/* ===== 全局样式 ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --pink: #a78bfa;
  --pink-deep: #7c3aed;
  --purple: #c084fc;
  --bg: #150a22;
  --text: #efe6fb;
  --text-light: #c3aede;
  --card: rgba(48, 26, 74, 0.72);
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background:
    radial-gradient(820px 520px at 50% -8%, rgba(139, 92, 246, 0.34), transparent 70%),
    radial-gradient(640px 620px at 8% 35%, rgba(91, 33, 182, 0.32), transparent 72%),
    radial-gradient(700px 560px at 92% 78%, rgba(126, 34, 206, 0.26), transparent 72%),
    linear-gradient(180deg, #2a1642 0%, #1e0f30 46%, #150a22 100%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
}

/* ===== 顶部导航 ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  background: #0d0a12;
  backdrop-filter: blur(12px);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.45);
  border-bottom: 1px solid rgba(192, 132, 252, 0.18);
}

.nav .logo {
  font-size: 22px;
  font-weight: 800;
  color: #e9d5ff;
  text-decoration: none;
  letter-spacing: 0.5px;
}

.nav .logo span {
  color: #c084fc;
}

.nav-links {
  display: flex;
  gap: 8px;
}

.nav-links a {
  text-decoration: none;
  color: #cbb8e0;
  font-size: 15px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 999px;
  transition: all 0.25s;
}

.nav-links a:hover {
  background: rgba(192, 132, 252, 0.16);
  color: #f3e8ff;
}

.nav-links a.active {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #fff;
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.5);
}

/* ===== 主页 ===== */
.hero {
  text-align: center;
  padding: 80px 24px 40px;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.hero-avatar {
  width: 140px;
  height: 140px;
  margin: 0 auto 24px;
  border-radius: 50%;
  display: block;
  object-fit: cover;
  object-position: center;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 44px rgba(168, 85, 247, 0.35);
  border: 4px solid rgba(255, 255, 255, 0.55);
}

/* ===== 首页头像彩蛋 ===== */
.avatar-stage {
  position: relative;
  z-index: 200; /* 高于 .hero-glow，转圈时只有圆形头像不被白光盖住 */
  width: 140px;
  height: 140px;
  margin: 0 auto 24px;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  /* 防止移动端快速点按时被浏览器双击缩放/选择手势打断 */
  touch-action: manipulation;
}

/* 首页：单击圆形头像后弹出的弹跳图形层（纯展示，不拦截鼠标） */
.bounce-layer {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 300; /* 盖住头像与白光，但仍低于切页的海水层 */
}

.bounce-item {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  object-fit: contain;
  will-change: transform;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.45));
}

.bounce-item.fading {
  opacity: 0;
  transition: opacity 0.4s ease;
}

/* ===== 狂暴模式：头像闪动 + 抖动 + 全屏锁交互遮罩 ===== */
.frenzy-flash {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  z-index: 6;            /* 盖在头像层与表盘之上 */
  opacity: 0;
  pointer-events: none;
  display: none;
}
.frenzy-flash.on {
  display: block;
  animation: frenzyFlash 0.33s steps(1) infinite;
}
@keyframes frenzyFlash {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}

/* 头像整体抖动 */
#avatarStage.frenzy {
  animation: frenzyShake 0.08s linear infinite;
}
@keyframes frenzyShake {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(-5px, 3px) rotate(-1.2deg); }
  50% { transform: translate(4px, -4px) rotate(1.2deg); }
  75% { transform: translate(-3px, 4px) rotate(-0.6deg); }
}

/* 狂暴期间全屏透明遮罩：拦截所有指针 / 键盘 / 滚动，动画照常播放 */
.frenzy-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: transparent;
  display: none;
  cursor: wait;
}
.frenzy-overlay.on {
  display: block;
}

.avatar-layers {
  position: absolute;
  inset: 0;
}

.avatar-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  -webkit-user-drag: none;
  user-drag: none;
}

.avatar-layer[data-index="0"] { z-index: 4; }
.avatar-layer[data-index="1"] { z-index: 3; }
.avatar-layer[data-index="2"] { z-index: 2; }
.avatar-layer[data-index="3"] { z-index: 1; }

.avatar-layer.dropping {
  animation: avatarDrop 1.15s cubic-bezier(0.45, 0.02, 0.75, 0.55) forwards;
}

@keyframes avatarDrop {
  0%   { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); opacity: 1; }
  18%  { transform: translate3d(0, -16px, 0) rotate(-7deg) scale(1.03); opacity: 1; }
  100% { transform: translate3d(0, 74vh, 0) rotate(26deg) scale(0.82); opacity: 0; }
}

.clock-veil {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 340px;
  height: 340px;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
  z-index: 5; /* 盖在头像之上：指针要能横过头像才看得见，但不填色，头像仍然透过线条可见 */
}

/* 表盘后的柔光，让时钟从背景里浮出来 */
.clock-veil::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(226, 200, 255, 0.14) 0%, rgba(226, 200, 255, 0.05) 46%, transparent 66%);
}

.clock-veil.on {
  animation: veilPulse 2.6s ease-in-out infinite;
}

.clock-veil svg {
  position: relative;
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 0 10px rgba(226, 200, 255, 0.7));
}

.clock-veil .hand {
  transform-box: view-box;
  transform-origin: 100px 100px;
}

.clock-veil .hand line.glow {
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.95));
}

.clock-veil .hand-h { animation: clockBack 24s linear infinite; }
.clock-veil .hand-m { animation: clockBack 7s linear infinite; }
.clock-veil .hand-s { animation: clockBack 4.5s linear infinite; }

@keyframes clockBack {
  from { transform: rotate(0deg); }
  to { transform: rotate(-360deg); }
}

@keyframes veilPulse {
  0%, 100% { opacity: 0.45; }
  45% { opacity: 1; }
}

/* 转圈时除头像外的整屏渐亮：透明度由脚本按进度直接设置 */
.hero-glow {
  position: fixed;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  z-index: 150;
  will-change: opacity;
}

/* 最后一刻盖在头像上面的白光：连圆形头像也一起吃掉，然后才切页 */
.hero-flash {
  position: fixed;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  z-index: 260;
  transition: opacity 0.8s ease;
  will-change: opacity;
}

