:root {
  --bg: #07100e;
  --panel: #0c1916;
  --panel-2: #10221d;
  --line: rgba(167, 224, 203, .13);
  --text: #eef8f3;
  --muted: #91aaa0;
  --mint: #6ee7b7;
  --amber: #f5c56a;
  --red: #fb8b86;
  --blue: #82c8ff;
  --shadow: 0 20px 60px rgba(0, 0, 0, .24);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 280px;
  color: var(--text);
  background:
    radial-gradient(circle at 82% 2%, rgba(36, 153, 112, .18), transparent 30rem),
    radial-gradient(circle at 8% 40%, rgba(245, 197, 106, .07), transparent 26rem),
    var(--bg);
  font: 15px/1.55 Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

.research-notice {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 10px 20px;
  color: #15352b;
  background: linear-gradient(90deg, #8df0c8, #d9f7a8);
  text-align: center;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: .02em;
}

.site-header, .meta-strip, .primary-nav, main, footer {
  width: min(1460px, calc(100% - 40px));
  margin-inline: auto;
}
.site-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  padding: 48px 0 26px;
}
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 4px; font-size: clamp(34px, 5vw, 62px); line-height: 1.02; letter-spacing: -.045em; }
h2 { margin-bottom: 0; font-size: clamp(24px, 3vw, 36px); letter-spacing: -.025em; }
h3 { margin-bottom: 10px; font-size: 18px; }
.eyebrow { margin-bottom: 8px; color: var(--mint); font-size: 11px; font-weight: 800; letter-spacing: .18em; }
.subtitle, .muted { color: var(--muted); }
.subtitle { margin: 0; }
.health-pill { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 999px; padding: 9px 14px; background: rgba(8, 20, 17, .72); font-size: 13px; }
.health-pill.ready { color: var(--mint); border-color: rgba(110, 231, 183, .34); }
.health-pill.alert { color: var(--amber); border-color: rgba(245, 197, 106, .35); }

.meta-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(12, 25, 22, .7);
  box-shadow: var(--shadow);
}
.meta-strip > div { min-width: 0; padding: 15px 18px; border-right: 1px solid var(--line); }
.meta-strip > div:last-child { border-right: 0; }
.meta-strip span { display: block; color: var(--muted); font-size: 11px; }
.meta-strip strong { display: block; overflow: hidden; margin-top: 4px; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }

.primary-nav { display: flex; gap: 8px; overflow-x: auto; padding: 22px 0 10px; scrollbar-width: none; }
.primary-nav a { flex: 0 0 auto; padding: 10px 16px; border: 1px solid transparent; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 700; }
.primary-nav a:hover, .primary-nav a.active { color: var(--text); border-color: var(--line); background: var(--panel-2); }

