/* 基础版式与组件：所有颜色走 CSS 变量，一套风格一个文件 */
:root {
  --top-h: 72px;
  --status-h: 26px;
  --gap: 10px;
  --panel-pad: 12px;
  --radius: 3px;
  --sans: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, sans-serif;
  --mono: "SF Mono", "JetBrains Mono", Consolas, "Roboto Mono", monospace;
  --num: "Bahnschrift", "DIN Alternate", "SF Mono", Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans);
  font-size: 13px; line-height: 1.5; overflow: hidden;
  background-image: var(--bg-img, none);
  background-size: cover; background-attachment: fixed;
}
a { color: inherit; text-decoration: none; }
button, select, input { font-family: inherit; }
button { cursor: pointer; }
#app {
  position: fixed; inset: 0; display: flex; flex-direction: column;
  min-width: 0; min-height: 0;
}
.view { flex: 1; min-height: 0; position: relative; overflow: hidden; }

/* ── 顶栏 ── */
.topbar {
  height: var(--top-h); flex: 0 0 var(--top-h);
  display: grid; grid-template-columns: minmax(220px, 1fr) minmax(0, 2.1fr) minmax(300px, 1fr);
  align-items: center; gap: 10px; padding: 0 16px; position: relative; z-index: 30;
  background: var(--top-bg); border-bottom: 1px solid var(--rule2);
}
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--top-line); opacity: .8; }
.top-left, .top-right { display: flex; align-items: center; gap: 14px; min-width: 0; }
.top-right { justify-content: flex-end; }
.clock { display: flex; flex-direction: column; line-height: 1.15; }
.clock span { color: var(--muted); font-size: 11px; letter-spacing: .04em; }
.clock b { font-family: var(--mono); font-size: 20px; color: var(--hi); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.weather { color: var(--ink2); font-size: 12px; display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.wx-ico { color: var(--rain); font-size: 14px; }
.top-center { text-align: center; min-width: 0; }
.top-center h1 {
  margin: 0; font-size: 27px; letter-spacing: .16em; color: var(--title); font-weight: 700;
  white-space: nowrap; text-shadow: var(--title-glow, none); line-height: 1.2;
}
.top-center .sub { margin: 2px 0 0; color: var(--muted); font-size: 11.5px; letter-spacing: .06em; white-space: nowrap; }
.top-center .sep { opacity: .5; }
.nav { display: flex; gap: 2px; background: var(--nav-bg); border: 1px solid var(--rule); border-radius: 2px; padding: 2px; }
.nav a {
  padding: 6px 12px; font-size: 13px; color: var(--ink2); border-radius: 1px; white-space: nowrap;
  transition: color .15s, background .15s;
}
.nav a:hover { color: var(--hi); background: var(--nav-hover); }
.nav a.on { color: var(--nav-on-ink); background: var(--nav-on); box-shadow: var(--nav-on-glow, none); }
.design-pick { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; }
.design-pick select {
  background: var(--panel); color: var(--ink); border: 1px solid var(--rule2); border-radius: 2px;
  padding: 4px 6px; font-size: 12px; outline: none;
}
/* ── 底栏 ── */
.statusbar {
  flex: 0 0 var(--status-h); height: var(--status-h); display: flex; align-items: center; gap: 16px;
  padding: 0 16px; background: var(--status-bg); border-top: 1px solid var(--rule);
  color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden;
}
.statusbar .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--good); box-shadow: 0 0 6px var(--good); }
.statusbar .sim { margin-left: auto; color: var(--muted); opacity: .85; }
.statusbar .ver { color: var(--muted); opacity: .7; }

/* ── 面板 ── */
.panel {
  position: relative; background: var(--panel); border: 1px solid var(--rule);
  border-radius: var(--radius); min-height: 0; min-width: 0; display: flex; flex-direction: column;
  box-shadow: var(--panel-shadow, none);
}
.panel::before, .panel::after {
  content: ""; position: absolute; width: 10px; height: 10px; pointer-events: none; opacity: var(--corner-op, 1);
  border-color: var(--corner); z-index: 2;
}
.panel::before { left: -1px; top: -1px; border-left: 2px solid; border-top: 2px solid; }
.panel::after { right: -1px; bottom: -1px; border-right: 2px solid; border-bottom: 2px solid; }
.p-head {
  flex: 0 0 32px; height: 32px; display: flex; align-items: center; gap: 8px; padding: 0 10px;
  border-bottom: 1px solid var(--rule); background: var(--head-bg);
}
.p-head .bar { width: 3px; height: 13px; background: var(--neon); box-shadow: var(--glow); }
.p-head h3 { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--hi); letter-spacing: .04em; white-space: nowrap; }
.p-head .en { margin-left: auto; font-family: var(--mono); font-size: 10px; color: var(--muted); letter-spacing: .12em; white-space: nowrap; }
.p-body { flex: 1; min-height: 0; padding: 8px 10px; position: relative; display: flex; flex-direction: column; }
.p-body.tight { padding: 4px 6px; }
.p-body.scroll { overflow: auto; }

