: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;
  --bn: #f0b90b; --hl: #50d2c1; --band: rgba(88,166,255,.22); --line: #58a6ff;
}
* { 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); }
.wk { font-size: 10.5px; color: var(--faint); font-weight: 500; }

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: 1680px; 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: 8px; font-size: 12px; }
.xlink { border: 1px solid var(--border); border-radius: 999px; padding: 2px 9px; color: var(--muted); font-size: 11.5px; }
.xlink:hover { color: var(--text); border-color: var(--faint); }

main { max-width: 1680px; margin: 0 auto; padding: 14px 16px 60px; }
.loading { color: var(--muted); text-align: center; padding: 60px 0; }
footer { max-width: 1680px; margin: 0 auto; padding: 18px 16px 40px; color: var(--faint); font-size: 12px; border-top: 1px solid var(--border); line-height: 1.9; }

/* controls */
.ctl { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
select, button, input { background: var(--panel2); color: var(--text); border: 1px solid var(--border);
  border-radius: 6px; padding: 5px 9px; font: inherit; font-size: 13px; }
select:hover, button:hover { border-color: var(--faint); }
button { cursor: pointer; }
button.on { background: #1f3350; border-color: var(--link); color: #cfe4ff; }
.lbl { color: var(--muted); font-size: 12px; }
.seg { display: flex; gap: 0; }
.seg button { border-radius: 0; margin-left: -1px; }
.seg button:first-child { border-radius: 6px 0 0 6px; margin-left: 0; }
.seg button:last-child { border-radius: 0 6px 6px 0; }

/* cards */
.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: 128px; }
.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); }

/* chart */
.chartbox { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px 6px; margin-bottom: 12px; position: relative; }
.chartbox h3 { margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--muted); display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.chartbox h3 .legend { font-weight: 500; font-size: 11.5px; }
.chartbox h3 .legend i { display: inline-block; width: 10px; height: 3px; vertical-align: middle; margin-right: 4px; border-radius: 2px; }
canvas { display: block; width: 100%; cursor: crosshair; }
.tip { position: absolute; pointer-events: none; background: rgba(22,27,34,.97); border: 1px solid var(--border);
  border-radius: 7px; padding: 7px 10px; font-size: 12px; line-height: 1.6; z-index: 10; white-space: nowrap;
  font-variant-numeric: tabular-nums; box-shadow: 0 4px 18px rgba(0,0,0,.5); }
.tip b { color: var(--text); } .tip .r { display: flex; justify-content: space-between; gap: 14px; }

/* table */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 6px 9px; text-align: right; border-bottom: 1px solid var(--grid); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 11.5px; position: sticky; top: 0; background: var(--bg); cursor: pointer; user-select: none; z-index: 5; box-shadow: 0 1px 0 var(--border); }
th:hover { color: var(--text); }
th.l, td.l { text-align: left; }
tbody tr:hover { background: var(--panel2); }
tbody tr { cursor: pointer; }
.tag { font-size: 10.5px; padding: 1px 6px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); }
.tag.black { border-color: #6e2c2f; color: #ffb3ad; background: #2d1517; }
.tag.growth { border-color: #1f4d3d; color: #56d364; background: #10251d; }
.bar { display: inline-block; height: 9px; border-radius: 2px; vertical-align: middle; }
.spark { vertical-align: middle; }
.tblwrap { overflow: auto; max-height: calc(100vh - 250px); border: 1px solid var(--border); border-radius: 9px; }
.tblwrap table { border-collapse: separate; border-spacing: 0; }
.note { color: var(--muted); font-size: 12.5px; margin: 10px 0 16px; line-height: 1.8; }
.doc { max-width: 900px; line-height: 1.9; }
.doc h3 { margin: 22px 0 6px; font-size: 15px; }
.doc p, .doc li { color: #c9d1d9; font-size: 13.5px; }
.doc ul { padding-left: 20px; }
.hint { color: var(--faint); font-size: 11.5px; }
