:root {
  --bg: #06080d;
  --bg-elevated: #0c1018;
  --panel: rgba(14, 18, 26, 0.82);
  --panel-2: rgba(20, 26, 38, 0.9);
  --panel-solid: #0e1219;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(56, 189, 248, 0.22);
  --text: #f1f5f9;
  --muted: rgba(203, 213, 225, 0.58);
  --accent: #38bdf8;
  --accent-dim: rgba(56, 189, 248, 0.12);
  --accent-glow: rgba(56, 189, 248, 0.35);
  --up: #4ade80;
  --up-dim: rgba(74, 222, 128, 0.12);
  --warn: #fbbf24;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.45);
  --font: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}

html[data-theme="light"] {
  --bg: #eef2f8;
  --bg-elevated: #f8fafc;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-2: rgba(241, 245, 249, 0.95);
  --panel-solid: #ffffff;
  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(2, 132, 199, 0.25);
  --text: #0f172a;
  --muted: rgba(51, 65, 85, 0.65);
  --accent: #0284c7;
  --accent-dim: rgba(2, 132, 199, 0.08);
  --accent-glow: rgba(2, 132, 199, 0.2);
  --up: #16a34a;
  --up-dim: rgba(22, 163, 74, 0.1);
  --shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 12px 36px rgba(15, 23, 42, 0.1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(56, 189, 248, 0.14), transparent),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(74, 222, 128, 0.06), transparent),
    var(--bg);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black 0%, transparent 85%);
  pointer-events: none;
}

html[data-theme="light"] body::before {
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(2, 132, 199, 0.1), transparent),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(22, 163, 74, 0.05), transparent),
    var(--bg);
}

html[data-theme="light"] body::after {
  opacity: 0.5;
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.04) 1px, transparent 1px);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.15s;
}

a:hover { opacity: 0.8; }

.wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 3rem;
}

.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

/* ── Header ── */

.hero {
  margin-bottom: 1.25rem;
  padding: 1.35rem 1.4rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.5rem;
  padding: 0.2rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.45rem, 4vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.subtitle {
  margin: 0;
  max-width: 36em;
  color: var(--muted);
  font-size: 0.9rem;
}

.hero-sub {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.65rem;
  margin-top: 0.45rem;
}

.hero-sub .subtitle {
  max-width: none;
}

.btn {
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.85rem;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}

.btn:hover {
  border-color: var(--border-strong);
  background: var(--accent-dim);
}

.btn:active { transform: scale(0.97); }

.btn-ghost { background: transparent; }

/* ── Panels ── */

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.65rem;
}

.panel-head h2,
.panel-head h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.panel-head .panel-badge {
  font-size: 0.62rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  color: var(--muted);
  background: var(--panel-2);
  border: 1px solid var(--border);
}

.panel-desc {
  margin: 0 0 0.9rem;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.6;
}

.panel-desc strong { color: var(--text); font-weight: 600; }

.panel-desc.callout {
  padding: 0.65rem 0.8rem;
  background: var(--accent-dim);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  margin-top: 0.75rem;
}

/* ── Inputs ── */

.input-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
}

@media (max-width: 720px) {
  .input-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 420px) {
  .input-grid { grid-template-columns: 1fr; }
}

.input-card {
  padding: 0.7rem 0.75rem;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s;
}

.input-card:focus-within {
  border-color: var(--border-strong);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.input-card label {
  display: block;
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.12rem;
}

.input-hint {
  display: block;
  font-size: 0.62rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
  line-height: 1.35;
}

.input-card input {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel-solid);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  transition: border-color 0.15s;
}

.input-card input:focus {
  outline: none;
  border-color: var(--accent);
}

/* ── FDV / 空投 picks ── */

.val-picks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  margin-top: 0.75rem;
}

@media (max-width: 640px) {
  .val-picks { grid-template-columns: 1fr; }
}

.val-pick {
  padding: 0.65rem 0.75rem;
  background: linear-gradient(135deg, var(--accent-dim), transparent 60%);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}

.val-pick-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.val-pick-label {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--accent);
  min-width: 3.2rem;
  flex-shrink: 0;
}

.val-pick-unit {
  font-size: 0.64rem;
  font-weight: 500;
  color: var(--muted);
}

.val-pick-input {
  width: 60px;
  padding: 0.28rem 0.4rem;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
  background: var(--panel-solid);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
}

.val-pick-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-dim);
}

.val-pick .chips {
  flex: 1;
  min-width: 0;
  gap: 0.28rem;
}

.val-pick .chip {
  padding: 0.15rem 0.5rem;
  font-size: 0.67rem;
}

.val-pick-hint {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.62rem;
  color: var(--muted);
}