.hero-flash.on {
  opacity: 1;
}

/* 进入页面 4 时的白光淡出：时长对齐钟声剩余的 6.3 秒，声音放完时页面刚好完全显现 */
.page-bloom {
  position: fixed;
  inset: 0;
  background: #fff;
  pointer-events: none;
  z-index: 9000;
  animation: pageBloomOut 6.3s ease 0.05s forwards;
}

@keyframes pageBloomOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

.hero h1 {
  font-size: 42px;
  letter-spacing: 2px;
  color: #f7edff;
}

.hero h1 em {
  font-style: normal;
  background: linear-gradient(135deg, #f8eeff 0%, #ddc0fc 42%, #b388ff 100%);
  filter: drop-shadow(0 8px 28px rgba(168, 85, 247, 0.45));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  margin-top: 14px;
  font-size: 17px;
  color: var(--text-light);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 28px;
  max-width: 1000px;
  margin: 48px auto 80px;
  padding: 0 24px;
}

.card {
  background: var(--card);
  backdrop-filter: blur(6px);
  border-radius: 24px;
  padding: 36px 28px;
  text-decoration: none;
  color: var(--text);
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.42);
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
  border: 1px solid rgba(192, 132, 252, 0.22);
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5), 0 0 36px rgba(168, 85, 247, 0.35);
  border-color: rgba(192, 132, 252, 0.45);
}

.card .icon {
  width: 96px;
  height: 96px;
  margin: 0 auto 18px;
  border-radius: 24px;
  object-fit: cover;
  overflow: hidden;
  background: rgba(192, 132, 252, 0.14);
  border: 1px solid rgba(192, 132, 252, 0.2);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.card h2 {
  font-size: 21px;
  margin-bottom: 10px;
  color: #f4e9ff;
}

.card p {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.7;
}

/* ===== 子页面通用 ===== */
.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.page-title {
  text-align: center;
  margin-bottom: 36px;
}

.page-title h1 {
  font-size: 34px;
  background: linear-gradient(135deg, #f8eeff 0%, #ddc0fc 42%, #b388ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
  filter: drop-shadow(0 8px 28px rgba(168, 85, 247, 0.45));
}

.page-title p {
  margin-top: 8px;
  color: var(--text-light);
  font-size: 15px;
}

/* ===== 点歌页 ===== */
.search-box {
  position: relative;
  max-width: 560px;
  margin: 0 auto 32px;
}

.search-box input {
  width: 100%;
  padding: 16px 52px 16px 24px;
  font-size: 16px;
  border: 2px solid rgba(192, 132, 252, 0.3);
  border-radius: 999px;
  outline: none;
  background: rgba(26, 14, 42, 0.78);
  transition: all 0.25s;
  color: var(--text);
}

.search-box input::placeholder {
  color: rgba(195, 174, 222, 0.55);
}

.search-box input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 4px rgba(192, 132, 252, 0.16), 0 0 28px rgba(168, 85, 247, 0.28);
}

.search-box .search-icon {
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: var(--pink);
  pointer-events: none;
}

.song-count {
  text-align: center;
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 16px;
}

.song-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 720px;
  margin: 0 auto;
}

.song-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--card);
  border-radius: 16px;
  padding: 14px 20px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(192, 132, 252, 0.2);
  animation: fadeIn 0.3s;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.song-item .song-name {
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.song-item .song-name .note {
  color: #d8b4fe;
  font-size: 18px;
}

.btn-order {
  flex-shrink: 0;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  padding: 9px 20px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
  font-family: inherit;
}

.btn-order:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.45);
}

.btn-order.copied {
  background: linear-gradient(135deg, #4ade80, #22c55e);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.35);
}

.empty-tip {
  text-align: center;
  color: var(--text-light);
  padding: 48px 0;
  font-size: 15px;
}

/* 复制成功提示 */
.toast {
  position: fixed;
  left: 50%;
  bottom: 48px;
  transform: translateX(-50%) translateY(20px);
  background: rgba(43, 24, 68, 0.94);
  color: #f3e8ff;
  padding: 12px 28px;
  border-radius: 999px;
  border: 1px solid rgba(192, 132, 252, 0.32);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s;
  z-index: 999;
}

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

/* ===== 表情包页 ===== */
/* 分类卡片 */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 22px;
  align-items: start;
}

.cat-card {
  background: var(--card);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(192, 132, 252, 0.2);
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.cat-card:hover {
  transform: translateY(-4px);
  border-color: rgba(192, 132, 252, 0.45);
}

.cat-card.open {
  grid-column: 1 / -1;
  transform: none;
  border-color: rgba(192, 132, 252, 0.5);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45), 0 0 36px rgba(168, 85, 247, 0.22);
}

.cat-cover {
  position: relative;
  cursor: pointer;
}

.cat-cover img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  transition: height 0.3s;
}

.cat-card.open .cat-cover img {
  aspect-ratio: auto;
  height: 130px;
}

.cat-badge {
  position: absolute;
  right: 10px;
  top: 10px;
  background: rgba(13, 10, 18, 0.78);
  color: #e9d5ff;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(192, 132, 252, 0.3);
}

.cat-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
}

.cat-meta h3 {
  font-size: 15px;
  color: #f4e9ff;
}

.cat-hint {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--text-light);
}

.cat-panel {
  display: none;
  padding: 4px 16px 18px;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 14px;
}

.cat-card.open .cat-panel {
  display: grid;
}

/* 单个表情：双击翻面 */
.em-card {
  position: relative;
  aspect-ratio: 1;
  perspective: 900px;
  cursor: zoom-in;
  user-select: none;
  -webkit-user-select: none;
}

.em-inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

.em-card.flipped .em-inner {
  transform: rotateY(180deg);
}

.em-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(192, 132, 252, 0.2);
  background: rgba(26, 14, 42, 0.78);
}

.em-front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.em-back {
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px;
  background: linear-gradient(160deg, rgba(56, 30, 88, 0.92), rgba(32, 17, 52, 0.96));
}

.em-back img {
  width: 58%;
  aspect-ratio: 1;
  object-fit: contain;
}

.btn-take {
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  padding: 7px 15px;
  border-radius: 999px;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-take:hover {
  transform: scale(1.07);
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.55);
}

