/* Single-page project showcase. System fonts only, no external resources. */

:root {
  --bg: #ffffff;
  --text: #1d2125;
  --muted: #5b6168;
  --faint: #8a9097;
  --rule: #e3e5e8;
  --card: #ffffff;
  --band: #f5f6f7;
  --link: #1f5fae;
  --link-hover: #0d3f7a;
  --btn: #363636;
  --btn-hover: #141414;
  --ours: #f1f5fb;
  --max: 960px;
  --gutter: 20px;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC",
    "WenQuanYi Micro Hei", sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

a { color: var(--link); text-decoration: none; }
a:hover, a:focus { color: var(--link-hover); text-decoration: underline; }

img, video { max-width: 100%; display: block; }

.page {
  max-width: var(--max);
  margin: 0 auto;
  padding: 48px var(--gutter) 32px;
}

[id] { scroll-margin-top: 16px; }

/* ---------- header ---------- */
.intro h1 {
  margin: 0 0 6px;
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.intro h1 .cn { font-weight: 400; color: var(--muted); }
.intro p { margin: 4px 0; }
.intro .affil { color: var(--muted); }
.intro .note { margin-top: 14px; }

.toc {
  margin: 26px 0 0;
  padding: 10px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  font-size: 0.93rem;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
}

/* ---------- paper blocks (project-page layout) ---------- */
.paper, .project {
  padding: 56px 0 20px;
  border-bottom: 1px solid var(--rule);
}
.project:last-of-type { border-bottom: none; }

.paper-head {
  max-width: 880px;
  margin: 0 auto 30px;
  text-align: center;
}
.paper-head .paper-title {
  margin: 0 0 14px;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.paper-head .authors { margin: 0 0 2px; font-size: 1.08rem; }
.paper-head .venue-line { margin: 0 0 16px; color: var(--muted); font-size: 0.98rem; }
.links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 10px;
}
.btn {
  display: inline-block;
  padding: 6px 18px;
  border-radius: 999px;
  background: var(--btn);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
}
.btn:hover, .btn:focus { background: var(--btn-hover); color: #fff; text-decoration: none; }
.btn.off { background: #e8e9eb; color: #7d838a; cursor: default; }

.sec-title {
  margin: 44px 0 16px;
  text-align: center;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.3;
}

.abstract {
  max-width: 820px;
  margin: 0 auto;
  text-align: justify;
  -webkit-hyphens: auto;
  hyphens: auto;
}

.project p { margin: 0 0 12px; }
.project h2 {
  margin: 0 0 14px;
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1.3;
}

/* ---------- figures, videos ---------- */
figure { margin: 18px 0 26px; }
figure img {
  width: 100%;
  height: auto;
  background: var(--card);
  border-radius: 4px;
}
figcaption {
  margin-top: 10px;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--muted);
  text-align: justify;
}
figcaption b { color: var(--text); font-weight: 600; }
.teaser { max-width: 600px; margin: 0 auto 8px; }
.wide { margin: 8px 0 26px; }

.video {
  width: 100%;
  height: auto;
  background: #000;
  border-radius: 6px;
}

/* full-width light band behind rollout videos (no horizontal overflow) */
.band {
  background: var(--band);
  box-shadow: 0 0 0 100vmax var(--band);
  -webkit-clip-path: inset(0 -100vmax);
  clip-path: inset(0 -100vmax);
  padding: 22px 0 24px;
  margin: 0 0 30px;
}
.band .band-note { margin: 0 0 14px; text-align: center; color: var(--muted); font-size: 0.9rem; }

.vgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px 14px;
}
.vgrid figure { margin: 0; }
.vgrid video {
  width: 100%;
  height: auto;
  background: #000;
  border-radius: 6px;
}
.vgrid figcaption { margin-top: 6px; text-align: center; font-size: 0.85rem; line-height: 1.4; }
.vgrid figcaption b { display: block; font-size: 0.92rem; }
.vgrid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.video-placeholder {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px dashed #c6cbd1;
  border-radius: 6px;
  color: var(--faint);
  font-size: 1rem;
  letter-spacing: 0.02em;
}

/* ---------- results table ---------- */
.table-fig { max-width: 820px; margin: 4px auto 26px; }
.table-wrap { overflow-x: auto; }
table.results {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}
table.results th, table.results td { padding: 5px 10px; text-align: center; white-space: nowrap; }
table.results thead th { border-top: 2px solid var(--text); border-bottom: 1px solid var(--text); font-weight: 600; }
table.results tbody th { text-align: left; font-weight: 400; }
table.results tbody tr:last-child th, table.results tbody tr:last-child td { border-bottom: 2px solid var(--text); }
table.results tr.ours { background: var(--ours); }
table.results tr.ours th { font-weight: 600; }
table.results sup, table.results sub { font-size: 0.72em; }

/* ---------- robot architecture figure ---------- */
.arch-fig { margin: 20px 0 30px; }
.arch-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 330px);
  gap: 24px;
  align-items: stretch;
}
.arch-panel { display: flex; flex-direction: column; min-width: 0; }
.project .panel-label {
  margin: 0 0 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}
