:root {
  --bg: #0d1117;
  --panel: #161b22;
  --panel2: #1c2129;
  --border: #30363d;
  --text: #e6edf3;
  --muted: #8b949e;
  --faint: #6e7681;
  --link: #58a6ff;
  --pos: #3fb950;
  --neg: #f85149;
  --warn: #d29922;
  --grid: #21262d;
  --hot: #56d364;
  /* 七所配色 —— 与各站雷达的品牌色对齐, 列头/曲线/徽章共用 */
  --v-hl: #50d2c1;
  --v-bn: #f0b90b;
  --v-bg: #4fa3ff;
  --v-poly: #b98cf0;
  --v-bybit: #f7a35c;
  --v-gate: #63d2a6;
  --v-cb: #7d92f5;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.5 -apple-system, "SF Pro Text", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
a { color: var(--link); text-decoration: none; }
code { background: var(--panel2); padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.hidden { display: none !important; }
.pos { color: var(--pos); } .neg { color: var(--neg); } .muted { color: var(--muted); }
.faint { color: var(--faint); }

/* ── header ── */
header { position: sticky; top: 0; z-index: 30; background: rgba(13,17,23,.94); backdrop-filter: blur(6px); border-bottom: 1px solid var(--border); }
.hwrap { max-width: 1720px; margin: 0 auto; padding: 9px 16px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; }
.logo { font-size: 19px; }
.title { font-weight: 700; font-size: 16px; }
.title .sub { color: var(--muted); font-weight: 500; font-size: 13px; margin-left: 4px; }
nav#tabs { display: flex; gap: 4px; }
nav#tabs a { color: var(--muted); padding: 5px 12px; border-radius: 6px; font-weight: 600; cursor: pointer; }
nav#tabs a.active { color: var(--text); background: var(--panel2); }
nav#tabs a:hover { color: var(--text); }
.hstatus { margin-left: auto; display: flex; align-items: center; gap: 6px; font-size: 12px; flex-wrap: wrap; }
.xlink { border: 1px solid var(--border); border-radius: 999px; padding: 2px 9px; color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.xlink:hover { color: var(--text); border-color: var(--faint); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pos); display: inline-block; animation: pulse 2s infinite; }
.dot.bad { background: var(--neg); animation: none; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .35 } }

.stale { background: #3d1d1f; color: #ffb3ad; border-bottom: 1px solid #6e2c2f; text-align: center; padding: 6px; font-size: 13px; }
.warnbar { background: #241d0f; color: #e3b341; border-bottom: 1px solid #4a3a15; text-align: center;
  padding: 5px 16px; font-size: 12.5px; }

main { max-width: 1720px; margin: 0 auto; padding: 14px 16px 60px; }
.loading { color: var(--muted); text-align: center; padding: 60px 0; }

/* ── summary strip ── */
.strip { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 9px; padding: 9px 14px; min-width: 118px; }
.card .k { font-size: 11px; color: var(--muted); letter-spacing: .3px; }
.card .v { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 1px; }
.card .v small { font-size: 12px; font-weight: 500; color: var(--muted); }
.card.wide { flex: 1; min-width: 320px; }
.card.wide .v { font-size: 12.5px; font-weight: 500; line-height: 1.7; }

/* ── controls ── */
.controls { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; margin-bottom: 10px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 9px; padding: 9px 12px; }
.cgrp { display: flex; align-items: center; gap: 5px; }
.cgrp > label { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.pills { display: flex; gap: 3px; flex-wrap: wrap; }
.pill { border: 1px solid var(--border); background: var(--panel2); color: var(--muted); padding: 3px 10px;
  border-radius: 999px; cursor: pointer; font-size: 12px; font-weight: 600; user-select: none; }
.pill:hover { color: var(--text); }
.pill.on { background: #1f3a5f; border-color: #2f5f9e; color: #cae2ff; }
.vpill { border: 1px solid var(--border); background: var(--panel2); color: var(--faint); padding: 3px 9px;
  border-radius: 999px; cursor: pointer; font-size: 12px; font-weight: 700; user-select: none; }
.vpill.on { color: #0d1117; }
.vpill.on[data-v=hl] { background: var(--v-hl); border-color: var(--v-hl); }
.vpill.on[data-v=bn] { background: var(--v-bn); border-color: var(--v-bn); }
.vpill.on[data-v=bg] { background: var(--v-bg); border-color: var(--v-bg); }
.vpill.on[data-v=poly] { background: var(--v-poly); border-color: var(--v-poly); }
.vpill.on[data-v=bybit] { background: var(--v-bybit); border-color: var(--v-bybit); }
.vpill.on[data-v=gate] { background: var(--v-gate); border-color: var(--v-gate); }
.vpill.on[data-v=cb] { background: var(--v-cb); border-color: var(--v-cb); }
input[type=text], input[type=number], select {
  background: var(--panel2); border: 1px solid var(--border); color: var(--text);
  border-radius: 6px; padding: 3px 8px; font-size: 12.5px; outline: none; font-variant-numeric: tabular-nums; }
input[type=number] { width: 62px; }
input:focus { border-color: #2f5f9e; }
.chk { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); cursor: pointer; user-select: none; }
.btn { border: 1px solid var(--border); background: var(--panel2); color: var(--muted); border-radius: 6px;
  padding: 3px 10px; font-size: 12px; cursor: pointer; font-weight: 600; }
.btn:hover { color: var(--text); }
.sep { width: 1px; height: 20px; background: var(--border); }
.fee { width: 50px !important; }

/* ── table ── */
.tw { background: var(--panel); border: 1px solid var(--border); border-radius: 9px; overflow: auto; }
.tw.grid { max-height: calc(100vh - 292px); }
table { border-collapse: collapse; width: 100%; min-width: 1460px; font-size: 13px; table-layout: fixed; }
thead th { position: sticky; top: 0; background: var(--panel2); z-index: 10;
  text-align: right; padding: 7px 8px; font-size: 11.5px; color: var(--muted); font-weight: 600;
  border-bottom: 1px solid var(--border); white-space: nowrap; cursor: pointer; user-select: none;
  overflow: hidden; text-overflow: ellipsis; }
thead th:first-child, thead th.l { text-align: left; }
thead th:hover { color: var(--text); }
thead th .ar { color: var(--link); font-size: 10px; }
thead th.off { color: var(--faint); background: #191d24; }
thead th.red { color: #ff9d95; }
thead th[data-v=hl].on { color: var(--v-hl); }
thead th[data-v=bn].on { color: var(--v-bn); }
thead th[data-v=bg].on { color: var(--v-bg); }
thead th[data-v=poly].on { color: var(--v-poly); }
thead th[data-v=bybit].on { color: var(--v-bybit); }
thead th[data-v=gate].on { color: var(--v-gate); }
thead th[data-v=cb].on { color: var(--v-cb); }
tbody td { padding: 5px 8px; text-align: right; border-bottom: 1px solid var(--grid);
  white-space: nowrap; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }
tbody td.l { text-align: left; }
tbody td.off { background: #12161c; color: var(--faint); }
tbody tr { cursor: pointer; }
tbody tr:hover { background: #1a2029; }
.sym { font-weight: 700; }
.xmark { color: var(--faint); cursor: help; }
.net { font-weight: 700; font-size: 14px; }
.net.t3 { color: var(--hot); }
.net.t2 { color: var(--pos); }
.net.t1 { color: var(--warn); }
.net.t0 { color: var(--faint); }
.badge { display: inline-block; font-size: 10px; padding: 0 5px; border-radius: 4px; margin-left: 4px;
  border: 1px solid transparent; font-weight: 600; vertical-align: 1px; }
.b-加密 { background: #2b2438; color: #c9a7f0; }
.b-股票 { background: #1f2a3d; color: #8ab4f8; }
.b-ETF { background: #16302c; color: #6fd3c0; }
.b-指数 { background: #33261a; color: #e0a373; }
.b-商品 { background: #3a2c10; color: #e3b341; }
.b-外汇 { background: #26313a; color: #93b7c9; }
.b-Pre-IPO { background: #351f2e; color: #ef9fc6; }
.b-alt { background: #262b33; color: var(--muted); }
.b-cons { background: #17301f; color: #6fce8a; }
.dirtag { font-size: 12px; color: var(--muted); }
.dirtag b { font-weight: 700; }
.wk { color: var(--faint); }
.vtag { font-weight: 700; }
.vtag.hl { color: var(--v-hl); } .vtag.bn { color: var(--v-bn); } .vtag.bg { color: var(--v-bg); }
.vtag.poly { color: var(--v-poly); } .vtag.bybit { color: var(--v-bybit); }
.vtag.gate { color: var(--v-gate); } .vtag.cb { color: var(--v-cb); }

/* ── underlying page ── */
.ubox { background: var(--panel); border: 1px solid var(--border); border-radius: 9px; padding: 14px 16px; margin-bottom: 12px; }
.ubox h3 { margin: 0 0 10px; font-size: 14px; border-left: 3px solid var(--link); padding-left: 9px; }
.ubox table { min-width: 0; }
.uhead { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.uhead .k { font-size: 22px; font-weight: 700; }
canvas { width: 100%; display: block; background: #10151c; border-radius: 7px; border: 1px solid var(--grid); }
.legend { display: flex; gap: 12px; flex-wrap: wrap; margin: 8px 0 2px; font-size: 12px; }
.legend span { display: flex; align-items: center; gap: 5px; color: var(--muted); }
.legend i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }

/* ── docs ── */
.doc { background: var(--panel); border: 1px solid var(--border); border-radius: 9px; padding: 18px 22px; max-width: 1080px; line-height: 1.75; }
.doc h3 { margin: 22px 0 8px; font-size: 15px; border-left: 3px solid var(--link); padding-left: 9px; }
.doc h3:first-child { margin-top: 0; }
.doc p, .doc li { font-size: 13.5px; color: #c9d1d9; }
.doc table { margin: 8px 0 4px; font-size: 12.5px; min-width: 0; table-layout: auto; }
.doc table td, .doc table th { border-bottom: 1px solid var(--grid); padding: 5px 10px; text-align: left; }
.doc table th { color: var(--muted); font-weight: 600; }
.doc .fml { background: var(--panel2); border-radius: 7px; padding: 10px 14px; margin: 8px 0;
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.85;
  white-space: pre-wrap; overflow-x: auto; }

footer { max-width: 1720px; margin: 0 auto; padding: 14px 16px 30px; color: var(--faint); font-size: 11.5px; line-height: 1.8; }

/* v0.2 长窗口 */
.cov { color: var(--faint); font-size: 10px; white-space: nowrap; cursor: help; margin-left: 3px; }
tbody td .cov { display: block; line-height: 1.1; margin-left: 0; }
.pill.long { border-style: dashed; }
.uwin { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 8px; }
.uwin > label { font-size: 11.5px; color: var(--muted); }
.uwin .muted { font-size: 11.5px; }

/* ── v0.3 标的页图表: 七所复选框 + hover 浮层 ── */
.uvsel { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; margin: 0 0 8px;
  background: var(--panel2); border: 1px solid var(--border); border-radius: 8px; padding: 6px 11px; }
.uvsel .uvlab { font-size: 11.5px; color: var(--muted); }
.uchk { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text);
  font-weight: 600; cursor: pointer; user-select: none; }
.uchk input { margin: 0; cursor: pointer; accent-color: #58a6ff; }
.uchk i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.uchk .faint { font-size: 10.5px; font-weight: 500; }
.uchk.dead { color: var(--faint); cursor: not-allowed; }
.uchk.dead i { opacity: .25; }
.uchk.dead input { cursor: not-allowed; }
.lgwrap { margin-bottom: 2px; }
.lgwrap .k { font-size: 11px; line-height: 1.6; }

.chartwrap { position: relative; }
.chtip { position: absolute; z-index: 5; pointer-events: none; white-space: nowrap;
  background: rgba(13,17,23,.96); border: 1px solid var(--border); border-radius: 7px;
  padding: 6px 9px; font-size: 11.5px; line-height: 1.55;
  box-shadow: 0 4px 18px rgba(0,0,0,.55); font-variant-numeric: tabular-nums; }
.chtip .tt { color: var(--muted); font-size: 11px; margin-bottom: 3px;
  padding-bottom: 3px; border-bottom: 1px solid var(--grid); }
.chtip .tr { display: flex; align-items: center; gap: 6px; color: #c9d1d9; }
.chtip .tr.near { color: #fff; font-weight: 700; }
.chtip .tr i { width: 9px; height: 3px; border-radius: 2px; display: inline-block; flex: 0 0 auto; }
.chtip .tr b { font-weight: 700; min-width: 34px; }
.chtip .tr .faint { font-size: 10.5px; }