/* ===== 主播介绍页（深紫 + 旧纸） ===== */
body.about-dark {
  background:
    radial-gradient(820px 520px at 50% -8%, rgba(139, 92, 246, 0.34), transparent 70%),
    radial-gradient(640px 620px at 8% 35%, rgba(91, 33, 182, 0.32), transparent 72%),
    radial-gradient(700px 560px at 92% 78%, rgba(126, 34, 206, 0.26), transparent 72%),
    linear-gradient(180deg, #2a1642 0%, #1e0f30 46%, #150a22 100%);
  background-attachment: fixed;
  color: #efe6fb;
}

.about-page {
  max-width: 1280px;
}

body.about-dark .about-title h1 {
  font-size: 46px;
  letter-spacing: 2px;
  background: linear-gradient(135deg, #f8eeff 0%, #ddc0fc 42%, #b388ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 8px 28px rgba(168, 85, 247, 0.45));
}

.about-hero {
  text-align: center;
  margin-bottom: 52px;
}

.about-hero .about-avatar {
  width: 120px;
  height: 120px;
  margin: 0 auto 20px;
  border-radius: 50%;
  display: block;
  object-fit: cover;
  object-position: center;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  border: 4px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 44px rgba(168, 85, 247, 0.35);
}

.about-hero h2 {
  font-size: 30px;
  margin-bottom: 10px;
  letter-spacing: 1px;
  color: #f7edff;
}

.about-hero .about-tag {
  font-size: 16px;
  color: #c3aede;
  letter-spacing: 0.5px;
}

/* 卷轴 + 卡片舞台 */
.stage {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 300px;
  gap: 30px;
  align-items: stretch;
}

.card-col {
  position: relative;
  min-height: 100%;
  z-index: 4;
}

/* 翻面卡片：绝对定位，12 张各自一个高度，向卷轴方向偏移 */
.flip-card {
  position: absolute;
  height: 318px;
  z-index: 4;
  perspective: 1400px;
  cursor: pointer;
  animation-name: floatY;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}

.card-col.left .flip-card:nth-child(1) { top: 0%;    left: 0;     width: 280px; --amp: 54px; --dx: 8px;  animation-duration: 8.6s;  animation-delay: -0.3s; }
.card-col.left .flip-card:nth-child(2) { top: 16%;   left: 46px;  width: 292px; --amp: 66px; --dx: 8px;  animation-duration: 10.4s; animation-delay: -2.8s; }
.card-col.left .flip-card:nth-child(3) { top: 31%;   left: 18px;  width: 276px; --amp: 58px; --dx: 8px;  animation-duration: 9.2s;  animation-delay: -5.1s; }
.card-col.left .flip-card:nth-child(4) { top: 47%;   left: 64px;  width: 296px; --amp: 72px; --dx: 8px;  animation-duration: 11.2s; animation-delay: -1.4s; }
.card-col.left .flip-card:nth-child(5) { top: 63%;   left: 4px;   width: 284px; --amp: 60px; --dx: 8px;  animation-duration: 8.9s;  animation-delay: -4.2s; }
.card-col.left .flip-card:nth-child(6) { top: 79%;   left: 38px;  width: 288px; --amp: 68px; --dx: 8px;  animation-duration: 10.8s; animation-delay: -6.3s; }

.card-col.right .flip-card:nth-child(1) { top: 8%;    right: 0;    width: 280px; --amp: 64px; --dx: -8px; animation-duration: 9.8s;  animation-delay: -2.2s; }
.card-col.right .flip-card:nth-child(2) { top: 23%;   right: 46px; width: 292px; --amp: 56px; --dx: -8px; animation-duration: 8.4s;  animation-delay: -5.6s; }
.card-col.right .flip-card:nth-child(3) { top: 39%;   right: 18px; width: 276px; --amp: 70px; --dx: -8px; animation-duration: 11s;   animation-delay: -0.9s; }
.card-col.right .flip-card:nth-child(4) { top: 54%;   right: 64px; width: 296px; --amp: 54px; --dx: -8px; animation-duration: 9.4s;  animation-delay: -3.7s; }
.card-col.right .flip-card:nth-child(5) { top: 70%;   right: 4px;  width: 284px; --amp: 66px; --dx: -8px; animation-duration: 10.6s; animation-delay: -6.8s; }
.card-col.right .flip-card:nth-child(6) { top: 86%;   right: 38px; width: 288px; --amp: 60px; --dx: -8px; animation-duration: 8.8s;  animation-delay: -1.7s; }

@keyframes floatY {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  50% { transform: translate3d(var(--dx, 8px), calc(var(--amp, 60px) * -1), 0) rotate(-1.8deg); }
}

.flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.25, 1);
}

.flip-card:hover .flip-inner,
.flip-card.flipped .flip-inner {
  transform: rotateY(180deg);
}

.face {
  position: absolute;
  inset: 0;
  border-radius: 5px 14px 7px 16px;
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  border: 1px solid rgba(108, 76, 38, 0.5);
  background:
    radial-gradient(circle at 16% 10%, rgba(112, 78, 36, 0.2), transparent 36%),
    radial-gradient(circle at 86% 76%, rgba(112, 78, 36, 0.16), transparent 32%),
    radial-gradient(circle at 62% 32%, rgba(255, 250, 235, 0.35), transparent 40%),
    repeating-linear-gradient(92deg, rgba(112, 78, 36, 0.04) 0 2px, transparent 2px 7px),
    linear-gradient(160deg, #f5eacd 0%, #e7d5ae 55%, #dcc596 100%);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.45), inset 0 0 42px rgba(112, 78, 36, 0.22);
}

.face-front {
  align-items: center;
  justify-content: center;
  text-align: center;
}

.face-front .face-icon {
  width: 70px;
  height: 70px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.face-front .face-icon svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 2px 3px rgba(70, 40, 20, 0.25));
}

.face-front h3 {
  font-size: 19px;
  letter-spacing: 1px;
  color: #3f2c16;
  font-weight: 800;
}

.face-front .flip-hint {
  margin-top: 12px;
  font-size: 12px;
  color: #826a45;
  padding: 3px 12px;
  border-radius: 4px;
  border: 1px solid rgba(108, 76, 38, 0.25);
  background: rgba(112, 78, 36, 0.08);
}

