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

:root {
  --blue:    #1a56db;
  --blue-lt: #e8f0fe;
  --gray-bg: #f7f8fa;
  --gray-bd: #e2e5ea;
  --text:    #1a1a2e;
  --muted:   #5a6172;
  --radius:  10px;
  --max-w:   1100px;
  --narrow:  740px;
}

html { scroll-behavior: smooth; }

body {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: #fff;
}

/* ── Layout ──────────────────────────────────────────────────────────── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
.container.narrow { max-width: var(--narrow); }

/* ── Hero ────────────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(160deg, #0f172a 0%, #1e3a5f 100%);
  color: #fff;
  padding: 80px 0 64px;
  text-align: center;
}

.hero .venue {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #93c5fd;
  margin-bottom: 18px;
}

.hero h1 {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 600;
  line-height: 1.25;
  max-width: 820px;
  margin: 0 auto 28px;
}

.authors {
  display: flex; flex-wrap: wrap;
  justify-content: center; gap: 6px 20px; margin-bottom: 8px;
}
.author { font-size: 15px; font-weight: 500; }
.author sup { font-size: 10px; color: #93c5fd; }

.affiliations {
  display: flex; flex-wrap: wrap;
  justify-content: center; gap: 6px 18px;
  font-size: 13px; color: #93c5fd; margin-bottom: 32px;
}

.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 20px; background: #fff; color: #1a56db;
  border-radius: 6px; font-size: 14px; font-weight: 600;
  text-decoration: none; transition: background 0.15s, transform 0.1s;
}
.btn:hover { background: #e8f0fe; transform: translateY(-1px); }
.btn.btn-outline {
  background: transparent; color: #fff;
  border: 1.5px solid rgba(255,255,255,0.5);
}
.btn.btn-outline:hover { background: rgba(255,255,255,0.1); }

/* ── Sections ────────────────────────────────────────────────────────── */
.section { padding: 72px 0; }
.section-gray { background: var(--gray-bg); }

.section h2 {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1.75rem; font-weight: 600;
  margin-bottom: 24px; color: var(--text);
}

.section p { color: #333; margin-bottom: 14px; text-align: justify; }
.section-intro { font-size: 17px; color: var(--muted); margin-bottom: 36px; }

/* ── Teaser / figures ────────────────────────────────────────────────── */
.teaser-box {
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--gray-bd); margin-bottom: 14px;
  background: var(--gray-bg);
}
.teaser-box img { width: 100%; display: block; }

.placeholder-fig {
  width: 100%; min-height: 260px; background: var(--gray-bg);
  border-radius: var(--radius); border: 2px dashed var(--gray-bd);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 14px; margin-bottom: 14px;
}

.caption {
  font-size: 14px; color: var(--muted);
  text-align: center; margin-bottom: 48px;
}

/* ── Method cards ────────────────────────────────────────────────────── */
.method-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px; margin-bottom: 32px;
}

.method-card {
  background: #fff; border: 1px solid var(--gray-bd);
  border-radius: var(--radius); padding: 28px 24px;
}

.method-icon {
  width: 40px; height: 40px; background: var(--blue-lt);
  color: var(--blue); border-radius: 50%; display: flex;
  align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; margin-bottom: 14px;
}

.method-card h3 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.method-card p  { font-size: 14px; color: var(--muted); margin: 0; }

