/* 开奖数据观测平台 —— 无构建静态样式
   设计取向：纸面底色 + 仪器式左栏 + 等宽数字。数据密度优先，装饰靠边。 */

:root {
  --rail: #17191b;
  --rail-2: #222527;
  --rail-ink: #ecebe6;
  --rail-muted: #8a8983;

  --bg: #f4f3ef;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --ink: #1b1c1a;
  --ink-2: #55534d;
  --ink-3: #85837c;
  --line: #e3e0d7;
  --line-strong: #cfccc1;

  --accent: #1f6157;
  --accent-soft: #e6f0ee;
  --warn: #9a6415;
  --warn-soft: #fbf1de;
  --danger: #a03829;
  --danger-soft: #f9e8e5;
  --ok: #2b6a4b;
  --ok-soft: #e7f2ec;

  --ball-red: #b93b2c;
  --ball-blue: #2c5f9e;
  --ball-green: #1d7a4c;
  --ball-none: #8d8b84;

  --mono: ui-monospace, "JetBrains Mono", "SFMono-Regular", Consolas, "Courier New", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;

  --rail-w: 236px;
  --radius: 8px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ------------------------------------------------------------------ 左栏 */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--rail-w);
  background: var(--rail);
  color: var(--rail-ink);
  display: flex;
  flex-direction: column;
  padding: 22px 0 16px;
  z-index: 20;
}

.brand {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 0 20px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.brand-mark {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 50%;
  color: #6fc0ad;
  font-size: 14px;
}
.brand-name { font-size: 15px; font-weight: 600; letter-spacing: .08em; }
.brand-sub {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--rail-muted);
  letter-spacing: .14em;
  text-transform: uppercase;
}

.nav { padding: 16px 10px; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  width: 100%;
  padding: 9px 12px;
  background: none; border: 0; border-radius: 6px;
  color: var(--rail-muted);
  font: inherit; font-size: 13.5px; text-align: left;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.nav-item span {
  font-family: var(--mono);
  font-size: 10px;
  color: #5c5b57;
  transition: color .12s;
}
.nav-item:hover { background: rgba(255, 255, 255, .05); color: var(--rail-ink); }
.nav-item.is-active { background: var(--rail-2); color: #fff; }
.nav-item.is-active span { color: #6fc0ad; }

.sidebar-foot { margin-top: auto; padding: 16px 20px 0; }
.pipeline {
  border-top: 1px solid rgba(255, 255, 255, .08);
  padding-top: 14px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--rail-muted);
  line-height: 1.9;
}
.pipeline-title {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #6b6a65;
  margin-bottom: 4px;
}
.pipeline-arrow { color: #4e4d49; font-size: 9.5px; }
.stance {
  margin-top: 18px;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 6px;
  font-size: 11.5px;
  line-height: 1.65;
  color: var(--rail-muted);
}
.stance strong { display: block; color: #cfe8e1; font-weight: 600; margin-bottom: 3px; }

/* ------------------------------------------------------------------ 主区 */
.main {
  margin-left: var(--rail-w);
  padding: 0 32px 48px;
  max-width: 1440px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 26px 0 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}
.topbar h1 {
  margin: 0;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: .02em;
}
.page-sub { margin: 3px 0 0; color: var(--ink-3); font-size: 12.5px; }
.topbar-right { display: flex; gap: 8px; flex-wrap: wrap; }

.chip {
  font-family: var(--mono);
  font-size: 11px;
  padding: 5px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  white-space: nowrap;
}
.chip.is-ok { border-color: #bcd8cb; background: var(--ok-soft); color: var(--ok); }
.chip.is-bad { border-color: #e3bfb9; background: var(--danger-soft); color: var(--danger); }

/* ------------------------------------------------------------------ 卡片 */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px 20px;
  margin-bottom: 18px;
}
.card-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.card-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .02em;
}
.hint { font-size: 11.5px; color: var(--ink-3); }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.grid-2 > .card { margin-bottom: 18px; }

/* ------------------------------------------------------------------ KPI */
.kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px 16px 14px;
  position: relative;
  overflow: hidden;
}
.kpi::after {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--accent);
  opacity: .55;
}
.kpi-label {
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 6px;
}
.kpi-value {
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -.01em;
}
.kpi-value small { font-size: 12px; color: var(--ink-3); font-weight: 400; margin-left: 3px; }
.kpi-foot { font-size: 11.5px; color: var(--ink-3); margin-top: 5px; }

/* ------------------------------------------------------------------ 年份条 */
.year-bars { display: flex; flex-direction: column; gap: 9px; }
.bar-row {
  display: grid;
  grid-template-columns: 46px 1fr 58px;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}
.bar-year { font-family: var(--mono); color: var(--ink-2); }
.bar-track {
  height: 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #2a7d70, #47968a);
}
.bar-count { font-family: var(--mono); text-align: right; color: var(--ink-2); font-size: 11.5px; }

.anomaly-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.stat-pill {
  font-size: 12px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--warn-soft);
  border: 1px solid #ecd9b6;
  color: var(--warn);
}
.stat-pill b { font-family: var(--mono); margin-left: 5px; }

.link-btn {
  background: none; border: 0; padding: 0;
  color: var(--accent);
  font: inherit; font-size: 12.5px;
  cursor: pointer;
  border-bottom: 1px solid transparent;
}
.link-btn:hover { border-bottom-color: var(--accent); }

.principles { margin: 0; padding-left: 20px; color: var(--ink-2); font-size: 13px; }
.principles li { margin-bottom: 7px; }
.principles b { color: var(--ink); }
.principles code {
  font-family: var(--mono);
  font-size: 11.5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 1px 5px;
  border-radius: 3px;
}

/* ------------------------------------------------------------------ 表单 */
.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
  margin-bottom: 14px;
}
.form-row label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11.5px;
  color: var(--ink-3);
  letter-spacing: .03em;
}
.form-row input, .form-row select {
  font: inherit;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  padding: 7px 9px;
  min-width: 150px;
  outline: none;
}
.form-row input:focus, .form-row select:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(31, 97, 87, .08);
}
.form-row select { font-family: var(--sans); }
.spacer { flex: 1; }

