@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@500;700;900&family=Rajdhani:wght@400;500;700&family=Share+Tech+Mono&display=swap');

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  background: #000;
  overflow: hidden;
}

body.branch-page {
  font-family: 'Noto Serif SC', serif;
  color: #f5f1e8;
  background: #000;
}

.branch-scene {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1920px;
  height: 1080px;
  transform: translate(-50%, -50%) scale(1);
  transform-origin: center center;
  overflow: hidden;
  background: #000;
  opacity: 1;
}

.branch-video,
.second-video {
  position: absolute;
  inset: 0;
  width: 1920px;
  height: 1080px;
  object-fit: cover;
  background: #000;
}

.timeline-nav {
  position: fixed;
  left: 50%;
  bottom: 6px;
  z-index: 58;
  transform: translateX(-50%);
  opacity: 0.82;
  pointer-events: auto;
  transition: opacity 0.45s ease, transform 0.35s ease;
}

.timeline-nav.visible {
  opacity: 0.9;
}

.timeline-shell {
  position: relative;
  width: min(1060px, calc(100vw - 180px));
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  padding: 12px 12px 0;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(8, 4, 4, 0.14), rgba(8, 4, 4, 0.03));
  backdrop-filter: blur(3px);
}

.timeline-line {
  position: absolute;
  left: 48px;
  right: 48px;
  top: 17px;
  height: 1px;
  background: linear-gradient(90deg, rgba(40, 8, 8, 0.08), rgba(110, 20, 20, 0.18), rgba(40, 8, 8, 0.08));
  pointer-events: none;
}

.timeline-node {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: none;
  background: transparent;
  color: rgba(255, 235, 235, 0.72);
  cursor: pointer;
  opacity: 0.42;
  pointer-events: none;
  transition: transform 0.35s ease, opacity 0.35s ease, filter 0.35s ease;
}

.timeline-node.unlocked {
  opacity: 1;
  pointer-events: auto;
}

.timeline-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(220, 150, 150, 0.8), rgba(120, 18, 26, 0.92) 52%, rgba(24, 4, 4, 0.98) 100%);
  border: 1px solid rgba(130, 38, 44, 0.44);
}

.timeline-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
  color: rgba(210, 180, 180, 0.52);
  text-transform: uppercase;
  white-space: nowrap;
}

/* 开场标题 */
.title-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at center, rgba(80, 0, 0, 0.16) 0%, rgba(0, 0, 0, 0.35) 35%, rgba(0, 0, 0, 0.86) 100%);
  opacity: 1;
  transition: opacity 2s ease;
  pointer-events: none;
}

.title-overlay.fade-out { opacity: 0; }
.title-overlay.hidden { display: none; }

.title-inner {
  text-align: center;
  padding: 24px 40px;
}

.title-kicker {
  font-family: 'Rajdhani', sans-serif;
  font-size: 18px;
  letter-spacing: 0.45em;
  text-transform: uppercase;
  color: rgba(255, 120, 120, 0.82);
  margin-bottom: 18px;
}

.branch-title {
  font-size: 110px;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #f5f1e8;
  text-transform: uppercase;
  text-shadow:
    0 0 10px rgba(255, 255, 255, 0.08),
    0 0 28px rgba(160, 0, 0, 0.28),
    0 0 60px rgba(80, 0, 0, 0.18);
}

/* ============================================================
   进度计数器 暂停交互
   ============================================================ */

.pause-overlay {
  position: absolute;
  inset: 0;
  z-index: 32;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: crosshair;
  pointer-events: auto;
  background: transparent;
}

.pause-overlay.hidden {
  display: none;
}

/* 三角指示符 */
.counter-triangle-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 8px;
  gap: 4px;
}

.counter-triangle {
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 15px solid #c8000a;
  filter: drop-shadow(0 0 8px rgba(200,0,10,0.7));
  animation: cw-pulse-tri 2s ease-in-out infinite;
}

