:root {
  color-scheme: dark;
  --plane: #0d0d0d; --surface: #1a1a19; --surface-2: #222220; --surface-3: #2a2a28;
  --ink: #f0efec; --ink-2: #c3c2b7; --muted: #898781;
  --grid: #2c2c2a; --axis: #383835; --border: rgba(255,255,255,.10);
  --accent: #3987e5; --accent-soft: rgba(57,135,229,.14);
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
  /* A 股惯例：红涨绿跌。方向同时用符号和箭头表示，不只靠颜色 */
  --up: #e66767; --down: #0ca30c; --flat: #898781;
  --good: #0ca30c; --warn: #fab219; --crit: #d03b3b;
  --radius: 14px;
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--plane); color: var(--ink); font-size: 14px; line-height: 1.5; overflow: hidden; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.num { font-variant-numeric: tabular-nums; }

/* 背景光晕 */
.aurora { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.aurora i { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(110px); opacity: .20; }
.aurora i:nth-child(1) { background: #2a78d6; top: -30vmax; left: -12vmax; animation: drift 28s ease-in-out infinite alternate; }
.aurora i:nth-child(2) { background: #6250d6; top: -34vmax; right: -18vmax; opacity: .16; animation: drift 36s ease-in-out infinite alternate-reverse; }
.aurora i:nth-child(3) { background: #199e70; bottom: -44vmax; left: 30vmax; opacity: .09; animation: drift 44s ease-in-out infinite alternate; }
@keyframes drift { to { transform: translate3d(7vmax, 5vmax, 0) scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .aurora i, .fade-in, .spark path { animation: none !important; } }

/* 登录 */
.login { position: fixed; inset: 0; display: grid; place-items: center; z-index: 5; }
.login-card { width: min(360px, 90vw); padding: 36px 32px 28px; border-radius: 20px; background: rgba(26,26,25,.72);
  border: 1px solid var(--border); backdrop-filter: blur(22px); box-shadow: 0 30px 80px rgba(0,0,0,.5); text-align: center; }
.login-sub { color: var(--muted); margin: 6px 0 26px; }
.login-card input { width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--plane); outline: none; }
.login-card input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.login-card button { width: 100%; margin-top: 12px; padding: 12px; border: 0; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 600; cursor: pointer; }
.login-card button:hover { filter: brightness(1.1); }
.login-err { color: var(--up); min-height: 20px; margin: 12px 0 0; font-size: 13px; }

/* 框架 */
.shell { position: relative; z-index: 1; display: grid; grid-template-columns: 220px 1fr; height: 100%; }
.side { display: flex; flex-direction: column; padding: 20px 14px; border-right: 1px solid var(--border); background: rgba(13,13,13,.55); backdrop-filter: blur(18px); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .14em; padding: 4px 8px 22px; }
.brand.big { justify-content: center; font-size: 20px; padding: 0; }
.logo { width: 22px; height: 22px; border-radius: 7px; background: conic-gradient(from 210deg, #3987e5, #9085e9, #199e70, #3987e5); box-shadow: 0 0 22px rgba(57,135,229,.55); }
nav { display: flex; flex-direction: column; gap: 2px; }
.nav-group { margin: 18px 10px 6px; font-size: 11px; letter-spacing: .1em; color: var(--muted); }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; color: var(--ink-2); position: relative; }
.nav-item:hover { background: rgba(255,255,255,.05); color: var(--ink); }
.nav-item.active { background: var(--accent-soft); color: var(--ink); }
.nav-item.active::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.nav-item svg { flex: none; opacity: .85; }
.nav-item .tag { margin-left: auto; font-size: 10px; padding: 1px 6px; border-radius: 99px; border: 1px solid var(--border); color: var(--muted); }
.nav-item.locked { color: var(--muted); }
.side-foot { margin-top: auto; display: grid; gap: 10px; }
.side-status { font-size: 12px; color: var(--muted); padding: 0 8px; line-height: 1.7; }
.ghost { background: none; border: 1px solid var(--border); border-radius: 9px; padding: 7px 10px; color: var(--ink-2); cursor: pointer; }
.ghost:hover { background: rgba(255,255,255,.05); color: var(--ink); }

.main { display: flex; flex-direction: column; min-width: 0; height: 100%; }
.top { display: flex; align-items: center; gap: 16px; padding: 14px 28px; border-bottom: 1px solid var(--border); background: rgba(13,13,13,.4); backdrop-filter: blur(18px); }
.search { position: relative; display: flex; align-items: center; gap: 8px; flex: 0 1 460px; padding: 0 12px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: rgba(26,26,25,.7); color: var(--muted); }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: var(--ink); }
.search input::-webkit-search-cancel-button { display: none; }
kbd { font: inherit; font-size: 11px; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.search-pop { position: absolute; left: 0; right: 0; top: 44px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 6px; box-shadow: 0 24px 60px rgba(0,0,0,.6); z-index: 20; max-height: 60vh; overflow: auto; }
.pop-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; color: var(--ink); }
.pop-row.sel, .pop-row:hover { background: rgba(255,255,255,.07); }
.pop-row .code { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 84px; }
.pop-row .hint { margin-left: auto; color: var(--muted); font-size: 12px; }
.pop-empty { padding: 12px; color: var(--muted); }
.top-chips { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--border); color: var(--ink-2); font-size: 12px; white-space: nowrap; }
.chip b { color: var(--ink); font-weight: 600; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.good { background: var(--good); box-shadow: 0 0 8px var(--good); }
.dot.warn { background: var(--warn); }
.dot.crit { background: var(--crit); }
.dot.live { background: var(--accent); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

#view { flex: 1; overflow: auto; padding: 24px 28px 56px; outline: none; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 22px; font-weight: 650; }
.page-head .sub { color: var(--muted); }
.filters { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: rgba(26,26,25,.8); border: 1px solid var(--border); }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: 7px; color: var(--ink-2); cursor: pointer; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--surface-3); color: var(--ink); box-shadow: inset 0 0 0 1px var(--border); }
.filters .lab { color: var(--muted); font-size: 12px; }

.grid { display: grid; gap: 16px; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.c12 { grid-column: span 12; } .c8 { grid-column: span 8; } .c7 { grid-column: span 7; } .c6 { grid-column: span 6; } .c5 { grid-column: span 5; } .c4 { grid-column: span 4; } .c3 { grid-column: span 3; }
@media (max-width: 1180px) { .c8, .c7, .c6, .c5, .c4 { grid-column: span 12; } .c3 { grid-column: span 6; } }
@media (max-width: 760px) { .shell { grid-template-columns: 1fr; } .side { display: none; } #view { padding: 16px; } .top { padding: 12px 16px; } .top-chips { display: none; } .c3 { grid-column: span 12; } }

.card { position: relative; background: linear-gradient(180deg, rgba(34,34,32,.82), rgba(26,26,25,.82)); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; backdrop-filter: blur(14px); min-width: 0; }
.card.glow::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; background: radial-gradient(60% 80% at 0% 0%, rgba(57,135,229,.20), transparent 60%); mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000); }
.card-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.card-head h2 { margin: 0; font-size: 14px; font-weight: 600; }
.card-head .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.card-head .tools { margin-left: auto; display: flex; gap: 6px; }
.tool { border: 1px solid var(--border); background: none; border-radius: 7px; padding: 3px 9px; font-size: 12px; color: var(--ink-2); cursor: pointer; }
.tool:hover, .tool[aria-pressed="true"] { background: var(--surface-3); color: var(--ink); }
.fade-in { animation: fade .45s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } }

.chart { width: 100%; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; color: var(--ink-2); font-size: 12px; margin: 2px 0 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.key-line { width: 14px; height: 2px; border-radius: 2px; }
.key-box { width: 10px; height: 10px; border-radius: 3px; }
.key-hollow { width: 10px; height: 10px; border-radius: 2px; border: 1.5px solid var(--up); }

/* 数字 */
.hero-label { color: var(--ink-2); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.hero { font-size: 56px; font-weight: 650; letter-spacing: -.02em; line-height: 1.1; margin: 6px 0 4px; }
.delta { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-variant-numeric: tabular-nums; }
.delta.up { color: var(--up); } .delta.down { color: var(--down); } .delta.flat { color: var(--flat); }
.hero-row { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.hero-row .when { color: var(--muted); font-size: 12px; }

.tile { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center; padding: 14px 16px; border-radius: 12px; background: rgba(13,13,13,.45); border: 1px solid var(--border); transition: transform .15s ease, border-color .15s ease; }
a.tile:hover, button.tile:hover { transform: translateY(-2px); border-color: rgba(255,255,255,.22); }
.tile .lab { color: var(--ink-2); font-size: 12px; }
.tile .val { font-size: 20px; font-weight: 620; }
.tile .spark { grid-row: 1 / span 3; grid-column: 2; }
.tile .foot { color: var(--muted); font-size: 12px; white-space: nowrap; }
.tile .foot.stale { grid-column: 1 / -1; }
.tiles { display: grid; gap: 10px; }
.tiles.cols2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tiles.cols4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tiles.auto { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
@media (max-width: 760px) { .tiles.cols4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.spark path.line { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 400; stroke-dashoffset: 400; animation: draw 1.1s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.spark circle { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }

.stat { display: grid; gap: 2px; }
.stat .lab { color: var(--muted); font-size: 12px; }
.stat .val { font-size: 18px; font-weight: 620; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 14px 18px; }

/* 分段条 */
.segbar { display: flex; gap: 2px; height: 28px; margin: 4px 0 8px; }
.segbar div { border-radius: 4px; display: flex; align-items: center; padding: 0 8px; color: #fff; font-weight: 600; font-size: 12px; min-width: 0; overflow: visible; white-space: nowrap; }
.segbar .up { background: var(--up); } .segbar .down { background: var(--down); } .segbar .flat { background: #5c5b57; }

/* 进度条 */
.meter-row { display: grid; grid-template-columns: 84px 1fr auto; gap: 12px; align-items: center; padding: 7px 0; }
.meter-row .name { color: var(--ink-2); }
.meter { height: 8px; border-radius: 99px; background: #184f95; opacity: 1; overflow: hidden; position: relative; }
.meter.track { background: rgba(57,135,229,.18); }
.meter i { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: var(--accent); }
.meter i.gap { background: rgba(57,135,229,.0); }
.meter-row .fig { color: var(--ink-2); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* 表格 */
.tbl-wrap { overflow: auto; max-height: 420px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 8px 10px; text-align: right; border-bottom: 1px solid var(--grid); white-space: nowrap; font-variant-numeric: tabular-nums; }
th { color: var(--muted); font-weight: 500; font-size: 12px; position: sticky; top: 0; background: var(--surface-2); }
th:first-child, td:first-child, th.l, td.l { text-align: left; }
tbody tr:hover td { background: rgba(255,255,255,.03); }
tr.link { cursor: pointer; }
td .sub { color: var(--muted); margin-left: 8px; }

/* 提示框 */
.tip { position: fixed; z-index: 50; pointer-events: none; background: rgba(34,34,32,.96); border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; font-size: 12px; box-shadow: 0 14px 40px rgba(0,0,0,.55); max-width: 280px; }
.tt-head { color: var(--muted); margin-bottom: 5px; }
.tt-row { display: flex; align-items: center; gap: 8px; line-height: 1.75; }
.tt-row b { font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }
.tt-row span.n { color: var(--ink-2); }
.tt-row .v { margin-left: auto; padding-left: 16px; }

/* 状态 */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 2px 9px; border-radius: 99px; border: 1px solid var(--border); color: var(--ink-2); }
.status svg { flex: none; }
.check { display: grid; grid-template-columns: 92px 1fr auto; gap: 14px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--grid); }
.check:last-child { border-bottom: 0; }
.check .name { font-weight: 600; }
.check .desc { color: var(--muted); font-size: 12px; }
.check .figs { color: var(--ink-2); font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }
.check pre { margin: 8px 0 0; padding: 8px 10px; border-radius: 8px; background: var(--plane); color: var(--ink-2); font-size: 11.5px; overflow: auto; max-width: 100%; }

.note { color: var(--muted); font-size: 12px; margin-top: 10px; }
.note.warn { color: var(--ink-2); padding: 8px 12px; border-radius: 9px; border: 1px solid rgba(250,178,25,.35); background: rgba(250,178,25,.07); display: flex; gap: 8px; align-items: flex-start; }
.empty { padding: 48px 0; text-align: center; color: var(--muted); }
.title-row { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.title-row .px { font-size: 34px; font-weight: 650; letter-spacing: -.01em; }
.badge { font-size: 11px; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--border); color: var(--ink-2); }

/* 路线图 */
.road { display: grid; gap: 0; }
.road-item { display: grid; grid-template-columns: 28px 64px 1fr auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--grid); }
.road-item:last-child { border-bottom: 0; }
.road-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--axis); margin: 0 auto; }
.road-item.done .road-dot { background: var(--good); border-color: var(--good); box-shadow: 0 0 10px rgba(12,163,12,.6); }
.road-item.doing .road-dot { background: var(--accent); border-color: var(--accent); animation: pulse 1.6s ease-in-out infinite; }
.road-item .id { color: var(--muted); font-variant-numeric: tabular-nums; }
.road-item .t { font-weight: 600; }
.road-item .d { color: var(--muted); font-size: 12px; }
.road-item.todo .t { color: var(--ink-2); }
