/* ============ 擎曜中控平台 - 全局样式 ============ */
:root {
  --bg-0: #070b14;
  --bg-1: #0d1424;
  --bg-2: #141d33;
  --surface: rgba(20, 29, 51, 0.72);
  --surface-solid: #141d33;
  --border: rgba(0, 212, 255, 0.14);
  --border-strong: rgba(0, 212, 255, 0.32);
  --text: #e6edf6;
  --text-dim: #8b9bb8;
  --text-mute: #5b6a88;
  --accent: #00d4ff;
  --accent-2: #7c5cff;
  --ok: #2ed573;
  --warn: #ffa502;
  --danger: #ff4757;
  --radius: 14px;
  --radius-sm: 9px;
  --font-sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", "Cascadia Code", monospace;
  /* 主题相关派生色（各 data-theme 覆盖） */
  --topbar-bg: rgba(7, 11, 20, 0.8);
  --panel-bg: rgba(7, 11, 20, 0.6);
  --hero-grad-from: #ffffff;
  --json-bg: #0a0f1c;
}

/* ============ 主题：纯黑 ============ */
:root[data-theme="black"] {
  --bg-0: #000000;
  --bg-1: #0b0b0b;
  --bg-2: #141414;
  --surface: rgba(22, 22, 22, 0.72);
  --surface-solid: #141414;
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.26);
  --text: #ececec;
  --text-dim: #9a9a9a;
  --text-mute: #666666;
  --topbar-bg: rgba(0, 0, 0, 0.85);
  --panel-bg: rgba(0, 0, 0, 0.55);
  --hero-grad-from: #ffffff;
  --json-bg: #050505;
}
:root[data-theme="black"] body::before { display: none; }
:root[data-theme="black"] body::after { opacity: 0.3; }

/* ============ 主题：亮白 ============ */
:root[data-theme="light"] {
  --bg-0: #eef2f8;
  --bg-1: #ffffff;
  --bg-2: #f6f8fc;
  --surface: rgba(255, 255, 255, 0.85);
  --surface-solid: #ffffff;
  --border: rgba(20, 40, 80, 0.10);
  --border-strong: rgba(20, 40, 80, 0.22);
  --text: #1c2740;
  --text-dim: #5a6a85;
  --text-mute: #8b98b0;
  --accent: #0284c7;
  --accent-2: #6d5ae0;
  --ok: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
  --topbar-bg: rgba(255, 255, 255, 0.82);
  --panel-bg: rgba(255, 255, 255, 0.7);
  --hero-grad-from: #0f1c33;
  --json-bg: #f6f8fb;
}
:root[data-theme="light"] body::before {
  background-image:
    linear-gradient(rgba(2, 132, 199, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(2, 132, 199, 0.05) 1px, transparent 1px);
}
:root[data-theme="light"] body::after {
  background:
    radial-gradient(ellipse 60% 50% at 15% 10%, rgba(2, 132, 199, 0.08), transparent 60%),
    radial-gradient(ellipse 50% 45% at 85% 90%, rgba(109, 90, 224, 0.08), transparent 60%);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* 按钮和工具条自己写了 display，不能把 hidden 顶掉 */
[hidden] { display: none !important; }

html, body {
  height: 100%;
  font-family: var(--font-sans);
  background: var(--bg-0);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
html.page-bright,
body.page-bright {
  background: var(--page-bg, #f4f6f8);
  color: var(--ink, #1c2740);
}

/* 背景：网格 + 光晕 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 212, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.04) 1px, transparent 1px);
  background-size: 44px 44px;
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 15% 10%, rgba(0, 212, 255, 0.12), transparent 60%),
    radial-gradient(ellipse 50% 45% at 85% 90%, rgba(124, 92, 255, 0.12), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

#app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

/* ============ 顶部导航 ============ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--topbar-bg);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
  white-space: nowrap;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.brand .logo {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center;
  font-weight: 800; color: #06101e; font-size: 16px;
  box-shadow: 0 0 24px rgba(0, 212, 255, 0.4);
}
.back-home {
  display: inline-flex;
  align-items: center;
  margin: 0 0 18px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}
.back-home:hover { background: color-mix(in srgb, var(--accent) 12%, var(--card)); }
.page-titlebar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
}
.page-titlebar .back-home,
.page-titlebar h2,
.page-titlebar .page-title-side {
  height: 36px;
  min-height: 36px;
  max-height: 36px;
  box-sizing: border-box;
}
.page-titlebar .back-home {
  margin: 0;
  justify-self: start;
  padding: 0 12px;
  font-size: 13px;
  line-height: 1;
  font-weight: 650;
}
.page-titlebar h2 {
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 16px;
  line-height: 1;
  font-weight: 650;
}
.page-titlebar .logo {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  font-size: 12px;
  box-shadow: none;
  flex: none;
}
.page-title-side { justify-self: end; display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; }
.page-titlebar .page-title-side .btn {
  height: 36px;
  min-height: 36px;
  padding: 0 12px;
  font-size: 13px;
  line-height: 1;
  box-sizing: border-box;
}
.page-titlebar .sel-info { font-size: 13px; line-height: 1; white-space: nowrap; }
.page-title-sub {
  margin: -6px 0 14px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.5;
}
.brand .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 10px var(--ok);
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }

.nav-links { display: flex; gap: 6px; flex-wrap: nowrap; min-width: 0; }
.nav-links a {
  white-space: nowrap;
  color: var(--text-dim);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  transition: all .2s;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--accent);
  background: rgba(0, 212, 255, 0.08);
}

/* ============ 容器 ============ */
.container { max-width: 1280px; margin: 0 auto; padding: 36px 32px; }

/* ============ 首页 Hero ============ */
.hero {
  text-align: center;
  padding: 60px 20px 40px;
}
.hero h1 {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: 2px;
  background: linear-gradient(135deg, var(--hero-grad-from), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 14px;
}
.hero p { color: var(--text-dim); font-size: 16px; max-width: 620px; margin: 0 auto; line-height: 1.7; }

/* ============ 平台卡片 ============ */
.platform-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  margin-top: 48px;
}
.platform-card {
  position: relative;
  padding: 36px 30px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  overflow: hidden;
  transition: all .3s cubic-bezier(.2,.8,.2,1);
  backdrop-filter: blur(8px);
}
.platform-card::before {
  content: "";
  position: absolute;
  top: -50%; right: -50%;
  width: 200px; height: 200px;
  background: radial-gradient(circle, var(--card-glow, var(--accent)) 0%, transparent 70%);
  opacity: 0;
  transition: opacity .4s;
}
.platform-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-strong);
  box-shadow: 0 20px 60px rgba(0,0,0,.5), 0 0 30px rgba(0,212,255,.1);
}
.platform-card:hover::before { opacity: .25; }
.platform-card .icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--card-color-a, var(--accent)), var(--card-color-b, var(--accent-2)));
  display: grid; place-items: center;
  font-size: 26px;
  margin-bottom: 20px;
  box-shadow: 0 8px 24px rgba(0,212,255,.25);
}
.platform-card h3 { font-size: 22px; margin-bottom: 10px; }
.platform-card p { color: var(--text-dim); font-size: 14px; line-height: 1.7; }
.platform-card .arrow {
  margin-top: 20px;
  color: var(--accent);
  font-size: 14px;
  display: flex; align-items: center; gap: 6px;
  transition: gap .2s;
}
.platform-card:hover .arrow { gap: 12px; }

/* ============ 通用按钮 ============ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px;
  border: 1px solid var(--border-strong);
  background: rgba(0, 212, 255, 0.08);
  color: var(--accent);
  border-radius: var(--radius-sm);
  font-size: 14px; font-family: var(--font-sans);
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
}
.btn:hover { background: rgba(0, 212, 255, 0.16); }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #06101e;
  border: none;
  font-weight: 600;
}
.btn.primary:hover { filter: brightness(1.1); }
.btn.danger { color: var(--danger); border-color: rgba(255,71,87,.4); background: rgba(255,71,87,.08); }
.btn.danger:hover { background: rgba(255,71,87,.16); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ============ 页面标题 ============ */
.page-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 28px;
}
.page-head h2 { font-size: 26px; font-weight: 700; }
.page-head .sub { color: var(--text-dim); font-size: 13px; margin-top: 4px; }

