.detail main { margin-top: 30px; margin-bottom: 60px; }
.back-link { display: inline-block; font-size: 14px; color: var(--accent); text-decoration: underline; text-underline-offset: 4px; min-height: 37px; }
.work-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; border-bottom: 1px solid var(--border); padding: 8px 0 19px; margin-bottom: 23px; }
.work-heading h1 { margin: 6px 0 0; font-size: clamp(33px, 4vw, 58px); line-height: 1.12; letter-spacing: -.055em; }
.work-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 10px; font-size: 14px; color: var(--muted); }
.kind { background: var(--inset); color: var(--ink); font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 5px; }
.work-options { display: flex; align-items: center; flex-wrap: wrap; justify-content: end; gap: 8px 14px; }
.work-options:not(:has(> :not([hidden]))) { display: none; }
.edition-switch { display: inline-flex; align-items: center; position: relative; isolation: isolate; padding: 2px; }
.edition-switch::before { content: ""; position: absolute; inset: 4px 0; z-index: -1; border-radius: 9px; background: color-mix(in srgb, var(--inset) 78%, transparent); }
.edition-switch a { display: grid; place-items: center; position: relative; min-width: 44px; min-height: 40px; padding-inline: 8px; border-radius: 8px; color: var(--muted); font-size: 13px; }
.edition-switch a:is(:hover, [aria-current="page"]) { color: var(--ink); }
.edition-switch a[aria-current="page"]::before { content: ""; position: absolute; inset: 5px 1px; z-index: -1; border-radius: 7px; background: var(--surface); box-shadow: 0 0 0 1px var(--border); }
.view-switch { display: flex; gap: 8px; flex: none; }
.detail button { min-height: 41px; color: inherit; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; }
.detail button:hover:not(:disabled) { background: var(--inset); }
.detail button:disabled { color: var(--muted); opacity: .65; cursor: default; }
.view-switch button { padding: 7px 15px; font-size: 15px; }
.detail :is(.view-switch button[aria-pressed="true"], button[aria-current="page"]) { background: var(--active); color: var(--on-active); border-color: var(--active); }
.work-body { display: grid; grid-template-columns: 176px minmax(0, 1fr); align-items: start; gap: 26px; }
.work-body:has(.page-index[hidden]) { grid-template-columns: minmax(0, 1fr); }
.page-index h2 { margin: 0 0 8px; color: var(--muted); font-size: 14px; font-weight: 500; }
#page-list { display: grid; align-content: start; gap: 6px; max-height: 62vh; overflow: auto; padding: 3px 5px 4px 3px; margin-left: -3px; }
#page-list button { display: flex; align-items: baseline; gap: 9px; text-align: left; padding: 7px 9px; font-size: 14px; }
#page-list button > b { font-family: Consolas, "Microsoft YaHei", monospace; }
#page-list b { flex: none; }
.presentation { width: 100%; min-width: 0; }
.video-preview, .stage { margin-inline: auto; }
.stage { aspect-ratio: 16 / 9; width: min(100%, 960px); display: grid; place-items: center; background: #181713; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.video-preview .stage { width: min(100%, 1040px); }
.portrait-work .video-preview .stage { width: min(100%, 380px, 49vh); aspect-ratio: 9 / 16; }
.stage :is(img, video) { width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: contain; }
.slide-preview .stage { position: relative; }
.slide-outgoing { position: absolute; inset: 0; }
.carousel-controls { position: absolute; inset: 0 8px; z-index: 1; display: flex; align-items: center; justify-content: space-between; pointer-events: none; }
.detail .carousel-controls button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #fff5;
  border-radius: 50%;
  color: #fff;
  background: #181713b8;
  pointer-events: auto;
}
.detail .carousel-controls button:hover:not(:disabled) { background: #181713ec; }
.carousel-controls svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) and (pointer: fine) {
  .carousel-controls { opacity: 0; transition: opacity .15s ease; }
  .stage:not(:hover, :has(.carousel-controls :focus-visible)) .carousel-controls button { pointer-events: none; }
  .stage:is(:hover, :has(.carousel-controls :focus-visible)) .carousel-controls { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .carousel-controls { transition: none; }
}
.video-error, .slide-error { color: var(--accent); font-size: 15px; }
.video-error a { text-decoration: underline; }
#studio-access { width: min(100%, 960px); margin: 12px auto 0; color: var(--muted); }
#studio-access a { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 850px) { .work-body { grid-template-columns: 138px minmax(0, 1fr); gap: 15px; } }
@media (max-width: 720px) {
  .detail main { margin-top: 21px; margin-bottom: 36px; }
  .work-heading { align-items: start; flex-direction: column; padding: 4px 0 14px; gap: 14px; margin-bottom: 16px; }
  .view-switch button, .edition-switch a, #page-list button { min-height: 44px; }
  .work-options { justify-content: start; }
  .work-body { display: flex; flex-direction: column-reverse; gap: 13px; }
  .page-index { width: 100%; }
  #page-list { grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); padding: 3px; margin: 0; }
  #page-list button { justify-content: center; }
  #page-list button span { display: none; }
}
.download-strip { display:flex; flex-wrap:wrap; align-items:center; gap:9px 20px; margin:0 0 22px; padding:15px 18px; border:1px solid var(--border); border-radius:12px; background:var(--surface); }
.download-strip h2 { margin:0; font-size:18px; }.download-buttons{display:flex;flex-wrap:wrap;gap:8px}.download-buttons a{display:inline-block;padding:9px 15px;min-height:44px;border-radius:8px;border:1px solid var(--border);font-weight:700}.source-primary{background:var(--active);color:var(--on-active)}.source-secondary{background:var(--inset);color:var(--ink)}