.face-back {
  transform: rotateY(180deg);
  background:
    radial-gradient(circle at 20% 14%, rgba(112, 78, 36, 0.2), transparent 38%),
    radial-gradient(circle at 82% 84%, rgba(112, 78, 36, 0.16), transparent 34%),
    repeating-linear-gradient(88deg, rgba(112, 78, 36, 0.04) 0 2px, transparent 2px 7px),
    linear-gradient(160deg, #f7eed6 0%, #e9d8b3 55%, #ddc79c 100%);
}

.face-back h4 {
  font-size: 15px;
  color: #6a4a1f;
  margin-bottom: 10px;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.face-back p {
  font-size: 12.5px;
  line-height: 1.85;
  color: #4a3520;
  overflow-y: auto;
  scrollbar-width: none;
}

.face-back p::-webkit-scrollbar {
  display: none;
}

/* 卷轴区域：随页面滚动逐步展开 */
.scroll-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
  padding-top: 4px;
  padding-bottom: 40px;
}

.scroll-tip {
  font-size: 12.5px;
  letter-spacing: 1px;
  color: rgba(226, 212, 245, 0.55);
  margin-bottom: 18px;
  text-align: center;
  transition: opacity 0.4s;
}

.scroll {
  width: calc(100% - 20px);
  position: relative;
  filter: drop-shadow(0 26px 50px rgba(0, 0, 0, 0.5));
  transition: transform 1.2s cubic-bezier(0.45, 0, 0.55, 1);
}

/* 收起时的"卷起"观感：整体轻微回缩 + 摆动 */
.scroll.is-closing {
  transform: scaleY(0.985) rotate(-0.35deg);
}

.scroll.is-closing .rod-bottom {
  box-shadow: inset 0 2px 0 rgba(255, 235, 200, 0.25), 0 0 26px rgba(240, 210, 150, 0.55);
}

.rod {
  height: 24px;
  border-radius: 9px;
  background: linear-gradient(180deg, #6f5540 0%, #4a3520 55%, #2c1f12 100%);
  box-shadow: inset 0 2px 0 rgba(255, 235, 200, 0.25), 0 3px 10px rgba(0, 0, 0, 0.5);
  position: relative;
  z-index: 3;
}

.rod::before,
.rod::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 18px;
  height: 36px;
  transform: translateY(-50%);
  border-radius: 9px;
  background: linear-gradient(180deg, #6f5540, #2c1f12);
  box-shadow: inset 0 2px 0 rgba(255, 235, 200, 0.22), 0 3px 8px rgba(0, 0, 0, 0.45);
}

.rod::before { left: -9px; }
.rod::after { right: -9px; }

/* 下轴随着展开进度向下移动 */
.rod-bottom {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(24px + var(--reveal, 0px));
}

.paper {
  position: relative;
  z-index: 1;
  overflow: hidden;
  clip-path: inset(0 0 calc(100% - var(--reveal, 0px)) 0);
  background:
    radial-gradient(circle at 16% 8%, rgba(112, 78, 36, 0.2), transparent 34%),
    radial-gradient(circle at 84% 46%, rgba(112, 78, 36, 0.15), transparent 32%),
    radial-gradient(circle at 38% 82%, rgba(112, 78, 36, 0.18), transparent 34%),
    repeating-linear-gradient(90deg, rgba(112, 78, 36, 0.04) 0 2px, transparent 2px 8px),
    linear-gradient(180deg, #f4e9cd 0%, #e8d7b4 42%, #dcc69e 100%);
  border-left: 1px solid rgba(108, 76, 38, 0.55);
  border-right: 1px solid rgba(108, 76, 38, 0.55);
  box-shadow: inset 0 0 60px rgba(108, 76, 38, 0.28);
}

.paper::before {
  content: "";
  position: absolute;
  inset: 14px 0;
  background: repeating-linear-gradient(
    180deg,
    transparent 0,
    transparent 33px,
    rgba(108, 76, 38, 0.08) 33px,
    rgba(108, 76, 38, 0.08) 34px
  );
  pointer-events: none;
}

.story {
  padding: 44px 36px 48px;
  position: relative;
  z-index: 1;
}

.story-head {
  text-align: center;
  margin-bottom: 30px;
}

.story-head h2 {
  font-size: 26px;
  letter-spacing: 6px;
  color: #6b4a22;
  margin-bottom: 8px;
}

.story-head span {
  font-size: 12px;
  letter-spacing: 2px;
  color: #8a704b;
}

.chapter {
  margin-bottom: 34px;
}

.chapter:last-child { margin-bottom: 0; }

.chapter h3 {
  font-size: 18px;
  color: #5c3a12;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.chapter .chapter-sub {
  font-size: 12px;
  color: #8a704b;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

.chapter p {
  font-size: 14px;
  line-height: 2.05;
  color: #43301c;
  text-indent: 2em;
  margin-bottom: 8px;
  text-align: justify;
}

.chapter p.line {
  text-indent: 0;
}

.chapter .divider {
  width: 60px;
  height: 2px;
  margin: 22px auto;
  background: linear-gradient(90deg, transparent, rgba(108, 76, 38, 0.6), transparent);
}

.story-quote {
  text-align: center;
  font-size: 13px;
  letter-spacing: 1px;
  color: #6b4423;
  padding: 14px 0 0;
  text-indent: 0;
}

/* ===== 页脚 ===== */
.footer {
  text-align: center;
  padding: 28px 0 36px;
  color: rgba(226, 212, 245, 0.42);
  font-size: 13px;
}

body.about-dark .footer {
  color: rgba(226, 212, 245, 0.42);
}

/* ===== 响应式 ===== */
@media (max-width: 1180px) {
  .stage {
    grid-template-columns: 1fr;
  }
  /* 手机 / 平板：先展示卷轴，再展示卡片 */
  .scroll-area {
    order: -2;
    margin-bottom: 40px;
    padding-bottom: 0;
  }
  .card-col {
    order: -1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 22px;
    padding: 0;
  }
  .card-col .flip-card {
    position: static;
    /* 覆盖 nth-child 里的错落宽度，让卡片等宽、按网格对齐 */
    width: 100% !important;
    height: 300px;
    margin: 0 !important;
    /* 小屏不做漂浮动画，卡片按网格规则排列 */
    animation: none;
  }
}

@media (max-width: 640px) {
  .nav { padding: 12px 16px; }
  .nav-links a { padding: 7px 12px; font-size: 14px; }
  .hero { padding: 56px 16px 24px; }
  .hero h1 { font-size: 32px; }
  .page { padding: 36px 16px 60px; }
  .page-title h1 { font-size: 26px; }
  body.about-dark .about-title h1 { font-size: 30px; }
  .about-hero h2 { font-size: 24px; }
  .about-hero .about-tag { font-size: 14px; }
  .story { padding: 28px 20px 32px; }
  .chapter p { font-size: 13.5px; }
  .scroll { width: calc(100% - 12px); }
}

/* ===== 页面切换过渡：海水上涌 / 下落 ===== */
/* 新页面加载的瞬间就铺满海水；内容不隐藏，靠半透明水体自然透过，避免切换时整屏亮度跳变 */

.water-transition {
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9500;
  overflow: hidden;
  transform: translate3d(0, 102%, 0);
  transition: transform 1500ms cubic-bezier(0.16, 0.74, 0.26, 1);
  will-change: transform;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}

.water-transition.cover { transform: translate3d(0, 0, 0); }
.water-transition.no-anim { transition: none; }

/* HTML 里预置的遮罩骨架：平常不显示；切换时由 html.wt-pre 直接点亮，保证首帧就是海水 */
#waterStage { display: none; }
#waterStage.live { display: block; }
html.wt-pre #waterStage {
  display: block;
  transform: translate3d(0, 0, 0);
  transition: none;
}

/* 下落：起势慢、尾段加速，像水体被重力拽下去 */
.water-transition.falling {
  transition-timing-function: cubic-bezier(0.52, 0.02, 0.74, 0.3);
}

/* 黑幕：与水面同步 —— 水涨时画面压到全黑，水落时由黑渐亮 */
.water-shade {
  position: fixed;
  inset: 0;
  z-index: 9499;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1500ms cubic-bezier(0.16, 0.74, 0.26, 1);
  will-change: opacity;
}

.water-shade.dark { opacity: 1; }

.water-shade.falling {
  transition-timing-function: cubic-bezier(0.52, 0.02, 0.74, 0.3);
}

.water-shade.no-anim { transition: none; }

/* HTML 里预置的黑幕骨架：切换时首帧就是全黑，与旧页面交接时亮度完全一致 */
#waterShade { display: none; }
#waterShade.live { display: block; }
html.wt-pre #waterShade {
  display: block;
  opacity: 1;
  transition: none;
}

.water-body {
  position: absolute;
  inset: 0;
  opacity: 0.88; /* 深色半透明：水体下的页面会隐约透出来 */
  background:
    linear-gradient(180deg, rgba(146, 198, 232, 0.32) 0, rgba(116, 174, 216, 0.14) 16px, rgba(106, 166, 210, 0) 58px),
    radial-gradient(120% 78% at 50% 0%, rgba(88, 150, 206, 0.32), transparent 60%),
    radial-gradient(70% 55% at 18% 30%, rgba(38, 96, 158, 0.3), transparent 70%),
    radial-gradient(80% 65% at 88% 55%, rgba(66, 52, 138, 0.32), transparent 72%),
    linear-gradient(180deg, #0d3350 0%, #092740 32%, #061a2c 64%, #030d17 100%);
}

/* 水面：两层不同尺度、不同速度的浪沿，横向滚动 + 轻微起伏，底部渐隐融进水体 */
.water-body::before,
.water-body::after {
  content: "";
  position: absolute;
  top: -14px;
  left: -90px;
  width: calc(100% + 180px);
  height: 70px;
  background-repeat: repeat-x;
  pointer-events: none;
  will-change: transform;
  -webkit-mask-image: linear-gradient(180deg, #000 0, rgba(0, 0, 0, 0.5) 42%, transparent 94%);
  mask-image: linear-gradient(180deg, #000 0, rgba(0, 0, 0, 0.5) 42%, transparent 94%);
}

.water-body::before {
  background-image:
    radial-gradient(closest-side, rgba(255, 255, 255, 0.62), rgba(206, 236, 255, 0.2) 62%, rgba(206, 236, 255, 0) 88%);
  background-size: 96px 30px;
  background-position: 0 2px;
  filter: blur(1.2px);
  animation: crestA 7.2s linear infinite;
  animation-delay: var(--wt-shift, 0ms);
}

.water-body::after {
  background-image:
    radial-gradient(closest-side, rgba(202, 234, 255, 0.34), rgba(150, 206, 255, 0.1) 64%, rgba(150, 206, 255, 0) 90%);
  background-size: 158px 46px;
  background-position: 0 6px;
  animation: crestB 12.5s linear infinite;
  animation-delay: var(--wt-shift, 0ms);
}

@keyframes crestA {
  0% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(-48px, 9px, 0); }
  100% { transform: translate3d(-96px, 0, 0); }
}

@keyframes crestB {
  0% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(79px, -8px, 0); }
  100% { transform: translate3d(158px, 0, 0); }
}

/* 水体内部缓慢漂移的亮斑，避免整片颜色像一块死板的色块 */
.water-current {
  position: absolute;
  inset: -12%;
  background:
    radial-gradient(38% 28% at 32% 42%, rgba(122, 198, 255, 0.22), transparent 70%),
    radial-gradient(44% 34% at 74% 64%, rgba(152, 118, 255, 0.2), transparent 72%),
    radial-gradient(30% 24% at 56% 18%, rgba(196, 232, 255, 0.16), transparent 70%);
  animation: currentDrift 9s ease-in-out infinite alternate;
  animation-delay: var(--wt-shift, 0ms);
  pointer-events: none;
  will-change: transform;
}

@keyframes currentDrift {
  0% { transform: translate3d(-1.5%, 1%, 0) scale(1); }
  55% { transform: translate3d(1.6%, -1.4%, 0) scale(1.045); }
  100% { transform: translate3d(-0.4%, 1.8%, 0) scale(1.02); }
}

.water-body .bubble {
  position: absolute;
  display: block;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.9), rgba(196, 232, 255, 0.42) 46%, rgba(150, 205, 255, 0.06) 74%);
  border: 1px solid rgba(222, 242, 255, 0.4);
  animation-name: waterBubble;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  pointer-events: none;
}

@keyframes waterBubble {
  0% { transform: translate3d(0, 0, 0) scale(0.55); opacity: 0; }
  9% { opacity: 0.85; }
  24% { transform: translate3d(9px, -32vh, 0) scale(0.92); opacity: 0.8; }
  48% { transform: translate3d(-11px, -66vh, 0) scale(1); opacity: 0.72; }
  72% { transform: translate3d(13px, -100vh, 0) scale(1.06); opacity: 0.55; }
  100% { transform: translate3d(-4px, -138vh, 0) scale(1.14); opacity: 0; }
}

/* 三只小章鱼：走和气泡同一条上浮路径，但身体持续左右摆头 —— 朝向一直在变，不是单纯平移 */
.water-body .octopus {
  position: absolute;
  display: block;
  width: 100px;
  height: 100px;
  margin-left: -50px;
  pointer-events: none;
  animation-name: octoRise;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  will-change: transform, opacity;
}

.water-body .octopus img {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-direction: alternate;
  animation-delay: var(--wt-shift, 0ms);
}

/* 起始高度、大小、速度全部错开：三只不在同一条水平线上，也不并排 */
.water-body .octo-1 {
  left: 16%;
  bottom: 16vh;
  width: 88px;
  height: 88px;
  margin-left: -44px;
  animation-duration: 7.4s;
  animation-delay: calc(var(--wt-shift, 0ms) + 0.35s);
}
/* 整体左倾：-28° 摆到 -4° */
.water-body .octo-1 img {
  animation-name: octoRockA;
  animation-duration: 2.7s;
}

.water-body .octo-2 {
  left: 50%;
  bottom: 33vh;
  width: 108px;
  height: 108px;
  margin-left: -54px;
  animation-duration: 8.8s;
  animation-delay: calc(var(--wt-shift, 0ms) + 0.9s);
}
/* 整体右倾：6° 摆到 32°，幅度最大 */
.water-body .octo-2 img {
  animation-name: octoRockB;
  animation-duration: 3.5s;
}

.water-body .octo-3 {
  left: 80%;
  bottom: 27vh;
  width: 96px;
  height: 96px;
  margin-left: -48px;
  animation-duration: 6.5s;
  animation-delay: calc(var(--wt-shift, 0ms) + 0.55s);
}
/* 镜像翻面 + 反向倾斜：16° 摆到 -18°，朝向与其他两只相反 */
.water-body .octo-3 img {
  animation-name: octoRockC;
  animation-duration: 3.1s;
}

@keyframes octoRise {
  0% { transform: translate3d(0, 0, 0); opacity: 0; }
  8% { opacity: 1; }
  28% { transform: translate3d(-18px, -34vh, 0); }
  55% { transform: translate3d(20px, -70vh, 0); }
  78% { opacity: 1; }
  100% { transform: translate3d(-10px, -134vh, 0); opacity: 0; }
}

@keyframes octoRockA {
  0% { transform: rotate(-28deg); }
  100% { transform: rotate(-4deg); }
}

@keyframes octoRockB {
  0% { transform: rotate(6deg); }
  100% { transform: rotate(32deg); }
}

@keyframes octoRockC {
  0% { transform: rotate(16deg) scaleX(-1); }
  100% { transform: rotate(-18deg) scaleX(-1); }
}

/* ===== 页面 4：自动放映的卡片与信纸 ===== */
/* 放映期间藏起滚动条，用户不能拖动也不会有滚动条位置提示；放映结束自动恢复 */
html.show-lock { scrollbar-width: none; }
html.show-lock::-webkit-scrollbar { width: 0; height: 0; }

.show-stage { padding: 0 24px; }

/* 页面 4 开头的倒计时大字：不再整体渐隐，文字由 JS 逐字打出，随白场淡出同步显现 */
.intro {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 24px;
  gap: 18px;
  opacity: 1;
}

@keyframes introFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.intro-line {
  font-size: clamp(26px, 4.2vw, 52px);
  font-weight: 700;
  color: #f3e8ff;
  letter-spacing: 2px;
  line-height: 1.5;
  text-shadow: 0 2px 24px rgba(168, 85, 247, 0.5);
  /* 初始隐藏，由 JS 在逐字打字前再显示，避免整句先闪现一下 */
  visibility: hidden;
}

.intro-counter {
  margin: 12px 0;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.intro-counter #elapsed {
  font-size: clamp(30px, 5vw, 64px);
  font-weight: 800;
  color: #c084fc;
  font-variant-numeric: tabular-nums;
  letter-spacing: 3px;
  text-shadow: 0 0 28px rgba(192, 132, 252, 0.65);
}

.intro-story {
  font-size: clamp(22px, 3.4vw, 42px);
  color: #d8b4fe;
}

/* 每一轮占满一屏，两张卡片在屏幕正中，上下错开摆放 */
.show-round {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
}

.show-round .pair {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 104px;
}

/* 每一轮整体略微偏向一侧，四轮不再排成同一条竖线 */
.show-round:nth-child(odd) .pair { transform: translateX(-26px); }
.show-round:nth-child(even) .pair { transform: translateX(26px); }

.p4-slot {
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.5));
  animation: p4Float var(--p4-dur, 10s) ease-in-out var(--p4-delay, 0s) infinite;
  will-change: transform;
}

