/* R029 视觉层：线路图册 / 站牌（纸白 + 墨字 + 细线 + 线路色唯一强调）
   规则来源：docs/planning/UI学习笔记_R029.md
   - 无渐变、无玻璃、无 glow、无投影；圆角 0–4px；颜色只在 :root 定义一处
   - 字体只用系统栈（A 方案），字号收敛为 9 档
   - 不改任何交互逻辑；类名与 ID 全部保留 */

:root {
  /* 纸与墨 */
  --paper: #F7F5F0;
  --paper-2: #EFEBE2;
  --paper-3: #FFFFFF;
  --ink: #161513;
  --muted: #6E6A61;
  --dim: #766E60;
  --rule: #D9D2C2;
  --rule-soft: #E7E1D3;
  --accent: #B23A2F;
  --accent-soft: rgba(178, 58, 47, .10);

  /* 状态 */
  --danger: #A8322A;
  --warn: #8A611F;
  --ok: #2F6B4F;

  /* 尺度 */
  --radius: 2px;
  --radius-s: 2px;
  --shadow: none;

  /* 字体：系统栈（不打包、不引 CDN） */
  --font: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans SC", system-ui, "Segoe UI", sans-serif;
  --font-display: var(--font);
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, "Liberation Mono", monospace;

  /* 数据色：降饱和 12%，只在这里定义 */
  --k-gan: #69a6f1;
  --k-jiao: #3ec996;
  --k-kuai: #f3798b;
  --k-zhun: #ec7ab6;
  --k-jiami: #eeb931;
  --k-quyu: #aa92f3;
  --k-huan: #2ecae2;
  --k-ban: #37cab8;
  --k-qie: #c08bf5;
  --k-wai: #96a3b6;
  --k-gong: #e79a19;

  --c-1: #96a3b6;
  --c-2: #ec7ab6;
  --c-3: #aa92f3;
  --c-4: #69a6f1;
  --c-5: #2ecae2;
  --c-6: #3ec996;
  --c-7: #eeb931;
  --c-8: #eb7524;

  /* 旧名别名：过渡期兼容，R031 结束前删除 */
  --bg: var(--paper);
  --bg-soft: var(--paper-2);
  --panel: var(--paper-3);
  --panel-2: var(--paper-2);
  --line: var(--rule);
  --line-soft: var(--rule-soft);
  --text: var(--ink);
  --text-2: var(--muted);
  --acc: var(--accent);
  --acc-2: var(--warn);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
body.locked { overflow: hidden; }
body { overflow-x: clip; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
button { font: inherit; color: inherit; cursor: pointer; }
::selection { background: var(--accent-soft); }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 32px;
  padding: 0 28px; height: 60px;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); flex: none; }
/* 预留 logo 位：作者设计好 SVG 后替换 .brand-slot，尺寸保持 30x30 */
.brand-slot { width: 30px; height: 30px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text b { font-size: 15px; letter-spacing: .02em; }
.brand-text small { font-size: 11px; color: var(--dim); letter-spacing: .16em; }

.tabs { display: flex; gap: 26px; height: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; align-items: center;
  border: 0; background: none; color: var(--muted);
  padding: 0; border-bottom: 2px solid transparent;
  font-size: 13px; white-space: nowrap;
  transition: color .12s, border-color .12s;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); font-weight: 700; border-bottom-color: var(--accent); }

.top-tools { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--paper-3); border: 1px solid var(--rule);
  border-radius: var(--radius); padding: 6px 10px; width: 340px;
  transition: border-color .12s;
}
.search:focus-within { border-color: var(--accent); }
.search svg { flex: none; opacity: .45; }
.search input {
  background: none; border: 0; outline: 0; color: var(--ink);
  width: 100%; font-size: 13px;
}
.search input::placeholder { color: var(--dim); }
.kbd {
  font-family: var(--mono); font-size: 11px; color: var(--dim);
  border: 1px solid var(--rule); border-radius: 2px; padding: 0 4px; flex: none;
}

/* ---------- 布局 ---------- */
main { max-width: 1240px; margin: 0 auto; padding: 0 28px 90px; }
.view { display: none; }
.view.active { display: block; animation: fade .14s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .view { animation: none; }
  html { scroll-behavior: auto; }
  * { transition-duration: .001ms !important; }
}

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 64px 0 18px; padding-bottom: 10px; border-bottom: 1px solid var(--ink); }
.eyebrow {
  font-family: var(--font); font-size: 12px; letter-spacing: .08em;
  text-transform: none; color: var(--accent); font-weight: 700; margin: 0 0 8px;
}
h2 { font-size: 28px; line-height: 1.3; margin: 0; letter-spacing: -.01em; font-weight: 700; }
.section-note { color: var(--muted); font-size: 13px; margin: 8px 0 0; max-width: 660px; line-height: 1.8; }