/* ── 通用文字 ── */
.muted { color: var(--muted); }
.ink2 { color: var(--ink2); }
.num { font-family: var(--num); font-variant-numeric: tabular-nums; }
.tag { display: inline-block; padding: 1px 6px; border-radius: 2px; font-size: 10.5px; line-height: 16px; white-space: nowrap; }
.tag.high { color: var(--crit); background: var(--crit-bg); border: 1px solid var(--crit-line); }
.tag.mid { color: var(--warn); background: var(--warn-bg); border: 1px solid var(--warn-line); }
.tag.low { color: var(--good); background: var(--good-bg); border: 1px solid var(--good-line); }
.tag.info { color: var(--neon); background: var(--neon-bg); border: 1px solid var(--neon-line); }

/* ── 驾驶舱 ── */
.cockpit { height: 100%; padding: var(--gap); display: grid; grid-template-columns: minmax(0, 23fr) minmax(0, 53fr) minmax(0, 24fr); gap: var(--gap); min-height: 0; }
.col { display: flex; flex-direction: column; gap: var(--gap); min-height: 0; min-width: 0; }
.col > .panel { min-height: 0; }
.site-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.site-stat { background: var(--stat-bg); border: 1px solid var(--rule); border-left: 2px solid var(--neon); padding: 5px 8px; min-height: 43px; }
.site-stat b { display: block; font-family: var(--num); font-size: 19px; color: var(--hi); line-height: 1.15; font-variant-numeric: tabular-nums; }
.site-stat b small { font-size: 10.5px; color: var(--ink2); margin-left: 2px; font-family: var(--sans); }
.site-stat span { font-size: 10.5px; color: var(--muted); }
.site-note { margin-top: 5px; font-size: 10.5px; color: var(--muted); line-height: 1.45; }

.rank-list { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.rank-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) 46px; align-items: center; gap: 6px; padding: 0 2px; cursor: pointer; border-bottom: 1px solid var(--rule); }
.rank-row:hover { background: var(--hover); }
.rank-row .id { font-family: var(--mono); font-size: 12px; color: var(--ink); font-weight: 600; }
.rank-row .id i { color: var(--muted); font-style: normal; font-size: 10px; margin-right: 3px; }
.rank-bar { position: relative; height: 9px; background: var(--track); border-radius: 1px; overflow: hidden; }
.rank-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--neon); box-shadow: var(--glow); }
.rank-row.high .rank-bar i { background: var(--crit); box-shadow: none; }
.rank-row.mid .rank-bar i { background: var(--warn); box-shadow: none; }
.rank-row .val { text-align: right; font-family: var(--num); font-size: 12.5px; color: var(--hi); font-variant-numeric: tabular-nums; }
.rank-row .val em { font-style: normal; font-size: 10px; color: var(--muted); margin-left: 2px; }

.chart-box { flex: 1; min-height: 0; position: relative; }
.chart-box canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.chart-legend { display: flex; gap: 12px; align-items: center; font-size: 10.5px; color: var(--ink2); padding: 2px 0 0; flex-wrap: wrap; }
.chart-legend i { display: inline-block; width: 14px; height: 2px; margin-right: 4px; vertical-align: 2px; }
.chart-legend i.dash { background: repeating-linear-gradient(90deg, var(--crit) 0 4px, transparent 4px 7px); height: 1px; }

