/* ============================================================
   ETH Options Reports — Shared Styles
   Dark theme · Trading-grade typography
============================================================ */

:root {
  /* fonts (theme-independent) */
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "Consolas", "JetBrains Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;

  /* default = DARK theme (also applies to [data-theme="dark"] and
     [data-theme="system"] when the OS prefers dark) */
  --bg: #0d1117;
  --bg-elev: #161b22;
  --bg-card: #1c2128;
  --border: #30363d;
  --text: #e6edf3;
  --text-dim: #8b949e;
  --text-muted: #6e7681;
  --accent: #58a6ff;
  --bull: #3fb950;
  --bear: #f85149;
  --warn: #d29922;
  --neutral: #8b949e;
  --track-a: #3fb950;
  --track-b: #58a6ff;
  --track-mixed: #d29922;
  --tg-bg: #1f2937;

  /* atmosphere (Shinkai-ish twilight) */
  --sky: #5ec8e0;
  --sky-soft: rgba(94, 200, 224, 0.14);
  --glow-warm: #ffb27a;
  --track-rail: #21262d;
  --card-bg: rgba(22, 27, 38, 0.84);
  --card-border-hi: rgba(255, 255, 255, 0.07);
  --shadow: 0 4px 18px rgba(2, 6, 16, 0.38);
  --shadow-hover: 0 10px 30px rgba(2, 6, 16, 0.5);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.35);
  --backdrop:
    radial-gradient(1200px 620px at 88% -10%, rgba(94, 200, 224, 0.11), transparent 60%),
    radial-gradient(940px 520px at 10% 112%, rgba(255, 178, 122, 0.06), transparent 62%),
    linear-gradient(168deg, #0a0e1a 0%, #0d1117 46%, #0f1422 100%);
  color-scheme: dark;
}

/* ---- LIGHT theme: explicit pick ---- */
:root[data-theme="light"] {
  --bg: #ffffff;
  --bg-elev: #f6f8fa;
  --bg-card: #f6f8fa;
  --border: #d0d7de;
  --text: #1f2328;
  --text-dim: #57606a;
  --text-muted: #6e7781;
  --accent: #0969da;
  --bull: #1a7f37;
  --bear: #cf222e;
  --warn: #9a6700;
  --neutral: #6e7781;
  --track-a: #1a7f37;
  --track-b: #0969da;
  --track-mixed: #9a6700;
  --tg-bg: #eaeef2;

  /* atmosphere (Shinkai-ish dawn) */
  --sky: #1f8fb0;
  --sky-soft: rgba(31, 143, 176, 0.12);
  --glow-warm: #e0863c;
  --track-rail: #e4e9f0;
  --card-bg: rgba(255, 255, 255, 0.88);
  --card-border-hi: rgba(255, 255, 255, 0.9);
  --shadow: 0 4px 16px rgba(80, 110, 150, 0.13);
  --shadow-hover: 0 10px 28px rgba(80, 110, 150, 0.2);
  --shadow-card: 0 1px 2px rgba(31, 35, 40, 0.08);
  --backdrop:
    radial-gradient(1100px 600px at 90% -12%, rgba(255, 198, 140, 0.32), transparent 62%),
    radial-gradient(900px 540px at 6% 112%, rgba(150, 200, 230, 0.24), transparent 60%),
    linear-gradient(168deg, #e9f1fb 0%, #f3f6fb 48%, #fcf6ef 100%);
  color-scheme: light;
}

/* ---- SYSTEM mode: follow OS when it prefers light ---- */
@media (prefers-color-scheme: light) {
  :root[data-theme="system"] {
    --bg: #ffffff;
    --bg-elev: #f6f8fa;
    --bg-card: #f6f8fa;
    --border: #d0d7de;
    --text: #1f2328;
    --text-dim: #57606a;
    --text-muted: #6e7781;
    --accent: #0969da;
    --bull: #1a7f37;
    --bear: #cf222e;
    --warn: #9a6700;
    --neutral: #6e7781;
    --track-a: #1a7f37;
    --track-b: #0969da;
    --track-mixed: #9a6700;
    --tg-bg: #eaeef2;
    --sky: #1f8fb0;
    --sky-soft: rgba(31, 143, 176, 0.12);
    --glow-warm: #e0863c;
    --track-rail: #e4e9f0;
    --card-bg: rgba(255, 255, 255, 0.88);
    --card-border-hi: rgba(255, 255, 255, 0.9);
    --shadow: 0 4px 16px rgba(80, 110, 150, 0.13);
    --shadow-hover: 0 10px 28px rgba(80, 110, 150, 0.2);
    --shadow-card: 0 1px 2px rgba(31, 35, 40, 0.08);
    --backdrop:
      radial-gradient(1100px 600px at 90% -12%, rgba(255, 198, 140, 0.32), transparent 62%),
      radial-gradient(900px 540px at 6% 112%, rgba(150, 200, 230, 0.24), transparent 60%),
      linear-gradient(168deg, #e9f1fb 0%, #f3f6fb 48%, #fcf6ef 100%);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
}

html { background: var(--bg); }      /* base/fallback color */
body { background: transparent; }    /* let the fixed ::before backdrop show */

/* sky backdrop as ONE fixed compositor layer — painted once, no scroll repaint
   (replaces background-attachment:fixed, which repainted every frame) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--backdrop);
  background-size: cover;
  background-position: center;
  pointer-events: none;
}

/* ============================================================
   INDEX PAGE (sidebar + iframe layout)
============================================================ */

body.index {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: 300px;
  flex-shrink: 0;
  background: var(--card-bg);
  -webkit-backdrop-filter: blur(8px) saturate(1.1);
  backdrop-filter: blur(8px) saturate(1.1);
  border-right: 1px solid var(--border);
  box-shadow: inset -1px 0 0 var(--card-border-hi);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}

.sidebar h1 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.sidebar .subtitle {
  margin: 0;
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--mono);
}

.sidebar .count {
  margin: 8px 0 0;
  font-size: 11px;
  color: var(--text-dim);
}

/* ---- theme toggle (segmented control) ---- */
.theme-toggle {
  display: flex;
  gap: 3px;
  margin-top: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 3px;
}

.theme-toggle button {
  flex: 1;
  background: transparent;
  border: 0;
  color: var(--text-dim);
  padding: 5px 4px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 11px;
  font-family: var(--mono);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: background 0.12s ease, color 0.12s ease;
}

.theme-toggle button:hover { color: var(--text); }

.theme-toggle button.active {
  background: var(--accent);
  color: #fff;
}

.sidebar nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.sidebar nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar nav li {
  border-bottom: 1px solid rgba(48, 54, 61, 0.5);
}

.sidebar nav li a {
  display: block;
  padding: 12px 20px;
  color: var(--text);
  text-decoration: none;
  transition: background 0.12s ease;
}

.sidebar nav li a:hover {
  background: rgba(88, 166, 255, 0.08);
}

.sidebar nav li.active a {
  background: rgba(88, 166, 255, 0.12);
  border-left: 3px solid var(--accent);
  padding-left: 17px;
}

.sidebar nav .ts {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
}

.sidebar nav .meta {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 11px;
  color: var(--text-dim);
}

.sidebar nav .spot {
  font-family: var(--mono);
}

.month-divider {
  padding: 12px 20px 6px;
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: var(--bg);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

main.content {
  flex: 1;
  overflow: hidden;
}

main.content iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* ============================================================
   TAGS (verdict + signals)
============================================================ */

.tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  font-family: var(--mono);
  letter-spacing: 0.3px;
}

.tag-A { background: rgba(63, 185, 80, 0.18); color: var(--bull); }
.tag-B { background: rgba(88, 166, 255, 0.18); color: var(--accent); }
.tag-AB { background: rgba(210, 153, 34, 0.18); color: var(--warn); }
.tag-Mixed { background: rgba(139, 148, 158, 0.18); color: var(--text-dim); }

/* ============================================================
   REPORT PAGE
============================================================ */

body.report {
  padding: 0;
}

article {
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 32px 60px;
}

.report-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
  margin-bottom: 28px;
}

.report-header h1 {
  margin: 0 0 10px;
  font-size: 22px;
  font-weight: 600;
}

.header-meta {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-dim);
}

