:root {
  color-scheme: light;
  --bg: #eef2f0;
  --surface: #ffffff;
  --surface-soft: #f5f8f6;
  --line: #d7e0db;
  --line-strong: #c2cdc7;
  --text: #14201b;
  --muted: #5f6f68;
  --faint: #87948d;
  --teal: #0b7d68;
  --teal-soft: #e4f6f1;
  --blue: #2767b2;
  --blue-soft: #eaf1fb;
  --amber: #a86707;
  --amber-soft: #fff3dc;
  --red: #b3443c;
  --red-soft: #fbeceb;
  --ink: #1d2d27;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(ellipse 70% 40% at 0% 0%, rgba(11, 125, 104, 0.07), transparent 42%),
    var(--bg);
  font-family: "IBM Plex Sans", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}
::selection { color: #fff; background: var(--teal); }
button, select { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid rgba(11, 125, 104, 0.55); outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 30px; line-height: 1.12; letter-spacing: -0.035em; font-weight: 650; }
h2 { font-size: 21px; letter-spacing: -0.03em; font-weight: 650; }
h3 { font-size: 15px; letter-spacing: -0.02em; }

.research-shell { width: min(1500px, calc(100vw - 48px)); margin: 0 auto; padding: 20px 0 38px; }
.topbar, .top-actions, .brand, .section-head, .panel-head, .maturity-label, footer { display: flex; align-items: center; }
.topbar, .section-head, .panel-head, footer { justify-content: space-between; gap: 18px; }
.brand { gap: 11px; color: var(--text); text-decoration: none; }
.brand > span:last-child { display: grid; gap: 2px; }
.brand b { font-size: 15px; letter-spacing: -0.03em; }
.brand small { color: var(--muted); font-size: 12px; }
.brand-mark { display: flex; width: 36px; height: 36px; align-items: end; justify-content: center; gap: 3px; border: 1px solid #b7ddd4; border-radius: 11px; padding: 8px; background: var(--teal-soft); }
.brand-mark i { width: 4px; border-radius: 99px; background: var(--teal); }
.brand-mark i:nth-child(1) { height: 9px; } .brand-mark i:nth-child(2) { height: 18px; } .brand-mark i:nth-child(3) { height: 13px; }
.top-actions { gap: 8px; }
.product-nav { display: inline-flex; flex-wrap: wrap; gap: 4px; margin: 14px 0 2px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, 0.72); }
.product-nav-link { display: inline-flex; min-height: 30px; align-items: center; border: 0; border-radius: 999px; padding: 0 12px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 600; text-decoration: none; }
.product-nav-link:hover { color: var(--text); background: rgba(11, 125, 104, 0.06); }
.product-nav-link.active { color: #fff; background: var(--teal); }
.readonly-badge, .state-badge, .status-chip { display: inline-flex; min-height: 28px; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 0 10px; color: var(--muted); background: var(--surface); font-size: 11px; font-weight: 700; }
.state-badge i { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }
.state-badge.ok i { background: var(--teal); } .state-badge.danger i { background: var(--red); }
.icon-button { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--line); border-radius: 11px; color: var(--muted); background: var(--surface); }
.icon-button:hover { color: var(--text); border-color: var(--line-strong); }
.icon-button svg { width: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.summary-band { display: grid; grid-template-columns: minmax(290px, 1fr) minmax(620px, 1.5fr); gap: 28px; margin-top: 20px; padding: 28px 30px; border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(180deg, #ffffff, #f7faf8); box-shadow: 0 16px 40px rgba(25, 40, 36, 0.06); }
.summary-copy p { max-width: 620px; margin-top: 8px; color: var(--muted); font-size: 14px; line-height: 1.65; }
.kicker { display: block; margin-bottom: 6px; color: var(--teal); font-size: 11px; font-weight: 760; letter-spacing: .14em; }
.summary-metrics { display: grid; grid-template-columns: repeat(4, 1fr); align-items: center; }
.summary-metric { min-width: 0; padding: 3px 18px; border-left: 1px solid var(--line); }
.summary-metric span { display: block; color: var(--muted); font-size: 12px; }
.summary-metric b { display: block; margin-top: 5px; font-size: 24px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.summary-metric small { display: block; margin-top: 4px; overflow: hidden; color: var(--faint); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }

.tabs { display: flex; gap: 2px; margin-top: 18px; border-bottom: 1px solid var(--line-strong); }
.tab { display: flex; min-width: 132px; min-height: 48px; align-items: center; justify-content: space-between; gap: 18px; border: 0; border-bottom: 2px solid transparent; padding: 0 13px; color: var(--muted); background: transparent; font-size: 13px; font-weight: 650; }
.tab b { display: grid; min-width: 22px; height: 22px; place-items: center; border-radius: 7px; color: var(--faint); background: #e4ebe7; font-size: 11px; }
.tab.active { color: var(--text); border-bottom-color: var(--teal); } .tab.active b { color: var(--teal); background: var(--teal-soft); }
.tab-panel { display: none; padding-top: 24px; } .tab-panel.active { display: block; }
.section-head { margin-bottom: 15px; } .section-meta, .subtle { color: var(--muted); font-size: 12px; }
.surface { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 10px 24px rgba(30, 48, 42, .04); }

.data-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.data-card { min-width: 0; min-height: 135px; padding: 16px; border-top: 3px solid var(--line-strong); }
.data-card[data-key="candles"], .data-card[data-key="snapshots"] { border-top-color: var(--teal); }
.data-card[data-key="funding"], .data-card[data-key="websocket"] { border-top-color: var(--blue); }
.data-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.data-icon { display: grid; width: 27px; height: 27px; place-items: center; border: 1px solid var(--line); border-radius: 5px; color: var(--teal); background: var(--surface-soft); }
.data-icon svg { width: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.freshness { color: var(--faint); font-size: 10px; }
.data-card h3 { margin-top: 12px; color: var(--muted); font-size: 11px; font-weight: 650; }
.data-value { display: flex; align-items: baseline; gap: 6px; margin-top: 3px; }.data-value b { font-size: 24px; font-variant-numeric: tabular-nums; }.data-value span { color: var(--muted); font-size: 11px; }
.data-secondary { margin-top: 9px; padding-top: 8px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.split-layout { display: grid; grid-template-columns: 1.25fr .75fr; gap: 12px; margin-top: 12px; }
.cadence-panel, .forward-panel, .stability-panel { padding: 17px; }
.cadence-rows { display: grid; gap: 10px; margin-top: 15px; }
.cadence-row { display: grid; grid-template-columns: 42px minmax(120px, 1fr) 105px 95px; align-items: center; gap: 12px; font-size: 11px; }
.cadence-row > b { color: var(--ink); }.cadence-row > span { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.bar-track { height: 7px; overflow: hidden; background: #edf0f2; }.bar-track i { display: block; height: 100%; background: var(--teal); }
.status-chip.collecting { color: var(--teal); border-color: #b8ddd7; background: var(--teal-soft); }
.status-chip.warning { color: var(--amber); border-color: #ecd5aa; background: var(--amber-soft); }
.forward-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 15px 0 18px; }
.forward-metric { padding: 10px; background: var(--surface-soft); }.forward-metric span { display: block; color: var(--muted); font-size: 10px; }.forward-metric b { display: block; margin-top: 4px; font-size: 16px; }
.maturity-block + .maturity-block { margin-top: 13px; }.maturity-label { justify-content: space-between; color: var(--muted); font-size: 10px; }.maturity-label b { color: var(--text); }
.progress { height: 7px; margin-top: 6px; overflow: hidden; background: #e8ecee; }.progress i { display: block; width: 0; height: 100%; background: var(--teal); }.progress.event i { background: var(--blue); }

.manual-risk-strip { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 12px; }
.manual-risk-item { min-width: 0; padding: 13px; border-top: 3px solid var(--amber); background: var(--surface); box-shadow: 0 2px 7px rgba(30, 48, 57, .035); }
.manual-risk-item span { display: block; color: var(--muted); font-size: 10px; }.manual-risk-item b { display: block; margin-top: 5px; color: var(--text); font-size: 14px; font-variant-numeric: tabular-nums; }
.manual-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }.manual-rules, .manual-gates { padding: 17px; }
.manual-rule-rows, .manual-gate-rows { display: grid; gap: 0; margin-top: 13px; }.manual-rule-row { display: grid; grid-template-columns: 105px minmax(0, 1fr); gap: 14px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 11px; }.manual-rule-row:first-child { border-top: 0; }.manual-rule-row span { color: var(--muted); }.manual-rule-row b { color: var(--text); font-weight: 650; overflow-wrap: anywhere; }
.manual-sector-head { margin-top: 25px; }.manual-sector-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }.manual-sector-card { min-width: 0; padding: 16px; border-top: 3px solid var(--amber); }.manual-sector-card-head { display: flex; align-items: start; justify-content: space-between; gap: 10px; }.manual-sector-card-head h3 { font-size: 15px; }.manual-sector-card-head small { display: block; margin-top: 3px; color: var(--faint); font-size: 10px; }.manual-thesis { min-height: 43px; margin-top: 11px; color: var(--muted); font-size: 11px; line-height: 1.5; }.manual-sector-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 12px; }.manual-sector-meta span { padding: 8px; color: var(--muted); background: var(--surface-soft); font-size: 10px; }.manual-sector-meta b { display: block; margin-top: 3px; color: var(--text); font-size: 12px; }.manual-leg-list { display: grid; gap: 7px; margin-top: 10px; }.manual-leg { padding-top: 9px; border-top: 1px solid var(--line); }.manual-leg > div:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }.manual-leg b { font-size: 11px; }.manual-leg small { color: var(--muted); font-size: 9px; }.manual-leg-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: 7px; }.manual-leg-stats span { min-width: 0; color: var(--faint); font-size: 9px; }.manual-leg-stats b { display: block; margin-top: 3px; color: var(--text); font-size: 10px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 5px; padding: 2px; background: #e9edf0; }
.segment { min-height: 28px; border: 0; border-radius: 3px; padding: 0 10px; color: var(--muted); background: transparent; font-size: 10px; font-weight: 700; }.segment.active { color: var(--text); background: var(--surface); box-shadow: 0 1px 3px rgba(20, 35, 44, .12); }
.table-shell { overflow: auto; }.strategy-table, .result-table { width: 100%; border-collapse: collapse; }
th { padding: 10px 13px; color: var(--muted); background: var(--surface-soft); font-size: 10px; text-align: left; white-space: nowrap; }
td { padding: 12px 13px; border-top: 1px solid var(--line); color: var(--ink); font-size: 11px; vertical-align: middle; }
.strategy-name { min-width: 180px; }.strategy-name b { display: block; font-size: 12px; }.strategy-name small { display: block; margin-top: 3px; color: var(--faint); }
.status-label { display: inline-flex; min-height: 24px; align-items: center; border-radius: 4px; padding: 0 7px; font-size: 10px; font-weight: 750; white-space: nowrap; }
.status-label.forward, .status-label.collecting { color: var(--teal); background: var(--teal-soft); }.status-label.data_only { color: var(--blue); background: var(--blue-soft); }.status-label.development { color: var(--amber); background: var(--amber-soft); }.status-label.rejected { color: var(--red); background: var(--red-soft); }
.finding { min-width: 330px; color: var(--muted); line-height: 1.45; }

.sample-studies { display: grid; gap: 12px; }.sample-study { padding: 17px; }.study-head { display: flex; align-items: start; justify-content: space-between; gap: 18px; }.study-head p { margin-top: 4px; color: var(--muted); font-size: 11px; }.classification { max-width: 260px; color: var(--muted); font-size: 10px; text-align: right; }
.split-track { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 3px; margin-top: 15px; }.split-track.forward-only { grid-template-columns: repeat(3, 1fr); }
.split-block { min-width: 0; padding: 13px; border-top: 3px solid var(--line-strong); background: var(--surface-soft); }.split-block.train { border-color: var(--ink); }.split-block.validation { border-color: var(--blue); }.split-block.test { border-color: var(--teal); }.split-block.collected, .split-block.months, .split-block.events { border-color: var(--amber); }
.split-block span { color: var(--muted); font-size: 10px; }.split-block b { display: block; margin-top: 5px; font-size: 15px; }.split-block small { display: block; margin-top: 4px; overflow-wrap: anywhere; color: var(--faint); font-size: 9px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 7px; }.toolbar select { min-height: 32px; border: 1px solid var(--line); border-radius: 5px; padding: 0 28px 0 9px; color: var(--ink); background: var(--surface); font-size: 10px; }
.evidence-banner { margin-bottom: 10px; border-left: 3px solid var(--red); padding: 10px 12px; color: var(--red); background: var(--red-soft); font-size: 11px; line-height: 1.45; }.evidence-banner.watch { color: var(--amber); border-color: var(--amber); background: var(--amber-soft); }
.result-shell { max-height: 610px; }.result-table th { position: sticky; top: 0; z-index: 1; }.result-table td { font-variant-numeric: tabular-nums; white-space: nowrap; }.result-table td:first-child { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 10px; }.positive { color: var(--teal) !important; }.negative { color: var(--red) !important; }.liquidated { color: var(--red); font-weight: 800; }

.method-strip { display: grid; grid-template-columns: repeat(5, 1fr); margin-bottom: 12px; border: 1px solid var(--line); background: var(--surface); }.method-item { padding: 12px 14px; border-left: 1px solid var(--line); }.method-item:first-child { border-left: 0; }.method-item span { display: block; color: var(--muted); font-size: 9px; }.method-item b { display: block; margin-top: 4px; font-size: 12px; }
.mc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }.mc-card { padding: 16px; border-top: 3px solid var(--ink); }.mc-card[data-risk="high"] { border-top-color: var(--red); }.mc-card-head { display: flex; align-items: center; justify-content: space-between; }.mc-card-head b { font-size: 17px; }.mc-card-head span { color: var(--muted); font-size: 10px; }.range-row { margin-top: 15px; }.range-label { display: flex; justify-content: space-between; color: var(--muted); font-size: 9px; }.range-label b { color: var(--text); font-size: 10px; }.range-axis { position: relative; height: 9px; margin-top: 7px; background: linear-gradient(90deg, #f4d2ce 0 40%, #e5e9eb 40% 55%, #cae9e3 55% 100%); }.range-axis i { position: absolute; top: -3px; width: 2px; height: 15px; background: var(--ink); }.risk-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; margin-top: 15px; }.risk-stat { padding: 8px; background: var(--surface-soft); }.risk-stat span { display: block; color: var(--muted); font-size: 9px; }.risk-stat b { display: block; margin-top: 3px; font-size: 12px; }
.stability-panel { margin-top: 12px; }.source-splits { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 14px; }.source-split { padding: 11px; border-left: 3px solid var(--line-strong); background: var(--surface-soft); }.source-split.validation { border-color: var(--blue); }.source-split.test { border-color: var(--teal); }.source-split span { color: var(--muted); font-size: 9px; }.source-split b { display: block; margin-top: 5px; font-size: 14px; }.source-split small { color: var(--faint); font-size: 9px; }.bootstrap-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }.bootstrap-row b { color: var(--text); font-size: 12px; }

footer { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--faint); font-size: 10px; }
.toast { position: fixed; right: 20px; bottom: 20px; max-width: 360px; border: 1px solid var(--line); border-radius: 5px; padding: 10px 12px; color: var(--text); background: var(--surface); box-shadow: 0 12px 30px rgba(20, 35, 44, .16); font-size: 11px; opacity: 0; pointer-events: none; transform: translateY(8px); transition: .2s; }.toast.show { opacity: 1; transform: translateY(0); }
.empty { padding: 30px; color: var(--muted); text-align: center; }

@media (max-width: 1100px) {
  .research-shell { width: min(100% - 28px, 940px); }
  .summary-band { grid-template-columns: 1fr; }.summary-metrics { border-top: 1px solid var(--line); padding-top: 16px; }.summary-metric:first-child { border-left: 0; }
  .data-grid, .mc-grid { grid-template-columns: repeat(2, 1fr); }.split-layout, .manual-layout { grid-template-columns: 1fr; }.manual-risk-strip { grid-template-columns: repeat(3, 1fr); }.manual-sector-grid { grid-template-columns: repeat(2, 1fr); }.method-strip { grid-template-columns: repeat(3, 1fr); }.method-item:nth-child(4) { border-left: 0; }
}

@media (max-width: 700px) {
  .research-shell { width: min(100% - 20px, 620px); padding-top: 13px; }.topbar { align-items: start; }.summary-band { padding: 20px 16px; }.summary-metrics { grid-template-columns: repeat(2, 1fr); gap: 14px 0; }.summary-metric:nth-child(3) { border-left: 0; }
  .tabs { overflow-x: auto; }.tab { min-width: 116px; }.data-grid, .mc-grid, .source-splits, .manual-sector-grid { grid-template-columns: 1fr; }.manual-risk-strip { grid-template-columns: repeat(2, 1fr); }.cadence-row { grid-template-columns: 38px 1fr 75px; }.cadence-row > span:last-child { display: none; }.manual-leg-stats { grid-template-columns: repeat(2, 1fr); }.method-strip { grid-template-columns: 1fr 1fr; }.method-item:nth-child(odd) { border-left: 0; }
  .section-head { align-items: start; flex-direction: column; }.toolbar { width: 100%; }.toolbar select { flex: 1; min-width: 120px; }.split-track { grid-template-columns: 1fr; }.strategy-table { min-width: 900px; }.result-table { min-width: 760px; }.forward-metrics { grid-template-columns: 1fr 1fr; }
}
