:root {
  color-scheme: dark;
  --bg: #0f172a;
  --panel: rgba(15, 23, 42, 0.72);
  --line: rgba(148, 163, 184, 0.18);
  --text: #e5edf8;
  --muted: #9fb0c6;
  --accent: #47c6a3;
  --shadow: 0 20px 60px rgba(2, 6, 23, 0.45);
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(71, 198, 163, 0.14), transparent 28%),
    radial-gradient(circle at top right, rgba(124, 156, 255, 0.14), transparent 30%),
    linear-gradient(160deg, #020617 0%, #0f172a 45%, #111827 100%);
}

code {
  font-family: "Consolas", "SFMono-Regular", monospace;
}

.page-shell {
  width: min(1480px, calc(100vw - 32px));
  margin: 24px auto 48px;
  display: grid;
  gap: 20px;
}

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

.hero {
  padding: 28px;
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
}

.hero h1,
.panel h2,
.detail-panel h2,
.explain-card h3 {
  margin: 0;
}

.hero h1 {
  font-size: clamp(28px, 4vw, 48px);
}

.hero-copy {
  max-width: 780px;
  color: var(--muted);
  margin: 12px 0 0;
  line-height: 1.6;
}

.ghost-button,
.primary-link,
.tag-link {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ghost-button:hover,
.primary-link:hover,
.tag-link:hover {
  background: rgba(124, 156, 255, 0.12);
}

.stats-grid,
.method-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.stat-card,
.metric-card {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.88);
}

.stat-card p,
.metric-card p {
  margin: 0;
}

.stat-label,
.metric-label {
  color: var(--muted);
  font-size: 13px;
}

.stat-value,
.metric-value {
  margin-top: 8px;
  font-size: 32px;
  font-weight: 700;
}

.metric-value {
  font-size: 24px;
}

.panel {
  padding: 20px;
}

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

.panel-head p {
  margin: 0;
  color: var(--muted);
}

.status-legend {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

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

.explain-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(2, 6, 23, 0.42);
  display: grid;
  gap: 10px;
}

.explain-kicker {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.explain-card p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

.filters-grid label {
  display: grid;
  gap: 8px;
}

.filters-grid span {
  color: var(--muted);
  font-size: 13px;
}

.filters-grid select,
.filters-grid input {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.88);
  color: var(--text);
  padding: 11px 14px;
}

.search-field {
  grid-column: span 2;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1560px;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.provider-groups {
  display: grid;
  gap: 14px;
}

.provider-group {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(2, 6, 23, 0.38);
  overflow: hidden;
}

.provider-summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 18px 20px;
  cursor: pointer;
}

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

.provider-summary::after {
  content: "展开";
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.provider-group[open] .provider-summary::after {
  content: "收起";
}

.provider-summary-main {
  display: grid;
  gap: 6px;
  min-width: 220px;
}

.provider-name {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.provider-caption {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.provider-summary-metrics {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.summary-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.provider-body {
  display: grid;
  gap: 14px;
  padding: 0 20px 18px;
}

.provider-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.provider-toolbar p {
  margin: 0;
  color: var(--muted);
}

.provider-table-wrap {
  border: 1px solid var(--line);
  border-radius: 18px;
}

.provider-model-table {
  min-width: 1400px;
}

.status-pill,
.score-pill,
.rank-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
}

.rank-pill {
  background: rgba(71, 198, 163, 0.14);
  color: #b5ffe9;
}

.rank-pill-subtle {
  background: rgba(124, 156, 255, 0.12);
  color: #d8e1ff;
}

.status-finished {
  background: rgba(71, 198, 163, 0.14);
  color: #a8f1df;
}

.status-timed_out,
.status-internal_error {
  background: rgba(239, 68, 68, 0.14);
  color: #ffc7c7;
}

.status-other {
  background: rgba(245, 158, 11, 0.14);
  color: #ffdb99;
}

.score-pill {
  background: rgba(124, 156, 255, 0.14);
  color: #d8e1ff;
}

.metric-bad {
  color: #ffb4b4;
}

.metric-good {
  color: #a8f1df;
}

.cell-primary {
  font-weight: 600;
  line-height: 1.5;
}

.cell-secondary {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
  line-height: 1.4;
  word-break: break-all;
}

.actions-cell {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.preview-error {
  color: #ffb4b4;
  font-size: 12px;
  line-height: 1.4;
}

.review-cell {
  min-width: 260px;
  max-width: 360px;
  color: var(--muted);
  line-height: 1.6;
}

.detail-panel {
  position: sticky;
  bottom: 12px;
  padding: 22px;
  display: none;
}

.detail-panel.is-open {
  display: grid;
  gap: 16px;
}

.detail-head,
.detail-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.detail-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.meta-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.meta-card p {
  margin: 0;
}

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

.meta-value {
  margin-top: 6px;
  font-weight: 700;
}

.detail-block {
  display: grid;
  gap: 10px;
}

.detail-block h3 {
  margin: 0;
  font-size: 15px;
}

pre {
  margin: 0;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(2, 6, 23, 0.6);
  color: #d8e1ff;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 360px;
  overflow: auto;
}

.empty-state,
.empty-cell {
  color: var(--muted);
  text-align: center;
  padding: 24px;
}

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

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

  .search-field {
    grid-column: span 2;
  }

  .hero {
    flex-direction: column;
  }

  .provider-summary {
    flex-direction: column;
    align-items: flex-start;
  }

  .provider-summary-metrics {
    justify-content: flex-start;
  }
}
