/* SomaWAM — Editorial Robotics Research Layout (crisp studio paper + quiet left TOC + calm single-column storytelling). */
:root {
  --bg: #f6f7fa;
  --surface: #ffffff;
  --surface-soft: #f2f4f8;
  --console: #11151d;
  --console-2: #181e2a;
  --console-line: rgba(255, 255, 255, .11);

  --ink: #182030;
  --ink-2: #424d61;
  --muted: #6c778b;
  --line: #e4e7ef;
  --line-2: #cfd5e2;

  --violet: #6236c4;
  --violet-bright: #8557e6;
  --violet-soft: #f3eefe;
  --violet-line: #d9c8fa;
  --cobalt: #1d5bbf;
  --cobalt-soft: #edf4fd;
  --emerald: #0f766e;
  --emerald-soft: #eaf9f6;
  --emerald-line: #b9e7df;
  --amber: #c26a0a;
  --amber-bright: #e88a17;
  --amber-soft: #fef6ea;

  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 1px 2px rgba(20, 28, 46, .035), 0 8px 26px rgba(20, 28, 46, .045);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 32px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--cobalt); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; -webkit-tap-highlight-color: transparent; }
h1, h2, h3, h4, p, figure { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 3px; border-radius: 6px; }
.skip-link { position: fixed; left: 16px; top: -80px; z-index: 100; padding: 10px 14px; background: #fff; border-radius: 10px; box-shadow: var(--shadow); }
.skip-link:focus { top: 12px; }

/* ------------------------------------------------------------------ Page Shell: Quiet Left TOC + Editorial Column */
.mobile-bar {
  display: none;
  position: sticky; top: 0; z-index: 40;
  align-items: center; justify-content: space-between; gap: 12px;
  height: 54px; padding: 0 18px;
  background: rgba(246, 247, 250, .92);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.wordmark { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); font-weight: 800; font-size: 16.5px; letter-spacing: -.02em; }
.wordmark b { color: var(--violet); }
.wordmark:hover { text-decoration: none; }
.ghost-mark { height: 32px; width: auto; display: block; mix-blend-mode: multiply; flex: 0 0 auto; }

.page-frame {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 28px 80px;
  display: grid;
  grid-template-columns: 168px minmax(0, 960px);
  gap: 36px;
  align-items: start;
}

.side-toc {
  position: sticky;
  top: 44px;
  padding-top: 4px;
}
.toc-brand {
  display: flex; align-items: center; gap: 9px;
  margin-bottom: 28px;
  color: var(--ink); font-weight: 800; font-size: 17px; letter-spacing: -.02em;
}
.toc-brand b { color: var(--violet); }
.toc-brand:hover { text-decoration: none; }
.toc-brand .ghost-mark { height: 38px; }
.toc-kicker {
  font: 700 10.5px/1 var(--mono);
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}
.side-toc nav {
  display: flex;
  flex-direction: column;
  border-left: 1.5px solid var(--line-2);
}
.side-toc nav a {
  padding: 6px 0 6px 14px;
  margin-left: -1.5px;
  border-left: 2px solid transparent;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  transition: color .16s, border-color .16s;
}
.side-toc nav a:hover { text-decoration: none; color: var(--ink); }
.side-toc nav a.is-active {
  color: var(--ink);
  font-weight: 700;
  border-left-color: var(--violet);
}

.article-col { min-width: 0; }

/* ------------------------------------------------------------------ Shared Editorial Card & Typography Rhythm */
.ed-sec { padding-top: 64px; }
.ed-sec-head {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; flex-wrap: wrap;
  margin-bottom: 22px;
}
.ed-sec-title {
  font: 700 clamp(28px, 3.2vw, 38px)/1.12 var(--serif);
  letter-spacing: -.022em;
  color: var(--ink);
}
.ed-sec-sub {
  margin-top: 6px;
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 680px;
}

.ed-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  box-shadow: var(--shadow);
}
.ed-card + .ed-card { margin-top: 22px; }
.ed-kicker {
  font: 700 11px/1 var(--mono);
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: var(--muted);
}
.ed-card h3 {
  margin-top: 9px;
  font: 700 clamp(21px, 2.3vw, 27px)/1.22 var(--serif);
  letter-spacing: -.018em;
  color: var(--ink);
}
.ed-prose {
  margin-top: 10px;
  font-size: 15.5px;
  line-height: 1.72;
  color: var(--ink-2);
}
.ed-prose strong { color: var(--ink); }

.ed-figure-btn {
  display: block; width: 100%; margin-top: 20px; padding: 12px 12px 8px;
  border-radius: var(--radius); border: 1px solid var(--line); background: #fff;
  text-align: right; transition: border-color .18s, box-shadow .18s;
}
.ed-figure-btn:hover { border-color: var(--line-2); box-shadow: 0 8px 24px rgba(20, 28, 46, .06); }
.ed-figure-btn img { width: 100%; height: auto; border-radius: 8px; }
.ed-fig-cap { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 9px; font-size: 12.5px; color: var(--muted); text-align: left; }
.ed-fig-cap b { color: var(--cobalt); font-weight: 700; white-space: nowrap; }