.btn {
  font: inherit;
  font-size: 12.5px;
  padding: 8px 16px;
  border-radius: 5px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--surface-2); border-color: var(--ink-3); }
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn.primary:hover { background: #1a534b; border-color: #1a534b; }
.btn.ghost { padding: 6px 12px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.status-line { font-size: 12.5px; color: var(--ink-3); min-height: 18px; }
.status-line.is-error { color: var(--danger); }
.status-line.is-ok { color: var(--ok); }

/* ------------------------------------------------------------------ 表格 */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl th {
  text-align: left;
  font-weight: 500;
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
  background: var(--surface-2);
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.tbl td {
  padding: 9px 12px;
  border-bottom: 1px solid #efedE6;
  vertical-align: middle;
}
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: #fbfbf8; }
.tbl .num { font-family: var(--mono); text-align: right; }
.tbl .mono { font-family: var(--mono); }
.tbl .empty { text-align: center; color: var(--ink-3); padding: 26px 0; }

.badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge.ok { background: var(--ok-soft); color: var(--ok); border: 1px solid #bcd8cb; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border: 1px solid #ecd9b6; }
.badge.bad { background: var(--danger-soft); color: var(--danger); border: 1px solid #e3bfb9; }
.badge.mute { background: var(--surface-2); color: var(--ink-3); border: 1px solid var(--line); }

.detail-cell {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-2);
  background: var(--surface-2);
  border-radius: 5px;
  padding: 10px 12px;
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.6;
}

.note {
  margin: 12px 0 0;
  padding: 11px 13px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: 0 5px 5px 0;
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.7;
}
.note b { color: var(--ink); }

/* ------------------------------------------------------------------ 频次图 */
.freq-chart {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 168px;
  padding: 10px 4px 0;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.freq-col {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: flex-end;
  position: relative;
}
.freq-bar {
  width: 100%;
  background: #3f8c80;
  border-radius: 1px 1px 0 0;
  min-height: 1px;
  transition: height .3s ease;
}
.freq-bar.is-out { background: #c8794a; }
.freq-labels {
  display: flex;
  gap: 2px;
  padding: 4px 4px 0;
  font-family: var(--mono);
  font-size: 8.5px;
  color: var(--ink-3);
}
.freq-labels span { flex: 1; text-align: center; }

.legend {
  display: flex;
  gap: 16px;
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--ink-3);
  flex-wrap: wrap;
}
.legend .sw {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 2px;
  margin-right: 5px;
  vertical-align: -1px;
}
.sw-band { background: rgba(31, 97, 87, .16); }
.sw-bar { background: #3f8c80; }
.sw-out { background: #c8794a; }

.power-box { display: flex; flex-direction: column; gap: 12px; }
.power-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  padding-bottom: 11px;
  border-bottom: 1px dashed var(--line);
}
.power-item:last-child { border-bottom: 0; padding-bottom: 0; }
.power-label { font-size: 12.5px; color: var(--ink-2); }
.power-value {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--danger);
  text-align: right;
}
.power-desc { grid-column: 1 / -1; font-size: 11.5px; color: var(--ink-3); }

.mini-list { display: flex; flex-direction: column; gap: 6px; }
.mini-row {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  padding: 5px 0;
  border-bottom: 1px dashed var(--line);
}
.mini-row:last-child { border-bottom: 0; }
.mini-row .k { color: var(--ink-2); font-family: var(--mono); }
.mini-row .v { color: var(--ink); font-family: var(--mono); }

/* ------------------------------------------------------------------ 球 */
.ball {
  display: inline-grid;
  place-items: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  color: #fff;
  font-family: var(--mono);
  font-size: 11.5px;
  margin-right: 4px;
}
.ball.红波 { background: var(--ball-red); }
.ball.蓝波 { background: var(--ball-blue); }
.ball.绿波 { background: var(--ball-green); }
.ball.unknown { background: var(--ball-none); }
.ball.special { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--accent); }
.ball-group { display: flex; gap: 2px; flex-wrap: nowrap; }

/* ------------------------------------------------------------------ 标签页 */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tab {
  font: inherit;
  font-size: 12.5px;
  padding: 8px 14px;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--ink-3);
  cursor: pointer;
  margin-bottom: -1px;
}
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 500; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; font-size: 12.5px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; font-family: var(--mono); color: var(--ink); }

.result-hero {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 14px 0 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}
.result-hero .big {
  font-family: var(--mono);
  font-size: 30px;
  line-height: 1;
  letter-spacing: -.02em;
}
.result-hero .big.pos { color: var(--ok); }
.result-hero .big.neg { color: var(--danger); }
.result-hero .cap { font-size: 12px; color: var(--ink-3); }

.pager { display: flex; align-items: center; gap: 10px; }
.pager .mono { font-family: var(--mono); font-size: 12px; color: var(--ink-2); min-width: 72px; text-align: center; }

.foot {
  margin-top: 26px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--ink-3);
  display: flex;
  justify-content: space-between;
}

/* ------------------------------------------------------------------ 响应式 */
@media (max-width: 1080px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .sidebar {
    position: static;
    width: auto;
    flex-direction: row;
    align-items: center;
    padding: 10px 12px;
    overflow-x: auto;
  }
  .brand { border: 0; padding: 0 14px 0 0; }
  .brand-sub { display: none; }
  .nav { flex-direction: row; padding: 0; }
  .nav-item { padding: 7px 10px; white-space: nowrap; }
  .sidebar-foot { display: none; }
  .main { margin-left: 0; padding: 0 16px 40px; }
  .topbar { flex-direction: column; align-items: flex-start; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .form-row input, .form-row select { min-width: 120px; }
}

/* 频次图的随机波动带（叠加在柱子上，z-index 低于柱子） */
.freq-band {
  position: absolute;
  left: 4px;
  right: 4px;
  background: rgba(31, 97, 87, .14);
  border-top: 1px dashed rgba(31, 97, 87, .45);
  border-bottom: 1px dashed rgba(31, 97, 87, .45);
  pointer-events: none;
  z-index: 0;
}
.freq-col { z-index: 1; }

/* 目录树里的路径与视图切换的轻微过渡 */
.pipeline-path { color: #cfcdc6; }
.view { animation: view-in .16s ease; }
@keyframes view-in {
  from { opacity: 0; transform: translateY(3px); }
  to   { opacity: 1; transform: none; }
}

/* ==================================================================
   号码行情 & 玩家偏好
   ================================================================== */

.kpis-5 { grid-template-columns: repeat(5, 1fr); }

/* ---- 行情墙：49 格 ---- */
.quote-wall {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}
.quote-cell {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 9px 7px;
  cursor: pointer;
  transition: transform .1s, box-shadow .1s, border-color .1s;
  position: relative;
  overflow: hidden;
}
.quote-cell:hover { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.quote-cell.is-active { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(31,97,87,.16); }
.quote-cell .qnum {
  font-family: var(--mono);
  font-size: 17px;
  line-height: 1.1;
  letter-spacing: -.02em;
}
.quote-cell .qmeta {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-2);
  margin-top: 3px;
  white-space: nowrap;
}
.quote-cell .qheat {
  position: absolute;
  top: 7px; right: 8px;
  font-family: var(--mono);
  font-size: 10px;
  opacity: .75;
}

/* ---- 走势图 ---- */
.chart-box {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  padding: 8px 10px;
  margin-bottom: 4px;
}
.chart { display: block; width: 100%; height: auto; }
.chart-sm { max-height: 120px; }
.chart-axis-note {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-3);
  margin: 0 2px 14px;
}

/* ---- 偏好：控制 + 图 ---- */
.pref-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  margin-bottom: 18px;
}
.pref-controls { display: flex; flex-direction: column; gap: 14px; }
.slider-row .srow {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12.5px; margin-bottom: 3px;
}
.slider-row .sval { font-family: var(--mono); font-size: 12px; color: var(--accent); }
.slider-row .sdesc { font-size: 11px; color: var(--ink-3); line-height: 1.5; margin-top: 2px; }
.slider-row input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  height: 18px;
}

