:root {
  --page-bg: #f3f6fa; --surface: #fff; --ink: #182230; --muted: #718096;
  --line: #e2e8f0; --accent: #2563eb; --accent-soft: #eaf1ff;
  --navy: #17213d; --navy-soft: #25345d; --good: #16846d; --bad: #c53b43;
  --warning: #a16207; --shadow: 0 10px 28px rgba(29, 48, 78, .06);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--page-bg); font-family: Inter, "Segoe UI", "Microsoft YaHei", "PingFang SC", Arial, sans-serif; letter-spacing: 0; }
button, input, select { font: inherit; }
a { color: inherit; }
.strategy-shell { min-height: 100vh; display: grid; grid-template-columns: 238px minmax(0, 1fr); }
.strategy-sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 24px 14px 18px; color: #dce6ff; background: var(--navy); }
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 2px 12px 26px; color: #fff; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid rgba(255,255,255,.35); border-radius: 8px; color: #fff; background: var(--accent); font-size: 17px; font-weight: 800; }
.sidebar-brand strong, .sidebar-brand small { display: block; }
.sidebar-brand strong { font-size: 15px; }
.sidebar-brand small { margin-top: 3px; color: #96a8d2; font-size: 11px; }
.sidebar-group-label { margin: 12px 12px 5px; color: #7789b4; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.sidebar-nav { display: grid; gap: 5px; }
.sidebar-nav a { position: relative; display: grid; grid-template-columns: 28px minmax(0,1fr); align-items: center; min-height: 46px; gap: 7px; border-radius: 8px; padding: 0 12px; color: #c3cee8; font-size: 14px; text-decoration: none; }
.sidebar-nav a:hover, .sidebar-nav a.active { color: #fff; background: var(--navy-soft); }
.sidebar-nav a.active::before { content: ""; position: absolute; left: 0; width: 3px; height: 24px; background: #8db2ff; }
.nav-icon { display: grid; place-items: center; color: #93a5d0; font-size: 19px; }
.sidebar-footer { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 5px 8px; margin-top: auto; border-top: 1px solid rgba(216,226,255,.13); padding: 16px 12px 0; color: #b1bfde; font-size: 12px; }
.sidebar-footer small { grid-column: 2; color: #7f91b9; font-size: 10px; }
.data-dot { width: 7px; height: 7px; border-radius: 50%; background: #7dd3a7; box-shadow: 0 0 0 4px rgba(125,211,167,.12); }
.strategy-main { min-width: 0; padding: 30px clamp(18px,4vw,52px) 0; }
.page-header, .top-toolbar, .market-strip, .regime-panel, .strategy-selector, .selection-workspace, .research-grid, .strategy-note { width: min(1480px,100%); margin-right: auto; margin-left: auto; }
.page-header { display: flex; align-items: end; justify-content: space-between; gap: 22px; margin-bottom: 22px; }
.eyebrow, .section-kicker { margin: 0 0 6px; color: var(--accent); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.page-header h1 { margin: 0; font-size: 28px; }
.header-note { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.data-badge, .count-badge, .mode-badge { display: inline-flex; align-items: center; min-height: 30px; border: 1px solid #cbdafa; border-radius: 6px; padding: 0 10px; color: var(--accent); background: var(--accent-soft); font-size: 11px; font-weight: 800; white-space: nowrap; }
.mode-badge { color: var(--good); border-color: #bce4d8; background: #edf9f5; }
.mode-badge.neutral { color: #475569; border-color: #d7dee8; background: #f7f9fb; }
.top-toolbar { display: grid; grid-template-columns: 220px 220px 190px auto; align-items: end; gap: 12px; border: 1px solid var(--line); border-radius: 8px; padding: 14px; background: var(--surface); box-shadow: var(--shadow); }
.top-toolbar label { display: grid; gap: 6px; }
.top-toolbar label > span { color: var(--muted); font-size: 11px; font-weight: 700; }
.top-toolbar select { min-height: 40px; border: 1px solid var(--line); border-radius: 6px; padding: 0 10px; color: var(--ink); background: #fff; }
.primary-button, .secondary-button, .text-button { min-height: 40px; border-radius: 6px; padding: 0 16px; font-size: 12px; font-weight: 800; cursor: pointer; }
.primary-button { border: 1px solid var(--accent); color: #fff; background: var(--accent); }
.secondary-button { border: 1px solid #b8caef; color: var(--accent); background: #f5f8ff; }
.text-button { min-height: 32px; border: 0; color: var(--accent); background: transparent; }
button:disabled { opacity: .55; cursor: default; }
.market-strip { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); margin-top: 14px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.market-item { min-width: 0; padding: 13px 15px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.market-item:nth-child(4n) { border-right: 0; }
.market-item:nth-last-child(-n+4) { border-bottom: 0; }
.market-item span, .market-item small { display: block; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.market-item strong { display: block; margin: 5px 0 3px; font-size: 17px; }
.positive { color: var(--bad) !important; }
.negative { color: var(--good) !important; }
.regime-panel { margin-top: 14px; }
.regime-heading { align-items: center; }
.regime-title { display: flex; align-items: center; gap: 8px; }
.regime-badge, .confidence-badge { display: inline-flex; align-items: center; min-height: 32px; border: 1px solid #d9e0e9; border-radius: 6px; padding: 0 10px; color: #475569; background: #f8fafc; font-size: 11px; font-weight: 800; white-space: nowrap; }
.regime-badge.bull, .regime-badge.bottom_rebound { color: #a62f39; border-color: #efc4c8; background: #fff3f4; }
.regime-badge.bear, .regime-badge.top_pullback { color: #11705e; border-color: #bae2d8; background: #eff9f6; }
.regime-badge.range { color: #9a6510; border-color: #ecd7ab; background: #fff9ec; }
.confidence-badge { color: #315d9e; border-color: #cbdafa; background: #f3f7ff; }
.regime-overview { display: grid; grid-template-columns: minmax(260px,1fr) minmax(420px,1.25fr); gap: 30px; align-items: center; padding: 18px; }
.regime-copy strong { font-size: 15px; }
.regime-copy p { max-width: 660px; margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.allocation-bars { display: grid; gap: 8px; }
.allocation-row { display: grid; grid-template-columns: 86px minmax(100px,1fr) 42px; align-items: center; gap: 9px; }
.allocation-row > span { overflow: hidden; color: #56657a; font-size: 10px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.allocation-row > strong { font-size: 11px; text-align: right; }
.allocation-track { height: 8px; overflow: hidden; border-radius: 4px; background: #edf1f5; }
.allocation-track i { display: block; height: 100%; border-radius: inherit; background: #326bd1; }
.allocation-row.limit_pullback .allocation-track i { background: #c18a22; }
.allocation-row.volume_breakout .allocation-track i { background: #16846d; }
.allocation-row.cash .allocation-track i { background: #7b8798; }
.regime-signals { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); border-top: 1px solid var(--line); }
.regime-signal { position: relative; min-width: 0; min-height: 108px; padding: 13px 14px; border-right: 1px solid var(--line); }
.regime-signal:last-child { border-right: 0; }
.regime-signal::before { content: ""; position: absolute; top: 0; right: 14px; left: 14px; height: 2px; background: #cbd5e1; }
.regime-signal.bullish::before { background: var(--bad); }
.regime-signal.bearish::before, .regime-signal.risk::before { background: var(--good); }
.regime-signal > span, .regime-signal > small { display: block; color: var(--muted); font-size: 9px; }
.regime-signal > strong { display: block; overflow: hidden; margin: 9px 0 6px; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.regime-signal > small { display: -webkit-box; overflow: hidden; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.strategy-selector { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin-top: 14px; }
.strategy-tab { position: relative; display: grid; min-width: 0; min-height: 132px; border: 1px solid var(--line); border-radius: 8px; padding: 14px 15px; color: var(--ink); background: var(--surface); box-shadow: var(--shadow); text-align: left; cursor: pointer; }
.strategy-tab:hover { border-color: #b7c8e8; }
.strategy-tab.active { border-color: #7da2e8; box-shadow: inset 0 3px 0 var(--accent), var(--shadow); }
.strategy-index { color: var(--accent); font-size: 9px; font-weight: 800; }
.strategy-tab > strong { margin-top: 4px; font-size: 14px; }
.strategy-tab > small { overflow: hidden; margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.5; text-overflow: ellipsis; white-space: nowrap; }
.strategy-tab-metrics { display: flex; flex-wrap: wrap; align-items: end; gap: 6px 12px; margin-top: 12px; border-top: 1px solid #edf1f5; padding-top: 9px; }
.strategy-tab-metrics b { color: #536175; font-size: 9px; }
.selection-workspace { display: grid; grid-template-columns: minmax(300px,.65fr) minmax(660px,1.6fr); gap: 14px; margin-top: 14px; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); padding: 16px 18px 13px; }
.panel-heading h2 { margin: 0; font-size: 17px; }
.panel-description { max-width: 390px; margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.parameter-list { display: grid; gap: 20px; padding: 19px 18px; }
.parameter-control { display: grid; gap: 8px; }
.parameter-control > span { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.parameter-control strong { font-size: 13px; }
.parameter-control output { min-width: 62px; color: var(--accent); font-size: 13px; font-weight: 800; text-align: right; }
.parameter-control small { color: var(--muted); font-size: 10px; }
.parameter-control input[type="range"] { width: 100%; accent-color: var(--accent); }
.fixed-strategy-rules { display: grid; gap: 0; padding: 5px 18px 15px; }
.fixed-strategy-rules > div { display: grid; grid-template-columns: 26px minmax(0,1fr); align-items: center; gap: 10px; min-height: 58px; border-bottom: 1px solid var(--line); }
.fixed-strategy-rules > div:last-child { border-bottom: 0; }
.fixed-strategy-rules span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: #fff; background: var(--accent); font-size: 10px; font-weight: 800; }
.fixed-strategy-rules p { margin: 0; color: #435167; font-size: 12px; line-height: 1.55; }
.fixed-filters { display: flex; flex-wrap: wrap; gap: 7px; border-top: 1px solid var(--line); padding: 14px 18px 17px; }
.fixed-filters span { border: 1px solid #dbe3ec; border-radius: 4px; padding: 5px 7px; color: #56657a; background: #f8fafc; font-size: 9px; font-weight: 700; }
.metric-row { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); border-bottom: 1px solid var(--line); }
.metric-row > div { min-width: 0; padding: 13px 15px; }
.metric-row > div + div { border-left: 1px solid var(--line); }
.metric-row span { display: block; color: var(--muted); font-size: 10px; }
.metric-row strong { display: block; margin-top: 5px; font-size: 17px; }
.table-wrap { overflow: auto; max-height: 475px; }
table { width: 100%; min-width: 780px; border-collapse: collapse; }
th, td { border-bottom: 1px solid #edf1f5; padding: 10px 12px; font-size: 11px; text-align: right; white-space: nowrap; }
th { position: sticky; top: 0; z-index: 1; color: var(--muted); background: #f8fafc; font-size: 10px; }
th:first-child, td:first-child { text-align: left; }
.stock-name { display: block; color: var(--ink); font-size: 12px; font-weight: 800; }
.stock-code { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.research-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; margin-top: 14px; }
.decision-box, .optimizer-result { min-height: 142px; padding: 10px 18px 17px; }
.decision-card { display: grid; gap: 8px; border-left: 3px solid var(--accent); padding: 10px 12px; background: #f7f9fd; }
.decision-card.good { border-left-color: var(--good); }
.decision-card.warn { border-left-color: var(--warning); }
.decision-card strong { font-size: 13px; }
.decision-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.parameter-change { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 6px; }
.parameter-change span { border: 1px solid var(--line); border-radius: 4px; padding: 7px; color: var(--muted); background: #fff; font-size: 9px; }
.parameter-change b { display: block; margin-top: 3px; color: var(--ink); font-size: 11px; }
.learning-summary { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); border-bottom: 1px solid var(--line); }
.learning-summary > div { min-width: 0; padding: 12px 14px; }
.learning-summary > div + div { border-left: 1px solid var(--line); }
.learning-summary span, .learning-section-title small { display: block; color: var(--muted); font-size: 9px; }
.learning-summary strong { display: block; overflow: hidden; margin-top: 5px; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.learning-section { border-bottom: 1px solid var(--line); padding: 14px 18px; }
.learning-section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.learning-section-title > strong { font-size: 12px; }
.candidate-panel { background: #fbfcfe; }
.candidate-reason { margin: 0 0 10px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.candidate-status { border: 1px solid #d7dee8; border-radius: 4px; padding: 4px 7px; color: #526176; background: #fff; font-size: 9px; font-weight: 800; }
.candidate-status.ready { color: var(--good); border-color: #bce4d8; background: #edf9f5; }
.candidate-status.observing { color: var(--accent); border-color: #cbdafa; background: var(--accent-soft); }
.candidate-status.rejected { color: var(--bad); border-color: #efc9cd; background: #fff3f4; }
.observation-progress { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-top: 12px; }
.observation-progress span { display: flex; justify-content: space-between; color: var(--muted); font-size: 9px; }
.observation-progress b { color: var(--ink); }
.observation-progress i { display: block; overflow: hidden; height: 5px; margin-top: 6px; border-radius: 3px; background: #e5eaf1; }
.observation-progress em { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.candidate-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 6px; margin-top: 12px; }
.candidate-metrics > div { border: 1px solid var(--line); border-radius: 4px; padding: 7px; background: #fff; }
.candidate-metrics span { display: block; color: var(--muted); font-size: 8px; }
.candidate-metrics strong { display: block; margin-top: 4px; font-size: 11px; }
.version-section { border-bottom: 0; }
.version-list { display: grid; gap: 6px; max-height: 126px; overflow: auto; }
.version-item { display: grid; grid-template-columns: 112px minmax(0,1fr); align-items: center; gap: 8px; border-top: 1px solid #edf1f5; padding-top: 7px; }
.version-item:first-child { border-top: 0; padding-top: 0; }
.version-item > div { display: flex; align-items: center; gap: 6px; }
.version-item strong { color: var(--accent); font-size: 11px; }
.version-item span, .version-item small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.learning-actions { flex-wrap: wrap; }
.danger-button { color: var(--bad); border-color: #efc9cd; background: #fff7f7; }
.empty-state.compact { padding: 10px 0; text-align: left; }
.panel-actions { display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); padding: 12px 18px; }
.optimizer-metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin-top: 9px; }
.optimizer-metrics div { border: 1px solid var(--line); border-radius: 4px; padding: 8px; }
.optimizer-metrics span { display: block; color: var(--muted); font-size: 9px; }
.optimizer-metrics strong { display: block; margin-top: 4px; font-size: 12px; }
.strategy-note { margin-top: 14px; border: 1px solid #f0d9a5; border-radius: 8px; padding: 12px 15px; color: #7c5c12; background: #fffaf0; font-size: 11px; line-height: 1.7; }
.loading-state, .empty-state, .error-state { padding: 26px 12px; color: var(--muted); font-size: 12px; text-align: center; }
.error-state { color: var(--bad); }
.legal-footer { margin: 24px calc(clamp(18px,4vw,52px) * -1) 0; }
.strategy-toast { position: fixed; right: 22px; bottom: 22px; z-index: 10; max-width: min(360px,calc(100vw - 44px)); border: 1px solid #c8d8fb; border-radius: 6px; padding: 11px 14px; color: #1e40af; background: #eef4ff; box-shadow: var(--shadow); font-size: 12px; }
@media (max-width: 1160px) { .strategy-shell { grid-template-columns: 205px minmax(0,1fr); } .selection-workspace { grid-template-columns: 1fr; } .market-strip { grid-template-columns: repeat(3,minmax(0,1fr)); } .market-item:nth-child(n) { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); } .market-item:nth-child(3n) { border-right: 0; } .regime-signals { grid-template-columns: repeat(3,minmax(0,1fr)); } .regime-signal:nth-child(3n) { border-right: 0; } .regime-signal:nth-child(-n+3) { border-bottom: 1px solid var(--line); } }
@media (max-width: 820px) { .strategy-shell { display: block; } .strategy-sidebar { position: static; height: auto; padding: 14px 10px 10px; } .sidebar-brand { padding-bottom: 13px; } .sidebar-group-label, .sidebar-footer { display: none; } .sidebar-nav { display: flex; overflow-x: auto; gap: 4px; padding-bottom: 3px; } .sidebar-nav + .sidebar-nav { margin-top: 5px; } .sidebar-nav a { flex: 0 0 auto; grid-template-columns: 20px auto; min-height: 38px; padding: 0 10px; font-size: 12px; } .sidebar-nav a.active::before { display: none; } .strategy-main { padding: 22px 12px 0; } .top-toolbar { grid-template-columns: repeat(2,minmax(0,1fr)); } .top-toolbar .primary-button { grid-column: 1 / -1; } .market-strip { grid-template-columns: repeat(2,minmax(0,1fr)); } .market-item:nth-child(n) { border-right: 1px solid var(--line); } .market-item:nth-child(2n) { border-right: 0; } .regime-overview { grid-template-columns: 1fr; gap: 16px; } .strategy-selector { grid-template-columns: 1fr; } .strategy-tab { min-height: 118px; } .research-grid { grid-template-columns: 1fr; } .learning-summary { grid-template-columns: repeat(2,minmax(0,1fr)); } .learning-summary > div:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); } .learning-summary > div:nth-child(4) { border-top: 1px solid var(--line); } .legal-footer { margin-right: -12px; margin-left: -12px; } }
@media (max-width: 520px) { .page-header { align-items: flex-start; flex-direction: column; } .top-toolbar { grid-template-columns: 1fr; } .top-toolbar .primary-button { grid-column: 1; } .market-strip { grid-template-columns: 1fr; } .market-item:nth-child(n) { border-right: 0; border-bottom: 1px solid var(--line); } .regime-heading { align-items: flex-start; flex-direction: column; } .regime-overview { padding: 15px; } .regime-signals { grid-template-columns: repeat(2,minmax(0,1fr)); } .regime-signal:nth-child(n) { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); } .regime-signal:nth-child(2n) { border-right: 0; } .regime-signal:nth-last-child(-n+2) { border-bottom: 0; } .allocation-row { grid-template-columns: 72px minmax(80px,1fr) 38px; } .metric-row { grid-template-columns: repeat(2,minmax(0,1fr)); } .metric-row > div:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); } .metric-row > div:nth-child(4) { border-top: 1px solid var(--line); } .parameter-change, .observation-progress, .candidate-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); } .version-item { grid-template-columns: 1fr; } .learning-actions button { flex: 1 1 130px; } }