.counter-triangle-line {
  width: 1px;
  height: 16px;
  background: linear-gradient(to bottom, #c8000a, transparent);
  opacity: 0.6;
}

@keyframes cw-pulse-tri {
  0%, 100% { opacity: 0.55; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-4px); }
}

/* 计数器主体方框 */
.counter-box-widget {
  position: relative;
  width: 240px;
  height: 240px;
  background: rgba(10, 6, 6, 0.88);
  border: 1.5px solid #4a1010;
  cursor: pointer;
  outline: none;
  overflow: hidden;
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  box-shadow:
    0 0 40px rgba(200,0,10,0.08),
    inset 0 1px 0 rgba(255,255,255,0.05);
}

.counter-box-widget::before,
.counter-box-widget::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  z-index: 10;
}

.counter-box-widget::before {
  top: -1px;
  left: -1px;
  border-top: 2px solid #c8000a;
  border-left: 2px solid #c8000a;
}

.counter-box-widget::after {
  bottom: -1px;
  right: -1px;
  border-bottom: 2px solid #c8000a;
  border-right: 2px solid #c8000a;
}

/* 左右刻度容器 */
.cw-ticks {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 20px;
  z-index: 5;
  pointer-events: none;
}

.cw-ticks-left { left: 0; }
.cw-ticks-right { right: 0; }

.cw-tick {
  position: absolute;
  height: 1px;
  background: #3a2020;
  transition: background 0.3s;
}

.cw-ticks-left .cw-tick { right: 0; }
.cw-ticks-right .cw-tick { left: 0; }

.cw-tick.major { width: 12px; }
.cw-tick.minor { width: 6px; }

.cw-tick.active {
  background: #c8000a;
  opacity: 0.8;
}

/* 网格线 */
.cw-grid-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.cw-grid-line {
  position: absolute;
  left: 20px;
  right: 20px;
  height: 1px;
  background: #3a2020;
  opacity: 0.5;
}

/* 填充块 */
.cw-fill-block {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(200, 0, 10, 0.6), rgba(139, 0, 7, 0.15));
  transition: height 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: height;
  z-index: 1;
}

.cw-fill-block::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: #c8000a;
  box-shadow: 0 0 10px #c8000a, 0 0 20px rgba(200,0,10,0.5);
}

/* 数字 */
.cw-number-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 6;
  pointer-events: none;
}

.cw-number {
  font-family: 'Share Tech Mono', monospace;
  font-size: 80px;
  color: rgba(232, 200, 200, 0.9);
  line-height: 1;
  text-shadow: 0 0 30px rgba(200,0,10,0.15);
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cw-unit {
  font-size: 16px;
  color: #6a4040;
  letter-spacing: 3px;
  display: block;
  text-align: center;
  margin-top: 4px;
  font-family: 'Share Tech Mono', monospace;
}

/* 长按光圈 */
.cw-hold-ring {
  position: absolute;
  inset: -5px;
  border: 1.5px solid transparent;
  pointer-events: none;
  z-index: 7;
  transition: border-color 0.1s;
}

.cw-hold-ring.active {
  border-color: rgba(200, 0, 10, 0.35);
  animation: cw-spin-ring 2s linear infinite;
}

@keyframes cw-spin-ring {
  to { transform: rotate(360deg); }
}

/* 完成闪烁 */
.cw-complete-flash {
  position: absolute;
  inset: 0;
  background: #c8000a;
  opacity: 0;
  pointer-events: none;
  z-index: 8;
}

/* 波纹 */
.cw-ripple {
  position: absolute;
  background: rgba(200, 0, 10, 0.14);
  transform: scale(0);
  animation: cw-ripple-anim 0.4s ease-out forwards;
  pointer-events: none;
  z-index: 3;
}

@keyframes cw-ripple-anim {
  to { transform: scale(4); opacity: 0; }
}

/* 完成态 */
.counter-box-widget.complete {
  border-color: #ff4444;
  box-shadow: 0 0 30px rgba(255,68,68,0.5), 0 0 60px rgba(200,0,10,0.2);
}

.counter-box-widget.complete::before,
.counter-box-widget.complete::after {
  border-color: #ff4444;
}

.counter-box-widget.complete .cw-fill-block {
  background: linear-gradient(to top, rgba(255,50,50,0.6), rgba(200,0,10,0.1));
}

.counter-box-widget.complete .cw-fill-block::after {
  background: #ff4444;
  box-shadow: 0 0 10px #ff4444, 0 0 20px rgba(255,68,68,0.5);
}

.counter-box-widget.complete .cw-number {
  color: #ff8888;
  text-shadow: 0 0 20px rgba(255,68,68,0.5);
}

/* 数字弹跳 */
@keyframes cw-bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.1) translateY(-5px); }
  100% { transform: scale(1); }
}