.header-meta .tag {
  font-size: 11px;
  padding: 3px 9px;
}

article section {
  margin-bottom: 32px;
}

article h2 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

article h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 10px;
}

article h3 small {
  color: var(--text-dim);
  font-weight: 400;
  font-size: 11px;
  margin-left: 6px;
  font-family: var(--mono);
}

/* ============================================================
   SNAPSHOT GRID
============================================================ */

.snapshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.snap-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: var(--shadow-card);
}

.snap-card .label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  font-family: var(--mono);
  font-weight: 700;
}

.snap-card .value {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 600;
}

/* hero treatment — Spot is always rendered first by live.js's renderCards() */
#snapshot-grid > .snap-card:first-child {
  grid-column: span 2;
  background: linear-gradient(160deg, var(--bg-elev), var(--bg-card));
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  box-shadow: var(--shadow-card), inset 0 0 0 1px color-mix(in srgb, var(--accent) 10%, transparent);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 14px 18px;
}
#snapshot-grid > .snap-card:first-child .label { color: var(--accent); }
#snapshot-grid > .snap-card:first-child .value { font-size: 34px; font-weight: 800; letter-spacing: -0.5px; margin-top: 4px; }

.snap-card .sub {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 3px;
  font-family: var(--mono);
}

.snap-card.bull .value { color: var(--bull); }
.snap-card.bear .value { color: var(--bear); }
.snap-card.warn .value { color: var(--warn); }

.gex-note {
  font-size: 12px;
  color: var(--text-dim);
  font-style: italic;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--warn);
  padding: 8px 12px;
  border-radius: 4px;
  margin-top: 8px;
}

/* GEX structure card — full width, colored level chips + readable detail */
.snap-card.gex-card { grid-column: 1 / -1; background: var(--bg-elev); padding: 15px 16px 16px; }

