/* ========== 设计变量 ========== */
:root {
  --red: #8C2B2B;
  --red-deep: #6B1F1F;
  --red-light: #B84545;
  --gold: #C9A961;
  --gold-light: #E5D4A8;
  --gold-deep: #A88B42;
  --paper: #FAF6EF;
  --paper-warm: #F5EDE0;
  --paper-dark: #EDE3D2;
  --ink: #3A281E;
  --ink-light: #6B5544;
  --ink-faint: #9A8570;
}

/* ========== 基础重置 ========== */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { width: 100%; height: 100%; overflow: hidden; }
body {
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
}

/* ========== 页面容器 ========== */
#app {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  position: relative;
  overflow: hidden;
}

.page {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.9s cubic-bezier(0.77, 0, 0.175, 1);
  will-change: transform;
}
.page.prev   { transform: translateY(-100%); }
.page.active { transform: translateY(0); z-index: 10; }
.page.next   { transform: translateY(100%); }

/* ========== 通用装饰 ========== */
.corner-deco {
  position: absolute;
  width: 60px; height: 60px;
  pointer-events: none;
  opacity: 0.5;
}
.corner-deco svg { width: 100%; height: 100%; }
.corner-tl { top: 16px; left: 16px; }
.corner-tr { top: 16px; right: 16px; transform: scaleX(-1); }
.corner-bl { bottom: 16px; left: 16px; transform: scaleY(-1); }
.corner-br { bottom: 16px; right: 16px; transform: scale(-1,-1); }

/* 上滑提示 */
.slide-hint {
  position: absolute;
  bottom: calc(28px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--ink-faint);
  font-size: 12px;
  letter-spacing: 3px;
  z-index: 20;
  animation: hintBounce 2s ease-in-out infinite;
}
.slide-hint .arrow {
  width: 20px; height: 20px;
  border-right: 1.5px solid var(--gold-deep);
  border-bottom: 1.5px solid var(--gold-deep);
  transform: rotate(45deg);
}
@keyframes hintBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.6; }
  50% { transform: translateX(-50%) translateY(8px); opacity: 1; }
}

/* ========== P1 信封页 ========== */
#page1 {
  background: linear-gradient(160deg, #F7F0E4 0%, #EFE3CE 50%, #E8D9BE 100%);
  overflow: hidden;
}
#page1::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 15%, rgba(201,169,97,0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 85%, rgba(140,43,43,0.08) 0%, transparent 50%);
  pointer-events: none;
}

.envelope-scene {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  perspective: 1200px;
}

.envelope-title {
  position: absolute;
  left: 0;
  width: 100%;
  top: calc(80px + env(safe-area-inset-top));
  text-align: center;
  z-index: 5;
}
.envelope-title .names {
  font-family: 'Noto Serif SC', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--red-deep);
  letter-spacing: 6px;
  margin-bottom: 8px;
}
.envelope-title .names .amp {
  color: var(--gold-deep);
  font-weight: 400;
  margin: 0 4px;
}
.envelope-title .sub {
  font-size: 11px;
  color: var(--ink-light);
  letter-spacing: 5px;
  font-weight: 300;
}

/* 信封主体 */
.envelope {
  position: relative;
  width: 300px;
  height: 200px;
  cursor: pointer;
  z-index: 10;
  transition: transform 0.6s ease;
}
.envelope:active { transform: scale(0.97); }

.envelope-body {
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, #FDFAF4 0%, #F5EDDE 100%);
  border: 1px solid rgba(201,169,97,0.4);
  border-radius: 4px;
  box-shadow:
    0 20px 50px rgba(107,31,31,0.18),
    0 4px 12px rgba(0,0,0,0.06),
    inset 0 1px 0 rgba(255,255,255,0.8);
  overflow: hidden;
}
/* 信封内部装饰边框 */
.envelope-body::before {
  content: '';
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(201,169,97,0.3);
  border-radius: 2px;
  pointer-events: none;
}