.pref-chart {
  position: relative;
  height: 210px;
  display: flex;
  gap: 2px;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  padding: 6px 8px;
  overflow: hidden;
}
.pref-col { flex: 1; position: relative; }
.pref-bar { position: absolute; left: 0; right: 0; border-radius: 1px; }
.pref-zero {
  position: absolute;
  left: 8px; right: 8px; top: 50%;
  border-top: 1px dashed var(--line-strong);
  pointer-events: none;
}
.pref-num {
  position: absolute;
  bottom: 2px; left: 0; right: 0;
  text-align: center;
  font-family: var(--mono);
  font-size: 7.5px;
  color: var(--ink-3);
  pointer-events: none;
}

.sw-hot { background: #b93b2c; }
.sw-cold { background: #2c5f9e; }

@media (max-width: 1080px) {
  .kpis-5 { grid-template-columns: repeat(3, 1fr); }
  .pref-layout { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .quote-wall { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kpis-5 { grid-template-columns: repeat(2, 1fr); }
}

/* 54% 返奖构成条 */
.split-bar {
  display: flex;
  height: 26px;
  border-radius: 4px;
  overflow: hidden;
  margin: 4px 0 16px;
  font-family: var(--mono);
  font-size: 10.5px;
}
.split-bar > div {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
}
.split-fixed { background: #2b6a4b; }
.split-float { background: #1f6157; }
.split-house { background: #a03829; }

/* ==================================================================
   深色主题 —— 只覆盖变量，所有组件自动跟随
   ================================================================== */

:root[data-theme="dark"] {
  --rail: #0e1013;
  --rail-2: #171a1e;
  --rail-ink: #e6e5df;
  --rail-muted: #7d7b75;

  --bg: #131519;
  --surface: #1a1d22;
  --surface-2: #1f2329;
  --ink: #e8e7e1;
  --ink-2: #b0ada4;
  --ink-3: #85837c;
  --line: #2b2f36;
  --line-strong: #3b4048;

  --accent: #6fc0ad;
  --accent-soft: #1b3a35;
  --warn: #d8a552;
  --warn-soft: #372c19;
  --danger: #e0705f;
  --danger-soft: #38211d;
  --ok: #5fbf8f;
  --ok-soft: #1b3229;

  --ball-red: #e0705f;
  --ball-blue: #6fa3e0;
  --ball-green: #5fbf8f;
  --ball-none: #7d7b75;
}

html { transition: background-color .18s ease; }
body, .card, .sidebar, .tbl th { transition: background-color .18s ease, color .18s ease; }

/* ==================================================================
   导航分组 / 顶栏按钮
   ================================================================== */

.nav { overflow-y: auto; padding-bottom: 8px; }
.nav::-webkit-scrollbar { width: 4px; }
.nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 2px; }

.nav-group {
  padding: 14px 20px 5px;
  font-size: 10px;
  letter-spacing: .14em;
  color: rgba(255,255,255,.32);
  text-transform: uppercase;
}
.nav-group:first-child { padding-top: 2px; }

.icon-btn {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-2);
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }

.chip-link { text-decoration: none; }
.chip-link:hover { color: var(--accent); border-color: var(--accent); }

/* ==================================================================
   组合特征卡片
   ================================================================== */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.fcard {
  text-align: left;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 7px;
  padding: 10px 11px 9px;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  transition: border-color .12s, transform .12s, box-shadow .12s;
}
.fcard:hover { transform: translateY(-1px); box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.fcard.is-active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.fcard.is-sig { border-left: 3px solid var(--warn); }

.fcard-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; }
.fcard-name { font-size: 12.5px; line-height: 1.35; }
.fcard-stat { font-family: var(--mono); font-size: 15px; margin-top: 7px; letter-spacing: -.02em; }
.fcard-foot { font-size: 10.5px; color: var(--ink-3); margin-top: 3px; font-family: var(--mono); }

/* ==================================================================
   图表悬停读数
   ================================================================== */

.chart-box { position: relative; }
.chart-tip {
  position: absolute;
  z-index: 6;
  transform: translate(-50%, -112%);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: 0 6px 20px rgba(0,0,0,.14);
  border-radius: 6px;
  padding: 6px 9px;
  font-size: 11.5px;
  line-height: 1.55;
  font-family: var(--mono);
  color: var(--ink);
  pointer-events: none;
  white-space: nowrap;
  max-width: 320px;
}

/* ==================================================================
   配对热力图
   ================================================================== */

.pairs-wrap { position: relative; display: flex; justify-content: center; }
#pairs-canvas {
  width: 100%;
  max-width: 760px;
  height: auto;
  border-radius: 4px;
  cursor: crosshair;
}

/* ==================================================================
   谬误检测
   ================================================================== */

.fallacy-list { display: grid; gap: 9px; }

.claim {
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
  border-radius: 6px;
  padding: 11px 13px;
  background: var(--surface-2);
}
.claim.is-supported { border-left-color: var(--warn); background: var(--warn-soft); }
.claim.is-no_support { border-left-color: var(--ok); }
.claim.is-contradicted { border-left-color: var(--danger); background: var(--danger-soft); }
.claim.is-refer { border-left-color: var(--line-strong); }

.claim-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.claim-claim { font-weight: 600; font-size: 13px; }
.claim-why { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }
.claim-test { font-size: 11.5px; color: var(--ink-2); margin-top: 6px; }
.claim-test code { font-size: 11px; background: var(--surface); padding: 1px 5px; border-radius: 3px; border: 1px solid var(--line); }
.claim-stats {
  display: flex; gap: 16px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 11.5px;
  margin-top: 7px; color: var(--ink-2);
}
.claim-stats b { color: var(--ink); }
.claim-explain { font-size: 12px; color: var(--ink-2); margin-top: 7px; line-height: 1.65; }

.trap-list { display: grid; gap: 9px; }
.trap {
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  padding: 11px 13px;
}
.trap-claim { font-weight: 600; font-size: 12.5px; }
.trap-why { font-size: 12px; color: var(--danger); margin-top: 4px; }
.trap-fix { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; }

/* ==================================================================
   可排序表头 / 加载态
   ================================================================== */

.tbl-sortable th[data-sort] { cursor: pointer; user-select: none; }
.tbl-sortable th[data-sort]:hover { color: var(--accent); }
.tbl-sortable th.is-sorted::after { content: " ▲"; font-size: 8px; opacity: .7; }
.tbl-sortable th.is-sorted[data-dir="desc"]::after { content: " ▼"; }

.view.is-loading { opacity: .5; }
.view.is-loading::after {
  content: "加载中…";
  position: fixed;
  right: 28px; bottom: 24px;
  background: var(--ink);
  color: var(--bg);
  font-size: 11.5px;
  padding: 5px 12px;
  border-radius: 999px;
  z-index: 30;
}

@media (max-width: 1200px) {
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ==================================================================
   全局扫描 / 交叉校验 / 增量对比
   ================================================================== */

.mini-title {
  font-size: 11.5px;
  color: var(--ink-3);
  letter-spacing: .04em;
  margin: 2px 0 6px;
}

.cc-result { margin-top: 12px; }
.cc-result .result-hero { margin-top: 4px; }

.btn-sm {
  padding: 4px 10px;
  font-size: 11.5px;
}

/* 表格内的等宽号码串 */
.tbl .mono { letter-spacing: .02em; }

/* ------------------------------------------------------------------ 玩家工具 */

.budget-bar {
  height: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  margin: 10px 0 6px;
}
.budget-fill { height: 100%; background: var(--accent); transition: width .25s; }
.budget-fill.is-warn { background: var(--warn); }
.budget-fill.is-over { background: var(--danger); }

.paste-box {
  width: 100%;
  min-height: 180px;
  margin: 12px 0;
  padding: 11px 13px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  resize: vertical;
}
.paste-box:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
}

@media (max-width: 640px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .main { padding: 0 12px 40px; }
  .form-row label { flex: 1 1 44%; }
  .tbl { font-size: 11.5px; }
  .result-hero .big { font-size: 24px; }
}
