/* 2026 Token 年鉴 · 极简科技视觉系统（深空黑 / 纸白） */

:root,
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --bg-elevated: #0a0a0a;
  --bg-surface: #0e0e10;
  --bg-subtle: #151518;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --border-focus: rgba(255, 255, 255, 0.36);
  --text: #f5f5f7;
  --text-secondary: #c7c9cc;
  --text-muted: #8a8d91;
  --accent: #f5f5f7;
  --accent-text: #000000;
  --bar-track: rgba(255, 255, 255, 0.07);
  --bar-fill: #c7c9cc;
  --bar-fill-strong: #f5f5f7;
  --heat-0: #141416;
  --heat-1: #2c2e33;
  --heat-2: #565a62;
  --heat-3: #9297a1;
  --heat-4: #eceef1;
  --badge-bg: rgba(255, 255, 255, 0.06);
  --danger: #ff6b6b;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #fbfbfd;
  --bg-elevated: #ffffff;
  --bg-surface: #ffffff;
  --bg-subtle: #f2f2f5;
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.16);
  --border-focus: rgba(0, 0, 0, 0.36);
  --text: #1d1d1f;
  --text-secondary: #424245;
  --text-muted: #6e6e73;
  --accent: #1d1d1f;
  --accent-text: #fbfbfd;
  --bar-track: rgba(0, 0, 0, 0.06);
  --bar-fill: #484a50;
  --bar-fill-strong: #1d1d1f;
  --heat-0: #ededf0;
  --heat-1: #c8cbd2;
  --heat-2: #8c919a;
  --heat-3: #4f535b;
  --heat-4: #1d1d1f;
  --badge-bg: rgba(0, 0, 0, 0.045);
  --danger: #c9372c;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "SF Pro Display", "PingFang SC", "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

.hidden {
  display: none !important;
}

/* Subtle entrance motion */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal {
  animation: fadeUp 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    animation: none;
  }
  * {
    transition-duration: 0.01ms !important;
  }
}

/* Header / Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}

.brand-mark {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text);
  display: inline-block;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Controls */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 450;
  letter-spacing: -0.005em;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.16s ease, border-color 0.16s ease, opacity 0.16s ease;
}

.btn:hover {
  border-color: var(--border-focus);
  background: var(--badge-bg);
}

.btn:focus-visible {
  outline: 1px solid var(--border-focus);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
  font-weight: 500;
}

.btn-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  opacity: 0.86;
}

.btn-sm {
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
}

.name-input {
  height: 32px;
  width: 148px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  outline: none;
  transition: border-color 0.16s ease;
}

.name-input::placeholder {
  color: var(--text-muted);
}

.name-input:focus {
  border-color: var(--border-focus);
}

/* Layout container */
.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
  flex: 1;
}

/* Home Hero */
.hero {
  padding: 72px 0 48px;
  border-bottom: 1px solid var(--border);
}

.eyebrow {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 14px;
}

.hero-title {
  font-size: clamp(36px, 6.5vw, 64px);
  font-weight: 250;
  letter-spacing: -0.035em;
  line-height: 1.08;
  margin: 0 0 16px;
}

.hero-subtitle {
  font-size: clamp(16px, 2.2vw, 20px);
  font-weight: 300;
  color: var(--text-secondary);
  margin: 0;
  max-width: 560px;
}

/* Entry Grid */
.entry-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 40px 0;
  border-bottom: 1px solid var(--border);
}

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
}

.card-index {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin: 0 0 10px;
}

.card-title {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.015em;
  margin: 0 0 8px;
}

.card-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.65;
  margin: 0;
}

.card-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Dropzone */
.dropzone {
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  padding: 18px 14px;
  text-align: center;
  cursor: pointer;
  background: var(--bg-surface);
  transition: border-color 0.16s ease, background-color 0.16s ease;
}

.dropzone:hover,
.dropzone.is-dragover {
  border-color: var(--border-focus);
  background: var(--bg-subtle);
}

.dropzone-main {
  font-size: 13px;
  color: var(--text);
  margin: 0 0 4px;
}

.dropzone-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}

.form-error {
  font-size: 12px;
  color: var(--danger);
  margin: 4px 0 0;
  line-height: 1.5;
}

/* Prompt disclosure */
.prompt-panel {
  padding: 28px 0 40px;
  border-bottom: 1px solid var(--border);
}

.prompt-details {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-elevated);
  overflow: hidden;
}

.prompt-summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-secondary);
}

.prompt-summary::-webkit-details-marker {
  display: none;
}

.prompt-summary-hint {
  font-size: 12px;
  color: var(--text-muted);
}