/* 收件人文字 */
.envelope-address {
  position: absolute;
  top: 70%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 6;
  width: 100%;
}
.envelope-address .label {
  display: none;
}
.envelope-address .recipient {
  font-family: 'Noto Serif SC', serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--red-deep);
  letter-spacing: 4px;
  line-height: 1.3;
}

/* 火漆印 */
.wax-seal {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #C44545 0%, #8C2B2B 50%, #6B1F1F 100%);
  box-shadow:
    0 3px 8px rgba(107,31,31,0.4),
    inset 0 2px 4px rgba(255,255,255,0.2),
    inset 0 -2px 4px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 7;
}
.wax-seal::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px dashed rgba(201,169,97,0.4);
}
.wax-seal span {
  font-family: 'Noto Serif SC', serif;
  font-size: 24px;
  font-weight: 900;
  color: var(--gold-light);
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* 信封盖 */
.envelope-flap {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  z-index: 6;
  transform-origin: top center;
  transition: transform 0.8s cubic-bezier(0.645, 0.045, 0.355, 1);
  transform-style: preserve-3d;
  pointer-events: none;
}
.envelope-flap::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 0; height: 0;
  border-left: 150px solid transparent;
  border-right: 150px solid transparent;
  border-top: 110px solid #F0E6D4;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.1));
}
.envelope-flap::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 0; height: 0;
  border-left: 148px solid transparent;
  border-right: 148px solid transparent;
  border-top: 108px solid transparent;
  border-top-color: #F8F2E8;
  transform: translateY(1px);
}

/* 信封打开状态 */
.envelope.opened .envelope-flap {
  transform: rotateX(180deg);
  z-index: 1;
}
.envelope.opened {
  transform: translateY(-10px) scale(1.02);
}

