:root {
  color-scheme: dark;
  --bg: #0b0d10;
  --surface: #12151a;
  --surface-2: #191d23;
  --line: #2a3038;
  --text: #f4f6f8;
  --muted: #9199a4;
  --green: #4cd49a;
  --red: #ff6b6b;
  --blue: #66a7ff;
  --yellow: #f1c75b;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: Inter, "Segoe UI", "Microsoft YaHei", sans-serif; letter-spacing: 0; }
button { font: inherit; }
.topbar { height: 76px; padding: 0 5vw; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 10; background: rgba(11, 13, 16, .94); backdrop-filter: blur(16px); }
.brand-block { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid #4b5562; background: #e9edf2; color: #11151a; font-weight: 800; font-size: 14px; }
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: 19px; line-height: 1.1; }
.brand-block p, #generatedAt { margin-top: 4px; color: var(--muted); font-size: 12px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.language-switcher { display: flex; border: 1px solid var(--line); background: var(--surface); }
.language-switcher button { min-height: 30px; padding: 0 9px; border: 0; border-right: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 11px; cursor: pointer; }
.language-switcher button:last-child { border-right: 0; }
.language-switcher button.active { background: #e9edf2; color: #11151a; font-weight: 700; }
.status { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 7px; }
.status i { width: 7px; height: 7px; border-radius: 50%; background: var(--yellow); }
.status.online i { background: var(--green); box-shadow: 0 0 12px rgba(76, 212, 154, .7); }
.status.error i { background: var(--red); }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 22px; cursor: pointer; }
.icon-button:hover { border-color: #596574; }
.icon-button.spinning { animation: spin .7s linear infinite; }
main { width: min(1280px, 92vw); margin: 0 auto; }
.summary-band { min-height: 210px; display: grid; grid-template-columns: minmax(220px, .8fr) minmax(0, 2fr); gap: 50px; align-items: center; border-bottom: 1px solid var(--line); }
.eyebrow { color: var(--green); font: 700 11px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; }
.run-copy h2 { margin-top: 12px; font-size: 31px; font-weight: 650; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(100px, 1fr)); border-left: 1px solid var(--line); }
.metric { min-height: 104px; padding: 20px 24px; border-right: 1px solid var(--line); display: flex; flex-direction: column; justify-content: space-between; }
.metric span { color: var(--muted); font-size: 12px; }
.metric strong { font-size: 28px; font-weight: 650; }
.tabs { display: flex; gap: 4px; padding: 22px 0 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { min-width: 112px; height: 42px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); cursor: pointer; }
.tab.active { color: var(--text); border-bottom-color: var(--green); }
.panel { display: none; padding: 28px 0 46px; min-height: 420px; }
.panel.active { display: block; }
.section-heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 22px; }
.section-heading h3 { margin-top: 8px; font-size: 21px; }
.count-label { color: var(--muted); font-size: 13px; }
.table-wrap { border-top: 1px solid var(--line); overflow-x: auto; }
table { width: 100%; min-width: 760px; border-collapse: collapse; }
th { height: 48px; text-align: left; color: var(--muted); font-size: 11px; font-weight: 600; }
td { height: 58px; border-top: 1px solid #20252c; font-size: 13px; }
td:first-child { font: 700 14px ui-monospace, SFMono-Regular, Consolas, monospace; color: var(--blue); }
.positive { color: var(--green); }
.negative { color: var(--red); }
.score { display: inline-grid; place-items: center; width: 28px; height: 24px; background: #203b32; color: var(--green); font-weight: 700; }
.empty-state { padding: 70px 10px; text-align: center; color: var(--muted); }
.ticker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.ticker { height: 58px; border: 1px solid var(--line); background: var(--surface); display: flex; align-items: center; justify-content: space-between; padding: 0 15px; }
.ticker strong { color: var(--blue); font: 700 14px ui-monospace, SFMono-Regular, Consolas, monospace; }
.ticker span { color: var(--green); font-size: 10px; }
.subsection { margin-top: 34px; border-top: 1px solid var(--line); padding-top: 24px; }
.subsection h4 { font-size: 13px; color: var(--muted); font-weight: 600; }
.subsection-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 12px; }
.segmented { display: flex; flex-wrap: wrap; gap: 2px; padding: 3px; border: 1px solid var(--line); background: var(--surface); }
.segment { min-height: 32px; padding: 0 12px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.segment.active { background: #e9edf2; color: #11151a; font-weight: 700; }
.strategy-event-table { min-width: 1320px; }
.empty-state.compact { padding: 28px 10px; }
.tracking-summary { display: grid; grid-template-columns: repeat(2, minmax(220px, 1fr)); border-top: 1px solid var(--line); margin-top: 30px; }
.tracking-summary div { min-height: 72px; padding: 14px 20px 14px 0; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.tracking-summary span { color: var(--muted); font-size: 11px; }
.tracking-summary strong { font-size: 15px; }
.history-table { min-width: 1180px; }
.holding-table, .strategy-table, .realized-table, .seesaw-event-table { min-width: 820px; }
tfoot td { border-top: 1px solid #596574; font-weight: 700; }
.data-note { margin-top: 18px; color: var(--muted); font-size: 12px; }
.strategy-intro { margin-top: 22px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.strategy-intro h4 { font-size: 13px; }
.strategy-intro p { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 12px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.strategy-intro p strong { color: var(--text); }
.strategy-intro .strategy-contact { display: block; margin-top: 4px; }
.strategy-contact a { color: var(--green); text-decoration: none; }
.realized-band { min-height: 72px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: 28px; display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 24px; }
.realized-band span, .realized-band small { color: var(--muted); font-size: 12px; }
.realized-band strong { font-size: 20px; }
.profit-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.profit-item { min-height: 142px; padding: 22px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; justify-content: space-between; gap: 12px; background: var(--surface); }
.profit-item span, .profit-item small { color: var(--muted); font-size: 12px; }
.profit-item strong { font-size: 25px; overflow-wrap: anywhere; }
.profit-item.total { background: #17241f; }
.profit-item.total strong { font-size: 30px; }
.profit-filter { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.date-range { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.date-range label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; }
.date-range input { height: 34px; padding: 0 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); color-scheme: dark; }
.date-range button { height: 34px; padding: 0 14px; border: 0; background: var(--green); color: #071b13; font-weight: 700; cursor: pointer; }
.ticker-line { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.ticker-line span { padding: 7px 10px; background: var(--surface-2); color: #c7cdd4; font: 12px ui-monospace, SFMono-Regular, Consolas, monospace; }
.setup-table { min-width: 680px; }
.setup-rate { font-size: 20px; font-weight: 700; }
.system-grid { border-top: 1px solid var(--line); }
.system-row { min-height: 64px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 180px 1fr; align-items: center; gap: 20px; }
.system-row span { color: var(--muted); font-size: 12px; }
.system-row strong { font-size: 13px; }
footer { width: min(1280px, 92vw); margin: 0 auto; border-top: 1px solid var(--line); padding: 22px 0 32px; color: var(--muted); font-size: 11px; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 820px) {
  .topbar { padding: 0 4vw; }
  main, footer { width: 92vw; }
  .summary-band { grid-template-columns: 1fr; gap: 24px; padding: 32px 0; }
  .metrics { grid-template-columns: repeat(2, 1fr); border-top: 1px solid var(--line); }
  .metric { border-bottom: 1px solid var(--line); padding: 16px; }
  .tracking-summary { grid-template-columns: 1fr; }
  .realized-band { grid-template-columns: 1fr; gap: 6px; padding: 14px 0; }
  .profit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .subsection-heading { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 520px) {
  .status { display: none; }
  .language-switcher button { padding: 0 7px; }
  .run-copy h2 { font-size: 26px; }
  .metric strong { font-size: 23px; }
  .tabs { padding-top: 12px; }
  .tab { min-width: 96px; }
  .panel { padding-top: 22px; }
  .system-row { grid-template-columns: 110px 1fr; }
  .profit-grid { grid-template-columns: 1fr; }
}
.tab[hidden], .panel[hidden] { display: none !important; }
