/* 统一字体及展示层级；不改变研究内容和媒体画幅。 */
@font-face {
  font-family: Figtree;
  src: url('assets/fonts/figtree/Figtree.ttf') format('truetype');
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
}
:root {
  --font: Figtree, 'Helvetica Neue', Arial, sans-serif;
  --display: Figtree, 'Helvetica Neue', Arial, sans-serif;
}
body, button, select, input { font-family: var(--font); }
h1, h2, h3, h4 { font-family: var(--display); }
.mono { font-family: var(--font); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.kicker { font-family: var(--font); font-weight: 600; letter-spacing: .035em; font-size: 12px; }

/* 首页保留电影首屏，正文采用更清晰的论文项目页比例。 */
html:not([data-style="browser"]) {
  --ink: #15191f;
  --paper: #f8f9fb;
  --paper-deep: #eef1f5;
  --muted: #5a6471;
}
html:not([data-style="browser"]) h1 { letter-spacing: -.055em; font-weight: 600; }
html:not([data-style="browser"]) h2 { font-size: clamp(36px, 4.1vw, 58px); font-weight: 600; letter-spacing: -.035em; line-height: 1.12; }
html:not([data-style="browser"]) h3 { letter-spacing: -.025em; font-weight: 550; }
.wordmark { font-family: var(--font); letter-spacing: -.025em; }
.masthead nav a { font-size: 14px; }
.hero .paper-title { font-size: clamp(18px, 1.7vw, 24px); }
.hero .hero-deck { font-size: 17px; line-height: 1.65; }
.section-intro { font-size: 18px; line-height: 1.65; }
.media-label { font-family: var(--font); font-size: 12px; letter-spacing: .015em; }
.stage-topline, .pair-meta, .stage-note, .gallery-note, .chart-note { font-size: 13px; }
.story-stage { border-radius: 5px; }
.level-tabs button { font-size: 14px; }
.pair-grid { gap: 12px; }
.pair-grid .media-cell { border-radius: 3px; }
.shot-card { border-radius: 5px; }
.pipeline-node .mono, .e2e-footnote .mono { font-size: 12px; }
.evaluation-number { font-family: var(--font); }

/* 浏览页：白底、细线分区，控件与媒体分别建立层级。 */
html[data-style="browser"] { --font: Figtree, 'Noto Sans SC', Arial, sans-serif; }
html[data-theme="light"] {
  --bg: #fff;
  --bg-alt: #fff;
  --text-primary: #171c24;
  --text-secondary: #505a68;
  --text-muted: #616b79;
  --accent: #245cba;
  --accent-soft: #edf3fc;
  --kicker-ink: #245cba;
  --line: #dde2e8;
}
html[data-style="browser"] body { font-size: 16px; line-height: 1.6; }
html[data-style="browser"] .container { max-width: 1360px; padding-inline: 48px; }
.browser-intro { padding-top: 58px; padding-bottom: 50px; }
.browser-intro h1 { font-size: clamp(36px, 4vw, 54px); font-weight: 600; letter-spacing: -.04em; }
.browser-intro p { font-size: 18px; }
.browser-scale { font-size: 14px; }
html[data-style="browser"] .section { padding-block: 60px; }
html[data-style="browser"] .section > .container { border-top: 1px solid var(--line-strong); padding-top: 30px; }
html[data-style="browser"] .sec-title { font-size: clamp(28px, 3vw, 38px); line-height: 1.18; font-weight: 600; letter-spacing: -.035em; }
html[data-style="browser"] .sec-sub { max-width: 830px; font-size: 16px; line-height: 1.65; }
.section-head-compact { align-items: flex-start; margin-bottom: 28px; }
.section-head-compact > div:first-child { flex: 1; }
.sync-btns { padding-top: 28px; }
.main-nav a { font-size: 14px; }
.brand { font-size: 17px; letter-spacing: -.025em; }
.control-panel { padding: 0; border: 0; border-radius: 0; background: transparent; }
.control-row { gap: 14px; }
.mode-tabs { gap: 18px; }
.mode-tab { border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 10px 0; font-size: 14px; }
.mode-tab.active, .mode-tab[aria-selected="true"] { background: transparent; color: var(--accent); border-bottom-color: var(--accent); }
.mode-tab:hover { background: transparent; color: var(--accent); }
.seg-group { border-radius: 4px; }
.seg-btn, .select-compact, .btn-xs { font-size: 13px; border-radius: 4px; }
.control-subrow { gap: 12px; padding-top: 14px; margin-top: 14px; }
#clay-subcontrols { align-items: flex-start; flex-direction: column; }
.agent-chips { gap: 6px 12px; }
.agent-chip { border-color: transparent; border-radius: 3px; padding: 6px 8px; font-size: 13px; }
.agent-chip.active, .agent-chip[aria-pressed="true"] { background: var(--accent-soft); border-color: transparent; }
.task-strip { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.task-btn { border: 0; border-bottom: 2px solid var(--line); border-radius: 0; padding: 10px 0; background: transparent; }
.task-btn.active { background: transparent; border-color: var(--accent); box-shadow: none; }
.task-btn:hover { background: transparent; border-color: var(--accent); }
.tb-name { font-size: 14px; line-height: 1.4; font-weight: 550; min-height: 0; }
.tb-top { font-size: 11px; line-height: 1.4; color: var(--text-muted); }
#clay-task-strip { grid-template-columns: repeat(9, minmax(0, 1fr)); }
#clay-task-strip .task-btn { padding-top: 0; }
.task-preview { display: block; width: 100%; aspect-ratio: 16/9; object-fit: contain; border-radius: 3px; background: #e8eaed; margin-bottom: 10px; opacity: .78; transition: opacity .15s; }
.task-btn.active .task-preview, .task-btn:hover .task-preview { opacity: 1; }
#clay-task-strip .tb-top > span:last-child { display: none; }
.task-mini-bar { font-size: 14px; line-height: 1.65; margin-block: 22px; }
.tmb-brief { max-width: none; }
.tmb-ref img, .tmb-ref video { width: 176px; max-height: 110px; object-fit: contain; border-radius: 3px; }
.level-pill { color: var(--text-primary); font-size: 14px; }
.level-pill .dot { display: none; }
.clay-matrix-header { display: none; }
.clay-matrix-row { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; margin-bottom: 28px; }
.clay-row-agent { grid-column: 1/-1; display: flex; flex-direction: row; align-items: center; justify-content: flex-start; flex-wrap: wrap; gap: 10px 18px; padding: 12px 0 0; border-top: 1px solid var(--line); }
.cra-top { font-size: 15px; font-weight: 600; }
.cra-meta { font-size: 12px; }
.clay-row-agent .cra-meta:last-child { margin-left: auto; }
.vid-card { border: 0; border-radius: 0; background: transparent; overflow: visible; }
.vid-head { background: transparent; padding: 0 0 8px; border: 0; font-size: 13px; min-height: 30px; gap: 6px; }
.vid-head .mono { font-size: 12px; color: var(--text-muted); }
.vid-box { border-radius: 3px; overflow: hidden; background: #11151b; }
.vid-box video { display: block; object-fit: contain; }
.grid-3, .grid-4 { gap: 20px 14px; }

/* 同一组视频在完整并排与滑动对照之间切换，保持播放状态。 */
.comparison-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.comparison-caption { font-size: 15px; font-weight: 600; }
.comparison-layout { display: flex; gap: 4px; border: 1px solid var(--line); padding: 3px; border-radius: 4px; }
.comparison-layout button { color: var(--text-secondary); background: transparent; border: 0; border-radius: 2px; padding: 7px 12px; font-size: 13px; cursor: pointer; }
.comparison-layout button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.wipe-viewport { border-radius: 4px; }
.wipe-viewport.comparison-paired { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); grid-template-rows: auto auto; column-gap: 16px; row-gap: 8px; aspect-ratio: auto; max-width: none; border: 0; background: transparent; overflow: visible; cursor: auto; touch-action: auto; }
.comparison-paired > .wipe-video { position: relative; inset: auto; grid-column: 2; grid-row: 2; aspect-ratio: 16/9; height: auto; background: #11151b; border-radius: 3px; }
.comparison-paired .wipe-left-clip { position: relative; inset: auto; grid-column: 1; grid-row: 2; clip-path: none; aspect-ratio: 16/9; background: #11151b; border-radius: 3px; overflow: hidden; }
.comparison-paired > .vp-badge { position: static; color: var(--text-primary); background: transparent; border: 0; border-radius: 0; backdrop-filter: none; padding: 0; font-size: 13px; font-weight: 550; letter-spacing: 0; text-transform: none; }
.comparison-paired .vp-tl { grid-column: 1; grid-row: 1; justify-self: start; }
.comparison-paired .vp-tr { grid-column: 2; grid-row: 1; justify-self: start; }
.comparison-scores { position: static; margin-top: 14px; gap: 18px; }
.comparison-scores .vp-badge { color: var(--text-muted); background: transparent; border: 0; padding: 0; font-size: 13px; }
.transport-bar { max-width: none; padding-top: 14px; margin-top: 16px; border-top: 1px solid var(--line); }
.transport-bar .mono { min-width: 96px; text-align: right; font-variant-numeric: tabular-nums; }
.level-pair-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; }
.level-pair-column { min-width: 0; }
.level-pair-column h3 { font-size: 16px; font-weight: 600; margin: 0 0 16px; }
.level-pair-column .vid-card + .vid-card { margin-top: 18px; }

/* 表格以数值和比较关系为主，弱化装饰性卡片。 */
.quant-tab.active, .quant-tab[aria-selected="true"] { background: transparent; }
.qtab-step { font-size: 12px; }
.qtab-name { font-size: 17px; }
.table-scroll { border-radius: 0; border-left: 0; border-right: 0; }
.data-table { font-size: 14px; font-variant-numeric: tabular-nums; }
.data-table thead th { font-size: 12px; background: var(--surface-2); }
.data-table th, .data-table td { padding: 14px 16px; }
.data-table tbody tr:hover { background: var(--accent-soft); }
.bar-track { height: 3px; }
.lb-card-head h3 { font-size: 23px; font-weight: 600; }
.lb-card-sub, .kpi-sub { font-size: 14px; }
.svg-wrap, .msc-card, .bibtex-pre, .task-context { border-radius: 4px; }

@media (max-width: 1100px) {
  #clay-task-strip { display: flex; overflow-x: auto; padding-bottom: 4px; scroll-snap-type: x proximity; }
  #clay-task-strip .task-btn { flex: 0 0 128px; scroll-snap-align: start; }
  .section-head-compact { flex-wrap: wrap; }
  .sync-btns { padding-top: 0; }
  .agent-chips { gap: 4px; }
}
@media (max-width: 760px) {
  html[data-style="browser"] .container { padding-inline: 24px; }
  html[data-style="browser"] .section { padding-block: 36px; }
  .browser-intro { padding-top: 40px; padding-bottom: 32px; }
  .section-head-compact > div:first-child { flex-basis: 100%; }
  .clay-matrix-row { grid-template-columns: 1fr; gap: 16px; }
  .clay-row-agent .cra-meta:last-child { margin-left: 0; }
  .grid-3, .grid-4, .level-pair-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .level-pair-grid { grid-template-columns: 1fr; gap: 32px; }
  .comparison-toolbar { flex-wrap: wrap; gap: 10px; }
  .wipe-viewport.comparison-paired { grid-template-columns: 1fr; gap: 8px; }
  .comparison-paired .vp-tl { grid-column: 1; grid-row: 1; }
  .comparison-paired .wipe-left-clip { grid-column: 1; grid-row: 2; }
  .comparison-paired .vp-tr { grid-column: 1; grid-row: 3; margin-top: 8px; }
  .comparison-paired > .wipe-video { grid-column: 1; grid-row: 4; }
  .mode-tabs { gap: 18px; }
  .mode-tab { font-size: 13px; }
  .transport-bar { flex-wrap: wrap; gap: 10px; }
  .transport-bar .timeline-scrub { flex: 1; width: auto; }
  .transport-bar .mono { font-size: 12px !important; }
  .section-intro { font-size: 16px; }
  html:not([data-style="browser"]) .hero .hero-deck { font-size: 15px; }
  .hero-facts span, .resource-tags span, .resource-tags small { font-size: 11px; }
  .stage-topline, .pair-meta, .stage-note, .gallery-note, .chart-note { font-size: 12px; }
}
@media (max-width: 460px) {
  html[data-style="browser"] .container { padding-inline: 18px; }
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .comparison-layout button { padding-inline: 10px; }
  .quant-tabs { grid-template-columns: 1fr; }
  .quant-tab { text-align: left; padding: 12px 0; }
  .qtab-name { font-size: 16px; }
  .comparison-scores { flex-wrap: wrap; gap: 8px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .task-preview { transition: none; }
}
/* 原生 hidden 优先于既有控件的 display 规则。 */
[hidden] { display: none !important; }
#clay-task-strip .task-btn { display: flex; flex-direction: column; align-items: stretch; }
#clay-task-strip .tb-name { min-height: 2.8em; }
html:not([data-style="browser"]) .level-label,
html:not([data-style="browser"]) .level-tabs button,
html:not([data-style="browser"]) .stage-note,
html:not([data-style="browser"]) .gallery-note,
html:not([data-style="browser"]) .chart-note,
html:not([data-style="browser"]) .shot-type,
html:not([data-style="browser"]) .resource-tags small,
html:not([data-style="browser"]) .pair-controls output { font-family: var(--font); letter-spacing: .01em; }
.resource-tags span { font-size: 12px; }
.resource-tags small { font-size: 10px; }
.level-tabs button span { font-size: 12px; }
.pair-controls output { font-size: 12px; }
.shot-type { font-size: 11px; }
@media (max-width: 760px) {
  #vid-subcontrols .task-strip { display: flex; overflow-x: auto; padding-bottom: 4px; scroll-snap-type: x proximity; }
  #vid-subcontrols .task-btn { flex: 0 0 148px; scroll-snap-align: start; }
  #clay-subcontrols .agent-chips { width: 100%; flex-wrap: nowrap; overflow-x: auto; padding-block: 4px; }
  #clay-subcontrols .agent-chip { flex: 0 0 auto; }
}
