:root {
  --ink: #1c1c1e;
  --mute: #6e6e73;
  --hair: #e3e3e8;
  --bg: #ffffff;
  --panel: #f6f6f8;
  --ours: #f1f7f3;
  --grn: #2e8b57;
  --org: #e0861a;
  --blu: #3a7acb;
  --red: #c8322d;
  --maxw: 1100px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: Inter, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 17px; line-height: 1.6; -webkit-font-smoothing: antialiased;
}
a { color: var(--blu); text-decoration: none; }
a:hover { text-decoration: underline; }
img, video { display: block; max-width: 100%; }

/* ---------- hero ---------- */
.hero { max-width: var(--maxw); margin: 0 auto; padding: 64px 24px 24px; text-align: center; }
.title { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
.rmd { display: block; font-size: 72px; line-height: 1.05; font-weight: 700; }
.subtitle { display: block; margin-top: 14px; font-size: 28px; line-height: 1.35; font-weight: 400; }
.re { color: var(--grn); } .me { color: var(--org); } .di { color: var(--blu); }
.subtitle .re, .subtitle .me, .subtitle .di { font-weight: 600; }
.authors { margin: 28px auto 6px; max-width: 900px; font-size: 18px; }
.authors span { display: inline-block; margin: 0 10px; white-space: nowrap; }
.affils { margin: 0 auto; max-width: 900px; font-size: 14.5px; color: var(--mute); line-height: 1.5; }
.affils span { display: inline-block; margin: 0 8px; }
.note { margin: 6px 0 0; font-size: 13.5px; color: var(--mute); }
sup { font-size: 0.68em; }

.links { margin-top: 26px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border-radius: 999px;
  background: var(--ink); color: #fff; font-size: 15px; font-weight: 500;
}
.btn:hover { text-decoration: none; background: #3a3a3c; }
.btn svg { width: 20px; height: 20px; }
.btn.disabled { background: #d1d1d6; color: #fff; cursor: default; pointer-events: none; }

/* ---------- sections ---------- */
main { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
section { padding: 36px 0 12px; }
h2 { font-size: 30px; font-weight: 600; margin: 0 0 18px; text-align: center; }
h2::after { content: ""; display: block; width: 48px; height: 3px; background: var(--grn); margin: 10px auto 0; border-radius: 2px; }
h3 { font-size: 21px; font-weight: 600; margin: 0 0 8px; }
h3.sub { margin-top: 40px; text-align: center; }
#abstract p { max-width: 880px; margin: 0 auto; text-align: justify; hyphens: auto; }
.lead { max-width: 880px; margin: 0 auto 22px; color: #3a3a3c; text-align: center; }
.hint, .caption { text-align: center; color: var(--mute); font-size: 14.5px; margin: 10px 0 0; }

figure { margin: 0; }
figure img { width: 100%; border-radius: 6px; }
figcaption { margin: 12px auto 0; max-width: 960px; font-size: 14.5px; color: #3a3a3c; line-height: 1.55; }
.teaser figure img { border: 1px solid var(--hair); }
figure.wide { margin-top: 26px; }
figure.narrow { max-width: 560px; margin: 34px auto 0; }

.video-wrap { max-width: 960px; margin: 0 auto; border-radius: 10px; overflow: hidden; box-shadow: 0 6px 28px rgba(0,0,0,.12); background: #000; }
.video-wrap video { width: 100%; }

/* ---------- method ---------- */
.key-idea { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.idea { display: flex; gap: 16px; background: var(--panel); border-radius: 12px; padding: 20px 22px; }
.idea p { margin: 0 0 8px; font-size: 15.5px; }
.idea-num {
  flex: 0 0 34px; height: 34px; border-radius: 50%; background: var(--grn); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 600;
}
.eq { text-align: center; font-family: "Times New Roman", serif; font-size: 20px !important; margin: 10px 0 !important; }

/* ---------- results ---------- */
.result-block { margin-top: 30px; }
.result-block h3 { text-align: center; }
.tag { font-size: 13px; font-weight: 500; color: var(--mute); background: var(--panel); border-radius: 999px; padding: 3px 10px; margin-left: 6px; vertical-align: middle; }
.thumbs { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 14px 0 18px; }
.thumb {
  width: 76px; height: 76px; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden;
  cursor: pointer; background: none; opacity: .62; transition: opacity .15s, border-color .15s, transform .15s;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb:hover { opacity: 1; transform: translateY(-2px); }
.thumb.active { opacity: 1; border-color: var(--grn); }

.grid { display: grid; gap: 8px 8px; align-items: center; }
.grid .rowlab { font-size: 14px; color: var(--mute); text-align: right; padding-right: 6px; line-height: 1.25; }
.grid .colhead { font-size: 14px; font-weight: 600; text-align: center; padding: 6px 2px; line-height: 1.25; }
.grid .colhead.ours { color: var(--grn); }
.grid .colhead.input { color: var(--mute); font-weight: 500; }
.cell { position: relative; aspect-ratio: 1 / 1; overflow: hidden; border-radius: 4px; background: #fff; border: 1px solid var(--hair); }
.cell.ours { outline: 2px solid var(--grn); outline-offset: 1px; }
.cell.empty { background: transparent; border: none; }
.cell img, .cell video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transform-origin: var(--zx, 50%) var(--zy, 50%); transition: transform .18s ease-out;
}
.grid.zoomed .cell img, .grid.zoomed .cell video { transform: scale(var(--zs, 2.6)); }
.cell .lens { position: absolute; pointer-events: none; border: 2px solid #f5c400; border-radius: 3px; display: none; }
.grid.zoomed .cell.src .lens { display: none; }

/* ---------- table ---------- */
.table-wrap { overflow-x: auto; margin-top: 12px; }
table.metrics { border-collapse: collapse; margin: 0 auto; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.metrics th, .metrics td { padding: 6px 10px; text-align: center; white-space: nowrap; }
.metrics thead tr:first-child th { border-top: 2px solid var(--ink); }
.metrics thead tr:last-child th { border-bottom: 1px solid var(--ink); font-weight: 500; color: var(--mute); }
.metrics th[colspan] { border-bottom: 1px solid var(--hair); }
.metrics td:first-child, .metrics th:first-child { text-align: left; }
.metrics tbody tr:last-child td { border-bottom: 2px solid var(--ink); }
.metrics tr.ours td { background: var(--ours); }
.metrics tr.ours td:first-child { font-weight: 600; color: var(--grn); }
.metrics .best { font-weight: 700; }
.metrics .second { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- bibtex ---------- */
.bib { position: relative; max-width: 880px; margin: 0 auto; }
.bib pre { margin: 0; background: var(--panel); border-radius: 10px; padding: 18px 20px; overflow-x: auto; font: 13.5px/1.55 "JetBrains Mono", Menlo, monospace; }
.copy {
  position: absolute; top: 10px; right: 10px; border: 1px solid var(--hair); background: #fff; color: var(--ink);
  border-radius: 6px; padding: 4px 10px; font: 500 13px Inter, sans-serif; cursor: pointer;
}
.copy:hover { background: var(--panel); }

footer { max-width: var(--maxw); margin: 40px auto 0; padding: 24px; text-align: center; color: var(--mute); font-size: 13.5px; border-top: 1px solid var(--hair); }

/* ---------- small screens ---------- */
@media (max-width: 820px) {
  body { font-size: 16px; }
  .rmd { font-size: 52px; }
  .subtitle { font-size: 20px; }
  .subtitle br { display: none; }
  .key-idea { grid-template-columns: 1fr; }
  .grid .rowlab { font-size: 11.5px; padding-right: 2px; }
  .grid .colhead { font-size: 10.5px; word-break: break-word; hyphens: auto; }
  .tag { display: table; margin: 6px auto 0; }
  .grid { gap: 4px; }
  .thumb { width: 58px; height: 58px; }
}