.gex-regime {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  margin: 4px 0 12px;
  color: var(--text-dim);
  background: rgba(128, 128, 128, 0.12);
}
.gex-regime::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}
.gex-regime.bull { color: var(--bull); background: rgba(63, 185, 80, 0.16); }
.gex-regime.bear { color: var(--bear); background: rgba(248, 81, 73, 0.16); }

.gex-levels {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0 0 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.gex-level {
  flex: 1;
  min-width: 150px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 14px 12px;
  border-right: 1px solid var(--border);
  font-family: var(--mono);
}
.gex-level:last-child { border-right: none; }

.gex-level .lvl-label {
  font-size: 10.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.gex-level .lvl-val { font-size: 17px; font-weight: 700; }

.gex-level.lvl-res { background: linear-gradient(180deg, rgba(248, 81, 73, 0.14), transparent 70%); }
.gex-level.lvl-res .lvl-val { color: var(--bear); }
.gex-level.lvl-hvl { background: linear-gradient(180deg, rgba(88, 166, 255, 0.14), transparent 70%); }
.gex-level.lvl-hvl .lvl-val { color: var(--accent); }
.gex-level.lvl-sup { background: linear-gradient(180deg, rgba(63, 185, 80, 0.14), transparent 70%); }
.gex-level.lvl-sup .lvl-val { color: var(--bull); }

.gex-levels::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--bear), var(--accent), var(--bull));
}

.gex-detail {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.65;
  color: var(--text-dim);
}

/* ============================================================
   SIGNAL MATRIX
============================================================ */

.signal-scores {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.score-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: var(--shadow-card);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.score-card .label {
  font-size: 12px;
  color: var(--text-dim);
}

.score-card .scores {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
}

.score-card .scores .pri {
  color: var(--text);
}

.score-card .scores .sep {
  color: var(--text-muted);
  margin: 0 6px;
}

.score-card.dom-bull .pri { color: var(--bull); }
.score-card.dom-bear .pri { color: var(--bear); }

.key-signals {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 82ch;
}

.key-signals li {
  position: relative;
  list-style: none;
  padding: 11px 0 11px 16px;
  border-bottom: 1px solid var(--border);
  font-family: var(--sans);
}

.key-signals li:last-child { border: 0; }

/* neutral left accent bar (direction-agnostic) */
.key-signals li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--sky), var(--accent));
  opacity: 0.6;
}

.sig-lead {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-dim);
}

.sig-impl {
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.6;
  font-weight: 600;
  color: var(--text);
}

.sig-impl::before {
  content: "→";
  color: var(--accent);
  font-weight: 700;
  margin-right: 7px;
}

.sig-tag {
  display: inline-block;
  background: rgba(88, 166, 255, 0.15);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 3px;
  margin-right: 7px;
  letter-spacing: 0.3px;
  vertical-align: 1px;
}

/* ============================================================
   VERDICT
============================================================ */

.verdict-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  padding: 14px 18px;
  border-radius: 6px;
}

.verdict-box .verdict-text {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 6px;
}

.verdict-box .verdict-reason {
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-dim);
  margin: 0;
}

/* ============================================================
   STRIKE TABLE
============================================================ */

/* card wrapper live.js writes the table into via #struct-table innerHTML */
#struct-table {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2px 14px 8px;
  box-shadow: var(--shadow-card);
  overflow-x: auto;
}

table.strike-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 12px;
}

table.strike-table caption {
  text-align: left;
  font-size: 12px;
  color: var(--text-dim);
  padding: 6px 0;
  font-family: var(--sans);
}

table.strike-table th {
  text-align: right;
  padding: 8px 10px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 10.5px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

table.strike-table th:first-child,
table.strike-table th:last-child {
  text-align: left;
}

table.strike-table td {
  padding: 7px 10px;
  border-bottom: 1px solid rgba(128, 128, 128, 0.12);
  text-align: right;
}

table.strike-table td:first-child,
table.strike-table td:last-child {
  text-align: left;
}

table.strike-table tr:hover td {
  background: var(--bg-elev);
}

table.strike-table tr.atm {
  background: rgba(88, 166, 255, 0.08);
}
table.strike-table tr.atm .strike-val {
  color: var(--accent);
}

table.strike-table tr.put-wall td:first-child::before {
  content: "🛡️ ";
}

table.strike-table tr.call-wall td:first-child::before {
  content: "🚧 ";
}

table.strike-table tr.target {
  background: rgba(63, 185, 80, 0.08);
  font-weight: 600;
}

table.strike-table .strike-val {
  color: var(--text);
}

table.strike-table .pos { color: var(--bull); }
table.strike-table .neg { color: var(--bear); }
table.strike-table .net-cell {
  font-family: var(--mono, monospace);
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}
table.strike-table .tag-cell {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--text-dim);
}

/* ============================================================
   STRATEGY CARD
============================================================ */

.strategy-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 14px;
  border-left: 4px solid var(--neutral);
}

.strategy-card.track-A { border-left-color: var(--track-a); }
.strategy-card.track-B { border-left-color: var(--track-b); }
.strategy-card.track-W { border-left-color: var(--track-mixed); }