/* 左右两张卡片错开得更多，并各自带一点倾斜，不再是水平对齐的一排 */
.show-round .p4-slot:nth-child(1) {
  margin-top: 0;
  --p4-rot: -2.2deg;
  --p4-tilt: 1.6deg;
  --p4-dx: -6px;
  --p4-dy: 18px;
  --p4-dur: 10.5s;
  --p4-delay: -1.2s;
}

.show-round .p4-slot:nth-child(2) {
  margin-top: 138px;
  --p4-rot: 2deg;
  --p4-tilt: -1.8deg;
  --p4-dx: 8px;
  --p4-dy: 24px;
  --p4-dur: 13s;
  --p4-delay: -5s;
}

/* 偶数轮换成另一组倾斜与速度，避免四轮飘动的节奏雷同 */
.show-round:nth-child(even) .p4-slot:nth-child(1) {
  --p4-rot: 1.8deg;
  --p4-tilt: -1.4deg;
  --p4-dx: 5px;
  --p4-dy: 21px;
  --p4-dur: 12s;
  --p4-delay: -3.4s;
}

.show-round:nth-child(even) .p4-slot:nth-child(2) {
  --p4-rot: -2.4deg;
  --p4-tilt: 2deg;
  --p4-dx: -8px;
  --p4-dy: 16px;
  --p4-dur: 9.5s;
  --p4-delay: -0.6s;
}

