/* Muse Relay V1.9.1 console（珍珠玻璃 UI） · 君莫笑 Relay 控制台
 * 珍珠玻璃（Pearl Glass）主题：取自 scaffold-master 的设计规范（DESIGN.md / styles/tokens.css）。
 * 柔和灰白画布 + 接近实色的阅读面 + 克制的玻璃浮层与细边线；
 * 蓝 = 选择与主操作，青柠 = 正常状态，红 = 危险；深色同语义、换材质。
 * 文件分层：令牌 → 基础/外壳/控件（V1.9.1 结构保留）→ 末尾「珍珠玻璃层」统一材质与仪器化读数。
 * 手写、无构建步骤；不引入外部字体与脚本，兼容严格 CSP。
 */

/* ------------------------------------------------------------ tokens */
:root {
  /* 场景面 */
  --bg: #f6f8f7;                 /* 画布 canvas */
  --surface: #fbfcfc;            /* 阅读面实色 surface-solid */
  --surface-2: #f4f7f6;          /* 次级面 / 表头 */
  --surface-3: #eaeeed;          /* 槽、轨道 */
  --line: rgba(46, 58, 62, .085);
  --line-2: rgba(46, 58, 62, .14);
  /* 字色：四档 */
  --ink: #101418;
  --ink-2: #2b3236;
  --body: #2f373b;
  --muted: #687276;              /* 次级正文，画布上对比 4.6:1 */
  --muted-2: #99a2a5;            /* 元信息 */
  /* 语义色 */
  --blue: #236de9;
  --blue-2: #1d61d5;
  --blue-bg: rgba(35, 109, 233, .1);
  --blue-line: rgba(35, 109, 233, .3);
  --lime: #82dd2d;
  --green: #3f7d12;              /* 承载文字的青柠（比 scaffold #58a021 加深以过 4.5:1） */
  --green-bg: rgba(130, 221, 45, .16);
  --amber: #7a5a16;              /* 分类色「沙」 */
  --amber-bg: #f6e7c4;
  --red: #d63a31;
  --red-bg: rgba(255, 90, 80, .11);
  --purple: #5b4597;             /* 分类色「丁香」 */
  --purple-bg: #e4dcf7;
  --grey-bg: rgba(46, 58, 62, .065);
  /* 环境光：两团极淡的静态漫射光（青柠 / 蓝） */
  --glow-a: rgba(130, 221, 45, .07);
  --glow-b: rgba(35, 109, 233, .055);
  --glow-c: transparent;
  /* 材质高度：接触阴影 + 环境阴影 */
  --shadow-sm: 0 1px 2px rgba(46, 58, 62, .05), 0 5px 14px rgba(46, 58, 62, .04);
  --shadow: 0 1px 3px rgba(46, 58, 62, .06), 0 12px 30px rgba(46, 58, 62, .055);
  --shadow-lg: 0 2px 6px rgba(46, 58, 62, .07), 0 22px 50px rgba(46, 58, 62, .08);
  --shadow-blue: 0 1px 2px rgba(20, 66, 148, .28), 0 8px 18px rgba(35, 109, 233, .24);
  --edge: inset 0 1px 0 rgba(255, 255, 255, .92);
  --glass-line: rgba(255, 255, 255, .88);
  --pill-bg: linear-gradient(145deg, rgba(255, 255, 255, .93), rgba(246, 251, 249, .62));
  --float-bg: rgba(246, 248, 247, .86);
  --rail-bg: rgba(250, 251, 250, .92);
  --surface-grad: linear-gradient(145deg, rgba(255, 255, 255, .97), rgba(249, 252, 251, .93));
  --hover-bg: rgba(46, 58, 62, .045);
  --input-bg: rgba(255, 255, 255, .78);
  --overlay: rgba(16, 20, 24, .26);
  --hatch: repeating-linear-gradient(135deg, rgba(46, 58, 62, .16) 0 1.5px, transparent 1.5px 6px);
  --plate-bg: rgba(21, 24, 26, .9);
  --plate-ink: #f2f5f4;
  --plate-soft: rgba(255, 255, 255, .56);
  /* 圆角：4px 一档（胶囊 999px 只给标签与徽标） */
  --r-xs: 8px;
  --r-sm: 12px;
  --r: 16px;
  --r-lg: 20px;
  --pill: 999px;
  /* 尺寸 */
  --side: 232px;
  --top: 64px;
  --control-h: 36px;
  --control-h-sm: 30px;
  --row-h: 48px;
  --cell: 15px;
  --font: "SF Pro Text", "SF Pro Display", "PingFang SC", -apple-system, BlinkMacSystemFont, "Noto Sans SC", "Noto Sans CJK SC", "Microsoft YaHei", "Segoe UI", "WenQuanYi Zen Hei", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #121517;
  --surface: #1b1f21;
  --surface-2: #202528;
  --surface-3: #272c2f;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .11);
  --ink: #eef2f1;
  --ink-2: #d6dedc;
  --body: #c4cdcf;
  --muted: #8d979a;
  --muted-2: #6c7679;
  --blue: #4c8dff;
  --blue-2: #6fa3ff;
  --blue-bg: rgba(76, 141, 255, .16);
  --blue-line: rgba(76, 141, 255, .42);
  --green: #9be35a;
  --green-bg: rgba(130, 221, 45, .16);
  --amber: #ecc779;
  --amber-bg: rgba(232, 190, 96, .16);
  --red: #ff7a71;
  --red-bg: rgba(255, 90, 80, .16);
  --purple: #bfaaf4;
  --purple-bg: rgba(160, 132, 236, .17);
  --grey-bg: rgba(255, 255, 255, .07);
  --glow-a: rgba(130, 221, 45, .05);
  --glow-b: rgba(76, 141, 255, .07);
  --glow-c: transparent;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3), 0 5px 14px rgba(0, 0, 0, .2);
  --shadow: 0 1px 3px rgba(0, 0, 0, .32), 0 12px 30px rgba(0, 0, 0, .28);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, .36), 0 22px 50px rgba(0, 0, 0, .42);
  --shadow-blue: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 18px rgba(76, 141, 255, .26);
  --edge: inset 0 1px 0 rgba(255, 255, 255, .06);
  --glass-line: rgba(255, 255, 255, .1);
  --pill-bg: linear-gradient(145deg, rgba(255, 255, 255, .11), rgba(255, 255, 255, .05));
  --float-bg: rgba(30, 34, 37, .9);
  --rail-bg: rgba(22, 26, 28, .94);
  --surface-grad: linear-gradient(145deg, rgba(29, 33, 36, .98), rgba(25, 29, 31, .96));
  --hover-bg: rgba(255, 255, 255, .05);
  --input-bg: rgba(255, 255, 255, .04);
  --overlay: rgba(0, 0, 0, .5);
  --hatch: repeating-linear-gradient(135deg, rgba(255, 255, 255, .12) 0 1.5px, transparent 1.5px 6px);
  --plate-bg: rgba(8, 10, 11, .78);
  color-scheme: dark;
}

/* ------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--body);
  font: 14px/1.55 var(--font); letter-spacing: -.005em; -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(42% 36% at 18% 4%, var(--glow-a), transparent 70%),
    radial-gradient(38% 34% at 88% 0%, var(--glow-b), transparent 70%),
    radial-gradient(30% 30% at 62% 100%, var(--glow-c), transparent 70%);
}
h1, h2, h3, b, strong { color: var(--ink); }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; opacity: .5; }
:focus-visible { outline: 3px solid var(--blue-line); outline-offset: 2px; border-radius: 8px; }
code, .mono { font-family: var(--mono); font-size: .92em; }
small { font-size: 12px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.pad { padding: 16px; }
[hidden] { display: none !important; }

.ico { display: inline-flex; width: 18px; height: 18px; flex: none; }
.ico svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ico.ok { color: var(--green); }

/* ------------------------------------------------------------ app shell */
.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
@media (min-width: 961px) { .app { background: linear-gradient(to right, color-mix(in srgb, var(--surface) 78%, transparent) calc(var(--side) - 1px), var(--line) calc(var(--side) - 1px), var(--line) var(--side), transparent var(--side)); } }
.main { min-width: 0; display: flex; flex-direction: column; }
.workspace { flex: 1; width: 100%; max-width: 1360px; margin: 0 auto; padding: 24px 32px 40px; display: flex; flex-direction: column; gap: 20px; outline: none; }

/* sidebar: header / scrollable nav / bottom never overlap (fixes the 900px-height overlap) */
.sidebar {
  position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; gap: 10px;
  padding: 18px 14px 14px; border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 78%, transparent); backdrop-filter: blur(18px); z-index: 30;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 10px; flex: none; }
.logo-wrap { display: inline-flex; width: 58px; height: 34px; flex: none; }
.logo { width: 100%; height: 100%; object-fit: contain; }
.logo-for-dark { display: none; }
[data-theme="dark"] .logo-for-light { display: none; }
[data-theme="dark"] .logo-for-dark { display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-text strong { font-size: 16px; font-weight: 800; letter-spacing: .02em; }
.brand-text small { color: var(--muted); font-weight: 600; font-size: 12px; white-space: nowrap; }
.nav-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin: 0 -6px; padding: 0 6px; scrollbar-width: thin; }
.nav-pill-box { display: flex; flex-direction: column; gap: 2px; padding: 6px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface-2); }
.nav-group { padding: 10px 10px 4px; font-size: 11px; font-weight: 700; color: var(--muted-2); letter-spacing: .06em; text-transform: uppercase; }
.nav-group:first-child { padding-top: 4px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px 0 12px;
  border-radius: var(--pill); color: var(--body); font-weight: 600; font-size: 13.5px; transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--surface-3); color: var(--ink); }
.nav-item.active { background: var(--blue-bg); color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue-line); }
.nav-item.active .ico { color: var(--blue); }
.nav-item span:not(.ico):not(.nav-badge) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-badge { min-width: 22px; height: 20px; padding: 0 7px; border-radius: var(--pill); display: inline-grid; place-items: center; font-size: 11.5px; font-weight: 700; background: var(--surface-3); color: var(--muted); }
.nav-item.active .nav-badge { background: var(--blue); color: #fff; }
.nav-badge.alert { background: var(--red); color: #fff; }
.sidebar-bottom { flex: none; display: flex; flex-direction: column; gap: 10px; }
.help-tile { border: 1px solid var(--line); border-radius: var(--r); background: linear-gradient(160deg, var(--blue-bg), var(--surface) 70%); padding: 8px; }
.help-toggle { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border-radius: var(--pill); font-weight: 700; color: var(--blue); font-size: 13px; }
.help-toggle span:not(.ico) { flex: 1; text-align: left; }
.help-body { padding: 2px 8px 8px; display: grid; gap: 8px; font-size: 12.5px; color: var(--muted); }
.help-tile.closed .help-body { display: none; }
.account { display: flex; align-items: center; gap: 10px; padding: 8px; border-top: 1px solid var(--line); padding-top: 12px; min-width: 0; }
.account > div { display: flex; flex-direction: column; min-width: 0; }
.account b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account small { color: var(--muted); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--blue-bg); color: var(--blue); font-weight: 800; font-size: 12px; }
/* short viewports: collapse the guide tile so the nav keeps room */
@media (max-height: 940px) {
  .help-tile .help-body { display: none; }
  .nav-item { height: 35px; }
  .nav-group { padding-top: 8px; }
}
@media (max-height: 640px) { .help-tile { display: none; } .account { display: none; } }

/* topbar */
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--top); display: flex; align-items: center; gap: 14px; padding: 0 24px 0 32px;
  background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line);
}
.crumbs { display: flex; align-items: center; gap: 6px; flex: none; min-width: 0; color: var(--muted); font-weight: 600; }
.crumbs strong { white-space: nowrap; }
.crumbs .ico { width: 14px; height: 14px; }
.menu-toggle { display: none !important; }
.search-pill {
  flex: 1 1 260px; max-width: 400px; min-width: 120px; height: 38px; margin-left: auto; display: flex; align-items: center; gap: 8px; padding: 0 8px 0 14px;
  border: 1px solid var(--line); border-radius: var(--pill); background: var(--surface); color: var(--muted); box-shadow: var(--shadow-sm);
}
.search-pill span:not(.ico) { flex: 1; text-align: left; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; }
kbd { font: 600 11px var(--mono); padding: 2px 7px; border-radius: 7px; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); }
.top-right { position: relative; display: flex; align-items: center; gap: 8px; flex: none; }
.live-badge { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border-radius: var(--pill); font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.live-badge i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted-2); }
.live-badge.live { color: var(--green); }
.live-badge.live i { background: var(--green); box-shadow: 0 0 0 0 rgba(5, 150, 105, .5); animation: pulse 2s infinite; }
.live-badge.connecting i, .live-badge.reconnecting i { background: var(--amber); }
.live-badge.reconnecting { color: var(--amber); }
.live-badge.polling i { background: var(--blue); }
.live-badge.polling { color: var(--blue); }
.live-badge.unauthorized i { background: var(--red); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(5, 150, 105, .45); } 70% { box-shadow: 0 0 0 7px rgba(5, 150, 105, 0); } 100% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0); } }
.tz-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: var(--pill); font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-3); white-space: nowrap; }
.tz-chip .ico { width: 14px; height: 14px; }
.tz-chip.small { height: 26px; }
.lang-switch, .seg {
  display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: var(--pill); background: var(--surface-3); border: 1px solid var(--line); flex: none;
}
.lang-switch > .ico { width: 15px; height: 15px; margin: 0 4px 0 6px; color: var(--muted); }
.lang-switch button, .seg button {
  height: 28px; padding: 0 11px; border-radius: var(--pill); font-size: 12.5px; font-weight: 600; color: var(--muted);
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; transition: background .15s, color .15s;
}
.lang-switch button:hover, .seg button:hover { color: var(--ink); }
.lang-switch button.on, .seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
[data-theme="dark"] .lang-switch button.on, [data-theme="dark"] .seg button.on { background: var(--line-2); }
.seg .ico { width: 15px; height: 15px; }
.topbar .theme-seg span:not(.ico) { display: none; }
.topbar .theme-seg button { padding: 0 8px; }
.icon-btn { position: relative; width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; color: var(--ink-2); border: 1px solid var(--line); background: var(--surface); flex: none; }
.icon-btn:hover { background: var(--surface-3); }
.icon-btn.small { width: 28px; height: 28px; }
.icon-btn.small .ico { width: 14px; height: 14px; }
.bell .count { position: absolute; top: -4px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--pill); background: var(--red); color: #fff; font-size: 10.5px; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--bg); }
.env-btn { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: var(--pill); font-weight: 700; font-size: 13px; white-space: nowrap; color: #fff; background: var(--blue); box-shadow: var(--shadow-blue); }
[data-theme="dark"] .env-btn:not(.live) { color: #0a0c11; }
.env-btn.live { background: var(--green-bg); color: var(--green); box-shadow: none; border: 1px solid color-mix(in srgb, var(--green) 30%, transparent); }

/* footer */
.footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px 32px 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; }
.foot-brand { display: flex; align-items: center; gap: 10px; }
.foot-brand .logo { width: 42px; height: 24px; }
.foot-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.foot-btn { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 13px; border-radius: var(--pill); border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: 12.5px; font-weight: 600; }
.foot-btn:hover { border-color: var(--line-2); }
.foot-btn .ico { width: 15px; height: 15px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--muted-2); }
.dot.green { background: var(--green); } .dot.amber { background: var(--amber); } .dot.red { background: var(--red); } .dot.grey { background: var(--muted-2); } .dot.blue { background: var(--blue); }