.strategy-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.strategy-card .code-badge {
  display: inline-block;
  background: rgba(88, 166, 255, 0.15);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
}

.strategy-card.track-A .code-badge {
  background: rgba(63, 185, 80, 0.15);
  color: var(--bull);
}

.strategy-card.track-B .code-badge {
  background: rgba(88, 166, 255, 0.15);
  color: var(--accent);
}

.strategy-card.track-W .code-badge {
  background: rgba(210, 153, 34, 0.15);
  color: var(--warn);
}

.legs {
  margin: 10px 0;
}

.leg {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed rgba(48, 54, 61, 0.4);
}

.leg:last-child { border: 0; }

.leg .action {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 12px;
}

.leg .action.sell { color: var(--bear); }
.leg .action.buy { color: var(--bull); }

.leg .details {
  font-family: var(--mono);
  font-size: 12px;
}

.leg .instrument {
  font-weight: 600;
  margin-bottom: 4px;
}

.leg .params {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--text-dim);
  font-size: 11px;
}

.leg .params strong {
  color: var(--text);
  font-weight: 600;
}

.strategy-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 18px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 12px;
}

.strategy-meta dt {
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.weekly-details {
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.7;
  margin: 0;
  color: var(--text-dim);
}

.strategy-meta dd {
  margin: 0 0 4px;
  font-family: var(--sans);
  line-height: 1.55;
}

/* ============================================================
   RISKS
============================================================ */

.risk-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.risk-list li {
  padding: 8px 12px 8px 30px;
  position: relative;
  font-size: 13px;
  border-left: 2px solid var(--bear);
  background: rgba(248, 81, 73, 0.05);
  margin-bottom: 6px;
  border-radius: 0 4px 4px 0;
}

.risk-list li::before {
  content: "⚠";
  position: absolute;
  left: 10px;
  color: var(--bear);
}

.position-sizing {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: 6px;
  margin-top: 12px;
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.6;
}

/* ============================================================
   TG MESSAGE
============================================================ */

.tg-block {
  background: var(--tg-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 16px;
  position: relative;
}

.tg-block pre {
  margin: 0;
  white-space: pre-wrap;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  color: var(--text);
}

.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  font-family: var(--mono);
  transition: all 0.15s ease;
}

.copy-btn:hover {
  color: var(--text);
  border-color: var(--accent);
}

.copy-btn.copied {
  color: var(--bull);
  border-color: var(--bull);
}

/* ============================================================
   COLLAPSIBLE
============================================================ */

details {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0;
  margin-bottom: 8px;
}

details summary {
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  list-style: none;
  user-select: none;
}

details summary::-webkit-details-marker { display: none; }

details summary::before {
  content: "▶";
  display: inline-block;
  margin-right: 8px;
  font-size: 10px;
  transition: transform 0.15s ease;
}

details[open] summary::before {
  transform: rotate(90deg);
}

details > div {
  padding: 0 14px 14px;
  font-size: 13px;
  color: var(--text-dim);
}

/* ============================================================
   SCROLLBAR
============================================================ */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ============================================================
   ATMOSPHERE & DEPTH  (glassy cards over the sky backdrop)
============================================================ */

.snap-card,
.score-card,
.verdict-box,
.strategy-card,
.position-sizing,
details {
  background: var(--card-bg);
  box-shadow: inset 0 1px 0 var(--card-border-hi), var(--shadow);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.snap-card:hover,
.strategy-card:hover {
  transform: translateY(-2px);
  box-shadow: inset 0 1px 0 var(--card-border-hi), var(--shadow-hover);
}

/* section headers — accent mark + fading hairline (no flat underline) */
article h2 {
  position: relative;
  border-bottom: 0;
  padding: 0 0 9px 13px;
}

article h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  bottom: 12px;
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--sky), var(--accent));
  box-shadow: 0 0 8px var(--sky-soft);
}

article h2::after {
  content: "";
  position: absolute;
  left: 13px;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--border) 0%, var(--border) 30%, transparent 100%);
}

/* ============================================================
   HERO  (verdict banner, atmospheric tint by track)
============================================================ */

.hero {
  position: relative;
  border: 1px solid var(--card-border-hi);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 28px;
  box-shadow: var(--shadow);
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--card-border-hi), transparent);
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 22px 26px 24px;
}