/* ---------- Hero ---------- */
.hero { padding: 64px 0 8px; }
.hero h1 { font-size: 40px; line-height: 1.15; letter-spacing: -.02em; margin: 0 0 16px; font-weight: 700; max-width: 760px; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lede { font-size: 17px; line-height: 1.85; color: var(--muted); max-width: 560px; margin: 0 0 22px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0 0 30px; }
.chip {
  display: inline-flex; align-items: baseline; gap: 6px;
  font-size: 13px; color: var(--muted);
  border: 0; background: none; border-radius: 0; padding: 0;
}
.chip b { color: var(--ink); font-family: var(--mono); font-size: 13px; font-variant-numeric: tabular-nums; }
.chip i { display: none; }

.cta-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: var(--radius); padding: 9px 16px; font-size: 13px;
  border: 1px solid var(--ink); background: transparent; color: var(--ink);
  transition: background .12s, color .12s;
}
.btn:hover { background: var(--paper-2); }
.btn.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); font-weight: 600; }
.btn.primary:hover { background: #2B2A26; }
.btn.ghost { background: transparent; }

/* ---------- 数据条 ---------- */
.stats {
  display: grid; grid-template-columns: repeat(6, 1fr);
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  margin: 8px 0 10px; background: transparent;
}
.stat { background: transparent; padding: 14px 14px 12px; border-left: 1px solid var(--rule); }
.stat:first-child { border-left: 0; padding-left: 0; }
.stat .k { font-size: 12px; color: var(--muted); letter-spacing: .02em; }
.stat .v {
  font-family: var(--mono); font-size: 24px; font-weight: 600; letter-spacing: -.01em;
  font-variant-numeric: tabular-nums; margin-top: 2px;
}
.stat .v small { font-family: var(--font); font-size: 12px; color: var(--dim); font-weight: 400; margin-left: 4px; letter-spacing: 0; }
.stat .s { font-size: 12px; color: var(--dim); margin-top: 2px; line-height: 1.5; }
.caveat { font-size: 12px; color: var(--dim); margin: 10px 0 0; line-height: 1.7; }

/* ---------- 卡片 / 图表 ---------- */
.grid { display: grid; gap: 24px; }
.grid.two { grid-template-columns: 1.4fr 1fr; }
.grid.three { grid-template-columns: repeat(3, 1fr); }
.panel {
  background: var(--paper-3);
  border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 18px 18px 16px; min-width: 0;
}
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head h3 { font-size: 17px; margin: 0; font-weight: 700; letter-spacing: 0; }
.panel-head span { font-size: 12px; color: var(--dim); letter-spacing: .06em; }
.panel.wide { grid-column: 1 / -1; }

/* 横向条 */
.hbar { display: flex; flex-direction: column; gap: 9px; }
.hbar-row { display: grid; grid-template-columns: 84px 1fr 64px; align-items: center; gap: 12px; cursor: default; }
.hbar-label { font-size: 13px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-track { height: 8px; background: var(--paper-2); border-radius: 0; overflow: hidden; }
.hbar-fill { display: block; height: 100%; border-radius: 0; transition: width .5s cubic-bezier(.2, .7, .2, 1); }
.hbar-val { font-size: 12px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); }
.hbar-row.clickable { cursor: pointer; }
.hbar-row.clickable:hover .hbar-label { color: var(--accent); }

/* 甜甜圈 */
.donut-wrap { display: flex; align-items: center; gap: 20px; }
.donut { flex: none; }
.donut-center { font-size: 24px; font-weight: 600; fill: var(--ink); font-family: var(--mono); }
.donut-center-sub { font-size: 11px; fill: var(--muted); letter-spacing: .08em; font-family: var(--font); }
.donut-seg.clickable { cursor: pointer; pointer-events: stroke; transition: opacity .12s ease; }
.donut-seg.clickable:hover { opacity: .72; }
.donut-seg.clickable:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.legend { display: flex; flex-direction: column; gap: 6px; min-width: 0; width: 100%; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.legend-item.clickable { cursor: pointer; border-radius: var(--radius); margin: -2px -5px; padding: 2px 5px; transition: background .12s ease; }
.legend-item.clickable:hover, .legend-item.clickable:focus { background: var(--paper-2); outline: none; }
.legend-item i { width: 8px; height: 8px; border-radius: 0; flex: none; }
.legend-item b { margin-left: auto; color: var(--ink); font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 12px; }
.legend-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 柱状 */
.cols { display: flex; align-items: flex-end; gap: 10px; height: 164px; padding-top: 18px; border-bottom: 1px solid var(--rule); }
.col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; height: 100%; justify-content: flex-end; }
.col.clickable { cursor: pointer; border-radius: 0; outline-offset: 3px; }
.col.clickable:hover .col-bar { opacity: .82; }
.col.clickable:focus-visible { outline: 2px solid var(--accent); }
.col-bar { width: 100%; max-width: 44px; background: var(--k-gan); border-radius: 2px 2px 0 0; position: relative; min-height: 2px; }
.col-bar span { position: absolute; top: -17px; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--muted); font-family: var(--mono); }
.col-x { font-size: 11px; color: var(--dim); font-family: var(--mono); }