/* ------------------------------------------------------------ primitives */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 17px; border-radius: var(--pill);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 650; font-size: 13.5px; white-space: nowrap;
  box-shadow: var(--shadow-sm); transition: transform .12s, box-shadow .15s, background .15s, border-color .15s;
}
.btn:hover:not(:disabled) { border-color: var(--line-2); transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: none; }
.btn .ico { width: 16px; height: 16px; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: var(--shadow-blue); }
.btn.primary:hover:not(:disabled) { background: var(--blue-2); }
[data-theme="dark"] .btn.primary { color: #0a0c11; }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
[data-theme="dark"] .btn.danger { color: #0a0c11; }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.small { height: 31px; padding: 0 12px; font-size: 12.5px; }
.btn.small .ico { width: 14px; height: 14px; }
.btn.block { width: 100%; height: 44px; }
.btn.danger-text { color: var(--red); }
.link { display: inline-flex; align-items: center; gap: 5px; color: var(--blue); font-weight: 650; font-size: 13px; }
.link .ico { width: 14px; height: 14px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: var(--pill);
  font-size: 12px; font-weight: 650; white-space: nowrap; background: var(--grey-bg); color: var(--ink-2);
}
.chip.green { background: var(--green-bg); color: var(--green); }
.chip.amber { background: var(--amber-bg); color: var(--amber); }
.chip.red { background: var(--red-bg); color: var(--red); }
.chip.blue, .chip.t-clients, .chip.t-all { background: var(--blue-bg); color: var(--blue); }
.chip.purple, .chip.t-deploy { background: var(--purple-bg); color: var(--purple); }
.chip.grey { background: var(--grey-bg); color: var(--muted); }
.chip.t-keys { background: var(--amber-bg); color: var(--amber); }
.chip.t-routing { background: var(--green-bg); color: var(--green); }
.chip.t-debug { background: var(--red-bg); color: var(--red); }
.chip.mono { font-family: var(--mono); font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: .14em; color: var(--muted); text-transform: uppercase; margin-bottom: 6px; }
.eyebrow-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: var(--pill); background: var(--green-bg); color: var(--green); font-weight: 650; font-size: 12.5px; }
.eyebrow-chip .ico { width: 14px; height: 14px; }
.label { font-size: 12px; font-weight: 600; color: var(--muted); }

/* page header */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 30px; font-weight: 850; line-height: 1.15; }
.page-head p { margin-top: 6px; color: var(--muted); max-width: 680px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* panels */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px 22px; box-shadow: var(--shadow); min-width: 0; }
.panel.flat { padding: 16px; }
.panel.flat:has(> .route-cards), .panel.flat:has(> .empty) { background: none; border: 0; box-shadow: none; padding: 0; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.panel-head h2 { font-size: 17px; font-weight: 750; }
.panel-head p { margin-top: 3px; color: var(--muted); font-size: 13px; }
.panel-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grid-2-1 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; }
.grid-1-1 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.row-end { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.sub { display: block; color: var(--muted); }
.sub-h { font-size: 14px; font-weight: 750; margin: 20px 0 10px; }

/* notices */
.notice, .demo-banner { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--r); font-size: 13.5px; font-weight: 550; border: 1px solid transparent; }
.notice > span:not(.ico), .demo-banner > span:not(.ico) { flex: 1; }
.demo-banner { background: color-mix(in srgb, var(--blue-bg) 80%, var(--surface)); border-color: var(--blue-line); color: var(--ink-2); border-left: 4px solid var(--blue); }
.demo-banner > .ico { color: var(--blue); }
.notice.red { background: var(--red-bg); color: var(--red); }
.notice.amber { background: var(--amber-bg); color: var(--amber); }
.notice.blue { background: var(--blue-bg); color: var(--blue); }

/* stats */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.stat::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, var(--blue), #8b5cf6 60%, #34d399); opacity: .7; }
.stat-top { display: flex; align-items: center; gap: 10px; }
.stat-ico { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--blue-bg); color: var(--blue); }
.stat-ico.green { background: var(--green-bg); color: var(--green); }
.stat-ico.red { background: var(--red-bg); color: var(--red); }
.stat-ico.amber { background: var(--amber-bg); color: var(--amber); }
.stat-ico.purple { background: var(--purple-bg); color: var(--purple); }
.stat-value { font-size: 32px; font-weight: 850; color: var(--ink); letter-spacing: -.03em; margin-top: 12px; line-height: 1.1; }
.stat-value small { font-size: 14px; color: var(--muted); font-weight: 600; }
.stat-sub { margin-top: 4px; color: var(--muted); font-size: 12.5px; }

/* kv */
.kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.kv-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kv { display: flex; flex-direction: column; gap: 4px; padding: 11px 13px; border-radius: 13px; background: var(--surface-2); border: 1px solid var(--line); min-width: 0; }
.kv-value { color: var(--ink); font-weight: 700; overflow-wrap: anywhere; }
.kv-value.green, .kv-value.amber, .kv-value.red, .kv-value.blue,
.kv-grid.tags .kv-value { align-self: flex-start; display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: var(--pill); font-size: 12.5px; background: var(--grey-bg); }
.kv-value.green { background: var(--green-bg); color: var(--green); }
.kv-value.amber { background: var(--amber-bg); color: var(--amber); }
.kv-value.red { background: var(--red-bg); color: var(--red); }
.kv-value.blue { background: var(--blue-bg); color: var(--blue); }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }

/* meters */
.meter { display: grid; gap: 5px; margin: 4px 0 8px; }
.meter-top { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.meter-top b { font-size: 12.5px; }
.meter-top small { color: var(--muted); font-weight: 500; }
.bar { height: 7px; border-radius: var(--pill); background: var(--surface-3); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--blue); transition: width .4s; }
.bar.big { height: 10px; margin: 14px 0 10px; }
.meter.amber .bar i { background: var(--amber); }
.meter.red .bar i { background: var(--red); }
.weight-bar { height: 5px; border-radius: var(--pill); background: var(--surface-3); overflow: hidden; margin: 14px 0; }
.weight-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), #8b5cf6); }

/* tables */
.table-wrap { width: 100%; overflow-x: auto; border-radius: 14px; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.table th { text-align: left; font-size: 11.5px; font-weight: 700; color: var(--muted); letter-spacing: .04em; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); }
.table th:first-child { border-top-left-radius: 12px; } .table th:last-child { border-top-right-radius: 12px; }
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; color: var(--body); }
.table td b { display: block; font-weight: 700; }
.table td small { display: block; color: var(--muted); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table td.right, .table th.right { text-align: right; }
.table td.right .btn + .btn { margin-left: 6px; }
.req-row { cursor: pointer; }
.req-row.open td { background: var(--blue-bg); }
.req-detail td { background: var(--surface-2); }
.w-usage { min-width: 190px; }
.limits { white-space: nowrap; font-size: 12.5px; }
.table td .limits b { display: inline; }
.meter-top b { white-space: nowrap; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 4px 2px; color: var(--muted); font-size: 12.5px; flex-wrap: wrap; }
.pager > div { display: flex; gap: 6px; }

/* key ⋯ menu + mobile cards */
.menu-anchor { position: relative; display: inline-block; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 25; min-width: 180px; padding: 6px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); display: grid; gap: 2px; text-align: left; }
.menu button { display: flex; align-items: center; gap: 9px; height: 36px; padding: 0 12px; border-radius: 11px; font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.menu button:hover, .menu button:focus-visible { background: var(--surface-3); outline: none; }
.menu button.danger { color: var(--red); }
.menu .ico { width: 16px; height: 16px; }
.key-cards { display: none; }
.key-card { border: 1px solid var(--line); border-radius: var(--r); padding: 14px; background: var(--surface-2); display: grid; gap: 10px; }
.kc-head { display: flex; align-items: center; gap: 8px; }
.kc-head > div:first-child { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.kc-head small { color: var(--muted); }
.kc-meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; }
.kc-meta span { display: inline-flex; align-items: center; gap: 5px; }
.kc-meta .ico { width: 14px; height: 14px; }

/* forms */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.block { margin-bottom: 12px; }
.field.inline { flex-direction: row; align-items: center; gap: 8px; }
.field-label { font-weight: 650; font-size: 13px; color: var(--ink-2); }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=search], input:not([type]), select, textarea {
  height: 40px; padding: 0 13px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); min-width: 0;
}
select { padding-right: 30px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 17px, calc(100% - 11px) 17px; background-size: 5px 5px; background-repeat: no-repeat; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-bg); }
input[aria-invalid=true] { border-color: var(--red); }
.hint { color: var(--muted); }
.field-error { color: var(--red); min-height: 0; font-weight: 600; }
.field-error:empty { display: none; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; margin: 6px 0 12px; }
.check input { width: 16px; height: 16px; accent-color: var(--blue); }
.search-field { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: var(--pill); border: 1px solid var(--line-2); background: var(--surface); color: var(--muted); min-width: 220px; }
.search-field input { border: 0 !important; box-shadow: none !important; padding: 0; height: 100%; background: transparent; flex: 1; width: 100%; }
.search-field.grow { flex: 1 1 180px; min-width: 160px; }
.search-field.big { height: 52px; width: 100%; max-width: 640px; padding: 0 20px; margin-top: 20px; font-size: 15px; box-shadow: var(--shadow-sm); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 14px; }
.filters .field select, .filters .field input { height: 38px; }
.filters .field { flex: 0 1 132px; min-width: 0; }
.filters .field input[type=date] { padding: 0 8px; }
.filters > .btn { flex: none; white-space: nowrap; }
/* V1.9.1: at desktop widths the request filters stay on one row, "Clear" included. */
@media (min-width: 1200px) {
  .filters:not(.report-form) { flex-wrap: nowrap; }
  .filters:not(.report-form) .search-field.grow { flex: 1 1 150px; min-width: 120px; }
  .filters:not(.report-form) .field { flex: 1 1 104px; }
  .filters:not(.report-form) .field input[type=date] { min-width: 0; width: 100%; }
}
/* V1.9.1 cost report & budgets */
.report-form { align-items: flex-end; }
.report-form .group-by { border: 0; padding: 0; margin: 0; flex: 0 0 auto; }
.report-form .group-by .seg { display: inline-flex; }
.seg-check { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: var(--pill); font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.seg-check input { margin: 0; accent-color: var(--blue); }
.seg-check:has(input:checked) { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
[data-theme="dark"] .seg-check:has(input:checked) { background: var(--line-2); }
.report-actions { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.report-table tfoot td { border-top: 1px solid var(--line-2); padding: 10px 12px; background: var(--surface-2); }
.budget-meters { margin-top: 4px; padding-top: 8px; border-top: 1px dashed var(--line-2); }
.small-note { font-size: 12.5px; margin-top: 10px; }
.chip .ico { width: 12px; height: 12px; margin-right: 3px; vertical-align: -2px; }
.input-ico { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); border-radius: 12px; padding: 0 12px; background: var(--surface); color: var(--muted); }
.input-ico input { border: 0 !important; box-shadow: none !important; flex: 1; padding: 0; }
.input-ico:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-bg); }
.setting-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.setting-row:last-child { border-bottom: 0; }
.setting-row > div:first-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 220px; }
.setting-row small { color: var(--muted); }
.toggle { width: 44px; height: 26px; border-radius: var(--pill); background: var(--line-2); position: relative; transition: background .2s; flex: none; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.toggle.on { background: var(--blue); }
.toggle.on::after { transform: translateX(18px); }

/* empty states */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 34px 20px; border: 1px dashed var(--line-2); border-radius: var(--r); background: var(--surface-2); }
.empty-ico { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; background: var(--blue-bg); color: var(--blue); margin-bottom: 6px; }
.empty-ico .ico { width: 22px; height: 22px; }
.empty b { font-size: 15px; }
.empty p { color: var(--muted); max-width: 440px; font-size: 13px; }
.empty-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; justify-content: center; }

