/* 09 行动六幕 + 10 结尾叙事的局部收口。独立文件便于验收与回退。 */

#action {
  --action-panel: linear-gradient(145deg, rgb(28 22 34 / 94%), rgb(62 39 46 / 82%));
}

.has-js #action {
  min-height: 710svh;
}

#action .scene-stage {
  overflow: clip;
}

#action .story-copy--wide {
  left: clamp(2rem, 4.5vw, 6rem);
  width: min(41.5vw, 47rem);
}

#action .story-copy h2 {
  width: max-content;
  max-width: 100%;
  margin-bottom: 0.8rem;
  font-size: clamp(2.8rem, 4.1vw, 4.7rem);
  line-height: 1.02;
  white-space: nowrap;
}

#action .action-sequence-status {
  margin-top: 0;
  font-size: clamp(0.78rem, 0.9vw, 0.94rem);
}

.has-js #action .action-list {
  height: clamp(22rem, 48svh, 31rem);
  margin-top: clamp(1.1rem, 2.3svh, 1.8rem);
}

.has-js #action .action-list li {
  min-height: 100%;
  padding: clamp(2rem, 4vw, 4rem);
  background: var(--action-panel);
}

.has-js #action .action-list strong {
  font-family: var(--font-hand);
  font-size: clamp(3rem, 5.1vw, 5.8rem);
  letter-spacing: 0.01em;
}

.has-js #action .action-list p {
  max-width: 34rem;
  font-size: clamp(1.08rem, 1.45vw, 1.34rem);
}

#action .action-companion {
  right: clamp(1.5rem, 3.5vw, 4.5rem);
  width: min(47.5vw, 59rem);
}

#action .action-companion__portrait {
  min-height: min(56svh, 37rem);
  max-height: 68svh;
}

#action .action-companion__portrait img {
  filter: saturate(1.04) contrast(1.02) brightness(1.04);
}

#action .action-companion figcaption {
  position: relative;
  width: min(88%, 38rem);
  margin-top: -2.1rem;
  padding: 1.2rem 3.25rem 1.05rem 1.35rem;
}

#action .action-companion figcaption p {
  font-size: clamp(1rem, 1.2vw, 1.18rem);
}

.action-companion__note-close {
  position: absolute;
  z-index: 2;
  top: 0.65rem;
  right: 0.72rem;
  display: grid;
  width: 2.35rem;
  height: 2.35rem;
  place-items: center;
  padding: 0;
  color: rgb(247 236 216 / 86%);
  cursor: pointer;
  background: rgb(247 236 216 / 8%);
  border: 1px solid rgb(247 236 216 / 20%);
  border-radius: 999px;
  transition: background 180ms ease, transform 180ms ease;
}

.action-companion__note-close:hover,
.action-companion__note-close:focus-visible {
  background: rgb(232 183 102 / 20%);
  transform: rotate(6deg) scale(1.04);
}

.action-companion__note-close:focus-visible {
  outline: 2px solid #f1c978;
  outline-offset: 3px;
}

.action-companion.is-note-collapsed figcaption {
  width: auto;
  min-width: 3.65rem;
  min-height: 3.65rem;
  margin-right: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 999px;
}

.action-companion.is-note-collapsed figcaption > :not(.action-companion__note-close) {
  display: none;
}

.action-companion.is-note-collapsed .action-companion__note-close {
  top: 0.63rem;
  right: 0.63rem;
}

.action-companion.is-note-collapsed .action-companion__note-close span {
  font-size: 0;
}

.action-companion.is-note-collapsed .action-companion__note-close span::before {
  content: "＋";
  font-size: 1rem;
}

/* 每一幕都是完整停留页；卡片与画面交替落位，避免连续七页像同一张模板。 */
.story-section--finale-bridge {
  min-height: 132svh;
}

.story-section--finale-bridge .scene-image {
  filter: saturate(1.04) contrast(1.03) brightness(1.1);
}

.story-copy--finale-bridge {
  width: min(48vw, 58rem);
  padding: clamp(1.75rem, 3vw, 3.25rem);
  background: linear-gradient(145deg, rgb(12 17 29 / 84%), rgb(34 27 39 / 62%));
  box-shadow: 0 1.35rem 4.2rem rgb(3 7 15 / 22%);
  backdrop-filter: blur(12px);
}

.story-copy--finale-bridge h2,
.story-section--finale-help .story-copy--finale-bridge h2,
.story-section--finale-create .story-copy--finale-bridge h2 {
  max-width: 13.5em;
  font-size: clamp(2.65rem, 3.8vw, 4.6rem);
  line-height: 1.08;
}

.story-copy--finale-bridge h2 .display-line {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: break-word;
}

