/* RSI big-screen dashboard. A fixed 1920x1080 stage, scaled to the window by rsi-screen.js.
   Colours: one accent hue for data, greys for context, reserved status colours (always with an icon and a label).
   Accent and status colours were checked against the panel surface #0b1324 with the palette validator. */
:root{
  --page:#050a14;--surface:#0b1324;--line:#1c2b46;--grid:#1a2740;--axis:#2a3a58;
  --ink:#e8f1ff;--ink2:#9fb3cf;--muted:#7f93b0;
  --accent:#1fa3c8;--accent-dim:#2a7f99;--glow:#5fd4f5;
  --good:#0ca30c;--warn:#fab219;--bad:#d03b3b;
  --font:"Bahnschrift","DIN Alternate","Segoe UI","Microsoft YaHei",sans-serif;
  --mono:"Cascadia Code",Consolas,"Microsoft YaHei",monospace;
}
*{box-sizing:border-box}
html,body{margin:0;height:100%;background:var(--page);color:var(--ink);font-family:var(--font);overflow:hidden}
button,a{font:inherit}
.viewport{position:fixed;inset:0;display:grid;place-items:center;background:radial-gradient(ellipse at 50% 40%,#0e1f3d 0,#060c19 55%,#04070f 100%)}
.stage{position:absolute;left:50%;top:50%;width:1920px;height:1080px;flex:none;
  background-image:linear-gradient(rgba(31,163,200,.055) 1px,transparent 1px),linear-gradient(90deg,rgba(31,163,200,.055) 1px,transparent 1px);background-size:48px 48px}
#flow{position:absolute;inset:0;width:1920px;height:1080px;pointer-events:none}

/* top bar */
.top{position:absolute;left:24px;right:24px;top:0;height:84px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line)}
.top::after{content:"";position:absolute;left:0;bottom:-1px;width:420px;height:2px;background:linear-gradient(90deg,var(--accent),transparent)}
.brand{display:flex;align-items:center;gap:16px}
.mark{width:46px;height:46px;border-radius:10px;display:grid;place-items:center;font-size:24px;font-weight:700;color:#06111f;background:linear-gradient(135deg,#5fd4f5,#1fa3c8);box-shadow:0 0 24px rgba(31,163,200,.55)}
.brand strong{display:block;font-size:26px;letter-spacing:3px;font-weight:600}
.brand small{display:block;margin-top:4px;font-size:13.5px;color:var(--ink2);letter-spacing:.5px}
.top-right{display:flex;align-items:center;gap:14px}
.chip{display:inline-flex;align-items:center;gap:9px;padding:8px 14px;border:1px solid var(--line);border-radius:20px;font-size:15px;background:rgba(11,19,36,.8)}
.chip i{width:10px;height:10px;border-radius:50%;background:var(--muted)}
.chip.good i{background:var(--good);box-shadow:0 0 0 0 rgba(12,163,12,.7);animation:beat 1.6s infinite}
.chip.warn i{background:var(--warn)}
.chip.bad i{background:var(--bad)}
.clock{font-family:var(--mono);font-size:22px;color:var(--ink);letter-spacing:1px;min-width:118px;text-align:right}
.ghost{padding:8px 14px;border:1px solid var(--line);border-radius:7px;background:transparent;color:var(--ink2);font-size:14px;text-decoration:none;cursor:pointer}
.ghost:hover,.ghost:focus-visible{border-color:var(--accent);color:var(--ink);outline:none}

/* panels */
.panel{position:absolute;background:linear-gradient(180deg,rgba(14,26,49,.93),rgba(9,17,33,.93));border:1px solid var(--line);border-radius:10px;padding:16px 18px 14px;overflow:hidden}
.panel::before,.panel::after{content:"";position:absolute;width:18px;height:18px;border:2px solid var(--accent);opacity:.85}
.panel::before{left:-1px;top:-1px;border-right:0;border-bottom:0;border-top-left-radius:10px}
.panel::after{right:-1px;bottom:-1px;border-left:0;border-top:0;border-bottom-right-radius:10px}
.panel h2{margin:0;font-size:18px;font-weight:600;letter-spacing:1.5px}
.panel h2.second{margin-top:10px}
.panel .sub{margin:4px 0 12px;font-size:12.5px;color:var(--muted);line-height:1.5}
#p-ladder{left:24px;top:100px;width:480px;height:496px}
#p-solve{left:24px;top:612px;width:480px;height:344px}
#p-trend{left:1416px;top:100px;width:480px;height:540px}
#p-feed{left:1416px;top:656px;width:480px;height:300px}
.center{position:absolute;left:524px;top:100px;width:872px;height:856px}
#ring{height:690px}
svg{display:block;width:100%;height:auto;overflow:visible}
svg text{font-family:var(--font);fill:var(--ink2)}
.empty{padding:36px 8px;text-align:center;color:var(--muted);font-size:14px;line-height:1.8}

/* ladder */
.family{margin-bottom:11px}
.family-head{display:flex;align-items:baseline;gap:10px;margin-bottom:6px;font-size:15px}
.family-head b{font-weight:600;color:var(--ink)}
.tag{font-size:11.5px;color:var(--ink2);border:1px solid var(--axis);border-radius:4px;padding:1px 6px}
.family-head span:last-child{margin-left:auto;font-size:12.5px;color:var(--muted)}
.cell-track{fill:#0d1a31;stroke:var(--line);stroke-width:1}
.cell-fill{fill:var(--accent)}
.cell.mastered .cell-fill{opacity:.62}
.cell.frontier .cell-fill{opacity:.42}
.cell.next .cell-fill{opacity:.24}
.cell.frontier .cell-track{stroke:var(--glow);stroke-width:1.5;animation:pulse 1.8s ease-in-out infinite}
.cell.locked .cell-track{stroke-dasharray:3 3}
.cell-rate{font-size:14px;fill:var(--ink);font-weight:600}
.cell-state{font-size:10.5px;fill:var(--muted)}
.cell.mastered .cell-state{fill:var(--ink2)}

/* charts */
.grid-line{stroke:var(--grid);stroke-width:1}
.axis-line{stroke:var(--axis);stroke-width:1}
.tick{font-size:11.5px;fill:var(--muted)}
.row-label{font-size:13.5px;fill:var(--ink2)}
.value-label{font-size:12.5px;fill:var(--ink2);font-family:var(--mono)}
.link{stroke:var(--accent-dim);stroke-width:4;stroke-linecap:round}
.dot-first{fill:var(--surface);stroke:var(--accent-dim);stroke-width:2.5}
.dot-any{fill:var(--accent);stroke:var(--surface);stroke-width:2}
.series-line{fill:none;stroke:var(--accent);stroke-width:2;stroke-linejoin:round;stroke-linecap:round}
.series-area{fill:var(--accent);opacity:.1}
.mark-promoted{fill:var(--accent);stroke:var(--surface);stroke-width:2}
.mark-rejected{fill:var(--surface);stroke:var(--muted);stroke-width:2}
.mark-cross{stroke:var(--muted);stroke-width:1.6;stroke-linecap:round}
.mark-unlock{fill:var(--warn)}
.hit .hit-area{fill:transparent}
.hit .guide{stroke:var(--ink2);stroke-width:1;stroke-dasharray:3 3;opacity:0}
.hit:hover .guide{opacity:.7}
.end-label{font-size:13px;fill:var(--ink);font-weight:600;font-family:var(--mono)}
.legend{display:flex;gap:16px;align-items:center;margin:0 0 6px;font-size:12px;color:var(--ink2)}
.legend span{display:inline-flex;align-items:center;gap:6px}
.legend svg{width:16px;height:12px;flex:none}

/* ring */
.ring-track{fill:none;stroke:#13233f;stroke-width:10}
.ring-flow{fill:none;stroke:var(--accent);stroke-width:3;stroke-dasharray:6 22;stroke-linecap:round;opacity:.0}
.running .ring-flow{opacity:.9;animation:spin 14s linear infinite}
.ring-halo{fill:none;stroke:var(--accent);stroke-width:1;opacity:.25;stroke-dasharray:2 10}
.node circle{fill:#0c172c;stroke:var(--axis);stroke-width:2}
.node text.n{font-size:13px;fill:var(--muted);font-family:var(--mono)}
.node text.name{font-size:17px;fill:var(--ink2)}
.node.done circle{stroke:var(--accent)}
.node.done text.n{fill:var(--ink2)}
.node.live circle{fill:#103149;stroke:var(--glow);stroke-width:3;animation:pulse 1.2s ease-in-out infinite}
.node.live text.name{fill:var(--ink);font-weight:600}
.node.live text.n{fill:var(--ink)}
.hero-label{font-size:17px;fill:var(--ink2);letter-spacing:4px}
.hero{font-size:112px;fill:var(--ink);font-weight:600;letter-spacing:-2px}
.hero-unit{font-size:40px;fill:var(--ink2)}
.hero-sub{font-size:17px;fill:var(--ink2)}
.hero-champion{font-size:20px;fill:var(--ink);font-family:var(--mono);letter-spacing:1px}
.live-line{font-size:16px;fill:var(--ink2)}
.live-line.warn{fill:var(--warn);font-weight:600}
.live-line.bad{fill:var(--bad);font-weight:600}
.live-line.good{fill:var(--good);font-weight:600}
.live-sub{font-size:13px;fill:var(--muted)}
.progress-track{fill:#13233f}
.progress-fill{fill:var(--accent)}

/* KPI row */
.kpis{display:grid;grid-template-columns:repeat(5,1fr);gap:14px;height:150px;margin-top:16px}
.kpi{border:1px solid var(--line);border-radius:10px;background:linear-gradient(180deg,rgba(14,26,49,.93),rgba(9,17,33,.93));padding:14px 14px 10px;display:flex;flex-direction:column;justify-content:space-between;min-width:0}
.kpi span{font-size:13px;color:var(--ink2);letter-spacing:1px}
.kpi strong{font-size:38px;font-weight:600;line-height:1;white-space:nowrap}
.kpi strong small{font-size:16px;color:var(--ink2);font-weight:400;margin-left:4px}
.kpi em{font-style:normal;font-size:12px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.meter{height:6px;border-radius:3px;background:#13233f;position:relative;overflow:hidden;margin:2px 0}
.meter i{position:absolute;left:0;top:0;bottom:0;border-radius:3px;background:var(--accent)}
.meter b{position:absolute;top:-2px;bottom:-2px;width:2px;background:var(--ink2)}

/* feed */
.feed{list-style:none;margin:0;padding:0}
.feed li{display:grid;grid-template-columns:22px 52px 1fr;gap:8px;align-items:baseline;padding:7px 0;border-top:1px solid var(--grid);font-size:13.5px;color:var(--ink2);line-height:1.45}
.feed li:first-child{border-top:0}
.feed time{font-family:var(--mono);font-size:12px;color:var(--muted)}
.feed .icon{font-size:14px;text-align:center}
.icon.good{color:var(--good)}.icon.warn{color:var(--warn)}.icon.bad{color:var(--bad)}.icon.note{color:var(--glow)}
.feed li span:last-child{overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}

/* lineage */
.lineage{position:absolute;left:24px;right:24px;top:972px;height:92px;border:1px solid var(--line);border-radius:10px;background:rgba(9,17,33,.9);display:flex;align-items:center;gap:0;padding:0 20px;overflow:hidden}
.lineage h3{margin:0 22px 0 0;font-size:15px;font-weight:600;letter-spacing:2px;color:var(--ink2);white-space:nowrap}
.version{display:flex;flex-direction:column;align-items:center;gap:4px;padding:8px 14px;border:1px solid var(--axis);border-radius:8px;min-width:104px;background:#0c172c}
.version b{font-family:var(--mono);font-size:16px;font-weight:600}
.version small{font-size:12.5px;color:var(--ink2)}
.version.champion{border-color:var(--glow);box-shadow:0 0 18px rgba(95,212,245,.35)}
.version.champion small::before{content:"冠军 · "}
.arrow{flex:1;min-width:16px;max-width:60px;height:2px;background:linear-gradient(90deg,var(--axis),var(--accent));position:relative}
.arrow::after{content:"";position:absolute;right:-1px;top:-4px;border-left:7px solid var(--accent);border-top:5px solid transparent;border-bottom:5px solid transparent}

/* tooltip and table view */
.tip{position:absolute;z-index:20;max-width:320px;padding:9px 12px;border:1px solid var(--axis);border-radius:7px;background:#0a1222;color:var(--ink);font-size:13px;line-height:1.6;pointer-events:none;box-shadow:0 8px 24px rgba(0,0,0,.45)}
.tip[hidden]{display:none}
.sheet{position:fixed;inset:0;margin:auto;width:min(1560px,calc(100vw - 40px));height:min(900px,calc(100dvh - 40px));max-width:none;max-height:none;padding:0;border:1px solid #34445e;border-radius:14px;background:#101a2b;color:#e8f1ff;font-size:16px;box-shadow:0 24px 80px #0008}
.sheet[open]{display:flex;flex-direction:column}
.sheet::backdrop{background:rgba(2,7,16,.78)}
.sheet-head{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:20px 24px;border-bottom:1px solid #34445e}
.sheet-head h2{margin:0;font-size:24px;color:#f4f8ff}
.sheet-head p{margin:8px 0 0;font-size:14px;color:#b6c5da}
.sheet-head .ghost{font-size:16px;min-height:44px;padding:8px 18px;color:#e8f1ff;border-color:#536681}
.sheet-tools{display:flex;flex-wrap:wrap;justify-content:space-between;gap:12px;padding:14px 24px;font-size:14px;color:#b6c5da}
.sheet-tools label{display:flex;align-items:center;gap:8px;color:#e8f1ff;cursor:pointer}
.sheet-tools input{width:18px;height:18px;accent-color:#58cbb4}
.sheet-body{flex:1;min-height:0;overflow:auto;margin:0 16px 16px;scrollbar-color:#60738e #101a2b}
.sheet table{width:100%;min-width:1000px;border-collapse:separate;border-spacing:0;font-size:16px;font-variant-numeric:tabular-nums}
.sheet table.detailed{min-width:1520px}
.sheet th,.sheet td{text-align:right;white-space:nowrap;padding:14px 16px;border-bottom:1px solid #2b3b52;line-height:1.5}
.sheet th{position:sticky;top:0;z-index:2;background:#1d2c42;color:#d6e2f4;font-size:14px;font-weight:600}
.sheet td{background:#101a2b;color:#e8f1ff}
.sheet tr:nth-child(even) td{background:#142035}
.sheet tr:hover td{background:#20334d}
.sheet th:first-child,.sheet td:first-child{position:sticky;left:0;text-align:left;z-index:1}
.sheet th:first-child{z-index:3;background:#1d2c42}
.sheet th:nth-child(3),.sheet td:nth-child(3){text-align:left}
.sheet time{display:flex;flex-direction:column;gap:2px;font-size:15px}
.sheet time span:last-child{font-size:14px;color:#b6c5da}
.sheet .result{display:inline-block;padding:4px 10px;border-radius:6px;font-size:14px;background:#2a3649;color:#d6e2f4}
.sheet .result.promoted{background:#173d37;color:#9eebd2}
.sheet .gain-positive{color:#91e2c5}.sheet .gain-negative{color:#ffa7ad}
@media(max-width:600px){.sheet{width:calc(100vw - 16px);height:calc(100dvh - 16px)}.sheet-head{padding:16px}.sheet-head h2{font-size:22px}.sheet-tools{padding:12px 16px}.sheet-body{margin:0 8px 8px}}

@keyframes beat{0%{box-shadow:0 0 0 0 rgba(12,163,12,.7)}70%{box-shadow:0 0 0 10px rgba(12,163,12,0)}100%{box-shadow:0 0 0 0 rgba(12,163,12,0)}}
@keyframes pulse{0%,100%{opacity:1}50%{opacity:.45}}
@keyframes spin{to{stroke-dashoffset:-560}}
@media (prefers-reduced-motion:reduce){*{animation:none!important}}

#snapshot-time{font-size:12px;letter-spacing:0}#snapshot-time.stale{color:var(--warn)}
.sheet td:first-child{white-space:nowrap}
.sheet th:nth-child(4),.sheet td:nth-child(4){text-align:left}
.sheet table{min-width:1280px}.sheet table.detailed{min-width:1800px}
.family.compact{margin-bottom:6px}.family.compact .family-head{margin-bottom:3px;font-size:14px}
.kpi strong{overflow:hidden;text-overflow:ellipsis}.kpi strong.long{font-size:30px}
