:root {
  --chip-green: #17a368;
  --chip-blue: #2d63db;
  --chip-amber: #d07c00;
  --chip-cyan: #0f95b2;
  --chip-violet: #8250df;
  --chip-red: #d8413b;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg-top: #09111d;
  --bg-bottom: #111a2b;
  --panel: rgba(12, 19, 32, 0.84);
  --panel-strong: rgba(17, 25, 39, 0.95);
  --ink: #eef4ff;
  --muted: #a9b8ce;
  --line: rgba(148, 163, 184, 0.18);
  --border: rgba(148, 163, 184, 0.14);
  --shadow: 0 20px 48px rgba(0, 0, 0, 0.34);
  --shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.22);
  --panel-kicker: #95acff;
  --hero-meta-bg: linear-gradient(180deg, rgba(17, 25, 39, 0.92), rgba(9, 14, 24, 0.96));
  --status-border: rgba(251, 191, 36, 0.22);
  --status-bg: rgba(120, 53, 15, 0.26);
  --status-ink: #ffd596;
  --chip-bg: rgba(19, 28, 45, 0.88);
  --chip-border: rgba(96, 165, 250, 0.18);
  --chip-focus: rgba(96, 165, 250, 0.34);
  --chip-selected-border: rgba(125, 166, 255, 0.38);
  --chip-selected-shadow: 0 14px 28px rgba(52, 96, 192, 0.2);
  --plot-bg: rgba(12, 19, 32, 0.88);
  --metric-bg: rgba(16, 25, 40, 0.96);
  --range-band: rgba(96, 165, 250, 0.1);
  --grid-stroke: rgba(148, 163, 184, 0.18);
  --baseline-stroke: rgba(148, 163, 184, 0.3);
  --axis-text: #97a9c4;
  --band-label: rgba(191, 219, 254, 0.76);
  --axis-bg: rgba(17, 25, 39, 0.88);
  --event-line: rgba(96, 165, 250, 0.22);
  --dot-shadow: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.28));
  --series-shadow: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.34));
  --page-glow: rgba(59, 130, 246, 0.12);
  --button-bg: rgba(147, 197, 253, 0.12);
  --button-bg-hover: rgba(147, 197, 253, 0.18);
  --button-border: rgba(147, 197, 253, 0.22);
  --button-ink: #dbeafe;
}

[data-theme="light"] {
  color-scheme: light;
  --bg-top: #f4efe7;
  --bg-bottom: #edf3f9;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-strong: #ffffff;
  --ink: #1b2430;
  --muted: #5c6778;
  --line: rgba(110, 126, 149, 0.18);
  --border: rgba(255, 255, 255, 0.65);
  --shadow: 0 20px 48px rgba(25, 42, 70, 0.12);
  --shadow-soft: 0 10px 28px rgba(25, 42, 70, 0.08);
  --panel-kicker: #7a5f36;
  --hero-meta-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(244, 248, 253, 0.9));
  --status-border: rgba(216, 65, 59, 0.2);
  --status-bg: rgba(255, 244, 241, 0.92);
  --status-ink: #992e2a;
  --chip-bg: rgba(244, 247, 252, 0.92);
  --chip-border: rgba(45, 99, 219, 0.16);
  --chip-focus: rgba(45, 99, 219, 0.28);
  --chip-selected-border: rgba(34, 80, 175, 0.32);
  --chip-selected-shadow: 0 14px 28px rgba(34, 80, 175, 0.14);
  --plot-bg: rgba(255, 255, 255, 0.78);
  --metric-bg: rgba(245, 248, 252, 0.9);
  --range-band: rgba(45, 99, 219, 0.06);
  --grid-stroke: rgba(110, 126, 149, 0.16);
  --baseline-stroke: rgba(110, 126, 149, 0.28);
  --axis-text: #7a8697;
  --band-label: rgba(45, 99, 219, 0.68);
  --axis-bg: rgba(255, 255, 255, 0.88);
  --event-line: rgba(45, 99, 219, 0.24);
  --dot-shadow: drop-shadow(0 2px 3px rgba(35, 72, 147, 0.16));
  --series-shadow: drop-shadow(0 4px 8px rgba(35, 72, 147, 0.24));
  --page-glow: rgba(255, 255, 255, 0.72);
  --button-bg: rgba(45, 99, 219, 0.06);
  --button-bg-hover: rgba(45, 99, 219, 0.1);
  --button-border: rgba(45, 99, 219, 0.14);
  --button-ink: #234893;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, var(--page-glow), transparent 32%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
  color: var(--ink);
  font-family: Bahnschrift, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  transition: background 180ms ease, color 180ms ease;
}

a {
  color: inherit;
}

.page-shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 24px 0 32px;
}

.hero,
.panel {
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(240px, 0.8fr);
  gap: 20px;
  align-items: center;
  padding: 24px;
  margin-bottom: 18px;
}

.hero-title-wrap {
  min-height: 100%;
  display: flex;
  align-items: center;
}