.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; flex: 0 0 74px; }
.kpi { position: relative; background: var(--kpi-bg); border: 1px solid var(--rule); border-top: 2px solid var(--neon); padding: 5px 10px 4px; overflow: hidden; min-width: 0; }
.kpi .lab { font-size: 11px; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .val { font-family: var(--num); font-size: 27px; line-height: 1.12; color: var(--hi); font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi .val small { font-size: 11px; color: var(--ink2); font-family: var(--sans); margin-left: 2px; }
.kpi .note { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.crit { border-top-color: var(--crit); }
.kpi.crit .val { color: var(--crit); }
.kpi.warn { border-top-color: var(--warn); }
.kpi.warn .val { color: var(--warn); }
.kpi.good { border-top-color: var(--good); }

.stage { position: relative; flex: 1; min-height: 0; background: var(--sky); border: 1px solid var(--rule); overflow: hidden; }
.stage canvas { display: block; width: 100%; height: 100%; }
.stage .ov { position: absolute; z-index: 5; pointer-events: none; }
.ov-tl { left: 10px; top: 8px; }
.ov-tr { right: 10px; top: 8px; pointer-events: auto; }
.ov-bl { left: 10px; bottom: 8px; }
.ov-br { right: 10px; bottom: 8px; text-align: right; }
.ov-bc { left: 50%; bottom: 8px; transform: translateX(-50%); max-width: 58%; }
.stage-title { font-size: 12px; color: var(--hi); letter-spacing: .06em; text-shadow: 0 1px 3px #0008; }
.stage-title small { color: var(--muted); font-size: 10px; letter-spacing: .02em; display: block; }
.layers { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.layers button {
  background: var(--chip-bg); border: 1px solid var(--rule2); color: var(--ink2); font-size: 10.5px;
  padding: 3px 7px; border-radius: 2px; backdrop-filter: blur(2px);
}
.layers button.on { color: var(--neon); border-color: var(--neon); background: var(--neon-bg); }
.judge { background: var(--judge-bg); border: 1px solid var(--rule2); padding: 4px 10px; font-size: 11.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.judge b { color: var(--crit); }
.scalebar { font-size: 10px; color: var(--ink2); text-shadow: 0 1px 3px #0008; }
.scalebar .bar { display: inline-block; width: 72px; height: 5px; border: 1px solid var(--ink2); border-top: none; margin: 0 5px; vertical-align: -1px; }
.north { display: inline-block; width: 20px; height: 20px; border: 1px solid var(--ink2); border-radius: 50%; position: relative; vertical-align: middle; margin-left: 6px; }
.north::before { content: "N"; position: absolute; left: 50%; top: 1px; transform: translateX(-50%); font-size: 8px; color: var(--ink2); }
.north::after { content: ""; position: absolute; left: 50%; top: 8px; width: 0; height: 0; border-left: 3px solid transparent; border-right: 3px solid transparent; border-bottom: 8px solid var(--ink2); transform: translateX(-50%); }
.lite-tip { font-size: 10px; color: var(--warn); background: var(--judge-bg); border: 1px solid var(--warn-line); padding: 3px 7px; }
.stage-ctrl { flex: 0 0 36px; display: flex; align-items: center; gap: 8px; padding: 0 2px; }
.stage-ctrl .hint { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.btn {
  background: var(--btn-bg); border: 1px solid var(--rule2); color: var(--ink2); font-size: 11.5px;
  padding: 4px 10px; border-radius: 2px; white-space: nowrap; transition: .15s;
}
.btn:hover { color: var(--hi); border-color: var(--neon); }
.btn.on { color: var(--neon); border-color: var(--neon); background: var(--neon-bg); }
.btn.primary { color: var(--btn-primary-ink, #03131a); background: var(--neon); border-color: var(--neon); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); color: var(--btn-primary-ink, #03131a); }
.spacer { flex: 1; }

.rings { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; align-items: start; }
.ring { text-align: center; min-width: 0; }
.ring svg { width: 100%; max-width: 62px; height: auto; }
.ring .rn { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ring .rv { font-family: var(--num); font-size: 11px; color: var(--hi); }

.alerts { display: flex; flex-direction: column; min-height: 0; overflow: auto; flex: 1; }
.alert-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) 42px; gap: 6px; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--rule); font-size: 11px; }
.alert-row .txt { color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alert-row .txt b { color: var(--ink); font-weight: 600; }
.alert-row .tm { color: var(--muted); font-family: var(--mono); font-size: 10px; text-align: right; white-space: nowrap; }

table.mini { width: 100%; border-collapse: collapse; font-size: 11px; }
table.mini th { color: var(--muted); font-weight: 500; text-align: left; padding: 4px 5px; background: var(--thead); border-bottom: 1px solid var(--rule); white-space: nowrap; }
table.mini td { padding: 4px 5px; border-bottom: 1px solid var(--rule); color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
table.mini td.n { font-family: var(--num); text-align: right; color: var(--hi); font-variant-numeric: tabular-nums; }
table.mini tr:last-child td { border-bottom: none; }

/* ── 二级页面 ── */
.page { height: 100%; display: flex; flex-direction: column; padding: var(--gap); gap: var(--gap); min-height: 0; }
.page-head { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.page-head .desc { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.page-head .btn { flex: 0 0 auto; }
.page-head h2 { margin: 0; font-size: 15px; color: var(--hi); letter-spacing: .06em; font-weight: 600; }
.page-head .desc { color: var(--muted); font-size: 11.5px; }
.page-head .spacer { flex: 1; }
.steps { display: flex; gap: 4px; overflow: hidden; }
.steps button {
  flex: 1; min-width: 0; background: var(--chip-bg); border: 1px solid var(--rule2); color: var(--ink2);
  padding: 5px 6px; font-size: 11px; border-radius: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.steps button.on { color: var(--neon); border-color: var(--neon); background: var(--neon-bg); }
.steps button.done { color: var(--good); border-color: var(--good-line); }
.stack2 { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 3fr); gap: var(--gap); flex: 1; min-height: 0; }
.stack3 { display: grid; grid-template-columns: minmax(0, 72fr) minmax(0, 28fr); gap: var(--gap); flex: 1; min-height: 0; }
.canvas-wrap { position: relative; flex: 1; min-height: 0; }
.canvas-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.side-stack { display: flex; flex-direction: column; gap: var(--gap); min-height: 0; }
.side-stack .panel { min-height: 0; }
.kv { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 4px 8px; font-size: 11.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--ink); }
.kv dd b { font-family: var(--num); font-size: 13px; color: var(--hi); }
.note-line { font-size: 10.5px; color: var(--muted); line-height: 1.55; }
.formula { font-family: var(--mono); font-size: 10.5px; color: var(--neon); background: var(--code-bg); border: 1px solid var(--rule); padding: 4px 6px; line-height: 1.6; word-break: break-all; }

.scen-row { display: flex; gap: 4px; }
.scen-row button {
  flex: 1; min-width: 0; background: var(--chip-bg); border: 1px solid var(--rule2); color: var(--ink2);
  padding: 4px 4px; font-size: 10.5px; border-radius: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.scen-row button.on { color: var(--neon); border-color: var(--neon); background: var(--neon-bg); }
.timeline { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: 4px 2px; }
.timeline input[type=range] { flex: 1; accent-color: var(--neon); height: 3px; }
.timeline .tval { font-family: var(--mono); font-size: 11px; color: var(--hi); min-width: 104px; text-align: right; }
.evo-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.metric-box { background: var(--stat-bg); border: 1px solid var(--rule); padding: 4px 7px; }
.metric-box span { font-size: 10px; color: var(--muted); display: block; white-space: nowrap; }
.metric-box b { font-family: var(--num); font-size: 17px; color: var(--hi); font-variant-numeric: tabular-nums; }
.metric-box b small { font-size: 10px; color: var(--ink2); font-family: var(--sans); font-weight: 400; }

/* ── 数据分析页 ── */
.data-grid { display: grid; grid-template-columns: minmax(0, 34fr) minmax(0, 66fr); gap: var(--gap); flex: 1; min-height: 0; }
.drop {
  border: 1px dashed var(--rule2); background: var(--drop-bg); padding: 12px; text-align: center;
  display: flex; flex-direction: column; justify-content: center; gap: 6px; min-height: 108px;
}
.drop.drag { border-color: var(--neon); background: var(--neon-bg); }
.drop b { color: var(--hi); font-size: 13px; }
.drop span { color: var(--muted); font-size: 10.5px; }
.drop .row { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.quality { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
.qbox { background: var(--stat-bg); border: 1px solid var(--rule); padding: 4px 6px; }
.qbox b { display: block; font-family: var(--num); font-size: 17px; color: var(--hi); }
.qbox span { font-size: 10px; color: var(--muted); white-space: nowrap; }
.summary-list { display: flex; flex-direction: column; gap: 5px; overflow: auto; min-height: 0; }
.summary-item { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 6px; align-items: start; font-size: 11.5px; color: var(--ink2); padding-bottom: 5px; border-bottom: 1px solid var(--rule); }
.summary-item .no { font-family: var(--mono); font-size: 10px; color: var(--neon); border: 1px solid var(--neon-line); text-align: center; line-height: 15px; height: 16px; }
.report { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.report-scroll { flex: 1; min-height: 0; overflow: auto; padding-right: 4px; }
.report h4 { margin: 10px 0 4px; font-size: 12.5px; color: var(--hi); border-left: 3px solid var(--neon); padding-left: 6px; }
.report h4:first-child { margin-top: 0; }
.report p { margin: 3px 0; font-size: 11px; color: var(--ink2); line-height: 1.65; }
.report .sec { margin-bottom: 4px; }
.report .sec-lead { color: var(--ink); font-size: 11px; }
.report .small { font-size: 10px; color: var(--muted); }
.report table { width: 100%; border-collapse: collapse; font-size: 10.5px; margin: 4px 0; }
.report th { background: var(--thead); color: var(--muted); font-weight: 500; padding: 4px 5px; border: 1px solid var(--rule); text-align: left; white-space: nowrap; }
.report td { padding: 4px 5px; border: 1px solid var(--rule); color: var(--ink2); white-space: nowrap; }
.report td.n { font-family: var(--num); text-align: right; color: var(--hi); }
.report .pill { padding: 0 5px; border-radius: 2px; font-size: 10px; }
.report .empty { color: var(--muted); font-size: 11px; padding: 16px 0; text-align: center; }

/* ── 手机 ── */
.mobile-tip { display: none; }
@media (max-width: 1099px), (max-height: 619px) {
  body { overflow: auto; }
  #app { position: static; min-height: 100vh; height: auto; }
  .topbar { grid-template-columns: 1fr; height: auto; padding: 8px 10px; gap: 6px; }
  .top-left { display: none; }
  .top-center h1 { font-size: 19px; letter-spacing: .08em; white-space: normal; }
  .top-center .sub { font-size: 10px; white-space: normal; }
  .top-right { justify-content: space-between; flex-wrap: wrap; }
  .nav a { padding: 5px 8px; font-size: 12px; }
  .cockpit { height: auto; grid-template-columns: 1fr; }
  .col { min-height: 0; }
  .col-center { min-height: 70vh; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); flex: none; }
  .kpi { min-height: 62px; }
  .stage { min-height: 44vh; height: 44vh; flex: none; }
  .statusbar { flex-wrap: wrap; height: auto; padding: 5px 10px; font-size: 10px; }
  .statusbar .sim { margin-left: 0; }
  .view { overflow: visible; }
  .page { height: auto; min-height: calc(100vh - 100px); }
  .stack2, .stack3, .data-grid { grid-template-columns: 1fr; }
  .stack2 .canvas-wrap, .stack3 .stage, .data-grid .panel { min-height: 44vh; }
  .stack3 .stage { height: 44vh; }
  .data-grid .report { min-height: 60vh; }
  .steps { flex-wrap: wrap; }
  .steps button { flex: 1 1 28%; }
  .scen-row { flex-wrap: wrap; }
  .scen-row button { flex: 1 1 30%; }
  .timeline { flex-wrap: wrap; }
  .timeline .tval { text-align: left; }
  .rings { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
  .top-center h1 { font-size: 17px; }
  .nav a { padding: 4px 6px; font-size: 11.5px; }
  .site-stats { grid-template-columns: 1fr 1fr; }
}

/* 滚动条 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--rule2); border-radius: 3px; }
::-webkit-scrollbar-track { background: transparent; }

/* 提示条 */
.toast {
  position: fixed; left: 50%; bottom: 44px; transform: translateX(-50%); z-index: 99;
  background: var(--panel); color: var(--ink); border: 1px solid var(--neon); padding: 8px 14px;
  font-size: 12px; box-shadow: var(--glow); max-width: 80vw;
}
.hidden { display: none !important; }

/* 三维标签 */
.scene-lbl {
  position: absolute; left: 0; top: 0; pointer-events: none; white-space: nowrap;
  font-size: 11px; line-height: 16px; padding: 1px 5px; border-radius: 2px;
  color: var(--ink); background: rgba(3,12,18,.72); border: 1px solid var(--rule2);
  font-variant-numeric: tabular-nums;
}
.scene-lbl i { font-style: normal; color: var(--ink2); font-size: 10px; margin-left: 2px; }
.scene-lbl em { display: block; font-style: normal; font-size: 10px; color: var(--crit); line-height: 13px; }
.scene-lbl.lc { border-color: var(--lc-soft); color: var(--lc); }
.scene-lbl.gw { border-color: var(--gw-soft); color: var(--gw); }
.scene-lbl.gw i { color: var(--gw); }
.scene-lbl.crit { border-color: var(--crit); color: var(--crit); background: rgba(30,6,8,.8); }
.scene-lbl.mon { border-color: var(--neon-line); color: var(--neon); }
.scene-lbl.plan { border-color: var(--good-line); color: var(--good); }
:root[data-design="light"] .scene-lbl { background: rgba(255,255,255,.9); color: #1c2b40; }
:root[data-design="light"] .scene-lbl.crit { background: #fff3f4; }

/* 智能体分工 */
.agent-row { display: flex; align-items: center; gap: 7px; padding: 5px 4px; border-bottom: 1px solid var(--rule); min-height: 0; flex: 1; }
.agent-row .no { font-family: var(--mono); font-size: 10px; color: var(--muted); width: 22px; flex: 0 0 22px; }
.agent-row b { display: block; font-size: 11px; color: var(--ink2); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agent-row span { display: block; font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agent-row em { margin-left: auto; font-style: normal; font-size: 10px; color: var(--muted); }
.agent-row.on { background: var(--neon-bg); border-left: 2px solid var(--neon); }
.agent-row.on b { color: var(--neon); }
.agent-row.on em { color: var(--neon); }
.summary-act { margin-top: 4px; padding: 6px 8px; background: var(--stat-bg); border: 1px solid var(--rule); font-size: 11px; color: var(--ink2); line-height: 1.55; }
.summary-act b { display: block; font-size: 11.5px; color: var(--warn); margin-bottom: 2px; }
.summary-act .muted { font-size: 10px; margin-top: 3px; }
.summary-act .toc { display: grid; grid-template-columns: 1fr 1fr; gap: 1px 8px; margin-top: 5px; padding-top: 4px; border-top: 1px solid var(--rule); }
.summary-act .toc b { grid-column: 1 / -1; color: var(--ink2); }
.summary-act .toc span { font-size: 10px; color: var(--muted); white-space: nowrap; }
.metric-list { display: flex; flex-direction: column; justify-content: space-between; flex: 1; min-height: 0; }
.metric-list > div { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; border-bottom: 1px solid var(--rule); padding: 1px 0; }
.metric-list span { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.metric-list b { font-family: var(--num); font-size: 16px; color: var(--hi); white-space: nowrap; }
.metric-list b small { font-size: 10px; color: var(--ink2); margin-left: 2px; font-family: var(--sans); font-weight: 400; }
.plan-scroll { flex: 1; min-height: 0; overflow: auto; }
@media (max-width: 1099px), (max-height: 619px) {
  .stage .ov-br { display: none; }
  .ov-bc { max-width: 82%; }
  .judge { white-space: normal; line-height: 1.4; }
}
.lead-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 8px; }
.lead-cards > div { background: var(--stat-bg); border: 1px solid var(--rule); border-left: 2px solid var(--crit); padding: 4px 8px; }
.lead-cards span { display: block; font-size: 10px; color: var(--muted); }
.lead-cards b { display: block; font-family: var(--num); font-size: 20px; color: var(--hi); line-height: 1.2; }
.lead-cards small { font-size: 10px; color: var(--ink2); margin-left: 2px; }
@media (max-width: 1099px), (max-height: 619px) {
  .stage .ov-tl { display: none; }
}

/* 系统流程：智能体分工面板（高处填实，矮处自动收紧） */
.agent-row .ag-main { flex: 1; min-width: 0; }
.agent-row .ag-meta { display: flex; gap: 8px; margin-top: 2px; }
.agent-row .ag-meta i { font-style: normal; font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agent-row .ag-track { height: 3px; background: var(--track); margin-top: 4px; overflow: hidden; }
.agent-row .ag-track i { display: block; height: 100%; background: var(--neon); opacity: .55; }
.agent-row.done .ag-track i { opacity: .28; }
#flAgents.compact .ag-meta, #flAgents.compact .ag-track { display: none; }
#flAgents.compact .agent-row { padding: 2px 4px; }
#flAgents.compact .ag-main > span { display: none; }