/* 卡片在限定范围内缓慢上下浮动 + 轻微摆动，像被风托着 */
@keyframes p4Float {
  0%, 100% {
    transform: translate3d(0, 0, 0) rotate(var(--p4-rot, 0deg));
  }
  50% {
    transform: translate3d(var(--p4-dx, 6px), calc(var(--p4-dy, 18px) * -1), 0)
      rotate(calc(var(--p4-rot, 0deg) + var(--p4-tilt, 1.4deg)));
  }
}

/* 展开动画：从所属那一侧向外铺开（左卡自左向右、右卡自右向左） */
.p4-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 30px;
  overflow: hidden;
  opacity: 0;
  clip-path: inset(0 100% 0 0);
  transition: clip-path 1s cubic-bezier(0.22, 0.9, 0.24, 1), opacity 0.3s ease;
  will-change: clip-path;
}

.p4-slot.dir-right .p4-card { clip-path: inset(0 0 0 100%); }

.p4-card.open,
.p4-slot.dir-right .p4-card.open {
  opacity: 1;
  clip-path: inset(0 0 0 0);
}

.p4-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.55s ease 0.32s, transform 0.55s ease 0.32s;
}

.p4-card.open .p4-card-body {
  opacity: 1;
  transform: none;
}

/* 空白卡片：与站点一致的深紫玻璃质感；高度随图片比例自适应，保证整张图完整露出 */
.p4-card.p4-blank {
  width: 400px;
  height: auto;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(192, 132, 252, 0.32);
  background:
    radial-gradient(circle at 22% 12%, rgba(168, 85, 247, 0.3), transparent 46%),
    linear-gradient(160deg, rgba(74, 42, 112, 0.94) 0%, rgba(46, 25, 74, 0.95) 58%, rgba(34, 18, 56, 0.96) 100%);
  box-shadow: inset 0 0 46px rgba(126, 58, 196, 0.22);
  color: #efe6fb;
}