.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.hero-top h1 {
  margin: 0;
  font-size: 23px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.hero .header-meta {
  margin-top: 10px;
}

.hero-verdict {
  margin: 14px 0 0;
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.55;
  color: var(--text);
  max-width: 60ch;
}

.tag-lg {
  font-size: 12px;
  padding: 5px 13px;
  border-radius: 5px;
  flex-shrink: 0;
}

/* track-tinted hero skies */
.hero-A .hero-bg {
  background:
    radial-gradient(620px 240px at 84% -50%, rgba(94, 200, 224, 0.16), transparent 70%),
    linear-gradient(118deg, rgba(63, 185, 80, 0.13), rgba(94, 200, 224, 0.08) 60%, transparent);
}
.hero-B .hero-bg {
  background:
    radial-gradient(620px 240px at 84% -50%, rgba(126, 170, 255, 0.18), transparent 70%),
    linear-gradient(118deg, rgba(88, 166, 255, 0.14), rgba(120, 130, 220, 0.08) 60%, transparent);
}
.hero-AB .hero-bg {
  background:
    radial-gradient(640px 250px at 85% -50%, var(--sky-soft), transparent 72%),
    linear-gradient(118deg, rgba(63, 185, 80, 0.11), rgba(88, 166, 255, 0.12) 52%, rgba(160, 135, 245, 0.09));
}
.hero-Mixed .hero-bg {
  background:
    radial-gradient(600px 240px at 85% -50%, var(--sky-soft), transparent 72%),
    linear-gradient(118deg, rgba(139, 148, 158, 0.12), transparent 70%);
}

/* faint drifting light specks — dark only, very subtle */
:root[data-theme="dark"] .hero-bg::after,
:root[data-theme="system"] .hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.2px 1.2px at 20% 35%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1px 1px at 62% 22%, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1.4px 1.4px at 78% 60%, rgba(255, 255, 255, 0.35), transparent),
    radial-gradient(1px 1px at 42% 72%, rgba(255, 255, 255, 0.3), transparent);
  opacity: 0.5;
}
@media (prefers-color-scheme: light) {
  :root[data-theme="system"] .hero-bg::after { content: none; }
}

/* ============================================================
   PIP METERS + BALANCE  (signal scores)
============================================================ */

.score-card {
  flex-direction: column;
  align-items: stretch;
  gap: 9px;
}

.score-card .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  font-family: var(--mono);
}

.meter-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.meter-row + .meter-row { margin-top: 8px; }

.meter-name {
  width: 42px;
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 600;
}

.meter {
  display: inline-flex;
  gap: 4px;
  flex: 1;
  position: relative;
}

/* center tick — makes "who's ahead" readable at a glance */
.meter::before {
  content: "";
  position: absolute;
  top: -3px;
  bottom: -3px;
  left: 50%;
  width: 1px;
  background: var(--text-muted);
  opacity: 0.5;
}

.meter .pip {
  width: 100%;
  max-width: 26px;
  height: 8px;
  border-radius: 4px;
  background: var(--track-rail);
  box-shadow: inset 0 0 0 1px var(--border);
}

.meter.c-green .pip.on { background: var(--bull); box-shadow: 0 0 7px rgba(63, 185, 80, 0.5); }
.meter.c-blue  .pip.on { background: var(--accent); box-shadow: 0 0 7px rgba(88, 166, 255, 0.5); }
.meter.c-red   .pip.on { background: var(--bear); box-shadow: 0 0 7px rgba(248, 81, 73, 0.5); }

.meter-num {
  width: 30px;
  text-align: right;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
}

/* score-lead coloring: whichever side's meter is present colors its own number */
.meter-row:has(.c-green) .meter-num { color: var(--bull); }
.meter-row:has(.c-blue)  .meter-num { color: var(--accent); }
.meter-row:has(.c-red)   .meter-num { color: var(--bear); }

.meter-row.dim .meter-name,
.meter-row.dim .meter-num { color: var(--text-muted); }

/* ============================================================
   PERCENTILE BARS + GAUGE + SIGNED BAR  (snapshot viz)
============================================================ */

.viz-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-dim);
}

.viz-name { width: 36px; flex-shrink: 0; }
.viz-val { width: 30px; text-align: right; flex-shrink: 0; }

.pctile-track {
  position: relative;
  flex: 1;
  height: 6px;
  border-radius: 4px;
  background: linear-gradient(90deg,
    rgba(94, 200, 224, 0.28),
    rgba(210, 153, 34, 0.30) 55%,
    rgba(248, 81, 73, 0.36));
}

.pctile-mark {
  position: absolute;
  top: -3px;
  width: 3px;
  height: 12px;
  border-radius: 2px;
  background: var(--text);
  box-shadow: 0 0 6px var(--glow-warm);
  transform: translateX(-50%);
}

.gauge {
  position: relative;
  flex: 1;
  height: 8px;
  border-radius: 5px;
  background: linear-gradient(90deg,
    rgba(63, 185, 80, 0.28),
    rgba(139, 148, 158, 0.16) 50%,
    rgba(248, 81, 73, 0.30));
}

.gauge .zero {
  position: absolute;
  left: 50%;
  top: -2px;
  width: 1px;
  height: 12px;
  background: var(--text-muted);
}

.gauge .needle {
  position: absolute;
  top: -3px;
  width: 4px;
  height: 14px;
  border-radius: 2px;
  background: var(--text);
  box-shadow: 0 0 6px var(--sky);
  transform: translateX(-50%);
}

.signed {
  position: relative;
  flex: 1;
  height: 8px;
  border-radius: 5px;
  background: var(--track-rail);
  overflow: hidden;
}

