/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue: #3670BD;
  --blue-light: #e8f0fa;
  --blue-dark: #2a5a9a;
  --text: #1a1a1a;
  --text-secondary: #555;
  --bg: #ffffff;
  --bg-alt: #f7f9fc;
  --border: #e0e4ea;
  --max-width: 960px;
}

html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
}

/* ── Info Box ── */
.info-box {
  background: var(--blue-light);
  border-left: 4px solid var(--blue);
  border-radius: 6px;
  padding: 16px 20px;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text);
}
.info-box strong {
  color: var(--blue-dark);
}

/* ── Layout ── */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }
section { padding: 48px 0; }
section + section { border-top: 1px solid var(--border); }

/* ── Typography ── */
h1, h2, h3 { line-height: 1.3; }
h2 { font-size: 1.6rem; margin-bottom: 20px; color: var(--text); }
h2 .section-icon { color: var(--blue); margin-right: 6px; }
p { margin-bottom: 12px; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Hero ── */
.hero {
  text-align: center;
  padding: 64px 0 40px;
}
.hero-title {
  font-size: 3.6rem;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--blue);
  margin-bottom: 8px;
}
.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto 16px;
  line-height: 1.5;
}
.hero-badge {
  display: inline-block;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 4px 14px;
  border-radius: 4px;
  margin-bottom: 20px;
  letter-spacing: 0.5px;
}
.hero-authors {
  font-size: 0.92rem;
  color: var(--text-secondary);
  max-width: 720px;
  margin: 0 auto 24px;
  line-height: 1.7;
}
.hero-authors .author-name { white-space: nowrap; }
.hero-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.15s;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); text-decoration: none; }
.btn-outline { border: 2px solid var(--blue); color: var(--blue); background: transparent; }
.btn-outline:hover { background: var(--blue-light); text-decoration: none; }
.btn-disabled { border: 2px solid var(--border); color: #999; cursor: default; }
.btn-disabled:hover { text-decoration: none; }

/* ── Figures ── */
.figure {
  margin: 24px 0;
  text-align: center;
}
.figure img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}
.figure-caption {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-top: 10px;
  line-height: 1.5;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Abstract ── */
.abstract-text {
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--text);
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

/* ── GIF Grid ── */
.gif-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 20px 0;
}
.gif-card {
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-alt);
  border: 1px solid var(--border);
}
.gif-card img {
  width: 100%;
  display: block;
}
.gif-card .gif-label {
  padding: 6px 10px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-align: center;
  font-weight: 500;
}

/* ── Stats Row ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 28px 0;
}
.stat-card {
  text-align: center;
  padding: 20px 12px;
  background: var(--bg-alt);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.stat-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--blue);
  line-height: 1.2;
}
.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ── Tables ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 16px 0;
}
.data-table th, .data-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.data-table th {
  font-weight: 700;
  background: var(--bg-alt);
  color: var(--text);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.data-table td { color: var(--text); }
.data-table tr:last-child td { border-bottom: none; }
.data-table .best { font-weight: 700; color: var(--blue); }
.data-table .second { text-decoration: underline; }

/* ── Results Table ── */
.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin: 16px 0;
  overflow-x: auto;
  display: block;
}
.results-table th, .results-table td {
  padding: 7px 10px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.results-table th {
  font-weight: 700;
  background: var(--bg-alt);
  font-size: 0.82rem;
}
.results-table td:first-child, .results-table th:first-child {
  text-align: left;
}
.results-table .method-group td { padding-top: 14px; font-weight: 700; }
.results-table .best-val { font-weight: 700; color: var(--blue); }
.results-table .second-val { text-decoration: underline; }

/* ── Image Gallery ── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 20px 0;
}
.gallery-item {
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-alt);
}
.gallery-item img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
}
.gallery-item .gallery-label {
  padding: 4px 8px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: center;
}

/* ── Contributors Table ── */
.contrib-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin: 16px 0;
}
.contrib-table th, .contrib-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.contrib-table th {
  font-weight: 700;
  background: var(--bg-alt);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.legend {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-top: 12px;
}

/* ── BibTeX ── */
.bibtex-block {
  position: relative;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin: 16px 0;
}
.bibtex-block pre {
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
  font-size: 0.82rem;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre;
  color: var(--text);
}
.copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--blue);
  color: #fff;
  border: none;
  padding: 5px 14px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.copy-btn:hover { background: var(--blue-dark); }

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

/* ── Two-col layout ── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .hero-title { font-size: 2.4rem; }
  .gif-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
  .two-col { grid-template-columns: 1fr; }
  section { padding: 32px 0; }
}
@media (max-width: 480px) {
  .hero-title { font-size: 2rem; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .gif-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-number { font-size: 1.5rem; }
}