.cw-number.bump {
  animation: cw-bump 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* 完成闪烁动画 */
@keyframes cw-flash-anim {
  0% { opacity: 0; }
  20% { opacity: 0.22; }
  40% { opacity: 0; }
  60% { opacity: 0.13; }
  100% { opacity: 0; }
}

.cw-complete-flash.flash {
  animation: cw-flash-anim 0.7s ease forwards;
}

/* 鼠标移动提示 */
.counter-hint {
  position: absolute;
  left: 50%;
  top: calc(50% - 210px);
  transform: translateX(-50%);
  z-index: 40;
  display: block;
  font-family: 'Noto Serif SC', serif;
  font-size: 20px;
  color: rgba(255, 255, 255, 0.86);
  letter-spacing: 0.18em;
  white-space: nowrap;
  opacity: 1;
  transition: opacity 0.4s ease;
  pointer-events: none;
  text-shadow: 0 0 12px rgba(255,255,255,0.12);
}

.counter-hint.hidden {
  opacity: 0;
  pointer-events: none;
}

/* 底部长按提示 */
.cw-hint {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  letter-spacing: 4px;
  color: rgba(106, 64, 64, 0.8);
  margin-top: 14px;
  animation: cw-hint-blink 3s ease-in-out infinite;
}

@keyframes cw-hint-blink {
  0%, 80%, 100% { opacity: 0.35; }
  40% { opacity: 0.9; }
}

/* 三角完成时变色 */
.counter-triangle.complete {
  border-bottom-color: #ff4444;
  filter: drop-shadow(0 0 8px rgba(255,68,68,0.6));
}

/* drop layer */
.drop-layer {
  position: absolute;
  inset: 0;
  z-index: 50;
  overflow: hidden;
}

.drop-layer.hidden { display: none; }

.drop-bg {
  position: absolute;
  inset: 0;
  width: 1920px;
  height: 1080px;
  object-fit: cover;
  user-select: none;
}

.drop-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.26), rgba(0,0,0,0.03) 34%, rgba(0,0,0,0.18) 100%);
}

.popup-field,
.final-popup-field {
  position: absolute;
  left: 24px;
  right: 24px;
  top: 10px;
  bottom: 150px;
  z-index: 132;
  pointer-events: none;
}

.memory-popup {
  position: absolute;
  opacity: 0;
  transform:
    translate3d(var(--x, 0px), var(--y, 0px), 0)
    rotate(var(--r, 0deg))
    scale(0.72);
  filter:
    drop-shadow(0 24px 42px rgba(0, 0, 0, 0.38))
    drop-shadow(0 0 16px rgba(255, 255, 255, 0.04));
  transition:
    opacity 0.7s ease,
    transform 1.05s cubic-bezier(0.2, 0.85, 0.2, 1),
    filter 1.1s ease;
}

