:root {
  color-scheme: dark;
  --bg: #090d0f;
  --panel: rgba(16, 22, 24, .92);
  --panel-solid: #111819;
  --line: rgba(148, 163, 184, .22);
  --text: #e5edf8;
  --muted: #90a0b8;
  --accent: #22c55e;
  --accent-2: #38bdf8;
  --danger: #ef4444;
  --warning: #f59e0b;
  --shadow: 0 24px 70px rgba(0, 0, 0, .34);
  --radius: 10px;
  --radius-sm: 8px;
  --font-num: "SF Mono", "JetBrains Mono", "DIN Alternate", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(180deg, #0b1114 0, var(--bg) 430px),
    var(--bg);
  color: var(--text);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  letter-spacing: 0;
  -webkit-tap-highlight-color: transparent;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
body.light {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: rgba(255, 255, 255, .9);
  --panel-solid: #ffffff;
  --line: rgba(15, 23, 42, .14);
  --text: #101827;
  --muted: #64748b;
  --shadow: 0 18px 50px rgba(15, 23, 42, .12);
}

button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: progress; opacity: .66; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}
.app-shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; }

.sidebar-top { display: contents; }
.nav-close { display: none; }
.nav-overlay {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(2, 6, 23, .62);
  backdrop-filter: blur(4px);
  opacity: 0; transition: opacity .22s ease;
}
.nav-overlay.is-open { opacity: 1; }
.mobile-bottom-nav { display: none; }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  background: rgba(4, 10, 20, .94);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 28px;
  z-index: 5;
}
body.light .sidebar { background: #0f172a; color: #f8fafc; }
.brand { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 8px;
  display: grid; place-items: center;
  color: #02110a; background: linear-gradient(135deg, #67e8f9, #22c55e);
  font-weight: 900;
}
.brand strong, .brand small { display: block; }
.brand small { color: #94a3b8; margin-top: 2px; font-size: 12px; }
nav { display: grid; gap: 6px; }
nav a {
  color: #cbd5e1; text-decoration: none; padding: 12px 14px; border-radius: 8px;
  border: 1px solid transparent;
  font-size: 14px;
}
nav a:hover, nav a.active { background: rgba(34, 197, 94, .12); border-color: rgba(34, 197, 94, .22); color: #f8fafc; }
.source-card {
  margin-top: auto; padding: 14px; border-radius: 8px; border: 1px solid rgba(148, 163, 184, .2);
  background: rgba(15, 23, 42, .72); display: flex; gap: 10px; align-items: flex-start;
}
.source-card small { color: #94a3b8; display: block; margin-top: 4px; line-height: 1.45; }
.status-dot { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 999px; background: var(--accent); margin-top: 5px; box-shadow: 0 0 0 5px rgba(34, 197, 94, .14); }

.site-footer {
  margin-top: auto;
  padding: 20px clamp(18px, 4vw, 48px) calc(24px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(4, 10, 20, .55);
}
body.light .site-footer { background: rgba(15, 23, 42, .04); }
.site-footer-inner {
  display: grid; gap: 8px;
  color: var(--muted); font-size: 12px; line-height: 1.55;
}
.site-footer-meta {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px 16px;
}
.site-disclaimer { margin: 0; opacity: .92; }
.site-version {
  font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--text); opacity: .72;
}
.site-copyright { opacity: .85; }

.risk-disclaimer {
  position: sticky; bottom: calc(56px + env(safe-area-inset-bottom));
  z-index: 20; margin: 0 clamp(18px, 4vw, 48px) 12px; padding: 14px 16px;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  border: 1px solid rgba(245, 158, 11, .35); border-radius: 10px;
  background: rgba(15, 23, 42, .94); box-shadow: var(--shadow);
}
body.light .risk-disclaimer { background: rgba(255, 255, 255, .96); }
.risk-disclaimer-body { min-width: 0; }
.risk-disclaimer strong { display: block; margin-bottom: 6px; color: #fde68a; font-size: 13px; }
.risk-disclaimer p { margin: 0; color: var(--text); font-size: 13px; line-height: 1.55; }
.risk-disclaimer em { font-style: normal; color: #fecaca; font-weight: 700; }
.risk-disclaimer .ghost-btn { flex: 0 0 auto; min-height: 40px; white-space: nowrap; }
.risk-disclaimer[hidden] { display: none !important; }

.source-attribution { margin-top: 16px; }
.source-attribution table {
  width: 100%; border-collapse: collapse; font-size: 13px;
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
}
.source-attribution th, .source-attribution td {
  padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top;
}
.source-attribution thead th { background: rgba(148, 163, 184, .08); color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.source-attribution tbody tr:last-child th, .source-attribution tbody tr:last-child td { border-bottom: 0; }
.source-attribution tbody th { font-weight: 700; color: var(--text); width: 88px; }
.source-legal { margin: 12px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.source-status {
  display: inline-flex; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700;
}
.source-status.live { color: #bbf7d0; background: rgba(34, 197, 94, .16); border: 1px solid rgba(34, 197, 94, .28); }
.source-status.warn { color: #fde68a; background: rgba(245, 158, 11, .14); border: 1px solid rgba(245, 158, 11, .28); }
.source-status.down { color: #fecaca; background: rgba(239, 68, 68, .14); border: 1px solid rgba(239, 68, 68, .28); }

main { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
#overview, #screener, #reports, #alerts, #sources { scroll-margin-top: 16px; scroll-margin-bottom: 80px; }
.hero {
  position: relative; min-height: clamp(420px, 52vh, 590px); overflow: hidden; display: flex; align-items: stretch;
}
.hero-backdrop {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 78% 22%, rgba(56, 189, 248, .22), transparent 42%),
    radial-gradient(circle at 18% 78%, rgba(34, 197, 94, .14), transparent 38%),
    linear-gradient(135deg, #0b1220 0%, #111827 42%, #0f172a 100%);
}
.hero-backdrop::after {
  content: ""; position: absolute; inset: 0; opacity: .35;
  background-image:
    linear-gradient(rgba(148, 163, 184, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, .08) 1px, transparent 1px);
  background-size: 48px 48px;
}
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(2, 6, 23, .94), rgba(2, 6, 23, .72) 45%, rgba(2, 6, 23, .28)); }
body.light .hero-overlay { background: linear-gradient(90deg, rgba(7, 13, 26, .92), rgba(7, 13, 26, .62) 44%, rgba(7, 13, 26, .22)); }
.hero-content { position: relative; z-index: 1; width: 100%; padding: 22px clamp(20px, 4vw, 48px) 42px; display: flex; flex-direction: column; }
.topbar { display: flex; justify-content: flex-end; gap: 10px; align-items: center; }
.market-status {
  min-height: 48px; max-width: min(520px, 62vw); border: 1px solid rgba(226, 232, 240, .2);
  background: rgba(8, 15, 28, .78); border-radius: 8px; padding: 8px 12px;
  display: flex; align-items: flex-start; gap: 10px; color: #f8fafc;
}
.market-status strong, .market-status small { display: block; }
.market-status small { color: #a8b6ca; margin-top: 2px; line-height: 1.35; font-size: 12px; }
.icon-btn, .ghost-btn {
  border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 8px; min-height: 44px;
}
.icon-btn { width: 44px; font-size: 18px; }
.is-loading #refreshBtn { animation: spinPulse 1s linear infinite; }
.ghost-btn { padding: 0 14px; }
.hero-copy { max-width: 720px; margin-top: auto; padding-bottom: 20px; }
.eyebrow, .section-kicker { color: var(--accent-2); text-transform: uppercase; font-size: 11px; font-weight: 800; letter-spacing: .06em; }
h1 { font-size: clamp(28px, 4.5vw, 52px); line-height: 1.1; max-width: 720px; margin: 12px 0 14px; letter-spacing: -.01em; font-weight: 800; }
.hero p { max-width: 560px; color: #cad5e5; font-size: 16px; line-height: 1.7; margin: 0 0 14px; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.hero-chips span {
  padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 600;
  border: 1px solid rgba(56, 189, 248, .28); background: rgba(56, 189, 248, .08); color: #bae6fd;
}
.semantic-search {
  width: min(980px, 100%); min-height: 66px; display: grid; grid-template-columns: minmax(0, 1fr) 140px; gap: 10px;
  padding: 10px; border: 1px solid rgba(226, 232, 240, .22); background: rgba(15, 23, 42, .86); border-radius: 8px;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.semantic-search.is-searching {
  border-color: rgba(56, 189, 248, .45);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, .12);
}
.semantic-search input { border: 0; outline: 0; background: #0b1220; color: #f8fafc; border-radius: 6px; padding: 0 16px; min-width: 0; transition: opacity .2s ease; }
.semantic-search.is-searching input { opacity: .72; cursor: wait; }
.semantic-search button {
  border: 0; color: #04130a; background: var(--accent); border-radius: 6px; font-weight: 800;
  min-height: 48px; touch-action: manipulation;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.semantic-search button:disabled { opacity: .88; cursor: wait; }
.semantic-search .btn-spinner,
.semantic-feedback .semantic-spinner {
  width: 15px; height: 15px; flex: 0 0 auto;
  border: 2px solid rgba(4, 19, 10, .18); border-top-color: #04130a;
  border-radius: 50%; animation: spinPulse .75s linear infinite;
}
.semantic-feedback {
  margin: 10px 0 0; padding: 10px 14px; border-radius: var(--radius-sm);
  border: 1px solid rgba(34, 197, 94, .35); background: rgba(34, 197, 94, .1);
  color: #bbf7d0; font-size: 13px; line-height: 1.5;
}
.semantic-feedback.is-loading {
  display: flex; align-items: center; gap: 10px;
  border-color: rgba(56, 189, 248, .38); background: rgba(56, 189, 248, .1); color: #bae6fd;
}
.semantic-feedback.is-loading .semantic-spinner {
  border-color: rgba(186, 230, 253, .25); border-top-color: #bae6fd;
}
.semantic-feedback.is-warning {
  border-color: rgba(245, 158, 11, .4); background: rgba(245, 158, 11, .1); color: #fde68a;
}
body.light .semantic-feedback { color: #166534; background: rgba(34, 197, 94, .12); }
body.light .semantic-feedback.is-warning { color: #92400e; background: rgba(245, 158, 11, .12); }
.filter-toolbar.is-highlight { animation: filterPulse 1.2s ease; }
@keyframes filterPulse {
  0%, 100% { box-shadow: none; }
  40% { box-shadow: 0 0 0 2px rgba(56, 189, 248, .45); }
}
.mobile-status { display: none; }

.market-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 16px clamp(18px, 4vw, 48px); background: rgba(8, 15, 28, .82); border-block: 1px solid var(--line); }
.index-card {
  min-height: 108px; padding: 14px 16px; border: 1px solid var(--line);
  background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 4px;
}
.index-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.index-card-top span { color: var(--muted); font-size: 13px; line-height: 1.3; }
.index-card em { font-style: normal; font-size: 11px; opacity: .8; }
.index-card-body { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 4px; }
.index-card strong {
  display: block; font-size: 26px; font-family: var(--font-num);
  font-variant-numeric: tabular-nums; letter-spacing: -.02em; margin: 0;
}
.change-pill {
  display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 6px;
  font-size: 13px; font-weight: 700; font-family: var(--font-num); font-variant-numeric: tabular-nums;
}
.change-pill.up { color: #fecaca; background: rgba(239, 68, 68, .18); }
.change-pill.down { color: #bbf7d0; background: rgba(34, 197, 94, .18); }
.index-card small { color: var(--muted); font-size: 12px; margin-top: auto; }
.skeleton-card span, .skeleton-card strong, .skeleton-card small, .skeleton-row span {
  display: block; border-radius: 999px; background: rgba(148, 163, 184, .18);
}
.skeleton-card span { width: 45%; height: 14px; }
.skeleton-card strong { width: 68%; height: 30px; margin: 18px 0 12px; }
.skeleton-card small { width: 38%; height: 12px; }
.skeleton-row td { height: 56px; }
.skeleton-row span { width: min(520px, 74%); height: 16px; }
.up { color: #ef4444; }
.down { color: #22c55e; }

.workspace { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; padding: 20px clamp(18px, 4vw, 48px) 40px; align-items: start; }
.workspace-zone-head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 6px 16px; padding: 4px 2px 2px; border-bottom: 1px solid var(--line); margin-bottom: -4px;
}
.zone-title { margin: 0; font-size: 15px; font-weight: 800; letter-spacing: .02em; }
.zone-desc { margin: 0; color: var(--muted); font-size: 13px; }
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); min-width: 0;
}
.panel-primary { border-top: 2px solid rgba(56, 189, 248, .45); }
.panel-accent { border-top: 2px solid rgba(34, 197, 94, .45); }
.panel-risk { border-top: 2px solid rgba(239, 68, 68, .4); }
.panel-muted { background: rgba(148, 163, 184, .04); box-shadow: none; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.panel-head-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; flex-shrink: 0; }
.panel-desc { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; max-width: 420px; }
.panel-meta {
  display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
  border: 1px solid var(--line); background: rgba(148, 163, 184, .1); color: var(--muted); white-space: nowrap;
}
h2 { margin: 4px 0 0; font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.segmented { display: flex; gap: 3px; padding: 3px; border-radius: var(--radius-sm); background: rgba(148, 163, 184, .1); }
.segmented button { min-width: 52px; height: 34px; border: 0; border-radius: 6px; color: var(--muted); background: transparent; font-size: 13px; font-weight: 600; }
.segmented button.active { background: var(--panel-solid); color: var(--text); border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.filter-toolbar, .filter-grid { display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 10px; margin-bottom: 14px; padding: 12px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: rgba(148, 163, 184, .05); }
.focus-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-bottom: 10px; padding: 10px 12px; border-radius: var(--radius-sm);
  border: 1px solid rgba(56, 189, 248, .22); background: rgba(56, 189, 248, .06);
}
.focus-label { font-size: 12px; font-weight: 700; color: var(--accent-2); white-space: nowrap; }
.focus-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.focus-chips button {
  border: 1px solid var(--line); background: var(--panel-solid); color: var(--muted);
  border-radius: 999px; padding: 6px 12px; font-size: 12px; font-weight: 600; min-height: 32px;
  touch-action: manipulation;
}
.focus-chips button.active {
  color: #ecfdf5; border-color: rgba(34, 197, 94, .45);
  background: rgba(34, 197, 94, .22); box-shadow: inset 0 0 0 1px rgba(34, 197, 94, .15);
}
.focus-chips button[data-focus-sector="半导体"].active {
  border-color: rgba(56, 189, 248, .5); background: rgba(56, 189, 248, .18); color: #e0f2fe;
}
.pick-badge {
  display: inline-flex; align-items: center; margin-left: 6px; padding: 1px 7px;
  border-radius: 4px; font-size: 10px; font-weight: 800; vertical-align: middle;
  color: #e0f2fe; background: rgba(56, 189, 248, .18); border: 1px solid rgba(56, 189, 248, .35);
}
.filter-hint { display: block; margin-top: 4px; font-size: 11px; font-weight: 500; color: var(--accent-2); line-height: 1.4; }
.filter-toolbar label, .filter-grid label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 600; }
.filter-grid select, .filter-grid input { min-height: 40px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-solid); color: var(--text); padding: 0 10px; }
.range-field { display: flex; align-items: center; gap: 10px; }
.range-field input[type="range"] { flex: 1; min-width: 0; padding: 0; accent-color: var(--accent); }
.range-field output {
  min-width: 36px; text-align: center; font-weight: 800; color: var(--accent);
  font-size: 14px; font-variant-numeric: tabular-nums;
}

.stock-cards { display: none; }
.stock-card {
  padding: 14px; border: 1px solid var(--line); border-radius: var(--radius);
  background: rgba(148, 163, 184, .06); transition: border-color .12s ease, box-shadow .12s ease;
}
.stock-card.is-selected { border-color: rgba(34, 197, 94, .45); box-shadow: inset 3px 0 0 var(--accent); }
.stock-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.stock-card-head strong { font-size: 16px; }
.stock-card-head small { display: block; color: var(--muted); margin-top: 2px; font-size: 12px; }
.stock-card-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px;
  margin-bottom: 12px;
}
.stock-card-grid div { display: grid; gap: 3px; }
.stock-card-grid dt { color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stock-card-grid dd { margin: 0; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stock-card-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.stock-card-foot .row-action { flex: 1; min-height: 44px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; -webkit-overflow-scrolling: touch; }
.table-wrap:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { text-align: left; padding: 13px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { position: sticky; top: 0; z-index: 1; background: var(--panel-solid); color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
th.col-num, td.col-num { text-align: right; font-family: var(--font-num); font-variant-numeric: tabular-nums; }
tbody tr { transition: background .12s ease; cursor: pointer; }
tbody tr:hover { background: rgba(56, 189, 248, .06); }
.stock-card { cursor: pointer; }
.stock-card:hover { border-color: rgba(56, 189, 248, .35); }
tbody tr.is-selected { background: rgba(34, 197, 94, .08); box-shadow: inset 3px 0 0 var(--accent); }
tbody tr.is-selected td:first-child strong { color: var(--accent); }
tbody tr:last-child td { border-bottom: 0; }
td small { display: block; color: var(--muted); margin-top: 2px; }
.empty-state { text-align: center; padding: 34px 10px; }
.empty-state strong, .empty-state small { display: block; }
.empty-state small { margin-top: 8px; }
.score-pill { display: inline-grid; place-items: center; min-width: 40px; height: 28px; border-radius: 999px; color: #05210f; background: var(--accent); font-weight: 900; font-size: 13px; font-variant-numeric: tabular-nums; }
.advice-badge {
  display: inline-flex; align-items: center; justify-content: center; min-height: 32px; padding: 0 12px;
  border-radius: 6px; font-size: 12px; font-weight: 700; border: 1px solid transparent; white-space: nowrap;
}
.advice-badge.buy { color: #fecaca; background: rgba(239, 68, 68, .12); border-color: rgba(239, 68, 68, .35); }
.advice-badge.hold { color: #bae6fd; background: rgba(56, 189, 248, .1); border-color: rgba(56, 189, 248, .35); }
.advice-badge.watch { color: #fde68a; background: rgba(245, 158, 11, .1); border-color: rgba(245, 158, 11, .35); }
.advice-badge.avoid { color: #cbd5e1; background: rgba(148, 163, 184, .1); border-color: rgba(148, 163, 184, .3); }
.risk-tag { display: inline-block; padding: 2px 7px; border-radius: 4px; font-size: 10px; font-weight: 700; margin-left: 6px; vertical-align: middle; }
.risk-tag.high { color: #fecaca; background: rgba(239, 68, 68, .15); }
.risk-tag.medium { color: #fde68a; background: rgba(245, 158, 11, .15); }
.risk-tag.low { color: #bbf7d0; background: rgba(34, 197, 94, .15); }
.row-action { border: 1px solid rgba(56, 189, 248, .4); color: var(--accent-2); background: rgba(56, 189, 248, .1); border-radius: 6px; min-height: 44px; padding: 0 14px; touch-action: manipulation; font-size: 12px; font-weight: 700; }

.decision-panel { position: sticky; top: 16px; align-self: start; }
.decision-stock-bar {
  padding: 12px 14px; margin-bottom: 14px; border-radius: var(--radius-sm);
  border: 1px solid rgba(34, 197, 94, .28); background: rgba(34, 197, 94, .06);
}
.decision-stock-bar.is-empty { border-color: var(--line); background: rgba(148, 163, 184, .06); }
.decision-stock-label { display: block; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.decision-stock-bar strong { display: block; font-size: 17px; font-weight: 800; }
.decision-stock-bar small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.canvas-label { margin: 0 0 8px; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }

.guide-list { display: grid; gap: 10px; margin-bottom: 16px; }
.guide-list article { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; align-items: start; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: rgba(148, 163, 184, .08); }
.guide-list article.empty-state {
  display: block;
  text-align: center;
  padding: 24px 14px;
}
.guide-list article.empty-state span {
  display: block;
  line-height: 1.6;
  color: var(--muted);
  word-break: break-word;
}
.guide-list b { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 999px; background: rgba(34, 197, 94, .18); color: var(--accent); flex-shrink: 0; }
.guide-list span { line-height: 1.55; min-width: 0; word-break: break-word; }
canvas { width: 100%; min-height: 180px; height: auto; border: 1px solid var(--line); border-radius: 8px; background: rgba(15, 23, 42, .34); }

@keyframes spinPulse {
  to { transform: rotate(360deg); }
}

.feed, .report-list, .alert-list { display: grid; gap: 12px; }
.feed-item { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: rgba(148, 163, 184, .06); color: inherit; text-decoration: none; }
.feed-item time { color: var(--accent-2); font-weight: 800; font-size: 12px; font-family: var(--font-num); }
.feed-item strong, .feed-item span { display: block; }
.feed-item strong { font-size: 14px; line-height: 1.45; }
.feed-item span, .report-list small, .report-list span, .alert-list span { color: var(--muted); margin-top: 6px; font-size: 12px; }
.feed-item.high { border-left: 3px solid var(--danger); background: rgba(239, 68, 68, .06); }
.interactive-item { transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.interactive-item:hover {
  border-color: rgba(56, 189, 248, .5);
  background: rgba(56, 189, 248, .1);
  transform: translateY(-1px);
}
.interactive-item:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.report-list article, .report-list a, .alert-list article {
  padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: rgba(148, 163, 184, .06); color: inherit; text-decoration: none;
}
.report-list article div, .report-list a div { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.report-list p { margin: 8px 0; line-height: 1.5; font-size: 14px; }
.rating-chip {
  display: inline-flex; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 700;
  background: rgba(56, 189, 248, .12); color: var(--accent-2); border: 1px solid rgba(56, 189, 248, .25);
}
.alert-list article { display: grid; gap: 6px; }
.alert-list article.high { border-left: 3px solid var(--danger); background: rgba(239, 68, 68, .06); }
.alert-list article.medium { border-left: 3px solid var(--warning); background: rgba(245, 158, 11, .05); }
.alert-list article.watch { border-left: 3px solid var(--accent-2); background: rgba(56, 189, 248, .05); }
.alert-level {
  display: inline-flex; width: fit-content; padding: 2px 8px; border-radius: 4px;
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
}
.alert-level.high { color: #fecaca; background: rgba(239, 68, 68, .18); }
.alert-level.medium { color: #fde68a; background: rgba(245, 158, 11, .18); }
.alert-level.watch { color: #bae6fd; background: rgba(56, 189, 248, .16); }
.gateway-banner {
  margin-bottom: 14px; padding: 12px 14px; border-radius: 8px;
  border: 1px solid rgba(245, 158, 11, .35); background: rgba(245, 158, 11, .1);
  color: var(--text); font-size: 13px; line-height: 1.55;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.gateway-banner[hidden] { display: none !important; }
.gateway-banner-copy { min-width: 0; }
.gateway-banner strong { display: block; margin-bottom: 4px; color: #fde68a; }
.gateway-banner-detail { display: block; }
.gateway-banner code { font-size: 12px; padding: 1px 6px; border-radius: 4px; background: rgba(15, 23, 42, .5); }
.gateway-banner .ghost-btn { flex: 0 0 auto; min-height: 40px; white-space: nowrap; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.alert-list article strong { font-size: 14px; line-height: 1.4; }
.source-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.source-grid article { min-height: 118px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: rgba(148, 163, 184, .08); }
.source-grid strong, .source-grid span { display: block; }
.source-grid span { color: var(--muted); margin-top: 10px; line-height: 1.6; }

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: sticky; height: auto; padding: 12px 16px; flex-direction: row;
    align-items: center; gap: 12px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  }
  .sidebar-top { display: contents; }
  .source-card { display: none; }
  nav#mainNav { grid-auto-flow: column; grid-auto-columns: max-content; display: grid; flex-shrink: 0; }
  .span-3, .span-4, .span-5, .span-7, .span-8 { grid-column: span 12; }
  .decision-panel { position: static; }
  .market-strip { grid-template-columns: repeat(2, 1fr); }
  .source-grid { grid-template-columns: repeat(2, 1fr); }
  h1 { font-size: clamp(32px, 5vw, 48px); }
  .market-status { max-width: min(460px, 55vw); }
}

@media (max-width: 720px) {
  body {
    background: var(--bg);
    padding-bottom: calc(64px + env(safe-area-inset-bottom));
  }
  .app-shell { display: block; }

  .sidebar {
    position: fixed; top: 0; right: 0; bottom: 0; left: auto;
    width: min(300px, 88vw); height: 100dvh; padding: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    transform: translateX(100%); transition: transform .26s cubic-bezier(.4, 0, .2, 1);
    z-index: 50; overflow-y: auto; border-right: 0; border-left: 1px solid var(--line);
    box-shadow: -12px 0 40px rgba(0, 0, 0, .35);
  }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-top {
    display: flex; align-items: center; justify-content: space-between;
    padding: calc(14px + env(safe-area-inset-top)) 14px 14px;
    border-bottom: 1px solid var(--line);
  }
  .nav-close { display: inline-grid; }
  nav#mainNav {
    display: grid; grid-template-columns: 1fr; gap: 4px;
    padding: 12px; overflow: visible;
  }
  nav#mainNav a {
    min-height: 48px; display: flex; align-items: center;
    padding: 12px 14px; font-size: 15px; white-space: normal;
  }
  .source-card { display: flex; margin: 0 12px 12px; }

  .mobile-bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: rgba(4, 10, 20, .96);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(12px);
  }
  body.light .mobile-bottom-nav { background: rgba(255, 255, 255, .96); }
  .mobile-bottom-nav a,
  .mobile-menu-btn {
    display: grid; justify-items: center; gap: 2px;
    color: var(--muted); text-decoration: none; font-size: 11px;
    padding: 6px 2px; border: 0; background: transparent;
    border-radius: 8px; min-height: 48px; touch-action: manipulation;
  }
  .mobile-bottom-nav a.active,
  .mobile-menu-btn[aria-expanded="true"] {
    color: var(--accent); background: rgba(34, 197, 94, .1);
  }
  .nav-icon { font-size: 18px; line-height: 1; }

  .hero { min-height: auto; }
  .hero-content { padding: calc(10px + env(safe-area-inset-top)) 14px 20px; min-height: clamp(300px, 48vh, 420px); }
  .topbar { justify-content: flex-end; gap: 8px; }
  .market-status { display: none; }
  .semantic-search { grid-template-columns: 1fr; min-height: auto; }
  .semantic-search input, .semantic-search button { min-height: 48px; touch-action: manipulation; }
  .mobile-status {
    display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; padding: 10px 12px;
    border: 1px solid rgba(226, 232, 240, .2); border-radius: 8px;
    background: rgba(8, 15, 28, .78); color: #cbd5e1; font-size: 12px; line-height: 1.4;
  }
  .hero-copy { margin-top: auto; padding-bottom: 12px; }
  h1 { font-size: clamp(24px, 7vw, 34px); line-height: 1.15; margin: 10px 0 12px; }
  h2 { font-size: 18px; }
  .hero p { font-size: 15px; line-height: 1.65; }

  .market-strip {
    display: flex; gap: 10px; padding: 14px;
    overflow-x: auto; scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  .market-strip .index-card {
    flex: 0 0 min(78vw, 280px); scroll-snap-align: start;
    min-height: 100px;
  }
  .index-card strong { font-size: 22px; margin: 8px 0 4px; }

  .workspace { padding: 14px 14px 24px; gap: 14px; }
  .workspace-zone-head { margin-bottom: 0; padding-bottom: 8px; }
  .zone-title { font-size: 14px; }
  .zone-desc { font-size: 12px; }
  .panel { padding: 16px; border-radius: 10px; }
  .panel-head { align-items: flex-start; flex-direction: column; gap: 10px; margin-bottom: 14px; }
  .panel-head-actions { align-items: stretch; width: 100%; }
  .segmented {
    width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
  }
  .segmented button {
    flex: 1 0 auto; min-width: 64px; min-height: 40px;
    scroll-snap-align: start; touch-action: manipulation;
  }
  .filter-toolbar, .filter-grid { grid-template-columns: 1fr; gap: 14px; }
  .filter-grid select, .filter-grid input[type="range"] { min-height: 44px; }

  .stock-cards { display: grid; gap: 10px; }
  .table-wrap { display: none; }

  .report-list article div, .report-list a div { display: grid; gap: 4px; }
  .feed-item { grid-template-columns: 44px minmax(0, 1fr); padding: 12px; gap: 10px; }
  .feed-item time { font-size: 12px; }
  .source-grid { grid-template-columns: 1fr; }
  canvas { max-height: 200px; }

  .icon-btn, .ghost-btn { min-height: 44px; touch-action: manipulation; }
  .ghost-btn { min-height: 44px; padding: 0 16px; }

  .site-footer {
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    text-align: center;
  }
  .site-footer-meta { justify-content: center; flex-direction: column; gap: 4px; }
  .source-attribution { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .source-attribution table { min-width: 640px; }
  .risk-disclaimer { flex-direction: column; align-items: stretch; }
  .gateway-banner { flex-direction: column; align-items: stretch; }
}

@media (min-width: 721px) {
  .risk-disclaimer { bottom: 12px; }
}

@media (max-width: 360px) {
  .stock-card-grid { grid-template-columns: 1fr; }
  .mobile-bottom-nav a, .mobile-menu-btn { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sidebar, .nav-overlay { transition: none; }
  .interactive-item { transition: none; }
}