.motivation-block {
  background: var(--blue-lt); border-left: 4px solid var(--blue);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 24px 28px; margin-top: 8px;
}
.motivation-block h3 {
  font-size: 15px; font-weight: 600;
  margin-bottom: 8px; color: var(--blue);
}
.motivation-block p { font-size: 15px; color: #1e3a5f; margin: 0; }

/* ── Dataset cards ───────────────────────────────────────────────────── */
.dataset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.dataset-card {
  background: #fff; border: 1px solid var(--gray-bd);
  border-radius: var(--radius); overflow: hidden;
}

.dataset-img { aspect-ratio: 1 / 1; background: #dde8f5; overflow: hidden; }
.dataset-img img, .dataset-img video { width: 100%; height: 100%; object-fit: cover; display: block; }

.dataset-body { padding: 20px; }
.dataset-body h3 { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.dataset-body p  { font-size: 14px; color: var(--muted); margin: 0; }

/* ── Results ─────────────────────────────────────────────────────────── */
.result-heading {
  font-size: 17px; font-weight: 600;
  margin-bottom: 16px; margin-top: 32px; color: var(--text);
}

.result-fig {
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--gray-bd); background: #fff; margin-bottom: 12px;
}
.result-fig img { width: 100%; display: block; }

.results-row {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 24px; margin-top: 8px;
}

/* ── Stat cards ──────────────────────────────────────────────────────── */
.stat-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.stat-card {
  background: var(--blue-lt); border-radius: var(--radius);
  padding: 20px; text-align: center;
}
.stat-val {
  font-size: 2rem; font-weight: 700;
  color: var(--blue); line-height: 1.1; margin-bottom: 6px;
}
.stat-lbl { font-size: 13px; color: var(--muted); line-height: 1.4; }

/* ── Fancy stat cards ────────────────────────────────────────────────── */
.fancy-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.fancy-stat {
  border-radius: var(--radius);
  padding: 22px 16px 18px;
  text-align: center;
  background: var(--blue-lt);
  border: 1px solid #c7d7f8;
}
.fancy-stat-val {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 6px;
  color: var(--blue);
}
.fancy-stat-metric {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
}
.fancy-stat-sub {
  font-size: 11px;
  color: var(--muted);
}
@media (max-width: 640px) {
  .fancy-stat-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Results tables ──────────────────────────────────────────────────── */
.results-table-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 8px;
}
.results-table-col { overflow-x: auto; }
.results-table-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
  text-align: center;
}
.results-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.results-tbl th {
  background: var(--gray-bg);
  color: var(--muted);
  font-weight: 600;
  padding: 8px 10px;
  text-align: center;
  border-bottom: 2px solid var(--gray-bd);
}
.results-tbl td {
  padding: 7px 10px;
  text-align: center;
  border-bottom: 1px solid var(--gray-bg);
  color: #333;
}
.results-tbl td:first-child { text-align: left; }
.results-tbl td:nth-child(4),
.results-tbl td:nth-child(5) { text-align: center; }
.results-tbl .best-row td { background: #eff6ff; color: var(--blue); }
.results-tbl .sep-row td { border-bottom: 2px solid var(--gray-bd); color: var(--muted); }
@media (max-width: 640px) {
  .results-table-wrap { grid-template-columns: 1fr; }
}

/* ── Transfer flow ───────────────────────────────────────────────────── */
.transfer-flow {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.tf-node {
  flex: 1;
  min-width: 130px;
  border-radius: var(--radius);
  padding: 16px 14px;
  text-align: center;
  border: 2px solid transparent;
}
.tf-node.gray   { background: #f1f5f9; border-color: #cbd5e1; }
.tf-node.blue   { background: #eff6ff; border-color: #93c5fd; }
.tf-node.green  { background: #f0fdf4; border-color: #86efac; }
.tf-node.gold   { background: #fffbeb; border-color: #fcd34d; }
.tf-label  { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.tf-edit   { font-size: 14px; font-weight: 600; color: var(--blue); }
.tf-acc    { font-size: 13px; color: #16a34a; margin-bottom: 6px; }
.tf-tag    { font-size: 10px; color: var(--muted); }
.tf-arrow  { font-size: 22px; color: var(--muted); flex-shrink: 0; }

/* ── Edit hero + VLM gains ───────────────────────────────────────────── */
.tl-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}
.edit-hero {
  background: var(--blue-lt);
  border: 1px solid #c7d7f8;
  border-radius: var(--radius);
  padding: 20px 22px;
  color: var(--text);
}
.edit-hero-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 14px; }
.edit-hero-row   { display: flex; align-items: center; gap: 12px; }
.edit-hero-item  { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.edit-hero-val   { font-size: 2rem; font-weight: 700; line-height: 1; }
.edit-hero-val.dim    { color: var(--muted); }
.edit-hero-val.bright { color: var(--blue); }
.edit-hero-name  { font-size: 11px; color: var(--muted); }
.edit-hero-arrow { font-size: 20px; color: var(--muted); }
.edit-hero-badge {
  margin-left: auto;
  background: var(--blue);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 6px;
}

.vlm-gains {
  background: #fff;
  border: 1px solid var(--gray-bd);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.vlm-gains-title { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 12px; }
.vlm-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--gray-bg);
  font-size: 13px;
  color: #444;
}
.vlm-chip { font-size: 12px; font-weight: 600; color: #16a34a; }
.vlm-chip em { font-style: normal; background: #dcfce7; padding: 1px 6px; border-radius: 10px; margin-left: 4px; }
.vlm-chip.preserved em { background: #dbeafe; color: #1d4ed8; }

.seg-fig-wrap { margin-top: 8px; }

@media (max-width: 640px) {
  .tl-bottom-grid { grid-template-columns: 1fr; }
  .transfer-flow  { flex-direction: column; }
  .tf-arrow       { transform: rotate(90deg); }
}

/* ── CP findings row ─────────────────────────────────────────────────── */
.cp-finding-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}
.cp-finding {
  background: var(--gray-bg);
  border-radius: var(--radius);
  border: 1px solid var(--gray-bd);
  padding: 22px 20px;
  text-align: center;
}
.cp-finding-num {
  font-size: 2rem;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 8px;
}
.cp-finding-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}
@media (max-width: 640px) {
  .cp-finding-row { grid-template-columns: 1fr; }
}

/* ── CP banner ───────────────────────────────────────────────────────── */
.cp-banner {
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, #0f172a, #1e3a5f);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 28px;
  gap: 0;
}
.cp-banner-item {
  flex: 1;
  text-align: center;
  color: #fff;
}
.cp-banner-icon {
  font-size: 18px;
  color: #93c5fd;
  margin-bottom: 4px;
}
.cp-banner-val {
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
}
.cp-banner-lbl {
  font-size: 12px;
  color: #93c5fd;
  line-height: 1.5;
  margin-top: 4px;
}
.cp-banner-lbl em { color: #64748b; font-style: normal; }
.cp-banner-divider {
  width: 1px;
  height: 60px;
  background: rgba(255,255,255,0.12);
  margin: 0 8px;
}

/* ── CP compare ──────────────────────────────────────────────────────── */
.cp-compare {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin-bottom: 8px;
  border: 1px solid var(--gray-bd);
  border-radius: var(--radius);
  overflow: hidden;
}
.cp-compare-col {
  flex: 1;
  padding: 24px 24px 20px;
  background: #fff;
}
.cp-compare-vs {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  background: var(--gray-bg);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.05em;
  border-left: 1px solid var(--gray-bd);
  border-right: 1px solid var(--gray-bd);
}
.cp-compare-header {
  font-size: 15px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 6px;
  display: inline-block;
  margin-bottom: 4px;
}
.cp-compare-header.standard   { background: #dbeafe; color: #1d4ed8; }
.cp-compare-header.conditional { background: #fef3c7; color: #92400e; }
.cp-compare-tag {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 16px;
}
.cp-row-group { display: flex; flex-direction: column; gap: 8px; }
.cp-metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #444;
}
.chip {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}
.chip.green  { background: #dcfce7; color: #15803d; }
.chip.amber  { background: #fef9c3; color: #a16207; }
.cp-verdict {
  font-size: 12px;
  color: var(--muted);
  margin: 16px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--gray-bg);
}

/* ── CP highlight cards ──────────────────────────────────────────────── */
.cp-highlight-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 8px;
}

.cp-card {
  background: #fff;
  border: 1px solid var(--gray-bd);
  border-radius: var(--radius);
  padding: 20px 22px;
}

.cp-card-wide {
  grid-column: 1 / -1;
  background: var(--blue-lt);
  border-color: var(--blue);
}

.cp-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.cp-card-sub {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 14px;
}

.cp-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid var(--gray-bg);
  font-size: 13px;
}

.cp-label { color: var(--muted); }
.cp-val { font-weight: 600; }
.cp-val.good { color: #16a34a; }
.cp-val.warn { color: #ca8a04; }

.cp-note {
  font-size: 12px;
  color: var(--muted);
  margin: 10px 0 0;
  font-style: italic;
}

@media (max-width: 640px) {
  .cp-highlight-grid { grid-template-columns: 1fr; }
  .cp-card-wide { grid-column: 1; }
}

/* ── BibTeX ──────────────────────────────────────────────────────────── */
.bibtex {
  background: #0f172a; color: #e2e8f0;
  border-radius: var(--radius); padding: 24px 28px;
  font-family: "Fira Code", "Courier New", monospace;
  font-size: 13.5px; line-height: 1.7; overflow-x: auto;
}

/* ── Footer ──────────────────────────────────────────────────────────── */
.footer {
  background: #0f172a; color: #64748b;
  text-align: center; padding: 24px; font-size: 13px;
}

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .hero { padding: 52px 0 44px; }
  .section { padding: 48px 0; }
  .method-grid, .dataset-grid { grid-template-columns: 1fr; }
  .results-row, .stat-grid { grid-template-columns: 1fr; }
}