.signed .mid { position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--border); z-index: 1; }
.signed .neg { position: absolute; top: 0; bottom: 0; right: 50%; background: linear-gradient(90deg, transparent, var(--sky)); }
.signed .pos { position: absolute; top: 0; bottom: 0; left: 50%; background: linear-gradient(90deg, var(--warn), transparent); }

/* ============================================================
   STRIKE TABLE — inline OI bars + distance axis
============================================================ */

.oi-cell { min-width: 96px; }

.oi-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  justify-content: flex-end;
}

.oi-num { font-variant-numeric: tabular-nums; }

.oi-bar {
  position: relative;
  width: 46px;
  height: 5px;
  border-radius: 3px;
  background: var(--track-rail);
  overflow: hidden;
  flex-shrink: 0;
}

.oi-bar i {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  border-radius: 3px;
}

.oi-bar.c i { background: linear-gradient(90deg, rgba(63, 185, 80, 0.6), var(--bull)); }
.oi-bar.p i { background: linear-gradient(90deg, rgba(248, 81, 73, 0.6), var(--bear)); }

.dist-axis {
  position: relative;
  display: inline-block;
  width: 54px;
  height: 4px;
  border-radius: 2px;
  background: var(--track-rail);
  vertical-align: middle;
  margin-right: 7px;
}

.dist-axis::before {
  content: "";
  position: absolute;
  left: 50%; top: -2px; bottom: -2px;
  width: 1px;
  background: var(--border);
}

.dist-axis .dot {
  position: absolute;
  top: -2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 5px currentColor;
}

.dist-axis .dot.pos { background: var(--bull); color: var(--bull); }
.dist-axis .dot.neg { background: var(--bear); color: var(--bear); }
.dist-axis .dot.zero { background: var(--accent); color: var(--accent); }

/* ============================================================
   STRATEGY LEG BADGES (pill-style buy/sell)
============================================================ */

.leg .action {
  align-self: start;
  padding: 4px 0;
  text-align: center;
  border-radius: 6px;
  font-size: 11px;
  letter-spacing: 0.5px;
}

.leg .action.sell { background: rgba(248, 81, 73, 0.15); color: var(--bear); }
.leg .action.buy  { background: rgba(63, 185, 80, 0.15); color: var(--bull); }

/* ============================================================
   SPARKLINE (optional DVOL 48h series)
============================================================ */

.sparkline { display: block; width: 100%; height: 30px; margin-top: 6px; overflow: visible; }
.sparkline path.line { fill: none; stroke: var(--sky); stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.sparkline path.area { fill: var(--sky-soft); stroke: none; }
.sparkline circle { fill: var(--text); filter: drop-shadow(0 0 3px var(--sky)); }

/* ===== 实时工作台 (live.html) ===== */
body.report.live article { max-width: 1100px; margin: 0 auto; padding: 22px 26px 40px; }
.live-head { margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.live-head-top { display: flex; align-items: center; gap: 12px; }
.live-head-top h1 { margin: 0; font-size: 24px; }
.live-controls { display: flex; align-items: center; gap: 14px; margin-top: 12px; flex-wrap: wrap; }
.live-btn {
  font: inherit; font-size: 13px; cursor: pointer; padding: 5px 12px; border-radius: 7px;
  border: 1px solid var(--border); background: var(--bg-card); color: var(--text);
  transition: border-color .15s, color .15s;
}
.live-btn:hover { border-color: var(--accent); color: var(--accent); }
.live-auto { font-size: 13px; color: var(--text-dim); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.live-status-msg { font-size: 12.5px; color: var(--text-dim); }
.live-status-msg.err { color: var(--bear); }
.live-dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--bull);
  vertical-align: middle; margin-left: 4px; box-shadow: 0 0 0 0 var(--bull);
  animation: livePulse 2s infinite;
}
@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(63,185,80,.55); }
  70% { box-shadow: 0 0 0 7px rgba(63,185,80,0); }
  100% { box-shadow: 0 0 0 0 rgba(63,185,80,0); }
}
.live-loading { grid-column: 1 / -1; padding: 30px; text-align: center; color: var(--text-dim); }
.method-note {
  font-size: 12.5px; color: var(--text-dim); line-height: 1.6; margin-top: 16px;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-card);
}

/* pinned live workbench nav item */
.sidebar nav li.live-nav { border-bottom: 1px solid var(--border); }
.sidebar nav li.live-nav a { background: rgba(63,185,80,0.07); }
.sidebar nav li.live-nav a:hover { background: rgba(63,185,80,0.14); }
.sidebar nav li.live-nav .ts { color: var(--bull); }

/* ===== 实时工作台 · Block 2/3 ===== */
.muted { color: var(--text-dim); }
.live-row, .builder-controls, .add-leg { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 10px 0; }
.live-field { font-size: 13px; color: var(--text-dim); display: inline-flex; align-items: center; gap: 6px; }
.builder-presets { display: inline-flex; gap: 8px; flex-wrap: wrap; }
body.report.live select, body.report.live input[type="number"] {
  font: inherit; font-size: 13px; padding: 5px 8px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--bg-card); color: var(--text);
}
body.report.live input[type="number"] { width: 64px; }