/* ============ 账号卡片 ============ */
.account-list { display: grid; gap: 18px; }
.account-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  backdrop-filter: blur(8px);
}
.account-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.account-name { font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.account-model {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 3px 10px;
  background: rgba(124, 92, 255, 0.15);
  color: var(--accent-2);
  border-radius: 20px;
}
.account-meta {
  display: flex; gap: 24px; flex-wrap: wrap;
  color: var(--text-dim); font-size: 13px;
  font-family: var(--font-mono);
}
.account-actions { display: flex; gap: 10px; margin-top: 16px; }

/* ============ 报表区域 ============ */
.report-panel {
  margin-top: 18px;
  padding: 20px;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: none;
}
.report-panel.show { display: block; animation: fadeUp .3s ease; }
@keyframes fadeUp { from{opacity:0; transform:translateY(8px)} to{opacity:1; transform:translateY(0)} }

.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.report-card {
  padding: 16px;
  border-radius: 10px;
  background: var(--bg-2);
  border: 1px solid var(--border);
}
.report-card h4 { font-size: 13px; color: var(--text-mute); margin-bottom: 10px; text-transform: uppercase; letter-spacing: 1px; }
.report-card .val { font-size: 22px; font-weight: 700; font-family: var(--font-mono); }
.report-card.ok { border: 1px solid var(--ok); box-shadow: 0 0 0 1px var(--ok); }
.report-card.warn { border: 1px solid var(--warn); box-shadow: 0 0 0 1px var(--warn); }
.report-card.bad { border: 1px solid var(--danger); box-shadow: 0 0 0 1px var(--danger); }

.status-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
}
.status-tag.ok { background: rgba(46,213,115,.15); color: var(--ok); }
.status-tag.warn { background: rgba(255,165,2,.15); color: var(--warn); }
.status-tag.bad { background: rgba(255,71,87,.15); color: var(--danger); }
.status-tag .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.findings-list { list-style: none; margin-top: 8px; }
.findings-list li {
  padding: 6px 0;
  font-size: 13px;
  color: var(--text-dim);
  border-bottom: 1px dashed var(--border);
}
.findings-list li:last-child { border-bottom: none; }

/* ============ 表单 ============ */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.form-row .full { grid-column: 1 / -1; }
label { display: block; font-size: 12px; color: var(--text-mute); margin-bottom: 6px; }
input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-family: var(--font-mono);
  outline: none;
  transition: border-color .2s;
}
input:focus { border-color: var(--accent); }

/* ============ 监控/分析 仪表盘 ============ */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}
.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  backdrop-filter: blur(8px);
}
.metric-card .label { font-size: 12px; color: var(--text-mute); text-transform: uppercase; letter-spacing: 1px; }
.metric-card .value { font-size: 32px; font-weight: 800; font-family: var(--font-mono); margin: 8px 0 4px; }
.metric-card .delta { font-size: 12px; color: var(--text-dim); }
.metric-card .delta.up { color: var(--ok); }
.metric-card .delta.down { color: var(--danger); }

.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 18px;
  backdrop-filter: blur(8px);
}
.chart-card h3 { font-size: 16px; margin-bottom: 16px; }