.memory-popup img {
  width: 100%;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

.final-popup {
  will-change: transform, opacity, filter, box-shadow;
  backface-visibility: hidden;
  transform-style: preserve-3d;
}

.memory-popup.show {
  opacity: 1;
  transform:
    translate3d(var(--x, 0px), var(--y, 0px), 0)
    rotate(var(--r, 0deg))
    scale(1);
}

.memory-popup.float-in {
  animation: popupFloatIn 0.95s ease-out;
}

.memory-popup.soft-focus {
  filter:
    drop-shadow(0 18px 34px rgba(0, 0, 0, 0.34))
    drop-shadow(0 0 14px rgba(255,255,255,0.10))
    brightness(1.06)
    saturate(1.02)
    contrast(1.01);
  animation: popupBreath 1.8s ease-in-out infinite;
}

.memory-popup.gathering {
  transform:
    translate3d(var(--gx, 920px), var(--gy, 420px), 0)
    rotate(var(--gr, 0deg))
    scale(var(--gs, 0.42)) !important;
  opacity: 0.96;
  transition:
    transform 1.9s cubic-bezier(0.16, 0.84, 0.16, 1),
    opacity 1.1s ease,
    filter 1.2s ease;
}

.memory-popup.after-gather {
  opacity: 0.18;
  transition: opacity 1.1s ease;
}

@keyframes popupFloatIn {
  0% {
    opacity: 0;
    transform:
      translate3d(calc(var(--x, 0px) + 36px), calc(var(--y, 0px) + 28px), 0)
      rotate(calc(var(--r, 0deg) * 0.45))
      scale(0.64);
  }
  100% {
    opacity: 1;
    transform:
      translate3d(var(--x, 0px), var(--y, 0px), 0)
      rotate(var(--r, 0deg))
      scale(1);
  }
}

@keyframes popupBreath {
  0% {
    transform:
      translate3d(var(--x, 0px), var(--y, 0px), 0)
      rotate(var(--r, 0deg))
      scale(1);
  }
  100% {
    transform:
      translate3d(var(--x, 0px), var(--y, 0px), 0)
      rotate(var(--r, 0deg))
      scale(1.018);
  }
}

/* 底部中区提示位 */
.drop-action-zone {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* ─────────────────────────────
   顶部动态阅读区
   Top reading text area
───────────────────────────── */
.drop-reading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 145;
  width: 1320px;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.drop-reading-line {
  opacity: 0;
  transform: translateY(14px);
  text-align: center;
  font-size: 34px;
  line-height: 1.45;
  font-weight: 700;
  color: rgba(245, 241, 232, 0.96);
  text-shadow:
    0 0 14px rgba(0, 0, 0, 0.42),
    0 0 28px rgba(120, 0, 0, 0.14);
  background: rgba(92, 0, 0, 0.34);
  border: 1px solid rgba(200, 0, 10, 0.26);
  box-shadow:
    0 0 26px rgba(70, 0, 0, 0.20),
    inset 0 1px 0 rgba(255,255,255,0.04);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 18px 34px;
  border-radius: 6px;
  max-width: 1120px;
  transition:
    opacity 0.8s ease,
    transform 0.8s ease;
}

.drop-reading-line.show {
  opacity: 1;
  transform: translateY(0);
}

.drop-reading-line.hide {
  opacity: 0;
  transform: translateY(-10px);
}

/* ─────────────────────────────
   底部文字区域
   Bottom info area
───────────────────────────── */
.drop-head {
  position: absolute;
  left: 50%;
  bottom: 42px;
  transform: translateX(-50%);
  z-index: 134;
  text-align: center;
  width: 1120px;
  pointer-events: none;
}

.drop-layer .drop-kicker {
  display: none;
}

.drop-title {
  font-size: 40px;
  font-weight: 900;
  letter-spacing: 0.05em;
  color: #f3eadf;
  line-height: 1.18;
}

.drop-subtitle {
  margin-top: 8px;
  font-size: 17px;
  color: rgba(255,255,255,0.94);
  letter-spacing: 0.04em;
}

.drop-status {
  margin-top: 10px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 17px;
  letter-spacing: 0.16em;
  color: rgba(255, 232, 232, 0.96);
}

.drop-action-zone {
  position: relative;
  width: 100%;
  min-height: 86px;
  margin-top: 14px;
}

.drop-tip {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  width: 100%;
  font-size: 15px;
  color: rgba(255,255,255,0.94);
  min-height: 22px;
  opacity: 1;
  transition:
    opacity 0.9s ease,
    transform 0.9s ease;
}

.drop-tip.fade-out {
  opacity: 0;
  transform: translateX(-50%) translateY(-8px);
}

/* ─────────────────────────────
   揭开真相按钮：不在最底部，叠在提示语位置
   Reveal button: appears where the tip was
───────────────────────────── */
.reveal-truth-btn {
  position: absolute;
  left: 50%;
  top: -2px;
  bottom: auto;
  transform: translateX(-50%) translateY(10px);
  z-index: 135;
  padding: 15px 46px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 16px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(232, 200, 200, 0.9);
  background: rgba(10, 6, 6, 0.9);
  border: 1.5px solid #4a1010;
  cursor: pointer;
  backdrop-filter: blur(12px) saturate(120%);
  box-shadow:
    0 0 40px rgba(200, 0, 10, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 1s cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 1s cubic-bezier(0.22, 0.61, 0.36, 1),
    border-color 0.35s ease,
    color 0.35s ease,
    box-shadow 0.35s ease;
}

.reveal-truth-btn::before,
.reveal-truth-btn::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  z-index: 2;
}

.reveal-truth-btn::before {
  top: -1px;
  left: -1px;
  border-top: 2px solid #c8000a;
  border-left: 2px solid #c8000a;
}

.reveal-truth-btn::after {
  bottom: -1px;
  right: -1px;
  border-bottom: 2px solid #c8000a;
  border-right: 2px solid #c8000a;
}

.reveal-truth-btn.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.reveal-truth-btn:hover {
  border-color: #c8000a;
  color: #f5f1e8;
  box-shadow:
    0 0 40px rgba(200, 0, 10, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* 123 标签：改成和进度条同一套红黑质感，并移到人物左边 */
.person-order-badge {
  position: absolute;
  left: -22px;
  top: 50%;
  transform: translate(-100%, -50%);
  width: 52px;
  height: 52px;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Share Tech Mono', monospace;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  color: rgba(232, 200, 200, 0.94);
  text-shadow:
    0 0 8px rgba(200, 0, 10, 0.14),
    0 1px 2px rgba(0, 0, 0, 0.36);
  background: rgba(10, 6, 6, 0.92);
  border: 1.5px solid #4a1010;
  box-shadow:
    0 0 22px rgba(200,0,10,0.10),
    inset 0 1px 0 rgba(255,255,255,0.05);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  pointer-events: none;
  user-select: none;
  z-index: 12;
  overflow: visible;
}

.person-order-badge::before,
.person-order-badge::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  z-index: 2;
}

.person-order-badge::before {
  top: -1px;
  left: -1px;
  border-top: 2px solid #c8000a;
  border-left: 2px solid #c8000a;
}

.person-order-badge::after {
  bottom: -1px;
  right: -1px;
  border-bottom: 2px solid #c8000a;
  border-right: 2px solid #c8000a;
}

.person-1 .person-order-badge {
  left: -28px;
  top: 42%;
}

.person-2 .person-order-badge {
  left: -24px;
  top: 44%;
}

.person-3 .person-order-badge {
  left: -24px;
  top: 44%;
}

.drop-person.done .person-order-badge {
  opacity: 0.4;
  transform: translate(-100%, -50%) scale(0.96);
}

/* 防止编号被图片边缘吞掉 */
.drop-person {
  overflow: visible;
}

/* 人物 */
.drop-person {
  position: absolute;
  z-index: 62;
  border: none;
  background: transparent;
  padding: 0;
  cursor: grab;
  touch-action: none;
  user-select: none;
  transition: transform 0.28s ease, filter 0.3s ease, opacity 0.3s ease;
  animation: breathe 2s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.drop-person.dragging { 
  cursor: grabbing; 
  animation: none;
}

.drop-person img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
  filter: drop-shadow(0 16px 24px rgba(0,0,0,0.22));
}

.drop-person.done {
  pointer-events: none;
  animation: none;
}

/* 防止编号被图片边缘吞掉 */
.drop-person {
  overflow: visible;
}

.person-1 {
  left: 386px;
  top: 254px;
  width: 246px;
  height: 421px;
  --drop-distance: 150px;
}

.person-2 {
  left: 788px;
  top: 8px;
  width: 113px;
  height: 251px;
  --drop-distance: 170px;
}

.person-3 {
  left: 1149px;
  top: 8px;
  width: 133px;
  height: 319px;
  --drop-distance: 170px;
}

/* popup位置 */
.popup-1 { --x: 26px; --y: 72px; --r: -8deg; width: 600px; z-index: 133; }
.popup-2 { --x: 635px; --y: 46px; --r: 6deg; width: 670px; z-index: 136; }
.popup-3 { --x: 1312px; --y: 92px; --r: -5deg; width: 600px; z-index: 133; }
.popup-4 { --x: 18px; --y: 300px; --r: 4deg; width: 660px; z-index: 134; }
.popup-5 { --x: 660px; --y: 300px; --r: -6deg; width: 730px; z-index: 138; }
.popup-6 { --x: 1300px; --y: 360px; --r: 7deg; width: 600px; z-index: 134; }
.popup-7 { --x: 14px; --y: 560px; --r: -5deg; width: 590px; z-index: 133; }
.popup-8 { --x: 590px; --y: 540px; --r: 3deg; width: 700px; z-index: 137; }
.popup-9 { --x: 1310px; --y: 555px; --r: -4deg; width: 590px; z-index: 133; }

/* 第二段视频层 */
.second-video-layer {
  position: absolute;
  inset: 0;
  z-index: 165;
  background: #000;
  opacity: 1;
}

.second-video-layer.hidden {
  display: none;
}

.second-video-reading {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 1220px;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 170;
  pointer-events: none;
}

.second-video-reading-line {
  opacity: 1;
  transform: translateY(0);
  width: auto;
  max-width: 1120px;
  padding: 24px 34px;
  text-align: center;
  font-size: 31px;
  line-height: 1.85;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(245, 241, 232, 0.96);
  text-shadow:
    0 0 14px rgba(0, 0, 0, 0.42),
    0 0 28px rgba(120, 0, 0, 0.14);
  background: rgba(10, 10, 10, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow:
    0 0 24px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255,255,255,0.04);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 8px;
  transition:
    opacity 0.95s ease,
    transform 0.95s ease;
}

.second-video-reading.fade-out .second-video-reading-line {
  opacity: 0;
  transform: translateY(-10px);
}

.second-video-reading-line.show {
  opacity: 1;
  transform: translateY(0);
}

.second-video-reading-segment {
  display: inline-block;
  opacity: 0;
  transform: translateY(18px);
  filter: blur(6px);
  transition:
    opacity 1.35s ease,
    transform 1.35s cubic-bezier(0.2, 0.82, 0.2, 1),
    filter 1.35s ease;
}

.second-video-reading-segment.show {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

.second-video-reading br {
  display: block;
  content: '';
  margin-top: 16px;
}

/* 黑底评论层 */
.comment-end-layer {
  position: absolute;
  inset: 0;
  z-index: 180;
  background: #050505;
  overflow: hidden;
  opacity: 1;
  transition: opacity 1.4s ease;
}

.comment-end-layer.hidden {
  display: none;
}

.comment-end-layer.prep {
  opacity: 0;
}

.comment-end-layer.visible {
  opacity: 1;
}

.comment-bg-noise {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.025), transparent 25%),
    radial-gradient(circle at 75% 60%, rgba(255,255,255,0.02), transparent 25%),
    linear-gradient(180deg, rgba(255,255,255,0.01), rgba(0,0,0,0.04));
  opacity: 0.9;
}

.comment-cloud {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.comment-card {
  position: absolute;
  padding: 16px 18px;
  border: 1px solid rgba(255,255,255,0.05);
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(6px);
  color: rgba(255,255,255,0.28);
  font-size: 18px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  max-width: 360px;
  opacity: 0;
  transform: translateY(24px) scale(0.95);
  animation: commentFadeIn 1.8s ease forwards;
}

@keyframes commentFadeIn {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.comment-end-copy {
  position: absolute;
  left: 50%;
  bottom: 82px;
  transform: translateX(-50%);
  z-index: 5;
  width: 1100px;
  text-align: center;
  pointer-events: none;
}

.comment-end-kicker {
  font-family: 'Rajdhani', sans-serif;
  font-size: 16px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: rgba(255, 148, 148, 0.84);
  margin-bottom: 14px;
}

.comment-end-title {
  font-size: 72px;
  font-weight: 900;
  color: #f4ede4;
  text-shadow:
    0 0 18px rgba(255,255,255,0.03),
    0 0 22px rgba(150, 10, 20, 0.12);
}

.comment-end-body {
  margin-top: 18px;
  font-size: 24px;
  line-height: 1.88;
  color: rgba(255,255,255,0.88);
}

.comment-end-actions {
  position: absolute;
  left: 50%;
  bottom: 44px;
  transform: translateX(-50%);
  z-index: 6;
}

.comment-end-btn {
  min-width: 168px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255,255,255,0.92);
  font-family: 'Noto Serif SC', serif;
  font-size: 15px;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

.comment-end-btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
}


/* ========================================================= */
/* 以下为新增的视觉特效与第三个视频层样式                      */
/* ========================================================= */

/* 1. 弹窗渐渐发光的状态（替代原有卡顿的滤镜，改为高性能的盒子阴影） */
.glowing {
  transition: box-shadow 1s ease, background-color 1s ease !important;
  box-shadow: 0 0 40px 15px rgba(255, 255, 255, 0.85) !important;
  background-color: rgba(255, 255, 255, 0.95) !important;
  will-change: transform, opacity, box-shadow;
}

/* 2. 中心炸开的汇聚光点 */
.center-flash-light {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 40px;
  height: 40px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 120px 60px rgba(255, 255, 255, 1);
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.5s ease;
  z-index: 999;
  pointer-events: none;
}

/* 3. 全屏闪白遮罩层 */
.white-flash-overlay {
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background: #ffffff;
  opacity: 0;
  z-index: 9999;
  pointer-events: none;
  transition: opacity 0.8s ease;
}

.popup-core-light {
  pointer-events: none;
}

/* 4. 第三个视频层 */
#third-video-layer {
  position: absolute;
  inset: 0;
  z-index: 190;
  background: #000;
  opacity: 1;
}

#third-video-layer.hidden {
  display: none;
}

#third-video {
  position: absolute;
  inset: 0;
  width: 1920px;
  height: 1080px;
  object-fit: cover;
  background: #000;
}
/* =========================
   END VIDEO RESPONSE LAYER
   ========================= */