.arch { flex: 1 1 auto; display: flex; flex-direction: column; }
.layer {
  --c: #2b4a6f;
  --t: #f4f6f9;
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--rule);
  border-left: 4px solid var(--c);
  border-radius: 6px;
  background: var(--t);
}
.l-app  { --c: #24589a; --t: #f1f5fb; }
.l-nav  { --c: #2b6e47; --t: #f0f7f2; }
.l-ctrl { --c: #8a520c; --t: #fbf6ee; }
.l-body { --c: #54468f; --t: #f4f2fa; }
.layer .lname { font-weight: 700; font-size: 0.9rem; color: var(--c); line-height: 1.25; }
.items { display: flex; flex-direction: column; gap: 6px; }
.items .row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px 6px; }
.items span {
  font-size: 0.8rem;
  line-height: 1.35;
  padding: 2px 8px;
  background: #fff;
  border: 1px solid #d8dce2;
  border-radius: 4px;
}
.items b {
  min-width: 4.6em;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--faint);
}
.up { padding: 4px 0; }
.up::before {
  content: "";
  display: block;
  width: 0;
  height: 0;
  margin: 0 auto;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 7px solid #9aa1a9;
}
.arch-fig figcaption { text-align: left; }

/* photo with SVG labels on top (viewBox matches the photo's pixel grid) */
.annot { position: relative; border: 1px solid var(--rule); border-radius: 4px; overflow: hidden; }
.annot img { width: 100%; height: auto; border-radius: 0; }
.annot svg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.legend { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 3px; font-size: 0.85rem; line-height: 1.4; }
.legend li { display: flex; align-items: center; gap: 7px; }
.legend .k {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.45em;
  height: 1.45em;
  border: 1.5px solid #14181c;
  border-radius: 50%;
  background: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}

/* portrait video beside text and photos */
.video-side {
  display: grid;
  grid-template-columns: minmax(0, 210px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  margin-bottom: 8px;
}
.video-side > figure { margin: 0; }
.video-side figcaption { text-align: left; }
.video-side .photos { margin: 16px 0 24px; }

/* photo strip: flex weights proportional to aspect ratio -> equal heights */
.photos {
  display: flex;
  gap: 10px;
  margin: 22px 0 26px;
}
.photos figure { margin: 0; min-width: 0; }
.photos .portrait { flex: 9 1 0%; }
.photos .landscape { flex: 16 1 0%; }
.photos img { width: 100%; border-radius: 4px; border: 1px solid var(--rule); object-fit: cover; }
.photos .portrait img { aspect-ratio: 3 / 4; }
.photos .landscape img { aspect-ratio: 4 / 3; }
.photos figcaption { font-size: 0.8rem; margin-top: 5px; text-align: left; }
.project .photos-note { margin: -16px 0 22px; font-size: 0.85rem; color: var(--faint); }

/* ---------- papers ---------- */
ol.papers { margin: 0; padding-left: 1.3em; }
ol.papers li { margin: 0 0 14px; }
.ptitle { font-weight: 600; }
.venue { font-style: italic; }

footer {
  margin-top: 36px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  color: var(--faint);
  font-size: 0.85rem;
}

/* ---------- narrow screens ---------- */
@media (max-width: 720px) {
  .page { padding-top: 32px; }
  .intro h1 { font-size: 1.65rem; }
  .paper, .project { padding-top: 40px; }
  .paper-head .paper-title { font-size: 1.4rem; }
  .paper-head .authors { font-size: 0.98rem; }
  .btn { padding: 5px 14px; font-size: 0.9rem; }
  .sec-title { margin-top: 34px; font-size: 1.3rem; }
  .abstract { text-align: left; -webkit-hyphens: manual; hyphens: manual; }
  figcaption { text-align: left; }
  .vgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; }
  .vgrid-2 { grid-template-columns: 1fr; }
  .video-placeholder { height: 140px; }
  .arch-grid { grid-template-columns: 1fr; gap: 22px; }
  .arch-panel:last-child { max-width: 380px; width: 100%; margin: 0 auto; }
  .layer { grid-template-columns: 1fr; gap: 6px; }
  .video-side { grid-template-columns: 1fr; gap: 18px; }
  .video-side .portrait-video { max-width: 260px; width: 100%; margin: 0 auto; }
  .photos { display: grid; grid-template-columns: 1fr 1fr; grid-auto-flow: dense; gap: 10px; }
  .photos .landscape { grid-column: 1 / -1; }
}