.prompt-box {
  margin: 0;
  padding: 18px 20px 22px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.75;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

/* Privacy section */
.privacy-section {
  padding: 40px 0 64px;
}

.section-heading {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 20px;
}

.privacy-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.privacy-item {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.privacy-title {
  font-size: 14px;
  font-weight: 500;
  margin: 0 0 6px;
}

.privacy-text {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.65;
  margin: 0;
}

/* Report View */
.report-shell {
  padding: 36px 0 72px;
}

.status-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--badge-bg);
  font-size: 12px;
  color: var(--text-secondary);
}

.pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text);
}

.status-meta {
  font-size: 12px;
  color: var(--text-muted);
}

/* Report Hero KPI */
.report-hero {
  padding: 28px 0 40px;
  border-bottom: 1px solid var(--border);
}

.report-header-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.report-title {
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 400;
  letter-spacing: -0.02em;
  margin: 0;
}

.report-signature {
  color: var(--text-secondary);
  font-weight: 300;
}

.report-range {
  font-size: 13px;
  color: var(--text-muted);
}

.kpi-mega-label {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 8px;
}

.kpi-mega-number {
  font-size: clamp(40px, 8vw, 84px);
  font-weight: 200;
  letter-spacing: -0.04em;
  line-height: 1.02;
  margin: 0 0 10px;
  word-break: break-all;
}

.kpi-mega-approx {
  font-size: 16px;
  font-weight: 300;
  color: var(--text-secondary);
  margin: 0 0 32px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.kpi-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
}

.kpi-label {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 0 10px;
}

.kpi-value {
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 250;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin: 0 0 6px;
}

.kpi-sub {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
}

.kpi-disclaimer {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Report Sections */
.report-section {
  padding: 40px 0;
  border-bottom: 1px solid var(--border);
}

.report-section:last-of-type {
  border-bottom: 0;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.section-title {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0;
}

.section-note {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}

/* Heatmap */
.panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
}

.heatmap-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}

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

.heatmap-cell {
  cursor: pointer;
  transition: opacity 0.12s ease;
}

.heatmap-cell:hover,
.heatmap-cell.is-selected {
  stroke: var(--text);
  stroke-width: 1.2;
}

.heatmap-footer {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-secondary);
}

.heatmap-readout {
  min-height: 18px;
}

.heatmap-legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
}

.legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}

/* Monthly Chart */
.monthly-svg {
  display: block;
  width: 100%;
  height: auto;
}

.month-bar {
  cursor: pointer;
  transition: opacity 0.14s ease;
}

.month-bar:hover,
.month-bar.is-selected {
  fill: var(--bar-fill-strong);
}

.monthly-readout {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-secondary);
}

/* Tool Matrix */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.tool-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
}

.tool-row-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.tool-name {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.tool-tokens {
  font-size: 15px;
  font-weight: 300;
  color: var(--text-secondary);
}

.progress-track {
  width: 100%;
  height: 4px;
  background: var(--bar-track);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-fill {
  height: 100%;
  background: var(--bar-fill-strong);
  border-radius: 999px;
}

.tool-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-muted);
}

/* Top Models Table */
.table-wrap {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow-x: auto;
}

.model-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 600px;
}

.model-table th,
.model-table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.model-table th {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.model-table tbody tr:last-child td {
  border-bottom: 0;
}

.model-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.rank-cell {
  color: var(--text-muted);
  width: 44px;
}

.model-name-cell {
  font-weight: 500;
  color: var(--text);
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-secondary);
}

.unpriced-banner {
  margin-top: 14px;
  padding: 14px 18px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.65;
}

/* Scale Conversions */
.scale-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.scale-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
}

.scale-value {
  font-size: 28px;
  font-weight: 250;
  letter-spacing: -0.025em;
  margin: 0 0 6px;
}

.scale-label {
  font-size: 14px;
  font-weight: 500;
  margin: 0 0 8px;
}

.scale-basis {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
}

/* State views (Loading / Expired) */
.state-view {
  max-width: 520px;
  margin: 96px auto;
  text-align: center;
  padding: 40px 24px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--bg-elevated);
}

.state-title {
  font-size: 20px;
  font-weight: 450;
  letter-spacing: -0.015em;
  margin: 0 0 12px;
}

.state-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
  margin: 0 0 28px;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(12px);
  background: var(--accent);
  color: var(--accent-text);
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  z-index: 60;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 22px 20px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 900px) {
  .entry-grid,
  .privacy-grid,
  .scale-grid {
    grid-template-columns: 1fr;
  }
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .tool-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .topbar-inner {
    padding: 12px 16px;
  }
  .container {
    padding: 0 16px;
  }
  .hero {
    padding: 48px 0 36px;
  }
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  .name-input {
    width: 124px;
  }
  .btn {
    padding: 0 13px;
  }
}