.third-video-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #000;
}

.third-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  z-index: 1;
}

.end-response-cloud {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.end-response-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.58),
    rgba(0, 0, 0, 0.16),
    rgba(0, 0, 0, 0.42)
  );
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.9s ease;
}

.end-response-layer.show {
  opacity: 1;
  pointer-events: auto;
}

.end-response-panel {
  width: 760px;
  max-width: 76vw;
  padding: 34px 36px 30px;
  border-radius: 24px;
  background: rgba(10, 10, 10, 0.58);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  color: #f7f2ea;
  font-family: 'Noto Serif SC', serif;
  transform: translateY(24px);
  opacity: 0;
  transition:
    transform 0.95s cubic-bezier(0.22, 0.7, 0.18, 1),
    opacity 0.95s ease;
}

.end-response-layer.show .end-response-panel {
  transform: translateY(0);
  opacity: 1;
}

.end-response-kicker {
  margin: 0 0 12px;
  font-size: 12px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
  font-family: 'Rajdhani', sans-serif;
}

.end-response-title {
  margin: 0 0 14px;
  font-size: 40px;
  font-weight: 700;
  line-height: 1.2;
  color: #f7f2ea;
}

.end-response-prompt {
  margin: 0 0 22px;
  font-size: 18px;
  line-height: 1.8;
  color: rgba(247, 242, 234, 0.88);
}

