:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --text: #1e293b;
  --text-secondary: #475569;
  --border: #e2e8f0;
  --bg-light: #f8fafc;
  --bg-code: #1e293b;
  --max-width: 960px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Noto Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--text);
  line-height: 1.7;
  background: #fff;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
header {
  text-align: center;
  padding: 60px 0 30px;
}

header .conference-badge {
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 20px;
}

header h1 {
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 24px;
}

header h1 em {
  font-style: italic;
  color: var(--primary);
}

.authors {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
  line-height: 1.8;
}

.authors a {
  color: var(--text);
  text-decoration: none;
}

.authors sup {
  font-size: 0.7em;
  color: var(--primary);
  margin-left: 1px;
}

.affiliations {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 28px;
  line-height: 1.6;
}

.affiliations sup {
  font-size: 0.75em;
  color: var(--primary);
  margin-right: 2px;
}

/* Buttons */
.btn-group {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  font-size: 0.95rem;
  font-weight: 500;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.2s;
}

.btn:hover {
  background: var(--primary-dark);
}

.btn.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

.btn.btn-outline:hover {
  background: var(--primary);
  color: #fff;
}

/* Sections */
section {
  padding: 40px 0;
}

section h2 {
  font-size: 1.7rem;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}

section h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 24px 0 12px;
}

section p {
  margin-bottom: 16px;
}

/* Hero figure */
.hero-figure {
  text-align: center;
  margin: 0 0 20px;
}

.hero-figure img {
  width: 100%;
  max-width: 900px;
  border-radius: 8px;
}

/* Figures */
figure {
  margin: 28px 0;
  text-align: center;
}

figure img {
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
}

figcaption {
  margin-top: 10px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-style: italic;
}

/* Tables */
.table-wrapper {
  overflow-x: auto;
  margin: 20px 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

thead {
  background: var(--bg-light);
}

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

th {
  font-weight: 600;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
}

td.best {
  font-weight: 700;
  color: var(--primary);
}

tr.human-row {
  background: #eff6ff;
  font-weight: 600;
}

tr.separator td {
  border-bottom: 2px solid var(--text-secondary);
  padding: 0;
  height: 0;
}

/* Leaderboard note */
.leaderboard-note {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 8px;
}

/* Stats highlight */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.stat-card {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  text-align: center;
}

.stat-card .number {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
  display: block;
}

.stat-card .label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Chart gallery */
.chart-gallery {
  max-width: 720px;
  margin: 28px auto;
}

.chart-card {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin: 0;
  text-align: center;
}

.chart-card img {
  max-width: 100%;
  border: none;
  border-radius: 4px;
  background: #fff;
}

.chart-card figcaption {
  margin-top: 10px;
  font-size: 0.85rem;
}

.chart-gallery > .chart-card {
  margin-bottom: 14px;
}

.chart-gallery > .chart-card > img {
  max-width: 480px;
}

.chart-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.chart-row .chart-card img {
  max-width: 320px;
}

/* Two-column grid (legacy) */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 24px 0;
}

.two-col figure {
  margin: 0;
}

/* Example grid */
.example-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 20px 0;
}

.example-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  transition: box-shadow 0.2s;
}

.example-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.example-tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 12px;
  margin: 12px 12px 8px;
  border-radius: 20px;
  color: #fff;
}

.tag-red { background: #ef4444; }
.tag-orange { background: #f59e0b; }
.tag-purple { background: #8b5cf6; }

.example-card img {
  width: 100%;
  aspect-ratio: auto;
  object-fit: contain;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.example-body {
  padding: 12px 14px 16px;
}

.example-problem {
  font-size: 0.85rem;
  margin-bottom: 6px;
  line-height: 1.5;
}

.example-answer {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.example-desc {
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.55;
  margin-bottom: 0;
}

.example-grid figure {
  margin: 0;
}

.example-grid img {
  width: 100%;
  aspect-ratio: auto;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 8px;
}

/* Code block */
pre {
  background: var(--bg-code);
  color: #e2e8f0;
  padding: 20px;
  border-radius: 8px;
  overflow-x: auto;
  font-family: 'Inconsolata', 'SF Mono', 'Menlo', monospace;
  font-size: 0.88rem;
  line-height: 1.6;
  margin: 16px 0;
}

pre code {
  font-family: inherit;
}

/* Citation */
.citation-box {
  position: relative;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin: 16px 0;
}

.citation-box pre {
  background: transparent;
  color: var(--text);
  padding: 0;
  margin: 0;
  font-size: 0.85rem;
}

.copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s;
}

.copy-btn:hover {
  background: var(--primary-dark);
}

/* Footer */
footer {
  text-align: center;
  padding: 30px 0;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.85rem;
}

footer a {
  color: var(--primary);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
  header {
    padding: 40px 0 20px;
  }

  header h1 {
    font-size: 1.6rem;
  }

  section h2 {
    font-size: 1.4rem;
  }

  .two-col, .chart-row {
    grid-template-columns: 1fr;
  }

  .example-grid {
    grid-template-columns: 1fr;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .btn-group {
    gap: 8px;
  }

  .btn {
    padding: 8px 16px;
    font-size: 0.85rem;
  }

  table {
    font-size: 0.8rem;
  }

  th, td {
    padding: 8px 10px;
  }
}

@media (max-width: 480px) {
  .example-grid {
    grid-template-columns: 1fr !important;
  }

  .stats {
    grid-template-columns: 1fr 1fr;
  }
}