/* ------------------------------------------------------------------ ACT 1 · OVERVIEW (HERO + MAIN VIDEO) */
.hero-sec { padding-top: 38px; }
.hero-top-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 172px;
  gap: 24px;
  align-items: center;
}
.hero-kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font: 700 11.5px/1 var(--mono); letter-spacing: 1.3px; text-transform: uppercase;
  color: var(--muted);
}
.hero-sec h1 {
  margin-top: 10px;
  font: 700 clamp(32px, 4.3vw, 50px)/1.08 var(--serif);
  letter-spacing: -.028em;
  color: var(--ink);
  text-wrap: balance;
}
.hero-sec h1 .brand { color: var(--violet); }
.hero-ghost-fig {
  width: 172px; height: auto; display: block;
  mix-blend-mode: multiply;
  justify-self: end;
}

.hero-authors-block { margin-top: 18px; text-align: center; }
.authors { font-size: 15.5px; font-weight: 600; color: var(--ink); }
.author-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 18px; line-height: 1.72; }
.author-row span { white-space: nowrap; }
.author-row a { color: var(--ink); }
.author-row a:hover { color: var(--cobalt); }
.author-row sup { font-size: .72em; line-height: 0; vertical-align: super; margin-left: 1px; font-weight: 600; }
.mk-dag { margin-left: 1px; color: var(--ink-2); }