.end-response-input {
  width: 100%;
  min-height: 136px;
  resize: none;
  border-radius: 18px;
  padding: 18px 20px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  outline: none;
  background: rgba(255, 255, 255, 0.07);
  color: #fffaf3;
  font-size: 18px;
  line-height: 1.7;
  font-family: 'Noto Serif SC', serif;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.end-response-input::placeholder {
  color: rgba(255, 250, 243, 0.42);
}

.end-response-input:focus {
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.09);
}

.end-response-actions {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.end-response-count {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.62);
  font-family: 'Rajdhani', sans-serif;
  letter-spacing: 0.06em;
}

.end-response-submit {
  border: none;
  border-radius: 999px;
  padding: 14px 26px;
  background: rgba(255, 255, 255, 0.92);
  color: #111;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 0.25s ease,
    opacity 0.25s ease,
    box-shadow 0.25s ease;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
}

.end-response-submit:hover {
  transform: translateY(-1px);
}

.end-response-submit:disabled {
  opacity: 0.7;
  cursor: default;
  transform: none;
}

.end-response-feedback {
  margin: 18px 0 0;
  font-size: 16px;
  line-height: 1.8;
  color: rgba(255, 250, 243, 0.9);
}

.end-response-nav {
  margin-top: 22px;
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.end-response-nav-btn {
  min-width: 154px;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid rgba(255, 120, 120, 0.28);
  background: rgba(110, 8, 18, 0.24);
  color: rgba(255,255,255,0.92);
  font-family: 'Noto Serif SC', serif;
  font-size: 15px;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease, opacity 0.25s ease;
}

.end-response-nav-btn:hover {
  transform: translateY(-1px);
  background: rgba(130, 12, 24, 0.34);
  border-color: rgba(255, 140, 140, 0.4);
}

.end-response-nav-btn.is-secondary {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.86);
}

