:root {
  --bg: #0b0e11;
  --card: #12161c;
  --ink: #eaecef;
  --muted: #848e9c;
  --line: #2b3139;
  --gold: #f0b90b;
  --gold-soft: #2a2412;
  --up: #f6465d;
  --down: #0ecb81;
  --shadow: none;
  --nav: 3.6rem;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 "WenQuanYi Micro Hei", "PingFang SC", "Noto Sans SC", sans-serif;
  padding-bottom: calc(var(--nav) + 4.6rem + env(safe-area-inset-bottom));
}
a { color: var(--gold); }
.num, .stat b, .pos b, .quote b, .ticker, td, .tipbox b {
  font-family: "Roboto Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}
.wrap { width: min(760px, 100%); margin: 0 auto; padding: 0.6rem 0.75rem 1.2rem; }
.top {
  position: sticky; top: 0; z-index: 6;
  display: flex; gap: 0.6rem; align-items: center;
  background: rgba(11, 14, 17, 0.94);
  padding: 0.45rem 0; border-bottom: 1px solid var(--line);
}
.ticker { margin-left: auto; text-align: right; font-size: 0.82rem; }
.ticker b { font-size: 1rem; }
.pill {
  flex: none; background: var(--gold); color: #1a140c; border-radius: 4px;
  padding: 0.15rem 0.45rem; font-size: 0.72rem; letter-spacing: 0.06em;
}
.eyebrow { margin: 0; color: var(--muted); font-size: 0.72rem; }
h1 { margin: 0; font-size: 1.2rem; line-height: 1.2; font-weight: 650; }
h2 { margin: 0 0 0.35rem; font-size: 0.95rem; letter-spacing: 0.02em; }
.banner, .state {
  margin: 0.7rem 0 0; padding: 0.6rem 0.75rem; border-radius: 6px;
  background: #1a1408; border: 1px solid #3d3420; color: #f6e2b8; font-size: 0.86rem;
}
.banner strong { display: block; margin-bottom: 0.15rem; }
.state.bad { background: #2a1215; border-color: #f6465d; color: #ffd0d6; }
.state.ok { background: #0d2218; border-color: #0ecb81; color: #c8f5de; }
.lead { font-size: 0.95rem; margin: 0.7rem 0 0; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.45rem; margin-top: 0.7rem; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  padding: 0.75rem 0.8rem 0.85rem; margin-top: 0.6rem;
}
.stat { padding: 0.5rem 0.55rem; border-radius: 6px; background: #0e1318; border: 1px solid var(--line); }
.stat span { display: block; color: var(--muted); font-size: 0.7rem; }
.stat b { display: block; margin-top: 0.1rem; font-size: 1.05rem; }
.stat.hero b { font-size: 1.2rem; }
.up, .cn-gain { color: var(--up); }
.down, .cn-loss { color: var(--down); }
.small { font-size: 0.78rem; color: var(--muted); }
label.fee { display: block; margin-top: 0.5rem; font-size: 0.88rem; }
input[type="number"] {
  width: 4.2rem; font: inherit; padding: 0.3rem 0.35rem; border-radius: 4px;
  border: 1px solid var(--line); background: #0e1318; color: var(--ink);
}
button[disabled] {
  width: 100%; border: 0; border-radius: 6px; padding: 0.85rem 1rem; font: inherit;
  background: #1e2329; color: #848e9c;
}
canvas, #navchart { width: 100%; height: 280px; display: block; }
.toggles { display: flex; gap: 0.35rem; flex-wrap: wrap; margin: 0.35rem 0; }
.toggles button {
  border: 1px solid var(--line); background: #0e1318; border-radius: 4px;
  padding: 0.28rem 0.65rem; font: inherit; color: var(--muted);
}
.toggles button[aria-pressed="true"] {
  background: var(--gold); color: #1a140c; border-color: var(--gold); font-weight: 700;
}
.barline { display: grid; grid-template-columns: 7.2rem 1fr auto; gap: 0.4rem; align-items: center; margin: 0.3rem 0; font-size: 0.78rem; }
.track { height: 0.4rem; background: #1e2329; border-radius: 2px; overflow: hidden; }
.track i { display: block; height: 100%; }
.heat { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.25rem; }
.heat b { display: block; font-size: 0.62rem; font-weight: 550; line-height: 1.2; padding: 0.25rem; border-radius: 4px; text-align: center; }
table { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
th, td { text-align: left; padding: 0.35rem 0.12rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 0.7rem; }
ol { padding-left: 1.1rem; margin: 0.2rem 0; }
ol li { margin: 0.28rem 0; }
.pos { display: grid; grid-template-columns: 4.4rem 1fr; gap: 0.12rem 0.5rem; margin: 0.3rem 0 0.5rem; }
.pos span { color: var(--muted); font-size: 0.75rem; }
.legend { display: flex; gap: 0.7rem; flex-wrap: wrap; margin: 0.35rem 0 0; font-size: 0.75rem; color: var(--muted); }
details.raw, details.suggest { margin-top: 0.4rem; }
details summary { cursor: pointer; color: var(--muted); }
.quote-table td:last-child, .quote-table th:last-child { text-align: right; }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 8;
  display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 0.15rem;
  background: #0b0e11; border-top: 1px solid var(--line);
  padding: 0.35rem 0.4rem calc(0.35rem + env(safe-area-inset-bottom));
}
.tabbar a {
  flex: 0 0 auto; text-decoration: none; color: var(--muted);
  font-size: 0.78rem; padding: 0.4rem 0.65rem; border-radius: 4px; white-space: nowrap;
}
.tabbar a[aria-current="page"] { color: #1a140c; background: var(--gold); font-weight: 700; }
.chart-box { position: relative; width: 100%; max-width: 100%; }
#navchart { width: 100%; max-width: 100%; height: 320px; }
.ma-legend {
  position: absolute; left: 6px; top: 4px; right: 78px; z-index: 3;
  pointer-events: none; font-size: 11px; line-height: 1.35;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
.ma-legend i { display: inline-block; width: 10px; height: 2px; margin-right: 3px; vertical-align: middle; }
.ma-legend .mas span { margin-right: 0.45rem; white-space: nowrap; }
.tipbox {
  position: absolute; z-index: 4; pointer-events: none;
  background: #1e2329; border: 1px solid #474d57; border-radius: 4px;
  padding: 0.35rem 0.5rem; font-size: 0.75rem; line-height: 1.35; max-width: 12.5rem;
}
.loading { color: var(--muted); }
.returns { width: 100%; border-collapse: collapse; font-size: 0.75rem; }
.returns th, .returns td { padding: 0.28rem 0.15rem; text-align: right; }
.returns th:first-child, .returns td:first-child { text-align: left; }
.legal, .riskline {
  margin: 0.8rem 0 0; text-align: center; font-size: 0.72rem; color: var(--muted);
}
code.sym { color: var(--muted); font-size: 0.75rem; }