/* 信纸 */
.letter-paper {
  position: absolute;
  top: 8px;
  left: 12px;
  right: 12px;
  bottom: 8px;
  background: linear-gradient(180deg, #FFFEFA 0%, #FAF5EB 100%);
  border-radius: 2px;
  z-index: 3;
  opacity: 0;
  transform: translateY(0);
  transition: opacity 0.4s ease, transform 0.8s cubic-bezier(0.645, 0.045, 0.355, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.envelope.opened .letter-paper {
  opacity: 1;
  transform: translateY(-120px);
  transition-delay: 0.4s, 0.5s;
}
.envelope.opened.paper-settled .letter-paper {
  top: -10px;
  left: -8px;
  right: -8px;
  bottom: -10px;
  z-index: 8;
  opacity: 1;
  transform: translateY(0);
  border: 1px solid rgba(201,169,97,0.6);
  box-shadow:
    0 16px 30px rgba(107,31,31,0.2),
    0 2px 8px rgba(0,0,0,0.08);
  transition:
    top 0.65s cubic-bezier(0.645, 0.045, 0.355, 1),
    left 0.65s cubic-bezier(0.645, 0.045, 0.355, 1),
    right 0.65s cubic-bezier(0.645, 0.045, 0.355, 1),
    bottom 0.65s cubic-bezier(0.645, 0.045, 0.355, 1),
    transform 0.65s cubic-bezier(0.645, 0.045, 0.355, 1);
  transition-delay: 0s;
}
.envelope.opened.paper-settled .letter-paper::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(201,169,97,0.28);
  border-radius: 1px;
  pointer-events: none;
}
.envelope.opened.paper-settled .envelope-flap,
.envelope.opened.paper-settled .wax-seal {
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.35s ease,
    visibility 0s linear 0.35s;
}
.letter-paper .letter-content {
  text-align: center;
  padding: 16px;
}
.letter-paper .letter-xi {
  font-family: 'Noto Serif SC', serif;
  font-size: 36px;
  font-weight: 900;
  color: var(--red);
  margin-bottom: 8px;
}
.letter-paper .letter-text {
  font-family: 'Noto Serif SC', serif;
  font-size: 13px;
  color: var(--ink-light);
  letter-spacing: 3px;
  line-height: 2;
}

/* 开启提示 */
.open-hint {
  position: absolute;
  bottom: calc(60px + env(safe-area-inset-bottom));
  left: 0;
  width: 100%;
  text-align: center;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.open-hint .hint-text {
  font-size: 13px;
  color: var(--ink-light);
  letter-spacing: 5px;
  margin-bottom: 10px;
  animation: hintPulse 2s ease-in-out infinite;
}
.open-hint .hint-icon {
  width: 36px;
  height: 36px;
  margin: 0;
  border: 1.5px solid var(--gold-deep);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: hintPulse 2s ease-in-out infinite;
}
.open-hint .hint-icon::after {
  content: '';
  width: 8px; height: 8px;
  border-right: 1.5px solid var(--gold-deep);
  border-top: 1.5px solid var(--gold-deep);
  transform: rotate(-45deg) translate(1px, 1px);
}
@keyframes hintPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* P1 退出动画 */
#page1.leaving {
  opacity: 0;
  transform: translateY(-100%) scale(0.95);
  transition: all 0.9s cubic-bezier(0.645, 0.045, 0.355, 1);
}

/* ========== P2 卷轴日期页 ========== */
#page2 {
  background: linear-gradient(170deg, #F8F2E6 0%, #F0E5D0 100%);
}
#page2::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(201,169,97,0.1) 0%, transparent 60%);
  pointer-events: none;
}

.scroll-scene {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
}

/* 纸张展开容器：上下收边，延续 P1 的信纸方向 */
.scroll-unit {
  position: relative;
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  filter: drop-shadow(0 10px 22px rgba(107,31,31,0.12));
}

/* 上下纸卷收边 */
.paper-roll {
  width: calc(100% + 10px);
  height: 20px;
  margin-left: -5px;
  flex-shrink: 0;
  position: relative;
  z-index: 5;
  border-radius: 10px;
  background: linear-gradient(180deg, #E5D4A8 0%, #C9A961 42%, #8B6914 100%);
  box-shadow:
    0 2px 6px rgba(0,0,0,0.16),
    inset 0 2px 2px rgba(255,255,255,0.35),
    inset 0 -2px 3px rgba(107,31,31,0.2);
}
.paper-roll::before {
  content: '';
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  right: 4px;
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(255,255,255,0.45), rgba(255,255,255,0.02));
  pointer-events: none;
}
.paper-roll::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, #6B1F1F, #8C2B2B, #6B1F1F);
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.paper-roll-top {
  margin-bottom: -1px;
}
.paper-roll-top::after {
  bottom: -2px;
}
.paper-roll-bottom {
  margin-top: -1px;
}
.paper-roll-bottom::after {
  top: -2px;
}

/* 展开的纸张 */
.scroll-paper {
  width: 100%;
  min-width: 0;
  background: linear-gradient(180deg, #FDFAF2 0%, #F8F1E2 50%, #FDFAF2 100%);
  position: relative;
  border: 1px solid rgba(201,169,97,0.3);
  border-radius: 3px;
  box-shadow:
    inset 0 0 30px rgba(201,169,97,0.08),
    inset 0 1px 0 rgba(255,255,255,0.8);
  padding: 28px 20px;
  max-height: 70vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.scroll-paper::before {
  content: '';
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(201,169,97,0.25);
  pointer-events: none;
}

/* 纸张从上到下展开 */
.scroll-unit {
  opacity: 0;
  transform: scaleY(0.05);
  transform-origin: center top;
}
.scroll-unit.animate-in {
  animation: paperReveal 1.2s cubic-bezier(0.645, 0.045, 0.355, 1) forwards;
}
@keyframes paperReveal {
  0% { opacity: 0; transform: scaleY(0.05); }
  30% { opacity: 1; }
  100% { opacity: 1; transform: scaleY(1); }
}
.scroll-unit.animate-in .scroll-paper > * {
  opacity: 0;
  animation: contentFadeIn 0.6s ease forwards;
}
.scroll-unit.animate-in .scroll-paper > *:nth-child(1) { animation-delay: 0.8s; }
.scroll-unit.animate-in .scroll-paper > *:nth-child(2) { animation-delay: 0.95s; }
.scroll-unit.animate-in .scroll-paper > *:nth-child(3) { animation-delay: 1.1s; }
.scroll-unit.animate-in .scroll-paper > *:nth-child(4) { animation-delay: 1.25s; }
.scroll-unit.animate-in .scroll-paper > *:nth-child(5) { animation-delay: 1.4s; }
@keyframes contentFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 卷轴内容 */
.scroll-header {
  text-align: center;
  margin-bottom: 16px;
}
.scroll-header .xi-char {
  font-family: 'Noto Serif SC', serif;
  font-size: 32px;
  font-weight: 900;
  color: var(--red);
  line-height: 1;
  margin-bottom: 6px;
}
.scroll-header .title-text {
  font-family: 'Noto Serif SC', serif;
  font-size: 14px;
  color: var(--ink-light);
  letter-spacing: 6px;
  font-weight: 400;
}

.scroll-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 14px 0;
}
.scroll-divider .line {
  width: 40px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.scroll-divider .diamond {
  width: 6px; height: 6px;
  background: var(--gold);
  transform: rotate(45deg);
}

/* 日期 */
.scroll-date-block {
  text-align: center;
  margin-bottom: 18px;
}
.scroll-date-block .date-main {
  font-family: 'Noto Serif SC', serif;
  font-size: 30px;
  font-weight: 700;
  color: var(--red-deep);
  letter-spacing: 2px;
  line-height: 1.3;
}
.scroll-date-block .date-main .year {
  font-size: 18px;
  font-weight: 400;
  color: var(--ink-light);
  letter-spacing: 1px;
}
.scroll-date-block .date-sub {
  font-size: 13px;
  color: var(--ink-light);
  letter-spacing: 3px;
  margin-top: 8px;
  font-weight: 300;
}
.scroll-date-block .date-sub strong {
  color: var(--red);
  font-weight: 500;
}

/* Q版视频 */
.qvideo-wrap {
  width: 140px;
  height: 140px;
  margin: 0 auto 16px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--gold-light);
  box-shadow: 0 4px 16px rgba(201,169,97,0.25);
  position: relative;
}
.qvideo-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.qvideo-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 20px rgba(255,255,255,0.3);
  pointer-events: none;
}

.scroll-invite-text {
  text-align: center;
  font-family: 'Noto Serif SC', serif;
  font-size: 15px;
  color: var(--ink);
  letter-spacing: 4px;
  line-height: 2;
  font-weight: 500;
}
.scroll-invite-text .highlight {
  color: var(--red);
  font-weight: 700;
}

/* ========== P3 地点页 ========== */
#page3 {
  background: linear-gradient(170deg, #F5EDE0 0%, #EDE0CA 100%);
}
#page3::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 100%, rgba(140,43,43,0.06) 0%, transparent 50%);
  pointer-events: none;
}