/* 散点 */
.scatter-wrap { position: relative; }
.scatter { width: 100%; height: auto; display: block; overflow: visible; touch-action: none; user-select: none; }
.scatter .gridline { display: none; }
.scatter .axis-text { fill: var(--dim); font-size: 11px; font-family: var(--mono); }
.scatter circle { transition: r .16s, stroke .12s; cursor: pointer; }
.scatter circle:hover { stroke: var(--ink); stroke-width: 1.2; }
.scatter-tools { position: absolute; top: 0; right: 0; display: flex; gap: 4px; z-index: 2; }
.scatter-tools button {
  height: 26px; min-width: 26px; padding: 0 7px; border: 1px solid var(--rule); border-radius: var(--radius);
  background: var(--paper-3); color: var(--muted); font: 12px/1 var(--mono); cursor: pointer;
}
.scatter-tools button:hover { color: var(--ink); border-color: var(--ink); }
.scatter-hint { margin-top: 2px; }

/* 状态条 */
.health { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: center; }
.health-num { font-size: 28px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; font-family: var(--mono); }
.health-k { font-size: 12px; color: var(--muted); }
.health-bar { height: 8px; border-radius: 0; background: var(--paper-2); overflow: hidden; display: flex; margin-top: 9px; }
.health-bar i { height: 100%; }
.health-note { grid-column: 1 / -1; font-size: 13px; color: var(--muted); border-top: 1px solid var(--rule); padding-top: 14px; margin-top: 2px; }

/* ---------- 线网卡片 ---------- */
.net-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 16px; }
.net-card {
  position: relative;
  text-align: left; border: 1px solid var(--rule); background: var(--paper-3); cursor: pointer;
  border-radius: var(--radius); padding: 20px 18px 16px; transition: border-color .12s, background .12s;
}
/* 牌：城市名大字水印（全称、字号统一 76px；名字超宽就让它溢出卡片，不缩字、不截断） */
.net-card::before {
  content: attr(data-wm); position: absolute; right: -2px; bottom: -10px;
  font-size: 76px; line-height: 1; font-weight: 600; letter-spacing: -.03em;
  color: var(--ink); opacity: .08; pointer-events: none; user-select: none; white-space: nowrap;
}
.net-card > * { position: relative; }
.net-card:hover { border-color: var(--ink); background: var(--paper-3); }
.net-card-main {
  display: block; width: 100%; padding: 0; border: 0; background: none; color: inherit;
  font: inherit; text-align: left; cursor: pointer;
}
.net-card-main:focus-visible, .mix-seg:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.net-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.net-name { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.net-count { font-size: 12px; color: var(--dim); font-family: var(--mono); }
.net-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0 12px; }
.net-metrics div { font-size: 11px; color: var(--muted); }
.net-metrics b { display: block; font-size: 15px; color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 600; font-family: var(--mono); }
/* 卡内说明文字让位给水印：构成条已在顶部，页面顶部已有“彩色条=性质构成”的说明 */
.mix-head { display: none; }
/* 性质构成搬成卡片最上沿的 3px 分段顶条（R030） */
.mini-mix {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; height: 3px; margin: 0; gap: 0; border-radius: 0; overflow: hidden;
}
.net-cities { font-size: 11.5px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 62%; }
.mix-seg { height: 100%; min-width: 2px; padding: 0; border: 0; border-radius: 0; cursor: pointer; }
.mix-seg:hover { opacity: .8; }