.bar-chart { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: flex; align-items: center; gap: 12px; cursor: pointer; transition: opacity .32s ease; }
.bar-row .name { width: 140px; font-size: 13px; color: var(--text-dim); transition: color .32s ease; }
.bar-row .track { flex: 1; height: 36px; background: var(--bg-1); border-radius: 8px; overflow: hidden; transition: background .32s ease; }
.bar-row .fill {
  height: 100%; border-radius: 6px;
  background-color: var(--bar, var(--accent));
  background-image: linear-gradient(100deg, transparent 0%, color-mix(in srgb, white 72%, transparent) 50%, transparent 100%);
  background-repeat: no-repeat;
  background-size: 42% 100%;
  background-position: -60% 0;
  transition: width .6s ease, filter .32s ease;
}
.bar-row .num { width: auto; min-width: 52px; padding-left: 8px; text-align: right; font-family: var(--font-mono); font-size: 12px; color: var(--text-mute); white-space: nowrap; }
.bar-chart:hover .bar-row,
.bar-chart.is-dim .bar-row { opacity: 0.4; }
.bar-chart:hover .bar-row:hover,
.bar-chart.is-dim .bar-row.on { opacity: 1; }
.bar-row:hover .fill,
.bar-row.on .fill { animation: bar-sheen .65s ease; }
@keyframes bar-sheen {
  from { background-position: -60% 0; }
  to { background-position: 160% 0; }
}
.bar-row:hover .name,
.bar-row.on .name { color: var(--text); }
.bar-row:hover .track,
.bar-row.on .track { background: var(--border); }
.usage-filters { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 22px; }
.usage-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.usage-group > span { width: 72px; color: var(--text-mute); font-size: 13px; flex: none; }
.usage-group button {
  border: 1px solid var(--border-strong); background: var(--bg-1); color: var(--text);
  border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: 13px;
}
.usage-group button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.usage-hour { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-size: 13px; }
.usage-hour select {
  border: 1px solid var(--border-strong); background: var(--bg-1); color: var(--text);
  border-radius: 999px; padding: 6px 12px; font-size: 13px;
}
.monitor-quad {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  align-content: start;
}
.monitor-quad > .chart-card,
.monitor-quad-empty {
  margin: 0; min-height: 0;
}
.monitor-quad > .chart-card {
  display: flex; flex-direction: column;
}
.monitor-quad .usage-trend {
  flex: 1; min-width: 0; overflow: visible;
  display: flex; flex-direction: column;
}
.monitor-quad .usage-svg { flex: none; min-width: 0; height: 168px; }
.monitor-quad .usage-legend { margin-top: 8px; padding-top: 0; }
.monitor-quad .bar-chart { flex: none; gap: 6px; overflow: hidden; }
.monitor-quad .usage-legend { gap: 4px 10px; font-size: 11px; }
.monitor-quad .chart-card .bar-row { gap: 10px; }
.monitor-quad .bar-row .track { flex: 1 1 0; height: 12px; min-width: 72px; }
.monitor-quad .chart-card .bar-row .name { width: auto; flex: 0 1 180px; max-width: 40%; min-width: 0; font-size: 12px; line-height: 1.3; }
.monitor-quad-empty {
  height: auto;
  border: 0;
  background: transparent;
}
.usage-empty { color: var(--text-mute); font-size: 13px; padding: 8px 0 4px; }
.usage-note { color: var(--text-mute); font-size: 12px; min-height: 18px; margin: -12px 0 12px; }
.station-alert {
  flex: none;
  margin: 0 0 8px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--danger);
  background: color-mix(in srgb, var(--danger) 16%, var(--bg-1));
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
}
.station-alert:empty { display: none; }
.amount-unread { color: var(--danger); font-weight: 600; }
.usage-trend { overflow: visible; position: relative; }
.usage-trend.is-scroll { overflow-x: auto; overflow-y: hidden; }
.chart-grid { stroke: var(--border); stroke-width: 1; pointer-events: none; }
.chart-baseline { stroke: var(--border); stroke-width: 1.25; pointer-events: none; }
.chart-band { fill: transparent; pointer-events: none; }
.chart-band.on { fill: rgba(148, 163, 184, 0.18); }
.chart-hit { fill: transparent; cursor: pointer; }
.chart-tip {
  position: absolute; z-index: 4; min-width: 180px; max-width: 280px;
  padding: 10px 12px; background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 10px 28px rgba(36, 28, 58, 0.12); font-size: 12px; color: var(--ink);
  pointer-events: none;
}
.chart-tip[hidden] { display: none; }
.chart-tip-title { font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.chart-tip-row { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.chart-tip-row span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart-tip-row b { font-weight: 650; color: var(--ink); }
.chart-tip-row i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.chart-tip-total { margin-bottom: 4px; }
.usage-svg { width: 100%; min-width: 0; height: 168px; display: block; }
.usage-svg.is-wide { width: auto; max-width: none; }
.chart-peak { margin: 0 0 4px; color: var(--text-mute); font-size: 13px; font-variant-numeric: tabular-nums; }
.trend-stats { display: flex; flex-direction: column; gap: 8px; }
.trend-stat { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; color: var(--text-dim); font-size: 13px; }
.trend-stat b { color: var(--heading); font-size: 13px; font-weight: 600; }
.trend-stat i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.usage-axis { fill: var(--text-mute); font-size: 11px; }
.usage-legend { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 8px; font-size: 12px; color: var(--text-dim); }
.usage-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.chart-card .bar-row .name { width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#model-chart .bar-row { cursor: pointer; }
.board-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 16px; }
.board-tabs button, .board-chart-head .usage-group button {
  border: 1px solid var(--border-strong); background: var(--bg-1); color: var(--text);
  border-radius: 999px; padding: 7px 14px; cursor: pointer; font-size: 13px;
}
.board-tabs button.on, .board-chart-head .usage-group button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.board-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.reliability-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.reliability-table { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
.reliability-table th, .reliability-table td { padding: 10px 12px; text-align: right; border-bottom: 1px solid var(--border); white-space: normal; word-break: break-word; }
.reliability-table th:first-child, .reliability-table td:first-child,
.reliability-table th:nth-child(2), .reliability-table td:nth-child(2) { text-align: left; }
.reliability-table th { color: var(--muted); font-weight: 650; font-size: 12px; }
.reliability-table td { color: var(--ink); font-family: var(--font-mono); }
.reliability-table td:first-child, .reliability-table td:nth-child(2) { font-family: var(--font-sans); }
.metric-card { position: relative; }
.chart-card { position: relative; }
.help-wrap { position: relative; flex: none; }
.metric-card .help-wrap { position: absolute; top: 10px; right: 10px; z-index: 2; }
.board-stats .metric-card { padding: 16px; }
.head-tools { display: flex; align-items: center; gap: 8px; }
.help-btn {
  width: 22px; height: 22px; border-radius: 50%; padding: 0;
  border: 1px solid var(--border); background: var(--card); color: var(--accent);
  font-size: 13px; font-weight: 700; line-height: 20px; cursor: pointer;
}
.help-btn[aria-expanded="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.help-pop {
  position: absolute; z-index: 30; top: calc(100% + 8px); right: 0;
  width: min(340px, calc(100vw - 16px)); margin: 0; padding: 12px 14px;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(36, 28, 58, 0.14);
  color: var(--ink); font-size: 13px; font-weight: 450; line-height: 1.7; text-align: left;
}
.help-pop[hidden] { display: none; }
.board-stats .value { font-size: 26px; }
.board-chart-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.board-chart-head h3 { margin: 0; }
.board-chart-head h3 span { margin-left: 8px; color: var(--text-mute); font-size: 13px; font-weight: 500; }
#flow-chart { position: relative; }
.flow-plot { width: 100%; height: 220px; min-height: 0; overflow: hidden; flex: none; }
.flow-svg { width: 100%; height: 220px; display: block; }
.flow-col-title { fill: var(--text); font-size: 13px; font-weight: 650; }
.flow-ribbon { opacity: 0.55; cursor: pointer; transition: opacity .15s ease; }
.flow-svg.is-dim .flow-ribbon { opacity: 0.08; }
.flow-svg.is-dim .flow-ribbon.on,
.flow-ribbon.on { opacity: 0.9; }
.flow-svg.is-dim .flow-node { opacity: 0.28; }
.flow-svg.is-dim .flow-node.on { opacity: 1; }
.flow-card {
  box-sizing: border-box; height: 100%; padding: 6px 10px;
  border: 1px solid var(--border); border-left-width: 4px; border-radius: 8px;
  display: flex; flex-direction: column; justify-content: center; gap: 2px;
  overflow: hidden; font-family: var(--font-sans);
}
.flow-card.is-compact { padding: 0 8px; }
.flow-card.is-compact span { display: none; }
.flow-card span { font-size: 11px; color: var(--text-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flow-card strong { font-size: 12px; font-weight: 650; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flow-caption { margin: 4px 0 0; color: var(--text-mute); font-size: 12px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flow-links { margin-top: 6px; min-height: 0; }
.flow-links-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.flow-links h4 { margin: 0; font-size: 14px; }
.flow-links .bar-row .num { width: 58px; min-width: 0; padding-left: 0; color: var(--accent); font-weight: 650; }
.flow-links .bar-row { cursor: pointer; }
.flow-links.is-dim .bar-row { opacity: 0.4; }
.flow-links.is-dim .bar-row.on,
.flow-links .bar-row.on { opacity: 1; }
#flow-chart .flow-links .bar-row .name { width: auto; flex: 1.2 1 0; min-width: 0; }
.flow-links .bar-row .track { flex: 1; }
.flow-arrow { color: var(--accent); margin: 0 4px; }

body.page-bright:has(#board-tabs),
body.page-bright:has(#board-tabs) #app {
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}
html[data-nav="side"] body.page-bright:has(#board-tabs) #app {
  min-height: 0;
  align-items: stretch;
}
html:not([data-nav="side"]) body.page-bright:has(#board-tabs) #app {
  display: flex;
  flex-direction: column;
}
html:not([data-nav="side"]) body.page-bright:has(#board-tabs) .topbar {
  position: static;
  flex: none;
}
body.page-bright:has(#board-tabs) main.container {
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
}
html:not([data-nav="side"]) body.page-bright:has(#board-tabs) main.container {
  flex: 1;
  height: auto;
}
body.page-bright:has(#board-tabs) .page-titlebar { margin-bottom: 8px; }
body.page-bright:has(#board-tabs) .page-title-sub { margin: 0 0 8px; font-size: 13px; line-height: 1.4; }
body.page-bright:has(#board-tabs) .usage-filters { gap: 3px; margin: 0 0 4px; }
body.page-bright:has(#board-tabs) .usage-group { gap: 4px; }
body.page-bright:has(#board-tabs) .usage-group > span { width: 40px; font-size: 12px; }
body.page-bright:has(#board-tabs) .usage-group button,
body.page-bright:has(#board-tabs) .board-tabs button,
body.page-bright:has(#board-tabs) .usage-hour select {
  padding: 2px 8px;
  font-size: 12px;
  line-height: 1.4;
}
body.page-bright:has(#board-tabs) .board-tabs { gap: 4px; margin: 0 0 4px; }
body.page-bright:has(#board-tabs) .usage-note:empty { display: none; }
body.page-bright:has(#board-tabs) .station-alert { margin: 0 0 4px; padding: 6px 10px; }
body.page-bright:has(#board-tabs) [data-panel="sales"] .chart-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
body.page-bright:has(#board-tabs) #sales-list { flex: 1; min-height: 0; overflow: auto; }
body.page-bright:has(#board-tabs) .board-stats { gap: 6px; margin-bottom: 6px; }
body.page-bright:has(#board-tabs) .board-stats .metric-card { padding: 6px 10px; border-radius: 12px; }
body.page-bright:has(#board-tabs) .board-stats .label { letter-spacing: 0; font-size: 11px; }
body.page-bright:has(#board-tabs) .board-stats .value { font-size: 18px; margin: 1px 0; }
body.page-bright:has(#board-tabs) .board-stats .delta { font-size: 11px; }
body.page-bright:has(#board-tabs) [data-panel]:not([hidden]) {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
body.page-bright:has(#board-tabs) [data-panel="models"]:not([hidden]) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: start;
  align-content: start;
  gap: 12px;
  flex: 0 0 auto;
  overflow: visible;
}
body.page-bright:has(#board-tabs) [data-panel="models"] > .chart-card,
body.page-bright:has(#board-tabs) [data-panel="models"] > .monitor-quad-empty {
  height: auto;
  min-height: 0;
  overflow: visible;
}
body.page-bright:has(#board-tabs) [data-panel]:not([hidden]) > .chart-card {
  flex: 1;
  min-height: 0;
}
body.page-bright:has(#board-tabs) .monitor-quad {
  min-height: 0;
}
body.page-bright:has(#board-tabs) .chart-card {
  padding: 8px 10px;
  margin-bottom: 0;
  border-radius: 14px;
}
body.page-bright:has(#board-tabs) .board-chart-head { margin-bottom: 4px; }
body.page-bright:has(#board-tabs) [data-panel="flow"]:not([hidden]) > .chart-card,
body.page-bright:has(#board-tabs) [data-panel="users"]:not([hidden]) > .chart-card {
  flex: 0 0 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
body.page-bright:has(#board-tabs) #flow-chart {
  flex: 0 0 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: auto;
}
body.page-bright:has(#board-tabs) .flow-plot { flex: none; height: 220px; }
body.page-bright:has(#board-tabs) .flow-links {
  flex: none;
  max-height: 168px;
  overflow: auto;
}
body.page-bright:has(#board-tabs) #flow-chart .bar-chart { gap: 3px; }
body.page-bright:has(#board-tabs) #flow-chart .bar-row .track { height: 14px; }
body.page-bright:has(#board-tabs) [data-panel="flow"]:not([hidden]),
body.page-bright:has(#board-tabs) [data-panel="users"]:not([hidden]) { overflow: auto; }
body.page-bright:has(#board-tabs) .monitor-quad > .chart-card { min-height: 0; height: auto; overflow: visible; }
body.page-bright:has(#board-tabs) [data-panel="models"] .usage-trend { overflow: visible; }
body.page-bright:has(#board-tabs) [data-panel="models"] .usage-trend.is-scroll { overflow-x: auto; overflow-y: hidden; }
@media (max-width: 700px) {
  .flow-links .bar-row { flex-wrap: wrap; }
  #flow-chart .flow-links .bar-row .name,
  #flow-chart .flow-links .bar-row .track { flex: 1 1 100%; }
}
@media (max-width: 900px) {
  .board-stats, .reliability-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reliability-table { width: 100%; }
  .monitor-quad,
  body.page-bright:has(#board-tabs) [data-panel="models"]:not([hidden]) {
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }
  .monitor-quad-empty { display: none; }
}

/* ============ 加载 ============ */
.spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ 空状态 ============ */
.empty { text-align: center; padding: 60px 20px; color: var(--text-mute); }

/* 响应式 */
@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
  .topbar { padding: 14px 16px; }
  .container { padding: 20px 16px; }
}

/* ============ 完整 JSON 结果区 ============ */
.json-details {
  margin-top: 14px;
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  padding: 8px 12px;
}
.json-details summary {
  cursor: pointer; font-size: 13px; color: var(--text-mute); user-select: none;
  font-family: var(--font-sans);
}
.json-details summary:hover { color: var(--accent); }
.json-details pre {
  margin-top: 10px; padding: 12px;
  background: var(--json-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font-mono); font-size: 12px; line-height: 1.6;
  color: var(--text-dim);
  max-height: 460px; overflow: auto;
  white-space: pre; word-break: break-all;
}

/* ============ 测试平台：明亮卡片 ============ */
html:has(body.page-bright) { background: var(--page-bg, #f4f6f8); }
html.page-bright {
  --page-bg: #f4f6f8;
  --glow-a: color-mix(in srgb, var(--accent) 8%, transparent);
  --glow-b: rgba(15, 23, 42, 0.04);
  --card: #ffffff;
  --input-bg: #f8fafc;
  --ink: #1c2740;
  --muted: #5a6a85;
  --heading: #0f1c33;
  --accent: #0284c7;
  --accent-2: #0369a1;
  --accent-strong: #075985;
  --bg-0: var(--page-bg);
  --bg-1: var(--card);
  --bg-2: #f1f5f9;
  --surface: var(--card);
  --surface-solid: var(--card);
  --border: rgba(15, 23, 42, 0.08);
  --border-strong: color-mix(in srgb, var(--accent) 28%, transparent);
  --text: var(--ink);
  --text-dim: var(--muted);
  --text-mute: #64748b;
  --ok: #047857;
  --warn: #b45309;
  --danger: #be123c;
  --topbar-bg: rgba(255, 255, 255, 0.9);
  --panel-bg: var(--card);
  --hero-grad-from: var(--heading);
  --json-bg: var(--input-bg);
}
body.page-bright {
  background:
    radial-gradient(720px 280px at 0% -12%, var(--glow-a), transparent 70%),
    radial-gradient(560px 240px at 100% -10%, var(--glow-b), transparent 68%),
    var(--page-bg);
  color: var(--ink);
}
body.page-bright::before,
body.page-bright::after { display: none; }
body.page-bright .topbar {
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
  box-shadow: none;
  backdrop-filter: blur(18px);
}
body.page-bright .brand { color: var(--heading); letter-spacing: 0; font-weight: 650; }
body.page-bright .nav-links a {
  color: var(--muted);
  border-radius: var(--style-radius, 10px);
  padding: 8px 14px;
  font-weight: 500;
}
body.page-bright .nav-links a:hover { color: var(--accent-strong); background: color-mix(in srgb, var(--accent) 10%, transparent); }
body.page-bright .nav-links a.active { color: #fff; background: var(--accent); }
body.page-bright .hero { padding: 72px 20px 28px; }
body.page-bright .hero h1 {
  color: var(--heading);
  background: none;
  -webkit-text-fill-color: currentColor;
}
body.page-bright .hero p { color: var(--muted); font-size: 16px; max-width: 640px; }
body.page-bright .platform-card {
  background: var(--card);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
body.page-bright .platform-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 28%, transparent);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}
body.page-bright .platform-card .icon {
  background: var(--accent);
  color: #fff;
  box-shadow: none;
}
body.page-bright .platform-card .icon svg { width: 26px; height: 26px; display: block; }
body.page-bright .page-title-sub { color: var(--muted); }
body.page-bright .page-head { align-items: flex-end; gap: 24px; }
body.page-bright .page-head h2 { color: var(--heading); }
body.page-bright .page-head .sub { max-width: 680px; margin-top: 8px; line-height: 1.65; color: var(--muted); }
body.page-bright .metric-card,
body.page-bright .account-card,
body.page-bright .chart-card {
  background: var(--card);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
body.page-bright .usage-group button,
body.page-bright .board-tabs button {
  background: var(--card);
  border-color: var(--border);
  border-radius: var(--style-radius, 10px);
  color: var(--muted);
}
body.page-bright .usage-group button.on,
body.page-bright .board-tabs button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
body.page-bright .usage-hour select {
  background: var(--card);
  border-color: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--muted);
}
body.page-bright h1,
body.page-bright h2,
body.page-bright h3,
body.page-bright h4 {
  color: var(--heading);
}
body.page-bright strong,
body.page-bright b { font-weight: 600; }
body.page-bright .metric-card .value,
body.page-bright .report-card .val {
  font-weight: 650;
  color: var(--heading);
  font-variant-numeric: tabular-nums;
}
body.page-bright .platform-card h3 { font-weight: 600; color: var(--heading); }
body.page-bright :focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  body.page-bright *,
  body.page-bright *::before,
  body.page-bright *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
body.page-bright .reliability-table td,
body.page-bright .model-card-name,
body.page-bright .check-row .name,
body.page-bright .mode-name,
body.page-bright .history-row .name { color: var(--muted); font-weight: 500; }
body.page-bright:has(.probe-card) .container { max-width: none; padding-top: 18px; }
body.page-bright .probe-card { max-width: none; margin-left: 0; margin-right: 0; }
body.page-bright .logo {
  color: #fff;
  box-shadow: none;
}
body.page-bright .pool-table tr.row:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
body.page-bright .pool-table tr.row.selected { background: color-mix(in srgb, var(--accent) 10%, transparent); }
body.page-bright .pool-table .model-tag {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
}

.bright-hero { text-align: center; padding: 18px 12px 22px; }
.bright-hero h2 {
  font-size: 40px;
  font-weight: 500;
  letter-spacing: 0.5px;
  color: var(--accent);
}
.bright-hero h2 em { font-style: normal; color: var(--accent); }
.bright-hero p { color: var(--muted); font-size: 14px; margin-top: 10px; }

body.page-bright .probe-card,
body.page-bright .suite-panel {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 28px;
  padding: 28px 28px 24px;
  box-shadow: 0 24px 60px color-mix(in srgb, var(--accent) 8%, transparent);
}
body.page-bright .field { margin-bottom: 16px; }
body.page-bright .field label,
body.page-bright .key-toggle { color: var(--muted); }
body.page-bright input {
  background: var(--input-bg, var(--card));
  border: 1px solid color-mix(in srgb, var(--accent) 10%, transparent);
  border-radius: 14px;
  color: var(--ink);
  padding: 14px 16px;
}
body.page-bright input::placeholder { color: var(--muted); }
body.page-bright input:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent);
}
body.page-bright .btn.primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--style-radius, 10px);
  padding: 12px 28px;
  box-shadow: none;
}
body.page-bright .btn.primary:hover { filter: brightness(1.05); }
body.page-bright .btn {
  border-radius: var(--style-radius, 10px);
  color: var(--ink);
  border-color: var(--border);
  background: var(--card);
}
body.page-bright .probe-actions {
  display: flex;
  justify-content: center;
  margin-top: 6px;
}
.suite-panel { margin-top: 18px; }
.key-toggle {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--muted); margin: 2px 0 8px;
}
.key-toggle input { width: auto; }
.url-combo { position: relative; }
body.page-bright .url-combo input,
.url-combo input { padding-right: 58px; }
.url-combo-btn {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  width: 48px; height: 48px; border: 0; border-radius: 14px;
  background: transparent; color: var(--accent);
  display: grid; place-items: center;
  cursor: pointer; font-family: var(--font-sans);
}
.url-combo-btn svg { width: 28px; height: 28px; display: block; transition: transform .18s ease; }
.url-combo-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.url-combo-btn:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.url-combo-list {
  position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 6px);
  margin: 0; padding: 6px; list-style: none;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 16px 40px color-mix(in srgb, var(--accent) 14%, transparent);
}
.url-combo-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px; border-radius: 10px; cursor: pointer;
}
.url-combo-list li:hover,
.url-combo-list li.on { background: color-mix(in srgb, var(--accent) 12%, var(--card)); }
.url-combo-list li span { color: var(--accent); font-size: 13px; font-weight: 700; flex: none; }
.url-combo-list li code {
  color: var(--ink); font-size: 12px; font-family: var(--font-mono);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.field-label-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.field-label-row label { margin-bottom: 6px; }
.key-reveal {
  border: 0; background: transparent; color: var(--accent);
  font-size: 13px; font-weight: 650; cursor: pointer;
  padding: 0 2px 6px; font-family: var(--font-sans);
}
.key-reveal:hover { color: var(--accent); }
.hint { color: var(--muted); font-size: 12px; }
html:has(body.page-bright .probe-card) { overflow: hidden; }
html[data-nav="side"] body.page-bright:has(.probe-card),
html[data-nav="side"] body.page-bright:has(.probe-card) #app {
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}
html[data-nav="side"] body.page-bright:has(.probe-card) #app { align-items: stretch; min-height: 0; }
html[data-nav="side"] body.page-bright:has(.probe-card) main.container,
html:not([data-nav="side"]) body.page-bright:has(.probe-card) main.container {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
}
html:not([data-nav="side"]) body.page-bright:has(.probe-card),
html:not([data-nav="side"]) body.page-bright:has(.probe-card) #app {
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}
html:not([data-nav="side"]) body.page-bright:has(.probe-card) #app { display: flex; flex-direction: column; }
html:not([data-nav="side"]) body.page-bright:has(.probe-card) .topbar { position: static; flex: none; }
html:not([data-nav="side"]) body.page-bright:has(.probe-card) main.container { flex: 1; height: auto; }
body.page-bright:has(.probe-card) .page-titlebar,
body.page-bright:has(#board-tabs) .page-titlebar { margin: 0 0 8px; flex: none; }
body.page-bright:has(.probe-card) .page-title-sub,
body.page-bright:has(#board-tabs) .page-title-sub {
  margin: 0 0 8px;
  flex: none;
  font-size: 13px;
  line-height: 1.4;
}
body.page-bright:has(.probe-card) .probe-card {
  flex: none;
  min-height: 0;
  padding: 10px 12px 8px;
  border-radius: 14px;
  box-shadow: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: 12px;
  align-content: start;
  overflow: hidden;
}
body.page-bright:has(.probe-card) .probe-card > :not(.field) { grid-column: 1 / -1; }
body.page-bright:has(.probe-card) .probe-card:has(#model-panel:not([hidden])) {
  flex: 0 1 auto;
  max-height: 48vh;
  overflow: hidden;
}
body.page-bright:has(.probe-card) .field { margin-bottom: 8px; }
body.page-bright:has(.probe-card) .field label,
body.page-bright:has(.probe-card) .field-label-row label,
body.page-bright:has(.probe-card) .pick-field span { margin-bottom: 2px; font-size: 12px; }
body.page-bright:has(.probe-card) input,
body.page-bright:has(.probe-card) .pick-field select {
  padding: 5px 10px;
  font-size: 13px;
  border-radius: 10px;
  line-height: 1.3;
}
body.page-bright:has(.probe-card) .url-combo-btn { width: 28px; height: 28px; right: 4px; border-radius: 8px; }
body.page-bright:has(.probe-card) .url-combo-btn svg { width: 16px; height: 16px; }
body.page-bright:has(.probe-card) .url-combo input { padding-right: 34px; }
body.page-bright:has(.probe-card) .key-reveal { font-size: 12px; padding: 0 2px 2px; }
body.page-bright:has(.probe-card) .model-head { margin: 10px 0 8px; }
body.page-bright:has(.probe-card) .model-head h3,
body.page-bright:has(.probe-card) .suite-head h3,
body.page-bright:has(.probe-card) .mode-name { font-size: 14px; }
body.page-bright:has(.probe-card) .model-cat { padding: 4px 10px; font-size: 13px; }
body.page-bright:has(.probe-card) #model-panel {
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
body.page-bright:has(.probe-card) .model-board {
  min-height: 0;
  overflow: hidden;
  gap: 6px;
}
body.page-bright:has(.probe-card) .model-grid {
  gap: 6px;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  align-content: start;
}
body.page-bright:has(.probe-card) .model-card { border-radius: 12px; padding: 6px 24px 6px 10px; }
body.page-bright:has(.probe-card) .model-card-name { font-size: 12px; }
body.page-bright:has(.probe-card) .model-card-owner { display: none; }
body.page-bright:has(.probe-card) .mode-card { border-radius: 12px; padding: 10px 32px 10px 12px; }
body.page-bright:has(.probe-card) .mode-desc { font-size: 12px; line-height: 1.4; }
body.page-bright:has(.probe-card) .run-bar { margin-top: 8px; gap: 6px; }
body.page-bright:has(.probe-card) .result-board {
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 8px;
  gap: 10px;
  align-items: stretch;
  overflow: hidden;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.15fr);
}
body.page-bright:has(.probe-card) .result-board .suite-panel {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  margin-top: 0;
  padding: 10px 12px;
  border-radius: 14px;
  box-shadow: none;
  display: flex;
  flex-direction: column;
}
body.page-bright:has(.probe-card) #history-detail,
body.page-bright:has(.probe-card) #suite-list {
  min-height: 0;
  overflow: hidden;
}
body.page-bright:has(.probe-card) #suite-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  align-content: start;
}
body.page-bright:has(.probe-card) .pick-field { margin-top: 8px; gap: 2px; }
body.page-bright:has(.probe-card) .check-row { padding: 8px 10px; border-radius: 10px; gap: 8px; }
body.page-bright:has(.probe-card) .suite-card { padding: 10px; border-radius: 12px; }
.probe-msg { margin-top: 8px; color: #e11d48; font-size: 13px; line-height: 1.45; text-align: center; }
.probe-msg.ok { color: var(--accent); }
.probe-msg:empty { display: none; }
.model-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin: 22px 0 14px;
}
.model-head h3 { font-size: 18px; color: var(--ink); }
.model-head-actions { display: flex; align-items: center; gap: 10px; }
.model-head input { max-width: 220px; }
.model-board { display: flex; flex-direction: column; gap: 14px; }
.model-cat-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px;
  padding: 4px;
  background: var(--bg-2, var(--card)); border: 1px solid var(--border); border-radius: 12px;
}
.model-cat {
  display: inline-flex; align-items: center; gap: 8px; flex: none;
  margin: 0; padding: 8px 14px;
  border: 1px solid transparent; border-radius: 10px; background: transparent;
  color: var(--ink); font-family: var(--font-sans); font-size: 14px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
}
.model-cat-icon { width: 16px; height: 16px; display: inline-flex; color: var(--ink); }
.model-cat-icon svg { width: 16px; height: 16px; display: block; }
.model-cat:hover { background: rgba(255, 255, 255, 0.7); }
.model-cat.on {
  background: var(--card); border-color: var(--border); color: var(--ink);
  box-shadow: 0 1px 2px rgba(22, 20, 29, 0.06);
}
.model-empty { color: var(--muted); font-size: 13px; padding: 8px 2px 18px; }
.model-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.model-card {
  position: relative;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 36px 14px 16px;
  cursor: pointer;
  color: var(--ink);
  font-family: var(--font-sans);
}
.model-card-check {
  display: none;
  position: absolute;
  top: 12px;
  right: 12px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}
.model-card.active .model-card-check { display: flex; }
.model-card-name { display: block; font-weight: 700; font-size: 15px; line-height: 1.35; }
.model-card-owner { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }
.model-card:hover, .model-card.active {
  border-color: var(--accent);
  background: var(--input-bg, var(--card));
  box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 12%, transparent);
}
.run-bar {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 8px; margin-top: 18px;
}
.run-kicker { font-size: 12px; color: var(--muted); }
.run-picks { display: flex; flex-wrap: wrap; gap: 8px; }
.run-pick {
  background: color-mix(in srgb, var(--accent) 12%, var(--card));
  color: var(--accent-strong);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 650;
}
.result-board {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.15fr);
  gap: 16px;
  align-items: start;
  margin-top: 18px;
}
.result-board .suite-panel { margin-top: 0; }
.pick-field { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.pick-field span { font-size: 12px; color: var(--muted); }
.pick-field select {
  width: 100%;
  border: 1px solid color-mix(in srgb, var(--accent) 16%, transparent);
  background: var(--input-bg, var(--card));
  color: var(--ink);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
}
.record-brief { margin: 12px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.record-brief:empty { display: none; }
.side-detail { margin-top: 12px; }
.suite-list { display: block; }
.suite-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  background: var(--card);
}
.suite-card h3 { font-size: 16px; margin: 0; }
.suite-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; margin: 0; padding: 0; border: 0; background: transparent;
  color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.suite-toggle .chev { color: var(--muted); font-size: 12px; font-weight: 650; flex: none; }
.suite-card:not(.open) .suite-body,
.suite-card:not(.open) [data-download] { display: none; }
.history-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}
.history-item { min-width: 0; }
.history-row {
  display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center;
  width: 100%; text-align: left; cursor: pointer;
  border: 1px solid var(--border); border-radius: 14px; background: var(--card);
  padding: 12px 14px; color: var(--ink); font: inherit;
}
.history-row .name { font-weight: 700; }
.history-row .meta { color: var(--muted); font-size: 13px; }
.history-row .station { color: var(--accent); font-weight: 650; }
.history-detail { margin: -4px 0 8px; }
.run-actions { display: flex; gap: 10px; }
.suite-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.suite-head h3, .suite-summary { color: var(--ink); }
body.page-bright .sub { color: var(--muted); }
.score { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.progress-track {
  height: 6px; border-radius: 99px; background: var(--border); overflow: hidden; margin-bottom: 12px;
}
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent-2), var(--accent)); transition: width .25s ease; }
.suite-summary { font-size: 13px; color: var(--muted); line-height: 1.7; margin-bottom: 12px; }
.check-list { display: flex; flex-direction: column; gap: 8px; }
.check-row {
  display: grid; grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 12px; align-items: start;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
}
.check-row.pass { border-color: rgba(22, 163, 74, 0.35); }
.check-row.warn { border-color: rgba(217, 119, 6, 0.4); }
.check-row.fail { border-color: rgba(225, 29, 72, 0.35); }
.check-row.running { border-color: var(--accent-2); }
.check-row.info { border-color: var(--border); }
.check-row .st { font-size: 12px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.check-row.pass .st { color: #16a34a; }
.check-row.warn .st { color: #d97706; }
.check-row.fail .st { color: #e11d48; }
.check-row.running .st, .check-row.info .st { color: var(--accent); }
.check-row.pending .st, .check-row.skip .st { color: var(--muted); }
.check-row .name { font-weight: 650; color: var(--ink); line-height: 1.45; }
.check-row .desc, .check-row .sum { color: var(--muted); font-size: 13px; margin-top: 3px; line-height: 1.55; }
.check-row .name, .check-row .desc, .check-row .sum { word-break: normal; overflow-wrap: anywhere; }
.check-row .meta { font-family: var(--font-mono); font-size: 12px; color: var(--muted); white-space: nowrap; text-align: right; }
.check-row details { margin-top: 8px; }
.check-row summary { cursor: pointer; color: var(--muted); font-size: 12px; }
.check-row pre {
  margin-top: 8px; white-space: pre-wrap; word-break: break-word;
  font-family: var(--font-mono); font-size: 12px; line-height: 1.6;
  color: var(--ink); background: var(--input-bg, var(--card));
  border-radius: 8px; padding: 10px;
}
@media (max-width: 900px) {
  .model-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mode-grid { grid-template-columns: 1fr; }
  .result-board { grid-template-columns: 1fr; }
}
.run-bar { align-items: stretch; text-align: left; gap: 14px; }
.mode-label { font-size: 13px; color: var(--muted); }
.mode-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
  align-items: stretch;
}
.mode-card {
  position: relative;
  height: 100%;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 18px 42px 16px 18px;
  cursor: pointer;
  text-align: left;
  color: var(--ink);
  font-family: var(--font-sans);
}
.mode-card.active {
  background: #eef8fb;
  border-color: #3db7e0;
  box-shadow: 0 0 0 1px #3db7e0;
}
.mode-name { font-weight: 700; font-size: 16px; margin-bottom: 6px; }
.mode-desc { font-size: 13px; color: var(--muted); line-height: 1.55; }
.mode-check {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #2f9fd0;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}
.mode-list {
  width: 100%;
  text-align: left;
  background: color-mix(in srgb, var(--accent) 12%, var(--card));
  border-radius: 16px;
  padding: 6px 16px 12px;
}
.mode-list summary { cursor: pointer; color: var(--muted); font-size: 14px; padding: 8px 0; }
.mode-list ol { margin: 4px 0 4px 0; padding: 0; list-style: none; }
.mode-list li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 7px 0;
  border-top: 1px solid color-mix(in srgb, var(--accent) 8%, transparent);
  font-size: 13px;
  line-height: 1.55;
}
.mode-list .item-name { flex: none; font-weight: 650; color: var(--ink); }
.mode-list .item-desc { color: var(--muted); }
.run-actions { justify-content: flex-start; }
.token-banner {
  flex-basis: 100%;
  margin-bottom: 4px;
  padding: 10px 14px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 12%, var(--card));
  color: var(--accent-strong);
  font-size: 14px;
}
.token-banner strong { font-size: 18px; }
.check-row .tok { color: var(--accent); font-weight: 650; }

.sales-page { max-width: none; }
.sales-hero { margin: 8px 0 22px; max-width: 760px; }
.sales-kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.sales-hero h2 { margin: 0; font-size: 40px; line-height: 1.1; letter-spacing: -0.03em; font-weight: 500; color: var(--heading, var(--accent)); }
.sales-hero .sub { margin: 12px 0 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.sales-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 14px; padding: 14px; border-radius: 20px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid color-mix(in srgb, var(--accent) 12%, transparent);
  box-shadow: 0 16px 40px color-mix(in srgb, var(--accent) 8%, transparent);
}
#sales-add { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
#sales-add input, .sales-search input, .sales-rename {
  border: 1px solid color-mix(in srgb, var(--accent) 16%, transparent);
  border-radius: 12px;
  padding: 11px 14px;
  background: var(--input-bg, var(--card));
  color: var(--ink);
  font-size: 14px;
}
#sales-add input { flex: 1; min-width: 160px; }
.sales-search { flex: none; width: min(320px, 36%); }
.sales-search input { width: 100%; }
.sales-jump, .sales-refresh {
  border: 1px solid color-mix(in srgb, var(--accent) 16%, transparent); background: var(--card); color: var(--accent);
  border-radius: 999px; padding: 6px 12px; font-size: 13px; text-decoration: none; cursor: pointer;
}
.sales-rank-card {
  border: 1px solid color-mix(in srgb, var(--accent) 12%, transparent); border-radius: 18px; padding: 16px 18px; background: var(--card);
  margin-top: 12px; box-shadow: 0 12px 32px color-mix(in srgb, var(--accent) 6%, transparent);
}
.sales-rank-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-bottom: 8px; }
.sales-rank-head strong { font-size: 17px; color: var(--heading); letter-spacing: -0.02em; font-weight: 500; }
.sales-rank-head span { color: var(--accent); font-variant-numeric: tabular-nums; font-weight: 500; }
.sales-user-table { margin-top: 4px; }
.sales-user-table th:nth-child(2),
.sales-user-table td:nth-child(2) { text-align: left; font-family: var(--font-mono); }
.sales-user-table th:nth-child(3),
.sales-user-table td:nth-child(3) { text-align: left; font-family: var(--font-sans); }
.sales-empty { color: var(--muted); font-size: 13px; padding: 18px 4px; }
.sales-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.sales-pool { position: relative; margin: 0; }
.sales-pool-toggle {
  width: 100%; display: flex; align-items: center; gap: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 16%, transparent); border-radius: 16px;
  background: var(--card); color: var(--ink); padding: 14px 16px; cursor: pointer; text-align: left;
  box-shadow: 0 12px 32px color-mix(in srgb, var(--accent) 8%, transparent);
}
.sales-pool-toggle span:first-child { font-size: 16px; font-weight: 500; color: var(--heading); }
.sales-pool-toggle span:nth-child(2) { color: var(--accent); font-variant-numeric: tabular-nums; font-weight: 500; }
.sales-pool-caret { margin-left: auto; color: var(--accent); }
.sales-pool-toggle[aria-expanded="true"] .sales-pool-caret { transform: rotate(180deg); }
.sales-pool-toggle.over { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.sales-pool-menu {
  position: absolute; z-index: 6; left: 0; right: 0; top: calc(100% + 8px);
  max-height: 360px; overflow: auto; padding: 8px 12px 14px;
  background: var(--card); border: 1px solid color-mix(in srgb, var(--accent) 16%, transparent); border-radius: 16px;
  box-shadow: 0 18px 44px color-mix(in srgb, var(--accent) 18%, transparent);
}
.sales-pool-menu.over { border-color: var(--accent); }
.sales-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  align-items: start;
}
.sales-col {
  background: var(--card);
  border: 1px solid color-mix(in srgb, var(--accent) 12%, transparent);
  border-radius: 22px;
  min-height: 220px;
  padding: 16px;
  box-shadow: 0 18px 44px color-mix(in srgb, var(--accent) 12%, transparent);
}
.sales-col.pool { background: linear-gradient(180deg, #f7f5fb 0%, #fff 42%); }
.sales-col.over { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.sales-col-head { display: flex; align-items: center; gap: 8px; min-height: 42px; }
.sales-col-head strong { font-size: 18px; letter-spacing: -0.02em; font-weight: 500; color: var(--heading); }
.sales-rename { flex: 1; min-width: 0; width: auto; font-weight: 500; color: var(--heading); }
.sales-remove {
  flex: none; white-space: nowrap;
  border: 0; border-radius: 999px; padding: 7px 12px;
  background: var(--card)1f2; color: #9f1239; cursor: pointer; font-size: 13px; font-weight: 650;
}
.sales-col-meta {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin: 14px 0 6px; color: var(--muted); font-size: 12px;
}
.sales-col-meta strong { color: var(--accent); font-size: 22px; letter-spacing: -0.03em; font-weight: 500; font-variant-numeric: tabular-nums; }
.sales-chip {
  background: var(--card); border: 1px solid color-mix(in srgb, var(--accent) 12%, transparent); border-radius: 16px;
  padding: 12px 14px; margin-top: 10px; cursor: grab;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 6%, transparent);
}
.sales-chip.dragging { opacity: 0.45; }
.sales-chip-row { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.sales-chip-row strong { font-size: 14px; font-weight: 500; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sales-chip-detail { color: var(--muted); font-size: 12px; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sales-chip-money { margin-top: 8px; color: var(--accent); font-variant-numeric: tabular-nums; font-size: 18px; font-weight: 500; letter-spacing: -0.02em; }
.sales-badge { flex: none; border-radius: 999px; padding: 3px 8px; font-size: 11px; font-weight: 700; background: color-mix(in srgb, var(--accent) 14%, var(--card)); color: var(--accent); }
.sales-badge.sub2api { background: #ecfeff; color: #0e7490; }
.sales-badge.octafuse { background: #ecfdf5; color: #047857; }
@media (max-width: 860px) {
  .sales-toolbar, #sales-add { flex-direction: column; align-items: stretch; }
  .sales-search { width: 100%; }
  .sales-hero h2 { font-size: 32px; }
  .sales-layout { grid-template-columns: 1fr; }
  .sales-pool-menu { position: static; margin-top: 8px; }
}

@media (max-width: 1100px) {
  .platform-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-board:has(#suite-panel:not([hidden])) { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .platform-grid { grid-template-columns: 1fr; }
  .bright-hero h2 { font-size: 30px; }
  .suite-head, .model-head { flex-direction: column; align-items: stretch; }
  .model-head input { max-width: none; }
  .model-grid, .mode-grid { grid-template-columns: 1fr; }
  .check-row { grid-template-columns: 72px 1fr; }
  .check-row .meta { grid-column: 2; }
}

/* ============ 外观：配色 ============ */
html[data-palette="mist"],
html[data-palette="mist"] body.page-bright {
  --page-bg: #f3f6fb; --glow-a: rgba(37, 99, 235, 0.16); --glow-b: rgba(125, 211, 252, 0.32);
  --accent: #2563eb; --accent-2: #93c5fd; --accent-strong: #1d4ed8; --heading: #1d4ed8;
  --ink: #334155; --muted: #64748b; --card: #fff; --input-bg: #f8fafc;
  --topbar-bg: rgba(255, 255, 255, 0.9); --bg-2: #eef3fb;
}
html[data-palette="lake"],
html[data-palette="lake"] body.page-bright {
  --page-bg: #f2faf6; --glow-a: rgba(5, 150, 105, 0.16); --glow-b: rgba(167, 243, 208, 0.45);
  --accent: #059669; --accent-2: #6ee7b7; --accent-strong: #047857; --heading: #047857;
  --ink: #3f4f48; --muted: #5f736b; --card: #fff; --input-bg: #f6fdf9;
  --topbar-bg: rgba(247, 253, 249, 0.9); --bg-2: #e8f7ef;
}
html[data-palette="rose"],
html[data-palette="rose"] body.page-bright {
  --page-bg: #fff5f7; --glow-a: rgba(225, 29, 72, 0.14); --glow-b: rgba(251, 207, 232, 0.45);
  --accent: #e11d48; --accent-2: #fda4af; --accent-strong: #be123c; --heading: #be123c;
  --ink: #5c4650; --muted: #8a6b76; --card: #fff; --input-bg: #fff8fa;
  --topbar-bg: rgba(255, 248, 250, 0.9); --bg-2: #ffe8ee;
}
html[data-palette="dusk"],
html[data-palette="dusk"] body.page-bright {
  --page-bg: #16141f; --glow-a: rgba(167, 139, 250, 0.22); --glow-b: rgba(76, 29, 149, 0.28);
  --accent: #a78bfa; --accent-2: #c4b5fd; --accent-strong: #ddd6fe; --heading: #ddd6fe;
  --ink: #e7e2f4; --muted: #b7adc8; --card: #221f2e; --input-bg: #2a2638;
  --topbar-bg: rgba(22, 20, 31, 0.92); --bg-2: #2a2638; --text-mute: #8d84a3;
  --border: rgba(255, 255, 255, 0.08);
}
html[data-palette="ink"],
html[data-palette="ink"] body.page-bright {
  --page-bg: #101114; --glow-a: rgba(34, 211, 238, 0.14); --glow-b: rgba(15, 23, 42, 0.4);
  --accent: #22d3ee; --accent-2: #67e8f9; --accent-strong: #a5f3fc; --heading: #e2e8f0;
  --ink: #e6edf3; --muted: #94a3b8; --card: #181b22; --input-bg: #22262f;
  --topbar-bg: rgba(16, 17, 20, 0.92); --bg-2: #22262f; --text-mute: #7d8b9c;
  --border: rgba(255, 255, 255, 0.08);
}
html[data-palette="dusk"] body.page-bright .logo,
html[data-palette="ink"] body.page-bright .logo { color: #061018; }
html[data-palette] body.page-bright .platform-card,
html[data-palette] body.page-bright .metric-card,
html[data-palette] body.page-bright .chart-card,
html[data-palette] body.page-bright .probe-card,
html[data-palette] body.page-bright .sales-col,
html[data-palette] body.page-bright .sales-toolbar,
html[data-palette] body.page-bright .sales-pool-toggle,
html[data-palette] body.page-bright .sales-pool-menu,
html[data-palette] body.page-bright input,
html[data-palette] body.page-bright .btn {
  background-color: var(--card);
}
html[data-palette] body.page-bright input { background: var(--input-bg); color: var(--ink); }
html[data-palette] body.page-bright .btn.primary { background: var(--accent); color: #fff; }
html[data-palette="dusk"] body.page-bright .nav-links a.active,
html[data-palette="ink"] body.page-bright .nav-links a.active,
html[data-palette="dusk"] body.page-bright .btn.primary,
html[data-palette="ink"] body.page-bright .btn.primary,
html[data-palette="dusk"] body.page-bright .board-tabs button.on,
html[data-palette="ink"] body.page-bright .board-tabs button.on,
html[data-palette="dusk"] body.page-bright .usage-group button.on,
html[data-palette="ink"] body.page-bright .usage-group button.on { color: #111; }

/* ============ 外观：布局 ============ */
html[data-width="full"] .container,
html[data-width="full"] body.page-bright:has(.probe-card) .container {
  max-width: none;
  width: 100%;
  margin-left: 0;
  margin-right: 0;
}
html[data-density="compact"] .topbar { padding: 10px 16px; }
html[data-density="compact"] .container { padding: 16px 18px; }
html[data-density="compact"] body.page-bright .hero { padding: 28px 12px 12px; }
html[data-density="compact"] body.page-bright .hero h1 { font-size: 36px; }
html[data-density="compact"] .sales-hero { margin-bottom: 12px; }
html[data-density="compact"] body.page-bright:has(.page-titlebar) main.container {
  padding: 12px 16px;
}
body.page-bright .page-titlebar { margin: 0 0 8px; }
body.page-bright .page-titlebar .back-home,
body.page-bright .page-titlebar h2 {
  height: 48px;
  min-height: 48px;
  max-height: 48px;
  font-size: 13px;
  line-height: 48px;
}
body.page-bright .page-titlebar h2 { font-size: 28px; }
html[data-nav="side"] #app {
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  align-items: start;
}
html[data-nav="side"] .topbar {
  position: sticky; top: 0; height: 100vh;
  flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 18px;
  border-bottom: 0; border-right: 1px solid var(--border); padding: 20px 14px;
}
html[data-nav="side"] .nav-links { flex-direction: column; align-items: stretch; }
html[data-nav="side"] .nav-links a { text-align: left; }
html[data-nav="side"] .top-tools { margin-top: auto; display: flex; justify-content: flex-start; }
html[data-nav="side"] main { min-width: 0; }

/* ============ 调色盘抽屉 ============ */
.top-tools { display: flex; align-items: center; gap: 8px; flex: none; }
.palette-btn {
  width: 36px; height: 36px; border-radius: 10px; padding: 0;
  border: 1px solid var(--border); background: var(--card, #fff); color: var(--accent, var(--accent));
  display: grid; place-items: center; cursor: pointer;
}
.palette-btn svg { width: 18px; height: 18px; }
.palette-pop {
  position: fixed; z-index: 80; width: min(360px, calc(100vw - 24px));
  padding: 16px; border-radius: 18px; background: var(--card, #fff); color: var(--ink, var(--ink));
  border: 1px solid var(--border); box-shadow: 0 22px 50px rgba(40, 20, 70, 0.16);
}
.palette-pop h3 { margin: 0 0 10px; font-size: 13px; letter-spacing: 0.04em; color: var(--muted, var(--muted)); font-weight: 650; }
.palette-pop h3 + h3 { margin-top: 16px; }
.palette-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.palette-swatch, .layout-choice {
  border: 1px solid var(--border); background: transparent; color: inherit;
  border-radius: 12px; padding: 8px; cursor: pointer; text-align: left; font-size: 12px;
}
.palette-swatch.on, .layout-choice.on { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 28%, transparent); }
.palette-swatch i {
  display: block; height: 28px; border-radius: 8px; margin-bottom: 6px;
  background: linear-gradient(135deg, var(--swatch-a), var(--swatch-b));
}
.layout-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.palette-reset {
  margin-top: 14px; width: 100%; border: 0; border-radius: 999px; padding: 8px 12px; cursor: pointer;
  background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent-strong, var(--accent));
}

/* ============ 设计风格 ============ */
.style-dock { position: fixed; left: 14px; bottom: 14px; z-index: 90; }
.style-dock-toggle {
  min-height: 36px; padding: 0 14px; border: 1px solid rgba(15, 23, 42, 0.16);
  border-radius: var(--style-radius, 10px); background: var(--card); color: var(--ink);
  font: 600 13px/1 "Noto Sans SC", "Microsoft YaHei", sans-serif; cursor: pointer;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
}
.style-dock-panel {
  position: absolute; left: 0; bottom: 46px; width: min(380px, calc(100vw - 28px));
  max-height: min(68vh, 620px); overflow: auto; padding: 10px;
  background: var(--card); color: var(--ink); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16);
}
.style-dock-panel[hidden] { display: none; }
.style-tabs { display: flex; gap: 4px; position: sticky; top: 0; background: var(--card); padding-bottom: 8px; }
.style-tabs button {
  flex: 1; min-height: 28px; border: 0; border-radius: 999px; background: #f4f6f8;
  color: #334155; font: 600 12px/1 "Noto Sans SC", "Microsoft YaHei", sans-serif; cursor: pointer;
}
.style-tabs button.on { background: var(--ink); color: var(--card); }
.style-list { display: flex; flex-direction: column; gap: 4px; }
.style-row { display: grid; grid-template-columns: minmax(0, 1fr) 32px; gap: 4px; align-items: center; }
.style-card {
  display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 8px; align-items: center;
  width: 100%; min-height: 36px; padding: 4px 8px; border: 1px solid transparent; border-radius: 10px;
  background: transparent; color: var(--ink); text-align: left; cursor: pointer;
  font: 600 13px/1.3 "Noto Sans SC", "Microsoft YaHei", sans-serif;
}
.style-fav {
  width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent;
  color: #94a3b8; font-size: 16px; cursor: pointer;
}
.style-fav.on { color: #d97706; }
.style-fav.saved { color: #64748b; }
.style-card.on { border-color: var(--ink); background: color-mix(in srgb, var(--accent) 8%, var(--card)); }
.style-chips { display: flex; height: 16px; border-radius: 4px; overflow: hidden; border: 1px solid rgba(15, 23, 42, 0.12); }
.style-chips i { flex: 1; }
.style-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.style-mood { color: #64748b; font-size: 11px; font-weight: 500; }
html[data-style] body.page-bright .chart-card,
html[data-style] body.page-bright .metric-card,
html[data-style] body.page-bright .probe-card,
html[data-style] body.page-bright .suite-panel,
html[data-style] body.page-bright .platform-card {
  border-radius: var(--style-radius, 10px);
  border-width: var(--style-bw, 1px);
  box-shadow: var(--style-shadow, none);
}

/* ============ 账号 ============ */
.auth-bar { display: flex; align-items: center; gap: 8px; flex: none; }
html[data-nav="side"] .auth-bar {
  position: fixed;
  top: 14px;
  right: 18px;
  z-index: 70;
}
html[data-nav="side"] .page-title-side { padding-right: 52px; }
.auth-pop { position: relative; }
.auth-avatar-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}
.auth-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 148px;
  padding: 6px;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(40, 20, 70, 0.14);
}
.auth-menu[hidden] { display: none; }
.auth-menu a,
.auth-menu button {
  display: block;
  width: 100%;
  margin: 0;
  padding: 8px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: 500 14px/1.4 "Noto Sans SC", "Microsoft YaHei", sans-serif;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.auth-menu a:hover,
.auth-menu button:hover { background: color-mix(in srgb, var(--accent) 12%, var(--card)); }
.auth-avatar, .avatar-pick, .account-mini {
  border-radius: 50%;
  object-fit: cover;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  flex: none;
}
.auth-avatar { width: 34px; height: 34px; font-size: 14px; }
.auth-mask {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(28, 20, 48, 0.45);
  padding: 18px;
}
.auth-mask[hidden] { display: none; }
.auth-card, .account-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(40, 20, 70, 0.12);
}
.auth-card { width: min(420px, 100%); padding: 26px 24px 20px; }
.auth-card h2, .account-card h3 { margin: 0 0 6px; font-size: 22px; font-weight: 650; color: var(--ink); }
.auth-card p, .account-card p { margin: 0 0 14px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.auth-card label, .account-form label { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
.auth-card input, .account-form input, .account-search, .role-select {
  width: 100%;
  border: 1px solid #e6e0f4;
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  color: var(--ink);
  background: var(--card);
}
.auth-card .btn { width: 100%; justify-content: center; }
.auth-switch { margin-top: 12px; font-size: 13px; color: var(--muted); }
.auth-switch button { border: 0; background: transparent; color: var(--accent); cursor: pointer; font: inherit; padding: 0; }
.auth-error { min-height: 18px; color: var(--danger); }
.auth-error:empty { display: none; }
.account-note { min-height: 20px; margin: -6px 0 12px; text-align: center; color: var(--danger); font-size: 13px; }
.account-note:empty { display: none; }
.account-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; align-items: start; }
.account-card { padding: 18px; box-shadow: none; }
.avatar-row { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.avatar-row strong { display: block; color: var(--ink); font-size: 16px; }
.avatar-row span { color: var(--muted); font-size: 13px; }
.avatar-pick {
  width: 84px;
  height: 84px;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-size: 28px;
  overflow: hidden;
}
.avatar-pick img { width: 100%; height: 100%; object-fit: cover; }
.account-limit { margin: 4px 0 0; }
.account-who { display: flex; align-items: center; gap: 10px; }
.account-who strong, .account-who small { display: block; }
.account-who small { color: var(--muted); font-size: 12px; }
.account-mini { width: 32px; height: 32px; font-size: 13px; }
.account-table { width: 100%; border-collapse: collapse; }
.account-table th, .account-table td { padding: 10px 8px; border-bottom: 1px solid #f1eef8; text-align: left; font-size: 13px; vertical-align: middle; }
.account-table th { color: var(--muted); font-weight: 650; }
.role-select { width: auto; min-width: 128px; padding: 6px 10px; }
.role-tag { display: inline-flex; align-items: center; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 650; }
.role-user { background: #eef2ff; color: #3730a3; }
.role-admin { background: var(--card)7ed; color: #c2410c; }
.role-super { background: #fef2f2; color: #be123c; }
.auth-actions { display: flex; gap: 8px; }
@media (max-width: 900px) { .account-layout { grid-template-columns: 1fr; } }
