:root {
  color-scheme: dark;
  --page: #0b141a;
  --surface: #101e26;
  --line: #293b45;
  --text: #e8f1f4;
  --muted: #a5b8c2;
  --accent: #66e5cc;
  --gate: #f98188;
  --chain: #72acff;
  --spread: #6bdf98;
  font-family: Inter, system-ui, "Microsoft YaHei", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--text); }
[hidden] { display: none !important; }
.shell { width: min(1280px, 100%); margin: 0 auto; padding-inline: clamp(15px, 4vw, 48px); }
.topbar { background: #0e1a21; border-bottom: 1px solid var(--line); }
.topbar-inner { min-height: 67px; display: flex; justify-content: space-between; align-items: center; gap: 14px; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1 { font-size: clamp(17px, 2.5vw, 22px); font-weight: 720; letter-spacing: .01em; white-space: nowrap; }
h1 span { color: var(--accent); font-weight: 590; }
.status { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 8px; text-align: right; }
.status::before { content: ""; flex: none; width: 7px; height: 7px; background: #eeb875; border-radius: 100%; }
.status.ready::before { background: var(--accent); }
.status.error::before { background: var(--gate); }
main { padding-block: 24px 36px; }
.quotes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-block: 1px solid var(--line); }
.quote { display: grid; gap: 4px; padding: 14px clamp(8px, 2.5vw, 26px); }
.quote:first-child { padding-left: 0; }
.quote + .quote { border-left: 1px solid var(--line); }
.quote dt, .quote span, .axis-caption { color: var(--muted); font-size: 12px; }
.quote dd { font-size: clamp(18px, 4.6vw, 34px); font-weight: 680; font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
.gate { color: var(--gate); }
.chain { color: var(--chain); }
.spread { color: var(--spread); }
.market, .pool-section { margin-top: 22px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 18px; margin-bottom: 12px; }
h2 { font-size: 18px; font-weight: 690; }
.axis-caption { margin-top: 3px; }
.ranges { border: 1px solid var(--line); margin: 0; padding: 3px; display: flex; gap: 2px; border-radius: 7px; background: var(--surface); }
.ranges label { position: relative; padding: 7px 12px; font-size: 13px; border-radius: 5px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.ranges input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; }
.ranges label:has(:checked) { color: #dcfff7; background: #264d45; }
.ranges label:has(:focus-visible), canvas:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.custom { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.custom label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; }
.custom input, button { font: inherit; min-height: 36px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 5px; }
.custom input { background: var(--surface); color: var(--text); }
button { background: var(--accent); color: #092820; font-size: 13px; font-weight: 680; cursor: pointer; }
button:hover { background: #8bf2dd; }
#chart-error { font-size: 13px; color: var(--gate); margin-bottom: 10px; }
.legend { display: flex; gap: 17px; list-style: none; margin: 0; padding: 10px 12px 0; background: var(--surface); border: 1px solid var(--line); border-bottom: 0; border-radius: 8px 8px 0 0; }
.legend li { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.legend li::before { content: ""; width: 13px; height: 2px; background: currentColor; }
.plot { position: relative; height: 226px; background: var(--surface); }
.plot.primary { height: clamp(260px, 38vw, 388px); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 8px 8px; }
canvas { display: block; width: 100%; height: 100%; border-radius: inherit; cursor: crosshair; }
.hover-values { position: absolute; top: 14px; min-width: 138px; display: grid; gap: 4px; border: 1px solid #3d555f; border-radius: 5px; background: #101f28; padding: 8px; pointer-events: none; font: 12px system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.hover-values time { color: var(--muted); margin-bottom: 3px; }
.hover-values span { display: flex; justify-content: space-between; gap: 14px; }
.pools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.pools article { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); overflow: hidden; }
.pool-head { padding: 10px 12px 0; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.pool-head h3 { font-size: 14px; }
.pool-head span { color: var(--accent); font-size: 14px; font-variant-numeric: tabular-nums; }
footer { margin-top: 18px; color: var(--muted); font-size: 11px; }
@media (max-width: 620px) {
  .topbar-inner { min-height: 56px; }
  main { padding-block: 17px 30px; }
  .pools { grid-template-columns: 1fr; }
  .ranges label { padding-inline: 10px; }
  .quote dt, .quote span { font-size: 10px; }
}
