/* 回放沿用全站莫兰蒂配色，鼠尾草灰绿标识当前选项。 */
#videos {
  --replay-surface: var(--panel);
  --replay-soft: var(--surface);
  --replay-line: var(--line);
  --replay-accent: var(--accent);
  --replay-blue: var(--accent);
  max-width: none;
}
#videos button, #videos select, #videos input { font-family: inherit; }
#videos button { cursor: pointer; }
#videos button:disabled { cursor: default; opacity: .4; }
[hidden] { display: none !important; }
.task-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: -4px -4px 20px; padding: 4px; }
.task-tab { min-width: 0; display: flex; align-items: center; gap: 12px; min-height: 72px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--control-radius); background: transparent; color: var(--body); text-align: left; }
.task-tab-preview { display: block; flex-shrink: 0; width: 96px; height: 54px; overflow: hidden; border-radius: 6px; background: var(--surface); }
.task-tab-thumbnail { display: block; width: 100%; height: 100%; min-width: 0; object-fit: cover; }
.task-tab-copy { min-width: 0; }
.task-tab-title { font-size: 14px; line-height: 1.5; font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
.task-tab:hover { border-color: var(--card-hover-border); background: var(--surface); }
.task-tab[aria-selected="true"] { border-color: var(--accent); background: var(--panel); }
@media (max-width: 800px) {
  .task-tabs { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 260px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 4px; scrollbar-width: none; }
  .task-tabs::-webkit-scrollbar { display: none; }
  .task-tab { min-height: 64px; scroll-snap-align: start; }
  .task-tab-preview { width: 80px; height: 45px; }
}
/* 两个同画幅视频并排，Agent 的节点说明独立置于右侧。 */
.simulation-task { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 264px; gap: 12px 24px; align-items: stretch; }
.comparison-column { min-width: 0; display: grid; grid-template-rows: subgrid; grid-row: 1 / 3; }
.baseline-column { grid-column: 1; }
.comparison-heading { margin: 0; font-size: 16px; line-height: 24px; font-weight: 500; }
.comparison-heading-row { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.agent-column { grid-column: 2; position: relative; }
.agent-column::before { content: ""; position: absolute; left: -12px; top: 0; bottom: 0; width: 1px; background: var(--replay-line); } /* taste-skill-ignore: 用户要求两个方法之间用竖线分隔。 */
.baseline-player { overflow: hidden; border: 1px solid var(--card-border); border-radius: var(--card-radius); box-shadow: var(--card-shadow); display: grid; grid-template-rows: auto var(--transport-height); } /* taste-skill-ignore: 与真实播放器同画幅的占位。 */
.baseline-stage { aspect-ratio: 16 / 9; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: var(--replay-soft); color: var(--muted); }
.baseline-stage svg { width: 32px; height: 32px; fill: none; stroke: var(--muted); stroke-width: 1.3; }
.baseline-stage p { font-size: 14px; }
.baseline-status { min-height: var(--transport-height); display: flex; align-items: center; justify-content: center; padding: 15px; font-size: 12px; color: var(--muted); background: var(--replay-surface); }
.player { min-width: 0; overflow: hidden; border: 1px solid var(--card-border); border-radius: var(--card-radius); background: var(--replay-surface); color: var(--body); box-shadow: var(--card-shadow); display: grid; grid-template-rows: auto var(--transport-height); } /* taste-skill-ignore: 真实播放器控件分界。 */
.video-stage { position: relative; background: var(--replay-soft); aspect-ratio: 16 / 9; }
.video-stage video { display: block; width: 100%; height: 100%; object-fit: contain; }
.media-error { position: absolute; inset: 30% 10% auto; background: var(--replay-surface); color: var(--body); border: 1px solid var(--replay-line); border-radius: var(--control-radius); padding: 16px; font-size: 13px; line-height: 1.7; text-align: center; } /* taste-skill-ignore: 真实播放器控件分界。 */
.transport { display: flex; align-items: center; gap: 4px; height: var(--transport-height); padding: 0 6px; background: var(--replay-surface); border-radius: 0 0 var(--card-radius) var(--card-radius); }
.timeline-wrap { position: relative; flex: 1; min-width: 20px; height: var(--transport-height); }
.timeline-track, .timeline-segments { position: absolute; inset: calc(50% - 1px) 6px auto; height: 2px; border-radius: 2px; }
.timeline-track { overflow: hidden; background: var(--line); }
.timeline-track span { display: block; width: 0; height: 100%; background: var(--accent); }
.timeline-segments { display: flex; gap: 3px; }
.timeline-segments span { background: var(--line); border-radius: 2px; min-width: 2px; }
.timeline-segments span.passed { background: var(--accent); }
.timeline-wrap input { position: relative; z-index: 2; appearance: none; display: block; width: 100%; margin: 0; height: var(--transport-height); background: transparent; cursor: pointer; }
.timeline-wrap input::-webkit-slider-runnable-track { height: 2px; background: transparent; }
.timeline-wrap input::-webkit-slider-thumb { appearance: none; width: 10px; height: 10px; background: var(--accent); border: 2px solid var(--panel); box-shadow: 0 0 0 1px var(--accent); border-radius: 50%; margin-top: -4px; }
.timeline-wrap input::-moz-range-track { height: 2px; background: transparent; }
.timeline-wrap input::-moz-range-thumb { box-sizing: border-box; width: 10px; height: 10px; border: 2px solid var(--panel); box-shadow: 0 0 0 1px var(--accent); background: var(--accent); border-radius: 50%; }
.timeline-wrap input:hover::-webkit-slider-thumb { transform: scale(1.15); }
.timeline-wrap input:hover::-moz-range-thumb { transform: scale(1.15); }
.timeline-markers { position: absolute; inset: calc(50% - 7px) 6px auto; pointer-events: none; }
.timeline-markers span { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: var(--accent); transform: translateX(-50%); }
.play-button { position: relative; display: inline-flex; align-items: center; justify-content: center; width: var(--transport-height); height: var(--transport-height); padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ink); line-height: 1; flex-shrink: 0; appearance: none; }
.play-button > svg { display: block; width: 18px; height: 18px; fill: currentColor; stroke: none; pointer-events: none; }
.play-button .pause-icon, .play-button[data-playing="true"] .play-icon { display: none; }
.play-button[data-playing="true"] .pause-icon { display: block; }
.play-button:hover { background: color-mix(in srgb, var(--accent) 30%, var(--panel)); }
.play-button:active { transform: scale(.94); }
.icon-button { display: grid; place-items: center; padding: 3px; border: 0; border-radius: 6px; background: transparent; color: var(--body); width: var(--transport-height); min-height: var(--transport-height); flex-shrink: 0; }
.icon-button:hover:not(:disabled) { background: var(--surface); color: var(--ink); }
.icon-button:active:not(:disabled) { transform: scale(.94); }
.time-display { display: flex; gap: 4px; color: var(--body); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.time-divider, [data-ref="duration"] { color: var(--muted); }
.view-switch { position: relative; isolation: isolate; display: flex; width: 100%; padding: 3px; border: 1px solid var(--card-border); border-radius: var(--control-radius); background: var(--surface); }
.view-switch::before { content: ""; position: absolute; z-index: -1; inset: 3px auto 3px 3px; width: calc((100% - 6px) / 2); border-radius: 7px; background: color-mix(in srgb, var(--accent) 20%, var(--surface)); box-shadow: var(--card-shadow); }
.view-switch:has(button:last-child[aria-pressed="true"])::before { transform: translateX(100%); }
.view-switch button { flex: 1; min-width: 0; border: 0; border-radius: 7px; min-height: 36px; padding: 4px 6px; color: var(--body); background: transparent; font-size: 12px; line-height: 18px; white-space: nowrap; }
.view-switch button:hover { color: var(--ink); }
.view-switch button[aria-pressed="true"] { color: var(--accent-ink); font-weight: 550; }
#videos :focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 3px; }
.transport :focus-visible { outline-offset: -3px; }
.replay-details { grid-column: 3; grid-row: 1 / 3; min-width: 0; display: grid; grid-template-rows: subgrid; }
.decisions-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.decisions-heading h5 { font-size: 16px; line-height: 24px; font-weight: 500; }
.details-body { height: 0; min-height: 100%; padding: 14px; display: flex; flex-direction: column; gap: 12px; border: 1px solid var(--card-border); border-radius: var(--card-radius); background: var(--replay-surface); box-shadow: var(--card-shadow); } /* taste-skill-ignore: 用户要求对齐的圆角卡片。 */
[data-ref="chapter-list"] { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-auto-rows: max-content; align-content: start; gap: 3px; list-style: none; margin: 0; padding: 0; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
:is([data-ref="chapter-list"], [data-ref="go2-chapters"]) > li { position: relative; min-height: 0; }
:is([data-ref="chapter-list"], [data-ref="go2-chapters"]) > li::before { content: ""; position: absolute; width: 1px; left: 18px; top: -2px; bottom: -2px; background: var(--line); pointer-events: none; }
:is([data-ref="chapter-list"], [data-ref="go2-chapters"]) > li:first-child::before { top: 50%; }
:is([data-ref="chapter-list"], [data-ref="go2-chapters"]) > li:last-child::before { bottom: 50%; }
.chapter-button { position: relative; display: grid; grid-template-columns: 20px minmax(0, 1fr) 38px; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 10px 8px; text-align: left; border: 0; border-radius: var(--control-radius); background: transparent; color: var(--body); }
.chapter-button:hover, .chapter-button[aria-expanded="true"] { background: var(--surface); }
.chapter-button[aria-current="step"] { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); color: var(--ink); }
.chapter-index { position: relative; display: grid; place-items: center; width: 20px; height: 20px; border: 1px solid var(--line); border-radius: 50%; background: var(--paper); color: var(--body); font-size: 11px; font-variant-numeric: tabular-nums; }
.chapter-button.is-past .chapter-index { border-color: var(--accent); color: var(--accent); background: var(--surface); }
.chapter-button[aria-current="step"] .chapter-index { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.chapter-button[aria-current="step"] .chapter-title { font-weight: 500; }
.chapter-time { font-size: 12px; color: var(--body); font-variant-numeric: tabular-nums; text-align: right; }
.chapter-title { font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.decision-note { position: fixed; z-index: 50; width: min(328px, calc(100vw - 32px)); padding: 18px; background: var(--surface); border: 1px solid var(--card-hover-border); border-radius: var(--card-radius); box-shadow: var(--hover-shadow); }
.decision-note[hidden] { display: none; }
.decision-note::before { content: ""; position: absolute; width: 10px; height: 10px; background: var(--surface); border: solid var(--card-hover-border); border-width: 0 1px 1px 0; }
.decision-note[data-side="left"]::before { right: -6px; top: var(--arrow-position); transform: translateY(-50%) rotate(-45deg); }
.decision-note[data-side="right"]::before { left: -6px; top: var(--arrow-position); transform: translateY(-50%) rotate(135deg); }
.decision-note[data-side="bottom"]::before { top: -6px; left: var(--arrow-position); transform: translateX(-50%) rotate(225deg); }
.decision-note[data-side="top"]::before { bottom: -6px; left: var(--arrow-position); transform: translateX(-50%) rotate(45deg); }
.note-heading { display: flex; align-items: center; gap: 10px; color: var(--accent-ink); font-size: 13px; line-height: 1.5; }
#note-kind { flex: 1; font-weight: 550; }
#note-time { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
#close-note { display: grid; place-items: center; flex-shrink: 0; width: 24px; height: 24px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 19px; line-height: 1; }
#close-note:hover { background: var(--surface); color: var(--ink); }
#note-text { margin-top: 12px; color: var(--body); font-size: 14px; line-height: 1.75; max-height: 50dvh; overflow-y: auto; }
.instruction { margin-top: 14px; padding: 10px 12px; background: var(--paper); border-radius: var(--control-radius); color: var(--accent-ink); font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
@container tasks (max-width: 1000px) {
  .simulation-task { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .replay-details { grid-column: 1 / -1; grid-row: 3 / 5; }
  .details-body { height: auto; min-height: 0; }
  [data-ref="chapter-list"] { overflow-y: visible; }
}
@media (max-width: 600px) {
  .simulation-task { display: flex; flex-direction: column; gap: 24px; }
  .comparison-column, .replay-details { width: 100%; }
  .agent-column::before { display: none; }
  .comparison-column, .replay-details { display: block; }
  .comparison-heading, .comparison-heading-row, .decisions-heading { font-size: 16px; margin-bottom: 12px; }
  .comparison-heading-row .comparison-heading { margin-bottom: 0; }
  .decisions-heading h5 { font-size: 16px; }
  .replay-details { order: 4; }
  .details-body { height: auto; min-height: 0; display: block; }
}

.icon-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }

.playback-speed { width: 72px; min-height: 36px; color: var(--accent-ink); background: var(--surface); border: 1px solid var(--card-border); padding: 4px 8px; border-radius: 6px; font: inherit; cursor: pointer; }
.playback-speed:hover { border-color: var(--accent); }
.player, .baseline-player { --transport-height: 40px; position: relative; overflow: visible; }
.player-body, .baseline-player > .video-stage, .baseline-stage, .go2-views { overflow: hidden; border-radius: calc(var(--card-radius) - 1px) calc(var(--card-radius) - 1px) 0 0; }
.video-stage { cursor: pointer; }
.replay-settings { position: fixed; inset: auto; margin: 0; box-sizing: border-box; width: min(224px, calc(100vw - 24px)); padding: 12px; border: 1px solid var(--line); border-radius: var(--control-radius); background: var(--panel); color: var(--body); box-shadow: var(--hover-shadow); font-size: 12px; line-height: 1.5; overflow-y: auto; overscroll-behavior: contain; }
.replay-settings::backdrop { background: transparent; }
.replay-settings[data-fallback] { position: absolute; z-index: 30; top: calc(100% + 8px); right: 0; }
.settings-group { display: grid; gap: 8px; }
.settings-label { display: block; color: var(--muted); }
.settings-speed { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.settings-group + .settings-speed { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.replay-more svg circle { fill: currentColor; stroke: none; }
.replay-more[aria-expanded="true"] { color: var(--accent-ink); background: var(--surface); }
.player:fullscreen { grid-template-rows: minmax(0, 1fr) var(--transport-height); background: var(--paper); border: 0; border-radius: 0; }
.player:fullscreen .player-body { display: grid; place-items: center; min-height: 0; border-radius: 0; }
.player:fullscreen .screen-column { width: min(100%, calc((100dvh - var(--transport-height)) * 16 / 9)); }
@media (max-width: 800px), (hover: none), (pointer: coarse) {
  .player, .baseline-player { --transport-height: 44px; }
  .replay-settings .view-switch button, .replay-settings .playback-speed { min-height: 44px; }
}

/* Go2 同次录像左右分屏，只保留一套公共控制区。 */
.go2-view-headings, .go2-views { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; }
.go2-view-headings h5:last-child { padding-left: 12px; }
.go2-player:fullscreen .go2-views { align-self: center; justify-self: center; width: min(100%, calc((100dvh - var(--transport-height)) * 32 / 9)); }
@media (max-width: 600px) {
  .go2-view-headings .comparison-heading { font-size: 14px; }
  .go2-view-headings h5:last-child { padding-left: 6px; }
}
#go2 .realworld-notes { padding: 14px; height: 0; min-height: 100%; }
[data-ref="go2-chapters"] { align-self: stretch; flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-auto-rows: max-content; align-content: start; gap: 3px; list-style: none; padding: 0; margin: 0; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }

[data-ref="go2-external-video"] { object-fit: contain; background: var(--surface); }
.go2-provenance { color: var(--muted); font-size: 12px; margin: 10px 0 0; }
[data-ref="go2-external-coverage"] { inset: 0; border: 0; border-radius: 0; background: var(--surface); color: var(--muted); margin: 0; display: grid; place-items: center; }

.task-stack { display: grid; gap: 56px; container-type: inline-size; container-name: tasks; }
@media (max-width: 600px) {
  .task-stack { gap: 44px; }
}

/* 多节点在桌面栏内滚动，保持双视频为 16:9；窄屏完整展开。 */
@container tasks (max-width: 1000px) {
  #go2 .realworld-notes { height: auto; min-height: 150px; }
  [data-ref="go2-chapters"] { overflow-y: visible; }
}

.play-button.is-loading { position: relative; color: transparent; }
.play-button.is-loading > svg { opacity: 0; }
.play-button.is-loading::after { content: ""; position: absolute; inset: calc((var(--transport-height) - 16px) / 2); border: 2px solid var(--line); border-top-color: var(--on-accent); border-radius: 50%; opacity: 0; animation: playback-reveal .01s .45s forwards, playback-spin .8s linear infinite; }
@keyframes playback-reveal { to { opacity: 1; } }
@keyframes playback-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: no-preference) {
  .play-button, .icon-button, .playback-speed, .view-switch button, .chapter-button, .chapter-index, .player, .baseline-player, .details-body, .task-tab { transition: background-color .3s ease, color .3s ease, border-color .3s ease, box-shadow .3s ease, transform .3s ease; }
  .view-switch::before { transition: transform .3s ease; }
  .decision-note:not([hidden]) { animation: decision-reveal .16s ease-out; }
  @keyframes decision-reveal { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
}
@media (prefers-reduced-motion: reduce) {
  .play-button.is-loading::after { animation: playback-reveal .01s .45s forwards; }
  .play-button:active, .icon-button:active:not(:disabled) { transform: none; }
}

@media (hover: hover) {
  .player:hover, .baseline-player:hover { border-color: var(--card-hover-border); }
}
@media (prefers-reduced-motion: reduce) {
  .task-tab:hover { transform: none; }
}
