:root {
  --primary: #3366cc;
  --primary-dark: #264d99;
  --bg: #ffffff;
  --bg-alt: #f7f8fa;
  --text: #222;
  --text-secondary: #555;
  --border: #e0e0e0;
  --radius: 8px;
  --max-width: 900px;
  --font: 'Noto Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

/* Hero */
.hero {
  padding: 60px 0 40px;
  text-align: center;
}
.hero h1 {
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 20px;
  letter-spacing: -0.5px;
}
.venue-badge {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  padding: 4px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 24px;
}
.authors {
  font-size: 1.05rem;
  margin-bottom: 6px;
}
.authors a {
  color: var(--primary);
  text-decoration: none;
}
.authors a:hover { text-decoration: underline; }
.authors sup { color: var(--primary); font-weight: 600; }
.affiliation {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 28px;
}
.links {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  border-radius: 24px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
}
.btn-dark {
  background: #333;
  color: #fff;
}
.btn-dark:hover { background: #111; }
.btn-outline {
  border: 1.5px solid #333;
  color: #333;
}
.btn-outline:hover { background: #333; color: #fff; }

/* Sections */
section {
  padding: 48px 0;
}
section.alt { background: var(--bg-alt); }
.section-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 20px;
  text-align: center;
}

/* Teaser */
.teaser-img {
  width: 100%;
  border-radius: var(--radius);
  margin: 10px 0;
}
.teaser-caption {
  color: var(--text-secondary);
  font-size: 0.9rem;
  text-align: center;
  margin-top: 12px;
  line-height: 1.6;
}

/* Abstract */
.abstract-text {
  font-size: 1rem;
  text-align: justify;
  max-width: 800px;
  margin: 0 auto;
}

/* Method */
.method-overview {
  margin-top: 16px;
}
.method-img {
  width: 100%;
  border-radius: var(--radius);
  margin: 16px 0;
}
.method-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  text-align: justify;
}
.module-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 28px;
}
.module-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: box-shadow 0.2s;
}
.module-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.module-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--primary);
}
.module-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}
.module-card img {
  width: 100%;
  border-radius: 6px;
  margin-top: 12px;
}

/* Tables */
.results-section { overflow-x: auto; }
.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin: 20px 0;
}
.results-table th {
  background: var(--primary);
  color: #fff;
  padding: 10px 12px;
  text-align: center;
  font-weight: 600;
  white-space: nowrap;
}
.results-table td {
  padding: 8px 12px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.results-table tr:hover { background: #f0f4ff; }
.results-table .best { font-weight: 700; color: var(--primary); }
.results-table .second { text-decoration: underline; }
.results-table .ours-row { background: #eef3ff; }
.results-table .category-row td {
  text-align: left;
  font-style: italic;
  color: var(--text-secondary);
  font-weight: 500;
  padding-top: 14px;
}
.table-caption {
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* Qualitative */
.qual-img {
  width: 100%;
  border-radius: var(--radius);
  margin: 16px 0;
}
.qual-caption {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* BibTeX */
.bibtex-box {
  position: relative;
  background: #1e1e2e;
  color: #cdd6f4;
  border-radius: var(--radius);
  padding: 20px 24px;
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: 0.82rem;
  line-height: 1.6;
  overflow-x: auto;
  max-width: 700px;
  margin: 12px auto 0;
}
.bibtex-box pre { white-space: pre-wrap; word-break: break-all; }
.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255,255,255,0.1);
  border: none;
  color: #cdd6f4;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.78rem;
  transition: background 0.2s;
}
.copy-btn:hover { background: rgba(255,255,255,0.2); }
.copy-btn.copied { background: #a6e3a1; color: #1e1e2e; }

/* Footer */
footer {
  padding: 32px 0;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}
footer a { color: var(--primary); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* Responsive */
@media (max-width: 768px) {
  .hero h1 { font-size: 1.6rem; }
  .module-grid { grid-template-columns: 1fr; }
  .links { gap: 8px; }
  .links a { padding: 6px 14px; font-size: 0.85rem; }
  .container { padding: 0 16px; }
  section { padding: 32px 0; }
}

/* Scroll to top */
.scroll-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: opacity 0.3s;
  z-index: 999;
}
.scroll-top.visible { display: flex; }

/* Tab navigation for result tables */
.tab-nav {
  display: flex;
  gap: 0;
  justify-content: center;
  margin-bottom: 0;
  border-bottom: 2px solid var(--border);
}
.tab-btn {
  padding: 10px 24px;
  border: none;
  background: none;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}
.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}
.tab-btn:hover { color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