/* ---------- 工具栏 / 表格 ---------- */
.toolbar { display: flex; flex-direction: column; gap: 10px; margin: 22px 0 14px; }
.filter-row { display: flex; align-items: center; gap: 10px; }
.filter-row-selects { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.filter-row-inputs { flex-wrap: wrap; }
.field { display: flex; align-items: center; gap: 8px; background: var(--paper-3); border: 1px solid var(--rule); border-radius: var(--radius); padding: 8px 12px; min-height: 40px; }
.field label { font-size: 12px; color: var(--dim); white-space: nowrap; }
.field select, .field input {
  background: none; border: 0; outline: 0; color: var(--ink); font-size: 13px; max-width: 104px;
}
.filter-row-selects .field { min-width: 0; }
.filter-row-selects .field select { flex: 1; min-width: 0; max-width: none; }
/* 多选筛选：按钮 + 弹层 */
.ms-field { position: relative; }
.ms-label { font-size: 12px; color: var(--dim); white-space: nowrap; }
.ms-btn {
  flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--ink);
  font-size: 13px; text-align: left; padding: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ms-btn::after { content: "▾"; color: var(--dim); font-size: 11px; margin-left: 6px; }
.ms-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--radius); }
.ms-pop {
  position: absolute; z-index: 70; top: calc(100% + 6px); left: 0;
  width: min(320px, calc(100vw - 24px)); background: var(--paper-3);
  border: 1px solid var(--ink); border-radius: var(--radius);
  padding: 8px;
}
.ms-pop[hidden] { display: none; }
.ms-search input {
  width: 100%; max-width: none; box-sizing: border-box; background: var(--paper-3);
  border: 1px solid var(--rule); border-radius: var(--radius); padding: 7px 9px;
  font-size: 13px; color: var(--ink); outline: 0;
}
.ms-search input:focus { border-color: var(--accent); }
.ms-actions { display: flex; gap: 8px; padding: 8px 2px 4px; }
.ms-actions button { background: none; border: 0; color: var(--accent); font-size: 12px; padding: 2px 0; }
.ms-actions button:hover { text-decoration: underline; }
.ms-list { max-height: 260px; overflow: auto; }
.ms-item {
  display: flex; align-items: center; gap: 8px; padding: 7px 6px; border-radius: var(--radius);
  font-size: 13px; color: var(--muted); cursor: pointer;
}
.ms-item:hover { background: var(--paper-2); color: var(--ink); }
.ms-item input { accent-color: var(--accent); flex: none; }
.ms-item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-item em { color: var(--dim); font-style: normal; font-family: var(--mono); font-size: 11px; }
.ms-empty { padding: 14px 8px; color: var(--dim); font-size: 12px; text-align: center; }
.field-cars { flex: 1 1 210px; max-width: 360px; }
.field input#fCars { width: 100%; max-width: 60vw; }
.field input#fCars::placeholder { color: var(--dim); }
.field.spacing-field { gap: 6px; flex: 0 1 auto; }
.field input.spacing-num { width: 60px; max-width: 20vw; text-align: right; font-family: var(--mono); font-size: 13px; }
.field .range-sep, .field .unit { color: var(--dim); font-size: 11px; }
.field.invalid { border-color: var(--danger); background: var(--accent-soft); }
#spacingHint.err { color: var(--danger); }
.field select option { background: var(--paper-3); color: var(--ink); }
.toolbar-end { display: flex; align-items: center; gap: 7px; margin-left: auto; flex-wrap: wrap; }
/* 工具栏按钮退成细线（R030） */
.toolbar-end .btn { border-color: var(--rule); color: var(--muted); padding: 7px 12px; }
.toolbar-end .btn:hover { border-color: var(--ink); color: var(--ink); background: transparent; }
.toggle { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); padding: 7px 10px; border-radius: var(--radius); border: 1px solid var(--rule); background: var(--paper-3); }
.toggle input { accent-color: var(--accent); }
.count { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.count b { color: var(--ink); }
.sel-hint { font-size: 12px; color: var(--accent); white-space: nowrap; }
.filter-chip {
  border: 1px solid var(--accent); background: var(--accent-soft);
  color: var(--accent); border-radius: var(--radius); padding: 5px 9px; font-size: 12px;
  cursor: pointer; white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis;
}
.filter-chip:hover { background: rgba(178, 58, 47, .16); }

.table-wrap { border: 1px solid var(--rule); border-radius: 0; overflow: auto; background: var(--paper-3); max-height: 72vh; }
table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 1200px; }
thead th {
  position: sticky; top: 0; z-index: 2; text-align: left; font-weight: 600;
  font-size: 12px; color: var(--muted); letter-spacing: .06em;
  background: var(--paper-2); border-bottom: 1px solid var(--rule); padding: 11px 12px; white-space: nowrap;
}
thead th.sortable { cursor: pointer; user-select: none; }
thead th.sortable:hover { color: var(--ink); }
thead th .arrow { opacity: .35; margin-left: 3px; font-size: 11px; }
thead th .th-unit { font-size: 11px; color: var(--muted); font-weight: 400; margin-left: 2px; letter-spacing: 0; }
/* 勾选格整格可点（R032）：避免“点偏一点就弹详情” */
thead th.sel, tbody td.sel { width: 40px; padding: 8px 10px; text-align: center; cursor: pointer; }
thead th.sel input, tbody td.sel input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
thead th.sorted .arrow { opacity: 1; color: var(--accent); }
tbody tr { height: 44px; border-bottom: 1px solid var(--rule-soft); cursor: pointer; }
tbody tr:hover { background: rgba(178, 58, 47, .04); }
/* 勾选行：左侧 3px 朱砂竖条（R030） */
tbody tr.is-sel { background: rgba(178, 58, 47, .055); }
tbody tr.is-sel > td:first-child { border-left: 3px solid var(--accent); padding-left: 7px; }
tbody td { padding: 9px 12px; white-space: nowrap; vertical-align: middle; }
td.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 13px; }
th.num { text-align: right; font-variant-numeric: tabular-nums; }
.cell-line { display: flex; flex-direction: column; gap: 1px; }
.cell-line b { font-weight: 600; font-size: 13px; }
.cell-line span { font-size: 11px; color: var(--dim); }
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; padding: 2px 7px; border-radius: var(--radius);
  border: 1px solid transparent; white-space: nowrap;
}
.badge.kind { background: color-mix(in srgb, var(--c) 10%, transparent); color: var(--ink); border-color: var(--rule); border-left: 3px solid var(--c); padding-left: 6px; }
.badge.tag { background: var(--paper-2); color: var(--muted); border-color: var(--rule); }
.badge.goa { font-family: var(--mono); font-size: 11px; background: rgba(105, 166, 241, .14); color: #3E6C9E; border-color: rgba(105, 166, 241, .35); }
.badge.goa.g4 { background: var(--accent-soft); color: var(--accent); border-color: rgba(178, 58, 47, .35); }
.badge.status { font-size: 11px; }
.badge.status.r1 { background: rgba(168, 50, 42, .10); color: var(--danger); border-color: rgba(168, 50, 42, .32); }
.badge.status.r2 { background: rgba(138, 97, 31, .10); color: var(--warn); border-color: rgba(138, 97, 31, .32); }
.badge.status.r3 { background: var(--paper-2); color: var(--muted); border-color: var(--rule); }
.badge.status.ok { background: rgba(47, 107, 79, .10); color: var(--ok); border-color: rgba(47, 107, 79, .32); }
.badge.conf { font-family: var(--mono); font-size: 11px; }
.badge.conf.A { color: var(--ok); border-color: rgba(47, 107, 79, .32); background: rgba(47, 107, 79, .08); }
.badge.conf.B { color: var(--warn); border-color: rgba(138, 97, 31, .32); background: rgba(138, 97, 31, .08); }
.badge.conf.C { color: var(--danger); border-color: rgba(168, 50, 42, .32); background: rgba(168, 50, 42, .08); }
.feature-cell { min-width: 180px; max-width: 280px; white-space: normal; }
.tag-cell { display: flex; flex-wrap: wrap; gap: 4px; }
.tag-cell .badge.tag { font-size: 11px; padding: 1px 6px; }
.dash { color: var(--dim); }
.cars-8a { color: #7A5310; font-weight: 600; background: rgba(238, 185, 49, .16); }
.speed-cell { font-weight: 600; }
.empty { padding: 60px 20px; text-align: center; color: var(--muted); font-size: 13px; }
.q-hint { margin: -4px 0 12px; font-size: 13px; color: var(--muted); }
.q-hint b { color: var(--accent); font-weight: 600; }

/* ---------- 待核实 ---------- */
.rule-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.rule { border: 1px solid var(--rule); border-radius: var(--radius); padding: 17px 18px; background: var(--paper-3); }
.rule b { display: block; font-size: 13px; margin-bottom: 5px; }
.rule p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.7; }
.rule .dot { width: 7px; height: 7px; border-radius: 0; display: inline-block; margin-right: 7px; vertical-align: 1px; }
.review-list { display: flex; flex-direction: column; gap: 8px; }
.review-item {
  display: grid; grid-template-columns: 46px 1fr auto; gap: 14px; align-items: start;
  border: 1px solid var(--rule); border-left: 2px solid var(--c, var(--rule));
  border-radius: var(--radius); background: var(--paper-3); padding: 12px 15px; cursor: pointer;
  transition: background .12s, border-color .12s;
}
.review-item:hover { background: var(--paper-2); }
.review-p { font-family: var(--mono); font-size: 11px; color: var(--muted); padding-top: 2px; }
.review-main b { font-size: 13px; font-weight: 600; }
.review-main .meta { color: var(--dim); font-size: 12px; margin-left: 7px; }
.review-main p { margin: 3px 0 0; font-size: 13px; color: var(--muted); }
.review-main p.review-hint { color: var(--accent); font-size: 12px; margin-top: 5px; }
.review-flags { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; max-width: 260px; }
.review-empty {
  border: 1px solid var(--rule); border-left: 2px solid var(--ok); border-radius: var(--radius);
  background: var(--paper-3); padding: 18px 20px;
}
.review-empty b { display: block; font-size: 13px; color: var(--ok); margin-bottom: 8px; }
.review-empty p { margin: 0 0 6px; font-size: 13px; color: var(--muted); line-height: 1.7; }
.review-empty p:last-child { margin-bottom: 0; }
.review-empty code { font-family: var(--mono); font-size: 12px; color: var(--ink); }

/* ---------- 说明页 ---------- */
/* 长文阅读宽度（R031）：17px 下一行约 39 个汉字，避免“扫视回行” */
.prose { max-width: 660px; }
.about-meta { margin-top: 26px; color: var(--dim); font-size: 13px; }
.data-layout { display: grid; grid-template-columns: minmax(0, 660px) 240px; gap: 72px; justify-content: center; align-items: start; }
.data-main { min-width: 0; grid-column: 1; grid-row: 1; }
.data-toc { position: sticky; top: 78px; padding-left: 18px; border-left: 1px solid var(--rule); grid-column: 2; grid-row: 1; }
.page-solo { max-width: 660px; margin: 0 auto; }
.page-head { padding-top: 56px; margin-bottom: 2px; }
.page-head .eyebrow { margin: 0 0 6px; }
.toc-title { margin: 0 0 10px; font-family: var(--font); font-size: 12px; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.data-toc nav { display: flex; flex-direction: column; gap: 2px; }
.toc-link { display: block; padding: 4px 0; color: var(--muted); font-size: 13px; line-height: 1.5; text-decoration: none; }
.toc-link:hover, .toc-link:focus-visible { color: var(--accent); }
.toc-h3 { padding-left: 12px; font-size: 12px; }
.h-anchor { margin-left: 8px; color: var(--dim); text-decoration: none; font-weight: 400; font-size: .8em; opacity: 0; }
.prose h2:hover .h-anchor, .prose h3:hover .h-anchor, .h-anchor:focus-visible { opacity: 1; }
.prose h2, .prose h3, #data-quality { scroll-margin-top: 78px; }
.data-quality { margin-top: 44px; padding-top: 28px; border-top: 1px solid var(--rule); }
.data-quality .section-head { margin-top: 0; }
.prose h3 { font-size: 20px; margin: 34px 0 10px; letter-spacing: -.005em; font-weight: 700; }
.prose h3:first-child { margin-top: 0; }
.prose h2 { font-size: 28px; line-height: 1.35; margin: 40px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--ink); letter-spacing: -.01em; }
.prose h2:first-child { margin-top: 0; }
.prose h4 { font-size: 15px; margin: 22px 0 8px; color: var(--ink); }
.prose ol { color: var(--ink); font-size: 17px; padding-left: 22px; margin: 0 0 14px; line-height: 1.85; }
.prose img { display: block; max-width: 100%; height: auto; margin: 18px 0 8px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--paper-3); }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 30px 0; }
.prose p { color: var(--ink); font-size: 17px; margin: 0 0 12px; line-height: 1.85; }
.prose ul { color: var(--ink); font-size: 17px; padding-left: 20px; margin: 0 0 14px; line-height: 1.85; }
.prose li { margin-bottom: 6px; }
.prose strong { color: var(--ink); font-weight: 700; }
.prose a { text-decoration: underline; text-underline-offset: 2px; }
.prose code { font-family: var(--mono); font-size: 13px; background: var(--paper-2); border: 1px solid var(--rule); padding: 0 5px; border-radius: var(--radius); color: var(--ink); }
.callout { border: 1px solid var(--rule); border-left: 2px solid var(--warn); background: var(--paper-2); border-radius: var(--radius); padding: 14px 17px; font-size: 13px; color: var(--ink); margin: 16px 0; line-height: 1.8; }
.callout.info { border-left-color: var(--accent); background: var(--paper-3); }
.field-table { width: 100%; min-width: 0; border-collapse: collapse; font-size: 13px; margin: 6px 0 18px; }
.field-table th, .field-table td { white-space: normal; }
.field-table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; letter-spacing: .04em; padding: 8px 10px; border-bottom: 1px solid var(--ink); }
.field-table td { padding: 8px 10px; border-bottom: 1px solid var(--rule-soft); color: var(--ink); vertical-align: top; line-height: 1.7; }
.field-table td:first-child { color: var(--ink); font-family: var(--mono); font-size: 12px; white-space: nowrap; }