/* verdict block */
.live-verdict { margin-top: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 9px; background: var(--bg-card); }
.lv-tag { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lv-why { font-size: 12.5px; color: var(--text-dim); }
.lv-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.sig-chip { font-size: 11.5px; padding: 2px 8px; border-radius: 11px; border: 1px solid var(--border); background: var(--bg-elev); color: var(--text); font-family: var(--mono); }
.lv-note { font-size: 11.5px; color: var(--text-muted); margin-top: 9px; }

/* builder legs table */
table.builder-legs { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 13px; }
table.builder-legs th { text-align: left; color: var(--text-dim); font-weight: 600; padding: 5px 8px; border-bottom: 1px solid var(--border); font-size: 11.5px; }
table.builder-legs td { padding: 5px 8px; border-bottom: 1px solid rgba(128,128,128,0.12); font-family: var(--mono); }
table.builder-legs .buy { color: var(--bull); font-weight: 600; }
table.builder-legs .sell { color: var(--bear); font-weight: 600; }
.leg-del { cursor: pointer; border: 1px solid var(--border); background: transparent; color: var(--text-dim); border-radius: 5px; padding: 1px 7px; }
.leg-del:hover { color: var(--bear); border-color: var(--bear); }

/* builder output */
.builder-output { margin-top: 14px; }
/* integrated card: payoff chart + greeks strip share one outer shell */
#builder-output {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.payoff-wrap { border: none; border-radius: 0; background: transparent; padding: 16px 16px 4px; }
.payoff-svg { display: block; width: 100%; height: 190px; overflow: visible; }
.payoff-svg .po-line { stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.payoff-svg .po-area-pos { fill: rgba(63,185,80,0.16); stroke: none; }
.payoff-svg .po-area-neg { fill: rgba(248,81,73,0.14); stroke: none; }
.payoff-svg .po-zero { stroke: var(--text-muted); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.payoff-svg .po-spot { stroke: var(--text-dim); stroke-width: 1; stroke-dasharray: 2 2; vector-effect: non-scaling-stroke; }
.payoff-svg .po-be { stroke: var(--warn); stroke-width: 1; stroke-dasharray: 2 3; vector-effect: non-scaling-stroke; }
.payoff-svg .po-spotlbl { fill: var(--text-dim); font-size: 9px; font-family: var(--mono); text-anchor: middle; }
.payoff-svg .po-belbl { fill: var(--warn); font-size: 9px; font-family: var(--mono); text-anchor: middle; }

.builder-greeks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0;
  margin-top: 12px;
  border-top: 1px solid var(--border);
}
.bstat { border: none; border-radius: 0; background: transparent; padding: 10px 16px; border-right: 1px solid var(--border); }
.bstat:last-child { border-right: none; }
.bstat .bk { display: block; font-size: 10.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; }
.bstat .bv { display: block; font-size: 14px; font-weight: 700; font-family: var(--mono); margin-top: 3px; }
.bstat .bv.pos { color: var(--bull); }
.bstat .bv.neg { color: var(--bear); }

/* trailing siblings live.js appends after .builder-greeks inside #builder-output */
#builder-output > table.scenario-table,
#builder-output > .lv-note,
#builder-output > .err { margin-left: 16px; margin-right: 16px; }
#builder-output > .lv-note, #builder-output > .err { margin-bottom: 14px; }
#builder-output > table.scenario-table { margin-bottom: 4px; }

table.scenario-table { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 13px; font-family: var(--mono); }
table.scenario-table caption { text-align: left; color: var(--text-dim); font-size: 12px; margin-bottom: 6px; font-family: var(--sans); }
table.scenario-table th { text-align: right; color: var(--text-dim); font-weight: 600; padding: 5px 10px; border-bottom: 1px solid var(--border); font-size: 11.5px; }
table.scenario-table th:first-child { text-align: left; }
table.scenario-table td { text-align: right; padding: 5px 10px; border-bottom: 1px solid rgba(128,128,128,0.12); }
table.scenario-table td:first-child { text-align: left; }
table.scenario-table .pos { color: var(--bull); }
table.scenario-table .neg { color: var(--bear); }

/* ── 大宗期权 / block trades ──────────────────────────────── */
.blk-toolbar {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px; flex-wrap: wrap; margin-bottom: 14px;
}
.blk-summary {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.blk-toolbar .blk-summary { margin-bottom: 0; }
.blk-count { font-size: 12px; color: var(--text-dim); margin-right: 4px; }
.blk-stat {
  font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px;
  background: rgba(128,128,128,0.12);
}
.blk-sort {
  display: inline-flex; gap: 3px; flex: none;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 7px; padding: 3px;
}
.blk-sort button {
  font: inherit; font-size: 11.5px; cursor: pointer; padding: 4px 10px; border-radius: 5px;
  border: 0; background: transparent; color: var(--text-dim);
  transition: background .12s ease, color .12s ease;
}
.blk-sort button:hover { color: var(--text); }
.blk-sort button.active { background: var(--accent); color: #fff; }
.blk-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.blk-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-left-width: 3px; border-radius: 10px; padding: 0; overflow: hidden;
  box-shadow: var(--shadow-card);
}
.blk-card.blk-bull { border-left-color: var(--bull); }
.blk-card.blk-bear { border-left-color: var(--bear); }
.blk-card.blk-volp { border-left-color: var(--accent); }
.blk-card.blk-volm { border-left-color: #d29922; }
.blk-card.blk-neu  { border-left-color: var(--border); }
.blk-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 14px; }
.blk-sub { padding: 0 14px; }
.blk-legs { padding: 0 14px 12px; }
.blk-struct { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 8px; }
/* shape icon in front of the structure name — quick visual read of direction */
.blk-struct::before { content: ""; width: 9px; height: 9px; flex: none; display: inline-block; }
.blk-card.blk-bull .blk-head { background: linear-gradient(135deg, rgba(63,185,80,0.16), transparent 75%); }
.blk-card.blk-bull .blk-struct::before { background: var(--bull); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.blk-card.blk-bear .blk-head { background: linear-gradient(135deg, rgba(248,81,73,0.16), transparent 75%); }
.blk-card.blk-bear .blk-struct::before { background: var(--bear); clip-path: polygon(50% 100%, 100% 0, 0 0); }
.blk-card.blk-volp .blk-head { background: linear-gradient(135deg, rgba(88,166,255,0.14), transparent 75%); }
.blk-card.blk-volp .blk-struct::before { background: var(--accent); border-radius: 2px; transform: rotate(45deg); }
.blk-card.blk-volm .blk-head { background: linear-gradient(135deg, rgba(210,153,34,0.16), transparent 75%); }
.blk-card.blk-volm .blk-struct::before { background: #d29922; border-radius: 50%; }
.blk-dir {
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  white-space: nowrap; text-transform: uppercase; letter-spacing: 0.3px;
}
.blk-dir.blk-bull { color: var(--bull); background: rgba(63,185,80,0.16); }
.blk-dir.blk-bear { color: var(--bear); background: rgba(248,81,73,0.16); }
.blk-dir.blk-volp { color: var(--accent); background: rgba(88,166,255,0.16); }
.blk-dir.blk-volm { color: #d29922; background: rgba(210,153,34,0.16); }
.blk-dir.blk-neu  { color: var(--text-dim); background: rgba(128,128,128,0.14); }
.blk-stat.blk-bull { color: var(--bull); }
.blk-stat.blk-bear { color: var(--bear); }
.blk-stat.blk-volp { color: var(--accent); }
.blk-stat.blk-volm { color: #d29922; }
.blk-sub { font-size: 11.5px; color: var(--text-dim); margin: 5px 0 9px; }
.blk-legs { display: flex; flex-direction: column; gap: 5px; }
.blk-leg {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px;
  font-size: 12px; font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.blk-act { flex: 0 0 32px; font-weight: 700; font-size: 10.5px; }
.blk-act.sell { color: var(--bear); }
.blk-act.buy  { color: var(--bull); }
.blk-amt { flex: 0 0 44px; text-align: right; color: var(--text); }
/* 合约名优先占满剩余空间、不截断；放不下时把价格挤到下一行 */
.blk-inst { flex: 1 1 auto; min-width: 0; color: var(--text); white-space: nowrap; }
.blk-px { flex: 0 0 auto; margin-left: auto; color: var(--text-dim); font-size: 11px; white-space: nowrap; }

/* ── live: 对比基准带 + 变化高亮 ──────────────────────────── */
.cmp-field select { margin-left: 4px; }
.cmp-strip {
  display: flex; flex-wrap: wrap; gap: 7px; align-items: center;
  margin-top: 10px; font-size: 12px;
}
.cmp-label { color: var(--text-dim); font-weight: 600; margin-right: 2px; }
.cmp-item {
  padding: 2px 9px; border-radius: 999px; font-weight: 600;
  background: rgba(128,128,128,0.12); white-space: nowrap;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.cmp-item.up   { color: var(--bull); background: rgba(63,185,80,0.14); }
.cmp-item.down { color: var(--bear); background: rgba(248,81,73,0.14); }
.cmp-item.flat { color: var(--text-dim); }

/* 微型 ▲▼ 变化标注（vs 上一次刷新） */
.chg {
  font-size: 10.5px; font-weight: 700; margin-left: 6px;
  vertical-align: middle; font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.chg.up   { color: var(--bull); }
.chg.down { color: var(--bear); }

/* 卡片刷新闪烁 */
@keyframes flash-up   { 0% { box-shadow: inset 0 0 0 2px var(--bull); } 100% { box-shadow: inset 0 0 0 0 transparent; } }
@keyframes flash-down { 0% { box-shadow: inset 0 0 0 2px var(--bear); } 100% { box-shadow: inset 0 0 0 0 transparent; } }
.snap-card.flash-up   { animation: flash-up 1.6s ease-out; }
.snap-card.flash-down { animation: flash-down 1.6s ease-out; }

/* 大宗面板空态 */
.blk-empty { color: var(--text-dim); font-size: 13px; padding: 14px 2px; }
