/* REACT project page. No external fonts or CDNs, so it loads fast everywhere. */
:root {
  --bg: #ffffff;
  --bg-alt: #f6f7f9;
  --ink: #16181d;
  --ink-2: #4a505c;
  --ink-3: #646b78;
  --line: #e3e6eb;
  --accent: #1f5fd1;
  --accent-soft: #e8f0fd;
  --ours: #1f5fd1;
  --ours-soft: #eef4fe;
  --base: #b9bec8;
  --human: #9aa1ad;
  --badge-bg: #b8460b;
  --radius: 10px;
  --maxw: 880px;
  --maxw-wide: 1120px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial,
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); line-height: 1.6; font-size: 17px; }
img, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.wrap.wide { max-width: var(--maxw-wide); }

/* ---------- Hero ---------- */
.hero { padding: 36px 0 8px; text-align: center; }
.title { margin: 0 0 16px; font-weight: 700; line-height: 1.15; }
.title-main { display: block; font-size: clamp(40px, 6vw, 60px); letter-spacing: 0.04em; }
.title-sub { display: block; margin-top: 8px; font-size: clamp(19px, 2.6vw, 28px); font-weight: 600; color: var(--ink-2); }
.authors, .affils { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 18px; margin: 4px 0; }
.authors { font-size: 18px; }
.affils { font-size: 15px; color: var(--ink-2); }
.marks { margin: 4px 0 0; font-size: 14px; color: var(--ink-3); }
sup { font-size: 0.68em; line-height: 0; }
.venue { margin: 12px 0 4px; }
.badge {
  display: inline-block; padding: 4px 14px; border-radius: 999px;
  background: var(--badge-bg); color: #fff; font-weight: 700; font-size: 15px; letter-spacing: 0.02em;
}
.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 18px; border-radius: 999px;
  background: var(--ink); color: #fff; font-size: 15px; font-weight: 600;
}
.btn:hover { background: #33373f; text-decoration: none; }
.btn svg { width: 16px; height: 16px; }

/* ---------- Sections ---------- */
.section { padding: 44px 0; }
.section.alt { background: var(--bg-alt); }
.section.teaser { padding-top: 16px; }
.section.teaser .wrap.wide { max-width: 1240px; }
h2 { font-size: 28px; margin: 0 0 16px; text-align: center; }
h3 { font-size: 20px; margin: 0 0 8px; }
h3.sub { margin-top: 34px; }
.kicker { font-size: 20px; font-weight: 600; color: var(--ink-2); margin-bottom: 12px; }
.lead { color: var(--ink-2); max-width: var(--maxw); margin: 0 auto 22px; text-align: center; }
.muted { color: var(--ink-3); font-weight: 500; }
.note { font-size: 14px; color: var(--ink-3); margin: 10px 0 0; }
.center { text-align: center; }
.hint { color: var(--ink-3); }
.tldr {
  background: var(--accent-soft); border-left: 4px solid var(--accent);
  padding: 14px 18px; border-radius: 0 var(--radius) var(--radius) 0; margin: 0 0 32px;
}
.tldr b { margin-right: 6px; }
.abstract { text-align: left; }

/* ---------- Video comparison ---------- */
.compare { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.compare.two { grid-template-columns: repeat(2, 1fr); max-width: 900px; margin: 18px auto 0; }
.vcell { margin: 0; }
.vcell video { width: 100%; border-radius: var(--radius); background: #000; aspect-ratio: 16 / 9; object-fit: cover; }
.compare.two .vcell video { aspect-ratio: 4 / 3; }
[data-sync-group] video, video.lazy { cursor: pointer; }
.vlabel { font-weight: 700; font-size: 16px; margin-bottom: 6px; text-align: center; }
.vcell.ours .vlabel { color: var(--ours); }
.vcell.ours video { outline: 3px solid var(--ours); outline-offset: 2px; }
.verdict { margin: 8px 0 0; font-size: 15px; color: var(--ink-2); text-align: center; }
.sync-bar { text-align: center; margin: 14px 0 0; }
.play-all, .ghost {
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  border: 1px solid #c9ced6; background: var(--bg); color: var(--ink);
  padding: 7px 16px; border-radius: 999px;
}
.play-all:hover, .ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 28px; }
.stat {
  background: var(--bg-alt); border-radius: var(--radius); padding: 16px 12px; text-align: center;
  display: flex; flex-direction: column; gap: 4px;
}
.stat b { font-size: 28px; color: var(--accent); line-height: 1.15; }
.stat span { font-size: 14px; color: var(--ink-2); line-height: 1.4; }

/* ---------- Figures & cards ---------- */
.fig { margin: 22px 0 0; }
.fig img { width: 100%; border-radius: var(--radius); background: #fff; }
.fig a { display: block; cursor: zoom-in; }
.section.alt .fig:not(.plain) img { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }
.fig figcaption { margin-top: 10px; font-size: 15px; color: var(--ink-2); }
.cards.two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card p { margin: 0 0 12px; }
.fail-list { margin: 0; padding-left: 18px; }
.fail-list li { margin-bottom: 10px; }
.figs.train { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 24px; align-items: end; }
.figs.train .fig:first-child { grid-column: 1 / -1; max-width: 820px; width: 100%; margin-left: auto; margin-right: auto; }
.figs.train .fig figcaption { text-align: center; }
.figs.train .fig:not(:first-child) img { max-height: 340px; object-fit: contain; }

/* ---------- Tables ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 15px; margin: 6px 0 0; }
.tbl-caption { font-size: 14px; color: var(--ink-3); margin: 24px 0 0; }
.tbl th, .tbl td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
.tbl thead th { font-weight: 600; border-bottom: 2px solid var(--ink); line-height: 1.25; vertical-align: bottom; }
.tbl tbody th { font-weight: 600; text-align: left; }
.tbl td:first-child, .tbl thead th:first-child { text-align: left; }
.tbl .ours { background: var(--ours-soft); }
.tbl tr.ours td { background: var(--ours-soft); font-weight: 700; }
.tbl tr.avg td { color: var(--ink-2); }
.tbl tr.total td, .tbl tr.total th { border-top: 2px solid var(--ink); }
.tbl.compact { font-size: 14px; margin-top: 8px; }
.tbl.compact td, .tbl.compact th { padding: 5px 6px; }
.table-scroll { overflow-x: auto; }
.results th.robot { vertical-align: middle; }
.results td.task, .real-tbl thead th:nth-child(2) { text-align: left; }

/* ---------- Method ---------- */
.method-row { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; padding: 26px 0; }
.method-row + .method-row { border-top: 1px solid var(--line); }
.method-row.stack { grid-template-columns: 1fr; gap: 12px; }
.method-row.stack .method-text { max-width: var(--maxw); }
.method-row.stack .method-vis { max-width: 1000px; width: 100%; margin: 0 auto; }
.method-text p { margin: 0 0 10px; }

.roll { margin: 0; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.roll-obs { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 13px; color: var(--ink-2); }
.obs-chip {
  display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--accent-soft);
  color: var(--accent); font-weight: 700; transition: background-color .3s ease, color .3s ease;
}
.obs-chip.flash { background: var(--accent); color: #fff; }
.roll-track { position: relative; height: 60px; }
.blk {
  position: absolute; top: 0; height: 100%; width: calc((100% - 32px) / 5);
  left: calc(var(--i) * ((100% - 32px) / 5 + 8px));
  border-radius: 8px; border: 3px solid var(--c, #999);
  background-color: hsl(220 6% calc(30% + var(--clean, 0) * 68%));
  background-image: radial-gradient(rgba(255, 255, 255, var(--grain, .5)) 1px, transparent 1.2px);
  background-size: 6px 6px;
  display: flex; align-items: center; justify-content: center;
  transition: left .45s ease, background-color .45s ease, transform .4s ease, opacity .4s ease;
}
.blk span {
  font-size: 12px; font-weight: 700; color: #fff; background: rgba(0, 0, 0, .62);
  padding: 0 6px; border-radius: 4px; line-height: 1.5;
}
.blk.exec { transform: translateY(-16px); opacity: 0; }
.blk.enter { opacity: 0; transform: translateX(14px); }
.roll-axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.roll-foot { display: flex; align-items: center; gap: 14px; margin-top: 10px; font-size: 13px; color: var(--ink-3); }
.roll-foot .ghost { margin-left: auto; padding: 4px 12px; font-size: 13px; }
.legend { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.sw-noise { background: hsl(220 6% 30%); }
.sw-clean { background: hsl(220 6% 96%); border: 1px solid var(--line); }
.roll-caption { font-size: 13px; color: var(--ink-2); margin: 10px 0 0; }

.stair-fig { margin: 0; }
.stair { display: flex; align-items: flex-end; gap: 10px; padding: 0 6px 0 0; }
.stair-y { align-self: stretch; display: flex; align-items: center; }
.stair-y span { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 12px; color: var(--ink-3); }
.stair-col { flex: 1; display: grid; grid-template-rows: 150px auto; }
.stair-col .bar {
  align-self: end; height: calc(var(--n) * 100%); border-radius: 6px 6px 0 0;
  background: hsl(220 6% calc(92% - var(--n) * 62%));
  border: 1px solid rgba(0, 0, 0, .08);
}
.stair-col span { font-size: 12px; color: var(--ink-2); text-align: center; margin-top: 6px; line-height: 1.3; }

/* ---------- Video grids ---------- */
.view-toggle { display: flex; justify-content: center; margin-bottom: 16px; }
.seg {
  font: inherit; font-size: 14px; padding: 6px 16px; border: 1px solid #c9ced6; background: var(--bg);
  color: var(--ink-2); cursor: pointer;
}
.seg:first-child { border-radius: 999px 0 0 999px; }
.seg:last-child { border-radius: 0 999px 999px 0; border-left: none; }
.seg.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.grid.sim { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.grid.sim .vcell { flex: 0 0 calc((100% - 36px) / 4); }
.grid.sim figcaption { font-size: 13px; text-align: center; color: var(--ink-2); margin-top: 4px; }
.grid.sim video { aspect-ratio: 4 / 3; }
.grid.real { display: grid; grid-template-columns: auto repeat(3, 1fr); gap: 12px 14px; align-items: center; margin-bottom: 8px; }
.grid.real .row-label { writing-mode: vertical-rl; transform: rotate(180deg); font-weight: 700; color: var(--ink-2); }
.grid.real video { aspect-ratio: 16 / 10; object-fit: contain; }
.grid.real figcaption { font-size: 14px; text-align: center; margin-top: 6px; color: var(--ink-2); }

/* ---------- Bar charts ---------- */
.bars { max-width: 720px; margin: 26px auto 0; }
.bars-title { font-size: 14px; color: var(--ink-3); margin: 0 0 8px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 100px; align-items: center; gap: 10px; margin: 5px 0; font-size: 14px; }
.bar-row > span { text-align: right; color: var(--ink-2); }
.bar-row em { font-style: normal; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.track { height: 16px; background: var(--bg-alt); border-radius: 4px; overflow: hidden; }
.section.alt .track { background: #e9ecf0; }
.fill { height: 100%; width: calc(var(--v) * 1%); background: var(--base); border-radius: 4px; }
.latency .fill { width: calc(var(--v) / 1600 * 100%); }
.bar-row.ours .fill { background: #8db2ee; }
.bar-row.best .fill { background: var(--ours); }
.bar-row.best span, .bar-row.best em { color: var(--ours); font-weight: 700; }
.bar-row.human .fill { background: repeating-linear-gradient(45deg, var(--human) 0 4px, #c7ccd4 4px 8px); }

.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.photos figure { margin: 0; }
.photos img { width: 100%; border-radius: var(--radius); aspect-ratio: 4 / 3; object-fit: cover; }
.photos figcaption { font-size: 14px; color: var(--ink-2); text-align: center; margin-top: 6px; }

/* ---------- Misc ---------- */
.plain-list { padding-left: 20px; }
.plain-list li { margin-bottom: 8px; }
.bib { position: relative; }
.bib pre {
  margin: 0; padding: 18px 84px 18px 18px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  white-space: pre-wrap; overflow-wrap: break-word; font-size: 13.5px; line-height: 1.5;
}
.bib .copy { position: absolute; top: 10px; right: 10px; padding: 4px 12px; font-size: 13px; }
.footer { padding: 28px 0 40px; text-align: center; font-size: 13px; color: var(--ink-3); border-top: 1px solid var(--line); }
.footer p { margin: 4px 0; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .grid.sim .vcell { flex-basis: calc((100% - 24px) / 3); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .method-row, .cards.two { grid-template-columns: 1fr; }
  .figs.train { grid-template-columns: 1fr; }
  .br-wide { display: none; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .hero { padding-top: 24px; }
  .compare, .compare.two { grid-template-columns: 1fr; }
  .grid.sim .vcell { flex-basis: calc((100% - 12px) / 2); }
  .grid.real { grid-template-columns: 1fr; }
  .grid.real .row-label { writing-mode: horizontal-tb; transform: none; margin-top: 8px; }
  .photos { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 96px 1fr 84px; font-size: 13px; }
  .tbl.results { font-size: 12px; }
  .tbl.results th, .tbl.results td { padding: 5px 3px; }
  .tbl.results thead th { white-space: normal; }
  .results td.task { white-space: normal; min-width: 6.5em; }
  .results th.robot { writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; padding: 4px 2px; }
  .bib pre { padding-right: 18px; padding-top: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .blk, .obs-chip { transition: none; }
}
