:root {
  color-scheme: dark;
  --bg: #0a0c0f;
  --sidebar: #0d1013;
  --panel: #11151a;
  --panel-2: #151a20;
  --line: #252b32;
  --line-soft: #1d2228;
  --text: #f0f2f4;
  --muted: #7f8995;
  --gold: #e6ad3d;
  --gold-light: #f4c96d;
  --green: #3fc797;
  --red: #ed6b70;
  --blue: #62a7ff;
  --sidebar-w: 208px;
  --topbar-h: 62px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

body.light {
  color-scheme: light;
  --bg: #f3f4f5;
  --sidebar: #fff;
  --panel: #fff;
  --panel-2: #f7f8f9;
  --line: #dfe3e7;
  --line-soft: #e9ecef;
  --text: #171a1e;
  --muted: #68727e;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif; font-size: 13px; letter-spacing: 0; overscroll-behavior-y: none; -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible { outline: 2px solid #e6ad3d66; outline-offset: 2px; }

.app-shell { min-height: 100vh; }
.topbar { position: fixed; z-index: 30; inset: 0 0 auto; height: calc(var(--topbar-h) + var(--safe-top)); padding-top: var(--safe-top); display: grid; grid-template-columns: var(--sidebar-w) 1fr auto; align-items: center; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--sidebar) 94%, transparent); backdrop-filter: blur(14px); }
.brand { height: 100%; padding: 0 20px; display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; border-right: 1px solid var(--line); }
.brand-mark { width: 31px; height: 31px; display: grid; place-items: center; border: 1px solid #c58c25; background: #e6ad3d12; color: var(--gold-light); font: 700 13px Georgia, serif; }
.brand > span:last-child { display: grid; line-height: 1; }
.brand strong { font-size: 15px; letter-spacing: 2px; }
.brand small { margin-top: 5px; color: var(--muted); font-size: 8px; letter-spacing: 2px; }
.market-status { display: flex; align-items: center; gap: 8px; padding-left: 22px; color: var(--muted); font-size: 11px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px #3fc79718; }
.status-dot.error { background: var(--red); box-shadow: 0 0 0 4px #ed6b7018; }
.top-divider { width: 1px; height: 15px; margin: 0 4px; background: var(--line); }
.top-actions, .heading-actions, .chart-tools { display: flex; align-items: center; gap: 8px; }
.top-actions { padding-right: 18px; }
.btn, .icon-btn, .text-btn, .nav-item, .segmented button { border: 0; background: none; cursor: pointer; }
.btn { height: 34px; padding: 0 16px; border: 1px solid var(--line); font-size: 11px; font-weight: 600; }
.btn:hover, .icon-btn:hover { border-color: #7d6738; }
.btn.accent { border-color: #d99f31; background: var(--gold); color: #181207; }
.btn.accent:hover { background: var(--gold-light); }
.btn.ghost { color: var(--muted); }
.icon-btn { width: 34px; height: 34px; display: grid; flex: 0 0 34px; place-items: center; border: 1px solid var(--line); color: var(--muted); font-size: 16px; }
.icon-btn.small { width: 30px; height: 30px; flex-basis: 30px; font-size: 10px; }

.sidebar { position: fixed; z-index: 20; left: 0; top: calc(var(--topbar-h) + var(--safe-top)); bottom: 0; width: var(--sidebar-w); display: flex; flex-direction: column; padding: 22px 12px 16px; border-right: 1px solid var(--line); background: var(--sidebar); }
.sidebar nav { display: grid; gap: 4px; }
.nav-item { height: 42px; display: flex; align-items: center; gap: 12px; padding: 0 12px; color: var(--muted); text-align: left; border-left: 2px solid transparent; }
.nav-item span { width: 20px; color: #68727d; font-size: 17px; text-align: center; }
.nav-item:hover { color: var(--text); background: var(--panel-2); }
.nav-item.active { color: var(--gold-light); border-left-color: var(--gold); background: linear-gradient(90deg, #e6ad3d12, transparent); }
.nav-item.active span { color: var(--gold); }
.account-card { margin-top: auto; padding: 14px; border: 1px solid var(--line); background: var(--panel); }
.account-card small { display: block; color: var(--muted); font-size: 10px; }
.account-card strong { display: block; margin: 8px 0; font-size: 16px; }
.account-card span { color: var(--muted); font-size: 9px; }
.account-card i { display: inline-block; width: 5px; height: 5px; margin-right: 4px; border-radius: 50%; background: var(--green); }
.side-foot { padding: 16px 8px 0; color: #59616b; font-size: 9px; line-height: 1.7; }

.workspace { min-height: 100vh; margin-left: var(--sidebar-w); padding: calc(var(--topbar-h) + var(--safe-top) + 23px) 24px 30px; }
.page-heading { max-width: 1540px; margin: 0 auto 18px; display: flex; align-items: flex-end; justify-content: space-between; }
.eyebrow { margin: 0 0 5px; color: #a98035; font-size: 8px; font-weight: 700; letter-spacing: 2px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 22px; font-weight: 620; }
.saved-state { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; }
.saved-state i { width: 5px; height: 5px; border-radius: 50%; background: var(--green); }

.ticker-grid, .china-gold-band, .main-grid, .pro-panel, .factor-panel, .result-strip, .bottom-grid { max-width: 1540px; margin-left: auto; margin-right: auto; }
.ticker-grid { display: grid; grid-template-columns: 1.35fr repeat(3, 1fr); border: 1px solid var(--line); background: var(--line); gap: 1px; }
.ticker-card, .metric-card { min-height: 130px; padding: 17px 19px; background: var(--panel); }
.ticker-top { display: flex; align-items: center; gap: 10px; }
.asset-badge { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid #8a692d; color: var(--gold-light); font: 700 12px Georgia; }
.ticker-top > span:nth-child(2) { display: grid; }
.ticker-top b { font-size: 12px; }
.ticker-top small { margin-top: 3px; color: var(--muted); font-size: 8px; letter-spacing: 1px; }
.ticker-top em { margin-left: auto; padding: 3px 7px; background: #3fc79714; color: var(--green); font-size: 8px; font-style: normal; }
.ticker-price { margin: 13px 0 10px; display: flex; align-items: baseline; gap: 10px; }
.ticker-price strong { font-size: 25px; line-height: 1; }
.ticker-price span { font-size: 10px; color: var(--green); }
.ticker-price span.negative { color: var(--red); }
.mini-range { height: 2px; background: var(--line); }
.mini-range i { position: relative; display: block; width: 70%; height: 100%; background: #80652f; }
.mini-range i::after { content: ''; position: absolute; right: -2px; top: -2px; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); }
.range-label { margin-top: 6px; display: flex; justify-content: space-between; color: var(--muted); font-size: 8px; }
.metric-card { position: relative; overflow: hidden; }
.metric-label { color: var(--muted); font-size: 10px; }
.info { display: inline-grid; width: 13px; height: 13px; margin-left: 3px; place-items: center; border: 1px solid #4a535e; border-radius: 50%; font: 8px Georgia; cursor: help; }
.metric-card > strong { display: block; margin: 14px 0 6px; font-size: 21px; }
.metric-card > small { color: var(--muted); font-size: 9px; }
.signal.long { color: var(--green); }.signal.short { color: var(--red); }.signal.flat { color: var(--muted); }
.spark-bars { position: absolute; right: 15px; bottom: 15px; width: 74px; height: 27px; display: flex; align-items: flex-end; gap: 3px; opacity: .7; }
.spark-bars i { flex: 1; min-height: 2px; background: var(--green); }
.vol-meter { position: absolute; left: 19px; right: 19px; bottom: 16px; height: 3px; background: var(--line); }
.vol-meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--green), var(--gold), var(--red)); transition: width .4s; }
.risk-ring { position: absolute; right: 18px; bottom: 15px; width: 45px; height: 45px; display: grid; place-items: center; border: 3px solid var(--line); border-top-color: var(--green); border-radius: 50%; }
.risk-ring span { font-size: 7px; color: var(--muted); }

.china-gold-band { margin-top: 14px; border: 1px solid var(--line); background: var(--panel); }
.china-gold-band > header { min-height: 42px; padding: 8px 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line-soft); }
.china-gold-band > header div { min-width: 0; display: flex; align-items: baseline; gap: 9px; }
.china-gold-band > header b { font-size: 10px; }
.china-gold-band > header span, .china-gold-band > header small { overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.china-gold-band > header small { flex: 0 1 auto; text-align: right; }
.china-gold-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.china-gold-grid > div { min-width: 0; min-height: 66px; padding: 11px 15px; display: grid; align-content: center; border-right: 1px solid var(--line-soft); }
.china-gold-grid > div:last-child { border-right: 0; }
.china-gold-grid span, .china-gold-grid small { overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.china-gold-grid strong { margin: 5px 0 3px; font-size: 15px; }
.china-premium { background: color-mix(in srgb, var(--gold) 4%, var(--panel)); }

.main-grid { margin-top: 14px; display: grid; grid-template-columns: minmax(0, 2.15fr) minmax(280px, .72fr); gap: 14px; }
.panel { border: 1px solid var(--line); background: var(--panel); }
.chart-panel { min-width: 0; display: flex; flex-direction: column; }
.panel-head { height: 58px; padding: 0 17px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line-soft); }
.panel-head > div:first-child { min-width: 0; }
.panel-head h2 { margin: 0; font-size: 12px; font-weight: 650; }
.panel-head > div:first-child > span { display: block; margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.segmented { display: flex; padding: 2px; border: 1px solid var(--line); background: var(--bg); }
.segmented button { min-width: 43px; height: 24px; padding: 0 8px; color: var(--muted); font-size: 8px; }
.segmented button.active { background: var(--panel-2); color: var(--gold-light); }
.chart-legend { min-height: 34px; padding: 5px 18px; display: flex; align-items: center; gap: 18px; color: var(--muted); font-size: 8px; }
.chart-legend span { display: flex; align-items: center; gap: 5px; }
.chart-legend b { color: var(--muted); font-weight: 500; }
.chart-legend em { color: var(--text); font-style: normal; }
.chart-windows { margin-left: auto; }
.chart-windows button { min-width: 37px; height: 20px; padding: 0 5px; }
.legend-line { width: 11px; height: 2px; background: var(--gold); }.legend-line.slow { background: var(--blue); }.legend-block { width: 5px; height: 5px; background: #56606b; }
.chart-wrap { position: relative; flex: 1; height: 360px; min-height: 260px; }
canvas { display: block; width: 100%; height: 100%; }
.chart-wrap canvas { touch-action: pan-y; }
.chart-tooltip { position: absolute; z-index: 5; min-width: 154px; padding: 9px 11px; border: 1px solid var(--line); background: #090c0feF; color: #cbd1d7; font-size: 9px; line-height: 1.7; pointer-events: none; box-shadow: 0 7px 20px #0008; }
.chart-tooltip b { color: #fff; }.hidden { display: none !important; }

.switch { position: relative; width: 30px; height: 16px; }
.switch input { position: absolute; opacity: 0; }
.switch span { position: absolute; inset: 0; border-radius: 10px; background: #3d444c; cursor: pointer; }
.switch span::after { content: ''; position: absolute; width: 12px; height: 12px; left: 2px; top: 2px; border-radius: 50%; background: #9ba4ae; transition: .2s; }
.switch input:checked + span { background: #9a762f; }.switch input:checked + span::after { transform: translateX(14px); background: var(--gold-light); }
.strategy-body { padding: 16px 17px 15px; }
.field-group { margin-bottom: 13px; }
.field-group label, .slider-group label { display: flex; justify-content: space-between; margin-bottom: 6px; color: #b9c0c7; font-size: 9px; }
.field-group label span { color: var(--muted); font-size: 8px; }
.field-group input[type="number"] { width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.field-group input:focus { border-color: #9e7934; outline: 0; }
.input-wrap { position: relative; }.input-wrap::before { content: '$'; position: absolute; z-index: 2; left: 10px; top: 9px; color: var(--muted); }.input-wrap input { padding-left: 25px !important; }
.capital-basis { display: block; margin-top: 5px; color: var(--muted); font-size: 7px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.slider-group { margin: 0 0 15px; }
.slider-group > div:first-child { display: flex; justify-content: space-between; }
.slider-group output { color: var(--gold-light); font-size: 9px; }
input[type="range"] { width: 100%; height: 3px; margin: 5px 0; appearance: none; background: linear-gradient(90deg, var(--gold) var(--range, 30%), var(--line) var(--range, 30%)); }
input[type="range"]::-webkit-slider-thumb { width: 11px; height: 11px; appearance: none; border: 2px solid var(--panel); border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 1px #b6852d; cursor: pointer; }
.slider-scale { display: flex; justify-content: space-between; color: #58616b; font-size: 7px; }
.check-row { display: grid; grid-template-columns: 15px auto; align-items: center; column-gap: 7px; margin: 2px 0 15px; cursor: pointer; }
.check-row input { accent-color: var(--gold); }.check-row span { font-size: 9px; }.check-row small { grid-column: 2; margin-top: 3px; color: var(--muted); font-size: 7px; }
.run-btn { width: 100%; height: 38px; }.run-btn span { margin-right: 5px; }
.run-btn:disabled { opacity: .45; cursor: not-allowed; }
.param-hint { margin: 8px 0 0; text-align: center; color: #59616b; font-size: 7px; }

.pro-panel { margin-top: 14px; scroll-margin-top: calc(var(--topbar-h) + 12px); }
.pro-head { height: 60px; }
.engine-badge { padding: 5px 8px; border: 1px solid #7b642f; color: var(--gold-light); font-size: 8px; font-weight: 700; }
.pro-grid { min-height: 190px; display: grid; grid-template-columns: minmax(250px, .85fr) minmax(320px, 1.15fr) minmax(390px, 1.4fr); }
.pro-decision, .pro-checks, .direct-market { min-width: 0; padding: 18px; }
.pro-decision, .pro-checks { border-right: 1px solid var(--line-soft); }
.pro-decision > small { color: var(--muted); font-size: 8px; }
.decision-line { margin-top: 13px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.decision-line strong { font-size: 22px; }.decision-line span { color: var(--gold-light); font-size: 10px; }
.decision-meter { height: 3px; margin: 11px 0 12px; background: var(--line); }
.decision-meter i { display: block; width: 0; height: 100%; background: var(--gold); transition: width .35s; }
.pro-decision p { min-height: 34px; margin-bottom: 13px; color: var(--muted); font-size: 9px; line-height: 1.8; }
.decision-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.decision-meta span { padding: 4px 6px; background: var(--panel-2); color: #aeb6bf; font-size: 8px; }
.pro-checks { display: grid; grid-template-columns: 1fr 1fr; align-content: center; column-gap: 20px; }
.pro-checks div { min-height: 43px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--line-soft); }
.pro-checks span { color: var(--muted); font-size: 9px; }.pro-checks b { font-size: 9px; font-weight: 600; }
.pro-checks b.pass { color: var(--green); }.pro-checks b.warn { color: var(--gold-light); }.pro-checks b.fail { color: var(--red); }
.direct-market-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.direct-market-head div { display: grid; }.direct-market-head b { font-size: 10px; }.direct-market-head small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.direct-market-head > strong { font-size: 20px; }.direct-market-head > strong::after { content: '/100'; color: var(--muted); font-size: 8px; font-weight: 400; }
.context-quotes { min-height: 90px; margin-top: 12px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line-soft); border-left: 1px solid var(--line-soft); }
.context-quotes > span { grid-column: 1 / -1; display: grid; place-items: center; color: var(--muted); font-size: 8px; }
.context-quote { min-width: 0; min-height: 45px; padding: 7px 9px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-content: center; gap: 3px 6px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.context-quote span { overflow: hidden; color: var(--muted); font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }.context-quote b { font-size: 9px; }.context-quote small { grid-column: 2; grid-row: 1 / 3; align-self: center; font-size: 8px; }
.source-health { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: 7px; }
.source-health span { display: flex; align-items: center; gap: 5px; }.source-health i { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); }.source-health i.online { background: var(--green); }.source-health i.degraded { background: var(--gold); }.source-health i.offline { background: var(--red); }

.factor-panel { margin-top: 14px; scroll-margin-top: calc(var(--topbar-h) + 12px); }
.factor-head { height: 62px; }
.factor-overview { min-height: 390px; display: grid; grid-template-columns: 180px minmax(420px, 1fr) 250px; border-bottom: 1px solid var(--line-soft); }
.factor-score-block { padding: 25px 18px; display: flex; flex-direction: column; align-items: center; border-right: 1px solid var(--line-soft); text-align: center; }
.factor-score-block > small { color: var(--muted); font-size: 8px; }
.factor-ring { --factor-fill: 50%; --factor-color: var(--gold); width: 108px; height: 108px; margin: 21px 0 15px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--factor-color) var(--factor-fill), var(--line) 0); position: relative; }
.factor-ring::before { content: ''; position: absolute; inset: 7px; border-radius: 50%; background: var(--panel); }
.factor-ring span { position: relative; z-index: 1; font-size: 27px; font-weight: 700; }
.factor-score-block > strong { font-size: 15px; }
.factor-score-block > p { min-height: 31px; margin: 8px 0 16px; color: var(--muted); font-size: 8px; line-height: 1.7; }
.factor-legend { width: 100%; display: flex; justify-content: center; gap: 10px; color: var(--muted); font-size: 7px; }
.factor-legend span, .factor-source-legend span { display: flex; align-items: center; gap: 4px; }
.factor-legend i, .factor-source-legend i { width: 6px; height: 6px; border-radius: 50%; }.factor-legend .bull { background: var(--green); }.factor-legend .bear { background: var(--red); }
.factor-chart-block { min-width: 0; padding: 16px 18px 8px; border-right: 1px solid var(--line-soft); }
.factor-chart-title { height: 23px; display: flex; justify-content: space-between; color: #b9c0c7; font-size: 9px; }.factor-chart-title small { color: var(--muted); font-size: 7px; }
.factor-chart-wrap { height: 335px; }
.factor-domains { padding: 10px 0; display: grid; align-content: center; }
.factor-domain { min-height: 49px; padding: 8px 16px; display: grid; grid-template-columns: 1fr auto; align-items: center; border-bottom: 1px solid var(--line-soft); }
.factor-domain:last-child { border-bottom: 0; }
.factor-domain div { min-width: 0; }.factor-domain b { display: block; font-size: 9px; }.factor-domain small { display: block; margin-top: 4px; color: var(--muted); font-size: 7px; }
.factor-domain > strong { font-size: 13px; }.factor-domain > strong.positive { color: var(--green); }.factor-domain > strong.negative { color: var(--red); }
.domain-meter { grid-column: 1 / -1; height: 2px; margin-top: 6px; background: var(--line); position: relative; }.domain-meter i { position: absolute; left: 50%; height: 100%; background: var(--green); }.domain-meter i.negative { left: auto; right: 50%; background: var(--red); }
.factor-controls { min-height: 48px; padding: 8px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line-soft); background: var(--panel-2); }
.scenario-row { display: flex; align-items: center; gap: 10px; min-width: 0; }.scenario-row > span:first-child { color: var(--muted); font-size: 8px; white-space: nowrap; }
.scenario-tabs { overflow-x: auto; }.scenario-tabs button { min-width: 64px; }
.scenario-state { color: var(--gold-light); font-size: 8px; white-space: nowrap; }
.factor-source-legend { display: flex; gap: 11px; color: var(--muted); font-size: 7px; white-space: nowrap; }.factor-source-legend .auto { background: var(--green); }.factor-source-legend .model { background: var(--blue); }.factor-source-legend .manual { background: var(--gold); }
.factor-matrix { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); max-height: 590px; overflow-y: auto; }
.factor-group { min-width: 0; padding: 13px 16px 16px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.factor-group:nth-child(3n) { border-right: 0; }
.factor-group h3 { margin: 0 0 8px; color: #c6ccd2; font-size: 9px; font-weight: 650; }
.factor-group h3 span { margin-left: 6px; color: var(--muted); font-size: 7px; font-weight: 400; }
.factor-row { min-height: 31px; display: grid; grid-template-columns: minmax(86px, .95fr) minmax(70px, 1.2fr) 32px; align-items: center; gap: 7px; border-top: 1px solid var(--line-soft); }
.factor-name { min-width: 0; display: flex; align-items: center; gap: 5px; color: #aeb6bf; font-size: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: help; }
.factor-name i { width: 5px; height: 5px; flex: 0 0 5px; border-radius: 50%; }.factor-name i.live { background: #54d3d0; }.factor-name i.auto { background: var(--green); }.factor-name i.model { background: var(--blue); }.factor-name i.manual { background: var(--gold); }
.factor-source-legend .live { background: #54d3d0; }
.factor-row input[type="range"] { margin: 0; height: 2px; }.factor-row input[type="range"]:disabled { opacity: .55; }
.factor-row output { text-align: right; color: var(--muted); font-size: 8px; }.factor-row output.positive { color: var(--green); }.factor-row output.negative { color: var(--red); }

.result-strip { min-height: 92px; margin-top: 14px; display: grid; grid-template-columns: 1.2fr repeat(5, 1fr); border: 1px solid var(--line); background: var(--panel); }
.result-title, .result-item { display: flex; flex-direction: column; justify-content: center; padding: 15px 18px; border-right: 1px solid var(--line-soft); }
.result-title { flex-direction: row; align-items: center; justify-content: flex-start; gap: 11px; }
.result-icon { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid #7d642d; color: var(--gold); font-size: 18px; }
.result-title small, .result-item small { color: var(--muted); font-size: 8px; }
.result-title b { display: block; margin-top: 4px; font-size: 9px; font-weight: 500; }
.result-item strong { margin: 7px 0 4px; font-size: 17px; }
.result-item span { color: var(--muted); font-size: 7px; }
.positive { color: var(--green) !important; }.negative { color: var(--red) !important; }

.bottom-grid { margin-top: 14px; display: grid; grid-template-columns: 1.15fr .85fr; gap: 14px; }
.equity-wrap { height: 220px; }
.equity-legend { display: flex; gap: 14px; color: var(--muted); font-size: 8px; }
.equity-legend span { display: flex; align-items: center; gap: 5px; }
.equity-legend i { width: 14px; height: 2px; background: var(--gold); }.equity-legend .benchmark-dot { background: #59636f; }
.text-btn { color: var(--gold); font-size: 9px; }.text-btn:hover { color: var(--gold-light); }
.table-wrap { max-height: 220px; overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 8px; }
th { position: sticky; top: 0; z-index: 1; height: 31px; background: var(--panel-2); color: var(--muted); text-align: left; font-weight: 500; }
th, td { padding: 0 12px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
td { height: 34px; color: #adb5be; }
.direction { display: inline-block; min-width: 28px; padding: 3px 5px; text-align: center; background: #3fc79713; color: var(--green); }.direction.short { background: #ed6b7013; color: var(--red); }
.empty-row td { height: 170px; color: var(--muted); text-align: center; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: 24px; transform: translate(-50%, 20px); min-width: 190px; padding: 11px 17px; border: 1px solid #5e4b25; background: #17130d; color: #eed9ae; text-align: center; font-size: 10px; opacity: 0; pointer-events: none; transition: .25s; box-shadow: 0 8px 30px #0009; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.shutdown-screen { min-height: 100vh; display: grid; place-content: center; gap: 10px; text-align: center; background: var(--bg); color: var(--text); }
.shutdown-screen strong { font-size: 22px; }
.shutdown-screen span { color: var(--muted); font-size: 12px; }

@media (max-width: 1120px) {
  :root { --sidebar-w: 170px; }
  .ticker-grid { grid-template-columns: repeat(2, 1fr); }
  .main-grid { grid-template-columns: minmax(0, 1.8fr) 280px; }
  .result-strip { grid-template-columns: repeat(3, 1fr); }.result-title, .result-item { border-bottom: 1px solid var(--line-soft); }
  .factor-overview { grid-template-columns: 170px 1fr; }.factor-domains { grid-column: 1 / -1; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line-soft); }.factor-domain { border-right: 1px solid var(--line-soft); }
  .factor-matrix { grid-template-columns: repeat(2, minmax(0, 1fr)); }.factor-group:nth-child(3n) { border-right: 1px solid var(--line-soft); }.factor-group:nth-child(2n) { border-right: 0; }
  .pro-grid { grid-template-columns: minmax(230px, .8fr) minmax(300px, 1.2fr); }.direct-market { grid-column: 1 / -1; border-top: 1px solid var(--line-soft); }
}

@media (max-width: 820px) {
  :root { --topbar-h: 56px; }
  .topbar { grid-template-columns: 150px 1fr; }.brand { padding: 0 13px; border-right: 0; }.market-status { display: none; }.top-actions { justify-content: flex-end; padding-right: 10px; }.top-actions .ghost { display: none; }
  .sidebar { position: fixed; z-index: 25; left: 0; right: 0; top: auto; width: auto; height: calc(56px + var(--safe-bottom)); padding: 0 0 var(--safe-bottom); border: 0; border-top: 1px solid var(--line); }
  .sidebar nav { height: 56px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }.nav-item { height: 56px; min-width: 0; flex-direction: column; justify-content: center; gap: 2px; padding: 0 2px; border-left: 0; border-top: 2px solid transparent; font-size: 8px; }.nav-item.active { border-top-color: var(--gold); }.nav-item span { font-size: 14px; }
  .account-card, .side-foot { display: none; }
  .workspace { margin-left: 0; padding: calc(var(--topbar-h) + var(--safe-top) + 17px) 12px calc(78px + var(--safe-bottom)); }
  .main-grid, .bottom-grid { grid-template-columns: 1fr; }.chart-panel { grid-row: 1; }.chart-wrap { height: 320px; }
  .factor-overview { grid-template-columns: 145px 1fr; }.factor-score-block { padding-left: 10px; padding-right: 10px; }.factor-ring { width: 88px; height: 88px; }.factor-chart-block { padding-left: 10px; padding-right: 10px; }.factor-domains { grid-template-columns: repeat(2, 1fr); }
  .factor-controls { align-items: flex-start; flex-direction: column; }.scenario-row { width: 100%; }.factor-source-legend { align-self: flex-end; }
  .pro-grid { grid-template-columns: 1fr 1fr; }.pro-decision { border-bottom: 1px solid var(--line-soft); }.pro-checks { border-right: 0; border-bottom: 1px solid var(--line-soft); }.direct-market { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .top-actions .icon-btn { display: none; }.brand strong { font-size: 13px; }.btn { padding: 0 11px; }
  .page-heading { align-items: center; }.heading-actions .saved-state { display: none; } h1 { font-size: 18px; }
  .ticker-grid { grid-template-columns: 1fr 1fr; }.ticker-card, .metric-card { min-height: 117px; padding: 14px; }.primary-ticker { grid-column: 1 / -1; }.metric-card:last-child { grid-column: 1 / -1; }
  .china-gold-band > header { align-items: flex-start; flex-direction: column; gap: 4px; }.china-gold-band > header small { text-align: left; }.china-gold-grid { grid-template-columns: 1fr 1fr; }.china-gold-grid > div { border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }.china-gold-grid > div:nth-child(2n) { border-right: 0; }.china-gold-grid > .china-premium { grid-column: 1 / -1; border-right: 0; border-bottom: 0; }
  .panel-head { padding: 0 12px; }.chart-panel .panel-head { height: auto; min-height: 88px; padding-top: 11px; padding-bottom: 9px; align-items: stretch; flex-direction: column; gap: 8px; }.chart-panel .panel-head > div:first-child > span { white-space: normal; }.chart-tools { width: 100%; gap: 5px; }.chart-tools #timeframes { flex: 1; min-width: 0; overflow-x: auto; }.chart-tools #timeframes button { flex: 0 0 39px; }.segmented button { min-width: 36px; padding: 0 5px; }.chart-wrap { height: 300px; }.chart-legend { min-height: 55px; padding: 6px 12px; gap: 7px 10px; flex-wrap: wrap; }.chart-windows { margin-left: 0; }
  .result-strip { grid-template-columns: 1fr 1fr; }.result-title { grid-column: 1 / -1; }.result-item { padding: 13px; }.result-item strong { font-size: 15px; }
  .equity-wrap { height: 190px; }
  .factor-head { height: auto; min-height: 70px; align-items: flex-start; flex-direction: column; padding-top: 12px; padding-bottom: 10px; gap: 8px; }.factor-overview { grid-template-columns: 1fr; }.factor-score-block { border-right: 0; border-bottom: 1px solid var(--line-soft); }.factor-chart-block { border-right: 0; }.factor-chart-wrap { height: 330px; }.factor-domains { grid-template-columns: 1fr 1fr; }.scenario-row { align-items: flex-start; flex-wrap: wrap; }.scenario-tabs { width: 100%; }.scenario-state { margin-left: auto; }.factor-matrix { grid-template-columns: 1fr; max-height: 680px; }.factor-group, .factor-group:nth-child(3n), .factor-group:nth-child(2n) { border-right: 0; }
  .pro-grid { grid-template-columns: 1fr; }.pro-decision, .pro-checks { border-right: 0; border-bottom: 1px solid var(--line-soft); }.direct-market { grid-column: auto; }.context-quotes { grid-template-columns: 1fr 1fr; }
}