.panel-kicker {
  margin: 0 0 10px;
  color: var(--panel-kicker);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero h1,
.panel h2 {
  margin: 0;
  letter-spacing: 0.01em;
}

.hero h1 {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.05;
}

.panel-note {
  color: var(--muted);
  line-height: 1.6;
}

.hero-meta {
  padding: 18px;
  border-radius: 18px;
  background: var(--hero-meta-bg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 10px;
  align-content: start;
}

.hero-meta span {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.hero-meta a {
  font-size: 18px;
  font-weight: 800;
  text-decoration: none;
}

.hero-meta strong {
  font-size: 18px;
}

.dashboard {
  display: grid;
  gap: 18px;
}

.status-banner {
  margin: 0;
  padding: 14px 18px;
  border-radius: 16px;
  border: 1px solid var(--status-border);
  background: var(--status-bg);
  color: var(--status-ink);
  box-shadow: var(--shadow-soft);
}

.panel {
  padding: 22px;
}

.dashboard-panel {
  display: grid;
  gap: 18px;
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-head .panel-kicker {
  margin-bottom: 0;
}

.model-chip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.model-chip {
  border: 1px solid var(--chip-border);
  border-radius: 16px;
  background: var(--chip-bg);
  padding: 14px;
  text-align: left;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease, border-color 180ms ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68);
}

.model-chip:hover {
  transform: translateY(-1px);
}

.model-chip:focus-visible {
  outline: 3px solid var(--chip-focus);
  outline-offset: 2px;
}

.model-chip-name,
.model-chip-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.model-chip-name {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.model-chip-iq {
  display: block;
  margin-top: 8px;
  font-size: clamp(34px, 4vw, 44px);
  line-height: 1;
}

.model-chip-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.model-chip.is-muted {
  opacity: 0.45;
}

.model-chip.is-selected {
  border-color: var(--chip-selected-border);
  box-shadow: var(--chip-selected-shadow);
}

.model-chip[data-model-key="gpt_55_xhigh"] .model-chip-iq {
  color: var(--chip-green);
}

.model-chip[data-model-key="gpt_55_high"] .model-chip-iq {
  color: var(--chip-blue);
}

.model-chip[data-model-key="gpt_55_medium"] .model-chip-iq {
  color: var(--chip-amber);
}

.model-chip[data-model-key="gpt_55_low"] .model-chip-iq {
  color: var(--chip-cyan);
}

.model-chip[data-model-key="gpt_54_xhigh"] .model-chip-iq {
  color: var(--chip-violet);
}

.model-chip[data-model-key="gpt_54_high"] .model-chip-iq {
  color: var(--chip-red);
}

.chart-stage {
  width: 100%;
  overflow: hidden;
}

.dashboard-chart {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.chart-stage-standalone {
  padding: 0;
}

.chart-stage svg {
  display: block;
  width: 100%;
  min-width: 720px;
  height: auto;
}

.chart-stage .model-iq-plot-bg,
.chart-stage .model-iq-metric-bg {
  fill: var(--plot-bg);
  stroke: none;
}

.chart-stage .model-iq-metric-bg {
  fill: var(--metric-bg);
}

.chart-stage .model-iq-range-band {
  fill: var(--range-band);
}

.chart-stage .chart-grid line,
.chart-stage .model-iq-metric-grid line {
  stroke: var(--grid-stroke);
}

.chart-stage .model-iq-metric-grid line {
  stroke-dasharray: 3 7;
  stroke-width: 1;
}

.chart-stage .model-iq-metric-grid .model-iq-baseline {
  stroke: var(--baseline-stroke);
  stroke-dasharray: none;
}

.chart-stage .chart-grid text,
.chart-stage .chart-labels text,
.chart-stage .model-iq-metric-axis text {
  fill: var(--axis-text);
  font-size: 8.8px;
  font-weight: 760;
}

.chart-stage .model-iq-band-label {
  fill: var(--band-label);
  font-size: 8.5px;
  font-weight: 820;
}

.chart-stage .model-iq-metric-axis-bg {
  fill: var(--axis-bg);
  stroke: none;
}

.chart-stage .model-iq-metric-axis line,
.chart-stage .chart-event-line {
  stroke: var(--event-line);
  stroke-width: 2;
}

.chart-stage .chart-event-line {
  stroke-dasharray: 2 8;
}

.chart-stage .chart-dots circle,
.chart-stage .model-iq-series-dot {
  filter: var(--dot-shadow);
}

[data-dashboard][data-selected-models] .model-iq-series-line,
[data-dashboard][data-selected-models] .model-iq-series-dot {
  opacity: 0.14;
  transition: opacity 180ms ease, filter 180ms ease;
}

[data-dashboard][data-selected-models] .model-iq-series-line.is-selected,
[data-dashboard][data-selected-models] .model-iq-series-dot.is-selected {
  opacity: 1;
}

[data-dashboard][data-selected-models] .model-iq-series-line.is-selected {
  filter: var(--series-shadow);
}

@media (max-width: 900px) {
  .hero,
  .panel-head {
    grid-template-columns: 1fr;
    display: grid;
  }

  .panel-head .panel-kicker {
    margin-bottom: 4px;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 18px, 1180px);
    padding-top: 12px;
  }

  .hero,
  .panel {
    border-radius: 20px;
    padding: 18px;
  }

  .model-chip-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chart-stage {
    overflow-x: auto;
    overflow-y: hidden;
  }

  .chart-stage svg {
    margin-left: 0;
    min-width: 640px;
  }
}