main { min-height: 58vh; padding: 14px 0 80px; }
.page { display: none; animation: rise .24s ease-out; }
.page.active { display: block; }
@keyframes rise { from { transform: translateY(5px); opacity: .5; } }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 28px; margin: 28px 0 20px; }
.section-heading.compact { margin-top: 52px; }
.section-heading .eyebrow { margin-bottom: 5px; }
.state-message { margin: 0; color: var(--muted); text-align: right; }
.warning, .empty-state { margin: 16px 0; padding: 18px 20px; border: 1px solid rgba(245, 197, 106, .3); border-radius: 14px; color: #f9d99a; background: rgba(92, 62, 12, .16); }

.candidate-grid, .event-grid, .review-grid, .history-grid, .guide-grid { display: grid; gap: 16px; }
.candidate-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.event-grid, .history-grid, .guide-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.review-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.candidate-card, .event-card, .review-card, .history-card, .guide-card, .boundary-note {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(155deg, rgba(18, 39, 33, .94), rgba(9, 21, 18, .94));
  box-shadow: var(--shadow);
}
.candidate-card { padding: 22px; }
.event-card, .history-card, .guide-card { padding: 20px; }
.review-card { padding: 22px; }
.card-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.rank { display: inline-grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; color: #0c2c22; background: var(--mint); font-weight: 900; }
.stock-title { min-width: 0; flex: 1; }
.stock-title h3 { margin-bottom: 1px; overflow-wrap: anywhere; }
.stock-title p { margin: 0; color: var(--muted); font-variant-numeric: tabular-nums; }
.score { text-align: right; }
.score strong { display: block; color: var(--mint); font-size: 28px; line-height: 1; }
.score span { color: var(--muted); font-size: 11px; }
.metric-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; overflow: hidden; margin: 18px 0; border: 1px solid var(--line); border-radius: 13px; background: var(--line); }
.metric { min-width: 0; padding: 11px 12px; background: var(--panel); }
.metric span { display: block; color: var(--muted); font-size: 11px; }
.metric strong { display: block; overflow-wrap: anywhere; margin-top: 3px; font-size: 14px; font-variant-numeric: tabular-nums; }
.risk-bar { height: 7px; overflow: hidden; margin: 8px 0 5px; border-radius: 999px; background: rgba(255,255,255,.07); }
.risk-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--mint), var(--amber), var(--red)); }
.inline-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.tag { padding: 4px 8px; border-radius: 999px; color: var(--mint); background: rgba(110, 231, 183, .09); font-size: 11px; }
.tag.warn { color: var(--amber); background: rgba(245, 197, 106, .1); }
.tag.risk { color: var(--red); background: rgba(251, 139, 134, .1); }
.detail-block { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 12px; }
details { border-top: 1px solid var(--line); padding: 12px 0 0; }
details + details { margin-top: 10px; }
summary { cursor: pointer; color: var(--blue); font-weight: 700; }
ul.clean { margin: 8px 0 0; padding-left: 18px; color: var(--muted); }
ul.clean li { margin: 4px 0; }
.breakdown-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line); color: var(--muted); }
.breakdown-row:last-child { border-bottom: 0; }
.breakdown-row b { color: var(--text); font-variant-numeric: tabular-nums; }
.event-card.keep { border-top: 2px solid var(--mint); }
.event-card.reject { border-top: 2px solid var(--red); }
.event-card.replacement { border-top: 2px solid var(--blue); }
.event-card .action { color: var(--amber); font-size: 18px; font-weight: 850; }
.summary-row { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 16px; }
.summary-chip { padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--muted); }
.summary-chip b { color: var(--text); }
.review-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; overflow: hidden; margin-top: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--line); }
.history-card .big-number { color: var(--mint); font-size: 36px; line-height: 1; }
.history-card .metric-grid { grid-template-columns: 1fr; }
.guide-card .step { display: block; margin-bottom: 25px; color: var(--mint); font: 800 12px/1 ui-monospace, monospace; }
.guide-card p, .boundary-note p { margin-bottom: 0; color: var(--muted); }
.boundary-note { margin-top: 16px; padding: 22px; }
footer { padding: 24px 0 36px; border-top: 1px solid var(--line); color: var(--muted); text-align: center; font-size: 12px; }

@media (max-width: 1100px) {
  .meta-strip { grid-template-columns: repeat(3, 1fr); }
  .meta-strip > div { border-bottom: 1px solid var(--line); }
  .candidate-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .event-grid, .history-grid, .guide-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .site-header, .meta-strip, .primary-nav, main, footer { width: min(100% - 24px, 1460px); }
  .site-header { display: block; padding-top: 30px; }
  .health-pill { display: inline-block; margin-top: 18px; }
  .meta-strip { grid-template-columns: 1fr 1fr; }
  .meta-strip > div { border-right: 1px solid var(--line); }
  .meta-strip > div:nth-child(even) { border-right: 0; }
  .meta-strip > div:last-child { grid-column: 1 / -1; }
  .section-heading { display: block; }
  .state-message { margin-top: 10px; text-align: left; }
  .candidate-grid, .event-grid, .review-grid, .history-grid, .guide-grid { grid-template-columns: minmax(0, 1fr); }
  .candidate-card, .review-card { padding: 18px; }
  .review-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  h1 { font-size: 39px; }
}
