/* ==========================================================================
   CHAPTER 04: 如果我们在少年时就认识 — 全屏夏日动漫短片 + 精准分镜电影字幕
   全屏铺满播放 04.mp4（无黑边、无多余装饰，纯享画面 + 细腻电影字幕）
   ========================================================================== */

.ch4-layer {
  position: fixed;
  inset: 0;
  z-index: 34;
  background: #060608;
  color: #fffdf8;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  overflow: hidden;
  transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0.9s;
}

body[data-mode="chapter04"] .ch4-layer {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0s;
}

body[data-mode="chapter04"] .topbar {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

/* 100% 全屏铺满视频画面 */
.ch4-video-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #060608;
}

/* 末帧温柔延展 2 秒时的极其轻微呼吸推镜，避免生硬急停 */
.ch4-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  transform: scale(1);
  transition: transform 2.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.ch4-video.is-holding {
  transform: scale(1.028);
}

/* 仅在底部字幕区铺极柔和的暗色渐变衬底，绝不压暗主体动漫画面 */
.ch4-bottom-scrim {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 36vh;
  z-index: 4;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(6, 7, 10, 0) 0%,
    rgba(6, 7, 10, 0.38) 45%,
    rgba(6, 7, 10, 0.78) 100%
  );
}

/* 00:00–00:02：日本动画片开幕式正中央大标题（位于画面正中间红框位置） */
.ch4-opening-title {
  position: absolute;
  left: 50%;
  top: 44%;
  transform: translate(-50%, -50%) scale(0.96);
  width: min(1100px, 92vw);
  z-index: 9;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s cubic-bezier(0.22, 1, 0.36, 1), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.ch4-opening-title.is-active {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.ch4-opening-text {
  margin: 0;
  font-family: 'Noto Serif SC', Georgia, serif;
  font-size: clamp(2.1rem, 4vw, 3.6rem);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.14em;
  white-space: nowrap;
  color: #ffffff;
  text-shadow:
    0 4px 20px rgba(12, 32, 60, 0.65),
    0 10px 38px rgba(8, 22, 46, 0.48);
}

/* 电影级居中底部字幕舞台（干脆利落，秒级切换） */
.ch4-sub-stage {
  position: absolute;
  left: 50%;
  bottom: clamp(48px, 7.5vh, 82px);
  transform: translateX(-50%);
  width: min(920px, 92vw);
  z-index: 8;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-height: 84px;
  pointer-events: none;
}

.ch4-cue {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.22s ease, transform 0.26s cubic-bezier(0.16, 1, 0.3, 1);
}

.ch4-cue.is-active {
  opacity: 1;
  transform: translateY(0);
}

.ch4-sub-text {
  margin: 0;
  font-family: 'Noto Serif SC', Georgia, serif;
  font-size: clamp(1.06rem, 1.6vw, 1.42rem);
  font-weight: 500;
  line-height: 1.7;
  letter-spacing: 0.08em;
  color: #fffdf7;
  text-shadow:
    0 2px 10px rgba(0, 0, 0, 0.9),
    0 5px 24px rgba(0, 0, 0, 0.72);
}

.ch4-sub-gold {
  color: #ffebc2;
  text-shadow:
    0 0 20px rgba(243, 208, 138, 0.45),
    0 3px 14px rgba(0, 0, 0, 0.9);
}

/* 结尾轻交互按钮（播完后轻柔浮现） */
.ch4-end-actions {
  position: absolute;
  left: 50%;
  bottom: clamp(148px, 19vh, 196px);
  transform: translateX(-50%) translateY(12px);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.85s ease, transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.ch4-end-actions.is-ready {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.ch4-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 24px;
  border-radius: 999px;
  border: 1px solid rgba(243, 208, 138, 0.52);
  background: rgba(16, 14, 14, 0.62);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #fff5de;
  font-family: var(--font-sans);
  font-size: 13px;
  letter-spacing: 0.12em;
  cursor: pointer;
  box-shadow: 0 0 28px -8px rgba(243, 208, 138, 0.42);
  transition: transform 0.25s ease, background-color 0.25s ease, border-color 0.25s ease;
}

.ch4-action-btn:hover {
  transform: translateY(-2px);
  background: rgba(243, 208, 138, 0.2);
  border-color: rgba(255, 245, 218, 0.92);
}

/* 底部极细 2px 香槟金进度条 + 右下角极简控制 */
.ch4-progress-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  z-index: 20;
  background: rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

.ch4-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(243, 208, 138, 0.55), #f3d08a, #fff6de);
  box-shadow: 0 0 10px rgba(243, 208, 138, 0.72);
}

.ch4-controls {
  position: fixed;
  right: 24px;
  bottom: 14px;
  z-index: 22;
  display: flex;
  align-items: center;
  gap: 12px;
}

.ch4-ctrl-link {
  border: none;
  background: rgba(8, 8, 10, 0.42);
  backdrop-filter: blur(8px);
  border-radius: 999px;
  padding: 5px 11px;
  color: rgba(246, 242, 234, 0.68);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: color 0.25s ease, background-color 0.25s ease;
}

.ch4-ctrl-link:hover {
  color: #fff4da;
  background: rgba(243, 208, 138, 0.2);
}
