:root {
  --fg: #1a1a1a;
  --muted: #555;
  --bg: #fdfdfd;
  --card: #ffffff;
  --accent: #1f6feb;
  --accent-fg: #ffffff;
  --good: #117a3d;
  --bad: #b42318;
  --line: #e3e3e3;
  --code-bg: #0d1117;
  --maxw: 1040px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--fg);
  background: var(--bg);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

main { max-width: var(--maxw); margin: 0 auto; padding: 0 24px 64px; }

/* ── Hero ──────────────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 56px 24px 32px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #f6f8fb 0%, #fdfdfd 100%);
}
.hero h1 {
  font-size: 56px;
  margin: 0 0 12px;
  font-weight: 700;
  letter-spacing: -1px;
}
.hero .tagline { font-size: 20px; color: var(--muted); margin: 0 0 12px; }
.hero .authors {
  font-size: 16px;
  color: var(--fg);
  margin: 0 0 4px;
  font-weight: 500;
}
.hero .authors a { color: var(--fg); }
.hero .authors a:hover { color: var(--accent); }
.hero .venue { font-size: 13px; color: var(--muted); margin: 0 0 20px; }
.badge[aria-disabled="true"] {
  color: var(--muted);
  background: #f5f5f5;
  cursor: default;
  pointer-events: none;
}
.badges { display: inline-flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.badge {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
  color: var(--fg);
  background: var(--card);
}
.badge:hover { background: #f1f3f7; text-decoration: none; }
.badge.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.badge.primary:hover { filter: brightness(1.08); }

/* ── Teaser figure under hero ──────────────────────────────────────── */
.teaser {
  max-width: var(--maxw);
  margin: 28px auto 0;
  padding: 0 24px;
}
.teaser img {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
}
.teaser figcaption {
  font-size: 13px;
  color: var(--muted);
  text-align: left;
  margin-top: 8px;
  line-height: 1.55;
}

/* ── Pipeline figure inside Method ─────────────────────────────────── */
.pipeline-fig {
  margin: 16px 0;
}
.pipeline-fig img {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
}
.pipeline-fig figcaption {
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.55;
}

/* ── Table figures (PNG renders of paper tables) ───────────────────── */
.table-fig {
  margin: 18px 0;
  text-align: center;
}
.table-fig img {
  max-width: 62%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}
@media (max-width: 720px) {
  .table-fig img { max-width: 100%; }
}
.table-fig figcaption {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
  text-align: left;
  line-height: 1.55;
}

/* ── Sections ──────────────────────────────────────────────────────── */
section { padding-top: 48px; }
h2 { font-size: 28px; margin: 0 0 16px; border-bottom: 2px solid var(--line); padding-bottom: 8px; }
h3 { margin: 16px 0 8px; }

#tldr ul { padding-left: 22px; }
#tldr li { margin: 6px 0; }

.pipeline { padding-left: 22px; }
.pipeline li { margin: 12px 0; }

/* ── Results table ─────────────────────────────────────────────────── */
.results {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.results th, .results td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.results th { background: #f4f6fa; font-weight: 600; }
.results td:nth-child(2), .results td:nth-child(3),
.results th:nth-child(2), .results th:nth-child(3) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.results tr.best { background: #fffbe6; }
.results tr:last-child td { border-bottom: none; }

/* ── Viewer ────────────────────────────────────────────────────────── */
.viewer {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  padding: 18px;
  margin-top: 16px;
}

.case-tabs {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px;
}
.case-tabs button {
  border: 1px solid var(--line);
  background: var(--card);
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--fg);
}
.case-tabs button:hover { background: #f1f3f7; }
.case-tabs button.active { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }

.meta {
  display: flex; flex-wrap: wrap; gap: 10px 18px;
  font-size: 14px; color: var(--muted);
  background: #f7f8fa;
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 14px;
}
.meta .ok { color: var(--good); font-weight: 600; }
.meta .ko { color: var(--bad); font-weight: 600; }

details.instruction { margin-bottom: 14px; }
details.instruction summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
details.instruction pre {
  background: #f4f6fa;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 14px;
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
}

.solutions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}
.solution {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--card);
}
.solution h3 { margin: 0 0 8px; font-size: 16px; }
.shot-or-exec img {
  max-width: 100%; height: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: block;
  background: #fff;
}
.shot-or-exec pre {
  background: var(--code-bg);
  color: #e6edf3;
  padding: 10px;
  border-radius: 6px;
  margin: 0;
  max-height: 220px;
  overflow: auto;
  font-size: 12px;
  white-space: pre-wrap;
}
.solution details { margin-top: 10px; }
.solution details summary { cursor: pointer; font-size: 14px; color: var(--muted); }
.solution pre code {
  display: block;
  max-height: 320px;
  overflow: auto;
  font-size: 12.5px;
  border-radius: 6px;
}

/* ── Verdict tabs ──────────────────────────────────────────────────── */
.verdict-tabs {
  display: flex; gap: 0; margin-bottom: 12px; border-bottom: 1px solid var(--line);
}
.verdict-tabs button {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.verdict-tabs button.active { color: var(--fg); border-bottom-color: var(--accent); }
.verdict-view { display: none; }
.verdict-view.active { display: block; }

.verdict-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 8px; margin-bottom: 10px;
  background: #f8fafc;
  border: 1px solid var(--line);
}
.verdict-card.wrong { background: #fff1f0; border-color: #f5c2c0; }
.verdict-card.right { background: #f0fdf4; border-color: #bbf7d0; }
.verdict-label { font-weight: 600; }
.verdict-vote { font-weight: 600; }
.verdict-status { margin-left: auto; }

.psf-summary { font-size: 14px; color: var(--muted); margin: 8px 0; }

.criteria {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 14px;
}
.criteria th, .criteria td {
  padding: 6px 10px; border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
}
.criteria th { background: #f4f6fa; font-weight: 600; }
.criteria td:first-child, .criteria td:nth-child(3), .criteria td:nth-child(4) {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.verdict-A { color: #b42318; font-weight: 600; }
.verdict-B { color: #117a3d; font-weight: 600; }
.verdict-tie { color: #555; font-weight: 600; }

.rationale {
  background: #f7f8fa;
  border-left: 3px solid var(--accent);
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.6;
  border-radius: 4px;
  white-space: pre-wrap;
}

.narrative {
  margin-top: 14px;
  padding: 12px 14px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  font-size: 14px;
}

/* ── Citation ──────────────────────────────────────────────────────── */
.bibtex {
  background: var(--code-bg);
  color: #e6edf3;
  padding: 16px;
  border-radius: 6px;
  font-size: 13px;
  overflow: auto;
}
.copy-btn {
  background: var(--accent); color: var(--accent-fg);
  border: none; padding: 8px 14px; border-radius: 6px;
  cursor: pointer; margin-top: 8px; font-size: 14px;
}
.copy-btn:hover { filter: brightness(1.05); }

/* ── Footer ────────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--line);
  padding: 24px;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

@media (max-width: 720px) {
  .hero h1 { font-size: 38px; }
  .hero .tagline { font-size: 17px; }
  .solutions { grid-template-columns: 1fr; }
  .results th, .results td { padding: 8px 10px; font-size: 14px; }
}