/* 10·06 / 10·07 的标题句较长：维持完整语义，同时确保始终留在卡片内。 */
.story-section--finale-voice .story-copy--finale-bridge h2,
.story-section--finale-care .story-copy--finale-bridge h2 {
  max-width: 100%;
  font-size: clamp(2.35rem, 2.65vw, 3.3rem);
  line-height: 1.12;
}

.story-copy--finale-bridge .lead {
  font-size: clamp(1.2rem, 1.45vw, 1.48rem);
  line-height: 1.72;
}

.story-copy--finale-bridge p:not(.eyebrow, .lead),
.story-section--finale-help .story-copy--finale-bridge > p:not(.eyebrow),
.story-section--finale-create .story-copy--finale-bridge > p:not(.eyebrow) {
  max-width: 37rem;
  font-size: clamp(1.03rem, 1.22vw, 1.26rem);
  line-height: 1.82;
}

.story-section--finale-distance .story-copy--finale-bridge,
.story-section--finale-create .story-copy--finale-bridge {
  right: clamp(2rem, 5vw, 7rem);
  left: auto;
}

/* 共同守护的完整竖画陈列在右侧，文字落在左侧，避免文字卡再次遮住主体。 */
.story-section--finale-care .story-copy--finale-bridge {
  right: auto;
  left: clamp(2rem, 5vw, 7rem);
}

.scene-image--finale-distance {
  object-position: 50% 48%;
}

/* 共同守护原图是竖幅：桌面端把它当作一幅完整画作陈列，避免强裁切丢掉动物。 */
.story-section--finale-care .scene-visual--finale-care {
  background:
    radial-gradient(circle at 76% 46%, rgb(211 156 93 / 24%), transparent 31%),
    linear-gradient(120deg, #26343d 0%, #324946 47%, #1f2b33 100%);
}

.scene-image--finale-care {
  width: 52%;
  margin-left: 48%;
  object-fit: contain;
  object-position: 50% 50%;
  filter: saturate(1.06) contrast(1.02) brightness(1.08);
}

.scene-image-veil--finale-distance {
  background:
    linear-gradient(270deg, rgb(8 15 26 / 78%) 0%, rgb(8 15 26 / 42%) 35%, transparent 68%),
    linear-gradient(0deg, rgb(8 15 26 / 24%), transparent 55%);
}

.story-section--finale-distance.is-active .scene-image,
.story-section--finale-near.is-active .scene-image,
.story-section--finale-choice.is-active .scene-image,
.story-section--finale-voice.is-active .scene-image,
.story-section--finale-care.is-active .scene-image {
  animation: finale-action-drift 15s ease-in-out infinite alternate;
}

@keyframes finale-action-drift {
  to { transform: scale(1.045) translate3d(-0.45%, -0.35%, 0); }
}

#finale .story-copy--finale,
#finale.finale-reveal-ready .story-copy--finale {
  width: min(64rem, 82vw);
  text-align: center;
}

#finale .story-copy--finale h2,
#finale .finale-reveal__stage h2 {
  max-width: none;
  margin-inline: auto;
  font-size: clamp(3.8rem, 6.2vw, 7.2rem);
  line-height: 0.98;
  text-align: center;
}

#finale .story-copy--finale .display-line,
#finale .finale-reveal__title-line {
  width: 100%;
  text-align: center;
}

#finale .story-copy--finale .lead,
#finale .finale-reveal__stage .lead {
  max-width: 36rem;
  margin-inline: auto;
  font-size: clamp(1.3rem, 1.7vw, 1.65rem);
  line-height: 1.7;
}

#finale .story-copy--finale p:not(.eyebrow, .lead, .finale-wish),
#finale .finale-reveal__stage p:not(.eyebrow, .lead, .finale-wish) {
  max-width: 48rem;
  margin-inline: auto;
  font-size: clamp(1.06rem, 1.3vw, 1.3rem);
  line-height: 1.82;
}

#finale .story-copy--finale .finale-wish,
#finale .finale-reveal__stage .finale-wish {
  max-width: 43rem;
  margin: clamp(1.15rem, 2.5vh, 2rem) auto 0;
  font-size: clamp(1.2rem, 1.6vw, 1.55rem);
  line-height: 1.8;
}

