:root {
  color-scheme: light;
  --accent: #0369ff;
  --accent-soft: #eaf2fb;
  --ink: #16202b;
  --ink-2: #4a5765;
  --line: #e3e8ee;
  --bg: #ffffff;
  --bg-2: #f6f8fb;
  --open: #1f7a3d;
  --closed: #b3261e;
  --radius: 14px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 16px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.05em 0.35em;
}

/* Hero */
.hero {
  background: linear-gradient(180deg, var(--accent-soft) 0%, var(--bg) 100%);
  padding: 64px 0 28px;
  text-align: center;
}

.title {
  margin: 0 auto 22px;
  max-width: 900px;
  font-size: clamp(1.75rem, 4.2vw, 2.75rem);
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand { color: var(--accent); }
.nowrap { white-space: nowrap; }

.authors {
  margin: 0 auto 6px;
  max-width: 880px;
  font-size: 1.08rem;
  font-weight: 500;
}

.author { white-space: nowrap; }
.author:not(:last-child)::after { content: ","; margin-right: 0.45em; }

.affiliations {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.98rem;
}
.affiliations span { white-space: nowrap; margin: 0 0.55em; }

.note {
  margin: 4px 0 0;
  color: var(--ink-2);
  font-size: 0.85rem;
}

sup { font-size: 0.68em; line-height: 0; }

.logos {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 18px 40px;
  margin-top: 22px;
}
.logos img { height: 48px; width: auto; }
@media (max-width: 520px) {
  .logos { gap: 14px 16px; }
  .logos img { height: 32px; }
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.2;
  transition: background 0.15s ease, transform 0.15s ease;
}
.btn:hover { background: var(--accent); text-decoration: none; transform: translateY(-1px); }
.btn svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
.btn small { font-weight: 500; opacity: 0.8; }
.btn.disabled { background: #8b96a3; cursor: default; }
.btn.disabled:hover { background: #8b96a3; transform: none; }

/* Sections */
main section { padding: 34px 16px 10px; }
main section.container { padding-left: 16px; padding-right: 16px; }

h2 {
  margin: 0 0 14px;
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

h3 { margin: 0 0 6px; font-size: 1.05rem; font-weight: 700; line-height: 1.35; }
h3.sub { margin: 30px 0 10px; font-size: 1.25rem; }

p { margin: 0 0 14px; }

figure { margin: 0 0 18px; }
figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
}
figcaption {
  margin-top: 10px;
  color: var(--ink-2);
  font-size: 0.9rem;
  line-height: 1.55;
}

.demo { padding-top: 24px; }
.demo video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #070b14;
  box-shadow: 0 18px 50px rgba(7, 11, 20, 0.18);
}
.demo-caption {
  margin: 10px 2px 0;
  color: var(--ink-2);
  font-size: 0.9rem;
  line-height: 1.55;
}

.teaser { padding-top: 20px; }
.teaser figure img { border: 1px solid var(--line); }

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 26px 0 6px;
}
.stat {
  background: var(--accent-soft);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.stat-value {
  font-size: 2.3rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--accent);
  letter-spacing: -0.02em;
}
.stat-value span { font-size: 0.6em; margin-left: 2px; }
.stat-label { margin-top: 6px; color: var(--ink-2); font-size: 0.92rem; line-height: 1.45; }
.stat-label b { color: var(--ink); }

/* Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  background: var(--bg);
}
.card p { margin: 0; color: var(--ink-2); font-size: 0.95rem; line-height: 1.55; }
.card-num {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 10px;
}
.cards.cases { margin-top: 4px; }

.takeaway {
  margin: 18px 0 14px;
  padding: 14px 20px;
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--accent-soft);
  font-size: 1.05rem;
}

/* Method steps */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.step {
  background: var(--bg-2);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.step h3 { display: flex; align-items: baseline; gap: 8px; }
.step h3 span {
  flex: none;
  display: inline-grid; place-items: center;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 0.8rem;
  transform: translateY(-1px);
}
.step p { color: var(--ink-2); font-size: 0.95rem; line-height: 1.55; margin-bottom: 8px; }
.step p:last-child { margin-bottom: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips code { background: #fff; }

/* Tables */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 8px 0 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.table-wrap.narrow { max-width: 720px; margin-left: auto; margin-right: auto; }

table.results {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}
table.results caption {
  caption-side: bottom;
  text-align: left;
  padding: 12px 16px;
  color: var(--ink-2);
  font-size: 0.85rem;
  line-height: 1.5;
  border-top: 1px solid var(--line);
}
table.results th, table.results td {
  padding: 7px 12px;
  text-align: center;
  white-space: nowrap;
}
table.results th:first-child, table.results td:first-child { text-align: left; }
table.results thead th {
  background: var(--bg-2);
  font-weight: 700;
  border-bottom: 1px solid var(--line);
}
table.results tbody tr { border-bottom: 1px solid #f0f2f5; }
table.results tr.group td {
  background: #fafbfc;
  color: var(--ink-2);
  font-style: italic;
  font-size: 0.85rem;
  padding-top: 9px;
}
table.results tr.ours td { background: var(--accent-soft); font-weight: 600; }
table.results tr.sep td { border-top: 2px solid var(--line); }
table.results td.na { color: #9aa4af; }
table.results b { font-weight: 800; }
table.results u { text-underline-offset: 3px; }
.d-open, .d-closed { font-size: 0.78em; font-weight: 600; }
.d-open { color: var(--open); }
.d-closed { color: var(--closed); }

.k-asr { color: #4f7f6a; font-weight: 600; }
.k-pic { color: #b3403a; font-weight: 600; }
.k-aud { color: #3d6a9e; font-weight: 600; }

/* Tabs */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0 14px;
}
.tabs button {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink-2);
  cursor: pointer;
}
.tabs button:hover { border-color: var(--accent); color: var(--accent); }
.tabs button[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.case-panel img { border: 1px solid var(--line); }
.case-panel a:hover { text-decoration: none; }

/* BibTeX */
.bib { position: relative; }
.bib pre {
  margin: 0;
  padding: 18px 20px;
  overflow-x: auto;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.85rem;
  line-height: 1.6;
}
.bib pre code { background: none; border: 0; padding: 0; font-size: inherit; }
.copy {
  position: absolute;
  top: 10px;
  right: 10px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  cursor: pointer;
}
.copy:hover { color: var(--accent); border-color: var(--accent); }

footer {
  margin-top: 40px;
  padding: 26px 0 34px;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 0.88rem;
  text-align: center;
}
footer p { margin: 0; }

@media (max-width: 820px) {
  body { font-size: 16px; }
  .hero { padding-top: 40px; }
  .stats, .cards, .steps { grid-template-columns: 1fr; }
  .stat-value { font-size: 2rem; }
  h2 { font-size: 1.45rem; }
}