.hero-meta-line {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 20px;
  margin-top: 8px; font-size: 13.5px; color: var(--muted);
}
.hero-meta-line .affil { color: var(--ink-2); font-weight: 700; display: inline-flex; align-items: center; gap: 8px; }
.logo-pku { display: inline-block; aspect-ratio: 852 / 240; height: 26px; background: #94070a; -webkit-mask: url(../assets/logos/pku-white.png) center / contain no-repeat; mask: url(../assets/logos/pku-white.png) center / contain no-repeat; vertical-align: middle; }

.hero-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
.pill-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 18px;
  border-radius: 999px; border: 1px solid var(--line-2); background: #fff;
  color: var(--ink); font-size: 14px; font-weight: 700; transition: all .16s;
}
.pill-btn:hover { text-decoration: none; border-color: var(--ink); transform: translateY(-1px); }
.pill-btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.pill-btn.primary:hover { background: #293349; }
.pill-btn.pending { opacity: .66; cursor: default; background: var(--surface-soft); }
.pill-btn.pending:hover { transform: none; border-color: var(--line-2); }
.pill-btn .tag-soon { font-size: 10.5px; font-weight: 600; padding: 1px 6px; border-radius: 999px; background: #fff; color: var(--muted); border: 1px solid var(--line); }

/* Hero Video — Clean, Uncluttered Full-Width Showcase */
.hero-video-wrap { margin-top: 26px; }
.overview-video-box {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  background: #0c1018; border: 1px solid var(--line-2); box-shadow: 0 18px 50px rgba(20, 28, 46, .11);
}
.overview-video-box video { width: 100%; aspect-ratio: 16 / 9; display: block; background: #000; }
.hero-video-badge {
  position: absolute; left: 14px; top: 14px; z-index: 4;
  padding: 4px 11px; border-radius: 999px;
  background: rgba(17, 21, 29, .78); color: #f8fafc;
  font: 600 12px var(--mono); backdrop-filter: blur(8px); pointer-events: none;
}

/* Click-to-Play Facade Overlay (0 video bytes downloaded before user clicks) */
.vid-facade-poster { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-media.is-43 .vid-facade-poster { object-fit: contain; background: #0c0e13; }
.vid-play-overlay {
  position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px;
  background: linear-gradient(180deg, rgba(12, 15, 22, .03) 0%, rgba(12, 15, 22, .22) 100%);
  color: #fff; cursor: pointer; transition: background .18s;
}
.vid-play-overlay:hover { background: rgba(12, 15, 22, .32); }
.overview-video-box .vid-play-overlay {
  justify-content: flex-end; padding-bottom: 42px;
  background: linear-gradient(180deg, transparent 52%, rgba(12, 15, 22, .38) 100%);
}
.overview-video-box .vid-play-overlay:hover { background: linear-gradient(180deg, rgba(12, 15, 22, .06) 0%, rgba(12, 15, 22, .48) 100%); }
.play-ring {
  width: 54px; height: 54px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(17, 21, 29, .82); border: 1.5px solid rgba(255, 255, 255, .45);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
  transition: transform .18s, background .18s, border-color .18s;
}
.vid-play-overlay.is-sm .play-ring { width: 44px; height: 44px; }
.vid-play-overlay:hover .play-ring { transform: scale(1.08); background: var(--violet); border-color: #fff; }
.play-ring svg { width: 22px; height: 22px; margin-left: 2px; }
.play-cap {
  padding: 5px 14px; border-radius: 999px;
  background: rgba(17, 21, 29, .86); border: 1px solid rgba(255, 255, 255, .22);
  font: 600 12.5px var(--mono); color: #f8fafc; backdrop-filter: blur(8px);
}

.chapter-strip { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; justify-content: center; }
.chapter-strip button {
  padding: 4px 10px; border-radius: 999px; font: 500 11.5px var(--mono); color: var(--ink-2);
  background: #fff; border: 1px solid var(--line); transition: all .15s;
}
.chapter-strip button:hover { border-color: var(--ink); color: var(--ink); }

/* ------------------------------------------------------------------ ACT 2 · ABSTRACT + HEADLINE STRIP */
.abstract-sec { padding-top: 28px; }
.abstract-card p { margin-top: 12px; font-size: 15.5px; line-height: 1.78; color: var(--ink-2); text-align: justify; }
.abstract-card strong { color: var(--ink); }

.kpi-strip {
  margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px;
  align-items: stretch;
}
.kpi-item { padding: 10px 12px; border-radius: 12px; }
.kpi-item.is-featured {
  background: linear-gradient(135deg, #edf4fd 0%, #f3eefe 100%);
  border: 1.5px solid #c7daf8;
}
.kpi-item strong { display: block; font: 800 24px/1.05 var(--sans); letter-spacing: -.025em; color: var(--ink); }
.kpi-item.is-featured strong { font-size: 27px; color: var(--cobalt); }
.kpi-item:nth-child(2) strong { color: var(--violet); }
.kpi-item:nth-child(3) strong { color: var(--emerald); }
.kpi-item:nth-child(4) strong { color: var(--amber); }
.kpi-item span { display: block; margin-top: 4px; font-size: 13px; font-weight: 700; color: var(--ink); }
.kpi-item small { display: block; margin-top: 1px; font-size: 11.5px; color: var(--muted); }

.simple-callout-bar {
  margin-top: 16px;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px;
  padding: 12px 14px; border-radius: 12px;
  background: linear-gradient(90deg, #edf4fd 0%, #f3eefe 100%);
  border: 1px solid #cfdff9;
}
.simple-callout-cell { text-align: center; }
.simple-callout-cell strong { display: block; font: 800 22px/1.05 var(--sans); color: var(--cobalt); }
.simple-callout-cell:first-child strong { color: var(--violet); font-size: 24px; }
.simple-callout-cell span { display: block; margin-top: 3px; font: 600 11px var(--mono); color: var(--ink-2); }

/* ------------------------------------------------------------------ ACT 3 · DEMOS (CLEAN CATEGORY TABS) */
.demo-cat-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.demo-cat-tabs button {
  padding: 7px 15px; border-radius: 999px; font-size: 13.5px; font-weight: 700;
  color: var(--ink-2); background: #fff; border: 1px solid var(--line-2); transition: all .16s;
}
.demo-cat-tabs button:hover { border-color: var(--ink); color: var(--ink); }
.demo-cat-tabs button[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

/* Task selector row */
.task-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.task-thumb-btn {
  display: flex; align-items: center; gap: 8px; padding: 7px 8px;
  border-radius: 12px; background: #fff; border: 1px solid var(--line);
  text-align: left; transition: all .16s;
}
.task-thumb-btn:hover { border-color: var(--line-2); }
.task-thumb-btn[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.task-thumb-btn img { width: 32px; height: 44px; border-radius: 6px; object-fit: cover; flex: 0 0 auto; background: #12151c; }
.task-thumb-meta { min-width: 0; }
.task-thumb-meta strong { display: block; font-size: 12.5px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-thumb-meta span { display: block; margin-top: 2px; font: 700 11px var(--mono); color: var(--violet); }
.task-thumb-btn[aria-selected="true"] .task-thumb-meta span { color: #c4b5fd; }

/* Editorial Real-World Demo Card (videos crisp on top, synced stage + code cleanly below!) */
.demo-stage-card { padding: 0; overflow: hidden; }
.demo-stage-top {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 16px 24px; border-bottom: 1px solid var(--line); background: #fff;
}
.demo-stage-title h3 { margin: 0; font: 700 22px/1.2 var(--serif); color: var(--ink); }
.demo-stage-title p { margin-top: 3px; font: italic 500 14px/1.45 var(--serif); color: var(--ink-2); }
.demo-stage-score { text-align: right; }
.demo-stage-score strong { font: 800 24px/1 var(--sans); color: var(--violet); }
.demo-stage-score span { display: block; font: 600 11px var(--mono); color: var(--muted); margin-top: 2px; }

.demo-video-band { background: var(--console); padding: 16px 20px 14px; }
.theater-dual { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; max-width: 780px; margin: 0 auto; }
.theater-view-card { position: relative; border-radius: 12px; overflow: hidden; background: #090b0f; aspect-ratio: 9 / 14; }
.theater-view-card.is-landscape { aspect-ratio: 4 / 3; grid-column: 1 / -1; max-width: 620px; width: 100%; margin: 0 auto; }
.theater-view-card video { width: 100%; height: 100%; object-fit: cover; display: block; }
.vid-overlay-top { position: absolute; left: 9px; right: 9px; top: 9px; display: flex; justify-content: space-between; align-items: center; pointer-events: none; z-index: 4; }
.vid-badge-view { padding: 3px 9px; border-radius: 6px; background: rgba(255, 255, 255, .92); color: var(--ink); font-size: 11.5px; font-weight: 700; }
.vid-badge-auto { padding: 3px 9px; border-radius: 6px; background: rgba(17, 21, 29, .82); color: #6ee7b7; font: 600 11px var(--mono); }

.theater-bar {
  margin-top: 12px; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 12px; border-radius: 10px; background: var(--console-2); border: 1px solid var(--console-line);
}
.extra-views { display: flex; gap: 5px; flex-wrap: wrap; }
.extra-views button { padding: 5px 11px; border-radius: 7px; font-size: 12.5px; font-weight: 700; color: #b5bece; background: rgba(255, 255, 255, .07); }
.extra-views button.active { background: #fff; color: var(--ink); }
.theater-controls { display: flex; align-items: center; gap: 10px; }
.sync-play-btn { padding: 6px 14px; border-radius: 7px; background: var(--violet-bright); color: #fff; font-size: 12.5px; font-weight: 700; }
.speed-dark { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: #a7b1c4; }
.speed-dark select { background: var(--console); color: #fff; border: 1px solid rgba(255, 255, 255, .2); border-radius: 6px; padding: 3px 6px; font-size: 12.5px; }

.demo-meta-band {
  padding: 18px 24px 22px;
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 16px;
  align-items: start;
}
.subtasks-box { padding: 12px 14px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.subtasks-head { display: flex; justify-content: space-between; font: 700 11px var(--mono); text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-bottom: 9px; }
.subtasks-list { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
.sub-btn { padding: 7px 6px; border-radius: 8px; background: #fff; border: 1px solid var(--line); text-align: left; font-size: 11px; line-height: 1.25; color: var(--ink-2); transition: all .16s; }
.sub-btn b { display: block; font: 700 10.5px var(--mono); color: var(--muted); margin-bottom: 2px; }
.sub-btn.is-done { background: var(--violet-soft); border-color: var(--violet-line); color: var(--ink); }
.sub-btn.is-active { background: var(--violet); border-color: var(--violet); color: #fff; }
.sub-btn.is-active b { color: #e9d5ff; }

.mini-bars-inline { margin-top: 12px; display: flex; flex-direction: column; gap: 5px; }
.mini-bar-row { display: grid; grid-template-columns: 92px 1fr 48px; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-2); }
.mini-bar-row.is-ours { font-weight: 800; color: var(--violet); }
.mini-bar-track { height: 7px; border-radius: 99px; background: #e3e6ee; overflow: hidden; }
.mini-bar-fill { height: 100%; border-radius: 99px; background: #9aa4b6; }
.mini-bar-row.is-ours .mini-bar-fill { background: linear-gradient(90deg, var(--cobalt), var(--violet)); }

/* Shared Relation Code Card */
.code-card { border-radius: 12px; border: 1.5px solid var(--violet-line); background: #fff; overflow: hidden; }
.code-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 12px; background: var(--violet-soft); border-bottom: 1px solid var(--violet-line); font-size: 12px; }
.code-card-head strong { color: var(--violet); }
.code-card-head span { font: 500 10.5px var(--mono); color: var(--muted); }
.code-card-body { padding: 8px 12px 10px; font: 500 11.5px/1.7 var(--mono); color: var(--ink); overflow-x: auto; }
.code-line { display: flex; align-items: center; flex-wrap: nowrap; white-space: nowrap; gap: 3px; padding: 1px 6px; border-radius: 5px; }
.code-line.ind { padding-left: 16px; }
.code-line.is-next-diff { background: var(--amber-soft); box-shadow: inset 3px 0 0 var(--amber-bright); }
.code-kw { color: var(--cobalt); font-weight: 700; }
.code-dim { color: #8c95a6; }
.tok { display: inline-block; padding: 0 5px; border-radius: 4px; font-weight: 600; line-height: 1.5; }
.tok-cur { background: #ede3fc; color: var(--violet); }
.tok-next { background: var(--amber-soft); color: var(--amber); border: 1px dashed var(--amber-bright); }
.tok-scene { background: var(--emerald-soft); color: var(--emerald); }

/* Zero-Shot Generalization & All-17-Views Panels inside Demos */
.gen-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.gen-card { border-radius: var(--radius-lg); overflow: hidden; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column; }
.gen-card .video-media { position: relative; aspect-ratio: 9 / 13.5; background: #0c0e13; overflow: hidden; }
.gen-card video { width: 100%; height: 100%; object-fit: cover; display: block; }
.gen-body { padding: 15px 17px 17px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.gen-meta-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tag-pill { padding: 2px 9px; border-radius: 6px; font-size: 11px; font-weight: 700; background: var(--emerald-soft); color: var(--emerald); border: 1px solid var(--emerald-line); }
.tag-pill.is-task { background: var(--cobalt-soft); color: var(--cobalt); border-color: #cde0f7; }
.speed-light { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.speed-light select { border: 1px solid var(--line-2); border-radius: 6px; padding: 2px 5px; background: var(--bg); color: var(--ink); font-size: 11.5px; }
.gen-score { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 11px; border-radius: 10px; background: var(--emerald-soft); border: 1px solid var(--emerald-line); margin-top: auto; }
.gen-score strong { font: 800 22px/1 var(--sans); color: var(--emerald); }

.filter-pills { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.filter-pills button { padding: 5px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: #fff; border: 1px solid var(--line-2); color: var(--ink-2); }
.filter-pills button.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.gallery-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.video-card { border-radius: 14px; overflow: hidden; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column; }
.video-card .video-media { position: relative; aspect-ratio: 9 / 14; background: #0c0e13; overflow: hidden; }
.video-card video { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-card .video-media.is-43 video { object-fit: contain; background: #0c0e13; }
.video-meta { padding: 10px 12px; display: flex; flex-direction: column; gap: 5px; }
.video-meta h4 { font: 700 13.5px/1.25 var(--sans); color: var(--ink); }

/* ------------------------------------------------------------------ ACT 4 · METHOD CARDS */
.two-col-grid { margin-top: 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.three-col-grid { margin-top: 18px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }

.sub-card {
  padding: 18px 20px; border-radius: var(--radius);
  background: var(--bg); border: 1px solid var(--line);
}
.sub-card.is-accent { background: var(--violet-soft); border-color: var(--violet-line); }
.sub-card.is-blue { background: var(--cobalt-soft); border-color: #d0e1f8; }
.sub-card.is-green { background: var(--emerald-soft); border-color: var(--emerald-line); }
.step-num {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line-2);
  font: 700 11.5px var(--mono); color: var(--ink); margin-bottom: 10px;
}
.sub-card h4 { font: 700 17px/1.28 var(--serif); color: var(--ink); }
.sub-card p { margin-top: 7px; font-size: 14px; line-height: 1.62; color: var(--ink-2); }
.sub-card code { font: 600 12px var(--mono); background: rgba(255, 255, 255, .85); padding: 1px 5px; border-radius: 4px; color: var(--violet); }

/* Embedded Unified 3D Unitree G1 X-Ray Console inside Method */
.xray-console {
  margin-top: 20px; border-radius: 16px; overflow: hidden;
  background: var(--console); border: 1px solid #242b3a; color: #e6ebf5;
}
.xray-topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; background: var(--console-2); border-bottom: 1px solid var(--console-line);
}
.xray-slider-wrap { display: flex; align-items: center; gap: 9px; background: rgba(255, 255, 255, .06); padding: 5px 12px; border-radius: 9px; border: 1px solid rgba(255, 255, 255, .1); }
.xray-slider-wrap label { font: 700 11.5px var(--mono); color: #9cc2ff; white-space: nowrap; }
.xray-slider-wrap input { width: 120px; accent-color: #38bdf8; cursor: pointer; }
.xray-slider-wrap span { font: 600 11.5px var(--mono); color: #fff; min-width: 72px; }
.xray-pills { display: flex; flex-wrap: wrap; gap: 5px; }
.xray-pills button {
  padding: 5px 10px; border-radius: 7px; font-size: 12px; font-weight: 700;
  color: #a9b4c9; background: rgba(255, 255, 255, .07); transition: all .15s;
}
.xray-pills button[aria-pressed="true"] { background: #fff; color: var(--ink); }

.xray-grid { display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(394px, 1fr); }
.xray-stage-wrap { position: relative; min-height: 490px; background: radial-gradient(95% 85% at 48% 36%, #1f2636 0%, #11151d 78%); border-right: 1px solid var(--console-line); }
.stage-host { position: absolute; inset: 0; }
.stage-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; }
.stage-canvas.can-drag { cursor: grab; }
.stage-canvas.is-dragging { cursor: grabbing; }
.xray-cam-pills { position: absolute; left: 12px; top: 12px; z-index: 3; display: flex; gap: 5px; flex-wrap: wrap; }
.xray-cam-pills button { padding: 4px 9px; border-radius: 7px; font: 600 11.5px var(--mono); color: #cbd5e1; background: rgba(17, 21, 29, .78); border: 1px solid rgba(255, 255, 255, .14); backdrop-filter: blur(8px); }
.xray-cam-pills button.active { background: #38bdf8; color: #09101c; border-color: #38bdf8; }
.xray-hint { position: absolute; left: 12px; bottom: 10px; z-index: 3; padding: 3px 9px; border-radius: 999px; background: rgba(15, 19, 27, .76); border: 1px solid rgba(255, 255, 255, .1); font: 500 10.5px var(--mono); color: #cbd5e1; pointer-events: none; }

.xray-telemetry { padding: 14px; display: flex; flex-direction: column; gap: 10px; background: #151923; min-width: 0; }
.tel-maps { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tel-map-box { border-radius: 10px; overflow: hidden; border: 1px solid var(--console-line); background: #07090d; }
.tel-map-head { display: flex; justify-content: space-between; padding: 4px 8px; background: rgba(255, 255, 255, .05); font: 600 11px var(--mono); color: #cbd5e1; }
.tel-map-box svg { width: 100%; aspect-ratio: 1 / 1; display: block; }

.tel-torques { padding: 9px 11px; border-radius: 10px; background: rgba(255, 255, 255, .04); border: 1px solid var(--console-line); }
.tel-torques-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; font: 600 10.5px var(--mono); color: #9aa7bd; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 6px; }
.torque-meters { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.tm-item { text-align: center; }
.tm-bar-outer { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .1); overflow: hidden; margin: 3px 0 2px; }
.tm-bar-inner { height: 100%; border-radius: 99px; transition: width .08s linear, background-color .08s linear; }
.tm-lbl { font-size: 10.5px; color: #b5c0d4; font-weight: 600; }
.tm-val { font: 600 10px var(--mono); color: #e2e8f0; }

.xray-telemetry .code-card { background: #0d1017; border-color: rgba(167, 139, 250, .35); }
.xray-telemetry .code-card-head { background: rgba(139, 92, 246, .16); border-bottom-color: rgba(167, 139, 250, .2); }
.xray-telemetry .code-card-head strong { color: #d8b4fe; }
.xray-telemetry .code-card-head span { color: #9ca8be; }
.xray-telemetry .code-card-body { color: #dbe3f2; font-size: 9.8px; line-height: 1.62; padding: 7px 9px 9px; }
.xray-telemetry .code-line.ind { padding-left: 10px; }
.xray-telemetry .tok { padding: 0 3.5px; }
.xray-telemetry .code-kw { color: #7cc4ff; }
.xray-telemetry .tok-cur { background: rgba(167, 139, 250, .22); color: #e2c8ff; }
.xray-telemetry .tok-next { background: rgba(245, 158, 11, .18); color: #fcd34d; border-color: #f59e0b; }
.xray-telemetry .tok-scene { background: rgba(16, 185, 129, .2); color: #6ee7b7; }
.xray-telemetry .code-line.is-next-diff { background: rgba(245, 158, 11, .16); box-shadow: inset 3px 0 0 #fb923c; }

.xray-footer {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; background: var(--console-2); border-top: 1px solid var(--console-line);
}
.xray-play-btn { width: 32px; height: 32px; border-radius: 50%; background: #fff; color: var(--ink); font-weight: 800; display: grid; place-items: center; flex: 0 0 auto; }
.xray-scrub { flex: 1; min-width: 150px; display: flex; align-items: center; gap: 8px; }
.xray-scrub input { flex: 1; accent-color: #a78bfa; cursor: pointer; }
.xray-scrub span { font: 600 11.5px var(--mono); color: #cbd5e1; min-width: 108px; }
.xray-moments { display: flex; gap: 5px; flex-wrap: wrap; }
.xray-moments button { padding: 4px 9px; border-radius: 7px; font-size: 11.5px; font-weight: 700; color: #cbd5e1; background: rgba(255, 255, 255, .08); }
.xray-moments button.active { background: var(--violet-bright); color: #fff; }

/* Real Checkpoint 16-Step Prediction Scrubber inside Method */
.pred-toolbar {
  margin-top: 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 14px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line);
}
.pred-task-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.pred-task-tabs button { padding: 5px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: #fff; border: 1px solid var(--line-2); color: var(--ink-2); }
.pred-task-tabs button.active { background: var(--cobalt); color: #fff; border-color: var(--cobalt); }
.pred-step-ctl { display: flex; align-items: center; gap: 10px; flex: 1; max-width: 380px; }
.pred-play-btn { padding: 5px 12px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pred-step-ctl input { flex: 1; accent-color: var(--cobalt); }
.pred-step-label { font: 600 12px var(--mono); color: var(--ink); min-width: 96px; text-align: right; }

.pred-grid { margin-top: 14px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.pred-stream { border-radius: 12px; border: 1px solid var(--line); overflow: hidden; background: var(--bg); }
.pred-stream-head { display: flex; justify-content: space-between; padding: 6px 10px; background: var(--surface-soft); border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 700; }
.pred-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 7px; }
.pred-pair figure { position: relative; border-radius: 7px; overflow: hidden; background: #0a0c10; aspect-ratio: 1 / 1; }
.pred-pair img { width: 100%; height: 100%; object-fit: cover; }
.pred-pair figcaption { position: absolute; left: 5px; top: 5px; padding: 1px 6px; border-radius: 5px; background: rgba(17, 21, 29, .84); color: #fff; font: 600 10px var(--mono); }
.pred-pair figure.is-pred figcaption { background: rgba(29, 91, 191, .92); }
.pred-metrics-row { margin-top: 12px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.pred-metric-chip { padding: 9px 10px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); text-align: center; }
.pred-metric-chip strong { display: block; font: 800 18px var(--sans); color: var(--cobalt); }
.pred-metric-chip span { font-size: 11px; color: var(--muted); font-weight: 600; }

/* ------------------------------------------------------------------ ACT 5 · EVALUATION SETUP & SIMPLE SIMULATION */
.sim-grid { margin-top: 18px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.sim-card { border-radius: 14px; overflow: hidden; background: var(--bg); border: 1px solid var(--line); display: flex; flex-direction: column; }
.sim-media { position: relative; aspect-ratio: 16 / 9; background: #0c0e13; overflow: hidden; }
.sim-media video.sim-tp { width: 100%; height: 100%; object-fit: cover; display: block; }
.sim-pip { position: absolute; right: 8px; bottom: 42px; z-index: 4; width: 32%; aspect-ratio: 16 / 9; border-radius: 7px; overflow: hidden; border: 1.5px solid rgba(255, 255, 255, .92); box-shadow: 0 5px 14px rgba(0, 0, 0, .4); background: #000; pointer-events: none; }
.sim-pip video { width: 100%; height: 100%; object-fit: cover; display: block; }
.sim-pip span { position: absolute; left: 4px; top: 3px; padding: 1px 4px; border-radius: 4px; background: rgba(17, 21, 29, .82); color: #fff; font: 600 9px var(--mono); }
.sim-lvl-badge { position: absolute; left: 8px; top: 8px; z-index: 4; padding: 2px 7px; border-radius: 6px; background: rgba(17, 21, 29, .84); color: #7cc4ff; font: 700 10.5px var(--mono); pointer-events: none; }
.sim-score-badge { position: absolute; right: 8px; top: 8px; z-index: 4; padding: 2px 7px; border-radius: 6px; background: rgba(15, 118, 110, .92); color: #fff; font: 700 11px var(--mono); pointer-events: none; }
.sim-body { padding: 11px 13px 13px; display: flex; flex-direction: column; gap: 4px; }
.sim-body-top { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.sim-body h4 { font: 700 15px var(--sans); color: var(--ink); }
.sim-l012 { font: 600 10.5px var(--mono); color: var(--muted); }
.sim-body p { font-size: 12.5px; line-height: 1.42; color: var(--ink-2); }

/* ------------------------------------------------------------------ ACT 6 · EXPERIMENTS (UNHIDDEN, SCANNABLE ACADEMIC CARDS) */
.chart-bars { margin-top: 18px; display: flex; flex-direction: column; gap: 7px; }
.cbar-row { display: grid; grid-template-columns: 180px 1fr 64px; align-items: center; gap: 12px; font-size: 13px; }
.cbar-label { text-align: right; color: var(--ink-2); font-weight: 600; }
.cbar-row.is-ours .cbar-label { color: var(--violet); font-weight: 800; }
.cbar-track { height: 17px; border-radius: 6px; background: var(--surface-soft); overflow: hidden; }
.cbar-fill { height: 100%; border-radius: 6px; background: #a0abbe; }
.cbar-row.is-cap .cbar-fill { background: #6487bd; }
.cbar-row.is-ours .cbar-fill { background: linear-gradient(90deg, var(--cobalt), var(--violet)); }
.cbar-val { font: 700 12.5px var(--mono); color: var(--ink); }
.cbar-row.is-ours .cbar-val { color: var(--violet); }

.table-scroll { margin-top: 18px; overflow-x: auto; border-radius: 12px; border: 1px solid var(--line); }
table.paper-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.paper-table th { background: var(--surface-soft); color: var(--muted); font: 700 11px var(--mono); letter-spacing: .4px; text-transform: uppercase; text-align: center; padding: 9px 10px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
table.paper-table th:first-child, table.paper-table td:first-child { text-align: left; padding-left: 14px; }
table.paper-table td { text-align: center; padding: 8px 10px; border-bottom: 1px solid #eef0f5; font-variant-numeric: tabular-nums; color: var(--ink-2); }
table.paper-table tr:last-child td { border-bottom: 0; }
table.paper-table tr.group-row td { background: #f8f9fc; font-style: italic; font-weight: 700; color: var(--muted); text-align: center; padding: 6px; font-size: 12px; }
table.paper-table tr.ours-row td { background: var(--violet-soft); font-weight: 800; color: var(--ink); }
table.paper-table tr.ours-row td:last-child { color: var(--violet); }
table.paper-table td.indent { padding-left: 24px; }
table.paper-table td.delta-neg { color: var(--amber); font-weight: 600; font-family: var(--mono); }
.table-note { margin-top: 10px; font-size: 12.5px; color: var(--muted); }

.ablation-stack { margin-top: 16px; display: flex; flex-direction: column; gap: 18px; }
.ablation-item { padding: 18px 20px; border-radius: var(--radius); background: var(--bg); border: 1px solid var(--line); }
.ablation-item h4 { font: 700 17px/1.25 var(--serif); color: var(--ink); }
.ablation-item p { margin-top: 4px; font-size: 14px; color: var(--ink-2); }
.ablation-item .table-scroll { margin-top: 12px; background: #fff; }

/* ------------------------------------------------------------------ ACT 7 · CITE & FOOTER */
.cite-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.cite-box pre {
  margin: 0; padding: 18px 20px; overflow-x: auto; border-radius: 12px;
  background: var(--bg); border: 1px solid var(--line);
  font: 13px/1.72 var(--mono); color: #2f3848;
}
.site-footer {
  margin-top: 52px; padding-top: 22px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap;
  font-size: 13px; color: var(--muted);
}

/* Lightbox Dialog & Toast */
.dialog-open { overflow: hidden; }
dialog { width: min(1360px, 95vw); max-height: 94vh; padding: 0; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 30px 110px rgba(14, 20, 32, .38); }
dialog::backdrop { background: rgba(14, 18, 28, .76); backdrop-filter: blur(6px); }
.dialog-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.dialog-toolbar p { font-size: 13.5px; color: var(--ink-2); }
.dialog-toolbar button { font-size: 26px; line-height: 1; color: var(--ink); }
#expanded-figure { margin: auto; max-height: 78vh; object-fit: contain; padding: 18px; }
#figure-original { display: block; padding: 8px 0 14px; text-align: center; font-size: 13.5px; font-weight: 700; }
.page-status { position: fixed; left: 50%; bottom: 22px; z-index: 60; transform: translate(-50%, 20px); padding: 10px 18px; border-radius: 10px; background: var(--ink); color: #fff; font-size: 13.5px; opacity: 0; pointer-events: none; transition: .22s; }
.page-status.visible { opacity: 1; transform: translate(-50%, 0); }

.mini-bar-row.is-latency { grid-template-columns: 160px 1fr 70px; }
.mini-bar-row.is-real-abl { grid-template-columns: 132px 1fr 86px; font-size: 13px; }

/* ------------------------------------------------------------------ Responsive */
@media (max-width: 1140px) {
  .mobile-bar { display: flex; }
  .page-frame { grid-template-columns: 1fr; padding: 0 18px 64px; gap: 0; }
  .side-toc { display: none; }
  .hero-sec { padding-top: 26px; }
}
@media (max-width: 860px) {
  .ed-card { padding: 20px 16px; }
  .hero-top-grid { grid-template-columns: minmax(0, 1fr) 128px; gap: 14px; }
  .hero-ghost-fig { width: 128px; }
  .kpi-strip, .simple-callout-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .task-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .demo-meta-band, .xray-grid, .two-col-grid, .three-col-grid, .gen-grid, .pred-grid, .sim-grid { grid-template-columns: 1fr; }
  .xray-stage-wrap { min-height: 400px; border-right: 0; border-bottom: 1px solid var(--console-line); }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cbar-row { grid-template-columns: 118px 1fr 54px; font-size: 12px; }
}
@media (max-width: 600px) {
  .page-frame { padding: 0 14px 56px; }
  .ed-card { padding: 18px 14px; overflow-x: clip; }
  .hero-top-grid { grid-template-columns: 1fr; gap: 10px; }
  .hero-ghost-fig { width: 116px; justify-self: center; }
  .hero-video-badge { display: none; }
  .overview-video-box .vid-play-overlay { padding-bottom: 12px; gap: 5px; }
  .overview-video-box .play-ring { width: 40px; height: 40px; }
  .overview-video-box .play-ring svg { width: 18px; height: 18px; }
  .overview-video-box .play-cap { font-size: 10.5px; padding: 3px 10px; }
  .task-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .theater-dual { grid-template-columns: 1fr; }
  .subtasks-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery-grid { grid-template-columns: 1fr; }
  .pred-metrics-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .torque-meters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mini-bar-row.is-latency { grid-template-columns: 116px 1fr 62px; font-size: 11.5px; }
  .mini-bar-row.is-real-abl { grid-template-columns: 108px 1fr 74px; font-size: 12px; }
}