/* ── Chips ── */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.chip {
  border: 1px solid var(--border);
  background: var(--panel-solid);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.22rem 0.65rem;
  font-size: 0.73rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.chip:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.chip.active {
  color: var(--accent);
  border-color: var(--border-strong);
  background: var(--accent-dim);
  box-shadow: 0 0 12px var(--accent-glow);
}

/* ── Stat strips ── */

.hero-strip,
.result-strip {
  display: grid;
  gap: 0.55rem;
}

.hero-strip {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.result-strip {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 0.25rem;
}

@media (max-width: 800px) {
  .hero-strip,
  .result-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .hero-strip,
  .result-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.hero-stat {
  padding: 0.75rem 0.8rem;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s;
}

.hero-strip .hero-stat {
  background: var(--panel);
  border-color: var(--border);
}

.hero-stat.featured {
  background: linear-gradient(145deg, var(--up-dim), var(--panel-2));
  border-color: color-mix(in srgb, var(--up) 30%, var(--border));
}

.hero-stat.featured-accent {
  background: linear-gradient(145deg, var(--accent-dim), var(--panel-2));
  border-color: var(--border-strong);
}

.hero-stat-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 0.05rem;
}

.hero-stat-hint {
  display: block;
  font-size: 0.6rem;
  color: color-mix(in srgb, var(--muted) 70%, transparent);
  margin-bottom: 0.3rem;
  line-height: 1.3;
}

.hero-stat-value {
  font-size: clamp(0.95rem, 2.5vw, 1.15rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hero-stat-value.accent { color: var(--accent); }
.hero-stat-value.up { color: var(--up); }

/* ── Mini stats ── */

.mini-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 0.85rem 0 0;
}

@media (max-width: 720px) {
  .mini-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.mini-stat {
  padding: 0.6rem 0.7rem;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--border);
  transition: border-left-color 0.15s;
}

.mini-stat:hover { border-left-color: var(--accent); }

.mini-stat-label {
  display: block;
  font-size: 0.67rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 0.08rem;
}

.mini-stat-hint {
  display: block;
  font-size: 0.58rem;
  color: color-mix(in srgb, var(--muted) 75%, transparent);
  margin-bottom: 0.28rem;
}

.mini-stat-value {
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.3;
  word-break: break-word;
}

/* ── Matrix ── */

.matrix-block {
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.matrix-title {
  margin: 0 0 0.65rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.table-scroll {
  overflow-x: auto;
  margin-top: 0.35rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.heat-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.heat-table th,
.heat-table td {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--border);
  text-align: right;
}

.heat-table tr:last-child td,
.heat-table tr:last-child th { border-bottom: none; }

.heat-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel-solid);
  color: var(--muted);
  text-align: center;
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.heat-table td:first-child,
.heat-table th:first-child {
  text-align: left;
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--panel-solid);
  font-weight: 600;
  color: var(--text);
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
}

.heat-table thead th:first-child { z-index: 3; }

.heat-cell {
  font-family: var(--mono);
  font-size: 0.66rem;
  line-height: 1.45;
  vertical-align: top;
  transition: outline 0.15s;
}

.heat-cell.highlight {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  box-shadow: inset 0 0 20px var(--accent-dim);
}

.cell-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.4rem;
}

.cell-tag {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 0.58rem;
  font-family: var(--font);
  font-weight: 500;
}

.cell-val {
  text-align: right;
  font-weight: 500;
}

.cell-row:first-child .cell-val {
  font-weight: 700;
  font-size: 0.72rem;
  color: var(--up);
}

html[data-theme="light"] .cell-row:first-child .cell-val {
  color: var(--up);
}

.table-caption {
  margin: 0.65rem 0 0;
  padding: 0.65rem 0.75rem;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.65;
  background: var(--panel-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.table-caption code {
  font-family: var(--mono);
  font-size: 0.88em;
  padding: 0.1em 0.35em;
  background: var(--panel-solid);
  border-radius: 4px;
}

.table-caption strong { color: var(--text); }

.subtitle .ref-code,
.ref-code {
  font-family: var(--mono);
  font-size: 0.88em;
  font-weight: 600;
  padding: 0.1em 0.4em;
  border-radius: 5px;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--border-strong);
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  margin-top: 0;
  padding: 0.5rem 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--bg);
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, var(--up)));
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 4px 16px var(--accent-glow);
  transition: transform 0.15s, box-shadow 0.15s;
}

.hero-cta:hover {
  opacity: 1;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--accent-glow);
}

html[data-theme="light"] .hero-cta {
  color: #fff;
}

.footer-ref-hint {
  font-size: 0.72rem;
  color: var(--muted);
}

/* ── Footer ── */

.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  margin-top: 1.5rem;
  padding: 1.15rem 1rem;
  font-size: 0.78rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.35rem 0.5rem;
}

.footer-dot {
  opacity: 0.4;
}

.footer-links {
  display: flex;
  gap: 0.5rem;
}

.footer-links a {
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  font-size: 0.75rem;
  font-weight: 500;
}

.footer-links a:hover {
  border-color: var(--border-strong);
  opacity: 1;
}
