/* AI 成绩单（/#ai-scorecard）。底子用经营数据共用的 mgmt.css（mg-app / mg-sec / mg-table / mg-how），这里只补那条线、动作表、两句话和右侧面板。
   颜色只用 tokens.css 变量（UI 门禁）；好坏色：bad 红 / warn 黄 / good 绿 / muted 灰。 */
[hidden] { display: none !important; }

.sc-h { margin: 12px 0 4px; font-size: 16px; }
.sc-h-note { color: var(--text-muted); font-size: 12px; }
.sc-err { border: 1px solid var(--warning-border); background: var(--warning-bg); color: var(--warning-fg); border-radius: var(--radius-md);
  padding: 8px 12px; font-size: 13px; }

/* ---------- 顶上那条线：一周一列，最新在最左 ---------- */
.sc-star { display: flex; gap: 20px; align-items: stretch; flex-wrap: wrap; }
.sc-kpi { flex: 0 0 210px; display: flex; flex-direction: column; gap: 6px; padding: 6px 0; }
.sc-kpi-v { font-size: 34px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sc-kpi-v small { font-size: 13px; font-weight: 400; color: var(--text-muted); margin-left: 6px; }
.sc-kpi-l { font-size: 13px; color: var(--text-secondary); }
.sc-kpi-d { font-size: 12px; color: var(--text-muted); line-height: 1.6; }
.sc-kpi-d b { font-weight: 600; }
.sc-up { color: var(--danger-fg); }
.sc-down { color: var(--success-fg); }
.sc-chart { flex: 1 1 420px; min-width: 0; }
.sc-chart svg { display: block; width: 100%; height: 190px; overflow: visible; }
.sc-col { cursor: pointer; }
.sc-col:hover .sc-bg { fill: var(--surface-hover); }
.sc-bg { fill: transparent; }
.sc-bar-r { fill: var(--chart-1); }
.sc-bar-r.partial { fill: var(--chart-seq-2); }
.sc-ref { stroke: var(--chart-zero); stroke-dasharray: 4 4; stroke-width: 1; }
.sc-ref-t { fill: var(--text-muted); font-size: 11px; }
.sc-t { fill: var(--text-primary); font-size: 12px; font-weight: 600; }
.sc-t2 { fill: var(--text-muted); font-size: 11px; }
.sc-axis { stroke: var(--chart-axis); stroke-width: 1; }
.sc-parts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; font-size: 12px; }

.sc-chip { border: 1px solid var(--border); border-radius: var(--radius-full); padding: 1px 9px; white-space: nowrap; background: var(--surface);
  color: var(--text-secondary); font-size: 12px; line-height: 18px; }
.sc-chip.bad { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger-fg); }
.sc-chip.warn { background: var(--warning-bg); border-color: var(--warning-border); color: var(--warning-fg); }
.sc-chip.good { background: var(--success-bg); border-color: var(--success-border); color: var(--success-fg); }
.sc-chip.muted { color: var(--text-muted); }
.sc-chip.info { background: var(--info-bg); border-color: var(--info-border); color: var(--info-fg); }

