:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --accent: #7c3aed;
  --bg: #f8fafc;
  --bg-alt: #f1f5f9;
  --card: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 25px rgba(0,0,0,.08);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* --- NAV --- */
#navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(255,255,255,.92); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow .3s;
}
#navbar.scrolled { box-shadow: var(--shadow-lg); }
.nav-container {
  max-width: 1200px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; height: 64px;
}
.nav-logo { font-weight: 700; font-size: 1.15rem; color: var(--primary); text-decoration: none; letter-spacing: -.02em; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a { text-decoration: none; color: var(--text-muted); font-size: .9rem; font-weight: 500; transition: color .2s; }
.nav-links a:hover { color: var(--primary); }
.btn-github {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 8px;
  background: var(--text); color: #fff !important; font-size: .85rem;
  transition: background .2s;
}
.btn-github:hover { background: #334155; }
.nav-toggle { display: none; background: none; border: none; font-size: 1.3rem; cursor: pointer; color: var(--text); }

/* --- HERO --- */
#hero {
  position: relative; min-height: 80vh;
  display: flex; align-items: center; justify-content: center;
  text-align: center; overflow: hidden; padding-top: 64px;
}
.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 40%, #7c3aed 100%);
}
.hero-bg::after {
  content: ''; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0v60M60 30H0' stroke='%23ffffff08' stroke-width='.5'/%3E%3C/svg%3E");
}
.hero-content { position: relative; z-index: 1; color: #fff; max-width: 860px; padding: 60px 24px; }
.badge {
  display: inline-block; padding: 4px 16px; border-radius: 20px;
  background: rgba(255,255,255,.15); backdrop-filter: blur(4px);
  font-size: .8rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; margin-bottom: 20px;
}
#hero h1 { font-size: clamp(2.5rem, 6vw, 4rem); font-weight: 800; letter-spacing: -.03em; margin-bottom: 16px; }
.subtitle { font-size: clamp(1rem, 2.5vw, 1.3rem); opacity: .9; max-width: 700px; margin: 0 auto 32px; line-height: 1.5; }
.hero-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 24px; margin-bottom: 36px; }
.stat { display: flex; flex-direction: column; gap: 2px; font-size: .9rem; opacity: .85; }
.stat strong { font-size: 1.6rem; opacity: 1; }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px; border-radius: 10px; font-weight: 600; font-size: .95rem;
  text-decoration: none; transition: all .2s; cursor: pointer; border: none;
}
.btn-primary { background: #fff; color: var(--primary); }
.btn-primary:hover { background: #f0f4ff; transform: translateY(-1px); }
.btn-outline { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,.4); }
.btn-outline:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.7); }

/* --- SECTIONS --- */
.section { padding: 80px 0; }
.section-alt { background: var(--bg-alt); }
.section-title {
  font-size: 2rem; font-weight: 700; text-align: center; margin-bottom: 12px;
  letter-spacing: -.02em;
}
.section-desc { text-align: center; color: var(--text-muted); max-width: 700px; margin: 0 auto 48px; font-size: 1.05rem; }

