/* 原场景素材点读，不增加阅读段落。 */
.inline-radio { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
.chapter .scene .composition { pointer-events: none; }
.chapter .scene .art-hit { display: block; width: 100%; height: 100%; cursor: pointer; pointer-events: auto; }
.art-hit > img, .art-hit > picture, .art-hit > figure { display: block; width: 100%; }
.art-hit img { width: 100%; }
.art-hit:hover { filter: drop-shadow(0 0 7px #eed49a88); }
.art-tip { display: none; position: absolute; top: 15%; right: 5%; z-index: 30; width: min(185px,48vw); padding: 3px 9px; color: #2e291f; background: rgb(245 235 208 / .72); border: 1px solid #b69e6c99; border-radius: 6px; box-shadow: 0 5px 20px #0002; backdrop-filter: blur(8px); font-family: 'Songti SC',serif; text-shadow: none; line-height: 1.6; }
.art-tip summary { cursor: pointer; font-size: 14px; min-height: 28px; line-height: 28px; }
.art-tip summary small { font-size: 10px; margin-left: 8px; color: #756143; }
.art-tip p { font-size: 12px; padding: 5px 0; max-height: 21svh; overflow-y: auto; border-top: 1px solid #b69e6c44; }
.art-tip[open] summary small { font-size: 0; }
.art-tip[open] summary small::after { content: '收起'; font-size: 10px; }
.tip-close { font-size: 11px; cursor: pointer; display: block; text-align: right; color: #756143; padding: 3px 0; }
/* 点读层高于鼠标视差捕获层，原文仍在原位。 */
.chapter .scene .depth-input { z-index: 1; }
.chapter .scene .composition { z-index: 3; }
@media (max-width:760px) { .art-tip { width: min(165px,44vw); } }

.chapter:has(#pick-encounter-0:checked) .tip-encounter-0 { display: block; }
.chapter .inline-item-encounter-0 { anchor-name: --art-encounter-0; }
.tip-encounter-0 { position-anchor: --art-encounter-0; }
.chapter:has(#pick-encounter-0:focus-visible) .inline-item-encounter-0 { outline: 2px solid #e9d09d; }
.chapter:has(#pick-encounter-1:checked) .tip-encounter-1 { display: block; }
.chapter .inline-item-encounter-1 { anchor-name: --art-encounter-1; }
.tip-encounter-1 { position-anchor: --art-encounter-1; }
.chapter:has(#pick-encounter-1:focus-visible) .inline-item-encounter-1 { outline: 2px solid #e9d09d; }
.chapter:has(#pick-encounter-2:checked) .tip-encounter-2 { display: block; }
.chapter .inline-item-encounter-2 { anchor-name: --art-encounter-2; }
.tip-encounter-2 { position-anchor: --art-encounter-2; }
.chapter:has(#pick-encounter-2:focus-visible) .inline-item-encounter-2 { outline: 2px solid #e9d09d; }
.chapter:has(#pick-encounter-3:checked) .tip-encounter-3 { display: block; }
.chapter .inline-item-encounter-3 { anchor-name: --art-encounter-3; }
.tip-encounter-3 { position-anchor: --art-encounter-3; }
.chapter:has(#pick-encounter-3:focus-visible) .inline-item-encounter-3 { outline: 2px solid #e9d09d; }
.chapter:has(#pick-human-0:checked) .tip-human-0 { display: block; }
.chapter .inline-item-human-0 { anchor-name: --art-human-0; }
.tip-human-0 { position-anchor: --art-human-0; }
.chapter:has(#pick-human-0:focus-visible) .inline-item-human-0 { outline: 2px solid #e9d09d; }
.chapter:has(#pick-human-1:checked) .tip-human-1 { display: block; }
.chapter .inline-item-human-1 { anchor-name: --art-human-1; }
.tip-human-1 { position-anchor: --art-human-1; }
.chapter:has(#pick-human-1:focus-visible) .inline-item-human-1 { outline: 2px solid #e9d09d; }
.chapter:has(#pick-human-2:checked) .tip-human-2 { display: block; }
.chapter .inline-item-human-2 { anchor-name: --art-human-2; }
.tip-human-2 { position-anchor: --art-human-2; }
.chapter:has(#pick-human-2:focus-visible) .inline-item-human-2 { outline: 2px solid #e9d09d; }
.chapter:has(#pick-underworld-0:checked) .tip-underworld-0 { display: block; }
.chapter .inline-item-underworld-0 { anchor-name: --art-underworld-0; }
.tip-underworld-0 { position-anchor: --art-underworld-0; }
.chapter:has(#pick-underworld-0:focus-visible) .inline-item-underworld-0 { outline: 2px solid #e9d09d; }
.chapter:has(#pick-underworld-1:checked) .tip-underworld-1 { display: block; }
.chapter .inline-item-underworld-1 { anchor-name: --art-underworld-1; }
.tip-underworld-1 { position-anchor: --art-underworld-1; }
.chapter:has(#pick-underworld-1:focus-visible) .inline-item-underworld-1 { outline: 2px solid #e9d09d; }
.chapter:has(#pick-underworld-2:checked) .tip-underworld-2 { display: block; }
.chapter .inline-item-underworld-2 { anchor-name: --art-underworld-2; }
.tip-underworld-2 { position-anchor: --art-underworld-2; }
.chapter:has(#pick-underworld-2:focus-visible) .inline-item-underworld-2 { outline: 2px solid #e9d09d; }
.chapter:has(#pick-underworld-3:checked) .tip-underworld-3 { display: block; }
.chapter .inline-item-underworld-3 { anchor-name: --art-underworld-3; }
.tip-underworld-3 { position-anchor: --art-underworld-3; }
.chapter:has(#pick-underworld-3:focus-visible) .inline-item-underworld-3 { outline: 2px solid #e9d09d; }
.chapter:has(#pick-gate-0:checked) .tip-gate-0 { display: block; }
.chapter .inline-item-gate-0 { anchor-name: --art-gate-0; }
.tip-gate-0 { position-anchor: --art-gate-0; }
.chapter:has(#pick-gate-0:focus-visible) .inline-item-gate-0 { outline: 2px solid #e9d09d; }
.chapter:has(#pick-gate-1:checked) .tip-gate-1 { display: block; }
.chapter .inline-item-gate-1 { anchor-name: --art-gate-1; }
.tip-gate-1 { position-anchor: --art-gate-1; }
.chapter:has(#pick-gate-1:focus-visible) .inline-item-gate-1 { outline: 2px solid #e9d09d; }
.chapter:has(#pick-gate-2:checked) .tip-gate-2 { display: block; }
.chapter .inline-item-gate-2 { anchor-name: --art-gate-2; }
.tip-gate-2 { position-anchor: --art-gate-2; }
.chapter:has(#pick-gate-2:focus-visible) .inline-item-gate-2 { outline: 2px solid #e9d09d; }
.chapter:has(#pick-gate-3:checked) .tip-gate-3 { display: block; }
.chapter .inline-item-gate-3 { anchor-name: --art-gate-3; }
.tip-gate-3 { position-anchor: --art-gate-3; }
.chapter:has(#pick-gate-3:focus-visible) .inline-item-gate-3 { outline: 2px solid #e9d09d; }
.chapter:has(#pick-gate-4:checked) .tip-gate-4 { display: block; }
.chapter .inline-item-gate-4 { anchor-name: --art-gate-4; }
.tip-gate-4 { position-anchor: --art-gate-4; }
.chapter:has(#pick-gate-4:focus-visible) .inline-item-gate-4 { outline: 2px solid #e9d09d; }
.chapter:has(#pick-heaven-0:checked) .tip-heaven-0 { display: block; }
.chapter .inline-item-heaven-0 { anchor-name: --art-heaven-0; }
.tip-heaven-0 { position-anchor: --art-heaven-0; }
.chapter:has(#pick-heaven-0:focus-visible) .inline-item-heaven-0 { outline: 2px solid #e9d09d; }
.chapter:has(#pick-heaven-1:checked) .tip-heaven-1 { display: block; }
.chapter .inline-item-heaven-1 { anchor-name: --art-heaven-1; }
.tip-heaven-1 { position-anchor: --art-heaven-1; }
.chapter:has(#pick-heaven-1:focus-visible) .inline-item-heaven-1 { outline: 2px solid #e9d09d; }
.chapter:has(#pick-heaven-2:checked) .tip-heaven-2 { display: block; }
.chapter .inline-item-heaven-2 { anchor-name: --art-heaven-2; }
.tip-heaven-2 { position-anchor: --art-heaven-2; }
.chapter:has(#pick-heaven-2:focus-visible) .inline-item-heaven-2 { outline: 2px solid #e9d09d; }
/* 原版开场：标题、画中主体和叙事文字各有自己的区域。 */
.standalone .chapter .scene {
  --opening-top: clamp(10rem, 22svh, 13rem);
  --opening-bottom: clamp(9rem, 23svh, 12rem);
}

body.standalone .chapter .scene .composition {
  inset: .75rem max(1.5rem, calc((100% - 62rem) / 2)) auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  gap: clamp(.35rem, 1.25svh, .8rem) clamp(.55rem, 3vw, 2rem);
  width: auto;
  height: calc(65svh - 1.5rem);
  z-index: 5;
  animation: none;
  filter: none;
}

body.standalone .chapter .scene .people { display: contents; }

body.standalone .chapter .scene .composition .layer {
  position: relative;
  inset: auto;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  overflow: clip;
  translate: none;
  transform: none;
  opacity: 1;
  filter: drop-shadow(0 3px 5px #0006);
}

body.standalone .chapter .scene .composition .art-hit {
  display: grid;
  place-items: center;
  padding: .2rem;
  overflow: hidden;
}

.chapter .scene .art-hit > :is(picture, figure) {
  display: block;
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
}

.chapter .scene .art-hit > figure {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}

.chapter .scene .composition .art-hit img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
}

.chapter .scene .composition .people figcaption {
  margin: .2rem 0 0;
  text-align: center;
}

.chapter .scene .composition .art-ground { display: none; }
.chapter .scene :is(.passing-cloud, .foreground, .curtain, .shore) { z-index: 2; }

body .chapter.encounter .composition {
  grid-template-areas: "canopy canopy" "bird bird" "envoys xinzhui";
  grid-template-rows: minmax(0, .85fr) minmax(0, .55fr) minmax(0, 1.8fr);
}
.encounter .canopy { grid-area: canopy; --art-in: 40%; --art-hold: 53%; }
.encounter .soul-bird { grid-area: bird; --art-in: 53%; --art-hold: 66%; }
.encounter .envoys { grid-area: envoys; --art-in: 27%; --art-hold: 40%; }
.encounter .xinzhui { grid-area: xinzhui; }

body .chapter.human .composition {
  grid-template-areas: "roof roof" "banquet banquet" "bird bird";
  grid-template-rows: minmax(0, 1.05fr) minmax(0, 1.5fr) minmax(0, .65fr);
}
.human .roof { grid-area: roof; }
.human .banquet { grid-area: banquet; --art-in: 29%; --art-hold: 43%; }
.human .human-bird { grid-area: bird; --art-in: 47%; --art-hold: 62%; }

body .chapter.underworld .composition {
  grid-template-areas: "earth earth" "giant giant" "fish beasts";
  grid-template-rows: minmax(0, .6fr) minmax(0, 1.35fr) minmax(0, 1.2fr);
}
.underworld .earth { grid-area: earth; --art-in: 28%; --art-hold: 40%; }
.underworld .giant { grid-area: giant; }
.underworld .fish { grid-area: fish; --art-in: 41%; --art-hold: 54%; }
.underworld .beasts { grid-area: beasts; --art-in: 54%; --art-hold: 67%; }

body .chapter.gate .composition {
  grid-template-areas: "dragons dragons" "left right" "rider-left rider-right";
  grid-template-rows: minmax(0, .85fr) minmax(0, 1.25fr) minmax(0, 1fr);
}
.gate .dragons { grid-area: dragons; --art-in: 40%; --art-hold: 52%; }
.gate .gate-left { grid-area: left; }
.gate .gate-right { grid-area: right; --art-in: 26%; --art-hold: 38%; }
.gate .rider-left { grid-area: rider-left; --art-in: 49%; --art-hold: 61%; }
.gate .rider-right { grid-area: rider-right; --art-in: 58%; --art-hold: 70%; }

body .chapter.heaven .composition {
  grid-template-areas: "moon sun" "deity deity";
  grid-template-rows: minmax(0, 1.55fr) minmax(0, .95fr);
}
.heaven .sun { grid-area: sun; }
.heaven .moon { grid-area: moon; --art-in: 29%; --art-hold: 43%; }
.heaven .deity { grid-area: deity; --art-in: 47%; --art-hold: 62%; }

.chapter .scene .art-tip {
  z-index: 16;
  inset: auto 0 clamp(2.15rem, 6svh, 3.8rem);
  width: min(84%, 32rem);
  margin-inline: auto;
}

.chapter .scene .art-tip summary { padding: 0; }
.chapter .scene .art-tip p { max-height: clamp(2.15rem, 8svh, 5rem); }
.chapter .scene:has(.inline-radio[id^="pick-"]:checked) .story-beat { visibility: hidden; }

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    body.standalone .chapter .scene .composition {
      inset-block: var(--opening-top) var(--opening-bottom);
      height: auto;
    }

    body.standalone .chapter .scene .composition .layer {
      animation: opening-art-settle ease-out both;
      animation-timeline: --chapter;
      animation-range: contain var(--art-in, 12%) contain var(--art-hold, 28%);
    }

    body.standalone .chapter .scene .copy .chapter-opening {
      inset: clamp(4rem, 9svh, 5.5rem) 1rem auto;
      max-width: none;
      width: auto;
      text-align: center;
      translate: none;
      scale: none;
      transform-origin: center top;
      animation-name: opening-heading-opacity;
    }

    .standalone .chapter .chapter-opening h2 {
      font-size: clamp(1.3rem, 3.55vw, 2.75rem);
      line-height: 1.2;
    }

    .standalone .chapter .chapter-opening h2 br,
    .standalone .chapter .chapter-opening .fine-rule { display: none; }

    .standalone .chapter .chapter-opening .eyebrow {
      margin-bottom: .3rem;
      font-size: clamp(.65rem, 1.7vw, .85rem);
      line-height: 1.35;
    }

    body.standalone .chapter .scene .copy > .story-beat {
      top: auto;
      bottom: clamp(2.1rem, 6svh, 3.5rem);
      font-size: clamp(.8rem, 1.65vw, 1.1rem);
      line-height: 1.65;
    }

    body.standalone .chapter .scene .scene-bottom { bottom: max(.65rem, env(safe-area-inset-bottom)); }
  }
}

@keyframes opening-art-settle {
  from { opacity: 0; transform: scale(.82); }
  to { opacity: 1; transform: none; }
}

@keyframes opening-heading-opacity {
  0%, 25% { opacity: 1; }
  47%, 100% { opacity: 0; }
}