.end-voice-card {
  position: absolute;
  padding: 14px 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 248, 240, 0.92);
  font-size: 16px;
  line-height: 1.7;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
  opacity: 0;
  transition:
    opacity 1s ease,
    transform 1.15s cubic-bezier(0.22, 0.7, 0.18, 1);
  will-change: transform, opacity;
}

@keyframes endVoiceFloat {
  0% {
    transform: translateY(0px) rotate(-1deg);
  }
  100% {
    transform: translateY(-12px) rotate(1deg);
  }
}
.user-comment-card {
  border-color: rgba(255, 236, 210, 0.28);
  background: rgba(255, 248, 240, 0.09);
}

.user-comment-card.is-highlighted {
  z-index: 12;
  border-color: rgba(255, 244, 220, 0.62);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.08),
    0 0 18px rgba(255, 244, 214, 0.18),
    0 0 36px rgba(255, 244, 214, 0.10);
  animation:
    userVoiceGlow 0.9s ease-in-out 0s 2 alternate,
    userVoiceBreath 1.9s ease-in-out 1.8s 2;
}

.return-voice-hint {
  position: absolute;
  left: 50%;
  top: 92px;
  transform: translateX(-50%) translateY(14px);
  min-width: 320px;
  max-width: 720px;
  padding: 14px 24px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(10px);
  color: rgba(255, 245, 232, 0.95);
  font-size: 16px;
  letter-spacing: 0.08em;
  text-align: center;
  border-radius: 999px;
  opacity: 0;
  z-index: 30;
  pointer-events: none;
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.return-voice-hint.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.return-voice-hint.hide {
  opacity: 0;
  transform: translateX(-50%) translateY(-8px);
}

@keyframes userVoiceGlow {
  0% {
    transform: scale(1);
    filter: brightness(1);
  }
  100% {
    transform: scale(1.045);
    filter: brightness(1.08);
  }
}

@keyframes userVoiceBreath {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.028);
  }
  100% {
    transform: scale(1);
  }
}