.golden-subset-intro {
  background: linear-gradient(135deg, #eff6ff 0%, #f5f3ff 100%);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 24px; margin-bottom: 32px; text-align: center;
  font-size: 1rem; line-height: 1.65; color: var(--text);
}
.golden-subset-intro p { margin: 0; }
.golden-subset-intro strong { color: var(--primary); }

/* --- ABSTRACT --- */
.abstract-card {
  background: var(--card); border-radius: var(--radius); padding: 40px;
  box-shadow: var(--shadow); border: 1px solid var(--border);
  font-size: 1.02rem; line-height: 1.75;
}
.abstract-card p { margin-bottom: 16px; }
.abstract-card em { color: var(--accent); font-style: italic; }
.abstract-card a { color: var(--primary); text-decoration: none; font-weight: 500; }
.abstract-card a:hover { text-decoration: underline; }
.keywords { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.kw {
  padding: 4px 14px; border-radius: 6px;
  background: #ede9fe; color: var(--accent); font-size: .85rem; font-weight: 500;
}

/* --- PIPELINE FIGURE --- */
.pipeline-figure {
  background: var(--card); border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow); border: 1px solid var(--border);
  margin-bottom: 32px; text-align: center;
}
.pipeline-figure img {
  width: 100%; max-width: 1100px; height: auto;
  border-radius: 8px; cursor: zoom-in;
  transition: transform .3s;
}
.pipeline-figure img:hover { transform: scale(1.02); }
.pipeline-figure img.zoomed {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(1);
  max-width: 95vw; max-height: 95vh;
  z-index: 10000; cursor: zoom-out;
  border-radius: 0; box-shadow: 0 0 60px rgba(0,0,0,.5);
}
.pipeline-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.7);
  z-index: 9999; cursor: zoom-out;
}
.figure-caption {
  margin-top: 16px; font-size: .9rem; color: var(--text-muted);
  line-height: 1.6; max-width: 900px; margin-left: auto; margin-right: auto;
  text-align: left;
}

/* --- METHOD --- */
.method-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.method-card {
  background: var(--card); border-radius: var(--radius); padding: 32px;
  box-shadow: var(--shadow); border: 1px solid var(--border);
}
.method-card.full-width { grid-column: 1 / -1; }
.method-icon { font-size: 2rem; color: var(--primary); margin-bottom: 16px; }
.method-card h3 { font-size: 1.15rem; margin-bottom: 14px; }
.method-card ul { list-style: none; }
.method-card li { padding: 6px 0; padding-left: 20px; position: relative; color: var(--text-muted); font-size: .95rem; }
.method-card li::before { content: '→'; position: absolute; left: 0; color: var(--primary); }
.method-card li strong { color: var(--text); }

/* --- CHARTS --- */
.charts-row { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px; }
.chart-card {
  background: var(--card); border-radius: var(--radius); padding: 28px;
  box-shadow: var(--shadow); border: 1px solid var(--border);
}
.chart-card.full-width { margin-bottom: 24px; }
.chart-card h3 { font-size: 1.05rem; margin-bottom: 16px; color: var(--text); }
.chart-container { width: 100%; min-height: 360px; }
.chart-container-tall { width: 100%; min-height: 500px; }