/* ---------- 动作表 ---------- */
.sc-wrap { overflow-x: auto; }
.sc-wrap.fits { overflow: visible; }
.sc-tbl { table-layout: fixed; min-width: 940px; }
.sc-tbl th { white-space: nowrap; position: sticky; top: 0; z-index: 2; }
.sc-tbl td { vertical-align: middle; height: 46px; }
.sc-tbl th:nth-child(1) { width: 150px; }
.sc-tbl th:nth-child(2) { width: 56px; }
.sc-tbl th:nth-child(3), .sc-tbl th:nth-child(4), .sc-tbl th:nth-child(5) { width: 92px; }
.sc-tbl th:nth-child(6) { width: 60px; }
.sc-tbl th:nth-child(7) { width: 100px; }
.sc-tbl th:nth-child(8) { width: 66px; }
.sc-tbl th:nth-child(9) { width: 120px; }
.sc-tbl th:nth-child(10) { width: 120px; }
.sc-tbl tbody tr { cursor: pointer; }
.sc-tbl tbody tr:hover td { background: var(--surface-hover); }
.sc-tbl tr.sel td { background: var(--surface-selected); }
.sc-name b { display: block; font-weight: 600; }
.sc-name small { display: block; color: var(--text-muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.sc-num small { color: var(--text-muted); font-size: 11px; margin-left: 3px; }
.sc-zero { color: var(--text-disabled); }
.sc-good { color: var(--success-fg); font-weight: 600; }
.sc-mixed { color: var(--warning-fg); font-weight: 600; }
.sc-bad { color: var(--danger-fg); font-weight: 600; }
.sc-rate { font-variant-numeric: tabular-nums; white-space: nowrap; }
.sc-rate small { display: block; color: var(--text-muted); font-size: 11px; }
.sc-strip { display: flex; gap: 3px; align-items: flex-end; height: 30px; }
.sc-strip i { flex: 1 1 0; min-width: 6px; max-width: 18px; background: var(--chart-seq-2); border-radius: 2px 2px 0 0; }
.sc-strip i.bad { background: var(--chart-negative); }
.sc-strip i.empty { background: var(--border-subtle); height: 2px !important; }
.sc-trend.better { color: var(--success-fg); }
.sc-trend.worse { color: var(--danger-fg); }
.sc-trend.same, .sc-trend.none { color: var(--text-muted); }

/* ---------- 页底两句 ---------- */
.sc-lessons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.sc-lesson { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px 14px; background: var(--surface); }
.sc-lesson h3 { margin: 0 0 4px; font-size: 13px; color: var(--text-secondary); }
.sc-lesson p { margin: 0; font-size: 14px; line-height: 1.7; }
.sc-lesson.good { border-color: var(--success-border); background: var(--success-bg); }
.sc-lesson.bad { border-color: var(--danger-border); background: var(--danger-bg); }

/* ---------- 右侧面板：盖在页面上；z 高过吸顶条和表头 ---------- */
.sc-panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(760px, 96vw); background: var(--surface); z-index: 30;
  border-left: 1px solid var(--border); box-shadow: var(--shadow-3); overflow-y: auto; }
.sc-ph { position: sticky; top: 0; z-index: 3; background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; }
.sc-ph-t { flex: 1 1 auto; min-width: 0; }
.sc-ph h2 { margin: 0; font-size: 17px; }
.sc-p-meta { color: var(--text-muted); font-size: 12px; margin-top: 2px; line-height: 1.6; }
.sc-x { flex: none; border: 0; background: transparent; font-size: 24px; line-height: 1; cursor: pointer; color: var(--text-muted); padding: 2px 6px; }
.sc-x:hover { color: var(--text-primary); }
.sc-pt { padding: 8px 16px 0; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 13px; }
.sc-pt select { height: 30px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text-primary); padding: 0 8px; font: inherit; font-size: 13px; }
.sc-pt .mg-seg button { padding: 4px 10px; }
.sc-btn { border: 1px solid var(--border-control); border-radius: 8px; background: var(--surface); color: var(--text-primary); padding: 4px 12px;
  font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.sc-btn:hover { border-color: var(--accent); color: var(--accent); }
.sc-btn.on { background: var(--accent); color: var(--text-on-accent); border-color: var(--accent); }
.sc-pb { padding: 10px 16px 40px; display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.sc-rule-box { border: 1px dashed var(--info-border); background: var(--info-bg); border-radius: var(--radius-md); padding: 6px 12px; color: var(--text-secondary); }
.sc-rule-box summary { cursor: pointer; font-size: 12px; }
.sc-rule-box p { margin: 4px 0; font-size: 12px; line-height: 1.6; }

.sc-item { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.sc-item-h { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 6px 10px; background: var(--surface-sunken); font-size: 12px; color: var(--text-secondary); }
.sc-item-h b { color: var(--text-primary); }
.sc-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sc-side { padding: 8px 10px; min-width: 0; }
.sc-side + .sc-side { border-left: 1px solid var(--border-subtle); }
.sc-side h4 { margin: 0 0 4px; font-size: 12px; color: var(--text-muted); font-weight: 600; }
.sc-side p { margin: 3px 0; line-height: 1.6; word-break: break-word; }
.sc-quote { color: var(--text-primary); }
.sc-meta { color: var(--text-muted); font-size: 12px; }
.sc-check { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 6px 10px; border-top: 1px dashed var(--border); background: var(--surface); }
.sc-check input { flex: 1 1 160px; min-width: 0; height: 28px; border: 1px solid var(--border); border-radius: 6px; padding: 0 8px; font: inherit; font-size: 12px; }

.sc-tasks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sc-tasks li { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 6px 10px; line-height: 1.6; }
.sc-tasks li b { font-weight: 600; }

@media (max-width: 640px) {
  .sc-kpi { flex-basis: 100%; }
  .sc-lessons { grid-template-columns: minmax(0, 1fr); }
  .sc-pair { grid-template-columns: minmax(0, 1fr); }
  .sc-side + .sc-side { border-left: 0; border-top: 1px solid var(--border-subtle); }
  .sc-check input { font-size: 16px; }
}
