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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #1e293b;
  background: #fff;
  line-height: 1.65;
  font-size: 16px;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ===== Hero ===== */
.hero {
  background: linear-gradient(160deg, #bfdbfe 0%, #dbeafe 30%, #eff6ff 70%, #f8faff 100%);
  padding: 60px 0 52px;
  text-align: center;
}

.venue-badge {
  display: inline-block;
  background: #2563eb;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 20px;
}

.paper-title {
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.3;
  color: #0f172a;
  max-width: 820px;
  margin: 0 auto 24px;
}

.authors {
  font-size: 1.0rem;
  color: #374151;
  margin-bottom: 6px;
  line-height: 1.8;
}

.authors span { white-space: nowrap; }
.authors sup { color: #2563eb; font-weight: 600; font-size: 0.7em; }

.affiliation {
  font-size: 0.9rem;
  color: #6b7280;
  margin-bottom: 6px;
}

.author-notes {
  font-size: 0.82rem;
  color: #9ca3af;
  margin-bottom: 28px;
  display: flex;
  justify-content: center;
  gap: 20px;
}

.author-notes sup { color: #2563eb; font-weight: 600; font-size: 0.7em; }

/* Hero Buttons */
.hero-buttons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  border: 1.5px solid #2563eb;
  border-radius: 6px;
  color: #2563eb;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  background: #fff;
  transition: background 0.18s, color 0.18s;
  cursor: pointer;
  font-family: inherit;
}

.btn:hover {
  background: #2563eb;
  color: #fff;
}

.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ===== Sections ===== */
.section { padding: 64px 0; }
.section-alt { background: #f8faff; }

.section h2 {
  font-size: 1.55rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 24px;
  padding-bottom: 10px;
  border-bottom: 2px solid #e2e8f0;
}

/* ===== Abstract ===== */
.abstract-text {
  font-size: 0.97rem;
  color: #374151;
  line-height: 1.8;
  max-width: 860px;
}

/* ===== Stats Grid ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.stat-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 28px 20px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.stat-number {
  font-size: 2.2rem;
  font-weight: 700;
  color: #2563eb;
  line-height: 1;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 0.85rem;
  color: #6b7280;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ===== Domain Table ===== */
.table-wrapper {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  margin-bottom: 32px;
}

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

thead th {
  background: #1e293b;
  color: #fff;
  padding: 11px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 0.82rem;
  white-space: nowrap;
}

tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: #374151;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #f8faff; }

/* ===== Pipeline ===== */
.pipe-slider { text-align: center; }

.pipe-tabs {
  display: inline-flex;
  background: #f1f5f9;
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
  margin-bottom: 16px;
}

.pipe-tab {
  padding: 6px 16px;
  border: none;
  border-radius: 6px;
  background: transparent;
  font-size: 0.82rem;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.pipe-tab:hover { color: #374151; }
.pipe-tab.active {
  background: #fff;
  color: #2563eb;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
  font-weight: 600;
}

.pipe-img {
  width: 100%;
  border-radius: 8px;
}

/* ===== Leaderboard ===== */
.lb-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 20px;
}

.lb-left { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

.lb-tabs {
  display: flex;
  gap: 0;
  border: 1.5px solid #2563eb;
  border-radius: 6px;
  overflow: hidden;
}

.lb-tab {
  padding: 8px 18px;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  background: #fff;
  color: #2563eb;
  border: none;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  font-family: inherit;
}

.lb-tab.active {
  background: #2563eb;
  color: #fff;
}

.lb-filter {
  display: flex;
  gap: 6px;
  align-items: center;
}

.lb-filter-label {
  font-size: 0.83rem;
  color: #6b7280;
  margin-right: 2px;
}

.filter-btn {
  padding: 5px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  font-size: 0.8rem;
  cursor: pointer;
  background: #fff;
  color: #374151;
  transition: all 0.15s;
  font-family: inherit;
}

.filter-btn.active {
  background: #1e293b;
  color: #fff;
  border-color: #1e293b;
}

.filter-btn:hover:not(.active) { background: #f1f5f9; }

.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 0.82rem;
  color: #374151;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
  white-space: nowrap;
}

.download-btn:hover { background: #e2e8f0; }
.download-btn svg { width: 14px; height: 14px; }

.lb-note {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-top: 10px;
}

/* Leaderboard Table */
.lb-table-wrap {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

#lb-table {
  min-width: 800px;
  border-collapse: collapse;
  font-size: 0.81rem;
  width: 100%;
  background: #fff;
}

#lb-table thead tr:first-child th {
  background: #1e293b;
  color: #fff;
  padding: 9px 10px;
  text-align: center;
  font-weight: 600;
  font-size: 0.78rem;
  white-space: nowrap;
}

#lb-table thead tr:last-child th {
  background: #2d3f55;
  color: #cbd5e1;
  padding: 7px 8px;
  text-align: center;
  font-size: 0.73rem;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

#lb-table thead tr:last-child th:hover { background: #3d5068; color: #fff; }
#lb-table thead tr:last-child th.sort-asc::after { content: " ▲"; font-size: 0.65em; }
#lb-table thead tr:last-child th.sort-desc::after { content: " ▼"; font-size: 0.65em; }

/* Sticky columns */
#lb-table th.sticky-1, #lb-table td.sticky-1 {
  position: sticky; left: 0; z-index: 2; min-width: 40px;
}
#lb-table th.sticky-2, #lb-table td.sticky-2 {
  position: sticky; left: 40px; z-index: 2; min-width: 160px;
}
#lb-table th.sticky-3, #lb-table td.sticky-3 {
  position: sticky; left: 200px; z-index: 2; min-width: 76px;
}

#lb-table thead tr:first-child th.sticky-1,
#lb-table thead tr:first-child th.sticky-2,
#lb-table thead tr:first-child th.sticky-3 { z-index: 4; }

#lb-table thead tr:last-child th.sticky-1,
#lb-table thead tr:last-child th.sticky-2,
#lb-table thead tr:last-child th.sticky-3 { z-index: 3; }

#lb-table tbody td {
  padding: 8px 10px;
  text-align: center;
  border-bottom: 1px solid #f1f5f9;
  white-space: nowrap;
  color: #374151;
  background: #fff;
}

#lb-table tbody td.sticky-1,
#lb-table tbody td.sticky-2,
#lb-table tbody td.sticky-3 { background: #fff; }

#lb-table tbody tr:nth-child(even) td { background: #f8faff; }
#lb-table tbody tr:nth-child(even) td.sticky-1,
#lb-table tbody tr:nth-child(even) td.sticky-2,
#lb-table tbody tr:nth-child(even) td.sticky-3 { background: #f8faff; }

#lb-table tbody tr:nth-child(1) td { background: #fefce8; }
#lb-table tbody tr:nth-child(1) td.sticky-1,
#lb-table tbody tr:nth-child(1) td.sticky-2,
#lb-table tbody tr:nth-child(1) td.sticky-3 { background: #fefce8; }

#lb-table tbody tr:hover td { background: #eff6ff !important; }
#lb-table tbody tr:hover td.sticky-1,
#lb-table tbody tr:hover td.sticky-2,
#lb-table tbody tr:hover td.sticky-3 { background: #eff6ff !important; }

#lb-table td.align-left { text-align: left; }

/* Best value highlight */
#lb-table td.best { color: #16a34a; font-weight: 700; }

/* Column group separator */
.col-sep { border-left: 2px solid #475569 !important; }
.col-sep-body { border-left: 2px solid #e2e8f0 !important; }

/* Type badge */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
}
.badge-open { background: #dbeafe; color: #1d4ed8; }
.badge-closed { background: #fef3c7; color: #92400e; }

/* Rank */
.rank-medal { font-weight: 700; }
.rank-1 { color: #b45309; }
.rank-2 { color: #475569; }
.rank-3 { color: #92400e; }
.dash-val { color: #cbd5e1; }

/* ===== Citation ===== */
.citation-block {
  background: #1e293b;
  border-radius: 8px;
  padding: 24px;
  overflow-x: auto;
}

.citation-block pre {
  color: #e2e8f0;
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  white-space: pre;
}

/* ===== Examples Viewer ===== */
.ex-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.ex-selects {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.ex-right-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Unhighlight btn — same height as mode toggle */
#btn-highlight {
  align-self: auto;
  padding: 7px 14px;
}

.ex-select {
  padding: 7px 32px 7px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.85rem;
  font-family: inherit;
  color: #374151;
  background: #fff;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
  min-width: 140px;
  transition: border-color 0.15s;
}
.ex-select:focus { outline: none; border-color: #2563eb; }

.ex-mode-toggle {
  display: flex;
  border: 1.5px solid #2563eb;
  border-radius: 6px;
  overflow: hidden;
}

.ex-mode {
  padding: 7px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  background: #fff;
  color: #2563eb;
  border: none;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}

.ex-mode.active {
  background: #2563eb;
  color: #fff;
}

/* Single-image viewer */
.ex-viewer-outer {
  padding: 0 28px 48px;
}

#ex-viewer { width: 100%; }

.ex-viewer-card {
  display: flex;
  height: 68vh;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
}

.ex-viewer-img {
  width: 50%;
  flex-shrink: 0;
  background: #f8faff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ex-viewer-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.ex-viewer-body {
  flex: 1;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}

.ex-viewer-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ex-domain-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.ex-filename {
  font-size: 0.78rem;
  color: #6b7280;
  font-family: 'JetBrains Mono', monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.ex-gt-btn {
  align-self: flex-start;
  padding: 5px 14px;
  border: 1.5px solid #2563eb;
  border-radius: 6px;
  background: #fff;
  color: #2563eb;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}
.ex-gt-btn:hover { background: #eff6ff; }
.ex-gt-btn.active { background: #2563eb; color: #fff; }

/* Method slider (synthetic mode) — top-right of card header */
.ex-method-slider {
  margin-left: auto;
  flex-shrink: 0;
  display: flex;
  background: #f1f5f9;
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.ex-method-slider button {
  padding: 4px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  font-size: 0.74rem;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.ex-method-slider button:hover { color: #374151; }

.ex-method-slider button.active {
  background: #fff;
  color: #7c3aed;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
  font-weight: 600;
}

.ex-caption {
  font-size: 0.9rem;
  line-height: 1.8;
  color: #374151;
  flex: 1;
  overflow-y: auto;
}

/* Hallucination highlight + tooltip */
mark { background: transparent; }

mark.hal {
  background: #fee2e2;
  color: #b91c1c;
  border-radius: 3px;
  padding: 1px 2px;
  font-style: normal;
  cursor: help;
}

.hal-tooltip {
  position: fixed;
  background: #1e293b;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 4px 9px;
  border-radius: 5px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 9999;
  transition: opacity 0.15s;
  opacity: 0;
}

/* GT correction highlight */
mark.gt-cor {
  background: #bbf7d0;
  color: #14532d;
  border-radius: 3px;
  padding: 1px 2px;
  font-style: normal;
}

/* ===== Footer ===== */
footer {
  background: #1e293b;
  color: #94a3b8;
  text-align: center;
  padding: 28px;
  font-size: 0.85rem;
}

footer a { color: #60a5fa; text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .paper-title { font-size: 1.35rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .lb-controls { flex-direction: column; align-items: flex-start; }
  .hero-buttons { gap: 8px; }
  .btn { padding: 8px 14px; font-size: 0.85rem; }
}