/* --- TABLE --- */
.table-responsive { overflow-x: auto; }
.data-table {
  width: 100%; border-collapse: collapse; font-size: .9rem;
}
.data-table th, .data-table td {
  padding: 10px 16px; text-align: left; border-bottom: 1px solid var(--border);
}
.data-table th { background: var(--bg-alt); font-weight: 600; position: sticky; top: 0; }
.data-table tbody tr:hover { background: #f8faff; }

/* --- HIGHLIGHT --- */
.highlight-box {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
  margin-top: 32px;
}
.highlight-item {
  background: var(--card); border-radius: var(--radius); padding: 28px; text-align: center;
  box-shadow: var(--shadow); border: 1px solid var(--border);
}
.highlight-num { display: block; font-size: 2.4rem; font-weight: 800; color: var(--primary); }
.highlight-label { display: block; margin-top: 8px; color: var(--text-muted); font-size: .88rem; line-height: 1.4; }

/* --- SHOWCASE --- */
.showcase-controls {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap;
  gap: 16px; margin-bottom: 24px;
}
.tab-group { display: flex; background: var(--bg-alt); border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.tab {
  padding: 10px 22px; border: none; background: none; cursor: pointer;
  font-weight: 500; font-size: .9rem; color: var(--text-muted); transition: all .2s;
}
.tab.active { background: var(--primary); color: #fff; }
.lang-toggle { display: flex; gap: 0; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.lang-btn {
  padding: 10px 20px; border: none; background: var(--bg-alt); cursor: pointer;
  font-weight: 500; font-size: .9rem; color: var(--text-muted); transition: all .2s;
}
.lang-btn.active { background: var(--accent); color: #fff; }
.showcase-grid { display: flex; flex-direction: column; gap: 16px; }
.loading { text-align: center; padding: 60px; color: var(--text-muted); font-size: 1.1rem; }
.loading i { margin-right: 8px; }

/* --- QUESTION CARD --- */
.q-card {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); border: 1px solid var(--border); transition: box-shadow .2s;
}
.q-card:hover { box-shadow: var(--shadow-lg); }
.q-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 24px; cursor: pointer; user-select: none;
}
.q-header:hover { background: #f8faff; }
.q-meta { display: flex; align-items: center; gap: 12px; }
.q-num {
  width: 36px; height: 36px; border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .9rem; flex-shrink: 0;
}
.q-title { font-weight: 600; font-size: .95rem; color: var(--text); }
.q-badges { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.q-badge {
  padding: 3px 10px; border-radius: 6px; font-size: .78rem; font-weight: 600;
}
.q-badge.error { background: #fef2f2; color: var(--danger); }
.q-badge.rag { background: #ecfdf5; color: var(--success); }
.q-badge.answer { background: #eff6ff; color: var(--primary); }
.q-expand { color: var(--text-muted); transition: transform .3s; font-size: 1rem; }
.q-card.open .q-expand { transform: rotate(180deg); }

.q-body { display: none; padding: 0 24px 24px; }
.q-card.open .q-body { display: block; }

.q-question { padding: 16px; background: var(--bg-alt); border-radius: 8px; margin-bottom: 16px; font-size: .95rem; line-height: 1.7; }
.q-options { margin-bottom: 16px; }
.q-opt {
  padding: 10px 14px; margin: 4px 0; border-radius: 8px;
  font-size: .9rem; display: flex; gap: 8px; transition: background .15s;
}
.q-opt.correct-opt { background: #ecfdf5; border: 1px solid #a7f3d0; }
.q-opt-label { font-weight: 700; color: var(--text-muted); min-width: 20px; }
.q-answer-row { font-weight: 600; color: var(--success); margin-bottom: 16px; font-size: .9rem; }

.q-section-title {
  font-weight: 600; font-size: .9rem; color: var(--text-muted); margin: 20px 0 8px;
  text-transform: uppercase; letter-spacing: .04em;
}
.q-analysis {
  padding: 12px 16px; background: #fffbeb; border-radius: 8px;
  font-size: .88rem; line-height: 1.6; max-height: 200px; overflow-y: auto; margin-bottom: 12px;
  white-space: pre-wrap; word-break: break-word;
}
.q-rag {
  padding: 12px 16px; background: #f0fdf4; border-radius: 8px;
  font-size: .85rem; line-height: 1.5; max-height: 200px; overflow-y: auto; margin-bottom: 12px;
  white-space: pre-wrap; word-break: break-word;
}

/* Model results table */
.model-table { width: 100%; border-collapse: collapse; font-size: .84rem; margin-top: 8px; }
.model-table th, .model-table td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.model-table th { background: var(--bg-alt); font-weight: 600; position: sticky; top: 0; z-index: 1; }
.model-table .correct-cell { color: var(--success); font-weight: 700; }
.model-table .wrong-cell { color: var(--danger); font-weight: 700; }
.model-reasoning {
  max-height: 120px; overflow-y: auto; white-space: pre-wrap; word-break: break-word;
  font-size: .82rem; color: var(--text-muted); line-height: 1.4;
}
.model-table-wrap { max-height: 500px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; }

/* --- FOOTER --- */
footer {
  text-align: center; padding: 40px 0; border-top: 1px solid var(--border);
  color: var(--text-muted); font-size: .9rem;
}
.footer-links { margin-top: 8px; }
.footer-links a { color: var(--primary); text-decoration: none; }
.sep { margin: 0 12px; }

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
  .method-grid, .charts-row { grid-template-columns: 1fr; }
  .highlight-box { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .nav-links { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; background: #fff; padding: 16px; gap: 12px; border-bottom: 1px solid var(--border); box-shadow: var(--shadow-lg); }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
  .showcase-controls { flex-direction: column; align-items: stretch; }
  .q-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .q-badges { align-self: flex-end; }
}