.location-scroll .scroll-paper {
  padding: 32px 22px;
}

.location-header {
  text-align: center;
  margin-bottom: 20px;
}
.location-header .label {
  font-size: 11px;
  color: var(--gold-deep);
  letter-spacing: 5px;
  margin-bottom: 8px;
  font-weight: 500;
}
.location-header .venue-name {
  font-family: 'Noto Serif SC', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--red-deep);
  letter-spacing: 2px;
  line-height: 1.4;
}

.location-info-block {
  margin-bottom: 20px;
}
.info-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px dashed rgba(201,169,97,0.3);
}
.info-row:last-child { border-bottom: none; }
.info-row .info-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--red-light), var(--red));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}
.info-row .info-icon svg {
  width: 16px; height: 16px;
  fill: var(--gold-light);
}
.info-row .info-content {
  flex: 1;
  min-width: 0;
}
.info-row .info-label {
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 2px;
  margin-bottom: 4px;
}
.info-row .info-value {
  font-size: 14px;
  color: var(--ink);
  line-height: 1.6;
  font-weight: 400;
}
.info-row .info-value strong {
  color: var(--red-deep);
  font-weight: 600;
}

/* 新人署名 */
.signature-block {
  text-align: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(201,169,97,0.2);
}
.signature-block .sig-label {
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 4px;
  margin-bottom: 8px;
}
.signature-block .sig-names {
  font-family: 'Noto Serif SC', serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--red-deep);
  letter-spacing: 3px;
}
.signature-block .sig-names .amp {
  color: var(--gold-deep);
  font-weight: 400;
  font-size: 14px;
  margin: 0 6px;
}

