:root {
  --bg: #f4f6f9; --surface: #ffffff; --surface-muted: #f8fafc; --border: #e2e8f0; --border-subtle: #edf2f7;
  --ink: #0f172a; --ink-secondary: #475569; --ink-muted: #64748b; --accent: #1d4ed8; --accent-soft: #eff6ff;
  --buy: #047857; --buy-bg: #ecfdf5; --buy-border: #a7f3d0;
  --watch: #b45309; --watch-bg: #fffbeb; --watch-border: #fde68a;
  --avoid: #be123c; --avoid-bg: #fff1f2; --avoid-border: #fecdd3;
  --neutral: #475569; --neutral-bg: #f1f5f9; --neutral-border: #cbd5e1;
  --up: #dc2626; --down: #059669; --radius: 14px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 6px 20px rgba(15, 23, 42, 0.04);
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, ui-monospace, monospace;
}
[data-theme="dark"] {
  --bg: #0b1120; --surface: #111827; --surface-muted: #162032; --border: #1f2937; --border-subtle: #1b2538;
  --ink: #f1f5f9; --ink-secondary: #cbd5e1; --ink-muted: #94a3b8; --accent: #60a5fa; --accent-soft: rgba(59, 130, 246, 0.14);
  --buy: #34d399; --buy-bg: rgba(16, 185, 129, 0.14); --buy-border: rgba(52, 211, 153, 0.32);
  --watch: #fbbf24; --watch-bg: rgba(245, 158, 11, 0.14); --watch-border: rgba(251, 191, 36, 0.32);
  --avoid: #fb7185; --avoid-bg: rgba(244, 63, 94, 0.14); --avoid-border: rgba(251, 113, 133, 0.32);
  --neutral: #94a3b8; --neutral-bg: rgba(148, 163, 184, 0.12); --neutral-border: rgba(148, 163, 184, 0.25);
  --up: #f87171; --down: #34d399; --shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); font-family: var(--font-sans); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
.num, code { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
code { background: var(--surface-muted); border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; font-size: 12px; }
.container { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.topbar { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; padding-top: 10px; padding-bottom: 10px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 38px; height: 38px; border-radius: 10px; background: linear-gradient(135deg, #0f172a, #1d4ed8); color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.brand-title { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.brand-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 12px; color: var(--ink-muted); }
.meta-pill { padding: 1px 7px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 11px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.btn { display: inline-flex; align-items: center; gap: 6px; border-radius: 9px; padding: 8px 13px; font-size: 13px; font-weight: 600; cursor: pointer; border: 1px solid transparent; transition: transform 0.12s ease, background 0.15s ease, opacity 0.15s ease; font-family: inherit; }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost { background: var(--surface); color: var(--ink-secondary); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-muted); color: var(--ink); }
.spinning { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.main-content { padding-top: 22px; padding-bottom: 44px; }
.section { margin-bottom: 20px; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.eyebrow { font-size: 11.5px; font-weight: 600; color: var(--ink-muted); letter-spacing: 0.01em; margin-bottom: 2px; }
.card-title { margin: 0; font-size: 16.5px; font-weight: 700; letter-spacing: -0.01em; }
.rule-chip { font-size: 11.5px; font-weight: 600; color: var(--ink-secondary); background: var(--surface-muted); border: 1px solid var(--border); padding: 4px 10px; border-radius: 99px; white-space: nowrap; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; border: 1px solid transparent; white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-buy { color: var(--buy); background: var(--buy-bg); border-color: var(--buy-border); }
.badge-watch { color: var(--watch); background: var(--watch-bg); border-color: var(--watch-border); }
.badge-avoid { color: var(--avoid); background: var(--avoid-bg); border-color: var(--avoid-border); }
.badge-neutral { color: var(--neutral); background: var(--neutral-bg); border-color: var(--neutral-border); }
.badge-lg { padding: 6px 14px; font-size: 13px; }
.pct-up { color: var(--up); font-weight: 600; }
.pct-down { color: var(--down); font-weight: 600; }
.pct-flat { color: var(--ink-muted); font-weight: 600; }
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.kpi-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 15px 17px; box-shadow: var(--shadow); }
.kpi-label { font-size: 12px; color: var(--ink-muted); font-weight: 600; margin-bottom: 6px; }
.kpi-value { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.kpi-sub { margin-top: 5px; font-size: 12px; color: var(--ink-secondary); }
.alerts-panel { display: grid; gap: 10px; }
.alert-banner { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 16px; border-radius: var(--radius-sm); border: 1px solid var(--buy-border); background: var(--buy-bg); }
.alert-banner.is-watch { border-color: var(--watch-border); background: var(--watch-bg); }
.alert-banner.is-empty { border-color: var(--border); background: var(--surface); color: var(--ink-secondary); }
.alert-left { display: flex; flex-direction: column; gap: 2px; }
.alert-title { font-weight: 700; font-size: 13.5px; color: var(--ink); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.alert-module { font-size: 11px; padding: 1px 7px; border-radius: 5px; background: var(--surface); border: 1px solid var(--border); color: var(--ink-secondary); font-weight: 700; }
.alert-detail { font-size: 12.5px; color: var(--ink-secondary); }
.alert-action { font-size: 12px; font-weight: 700; color: var(--buy); background: var(--surface); border: 1px solid var(--buy-border); padding: 6px 11px; border-radius: 8px; white-space: nowrap; }
.alert-banner.is-watch .alert-action { color: var(--watch); border-color: var(--watch-border); }
.hl-price-strip { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 22px; padding: 12px 15px; border-radius: var(--radius-sm); background: var(--surface-muted); border: 1px solid var(--border-subtle); margin-bottom: 16px; }
.strip-item { display: flex; align-items: baseline; gap: 7px; }
.strip-label { font-size: 12px; color: var(--ink-muted); }
.strip-val { font-size: 16px; font-weight: 700; }
.strip-note { margin-left: auto; font-size: 12px; color: var(--watch); background: var(--watch-bg); border: 1px solid var(--watch-border); padding: 3px 10px; border-radius: 99px; font-weight: 600; }
.hl-metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric-tile { padding: 14px 15px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-muted); }
.metric-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 8px; }
.metric-name { font-size: 12px; font-weight: 600; color: var(--ink-secondary); }
.metric-val { font-size: 23px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
.metric-bar-track { position: relative; height: 7px; border-radius: 99px; background: var(--border); margin: 10px 0 7px; overflow: visible; }
.metric-bar-fill { height: 100%; border-radius: 99px; transition: width 0.4s ease; }
.metric-bar-marker { position: absolute; top: -3px; width: 2px; height: 13px; background: var(--ink); border-radius: 2px; }
.metric-foot { font-size: 11.5px; color: var(--ink-muted); display: flex; justify-content: space-between; gap: 6px; }
.charts-row { display: grid; grid-template-columns: 1.65fr 1fr; gap: 16px; margin-bottom: 16px; }
.chart-box { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 15px 10px; background: var(--surface); }
.chart-compact { margin-top: 12px; margin-bottom: 12px; }
.chart-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.chart-title { font-size: 13px; font-weight: 700; }
.chart-sub { font-size: 11.5px; color: var(--ink-muted); }
.chart-legend { display: flex; align-items: center; gap: 12px; font-size: 11px; color: var(--ink-muted); }
.legend-item { display: inline-flex; align-items: center; gap: 5px; }
.swatch { display: inline-block; width: 12px; height: 3px; border-radius: 2px; }
.sw-primary { background: var(--accent); }
.sw-amber { background: #d97706; }
.sw-green { background: #059669; }
.svg-chart-wrap { position: relative; width: 100%; height: 215px; }
.svg-chart-sm { height: 155px; }
.svg-chart-wrap svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart-tooltip { position: absolute; pointer-events: none; background: var(--ink); color: var(--surface); font-size: 11.5px; padding: 6px 9px; border-radius: 7px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22); white-space: nowrap; z-index: 10; opacity: 0; transition: opacity 0.1s ease; }
.bond-foot { margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--border-subtle); display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--ink-secondary); flex-wrap: wrap; }
.advice-bar { padding: 12px 15px; border-radius: var(--radius-sm); background: var(--surface-muted); border-left: 4px solid var(--accent); font-size: 13px; color: var(--ink-secondary); }
.advice-bar.signal-buy { border-left-color: var(--buy); background: var(--buy-bg); color: var(--ink); }
.advice-bar.signal-watch { border-left-color: var(--watch); background: var(--watch-bg); color: var(--ink); }
.advice-bar.signal-avoid { border-left-color: var(--avoid); background: var(--avoid-bg); color: var(--ink); }
.advice-bar.compact { font-size: 12.5px; padding: 10px 13px; }
.etf-list { display: grid; gap: 10px; }
.etf-row { padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-muted); }
.etf-row.is-buy { border-color: var(--buy-border); background: var(--buy-bg); }
.etf-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.etf-name { font-weight: 700; font-size: 13.5px; }
.etf-code { font-size: 12px; color: var(--ink-muted); margin-left: 6px; }
.etf-note { font-size: 11.5px; color: var(--ink-muted); }
.etf-nums { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 12.5px; margin-bottom: 8px; }
.prem-meter { position: relative; height: 7px; border-radius: 99px; background: linear-gradient(90deg, #10b981 0%, #10b981 20%, #f59e0b 20%, #f59e0b 30%, #f43f5e 30%, #e11d48 100%); opacity: 0.85; }
.prem-dot { position: absolute; top: 50%; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 3px solid var(--ink); transform: translate(-50%, -50%); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25); }
.prem-scale { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--ink-muted); margin-top: 4px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th { text-align: left; font-size: 11.5px; color: var(--ink-muted); font-weight: 600; padding: 8px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 9px 8px; border-bottom: 1px solid var(--border-subtle); vertical-align: middle; }
td.nowrap { white-space: nowrap; }
tr:last-child td { border-bottom: none; }
.plan-tag { display: inline-block; font-size: 10.5px; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 1px 6px; border-radius: 4px; margin-left: 4px; }
.card-footnote { margin-top: 12px; font-size: 12px; color: var(--ink-muted); }
.mini-stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.mini-stat { padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-muted); }
.mini-stat-label { font-size: 11px; color: var(--ink-muted); }
.mini-stat-val { font-size: 17px; font-weight: 800; margin-top: 2px; }
.crash-list { display: grid; gap: 10px; }
.crash-item { padding: 11px 13px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-muted); }
.crash-item.is-buy { border-color: var(--buy-border); background: var(--buy-bg); }
.crash-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.crash-title { font-weight: 700; font-size: 13.5px; }
.crash-region { font-size: 11.5px; color: var(--ink-muted); margin-left: 6px; }
.crash-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--ink-secondary); margin-bottom: 7px; flex-wrap: wrap; }
.dd-track { position: relative; height: 7px; border-radius: 99px; background: var(--border); overflow: visible; }
.dd-fill { height: 100%; border-radius: 99px; }
.dd-mark { position: absolute; top: -3px; width: 2px; height: 13px; background: var(--ink-muted); }
.discipline-list { margin: 0; padding-left: 18px; display: grid; gap: 10px; font-size: 13px; color: var(--ink-secondary); }
.discipline-list strong { color: var(--ink); }
.footer { border-top: 1px solid var(--border); padding: 16px 0 28px; font-size: 12px; color: var(--ink-muted); }
.footer-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 60; background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: 10px; font-size: 13px; font-weight: 600; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22); opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity 0.2s ease, transform 0.2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.modal-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(15, 23, 42, 0.52); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; }
.modal-backdrop[hidden] { display: none; }
.modal { width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 20px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28); }
.modal-header { display: flex; align-items: center; justify-content: space-between; }
.modal-header h3 { margin: 0; font-size: 16px; }
.icon-btn { border: none; background: transparent; color: var(--ink-muted); font-size: 24px; cursor: pointer; line-height: 1; }
.modal-desc { margin: 6px 0 14px; font-size: 12.5px; color: var(--ink-muted); }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 12px; font-weight: 600; color: var(--ink-secondary); }
.field input { width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-muted); color: var(--ink); font-family: var(--font-mono); font-size: 13px; }
.modal-footer { margin-top: 18px; display: flex; justify-content: flex-end; gap: 8px; }
@media (max-width: 980px) { .summary-grid, .hl-metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .charts-row, .two-col { grid-template-columns: 1fr; } .strip-note { margin-left: 0; } }
@media (max-width: 600px) { .container { padding: 0 14px; } .card { padding: 15px; } .mini-stats-grid, .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hide-sm { display: none; } .alert-banner { flex-direction: column; align-items: flex-start; } .alert-action { white-space: normal; } }