@media (max-width: 760px) {
  .has-js #action {
    min-height: 720svh;
  }

  .has-js #action .story-copy--wide {
    top: calc(var(--header-height) + 0.85rem);
    right: 0.85rem;
    left: 0.85rem;
  }

  .has-js #action .story-copy--wide > h2 {
    font-size: clamp(1.65rem, 7.4vw, 2.25rem);
  }

  .has-js #action .action-list {
    height: min(34svh, 19rem);
    margin-top: clamp(3rem, 8svh, 4.6rem);
  }

  .has-js #action .action-list li {
    padding: 1.25rem;
  }

  .has-js #action .action-list strong {
    font-size: clamp(2.1rem, 11vw, 3.4rem);
  }

  .has-js #action [data-action-phase="summary"] .action-list strong {
    font-size: clamp(1.125rem, 5.2vw, 1.4rem);
  }

  .has-js #action [data-action-phase="summary"] .action-list p {
    font-size: clamp(0.9375rem, 4vw, 1.02rem);
    line-height: 1.65;
  }

  #action .action-companion {
    top: auto;
    right: 0.9rem;
    bottom: max(0.65rem, env(safe-area-inset-bottom));
    left: 0.9rem;
    width: auto;
  }

  #action .action-companion__portrait {
    width: 100%;
    height: clamp(9.4rem, 22svh, 12rem);
    min-height: 0;
    max-height: none;
  }

  #action .action-companion figcaption {
    width: min(92%, 24rem);
    margin-top: -1.65rem;
    padding: 0.95rem 3rem 0.85rem 1.05rem;
  }

  #action .action-companion figcaption p {
    font-size: clamp(1rem, 4.1vw, 1.08rem);
    line-height: 1.64;
  }

  .story-section--finale-bridge {
    min-height: 138svh;
  }

  .story-copy--finale-bridge,
  .story-section--finale-distance .story-copy--finale-bridge,
  .story-section--finale-create .story-copy--finale-bridge,
  .story-section--finale-care .story-copy--finale-bridge {
    top: auto;
    right: 0.9rem;
    bottom: max(1.15rem, env(safe-area-inset-bottom));
    left: 0.9rem;
    width: auto;
    padding: 1.2rem 1.15rem 1.3rem;
    transform: none;
  }

  .story-copy--finale-bridge h2,
  .story-section--finale-help .story-copy--finale-bridge h2,
  .story-section--finale-create .story-copy--finale-bridge h2 {
    max-width: 100%;
    margin-bottom: 0.7rem;
    font-size: clamp(1.9rem, 9vw, 3rem);
    line-height: 1.04;
  }

  .story-section--finale-create .story-copy--finale-bridge h2,
  .story-section--finale-voice .story-copy--finale-bridge h2,
  .story-section--finale-care .story-copy--finale-bridge h2 {
    font-size: clamp(1.75rem, 7.7vw, 2.45rem);
    line-height: 1.12;
  }

  .story-copy--finale-bridge .lead {
    font-size: clamp(1rem, 4.25vw, 1.14rem);
    line-height: 1.62;
  }

  .story-copy--finale-bridge p:not(.eyebrow, .lead),
  .story-section--finale-help .story-copy--finale-bridge > p:not(.eyebrow),
  .story-section--finale-create .story-copy--finale-bridge > p:not(.eyebrow) {
    font-size: clamp(1rem, 4vw, 1.08rem);
    line-height: 1.72;
  }

  .story-section--finale-bridge .scene-image {
    width: 100%;
    height: 100%;
    margin-left: 0;
    aspect-ratio: auto;
    object-fit: cover;
  }

  .story-section--finale-bridge .scene-image-veil {
    background: linear-gradient(0deg, rgb(8 15 26 / 70%) 0%, rgb(8 15 26 / 38%) 43%, transparent 76%);
  }

  .story-section--finale-care .scene-image {
    width: calc(100% - 1rem);
    height: 100%;
    margin-left: 0.5rem;
    object-fit: contain;
    object-position: 50% 18%;
    filter: saturate(1.06) contrast(1.02) brightness(1.14);
  }

  .story-section--finale-care .scene-image-veil {
    background: linear-gradient(0deg, rgb(8 15 26 / 58%) 0%, rgb(8 15 26 / 24%) 42%, transparent 76%);
  }

  #finale.finale-reveal-ready .story-copy--finale,
  .has-js #finale.finale-reveal-ready .story-copy--finale,
  .has-js #finale.finale-reveal-ready:not(.is-finale-copy-ready) .story-copy--finale {
    right: 0.9rem !important;
    left: 0.9rem !important;
    width: auto !important;
  }

  #finale .finale-reveal__stage {
    min-height: min(76svh, 42rem);
    align-content: center;
    justify-items: center;
    text-align: center;
  }

  #finale .finale-reveal__stage h2 {
    max-width: 100%;
    font-size: clamp(2.7rem, 13vw, 4.45rem);
    line-height: 0.98;
  }

  #finale .finale-reveal__stage .lead {
    font-size: clamp(1rem, 4.35vw, 1.18rem);
  }

  #finale .finale-reveal__stage p:not(.eyebrow, .lead, .finale-wish) {
    font-size: clamp(1rem, 4vw, 1.08rem);
    line-height: 1.72;
  }

  #finale .finale-reveal__stage .finale-wish {
    font-size: clamp(1.02rem, 4.2vw, 1.16rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .story-section--finale-bridge.is-active .scene-image {
    animation: none;
  }
}