/* skeletons */
.skeleton { height: 64px; border-radius: 14px; margin-bottom: 10px; background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 50%, var(--surface-3) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
.skeleton.tall { height: 150px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* code */
pre.code { margin: 0; padding: 16px 18px; border-radius: 16px; background: #0f1420; color: #dbe4ff; overflow-x: auto; font: 12.5px/1.6 var(--mono); border: 1px solid #1e2636; }
[data-theme="dark"] pre.code { background: #080a0f; }
.code-tabs { margin-bottom: 12px; }

/* ------------------------------------------------------------ dashboard */
.chart { width: 100%; height: auto; display: block; }
.chart .bar-ok { fill: var(--blue); opacity: .85; }
.chart .bar-err { fill: var(--red); }
.chart text { fill: var(--muted); font-size: 11px; }
.chart .axis { stroke: var(--line-2); }
.mini-timer { display: flex; flex-direction: column; gap: 4px; padding: 6px 0 12px; }
.mini-timer b { font-size: 30px; font-weight: 850; letter-spacing: -.03em; }
.mini-timer span { color: var(--muted); font-size: 13px; }
.mini-inc { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.mini-inc small { color: var(--muted); }
.mini-inc + .link, .mini-timer + .link { margin-top: 10px; }
.route-mini, .recent { display: grid; gap: 4px; }
.rm-row, .recent-row { display: grid; align-items: center; gap: 10px; padding: 10px 8px; border-radius: 12px; }
.rm-row { grid-template-columns: auto minmax(0, 1fr) auto auto; }
.recent-row { grid-template-columns: 110px minmax(0, 1fr) auto auto; }
.recent-row:hover, .rm-row:hover { background: var(--surface-2); }
.rm-row .mono, .recent-row span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-row small { color: var(--muted); white-space: nowrap; }

/* heatmap */
.heatmap { overflow-x: auto; padding-bottom: 4px; }
.hm-months { display: grid; grid-template-columns: repeat(var(--weeks), calc(var(--cell) + 3px)); margin-left: 26px; font-size: 11px; color: var(--muted); height: 16px; }
.hm-months span { white-space: nowrap; }
.hm-body { display: flex; gap: 6px; }
.hm-dows { display: grid; grid-template-rows: repeat(7, var(--cell)); gap: 3px; width: 20px; font-size: 10.5px; color: var(--muted); line-height: var(--cell); }
.hm-grid { display: flex; gap: 3px; }
.hm-col { display: grid; grid-template-rows: repeat(7, var(--cell)); gap: 3px; }
.hm-cell { display: inline-block; width: var(--cell); height: var(--cell); border-radius: 4px; background: var(--surface-3); border: 0; padding: 0; transition: transform .12s; }
button.hm-cell:not(:disabled):hover { transform: scale(1.25); }
.hm-cell.pad { background: transparent; }
.hm-cell.lv0 { background: var(--surface-3); }
.hm-cell.lv1 { background: color-mix(in srgb, var(--blue) 25%, var(--surface-3)); }
.hm-cell.lv2 { background: color-mix(in srgb, var(--blue) 48%, var(--surface-3)); }
.hm-cell.lv3 { background: color-mix(in srgb, var(--blue) 72%, var(--surface-3)); }
.hm-cell.lv4 { background: var(--blue); }
.hm-cell { position: relative; }
.hm-cell.err-lo::after { content: ""; position: absolute; right: 1px; top: 1px; width: 5px; height: 5px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 1px var(--surface); }
.hm-cell.err-hi { box-shadow: inset 0 0 0 2px var(--red); }
.hm-cell.is-today { outline: 2px solid var(--ink); outline-offset: 1px; }
.hm-cell.is-selected { outline: 2px solid var(--blue); outline-offset: 2px; }
.hm-cell.is-future { background: transparent; border: 1px dashed var(--line-2); }
.hm-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; font-size: 12px; color: var(--muted); }
.hm-legend { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.hm-legend .hm-cell { width: 11px; height: 11px; }
.hm-legend .hm-cell.err-lo, .hm-legend .hm-cell.err-hi { margin-left: 8px; }

/* probes */
.probe-note { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; color: var(--muted); font-size: 12.5px; }
.probe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.probe-tile { display: flex; flex-direction: column; gap: 3px; padding: 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface-2); border-top: 3px solid var(--muted-2); min-width: 0; }
.probe-tile.green { border-top-color: var(--green); }
.probe-tile.amber { border-top-color: var(--amber); }
.probe-tile.red { border-top-color: var(--red); }
.probe-top { display: flex; align-items: center; gap: 8px; }
.probe-top b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.probe-state { font-weight: 700; font-size: 12.5px; color: var(--ink-2); }
.probe-tile.green .probe-state { color: var(--green); }
.probe-tile.amber .probe-state { color: var(--amber); }
.probe-tile.red .probe-state { color: var(--red); }
.probe-tile small { color: var(--muted); overflow-wrap: anywhere; }

/* route + project cards */
.route-cards, .project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.route-card, .project-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.rc-head, .pc-head { display: flex; align-items: center; gap: 12px; }
.rc-head > div, .pc-head > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rc-head .mono, .pc-head small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-logo { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; font-weight: 850; color: #fff; background: linear-gradient(135deg, var(--blue), #8b5cf6); flex: none; }
.rc-props { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.rc-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.project-card { display: flex; flex-direction: column; gap: 8px; }
.project-card.paused { opacity: .82; }
.pc-head { margin-bottom: 6px; }
.pc-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.pc-foot > div { display: flex; gap: 6px; flex-wrap: wrap; }

/* lists */
.alert-list { list-style: none; margin: 0; padding: 0; display: grid; }
.alert-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.alert-list li:last-child { border-bottom: 0; }
.alert-list li span:not(.chip) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.alert-list li small { color: var(--muted); white-space: nowrap; }
.alert-list li.unread { background: linear-gradient(90deg, var(--blue-bg), transparent 60%); border-radius: 10px; }
.scenarios { display: grid; gap: 8px; }
.scenario { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; }
.scenario span { display: flex; flex-direction: column; }
.scenario small { color: var(--muted); }
.scenario input { accent-color: var(--blue); width: 16px; height: 16px; }

/* ------------------------------------------------------------ incident radar */
.radar-top { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.timer-card, .avg-card, .pills-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.big-timer { font-size: 46px; font-weight: 900; letter-spacing: -.04em; color: var(--ink); line-height: 1.05; font-variant-numeric: tabular-nums; }
.timer-card p, .avg-card p { color: var(--muted); font-size: 13px; }
.timer-card .btn { margin-top: 8px; }
.avg-value { font-size: 32px; font-weight: 850; color: var(--ink); letter-spacing: -.03em; }
.avg-card .bar { width: 100%; }
.kind-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.kind-pill { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 6px 0 13px; border-radius: var(--pill); border: 1px solid var(--line); background: var(--surface-2); font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.kind-pill b { min-width: 22px; height: 22px; padding: 0 7px; border-radius: var(--pill); background: var(--blue); color: #fff; display: grid; place-items: center; font-size: 11.5px; }
[data-theme="dark"] .kind-pill b { color: #0a0c11; }
.kind-pill.zero { opacity: .6; }
.kind-pill.zero b { background: var(--surface-3); color: var(--muted); }
.timeline { list-style: none; margin: 0; padding: 0 0 0 6px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 11px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--blue), var(--line)); border-radius: 2px; }
.tl-item { position: relative; display: flex; gap: 16px; padding: 8px 0; }
.tl-dot { width: 12px; height: 12px; border-radius: 50%; margin-top: 10px; flex: none; background: var(--surface); border: 3px solid var(--blue); z-index: 1; }
.tl-item.sev-critical .tl-dot { border-color: var(--red); }
.tl-item.sev-warning .tl-dot { border-color: var(--amber); }
.tl-body { flex: 1; min-width: 0; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); }
.tl-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tl-top time { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.tl-body p { margin-top: 6px; font-size: 13px; }
.more-row { display: flex; justify-content: center; margin-top: 14px; }

/* ------------------------------------------------------------ help center */
.help-hero { text-align: left; padding: 30px 32px; background: radial-gradient(60% 120% at 100% 0%, var(--blue-bg), transparent 70%), var(--surface); }
.help-hero h1 { font-size: 32px; font-weight: 850; }
.help-hero p { color: var(--muted); margin-top: 6px; }
.topic-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.topic { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 16px; text-align: left; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-sm); min-width: 0; }
.topic b { font-size: 14px; margin-top: 8px; }
.topic small { color: var(--muted); }
.topic.on { background: var(--blue-bg); border-color: var(--blue-line); }
.topic-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-2); }
.topic-ico.t-all, .topic.on .topic-ico.t-all { background: var(--blue); color: #fff; }
.topic-ico.t-clients { background: var(--blue-bg); color: var(--blue); }
.topic-ico.t-keys { background: var(--amber-bg); color: var(--amber); }
.topic-ico.t-routing { background: var(--green-bg); color: var(--green); }
.topic-ico.t-debug { background: var(--red-bg); color: var(--red); }
.topic-ico.t-deploy { background: var(--purple-bg); color: var(--purple); }
.topic-count { position: absolute; top: 14px; right: 14px; min-width: 24px; height: 22px; padding: 0 8px; border-radius: var(--pill); background: var(--surface-3); color: var(--muted); font-size: 11.5px; font-weight: 700; display: grid; place-items: center; }
.topic.on .topic-count { background: var(--blue); color: #fff; }
.faq { display: grid; gap: 8px; }
.faq-item { border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.faq-item summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 13px 14px; cursor: pointer; font-weight: 650; color: var(--ink); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary > span:not(.chip) { flex: 1; min-width: 0; }
.faq-item p { padding: 0 14px 14px; color: var(--body); font-size: 13px; }
.pm { width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line-2); position: relative; flex: none; }
.pm::before, .pm::after { content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 2px; background: var(--muted); transform: translate(-50%, -50%); border-radius: 2px; }
.pm::after { transform: translate(-50%, -50%) rotate(90deg); transition: transform .2s; }
.faq-item[open] .pm::after { transform: translate(-50%, -50%) rotate(0); }

/* ------------------------------------------------------------ key self-service */
.self-hero { text-align: center; padding: 18px 0 4px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.self-hero h1 { font-size: 34px; font-weight: 850; }
.self-hero p { color: var(--muted); }
.receipt { width: 52px; height: 52px; border-radius: 17px; display: grid; place-items: center; background: var(--blue-bg); color: var(--blue); }
.receipt .ico { width: 24px; height: 24px; }
.self-cards { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: var(--pill); background: var(--surface-3); margin-bottom: 18px; }
.tabs button { height: 36px; border-radius: var(--pill); font-weight: 650; color: var(--muted); }
.tabs button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
[data-theme="dark"] .tabs button.on { background: var(--line-2); }
.self-form h2 { font-size: 18px; font-weight: 750; }
.self-form > p { color: var(--muted); font-size: 13px; margin: 4px 0 14px; }
.self-form .input-ico input { height: 42px; }
.self-form .notice { margin-top: 12px; }
.self-foot { display: flex; align-items: center; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.self-foot > span:not(.ico) { flex: 1; }
.self-foot .ico { width: 15px; height: 15px; }
.self-foot .link { font-size: 12.5px; }
.self-help h3 { display: flex; align-items: center; gap: 8px; font-size: 16px; margin-bottom: 12px; }
.self-help .link { margin-top: 14px; }
.self-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.mini-bars { display: flex; align-items: flex-end; gap: 6px; height: 110px; padding: 8px 0 0; }
.mini-bars span { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.mini-bars i { width: 100%; max-width: 26px; border-radius: 6px 6px 3px 3px; background: var(--blue); display: block; }
.mini-bars i.err { background: var(--red); }
.mini-bars small { color: var(--muted); font-size: 10.5px; }
.standalone { min-height: 100vh; display: flex; flex-direction: column; }
.std-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 28px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(16px); flex-wrap: wrap; }
.std-main { max-width: 1120px; }

/* ------------------------------------------------------------ overlays */
.modal-wrap { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(10, 14, 24, .42); backdrop-filter: blur(4px); animation: fade .16s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(520px, 100%); max-height: calc(100vh - 40px); overflow: auto; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); animation: pop .18s; }
.modal.wide { width: min(760px, 100%); }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 22px 8px; }
.modal-head h2 { font-size: 18px; }
.modal-body { padding: 10px 22px; }
.modal-body > p { margin-bottom: 12px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 22px 20px; }
.impact { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.impact li { display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border-radius: 13px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13.5px; color: var(--ink-2); }
.impact li .ico { color: var(--amber); margin-top: 1px; }
.token-box { display: flex; align-items: center; gap: 10px; padding: 12px; margin: 14px 0 10px; border-radius: 14px; border: 1px dashed var(--line-2); background: var(--surface-2); }
.token-box code { flex: 1; min-width: 0; overflow-wrap: anywhere; color: var(--ink); }
.form-error { margin-top: 8px; }
.palette-wrap { place-items: start center; padding-top: 12vh; }
.palette { width: min(640px, 100%); border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .16s; }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 0 16px; height: 56px; border-bottom: 1px solid var(--line); color: var(--muted); }
.palette-input input { flex: 1; border: 0 !important; box-shadow: none !important; height: 100%; font-size: 15px; background: transparent; padding: 0; }
#paletteList { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow: auto; }
#paletteList li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; cursor: pointer; color: var(--ink-2); font-size: 13.5px; }
#paletteList li span:not(.ico) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#paletteList li small { color: var(--muted); font-family: var(--mono); }
#paletteList li em { font-style: normal; font-size: 11px; color: var(--muted); padding: 2px 8px; border-radius: var(--pill); background: var(--surface-3); }
#paletteList li.on { background: var(--blue-bg); color: var(--blue); }
#paletteList li.none { justify-content: center; color: var(--muted); cursor: default; }
.palette-foot { padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); background: var(--surface-2); }
.bell-pop { position: absolute; right: 0; top: calc(100% + 12px); width: 380px; max-width: calc(100vw - 24px); z-index: 40; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .15s; }
.bp-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.bell-pop ul { list-style: none; margin: 0; padding: 6px; max-height: 360px; overflow: auto; }
.bell-pop li button { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 9px 8px; border-radius: 11px; text-align: left; font-size: 12.5px; }
.bell-pop li button:hover { background: var(--surface-2); }
.bell-pop li button span:not(.chip) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bell-pop li small { color: var(--muted); white-space: nowrap; }
.bell-pop li.unread button { background: var(--blue-bg); }
.bp-foot { display: flex; justify-content: space-between; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 12.5px; font-weight: 650; color: var(--blue); }
.bp-foot a { display: inline-flex; align-items: center; gap: 4px; }
.bp-foot .ico { width: 14px; height: 14px; }
#toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: grid; gap: 8px; justify-items: end; }
.toast { display: flex; align-items: center; gap: 9px; max-width: 420px; padding: 11px 16px; border-radius: var(--pill); background: var(--ink); color: var(--bg); font-size: 13px; font-weight: 600; box-shadow: var(--shadow-lg); animation: toastin .2s; transition: opacity .3s, transform .3s; }
.toast .ico { color: #34d399; }
.toast.red .ico { color: #f87171; } .toast.amber .ico { color: #fbbf24; }
.toast.out { opacity: 0; transform: translateY(8px); }
@keyframes toastin { from { opacity: 0; transform: translateY(10px); } }
.scrim { display: none; }

/* ------------------------------------------------------------ motion: tilt, reveal, save highlight */
.tilt { transition: transform .25s ease, box-shadow .25s ease; transform-style: preserve-3d; will-change: transform; }
.tilt.tilting { transform: perspective(900px) rotateX(var(--rx, 0)) rotateY(var(--ry, 0)) translateY(-2px); box-shadow: var(--shadow-lg); }
.reveal { opacity: 0; transform: translateY(10px); transition: opacity .45s ease, transform .45s ease; }
.reveal.in { opacity: 1; transform: none; }
.reveal.no-anim { transition: none; }
.tilt.reveal.in:not(.tilting) { transform: none; }
.flash, tr.flash td { animation: flash 2.6s ease; }
@keyframes flash { 0%, 30% { background-color: color-mix(in srgb, var(--blue) 18%, var(--surface)); box-shadow: 0 0 0 2px var(--blue-line); } 100% { background-color: inherit; } }
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
.reduce-motion .reveal { opacity: 1; transform: none; }
.reduce-motion .tilt.tilting { transform: none; }
.reduce-motion .flash, .reduce-motion tr.flash td { animation: none; outline: 2px solid var(--blue); outline-offset: -2px; }

/* density */
.compact .workspace { gap: 14px; }
.compact .panel { padding: 14px 16px; }
.compact .table td { padding: 8px 10px; }
.compact .stat { padding: 14px 16px; }
.compact .stat-value { font-size: 26px; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1440px) {
  .live-badge { padding: 0 10px; }
}
@media (max-width: 1360px) {
  .topbar .tz-chip { display: none; }
  .topic-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1220px) {
  .live-badge { width: 30px; padding: 0; justify-content: center; font-size: 0; gap: 0; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .radar-top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pills-card { grid-column: 1 / -1; }
  .workspace { padding: 22px 24px 36px; }
}
@media (max-width: 1080px) {
  .grid-2-1, .grid-1-1 { grid-template-columns: minmax(0, 1fr); }
  .topbar .lang-switch > .ico { display: none; }
  .search-pill kbd { display: none; }
}
@media (max-width: 960px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); transform: translateX(-104%); transition: transform .25s ease; box-shadow: var(--shadow-lg); background: var(--surface); }
  .nav-open .sidebar { transform: none; }
  .nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(10, 14, 24, .38); }
  .menu-toggle { display: inline-grid !important; }
  .topbar { padding: 0 14px; gap: 8px; }
  .crumb-root, .crumbs > .ico { display: none; }
  .search-pill { flex: 1 1 auto; max-width: none; }
  .search-pill span:not(.ico) { display: none; }
  .search-pill { flex: 0 0 38px; min-width: 38px; padding: 0; justify-content: center; margin-left: auto; }
  .self-cards { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .keys-table { display: none; }
  .key-cards { display: grid; gap: 10px; }
  .topbar .lang-switch, .topbar .theme-seg { display: none; }
  .env-btn span:not(.ico) { display: none; }
  .rm-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .rm-row .mono { display: none; }
  .env-btn { width: 36px; padding: 0; justify-content: center; }
  .workspace { padding: 16px 14px 30px; gap: 16px; }
  .page-head h1 { font-size: 24px; }
  .panel { padding: 16px; border-radius: 18px; }
  .stats { gap: 10px; }
  .stat { padding: 14px; }
  .stat-value { font-size: 24px; }
  .topic-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .radar-top { grid-template-columns: minmax(0, 1fr); }
  .big-timer { font-size: 38px; }
  .form-grid, .self-grid, .kv-grid.two { grid-template-columns: minmax(0, 1fr); }
  .recent-row { grid-template-columns: minmax(0, 1fr) auto auto; }
  .recent-row .mono { display: none; }
  .filters .field { flex: 1 1 140px; }
  .search-field { min-width: 0; width: 100%; }
  .footer { padding: 14px; justify-content: center; }
  .help-hero { padding: 22px; }
  .help-hero h1, .self-hero h1 { font-size: 26px; }
  .std-top { padding: 10px 14px; }
  .std-top .theme-seg span:not(.ico), .std-top .lang-switch > .ico { display: none; }
  .std-top .top-right { gap: 6px; }
  .std-top .seg button, .std-top .lang-switch button { padding: 0 9px; }
  .modal-wrap { padding: 10px; align-items: end; }
  .route-cards, .project-grid { grid-template-columns: minmax(0, 1fr); }
  /* request/route tables become stacked rows */
  .req-table thead, .routes-list thead { display: none; }
  .req-table tr.req-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
  .req-table tr.req-row td { border: 0; padding: 0; }
  .req-table tr.req-row td:nth-child(3), .req-table tr.req-row td:nth-child(4), .req-table tr.req-row td:nth-child(8) { display: none; }
  .req-table tr.req-detail { display: block; }
  .req-table tr.req-detail td { display: block; }
}
@media (max-width: 420px) {
  .stat-value { font-size: 22px; }
  .stat-ico { width: 30px; height: 30px; }
  .topic-row { grid-template-columns: minmax(0, 1fr); }
  .bell-pop { position: fixed; left: 12px; right: 12px; top: 70px; width: auto; }
}
@media print {
  .sidebar, .topbar, .footer, .demo-banner { display: none !important; }
  .app { display: block; }
  body::before { display: none; }
}

/* ============================================================
   珍珠玻璃层（UI 更新）
   来源：scaffold-master DESIGN.md「珍珠玻璃设计规范」。
   五种材质：导航轨 rail / 高亮玻璃块 pill / 浮层 float / 阅读面 surface / 凹槽 groove，
   差别只靠背景不透明度、模糊与白边强度拉开，不换颜色。
   仪器化语汇：等宽显示级读数 + 上标单位、段落标题前的青柠点、深色铭牌式提示。
   刻意偏离只留两处：① 总览第一张读数卡用青柠→珍珠白渐变面做唯一视觉主角；
   ② 路由卡的供应商徽标改为深色铭牌块（替代原蓝紫渐变）。
   ============================================================ */

/* ── 基础 ─────────────────────────────────────────────────── */
body { font-size: 13px; line-height: 1.5; letter-spacing: 0; color: var(--body); text-rendering: optimizeLegibility; }
body::before {
  background:
    radial-gradient(55% 45% at 92% 0%, var(--glow-a), transparent 70%),
    radial-gradient(45% 40% at 20% 100%, var(--glow-b), transparent 70%);
}
/* 细颗粒层：打散大面积渐变的色带；静态、不接指针（data: 图片在 CSP img-src 允许范围内） */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 300; pointer-events: none; opacity: .032;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}
[data-theme="dark"] body::after { opacity: .045; }
@media (prefers-contrast: more) { body::after { display: none; } }
::selection { background: var(--blue-bg); }
:focus-visible { outline: 2px solid color-mix(in srgb, var(--blue) 80%, transparent); outline-offset: 3px; border-radius: var(--r-xs); }
* { scrollbar-width: thin; scrollbar-color: rgba(46, 58, 62, .18) transparent; }
[data-theme="dark"] * { scrollbar-color: rgba(255, 255, 255, .14) transparent; }
h1, h2, h3 { letter-spacing: -.02em; }
code, .mono { font-family: var(--mono); font-size: 12px; }
.mono, .table td small.mono, .rc-head .mono { font-variant-numeric: tabular-nums; }
.stat-value, .big-timer, .avg-value, .mini-timer b, .kv-value, .meter-top b, .table td, .pager, time { font-variant-numeric: tabular-nums; }
.ico svg { stroke-width: 1.7; }

/* ── 外壳：导航轨 + 顶栏 ─────────────────────────────────── */
@media (min-width: 961px) { .app { background: none; } }
.sidebar {
  padding: 16px 12px 12px; gap: 8px;
  background: var(--rail-bg); border-right: 1px solid var(--line-2);
  backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
}
.brand { padding: 2px 8px 12px; }
.brand-text strong { font-size: 15px; font-weight: 720; letter-spacing: -.01em; }
.brand-text small { font-size: 11px; font-weight: 560; color: var(--muted-2); letter-spacing: .02em; }
.nav-pill-box { padding: 0; border: 0; border-radius: 0; background: none; gap: 2px; }
.nav-group { padding: 14px 11px 6px; font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: none; color: var(--muted-2); }
.nav-group:first-child { padding-top: 2px; }
.nav-item {
  height: 38px; padding: 0 10px 0 11px; gap: 11px; border-radius: var(--r-sm); border: 1px solid transparent;
  font-size: 13px; font-weight: 560; color: var(--muted);
  transition: color .2s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease, opacity .2s ease;
}
.nav-item .ico { color: var(--muted-2); transition: color .2s ease; }
.nav-item:hover { background: var(--hover-bg); color: var(--ink); }
.nav-item:hover .ico { color: var(--ink-2); }
/* 选中：高亮玻璃块（m-pill），标签转正文色、图标转主色 */
.nav-item.active {
  color: var(--ink); font-weight: 650; background: var(--pill-bg); border-color: var(--glass-line);
  box-shadow: var(--shadow), var(--edge), inset 0 -1px 0 rgba(105, 122, 128, .08);
}
[data-theme="dark"] .nav-item.active { box-shadow: var(--shadow-sm), var(--edge); }
.nav-item.active .ico { color: var(--blue); }
/* 兄弟项让位：被指向的那一项更清楚 */
@media (hover: hover) {
  .nav-pill-box:has(.nav-item:hover) .nav-item:not(:hover):not(.active) { opacity: .62; }
}
.nav-badge { min-width: 20px; height: 18px; padding: 0 6px; font-size: 11px; font-weight: 650; background: var(--grey-bg); color: var(--muted); font-variant-numeric: tabular-nums; }
.nav-item.active .nav-badge { background: var(--blue); color: #fff; }
.nav-badge.alert { background: var(--red); color: #fff; }
[data-theme="dark"] .nav-badge.alert { color: #1b1f21; }
.help-tile { border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface-grad); box-shadow: var(--edge), var(--shadow-sm); padding: 6px; }
.help-toggle { border-radius: var(--r-sm); color: var(--ink); font-weight: 620; }
.help-toggle > .ico:first-child { color: var(--blue); }
.account { border-top-color: var(--line); }
.avatar { background: #131619; color: #fff; font-weight: 650; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 1px 3px rgba(14, 18, 20, .16); }
[data-theme="dark"] .avatar { background: var(--surface-3); color: var(--ink); }

.topbar {
  gap: 10px; padding: 0 20px 0 28px;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(22px) saturate(1.1); -webkit-backdrop-filter: blur(22px) saturate(1.1);
  border-bottom: 1px solid var(--line);
}
.crumbs { font-size: 12.5px; font-weight: 500; color: var(--muted-2); }
.crumbs strong { color: var(--ink); font-weight: 620; }
.search-pill {
  height: 34px; border-radius: var(--r-sm); padding: 0 8px 0 11px;
  border: 1px solid var(--line-2); background: var(--input-bg); box-shadow: var(--edge); color: var(--muted-2);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.search-pill:hover { border-color: color-mix(in srgb, var(--ink) 18%, transparent); }
.search-pill span:not(.ico) { font-size: 12.5px; }
kbd { height: 20px; display: inline-flex; align-items: center; padding: 0 6px; border-radius: 6px; font: 600 11px var(--mono); border: 1px solid var(--line-2); background: var(--input-bg); color: var(--muted); }
.live-badge, .tz-chip { height: 28px; padding: 0 11px; border: 0; border-radius: var(--pill); background: var(--grey-bg); color: var(--muted); font-weight: 600; }
.live-badge i { width: 7px; height: 7px; }
.live-badge.live { color: var(--green); background: var(--green-bg); }
.live-badge.live i { background: var(--lime); box-shadow: 0 0 0 3px var(--green-bg); animation: none; }
.live-badge.demo i { background: var(--muted-2); }
/* 凹槽 + 滑块：分段控件与语言切换 */
.lang-switch, .seg, .tabs {
  padding: 3px; gap: 2px; border-radius: var(--r-sm);
  border: 1px solid rgba(255, 255, 255, .7); background: rgba(225, 231, 229, .5); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .46);
}
[data-theme="dark"] .lang-switch, [data-theme="dark"] .seg, [data-theme="dark"] .tabs { border-color: rgba(255, 255, 255, .07); background: rgba(0, 0, 0, .22); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .28); }
.lang-switch button, .seg button, .tabs button { height: 28px; border-radius: var(--r-xs); font-size: 12.5px; font-weight: 600; color: var(--muted); border: 1px solid transparent; }
.lang-switch button.on, .seg button.on, .tabs button.on,
.seg-check:has(input:checked) {
  color: var(--ink); background: var(--pill-bg); border-color: var(--glass-line);
  box-shadow: var(--shadow-sm), var(--edge);
}
[data-theme="dark"] .lang-switch button.on, [data-theme="dark"] .seg button.on, [data-theme="dark"] .tabs button.on, [data-theme="dark"] .seg-check:has(input:checked) { background: var(--pill-bg); }
.tabs button { height: 34px; }
.seg-check { height: 28px; border-radius: var(--r-xs); border: 1px solid transparent; }
.icon-btn {
  width: 34px; height: 34px; border-radius: var(--r-sm); color: var(--muted);
  border: 1px solid var(--line-2); background: var(--input-bg); box-shadow: var(--edge);
  transition: color .2s ease, background .2s ease, border-color .2s ease;
}
.icon-btn:hover { color: var(--ink); background: var(--hover-bg); }
.icon-btn.small { width: 28px; height: 28px; border-radius: var(--r-xs); }
.bell .count { top: -5px; right: -6px; min-width: 18px; height: 18px; font-size: 10.5px; font-weight: 700; border-color: var(--bg); font-variant-numeric: tabular-nums; }
.env-btn { height: 34px; padding: 0 14px; border-radius: var(--r-sm); font-weight: 650; font-size: 13px; box-shadow: var(--shadow-blue); }
.env-btn:hover { background: var(--blue-2); }
[data-theme="dark"] .env-btn:not(.live) { color: #fff; }
.env-btn.live { background: var(--green-bg); color: var(--green); border: 1px solid color-mix(in srgb, var(--lime) 40%, transparent); box-shadow: none; }

.footer { color: var(--muted-2); font-size: 12px; border-top-color: var(--line); }
.foot-btn { height: 30px; border-radius: var(--r-xs); border: 1px solid var(--line-2); background: var(--input-bg); box-shadow: var(--edge); color: var(--ink-2); }
.foot-btn:hover { background: var(--hover-bg); border-color: var(--line-2); }
.dot.green { background: var(--lime); box-shadow: 0 0 0 3px var(--green-bg); }

/* ── 控件 ─────────────────────────────────────────────────── */
.btn {
  height: var(--control-h); padding: 0 15px; gap: 7px; border-radius: var(--r-sm);
  font-size: 13px; font-weight: 620; letter-spacing: .005em; color: var(--ink);
  /* 次级按钮 = 高亮玻璃块 */
  border: 1px solid var(--glass-line); background: var(--pill-bg);
  box-shadow: var(--shadow-sm), var(--edge), inset 0 -1px 0 rgba(105, 122, 128, .08);
  transition: color .2s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
[data-theme="dark"] .btn { border-color: var(--line-2); }
.btn:hover:not(:disabled) { transform: none; border-color: var(--glass-line); box-shadow: var(--shadow), var(--edge), inset 0 -1px 0 rgba(105, 122, 128, .08); }
[data-theme="dark"] .btn:hover:not(:disabled) { border-color: rgba(255, 255, 255, .16); }
.btn:active:not(:disabled) { background: var(--hover-bg); }
.btn.primary { color: #fff; background: var(--blue); border-color: transparent; box-shadow: var(--shadow-blue); font-weight: 650; }
.btn.primary:hover:not(:disabled) { background: var(--blue-2); border-color: transparent; box-shadow: 0 1px 2px rgba(20, 66, 148, .32), 0 12px 24px rgba(35, 109, 233, .3); }
[data-theme="dark"] .btn.primary { color: #fff; }
.btn.danger { color: #fff; background: var(--red); border-color: transparent; box-shadow: 0 1px 2px rgba(150, 40, 34, .26), 0 8px 18px rgba(255, 90, 80, .22); }
.btn.danger:hover:not(:disabled) { background: #c4322a; border-color: transparent; }
[data-theme="dark"] .btn.danger { color: #1b1f21; }
[data-theme="dark"] .btn.danger:hover:not(:disabled) { background: #ff8f87; }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
.btn.ghost:hover:not(:disabled) { background: var(--hover-bg); color: var(--ink); box-shadow: none; border-color: transparent; }
.btn.small { height: var(--control-h-sm); padding: 0 11px; font-size: 12.5px; border-radius: var(--r-xs); gap: 5px; }
.btn.block { height: 42px; }
.btn.danger-text { color: var(--red); }
.link { font-weight: 600; font-size: 12.5px; border-radius: var(--r-xs); }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* 标签：胶囊、无边框；正常状态带青柠点（状态同时有文字，不只靠颜色） */
.chip { height: 22px; padding: 0 9px; gap: 5px; font-size: 12px; font-weight: 600; background: var(--grey-bg); color: var(--muted); }
.chip.green { background: var(--green-bg); color: var(--green); }
.chip.green:not(:has(.ico))::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 3px var(--green-bg); flex: none; }
.chip.red { background: var(--red-bg); color: var(--red); }
.chip.amber { background: var(--amber-bg); color: var(--amber); }
.chip.blue, .chip.t-clients, .chip.t-all { background: var(--blue-bg); color: var(--blue); }
.chip.mono { font-size: 11.5px; letter-spacing: 0; }
.label { font-size: 12px; font-weight: 600; color: var(--muted); }
/* 页面位置由顶栏面包屑承担，页头不再放英文眉标 */
.eyebrow { display: none; }
.eyebrow-chip { height: 28px; border-radius: var(--pill); background: var(--green-bg); color: var(--green); font-weight: 600; font-size: 12px; }

/* 页头 */
.page-head { gap: 16px 24px; margin-top: 2px; }
.page-head h1 { font-size: 28px; font-weight: 740; letter-spacing: -.03em; line-height: 1.15; text-wrap: balance; }
.page-head p { margin-top: 6px; font-size: 13px; color: var(--muted); text-wrap: pretty; }

/* ── 阅读面（m-surface）：卡片、表格容器、弹窗 ─────────────── */
.panel, .stat, .route-card, .project-card, .topic {
  background: var(--surface-grad); border: 1px solid var(--line-2);
  box-shadow: var(--edge), var(--shadow-sm);
}
.panel { border-radius: var(--r-lg); padding: 20px; }
.panel.flat { padding: 16px; }
.panel-head { margin-bottom: 16px; align-items: center; }
/* 段落标题：前置一颗带光晕的青柠点 */
.panel-head h2 { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.panel-head h2::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 5px var(--green-bg); flex: none; }
.panel-head p { margin-top: 4px; padding-left: 17px; font-size: 12.5px; color: var(--muted); }
.self-help h3 { font-size: 15px; font-weight: 650; }
.sub-h { font-size: 13px; font-weight: 650; }

/* 通知条 */
.notice, .demo-banner { padding: 11px 14px; border-radius: var(--r-sm); font-size: 13px; font-weight: 500; }
.demo-banner {
  border: 1px solid var(--line-2); border-left: 1px solid var(--line-2);
  background: var(--surface-grad); box-shadow: var(--edge), var(--shadow-sm); color: var(--ink-2);
}
.demo-banner > .ico { color: var(--blue); }
.notice.blue { background: var(--blue-bg); color: var(--blue); }
.notice.red { background: var(--red-bg); color: var(--red); }

/* ── 仪器化读数 ─────────────────────────────────────────── */
.stats { gap: 16px; }
.stat { border-radius: var(--r-lg); padding: 18px 20px 16px; }
.stat::before { display: none; }
.stat-top { gap: 9px; }
.stat-ico { width: 28px; height: 28px; border-radius: var(--r-xs); background: var(--grey-bg); color: var(--muted); }
.stat-ico .ico { width: 15px; height: 15px; }
.stat-ico.red { background: var(--red-bg); color: var(--red); }
.stat-value {
  display: flex; align-items: flex-start; gap: 4px; margin-top: 16px;
  font-size: 28px; font-weight: 720; letter-spacing: -.035em; line-height: 1;
}
.stat-value small { position: relative; top: .1em; font-size: .46em; font-weight: 640; letter-spacing: 0; color: var(--muted); }
.stat-sub { margin-top: 10px; font-size: 12px; color: var(--muted); }
/* 刻意偏离 ①：每页只有一个视觉主角 —— 第一张读数卡用青柠到珍珠白渐变面（不引入暖色） */
.stats > .stat:first-child {
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(130, 221, 45, .24), transparent 58%),
    linear-gradient(145deg, rgba(255, 255, 255, .98), rgba(246, 251, 249, .9));
}
[data-theme="dark"] .stats > .stat:first-child {
  background: radial-gradient(120% 140% at 0% 0%, rgba(130, 221, 45, .14), transparent 58%), var(--surface-grad);
}
.stats > .stat:first-child .stat-ico { background: rgba(255, 255, 255, .7); color: var(--green); box-shadow: var(--edge), var(--shadow-sm); }
[data-theme="dark"] .stats > .stat:first-child .stat-ico { background: var(--green-bg); }
.stats > .stat:first-child .stat-value { font-size: 34px; }

.big-timer { font-size: 44px; font-weight: 720; letter-spacing: -.045em; }
.avg-value, .mini-timer b { font-size: 28px; font-weight: 720; letter-spacing: -.035em; }
.mini-inc { border-top-color: var(--line); }
.kv { padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); }
.kv-value { font-weight: 650; }
.kv-value.green, .kv-value.amber, .kv-value.red, .kv-value.blue, .kv-grid.tags .kv-value { height: 22px; padding: 0 9px; font-size: 12px; font-weight: 600; }

/* 额度条：细轨道 + 主色；接近上限转沙 / 红 */
.bar { height: 6px; background: var(--surface-3); }
.bar.big { height: 8px; }
.weight-bar { height: 4px; background: var(--surface-3); }
.weight-bar i { background: var(--blue); }
.meter-top { align-items: baseline; font-size: 12px; }
.meter-top b { font-weight: 650; }
.table td .meter-top small, .meter-top b small { display: inline; color: var(--muted-2); font-weight: 500; }
.table td .meter-top b { display: inline; }

/* ── 数据表格 ─────────────────────────────────────────── */
.table-wrap { border-radius: 0; }
.table { font-size: 13px; }
.table th {
  height: 40px; padding: 0 14px; font-size: 12px; font-weight: 620; letter-spacing: 0; color: var(--muted);
  background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.table th:first-child, .table th:last-child { border-radius: 0; }
.table td { height: var(--row-h); padding: 10px 14px; color: var(--ink); border-bottom-color: var(--line); }
.table td b { font-weight: 620; }
.table td small { font-size: 12px; color: var(--muted); margin-top: 1px; }
.table tbody tr { transition: background .15s ease; }
.table tbody tr:hover td { background: var(--hover-bg); }
.req-row.open td { background: var(--blue-bg); }
.req-detail td { background: var(--surface-2); }
.report-table tfoot td { background: var(--surface-2); border-top-color: var(--line-2); font-weight: 650; }
.pager { font-size: 12px; color: var(--muted); }

/* ── 浮层（m-float）：菜单、命令面板、通知 ───────────────── */
.menu, .palette, .bell-pop {
  border: 1px solid var(--glass-line); background: var(--float-bg);
  box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(120, 132, 135, .13), inset 0 1px 0 rgba(255, 255, 255, .72);
  backdrop-filter: blur(28px) saturate(1.08); -webkit-backdrop-filter: blur(28px) saturate(1.08);
}
[data-theme="dark"] .menu, [data-theme="dark"] .palette, [data-theme="dark"] .bell-pop { box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, .06); }
.menu { border-radius: var(--r); padding: 6px; }
.menu button { height: 34px; padding: 0 10px; border-radius: var(--r-xs); font-weight: 560; color: var(--ink); }
.menu button:hover, .menu button:focus-visible { background: var(--hover-bg); }
.palette, .bell-pop { border-radius: var(--r-lg); }
.palette-input { height: 52px; border-bottom-color: var(--line); }
#paletteList li { border-radius: var(--r-xs); padding: 9px 10px; color: var(--ink); font-size: 13px; }
#paletteList li.on { background: var(--hover-bg); color: var(--ink); box-shadow: inset 2px 0 0 var(--blue); }
#paletteList li.on .ico { color: var(--blue); }
.palette-foot { background: transparent; border-top-color: var(--line); color: var(--muted-2); }
.bell-pop li button { border-radius: var(--r-xs); }
.bell-pop li button:hover { background: var(--hover-bg); }
.bell-pop li.unread button { background: var(--blue-bg); }
.bp-head, .bp-foot { border-color: var(--line); }

/* 弹窗：阅读面 + 更大圆角；遮罩用统一 overlay */
.modal-wrap { background: var(--overlay); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal { border-radius: 24px; background: var(--surface-grad); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg), var(--edge); }
[data-theme="dark"] .modal { background: var(--surface); }
.modal-head { padding: 20px 22px 6px; }
.modal-head h2 { font-size: 17px; font-weight: 700; }
.modal-foot { padding: 14px 22px 20px; }
.impact li, .token-box { border-radius: var(--r-sm); background: var(--surface-2); border-color: var(--line); }

/* 提示：深色铭牌，浅 / 深两态都是深色玻璃面 */
.toast {
  border-radius: var(--r-sm); background: var(--plate-bg); color: var(--plate-ink);
  border: 1px solid rgba(255, 255, 255, .1); box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, .1);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); font-weight: 560;
}
.toast .ico { color: #a6ec62; }
.toast.red .ico { color: #ff8a82; }

/* ── 表单 ─────────────────────────────────────────────── */
.field-label { font-size: 12px; font-weight: 600; color: var(--muted); }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=search], input:not([type]), select, textarea {
  height: var(--control-h); padding: 0 12px; border-radius: var(--r-sm);
  border: 1px solid var(--line-2); background-color: var(--input-bg); box-shadow: var(--edge); color: var(--ink);
  transition: border-color .2s ease, box-shadow .2s ease;
}
textarea { height: auto; padding: 9px 12px; line-height: 1.55; }
select { background-position: calc(100% - 16px) 15px, calc(100% - 11px) 15px; }
input::placeholder, textarea::placeholder { color: var(--muted-2); }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--ink) 18%, transparent); }
input:focus, select:focus, textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--blue) 80%, transparent); outline-offset: 2px;
  border-color: transparent; box-shadow: var(--edge);
}
input[aria-invalid=true] { border-color: var(--red); }
.search-field, .input-ico {
  height: var(--control-h); border-radius: var(--r-sm); border: 1px solid var(--line-2);
  background: var(--input-bg); box-shadow: var(--edge); color: var(--muted-2);
}
.search-field input:focus, .input-ico input:focus { outline: none; }
.search-field:focus-within, .input-ico:focus-within { outline: 2px solid color-mix(in srgb, var(--blue) 80%, transparent); outline-offset: 2px; border-color: transparent; box-shadow: var(--edge); }
.search-field.big { height: 48px; border-radius: var(--r); box-shadow: var(--edge), var(--shadow-sm); }
.filters .field select, .filters .field input { height: var(--control-h); }
/* 开关：轨道从灰注满青柠 */
.toggle { width: 38px; height: 22px; background: rgba(46, 58, 62, .14); box-shadow: inset 0 1px 2px rgba(46, 58, 62, .14); transition: background .32s var(--ease); }
[data-theme="dark"] .toggle { background: rgba(255, 255, 255, .14); }
.toggle::after { top: 2px; left: 2px; width: 18px; height: 18px; box-shadow: 0 1px 3px rgba(16, 20, 24, .22), 0 2px 6px rgba(16, 20, 24, .1); transition: transform .32s var(--ease); }
.toggle.on { background: var(--lime); }
.toggle.on::after { transform: translateX(16px); }
.check input, .scenario input, .seg-check input { accent-color: var(--blue); }
.setting-row { border-bottom-color: var(--line); }

/* ── 空状态、骨架、代码 ─────────────────────────────────── */
.empty { border: 1px dashed var(--line-2); border-radius: var(--r); background: transparent; }
.empty-ico { width: 44px; height: 44px; border-radius: var(--r-sm); background: var(--grey-bg); color: var(--muted); }
.skeleton { border-radius: var(--r-sm); }
pre.code { border-radius: var(--r); background: #15181a; border: 1px solid rgba(255, 255, 255, .08); color: #e6ecea; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06); }
[data-theme="dark"] pre.code { background: #0b0d0e; }

/* ── 总览、热力、探测 ───────────────────────────────────── */
.chart .bar-ok { fill: var(--blue); opacity: .9; }
.chart .bar-err { fill: var(--red); }
.chart text { fill: var(--muted-2); font-size: 11px; font-family: var(--mono); }
.chart .axis { stroke: var(--line-2); }
.rm-row, .recent-row { border-radius: var(--r-xs); }
.recent-row:hover, .rm-row:hover { background: var(--hover-bg); }
.hm-cell { border-radius: 3px; }
.hm-cell.is-today { outline-color: var(--ink); }
.hm-months, .hm-dows, .hm-foot { color: var(--muted-2); }
.probe-tile { border-radius: var(--r-sm); border: 1px solid var(--line); border-top: 2px solid var(--muted-2); background: var(--surface-2); }
.probe-tile.green { border-top-color: var(--lime); }

/* ── 路由、项目、帮助卡片 ───────────────────────────────── */
.route-card, .project-card { border-radius: var(--r-lg); padding: 18px; }
/* 刻意偏离 ②：供应商徽标用深色铭牌块，替代蓝紫渐变 */
.rc-logo {
  width: 38px; height: 38px; border-radius: var(--r-sm); font-weight: 700; color: #fff; background: #131619;
  box-shadow: 0 1px 3px rgba(14, 18, 20, .16), 0 6px 16px rgba(14, 18, 20, .14), inset 0 1px 0 rgba(255, 255, 255, .12);
}
[data-theme="dark"] .rc-logo { background: var(--surface-3); color: var(--ink); }
.pc-foot { border-top-color: var(--line); }
.topic { border-radius: var(--r-lg); }
.topic.on { background: var(--pill-bg); border-color: var(--glass-line); box-shadow: var(--shadow), var(--edge); }
.topic.on b { color: var(--blue); }
.topic-ico { border-radius: var(--r-sm); background: var(--grey-bg); color: var(--muted); }
.topic-count { background: var(--grey-bg); color: var(--muted); font-variant-numeric: tabular-nums; }
.topic.on .topic-count { background: var(--blue); }
.help-hero { background: radial-gradient(60% 120% at 100% 0%, var(--glow-a), transparent 70%), var(--surface-grad); }
.help-hero h1, .self-hero h1 { font-weight: 740; letter-spacing: -.03em; }
.faq-item { border-radius: var(--r-sm); background: var(--surface-2); border-color: var(--line); }
.receipt { border-radius: var(--r); background: #131619; color: #fff; box-shadow: 0 6px 16px rgba(14, 18, 20, .16), inset 0 1px 0 rgba(255, 255, 255, .12); }
[data-theme="dark"] .receipt { background: var(--surface-3); color: var(--ink); }
.std-top { background: color-mix(in srgb, var(--bg) 72%, transparent); }

/* ── 故障雷达 ─────────────────────────────────────────── */
.kind-pill { height: 30px; border-color: var(--line); background: var(--surface-2); font-weight: 600; }
.timeline::before { background: var(--line-2); width: 1px; left: 11.5px; }
.tl-dot { width: 11px; height: 11px; border-width: 2px; }
.tl-body { border-radius: var(--r-sm); background: var(--surface-2); border-color: var(--line); }
.alert-list li { border-bottom-color: var(--line); }
.alert-list li.unread { background: linear-gradient(90deg, var(--blue-bg), transparent 60%); border-radius: var(--r-xs); }
.scenario { border-radius: var(--r-sm); background: var(--surface-2); border-color: var(--line); }

/* ── 动效：卡片倾斜收敛到 ≤ 4°，悬停只抬阴影 ─────────────── */
.tilt.tilting { box-shadow: var(--shadow), var(--edge); }
.reveal { transition: opacity .45s var(--ease), transform .45s var(--ease); }

/* ── 密度 ─────────────────────────────────────────────── */
.compact { --row-h: 40px; }
.compact .table td { padding: 6px 12px; }
.compact .stat-value { font-size: 24px; }
.compact .stats > .stat:first-child .stat-value { font-size: 28px; }

/* ── 窄屏 ─────────────────────────────────────────────── */
@media (max-width: 960px) {
  .sidebar { background: var(--surface); }
  .nav-open .scrim { background: var(--overlay); }
}
@media (max-width: 760px) {
  .page-head h1 { font-size: 24px; }
  .panel { padding: 16px; border-radius: var(--r); }
  .stat-value { font-size: 24px; }
  .stats > .stat:first-child .stat-value { font-size: 28px; }
}
@media (prefers-reduced-transparency: reduce) {
  .sidebar, .topbar, .menu, .palette, .bell-pop, .toast { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .menu, .palette, .bell-pop { background: var(--surface); }
}
@media print { body::after { display: none; } }

/* 修补：内嵌输入不再画第二层框；工作区获得程序焦点时不画焦点环；读数卡图标保持中性 */
.search-field input, .input-ico input, .palette-input input { background: transparent !important; padding: 0; height: 100%; outline: none !important; }
.workspace:focus, .workspace:focus-visible { outline: none; }
.stat-ico.amber, .stat-ico.purple, .stat-ico.green, .stat-ico.blue { background: var(--grey-bg); color: var(--muted); }

/* ============================================================
   舞台外框（scaffold「舞台 → 深色外框 → 导航轨 + 工作区」）
   仅桌面端（≥ 961px）：页面变成灰色舞台上一块 38px 圆角的浮起卡片，
   侧栏与工作区在框内各自滚动；窄屏保持原抽屉式布局。
   V1.11：去掉 10px 黑色外框（浅色 #17191d / 深色 #000），只留 1px 发丝边、圆角与柔和阴影；
   内部侧栏 / 顶栏圆角随之改为 37px（= 外框 38px − 1px 边），贴合卡片边缘不留缝也不被裁切。
   ============================================================ */
@media (min-width: 961px) {
  body { background: #dfe3e2; overflow: hidden; }
  [data-theme="dark"] body { background: #090b0c; }
  body::before { display: none; }
  .app {
    margin: 8px; height: calc(100vh - 16px); height: calc(100dvh - 16px); min-height: 560px;
    --frame-r: 38px;
    border: 1px solid var(--line); border-radius: var(--frame-r); overflow: hidden;
    background:
      radial-gradient(55% 45% at 92% 0%, var(--glow-a), transparent 70%),
      radial-gradient(45% 40% at 20% 100%, var(--glow-b), transparent 70%),
      var(--bg);
    box-shadow: 0 24px 70px rgba(17, 23, 27, .24), 0 3px 12px rgba(17, 23, 27, .16);
  }
  [data-theme="dark"] .app { border-color: rgba(255, 255, 255, .07); box-shadow: 0 24px 70px rgba(0, 0, 0, .55), 0 3px 12px rgba(0, 0, 0, .35); }
  .sidebar { position: relative; top: auto; height: auto; min-height: 0; border-radius: calc(var(--frame-r) - 1px) 0 0 calc(var(--frame-r) - 1px); }
  .main { min-height: 0; overflow-y: auto; overflow-x: clip; overscroll-behavior: contain; scroll-padding-top: var(--top); }
  .topbar { border-radius: 0 calc(var(--frame-r) - 1px) 0 0; }
  .footer { padding-bottom: 18px; }
}
@media (min-width: 961px) and (max-height: 600px) { body { overflow: auto; } }
@media print {
  body { background: #fff; overflow: visible; }
  .app { margin: 0; height: auto; border: 0; border-radius: 0; box-shadow: none; overflow: visible; }
  .main { overflow: visible; }
}

/* ============================================================
   V1.10 组件层：批量、列、链路、聚类、向导、推送、会话、导入、账单、状态页
   沿用珍珠玻璃令牌；蓝 = 选择/主操作，青柠 = 正常，红 = 危险，斜线 = 异常。
   ============================================================ */

/* 读数滚动（Odometer） */
.odo { display: inline-flex; line-height: 1; height: 1em; overflow: hidden; vertical-align: -.08em; }
.odo-d { display: inline-block; height: 1em; overflow: hidden; font-style: normal; }
.odo-d b { display: flex; flex-direction: column; font-weight: inherit; transform: translateY(calc(var(--d) * -1em)); transition: transform .9s cubic-bezier(.2, .8, .2, 1); line-height: 1em; writing-mode: horizontal-tb; width: .62em; text-align: center; word-break: break-all; }
.odo-c { font-style: normal; }
.reveal:not(.in) .odo-d b { transform: translateY(0); }
.reveal.in:not(.no-anim) .odo-d b { animation: odo-roll 1.1s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes odo-roll { from { transform: translateY(0); } to { transform: translateY(calc(var(--d) * -1em)); } }
.reduce-motion .odo-d b { transition: none; animation: none !important; transform: translateY(calc(var(--d) * -1em)) !important; }
.delta { font-weight: 700; font-variant-numeric: tabular-nums; }
.delta.good { color: var(--green); } .delta.bad { color: var(--red); }

/* 弹窗从触发点展开 */
.modal.grow, .palette.grow { animation: grow-in .26s cubic-bezier(.2, .9, .25, 1.05); }
@keyframes grow-in { from { opacity: 0; transform: scale(.86); } to { opacity: 1; transform: none; } }
.reduce-motion .modal.grow, .reduce-motion .palette.grow { animation: none; }

/* 顶栏滚动后凝结 */
.topbar { transition: background .25s, box-shadow .25s, border-color .25s; }
.topbar.scrolled { background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); box-shadow: 0 1px 0 var(--line), 0 10px 24px rgba(16, 20, 24, .05); }

/* 热力图：错误率 ≥10% 改为斜线填充（不靠颜色区分） */
.hm-cell.err-hi { background-image: var(--hatch); box-shadow: inset 0 0 0 1.5px var(--red); }
[data-theme="dark"] .hm-cell.err-hi { background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, .28) 0 1.5px, transparent 1.5px 6px); }

/* 刷新 + 自动刷新 */
.split-btn { display: inline-flex; }
.split-btn > .btn:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.split-btn > .btn.auto { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: -1px; font-size: 12.5px; color: var(--muted); gap: 6px; }
.split-btn > .btn.auto.on { color: var(--blue); }
.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 0 rgba(130, 221, 45, .5); animation: pulse-dot 2s infinite; }
@keyframes pulse-dot { 70% { box-shadow: 0 0 0 7px rgba(130, 221, 45, 0); } 100% { box-shadow: 0 0 0 0 rgba(130, 221, 45, 0); } }

/* 接入向导 */
.wizard { margin-bottom: 18px; }
.wizard h2 { display: flex; align-items: center; gap: 8px; }
.wz-bar { height: 4px; border-radius: 4px; background: var(--surface-3); overflow: hidden; margin: 2px 0 16px; }
.wz-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--lime), #c9f08f); border-radius: 4px; transition: width .5s; }
.wz-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.wz-steps li { display: flex; gap: 12px; padding: 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface-2); }
.wz-steps li.now { border-color: var(--blue-line); background: var(--blue-bg); }
.wz-steps li.done { opacity: .78; }
.wz-num { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: var(--surface); border: 1px solid var(--line-2); color: var(--ink-2); }
.wz-steps li.done .wz-num { background: var(--green-bg); color: var(--green); border-color: transparent; }
.wz-steps li.now .wz-num { background: var(--blue); color: #fff; border-color: transparent; }
.wz-steps b { display: block; font-size: 14px; color: var(--ink); }
.wz-steps p { margin: 4px 0 10px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.wz-act { display: flex; flex-wrap: wrap; gap: 6px; }
.ok-text { color: var(--green); font-weight: 650; } .bad-text { color: var(--red); font-weight: 650; }
@media (max-width: 960px) { .wz-steps { grid-template-columns: 1fr; } }

/* 工具行 / 视图 */
.tools-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.tools-row .search-field { flex: 1 1 220px; min-width: 200px; }
.key-views em { font-style: normal; margin-left: 5px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.key-views .on em { color: inherit; opacity: .8; }
.tag-filter { display: inline-flex; align-items: center; gap: 6px; }
.tag-filter select { height: var(--control-h-sm); }

/* 标签、备注 */
.tag-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.tag { border: 0; font: inherit; font-size: 11px; font-weight: 650; line-height: 1; padding: 4px 7px; border-radius: 6px; background: var(--surface-3); color: var(--ink-2); cursor: pointer; }
.tag:hover { background: var(--blue-bg); color: var(--blue); }
.name-cell .note { display: block; max-width: 260px; margin-top: 4px; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 勾选与批量栏 */
.w-check { width: 36px; padding-right: 0 !important; }
.row-check { width: 16px; height: 16px; accent-color: var(--blue); cursor: pointer; }
.table tr.selected td { background: var(--blue-bg); }
.key-card.selected { box-shadow: inset 0 0 0 1.5px var(--blue-line); }
.batch-bar { position: sticky; top: calc(var(--top) + 6px); z-index: 12; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px 8px 16px; margin-bottom: 12px; border-radius: var(--pill); background: var(--plate-bg); color: var(--plate-ink); box-shadow: var(--shadow-lg); animation: grow-in .2s; }
.batch-bar b { margin-right: 6px; font-size: 13px; }
.batch-bar .btn { background: rgba(255, 255, 255, .1); color: var(--plate-ink); border-color: rgba(255, 255, 255, .14); box-shadow: none; }
.batch-bar .btn:hover { background: rgba(255, 255, 255, .18); }
.batch-bar .btn.danger-text { color: #ff8c84; }
.batch-bar .link { color: var(--plate-soft); margin-left: auto; padding: 0 8px; }

/* 列选择与排序 */
.col-anchor { margin-left: auto; }
.col-menu { min-width: 190px; padding: 8px; }
.menu-check { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; font-size: 13px; cursor: pointer; }
.menu-check:hover { background: var(--hover-bg); }
.menu-check input { accent-color: var(--blue); }
.col-menu .link { justify-self: start; padding: 6px 8px; font-size: 12.5px; }
th.sortable button { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; font: inherit; color: inherit; }
th.sortable .sort-ico { font-size: 11px; color: var(--muted-2); }
th.sorted .sort-ico, th.sorted { color: var(--blue); }

/* 请求链路时间线 */
.trace { display: grid; gap: 8px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); }
.trace-row { display: grid; grid-template-columns: 110px 1fr minmax(170px, auto); align-items: center; gap: 12px; font-size: 12.5px; }
.trace-route { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; }
.trace-track { position: relative; height: 12px; border-radius: 6px; background: var(--surface-3); }
.trace-track i { position: absolute; top: 0; bottom: 0; border-radius: 6px; }
.trace-track i.ok { background: linear-gradient(90deg, var(--blue), #5b97ff); }
.trace-track i.bad { background: var(--hatch), var(--red-bg); box-shadow: inset 0 0 0 1px var(--red); }
.ttft-mark { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--lime); border-radius: 2px; }
.trace-out { white-space: nowrap; text-align: right; }
.trace-axis { display: flex; justify-content: space-between; padding-left: 122px; font-size: 11px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
@media (max-width: 720px) { .trace-row { grid-template-columns: 1fr; gap: 4px; } .trace-out { text-align: left; } .trace-axis { padding-left: 0; } }

/* 错误聚类 */
.cluster-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.count-cell { min-width: 150px; }
.count-cell b { display: inline-block; min-width: 34px; font-variant-numeric: tabular-nums; }
.count-bar { display: inline-block; vertical-align: middle; width: 100px; height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.count-bar i { display: block; height: 100%; background: var(--red); opacity: .75; border-radius: 6px; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; height: var(--control-h-sm); padding: 0 6px 0 10px; align-self: end; }
.filter-chip button { all: unset; cursor: pointer; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; }
.filter-chip button:hover { background: rgba(35, 109, 233, .18); }
.filter-chip .ico svg { width: 12px; height: 12px; }

/* 延迟分位 */
.lat-bars { display: grid; gap: 9px; margin-bottom: 16px; }
.lat-row { display: grid; grid-template-columns: 150px 1fr 80px; gap: 12px; align-items: center; font-size: 13px; }
.lat-row > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.lat-row > b { text-align: right; font-variant-numeric: tabular-nums; }
.lat-track { position: relative; height: 10px; border-radius: 5px; background: var(--surface-3); }
.lat-track i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; }
.lat-track .p99, .lat-legend .p99 { background: color-mix(in srgb, var(--blue) 22%, transparent); }
.lat-track .p95, .lat-legend .p95 { background: color-mix(in srgb, var(--blue) 55%, transparent); }
.lat-track .p50, .lat-legend .p50 { background: var(--blue); }
.lat-legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--muted); padding-left: 162px; }
.lat-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lat-legend i { width: 14px; height: 8px; border-radius: 3px; display: inline-block; }
.lat-table tr.total td { font-weight: 700; background: var(--surface-2); }
@media (max-width: 720px) { .lat-row { grid-template-columns: 90px 1fr 64px; } .lat-legend { padding-left: 0; } }

/* 排空 */
.drain-note { display: flex; align-items: center; gap: 8px; padding: 8px 10px; margin: -2px 0 10px; border-radius: var(--r-sm); background: var(--blue-bg); color: var(--blue); font-size: 12.5px; font-weight: 600; }
.btn.on { border-color: var(--blue-line); color: var(--blue); background: var(--blue-bg); }
.route-share { display: grid; gap: 7px; margin-top: 8px; }
.share-row { display: grid; grid-template-columns: 1fr 120px 92px; gap: 10px; align-items: center; font-size: 12.5px; color: var(--muted); }
.share-row.me { color: var(--ink); font-weight: 650; }
.share-row b { text-align: right; font-variant-numeric: tabular-nums; }
.share-track { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.share-track i { display: block; height: 100%; background: var(--blue); border-radius: 6px; transition: width .25s; }

/* 改前 → 改后 */
.diff-preview { margin-top: 14px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--blue-bg); border: 1px solid var(--blue-line); display: grid; gap: 6px; font-size: 13px; }
.diff-preview b { display: flex; align-items: center; gap: 6px; color: var(--blue); font-size: 12.5px; }
.diff-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.diff-line > span:first-child { min-width: 92px; color: var(--muted); }
del { color: var(--red); text-decoration: line-through; text-decoration-thickness: 1.5px; }
ins { color: var(--green); text-decoration: none; font-weight: 700; }

/* 密钥表单 */
.tpl-row { display: grid; gap: 6px; margin-bottom: 14px; }
.tpl-seg button.on { background: var(--blue); color: #fff; }
.more-fields { margin: 12px 0; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 4px 14px; background: var(--surface-2); }
.more-fields > summary { cursor: pointer; padding: 8px 0; font-weight: 650; font-size: 13px; color: var(--ink-2); }
.more-fields[open] { padding-bottom: 12px; }
.field textarea { width: 100%; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--input-bg); padding: 9px 12px; font: inherit; color: var(--ink); resize: vertical; }
.field textarea.mono { font-family: var(--mono); font-size: 12.5px; }
.once-snip { margin: 14px 0; }
.once-snip .code-tabs { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; }
.once-snip .code-tabs .btn { margin-left: auto; }
.once-snip pre { max-height: 220px; }

/* 成本：Top 5 与周环比 */
.grid-cost { display: grid; grid-template-columns: 1fr 1fr minmax(240px, .8fr); gap: 18px; margin-bottom: 18px; }
.grid-cost > .panel { margin: 0; }
@media (max-width: 1100px) { .grid-cost { grid-template-columns: 1fr; } }
.top-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: top; }
.top-list li { display: grid; grid-template-columns: 18px minmax(90px, 1.4fr) minmax(36px, 1fr) 64px 44px; align-items: center; gap: 10px; font-size: 13px; counter-increment: top; }
.top-list li::before { content: counter(top); font-weight: 800; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.top-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-bar { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.top-bar i { display: block; height: 100%; border-radius: 6px; background: var(--blue); }
.top-list li:first-child .top-bar i { background: linear-gradient(90deg, var(--lime), #b8ea7c); }
.top-list b { text-align: right; font-variant-numeric: tabular-nums; }
.top-list small { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.week-card .week-value { font-size: 28px; font-weight: 850; letter-spacing: -.02em; color: var(--ink); margin: 6px 0 2px; display: flex; align-items: baseline; gap: 10px; }
.week-card .week-value .delta { font-size: 14px; }
.spark { display: flex; align-items: flex-end; gap: 4px; height: 56px; margin-top: 12px; }
.spark i { flex: 1; border-radius: 3px 3px 1px 1px; background: var(--surface-3); min-height: 3px; }
.spark i.cur { background: var(--blue); }

/* 告警推送 */
.hook-list, .session-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.hook-list li, .session-list li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface-2); }
.hook-list li.off { opacity: .6; }
.hook-list li > div:not(.hook-act), .session-list li > div { flex: 1; min-width: 0; display: grid; gap: 2px; }
.hook-list small, .session-list small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hook-act { display: flex; gap: 6px; align-items: center; }
.hook-badge { flex: none; min-width: 64px; text-align: center; padding: 5px 8px; border-radius: 8px; font-size: 11.5px; font-weight: 750; background: var(--plate-bg); color: var(--plate-ink); }
.kind-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 12px; }
.session-list li.current { border-color: var(--blue-line); }
.avatar.small { width: 30px; height: 30px; font-size: 11px; flex: none; }
.sub-h small { font-weight: 500; font-size: 12px; margin-left: 6px; }

/* 两步验证 */
.totp-steps { margin: 0 0 14px; padding-left: 20px; display: grid; gap: 14px; }
.totp-steps p { margin: 4px 0 10px; color: var(--muted); font-size: 13px; }
.totp-steps details { margin-top: 8px; font-size: 12.5px; color: var(--muted); }
code.wrap { display: block; word-break: break-all; margin-top: 6px; font-size: 11.5px; }
.otp-field input { font-family: var(--mono); font-size: 20px; letter-spacing: .35em; text-align: center; }

/* 配置导入导出 */
.config-actions { display: grid; gap: 4px; }
.row-gap { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.check.small { font-size: 12.5px; }
.file-btn { cursor: pointer; }
.import-plan { margin-top: 14px; padding: 14px; border-radius: var(--r); border: 1px dashed var(--blue-line); background: color-mix(in srgb, var(--blue-bg) 50%, transparent); }
.plan-sum { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; }
.plan-sum .muted { margin-left: auto; font-size: 12px; }

/* 实验室 · 测试请求 */
.tester-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1100px) { .tester-grid { grid-template-columns: 1fr; } }
.tester .form-grid { grid-template-columns: 1.3fr .9fr 1fr; }
@media (max-width: 720px) { .tester .form-grid { grid-template-columns: 1fr; } }
.tester-result { border-radius: var(--r); border: 1px solid var(--line); overflow: hidden; }
.tester-result.ok { border-color: color-mix(in srgb, var(--lime) 60%, transparent); }
.tester-result.bad { border-color: color-mix(in srgb, var(--red) 45%, transparent); }
.tr-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px; background: var(--surface-2); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.tr-head .link { margin-left: auto; }
.tester-result pre { margin: 0; border-radius: 0; max-height: 300px; }
.tester-empty { display: grid; place-items: center; gap: 8px; min-height: 220px; border-radius: var(--r); border: 1px dashed var(--line-2); color: var(--muted); text-align: center; padding: 20px; background: var(--hatch); background-size: auto; }
.tester-empty p { margin: 0; max-width: 260px; font-size: 13px; background: var(--surface); padding: 6px 10px; border-radius: 8px; }

/* 帮助中心快捷入口 */
.help-quick { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 16px; }

/* 快捷键 */
.kbd-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.kbd-list li { display: flex; justify-content: space-between; align-items: center; padding: 7px 4px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
kbd { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 6px; border: 1px solid var(--line-2); border-bottom-width: 2px; background: var(--surface); font: 600 11.5px/1 var(--mono); color: var(--ink-2); }

/* 撤销 Toast */
.toast.has-undo { position: relative; overflow: hidden; padding-right: 8px; border-radius: 16px; }
.toast-undo { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; margin-left: 6px; padding: 6px 10px; border-radius: 10px; background: rgba(255, 255, 255, .14); font-weight: 750; font-size: 12.5px; }
[data-theme="dark"] .toast-undo { background: rgba(0, 0, 0, .1); }
.toast-undo:hover { background: rgba(255, 255, 255, .24); }
.toast-undo .ico svg { width: 14px; height: 14px; }
.toast-undo .ico { color: inherit !important; }
.toast-timer { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--lime); transform-origin: left; animation: toast-timer linear forwards; }
@keyframes toast-timer { to { transform: scaleX(0); } }

/* 月度账单 */
.statement { display: grid; gap: 6px; }
.st-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-end; padding-bottom: 14px; border-bottom: 1px solid var(--line-2); }
.st-head h2 { margin: 6px 0 2px; font-size: 22px; }
.st-head p { margin: 0; color: var(--muted); font-size: 13px; }
.st-total { text-align: right; display: grid; gap: 2px; }
.st-total b { font-size: 30px; font-weight: 850; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.st-total small { color: var(--muted); }
.st-table { font-size: 13px; }
.st-tools { display: flex; align-items: center; gap: 8px; justify-content: flex-end; margin-top: 14px; }
@media print {
  .printing-statement body > *:not(.modal-wrap) { display: none !important; }
  .printing-statement .modal-wrap { position: static; background: none; padding: 0; backdrop-filter: none; }
  .printing-statement .modal { box-shadow: none; border: 0; max-height: none; width: 100%; background: #fff; }
  .printing-statement .modal-head, .printing-statement .modal-foot, .printing-statement .no-print { display: none !important; }
  .printing-statement .statement * { color: #111 !important; }
}

/* 公开状态页 */
.status-page .std-main { max-width: 920px; margin: 0 auto; }
.status-hero { display: flex; align-items: center; gap: 18px; padding: 26px 28px; margin: 10px 0 18px; border-radius: 26px; background: var(--surface-grad); border: 1px solid var(--line-2); box-shadow: var(--shadow), var(--edge); }
.status-hero.ok { background: linear-gradient(120deg, rgba(130, 221, 45, .18), var(--surface) 60%); }
.status-hero.warn { background: linear-gradient(120deg, var(--amber-bg), var(--surface) 60%); }
.status-hero h1 { margin: 0 0 4px; font-size: 26px; letter-spacing: -.02em; }
.status-hero p { margin: 0; color: var(--muted); font-size: 13px; }
.status-dot { flex: none; width: 18px; height: 18px; border-radius: 50%; }
.status-dot.green { background: var(--lime); box-shadow: 0 0 0 6px rgba(130, 221, 45, .22); }
.status-dot.amber { background: #e3a628; box-shadow: 0 0 0 6px rgba(227, 166, 40, .22); }
.status-models { display: grid; gap: 0; padding: 6px 22px; }
.sm-row { padding: 18px 0; border-bottom: 1px solid var(--line); }
.sm-row:last-child { border-bottom: 0; }
.sm-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.sm-avail { margin-left: auto; font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; display: grid; justify-items: end; line-height: 1.1; }
.sm-avail small { font-weight: 500; font-size: 11px; color: var(--muted); }
.sm-days { display: flex; gap: 2px; height: 30px; }
.sm-days i { flex: 1; border-radius: 3px; background: var(--lime); }
.sm-days i.y { background: #e3a628; } .sm-days i.r { background: var(--red); background-image: var(--hatch); }
.sm-days i.none { background: var(--surface-3); }
.sm-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted-2); margin-top: 6px; }
.sm-inc { margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.sm-inc ul { list-style: none; padding: 6px 0 0; margin: 0; display: grid; gap: 6px; }
.sm-inc li { display: flex; gap: 10px; align-items: center; }
.center { text-align: center; }

/* 小屏：工具行换行、批量栏不吸顶 */
@media (max-width: 720px) {
  .col-anchor { margin-left: 0; }
  .batch-bar { position: static; border-radius: var(--r); }
  .top-list li { grid-template-columns: 18px minmax(0, 1fr) 70px 60px; }
  .top-list small { display: none; }
}
.st-tools select { min-width: 112px; }

/* ============================================================
   V1.11 组件层：强调色、环境光、空状态线稿、拓扑、雷达扫描、热力图、
   实时流滑入、总览自定义、值班模式、离线提示。纯 CSS / SVG，无外部资源。
   ============================================================ */

/* 35 强调色：替换「青柠 = 正常」这一角色的色值；承载文字的 --green 在浅/深色下对画布 ≥ 4.5:1 */
[data-accent="ocean"] { --lime: #2bb7cc; --green: #0b6a7a; --green-bg: rgba(43, 183, 204, .16); --glow-a: rgba(43, 183, 204, .07); }
[data-accent="amber"] { --lime: #f0b23a; --green: #875800; --green-bg: rgba(240, 178, 58, .18); --glow-a: rgba(240, 178, 58, .08); }
[data-theme="dark"][data-accent="ocean"] { --lime: #3cc8dc; --green: #5fd0e0; --green-bg: rgba(60, 200, 220, .16); --glow-a: rgba(60, 200, 220, .05); }
[data-theme="dark"][data-accent="amber"] { --lime: #f2b84a; --green: #f2c46a; --green-bg: rgba(242, 184, 74, .16); --glow-a: rgba(242, 184, 74, .05); }
.swatch { width: 12px; height: 12px; border-radius: 50%; display: inline-block; margin-right: 6px; vertical-align: -1px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); }
.sw-lime { background: #82dd2d; } .sw-ocean { background: #2bb7cc; } .sw-amber { background: #f0b23a; }

/* 36 环境光：按本地时段给画布叠一层极淡色温；关闭或减少动效时不过渡 */
html::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: 0; transition: opacity 2s ease, background 2s ease; }
html[data-ambient="dawn"]::after { background: radial-gradient(70% 50% at 10% 0%, rgba(255, 196, 140, .07), transparent 70%); opacity: 1; }
html[data-ambient="day"]::after { background: radial-gradient(70% 50% at 85% 0%, rgba(255, 236, 190, .06), transparent 70%); opacity: 1; }
html[data-ambient="dusk"]::after { background: radial-gradient(80% 60% at 90% 10%, rgba(255, 150, 110, .07), transparent 70%); opacity: 1; }
html[data-ambient="night"]::after { background: radial-gradient(80% 60% at 15% 0%, rgba(90, 120, 255, .06), transparent 70%); opacity: 1; }
html[data-ambient="off"]::after { opacity: 0; }
.reduce-motion::after { transition: none; }
@media print { html::after { display: none; } }

/* 34 空状态：珍珠玻璃单色线稿 */
.empty-ico.art { width: 112px; height: 104px; background: none; border-radius: 0; color: var(--muted); margin-bottom: 4px; }
.empty-art { width: 112px; height: 104px; overflow: visible; }
.empty-art g { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.empty-art g .soft { stroke-opacity: .38; }
.empty-art g circle[r="3"] { fill: currentColor; }
.empty-art .sheen { fill: none; stroke: var(--blue); stroke-opacity: .22; stroke-width: 6; stroke-linecap: round; filter: blur(2px); }

/* 30 离线提示 */
.offline-banner { position: sticky; top: calc(var(--top) + 6px); z-index: 30; display: flex; align-items: center; gap: 8px; margin: 0 0 14px; padding: 10px 14px; border-radius: var(--r-sm); background: var(--plate-bg); color: var(--plate-ink); box-shadow: var(--shadow); font-size: 13px; }
.offline-banner .ico { color: #ffb84d; }

/* 31 新行滑入 + 脉冲 */
@keyframes row-slide { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes row-pulse { 0% { box-shadow: inset 3px 0 0 var(--lime), 0 0 0 0 color-mix(in srgb, var(--lime) 45%, transparent); } 70% { box-shadow: inset 3px 0 0 var(--lime), 0 0 0 8px transparent; } 100% { box-shadow: inset 3px 0 0 transparent; } }
tr.row-new td { animation: row-slide .42s cubic-bezier(.2, .8, .2, 1) both; }
tr.row-new td:first-child { animation: row-slide .42s cubic-bezier(.2, .8, .2, 1) both, row-pulse 1.6s ease-out .1s both; }
.reduce-motion tr.row-new td { animation: none !important; }
.tail-row.is-err td { background: color-mix(in srgb, var(--red-bg) 55%, transparent); }
.tail-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted-2); }
.live-dot.on { background: var(--lime); box-shadow: 0 0 0 3px var(--green-bg); animation: pulse-dot 2s infinite; }
.reduce-motion .live-dot.on { animation: none; }

/* 25 总览自定义 */
.dash-card { margin-bottom: 0; }
.dash-card.editing { position: relative; border: 1.5px dashed var(--blue-line); border-radius: calc(var(--r) + 6px); padding: 8px; margin-bottom: 14px; background: color-mix(in srgb, var(--blue-bg) 30%, transparent); cursor: grab; }
.dash-card.editing.off { opacity: .55; }
.dash-card.dragging { opacity: .4; }
.dash-handle { display: flex; align-items: center; gap: 8px; padding: 2px 6px 8px; font-size: 13px; }
.dash-handle .grip { color: var(--muted-2); letter-spacing: -2px; }
.dash-tools { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.dash-note { margin-bottom: 14px; align-items: center; }
.dash-note .btn { margin-left: 6px; }
.dash-note span { flex: 1; }

/* 32 路由拓扑 */
.topology { width: 100%; height: auto; display: block; }
.topo-line { fill: none; stroke: color-mix(in srgb, var(--lime) 75%, var(--ink) 10%); stroke-linecap: round; opacity: .85; }
.topo-line.warn { stroke: #e0a020; }
.topo-line.broken { stroke: var(--red); stroke-dasharray: 6 7; opacity: .9; }
.topo-line.off { stroke: var(--muted-2); stroke-dasharray: 2 6; opacity: .6; }
.topo-node { fill: var(--surface); stroke: var(--line-2); stroke-width: 1.2; }
.topo-node.bad { stroke: var(--red); }
.topo-node.off { stroke-dasharray: 3 4; }
.topo-hub { fill: var(--surface); stroke: var(--blue); stroke-width: 2; }
.topo-hub.off { stroke: #e0a020; stroke-dasharray: 4 4; }
.topo-text { fill: var(--ink-2); font-size: 12px; font-weight: 600; }
.topo-text.strong { font-size: 13px; fill: var(--ink); }
.topo-num { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.topo-dot { fill: var(--blue); }
.topo-break circle { fill: var(--surface); stroke: var(--red); stroke-width: 1.5; }
.topo-break path { stroke: var(--red); stroke-width: 1.6; stroke-linecap: round; }
.topo-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.topo-legend .lg { display: inline-block; width: 22px; height: 0; border-top: 3px solid var(--lime); vertical-align: middle; margin-right: 6px; }
.topo-legend .lg.warn { border-color: #e0a020; } .topo-legend .lg.broken { border-top-style: dashed; border-color: var(--red); } .topo-legend .lg.off { border-top-style: dotted; border-color: var(--muted-2); }

/* 33 雷达扫描 */
.radar-sweep-card { margin-bottom: 18px; }
.radar-wrap { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.radar-svg { width: min(100%, 300px); height: auto; flex: none; }
.radar-svg .ring { fill: none; stroke: var(--line-2); stroke-width: 1; }
.radar-svg .ring.outer { fill: color-mix(in srgb, var(--lime) 5%, transparent); stroke: color-mix(in srgb, var(--lime) 40%, var(--line-2)); }
.radar-svg .ring.cross { stroke-dasharray: 2 5; }
.radar-svg .sweep { transform-origin: 130px 130px; animation: radar-spin 4s linear infinite; }
.radar-svg .sweep.still, .reduce-motion .radar-svg .sweep { animation: none; transform: rotate(-35deg); }
.radar-svg .sweep-wedge { fill: color-mix(in srgb, var(--lime) 22%, transparent); }
.radar-svg .sweep-line { stroke: var(--lime); stroke-width: 2; stroke-linecap: round; }
.radar-svg .hub { fill: var(--lime); }
.blip { fill: var(--blue); stroke: var(--surface); stroke-width: 1.5; }
.blip.s-critical { fill: var(--red); } .blip.s-warning { fill: #e0a020; } .blip.s-notice { fill: var(--blue); }
.radar-svg .blip { animation: blip-glow 4s ease-in-out infinite; }
.reduce-motion .radar-svg .blip { animation: none; }
@keyframes radar-spin { to { transform: rotate(360deg); } }
@keyframes blip-glow { 0%, 100% { opacity: .65; } 50% { opacity: 1; } }
.radar-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 13px; }
.radar-legend li { display: flex; align-items: center; gap: 8px; }
.lg-blip { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; background: var(--blue); }
.lg-blip.s-critical { background: var(--red); } .lg-blip.s-warning { background: #e0a020; }
.pm-link { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 12px; }

/* 8 健康评分 */
.score-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.score-card { border: 1px solid var(--line); border-radius: var(--r); padding: 14px; background: var(--surface-grad); display: grid; gap: 6px; border-top: 3px solid var(--muted-2); }
.score-card.green { border-top-color: var(--lime); } .score-card.amber { border-top-color: #e0a020; } .score-card.red { border-top-color: var(--red); background-image: var(--hatch); }
.score-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; } .score-top .mono { color: var(--muted); font-size: 11px; }
.score-row { display: flex; align-items: center; gap: 12px; }
.score-num { font-size: 34px; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -.02em; color: var(--ink); }
.score-meta { display: grid; gap: 1px; color: var(--muted); font-size: 12px; }
.score-spark { width: 100%; height: 36px; }
.score-spark .line { fill: none; stroke: var(--blue); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.score-spark .target { stroke: var(--line-2); stroke-dasharray: 3 4; }

/* 9 小时延迟热力图 */
.lat-heat { display: grid; gap: 3px; overflow-x: auto; padding-bottom: 4px; }
.lh-row { display: grid; grid-template-columns: 28px repeat(24, minmax(14px, 1fr)); gap: 3px; align-items: center; }
.lh-day, .lh-hour { font-size: 11px; color: var(--muted); text-align: center; }
.lh-cell { display: block; height: 18px; border-radius: 4px; background: var(--surface-3); }
.lh-cell.l1 { background: color-mix(in srgb, var(--blue) 14%, var(--surface-3)); }
.lh-cell.l2 { background: color-mix(in srgb, var(--blue) 32%, var(--surface-3)); }
.lh-cell.l3 { background: color-mix(in srgb, var(--blue) 52%, var(--surface-3)); }
.lh-cell.l4 { background: color-mix(in srgb, #e0a020 70%, var(--surface-3)); }
.lh-cell.l5 { background: color-mix(in srgb, var(--red) 75%, var(--surface-3)); }
.lh-cell.slow { background-image: var(--hatch); }
.hm-legend i.lh-cell { display: inline-block; width: 14px; height: 12px; margin: 0 2px; vertical-align: middle; }

/* 4/5/17/12 表单、结果、时间线 */
.sandbox-form, .rule-form, .policy-form, .explain-form { display: grid; gap: 12px; }
.rule-form { grid-template-columns: minmax(140px, 1fr) minmax(180px, 2fr) minmax(110px, auto) auto auto; align-items: end; margin-top: 14px; }
.sandbox-result { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 14px; }
.sb-num { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px; display: grid; gap: 2px; background: var(--surface-grad); }
.sb-num b { font-size: 22px; font-variant-numeric: tabular-nums; }
.sb-num.good b { color: var(--green); } .sb-num.bad b { color: var(--red); }
.sb-num small { color: var(--muted); }
.explain-card { border: 1px solid var(--line); border-left: 3px solid var(--blue); border-radius: var(--r-sm); padding: 12px 14px; margin-top: 12px; background: var(--surface-grad); }
.explain-card.sev-error { border-left-color: var(--red); } .explain-card.sev-warning { border-left-color: #e0a020; }
.explain-card h3 { display: flex; align-items: center; gap: 6px; font-size: 15px; margin: 0 0 6px; }
.explain-card p { margin: 4px 0; font-size: 13px; } .explain-card p b { margin-right: 8px; color: var(--ink-2); }
.pm-list { list-style: none; margin: 0; padding: 0 0 0 4px; border-left: 2px solid var(--line-2); display: grid; gap: 2px; }
.pm-item { display: grid; grid-template-columns: 150px 110px 1fr; gap: 10px; align-items: start; padding: 8px 10px; position: relative; border-radius: var(--r-sm); }
.pm-item::before { content: ""; position: absolute; left: -10px; top: 15px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--muted-2); }
.pm-item.t-circuit::before { border-color: var(--red); } .pm-item.t-alert::before { border-color: #e0a020; } .pm-item.t-request::before { border-color: var(--blue); }
.pm-item:hover { background: var(--hover-bg); }
.pm-item time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pm-body p { margin: 2px 0 0; font-size: 13px; color: var(--body); }
.silence-list, .scope-list, .mini-list, .endpoint-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.silence-list li, .scope-list li, .mini-list li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); }
.silence-list small, .mini-list small { color: var(--muted); }
.scope-list li > span { flex: 1; display: flex; gap: 4px; flex-wrap: wrap; }
.check-list { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.endpoint-list li { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.endpoint-list small { color: var(--muted); }
.method { font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 6px; background: var(--blue-bg); color: var(--blue); min-width: 42px; text-align: center; }
.method.m-get { background: var(--green-bg); color: var(--green); }
.self-docs { margin-top: 18px; }
.span-2 { grid-column: 1 / -1; }

/* 29 值班模式（平板 / 手机，大按钮） */
.oncall { max-width: 760px; margin: 0 auto; display: grid; gap: 16px; }
.oncall-head h1 { display: flex; align-items: center; gap: 10px; font-size: 26px; margin: 0; }
.oncall-head p { color: var(--muted); margin: 4px 0 0; }
.oncall-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.oc-btn { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 72px; padding: 14px 18px; font: inherit; font-size: 17px; font-weight: 650; border-radius: 22px; border: 1px solid var(--line-2); background: var(--surface-grad); color: var(--ink); box-shadow: var(--shadow-sm); cursor: pointer; touch-action: manipulation; }
.oc-btn .ico { width: 24px; height: 24px; }
.oc-btn.stop { background: var(--red); color: #fff; border-color: transparent; }
.oc-btn.go { background: var(--blue); color: #fff; border-color: transparent; }
.oc-btn:disabled { opacity: .5; cursor: default; }
.oc-btn:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.oc-h { font-size: 18px; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.oc-h em { font-style: normal; font-size: 13px; padding: 1px 9px; border-radius: 999px; background: var(--grey-bg); }
.oc-row { display: flex; align-items: center; gap: 10px; padding: 14px 4px; border-bottom: 1px solid var(--line); font-size: 15px; flex-wrap: wrap; }
.oc-row:last-child { border-bottom: 0; }
.oc-row span { flex: 1; min-width: 160px; }
.oc-row small { color: var(--muted); }
.oc-row.bad b { color: var(--red); }
.oc-small { min-height: 44px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; }
.oc-ok { display: flex; align-items: center; gap: 8px; color: var(--green); font-size: 15px; }
.oncall-btn { display: inline-grid; place-items: center; }
@media (max-width: 960px) { .oncall-btn { display: none; } .rule-form { grid-template-columns: 1fr 1fr; } .pm-item { grid-template-columns: 1fr; } .sandbox-result { grid-template-columns: 1fr; } }