/* ========== P4 婚礼照片页 ========== */
#page4 {
  background: #720b13;
  overflow: hidden;
}

.final-image-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 28%;
  z-index: 1;
}

/* 图片遮罩：压住底部亮色礼服，让邀请文字保持清晰 */
.final-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(180deg, rgba(46,4,7,0.42) 0%, rgba(46,4,7,0.06) 36%, rgba(27,8,7,0.2) 62%, rgba(22,7,6,0.86) 100%);
  pointer-events: none;
}

/* 顶部装饰 */
.final-top {
  position: absolute;
  top: calc(60px + env(safe-area-inset-top));
  left: 0; right: 0;
  text-align: center;
  z-index: 5;
  opacity: 0;
  animation: finalFadeDown 1.2s ease 0.5s forwards;
}
.final-top .we-just {
  font-family: 'Noto Serif SC', serif;
  font-size: 14px;
  color: var(--gold-light);
  letter-spacing: 8px;
  font-weight: 300;
  margin-bottom: 12px;
}
.final-top .final-names {
  font-family: 'Noto Serif SC', serif;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 4px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.4);
}
.final-top .final-names .amp {
  color: var(--gold-light);
  font-weight: 400;
  font-size: 20px;
  margin: 0 8px;
}

/* 底部诚邀文字 */
.final-bottom {
  position: absolute;
  bottom: calc(80px + env(safe-area-inset-bottom));
  left: 0; right: 0;
  text-align: center;
  z-index: 5;
  padding: 0 24px;
  opacity: 0;
  animation: finalFadeUp 1.2s ease 1s forwards;
}
.final-bottom .invite-main {
  font-family: 'Noto Serif SC', serif;
  font-size: 20px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 4px;
  line-height: 1.8;
  margin-bottom: 16px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}
.final-bottom .invite-main .gold-text {
  color: var(--gold-light);
}
.final-bottom .invite-date {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  letter-spacing: 4px;
  font-weight: 300;
}
.final-bottom .invite-date strong {
  color: var(--gold-light);
  font-weight: 500;
}

/* 底部装饰线 */
.final-deco-line {
  position: absolute;
  bottom: calc(40px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 5;
  opacity: 0;
  animation: finalFadeUp 1.2s ease 1.5s forwards;
}
.final-deco-line .line-seg {
  width: 30px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.final-deco-line .heart-icon {
  width: 14px; height: 14px;
}
.final-deco-line .heart-icon svg {
  width: 100%; height: 100%;
  fill: var(--gold-light);
}

@keyframes finalFadeDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes finalFadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 音乐按钮 */
.music-btn {
  position: absolute;
  top: calc(16px + env(safe-area-inset-top));
  right: 16px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  cursor: pointer;
}
.music-btn svg {
  width: 18px; height: 18px;
  fill: rgba(255,255,255,0.8);
}
.music-btn.playing svg {
  animation: musicSpin 4s linear infinite;
}
@keyframes musicSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ========== 加载页 ========== */
#loading {
  position: fixed;
  inset: 0;
  background: var(--paper);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease;
}
#loading.hidden {
  opacity: 0;
  pointer-events: none;
}
.loading-xi {
  font-family: 'Noto Serif SC', serif;
  font-size: 48px;
  font-weight: 900;
  color: var(--red);
  margin-bottom: 20px;
  animation: loadingPulse 1.5s ease-in-out infinite;
}
.loading-bar {
  width: 120px;
  height: 2px;
  background: rgba(201,169,97,0.2);
  border-radius: 1px;
  overflow: hidden;
}
.loading-bar .fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold));
  border-radius: 1px;
  transition: width 0.3s ease;
}
.loading-text {
  margin-top: 12px;
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 4px;
}
@keyframes loadingPulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