/* 图片卡片里的照片：按原始比例撑开卡片，不裁切也不留衬底 */
.p4-photo {
  flex: 0 0 auto;
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
}

/* 信纸：纸质、配色与主播介绍页的卡片一致（米白旧纸 + 深棕字） */
.p4-card.p4-letter {
  width: 430px;
  height: 520px;
  border-radius: 5px 14px 7px 16px;
  border: 1px solid rgba(108, 76, 38, 0.5);
  color: #3f2c16;
  background:
    repeating-linear-gradient(180deg, transparent 0 43px, rgba(108, 76, 38, 0.12) 43px 44px),
    radial-gradient(circle at 16% 10%, rgba(112, 78, 36, 0.2), transparent 36%),
    radial-gradient(circle at 86% 76%, rgba(112, 78, 36, 0.16), transparent 32%),
    radial-gradient(circle at 62% 32%, rgba(255, 250, 235, 0.35), transparent 40%),
    repeating-linear-gradient(92deg, rgba(112, 78, 36, 0.04) 0 2px, transparent 2px 7px),
    linear-gradient(160deg, #f5eacd 0%, #e7d5ae 55%, #dcc596 100%);
  box-shadow: inset 0 0 42px rgba(112, 78, 36, 0.22);
}

/* 信纸左侧的红色装订线 */
.p4-card.p4-letter::before {
  content: "";
  position: absolute;
  left: 30px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(143, 29, 36, 0.26);
  pointer-events: none;
}

/* 信纸正文：字号与行高对齐信纸上的横格线；整段文字约占卡片的 2/3 以上 */
.p4-letter-text {
  flex: 1;
  font-family: "Kaiti SC", KaiTi, "STKaiti", "Songti SC", SimSun, serif;
  font-size: 28px;
  line-height: 44px;
  letter-spacing: 0.4px;
  color: #4a3418;
  text-align: justify;
  word-break: break-word;
  /* 打字开始前保持隐形，避免整段文字先闪一下 */
  opacity: 0;
  transition: opacity 0.35s ease;
}

/* 开始逐字显示（或已显示完）才让文字可见 */
.p4-letter-text.typing,
.p4-letter-text.shown {
  opacity: 1;
}

/* 逐字显示时末尾的闪烁光标 */
.p4-letter-text.typing::after {
  content: "▌";
  margin-left: 1px;
  color: rgba(143, 29, 36, 0.6);
  animation: p4Caret 1s steps(1) infinite;
}

@keyframes p4Caret {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* ===== 页面 4：卡片放映完之后的卷轴 ===== */
.scroll-round {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
}

.scroll {
  --scroll-h: 480px;      /* 纸面高度，展开时下轴滑动的距离 */
  position: relative;
  width: min(600px, 90vw);
  margin: 0 auto;
  padding: 22px 0;
}

/* 纸面：底色与材质完全沿用上面的信纸 */
.scroll-paper {
  position: relative;
  width: 100%;
  height: var(--scroll-h);
  padding: 46px 52px;
  box-sizing: border-box;
  border-radius: 4px;
  overflow: hidden;
  color: #3f2c16;
  background:
    repeating-linear-gradient(180deg, transparent 0 43px, rgba(108, 76, 38, 0.12) 43px 44px),
    radial-gradient(circle at 16% 10%, rgba(112, 78, 36, 0.2), transparent 36%),
    radial-gradient(circle at 86% 76%, rgba(112, 78, 36, 0.16), transparent 32%),
    radial-gradient(circle at 62% 32%, rgba(255, 250, 235, 0.35), transparent 40%),
    repeating-linear-gradient(92deg, rgba(112, 78, 36, 0.04) 0 2px, transparent 2px 7px),
    linear-gradient(160deg, #f5eacd 0%, #e7d5ae 55%, #dcc596 100%);
  box-shadow: inset 0 0 42px rgba(112, 78, 36, 0.22), 0 18px 40px rgba(0, 0, 0, 0.45);
  /* 收起状态：只露出最上面一条，由 .open 自下而上“卷”下来 */
  clip-path: inset(0 0 100% 0);
  transition: clip-path 1.5s cubic-bezier(0.22, 0.9, 0.24, 1);
}

.scroll.open .scroll-paper { clip-path: inset(0 0 0 0); }

/* 上下两根卷轴轴心，配色沿用站点紫色 */
.scroll-rod {
  position: absolute;
  left: -18px;
  right: -18px;
  height: 18px;
  border-radius: 999px;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(90deg, #2c1745 0%, #7c4dbc 28%, #a86ff0 50%, #7c4dbc 72%, #2c1745 100%);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.scroll-rod::before,
.scroll-rod::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 26px;
  height: 26px;
  margin-top: -13px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #c89bf5, #6b3fa0 62%, #2c1745);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}

.scroll-rod::before { left: -10px; }
.scroll-rod::after { right: -10px; }

.scroll-rod.top { top: 13px; }

/* 下轴随纸面一起向下滑，正好停在展开后的底边 */
.scroll-rod.bottom {
  top: 13px;
  transition: transform 1.5s cubic-bezier(0.22, 0.9, 0.24, 1);
}

.scroll.open .scroll-rod.bottom { transform: translateY(var(--scroll-h)); }

/* 卷轴文字：与信纸正文同一套字体与配色 */
.scroll-text {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Kaiti SC", KaiTi, "STKaiti", "Songti SC", SimSun, serif;
  font-size: 30px;
  line-height: 46px;
  letter-spacing: 2px;
  color: #4a3418;
  text-align: center;
  /* 打字开始前保持隐形，避免整段文字先闪一下 */
  opacity: 0;
  transition: opacity 0.35s ease;
}

.scroll-text.typing,
.scroll-text.shown { opacity: 1; }

.scroll-text.typing::after {
  content: "▌";
  margin-left: 2px;
  color: rgba(143, 29, 36, 0.6);
  animation: p4Caret 1s steps(1) infinite;
}

/* 窄屏：两张卡片改为上下排列，不再左右错开 */
@media (max-width: 980px) {
  .show-stage { padding: 0 16px; }
  .show-round { padding: 24px 0; }
  .show-round .pair {
    flex-direction: column;
    gap: 24px;
    transform: none;
  }
  /* 上面一条优先级低于 nth-child 的错位规则，这里必须显式覆盖，
     否则卡片整体会右移 26px 顶出屏幕造成横向滚动 */
  .show-round:nth-child(odd) .pair,
  .show-round:nth-child(even) .pair { transform: none; }
  .p4-slot {
    width: 100%;
    display: flex;
    justify-content: center;
  }
  .show-round .p4-slot:nth-child(1),
  .show-round .p4-slot:nth-child(2) { margin-top: 0; }
  .p4-card.p4-letter { width: min(430px, 100%); height: 470px; }
  .p4-card.p4-blank { width: min(400px, 100%); height: auto; }
  .scroll { --scroll-h: 420px; width: min(560px, calc(100vw - 48px)); }
  .scroll-paper { padding: 36px 30px; }
}

@media (max-width: 640px) {
  .p4-card { padding: 22px; }
  .p4-card.p4-blank { height: auto; }
  .scroll { --scroll-h: 380px; width: calc(100vw - 44px); }
  .scroll-paper { padding: 30px 22px; }
  .scroll-text { font-size: 24px; line-height: 40px; letter-spacing: 1px; }
}

/* ===== 手机 / 平板适配（追加在后，覆盖前面同类规则） ===== */

/* 手机 / 平板精简为「主页 + 点歌 + 主播介绍」：隐藏表情包入口 */
@media (max-width: 1024px), (hover: none) and (pointer: coarse) {
  .hide-mobile { display: none !important; }
}

/* 触屏设备：悬停不触发翻面，只保留点击翻面，避免点一下状态乱跳 */
@media (hover: none) and (pointer: coarse) {
  .flip-card:hover .flip-inner { transform: none; }
  .flip-card.flipped .flip-inner { transform: rotateY(180deg); }
}

/* 手机：导航压缩，避免 logo + 链接把一行撑破 */
@media (max-width: 640px) {
  .nav { gap: 8px; padding: 10px 12px; }
  .nav .logo { font-size: 18px; letter-spacing: 0; }
  .nav-links { gap: 2px; }
  .nav-links a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;   /* 触控目标不低于 40px */
    padding: 8px 9px;
    font-size: 13px;
  }
  .btn-take { min-height: 44px; padding: 12px 18px; }
}

/* 超窄屏（iPhone SE 等）：再压一档，保证一行放得下 */
@media (max-width: 380px) {
  .nav { padding: 8px 10px; }
  .nav .logo { font-size: 16px; }
  .nav-links a { padding: 8px 6px; font-size: 12px; }
}

/* 平板：保持单栏，只收一下左右留白 */
@media (max-width: 1180px) and (min-width: 641px) {
  .page { padding-left: 28px; padding-right: 28px; }
  .cards { padding: 0 32px; gap: 24px; }
}

/* 首页底部的 PC 提示：只在手机 / 平板显示 */
.pc-tip {
  display: none;
  margin: 4px 24px 30px;
  text-align: center;
  font-size: 13px;
  letter-spacing: 0.5px;
  color: rgba(226, 212, 245, 0.55);
}

@media (max-width: 768px) {
  .pc-tip { display: block; }
}

/* 全屏区块用动态视口高度，移动端地址栏伸缩时不再跳动 */
@supports (min-height: 100dvh) {
  .intro,
  .show-round,
  .scroll-round { min-height: 100dvh; }
}

@supports (height: 100dvh) {
  .water-transition { height: 100dvh; }
}

/* 刘海屏 / 底部 Home 条的安全区留白（只在小屏生效，避免改动桌面布局） */
@supports (padding: env(safe-area-inset-top)) {
  @media (max-width: 768px) {
    .nav { padding-top: max(10px, env(safe-area-inset-top)); }
    .footer { padding-bottom: calc(36px + env(safe-area-inset-bottom)); }
  }
}