/* ---------- 详情（居中弹窗）---------- */
.drawer-mask {
  position: fixed; inset: 0; background: rgba(22, 21, 19, .35); z-index: 80;
  opacity: 0; pointer-events: none; transition: opacity .18s;
}
.drawer-mask.on { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 50%; left: 50%; right: auto; bottom: auto; z-index: 90;
  width: min(760px, 92vw); max-height: 86vh;
  background: var(--paper-3); border: 1px solid var(--ink); border-radius: var(--radius);
  transform: translate(-50%, -46%) scale(.99); opacity: 0; visibility: hidden;
  transition: transform .2s cubic-bezier(.3, .8, .3, 1), opacity .18s;
  display: flex; flex-direction: column; overflow: hidden;
}
.drawer.on { transform: translate(-50%, -50%) scale(1); opacity: 1; visibility: visible; }
/* 详情“车票”：顶部用该线主性质色抬头（R030） */
.drawer-head {
  padding: 22px 24px 16px; border-bottom: 1px solid var(--rule); position: relative; flex: none;
  border-top: 3px solid var(--c, var(--ink));
  background: color-mix(in srgb, var(--c, var(--rule)) 8%, var(--paper-3));
}
.drawer-close { position: absolute; top: 16px; right: 18px; background: none; border: 1px solid var(--rule); border-radius: var(--radius); color: var(--muted); font-size: 17px; line-height: 1; padding: 3px 8px; }
.drawer-close:hover { color: var(--ink); border-color: var(--ink); }
.drawer-net { font-size: 12px; color: var(--accent); letter-spacing: .05em; }
.drawer-title { font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin: 2px 0 8px; }
.drawer-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.drawer-body { padding: 20px 24px 30px; overflow-y: auto; min-height: 0; flex: 1 1 auto; }
.drawer :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; background: transparent; border: 0; border-radius: 0; overflow: visible; margin-bottom: 20px; }
.metric { background: var(--paper-3); border: 1px solid var(--rule); border-radius: var(--radius); padding: 12px 12px 10px; }
.metric .k { font-size: 11px; color: var(--muted); }
.metric .v { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.01em; font-family: var(--mono); }
.metric .v small { font-family: var(--font); font-size: 11px; color: var(--dim); font-weight: 400; margin-left: 2px; }
.dl { display: grid; grid-template-columns: 84px 1fr; gap: 9px 14px; font-size: 13px; margin-bottom: 18px; }
.dl dt { color: var(--muted); font-size: 13px; }
.dl dd { margin: 0; color: var(--ink); }
.quote { border-left: 2px solid var(--rule); padding: 2px 0 2px 13px; color: var(--muted); font-size: 13px; white-space: pre-wrap; }
.drawer-section { margin: 20px 0 0; }
.drawer-section h4 { font-size: 12px; color: var(--muted); font-weight: 700; letter-spacing: .06em; margin: 0 0 9px; }
.flag-list { display: flex; flex-direction: column; gap: 6px; }
.flag { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; color: var(--ink); border: 1px solid var(--rule); border-radius: var(--radius); padding: 8px 11px; }
.flag i { width: 6px; height: 6px; border-radius: 0; margin-top: 7px; flex: none; }
.flag.warn i { background: var(--danger); }
.flag.check i { background: var(--warn); }
.flag.info i { background: var(--dim); }
.flag.ok { border-color: rgba(178, 58, 47, .35); background: var(--accent-soft); }
.flag.ok i { background: var(--accent); }
.flag-hint { display: block; margin-top: 4px; font-style: normal; font-size: 12px; color: var(--dim); line-height: 1.55; }
.flag.ok .flag-hint { color: var(--accent); }
.vlist { display: flex; flex-direction: column; gap: 9px; }
.vitem { border: 1px solid var(--rule); border-radius: var(--radius); padding: 10px 12px; background: var(--paper-3); }
.vitem p { margin: 6px 0 0; font-size: 13px; color: var(--muted); line-height: 1.6; }
.vitem a { display: inline-block; margin-top: 6px; font-size: 12px; color: var(--accent); border-bottom: 1px solid var(--accent); }
.vitem a:hover { color: var(--ink); border-bottom-color: var(--ink); }
.vitem a.vs { margin-left: 8px; color: var(--dim); border-bottom-color: var(--rule); }
.vitem a.vs:hover { color: var(--accent); }
.vhead { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vres { font-size: 11px; color: var(--warn); }
.vres.ok { color: var(--ok); }
.vdate { font-family: var(--mono); font-size: 11px; color: var(--dim); margin-left: auto; }
.drawer-foot { margin-top: 26px; display: flex; gap: 9px; }

/* ---------- 页脚（colophon）---------- */
footer { border-top: 1px solid var(--rule); background: transparent; }
.foot-in {
  max-width: 1240px; margin: 0 auto; padding: 24px 24px 34px;
  display: grid; grid-template-columns: 1fr auto; gap: 10px 24px; align-items: end;
  font-size: 12px; color: var(--dim);
}
.foot-brand { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.foot-brand b { color: var(--ink); font-weight: 600; font-size: 13px; }
.foot-links { justify-self: end; }
.foot-note { grid-column: 1 / -1; margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--rule); font-size: 12px; line-height: 1.75; display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: baseline; }
.foot-note a, .foot-links a { color: var(--muted); text-decoration: none; }
.foot-note a:hover, .foot-links a:hover { color: var(--accent); text-decoration: underline; }

/* ---------- 404（R031）---------- */
.err-page { position: relative; overflow: hidden; min-height: 82vh; }
.err-page::before {
  content: "404"; position: absolute; right: -18px; bottom: -46px;
  font-size: 220px; line-height: .82; font-weight: 600; letter-spacing: -.04em;
  color: var(--ink); opacity: .06; pointer-events: none; user-select: none;
}
.err-page > * { position: relative; }

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
  .stats .stat:nth-child(4) { border-left: 0; padding-left: 0; }
  .stat { border-top: 1px solid var(--rule); }
  .stat:nth-child(-n+3) { border-top: 0; }
  .grid.two, .grid.three { grid-template-columns: 1fr; }
  .health { grid-template-columns: repeat(3, 1fr); }
  .filter-row-selects { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .health-note { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--rule); padding: 12px 0 0; }
  .rule-grid { grid-template-columns: 1fr; }
  .data-layout { display: block; }
  .data-toc { position: static; padding: 0; margin: 0 0 26px; border-left: 0; }
  .data-toc nav { flex-direction: row; flex-wrap: wrap; gap: 4px 14px; }
  .toc-h3 { padding-left: 0; font-size: 12px; }
  .h-anchor { opacity: .45; }
  .page-head { padding-top: 36px; }
}
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; padding: 8px 14px; height: auto; gap: 8px 16px; }
  .brand { order: 1; }
  .brand-text small { display: none; }
  .top-tools { order: 2; flex: 1; margin-left: 0; }
  .top-tools .search { width: 100%; }
  .search .kbd { display: none; }
  .tabs { order: 3; width: 100%; padding-top: 4px; border-top: 1px solid var(--rule); gap: 18px; }
  .tab { padding: 10px 0; }
  .foot-in { grid-template-columns: 1fr; }
  .foot-links { justify-self: start; }
  main { padding: 0 16px 70px; }
  .hero { padding-top: 40px; }
  .hero h1 { font-size: 28px; }
  .hero .lede { font-size: 17px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat { padding: 12px 12px 10px; border-left: 1px solid var(--rule); }
  .stat:nth-child(odd) { border-left: 0; padding-left: 0; }
  .stat:nth-child(3) { border-top: 1px solid var(--rule); }
  .stat .v { font-size: 20px; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 44px; }
  .drawer { width: 100vw; height: 100dvh; max-height: none; border: 0; border-radius: 0; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .net-metrics { grid-template-columns: repeat(3, 1fr); }
  .review-item { grid-template-columns: 38px 1fr; }
  .review-flags { grid-column: 2; justify-content: flex-start; }
  .filter-row-selects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-cars { max-width: none; }
  .toolbar-end { width: 100%; justify-content: flex-end; }
  .ms-pop { position: fixed; left: 12px; right: 12px; top: auto; bottom: 12px; width: auto; max-height: 70vh; }
  .ms-list { max-height: 48vh; }
}
