:root {
  color-scheme: dark;
  --bg: #101410;
  --panel: #171c17;
  --surface: #1d241d;
  --border: #303a30;
  --text: #f4f6ee;
  --muted: #a8b4a5;
  --accent: #d9f783;
  --up: #ff9485;
  --down: #85d9ad;
  --resistance: #ffba87;
  --support: #9cddbb;
  font: 16px/1.45 "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.shell { max-width: 1280px; width: calc(100% - 64px); margin-inline: auto; }
.topbar { border-bottom: 1px solid var(--border); }
.topbar-inner, .header-tools, .heading, .toolbar, .panel-top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.topbar-inner { height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-size: 1.25rem; font-weight: 780; }
.brand-mark { height: 22px; width: 22px; border: 2px solid var(--accent); border-radius: 7px; transform: rotate(-15deg); position: relative; }
.brand-mark::after { content: ""; position: absolute; inset: 5px 4px; border-top: 2px solid var(--accent); transform: rotate(-18deg); }
.feed-status, .secondary, .as-of { color: var(--muted); font-size: .875rem; }
.refresh, .periods button { background: transparent; color: var(--muted); border: 1px solid var(--border); border-radius: 8px; min-height: 42px; padding: 8px 14px; }
.refresh:hover, .periods button:hover { color: var(--text); border-color: var(--muted); }
.heading { align-items: end; padding-block: 38px 22px; }
.eyebrow { color: var(--accent); margin: 0 0 4px; font-size: .875rem; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(2rem, 6vw, 3.25rem); letter-spacing: -.055em; line-height: 1.12; }
h2 { font-size: 1.25rem; margin-bottom: 3px; }
h3 { font-size: 1rem; margin-bottom: 4px; }
.watchlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: 10px; margin-bottom: 25px; }
.symbol { border: 1px solid var(--border); color: var(--text); text-align: left; padding: 11px 13px; border-radius: 10px; background: var(--panel); min-height: 66px; min-width: 0; }
.symbol:hover { background: var(--surface); }
.symbol[aria-pressed="true"] { border-color: var(--accent); background: #232b1c; }
.symbol strong, .symbol small { display: block; overflow-wrap: anywhere; }
.symbol small { color: var(--muted); margin-top: 3px; font-size: .875rem; }
.notice { margin: 0 0 16px; color: var(--muted); }
.notice.warning { color: var(--resistance); }
.toolbar { margin-bottom: 14px; }
.periods { display: flex; flex-wrap: wrap; gap: 6px; }
.periods button { min-width: 66px; white-space: nowrap; }
.periods button[aria-pressed="true"] { color: var(--bg); background: var(--accent); border-color: var(--accent); font-weight: 720; }
.grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(270px, 1fr); gap: 14px; }
.panel { min-width: 0; border: 1px solid var(--border); border-radius: 14px; background: var(--panel); }
.panel-top { padding: 17px 18px 13px; }
.quote { text-align: right; display: grid; gap: 4px; justify-items: end; }
.quote strong { font-size: clamp(1.35rem, 4.5vw, 2rem); font-variant-numeric: tabular-nums; line-height: 1.1; }
.trend { font-size: .875rem; color: var(--accent); }
.trend[data-direction="up"] { color: var(--up); }
.trend[data-direction="down"] { color: var(--down); }
.chart { position: relative; height: clamp(260px, 46vw, 420px); margin-inline: 8px; }
canvas { display: block; width: 100%; height: 100%; }
.tooltip { position: absolute; top: 6px; left: 10px; padding: 4px 8px; border-radius: 5px; background: #101410ed; border: 1px solid var(--border); font-size: .82rem; pointer-events: none; white-space: nowrap; max-width: calc(100% - 20px); overflow: hidden; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 7px 18px 16px; color: var(--muted); font-size: .875rem; }
.swatch { display: inline-block; width: 13px; height: 2px; margin: 0 6px 3px 0; }
.swatch.support { background: var(--support); }
.swatch.resistance { background: var(--resistance); }
.level-group { padding: 11px 18px 14px; border-top: 1px solid var(--border); }
.level-group h4 { margin: 0 0 7px; font-size: .9rem; }
.level-group[data-side="resistance"] h4 { color: var(--resistance); }
.level-group[data-side="support"] h4 { color: var(--support); }
.level { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 9px; padding: 4px 0; }
.level strong { font-variant-numeric: tabular-nums; font-size: 1rem; }
.level span { color: var(--muted); font-size: .875rem; }
.analysis-meta { color: var(--muted); font-size: .875rem; padding: 14px 0 28px; }
@media (max-width: 830px) {
  .grid { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 560px) {
  .shell { width: calc(100% - 28px); }
  .topbar-inner { height: 58px; }
  .heading { align-items: start; flex-direction: column; gap: 7px; padding-block: 23px 15px; }
  .watchlist { grid-template-columns: repeat(2, minmax(0,1fr)); margin-bottom: 18px; }
  .toolbar { align-items: start; flex-direction: column; gap: 10px; }
  .periods { width: 100%; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); }
  .periods button { min-width: 0; padding-inline: 3px; }
  .panel-top { padding-inline: 12px; }
  .level-group { padding-inline: 12px; }
}