/* ========== 响应式 ========== */
@media (max-height: 640px) {
  .envelope { width: 260px; height: 174px; }
  .envelope-flap::before {
    border-left-width: 130px;
    border-right-width: 130px;
    border-top-width: 95px;
  }
  .envelope-flap::after {
    border-left-width: 128px;
    border-right-width: 128px;
    border-top-width: 93px;
  }
  .scroll-paper { padding: 20px 16px; max-height: 65vh; }
  .qvideo-wrap { width: 110px; height: 110px; }
  .scroll-date-block .date-main { font-size: 24px; }
}

/* ========== 手机端适配 ========== */
@media (max-width: 600px) {
  .corner-deco {
    width: 48px;
    height: 48px;
    opacity: 0.38;
  }
  .corner-tl,
  .corner-tr { top: 12px; }
  .corner-bl,
  .corner-br { bottom: 12px; }
  .corner-tl,
  .corner-bl { left: 12px; }
  .corner-tr,
  .corner-br { right: 12px; }

  .scroll-scene {
    padding: 0 16px;
  }
  .scroll-paper {
    padding: 24px 18px;
    max-height: 70vh;
  }
  .location-scroll .scroll-paper {
    padding: 26px 18px;
  }
  .scroll-header {
    margin-bottom: 12px;
  }
  .scroll-header .xi-char {
    font-size: 30px;
  }
  .scroll-date-block .date-main {
    font-size: 28px;
  }
  .scroll-date-block .date-sub {
    font-size: 12px;
    letter-spacing: 2px;
  }
  .qvideo-wrap {
    width: 126px;
    height: 126px;
    margin-bottom: 14px;
  }
  .scroll-invite-text {
    font-size: 14px;
    letter-spacing: 3px;
  }
  .location-header {
    margin-bottom: 14px;
  }
  .location-header .venue-name {
    font-size: 20px;
  }
  .location-info-block {
    margin-bottom: 12px;
  }
  .info-row {
    gap: 10px;
    padding: 10px 0;
  }
  .info-row .info-value {
    font-size: 13px;
  }
  .signature-block {
    margin-top: 12px;
    padding-top: 12px;
  }

  .final-image-bg {
    object-position: center 28%;
  }
  .final-top {
    top: calc(44px + env(safe-area-inset-top));
  }
  .final-top .we-just {
    font-size: 12px;
    letter-spacing: 6px;
    margin-bottom: 8px;
  }
  .final-top .final-names {
    font-size: 24px;
    letter-spacing: 3px;
  }
  .final-bottom {
    bottom: calc(70px + env(safe-area-inset-bottom));
    padding: 0 20px;
  }
  .final-bottom .invite-main {
    font-size: 18px;
    letter-spacing: 3px;
    line-height: 1.7;
  }
  .final-bottom .invite-date {
    font-size: 11px;
    letter-spacing: 2px;
  }
  .final-deco-line {
    bottom: calc(32px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 380px) {
  .envelope {
    width: 270px;
    height: 180px;
  }
  .envelope-flap::before {
    border-left-width: 135px;
    border-right-width: 135px;
    border-top-width: 100px;
  }
  .envelope-flap::after {
    border-left-width: 133px;
    border-right-width: 133px;
    border-top-width: 98px;
  }
  .envelope-title .names {
    font-size: 20px;
    letter-spacing: 4px;
  }
  .envelope-title .sub {
    letter-spacing: 4px;
  }
  .scroll-paper,
  .location-scroll .scroll-paper {
    padding-left: 14px;
    padding-right: 14px;
  }
  .paper-roll {
    height: 18px;
  }
  .qvideo-wrap {
    width: 108px;
    height: 108px;
  }
  .scroll-invite-text {
    font-size: 13px;
    letter-spacing: 2px;
  }
}
