/* ============ 基础 ============ */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --gold: #b8925a;
  --gold-light: #d9bc8c;
  --ink: #4a3f33;
  --cream: #faf6ef;
  --paper: #faf6ef;                 /* 弹层等面板底色（不透明） */
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
}

html, body { height: 100%; }

body {
  font-family: var(--serif);
  color: var(--ink);
  background: var(--cream);
  overflow: hidden;               /* 开启前禁止滚动 */
  user-select: none;
}
body.opened { overflow-y: auto; overflow-x: hidden; }

img { display: block; max-width: 100%; }

/* 正文最大宽度，桌面居中模拟手机 */
#letter, #cover, #petals {
  max-width: 480px;
  margin: 0 auto;
}
#petals { position: fixed; top: 0; left: 0; right: 0; margin: 0 auto; pointer-events: none; z-index: 50; overflow: hidden; height: 100%; }

/* ============ 开屏封面 ============ */
#cover {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 1.2s cubic-bezier(.7,0,.3,1), opacity 1.2s ease, visibility 1.2s;
}
#cover.hide {
  opacity: 0;
  transform: translateY(-6%);
  visibility: hidden;
  pointer-events: none;
}
.cover-img {
  position: absolute;
  inset: 0;
  background: url("../assets/images/cover.jpg") center 18% / cover no-repeat;
  animation: coverZoom 8s ease-out forwards;
}
@keyframes coverZoom { from { transform: scale(1.08); } to { transform: scale(1); } }
.cover-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(30,20,10,.42) 0%, rgba(30,20,10,.05) 34%,
                    rgba(30,20,10,.05) 55%, rgba(30,20,10,.55) 100%);
}
.cover-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: #fff;
  padding-bottom: 6vh;
}
.cover-sub {
  font-size: 13px;
  letter-spacing: .55em;
  text-indent: .55em;
  opacity: .9;
}
.cover-names {
  margin: 4vh 0 2vh;
  font-size: 40px;
  font-weight: 600;
  letter-spacing: .12em;
  text-shadow: 0 2px 14px rgba(0,0,0,.35);
}
.cover-names i {
  font-style: italic;
  font-family: Georgia, serif;
  font-weight: 400;
  color: var(--gold-light);
  margin: 0 .35em;
  font-size: 34px;
}
.cover-date { font-size: 17px; letter-spacing: .3em; text-indent: .3em; }
.cover-tip {
  margin-top: 12vh;
  font-size: 12.5px;
  letter-spacing: .18em;
  opacity: .85;
}
#open-btn {
  position: relative;
  margin-top: 22px;
  padding: 13px 44px;
  border: 1px solid rgba(255,255,255,.85);
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  backdrop-filter: blur(4px);
  color: #fff;
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: .28em;
  text-indent: .28em;
  cursor: pointer;
  transition: background .3s;
}
#open-btn:active { background: rgba(255,255,255,.3); }
#open-btn .ring {
  position: absolute;
  inset: -1px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.85);
  animation: ringPulse 2s ease-out infinite;
}
@keyframes ringPulse {
  0%   { transform: scale(1); opacity: .8; }
  70%  { transform: scale(1.28); opacity: 0; }
  100% { transform: scale(1.28); opacity: 0; }
}

/* 封面元素进场动画（载入即播） */
.reveal-item {
  opacity: 0;
  transform: translateY(18px);
  animation: fadeUp 1.1s ease forwards;
}
.reveal-item:nth-child(1) { animation-delay: .2s; }
.reveal-item:nth-child(2) { animation-delay: .5s; }
.reveal-item:nth-child(3) { animation-delay: .8s; }
.reveal-item:nth-child(4) { animation-delay: 1.4s; }
.reveal-item:nth-child(5) { animation-delay: 2s; }
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }

/* ============ 音乐按钮 ============ */
#music-btn {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  right: 14px;
  z-index: 120;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(74,63,51,.55);
  backdrop-filter: blur(3px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0);
  transition: opacity .6s .8s, transform .6s .8s;
}
#music-btn.show { opacity: 1; transform: scale(1); }
#music-btn .disc {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background:
    radial-gradient(circle, #d9bc8c 0 3px, #4a3f33 3px 5px, transparent 5px),
    repeating-radial-gradient(circle, #6b5a44 0 2px, #57493a 2px 4px);
  animation: spin 3.2s linear infinite;
  animation-play-state: paused;
}
#music-btn.playing .disc { animation-play-state: running; }
@keyframes spin { to { transform: rotate(360deg); } }
#music-btn .note {
  position: absolute;
  top: -4px;
  right: -2px;
  font-size: 13px;
  color: var(--gold-light);
  opacity: 0;
  transition: opacity .3s;
}
#music-btn.paused .note { opacity: 1; }
.hidden { display: none; }

/* ============ 地图选择弹层 ============ */
.sheet-mask {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(74,63,51,.45);
  display: flex;
  align-items: flex-end;
  opacity: 0;
  visibility: hidden;
  transition: opacity .28s, visibility .28s;
}
.sheet-mask.show { opacity: 1; visibility: visible; }
.sheet {
  width: 100%;
  background: #faf6ef;
  background: var(--paper, #faf6ef);
  border-radius: 18px 18px 0 0;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  transform: translateY(100%);
  transition: transform .32s cubic-bezier(.3,.9,.3,1);
}
.sheet-mask.show .sheet { transform: translateY(0); }
.sheet-title {
  text-align: center;
  font-size: 15px;
  letter-spacing: .12em;
  color: var(--gold);
  margin-bottom: 12px;
}
.sheet-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 4px;
  font-size: 16px;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid rgba(184,146,90,.22);
}
.sheet-item i { font-style: normal; color: var(--gold); }
.sheet-item:active { background: rgba(184,146,90,.1); }
.sheet-tip {
  margin: 14px 0 16px;
  font-size: 12.5px;
  line-height: 1.7;
  color: #7d6c56;
}
.sheet-close {
  width: 100%;
  padding: 13px;
  border: 1px solid var(--gold-light);
  border-radius: 999px;
  background: transparent;
  font-size: 15px;
  color: var(--gold);
  cursor: pointer;
}

/* ============ 自动播放进度条 & 暂停按钮 ============ */
#auto-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  margin: 0 auto;
  max-width: 480px;
  height: 3px;
  z-index: 110;
  background: rgba(184,146,90,.18);
  opacity: 0;
  transition: opacity .4s;
}
#auto-bar.show { opacity: 1; }
#auto-bar i {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--gold-light), var(--gold));
}

/* ============ 正文页面通用 ============ */
#letter { background: var(--cream); }
.page { position: relative; padding: 60px 26px; }
.page + .page { border-top: 1px solid rgba(184,146,90,.18); }

.sec-en {
  text-align: center;
  font-size: 11px;
  letter-spacing: .5em;
  text-indent: .5em;
  color: var(--gold);
  opacity: .75;
}
.sec-title {
  margin: 10px 0 34px;
  text-align: center;
  font-size: 25px;
  font-weight: 600;
  letter-spacing: .35em;
  text-indent: .35em;
}
.sec-title::after {
  content: "";
  display: block;
  width: 34px;
  height: 2px;
  margin: 14px auto 0;
  background: var(--gold);
}

/* 滚动进场动画 */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 1s ease, transform 1s ease; }
.reveal.left  { transform: translateX(-36px); }
.reveal.right { transform: translateX(36px); }
.reveal.visible { opacity: 1; transform: none; }
.delay-1 { transition-delay: .25s; }
.delay-2 { transition-delay: .5s; }
.delay-3 { transition-delay: .75s; }

/* ============ 封面页 ============ */
.page-hero {
  min-height: 100vh;
  padding: 0 0 46px;
  display: flex;
  flex-direction: column;
}
.hero-text { padding-top: 12vh; text-align: center; }
.hero-text .line { font-size: 14px; letter-spacing: .5em; text-indent: .5em; color: var(--gold); }
.hero-text .names {
  margin: 3vh 0 4vh;
  font-size: 34px;
  font-weight: 600;
  letter-spacing: .1em;
}
.hero-text .names i {
  font-style: italic;
  font-family: Georgia, serif;
  font-weight: 400;
  color: var(--gold);
  margin: 0 .3em;
}
.date-card {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 12px 26px;
  border-top: 1px solid var(--gold-light);
  border-bottom: 1px solid var(--gold-light);
}
.date-card .d { font-family: Georgia, serif; font-size: 30px; color: var(--gold); }
.date-card em { font-style: normal; font-size: 13px; color: var(--ink); }
.week { margin-top: 14px; font-size: 13px; letter-spacing: .4em; text-indent: .4em; }

.hero-photo {
  margin-top: 6vh;
  width: 100%;
  flex: 1;
  min-height: 46vh;
}
.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  box-shadow: 0 -10px 34px rgba(74,63,51,.12);
}

.scroll-hint {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 36px;
  border: 1px solid var(--gold);
  border-radius: 12px;
}
.scroll-hint span {
  position: absolute;
  top: 7px;
  left: 50%;
  width: 3px;
  height: 8px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: var(--gold);
  animation: scrollDot 1.6s ease-in-out infinite;
}
@keyframes scrollDot {
  0%   { transform: translateY(0); opacity: 1; }
  70%  { transform: translateY(12px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}

/* ============ 邀请辞 ============ */
.invite-text { text-align: center; line-height: 2.3; font-size: 15.5px; }
.invite-text b { color: var(--gold); font-size: 17px; padding: 0 2px; }
.invite-photo {
  margin-top: 34px;
  width: 82%;
  margin-left: auto;
  margin-right: auto;
  border: 6px solid #fff;
  box-shadow: 0 10px 30px rgba(74,63,51,.18);
}

/* ============ 照片墙（自动轮播） ============ */
.gallery { width: 86%; margin: 0 auto; }
.g-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border: 5px solid #fff;
  box-shadow: 0 8px 24px rgba(74,63,51,.16);
  background: #fff;
}
.g-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1s ease;
}
.g-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}
.g-slide.is-active { opacity: 1; }
.g-slide.is-active img { animation: kenBurns 5.2s ease-out forwards; }
@keyframes kenBurns { from { transform: scale(1); } to { transform: scale(1.07); } }

/* ---------- 多种转场动画 ---------- */
.g-slide[class*="fx-"] { animation-duration: .85s; animation-fill-mode: both; animation-timing-function: cubic-bezier(.35,.7,.3,1); }

/* 1. 淡入淡出 */
.fx-fade { animation-name: gFade; }
@keyframes gFade { from { opacity: 0; } to { opacity: 1; } }

/* 2. 左右推移 */
.fx-slideR { animation-name: gSlideR; }
.fx-slideL { animation-name: gSlideL; }
@keyframes gSlideR { from { opacity: 1; transform: translateX(100%); } to { opacity: 1; transform: translateX(0); } }
@keyframes gSlideL { from { opacity: 1; transform: translateX(-100%); } to { opacity: 1; transform: translateX(0); } }

/* 3. 放大进入 */
.fx-zoomIn { animation-name: gZoomIn; }
@keyframes gZoomIn { from { opacity: 0; transform: scale(.82); } to { opacity: 1; transform: scale(1); } }

/* 4. 缩小进入 */
.fx-zoomOut { animation-name: gZoomOut; }
@keyframes gZoomOut { from { opacity: 0; transform: scale(1.2); } to { opacity: 1; transform: scale(1); } }

/* 5 / 6. 上下推入 */
.fx-pushUp { animation-name: gPushUp; }
.fx-pushDown { animation-name: gPushDown; }
@keyframes gPushUp { from { opacity: 0; transform: translateY(55%); } to { opacity: 1; transform: translateY(0); } }
@keyframes gPushDown { from { opacity: 0; transform: translateY(-55%); } to { opacity: 1; transform: translateY(0); } }

/* 7. 3D 翻页 */
.fx-flipR { animation-name: gFlipR; }
.fx-flipL { animation-name: gFlipL; }
@keyframes gFlipR {
  from { opacity: 0; transform: perspective(1000px) rotateY(75deg); }
  to   { opacity: 1; transform: perspective(1000px) rotateY(0); }
}
@keyframes gFlipL {
  from { opacity: 0; transform: perspective(1000px) rotateY(-75deg); }
  to   { opacity: 1; transform: perspective(1000px) rotateY(0); }
}

/* 8. 模糊虚化 */
.fx-blur { animation-name: gBlur; }
@keyframes gBlur { from { opacity: 0; filter: blur(14px); } to { opacity: 1; filter: blur(0); } }
.g-heart {
  position: absolute;
  right: 8px;
  bottom: 6px;
  z-index: 3;
  font-size: 20px;
  color: var(--gold);
  opacity: .9;
  text-shadow: 0 1px 4px rgba(255,255,255,.6);
}
.g-arrow {
  position: absolute;
  top: 50%;
  z-index: 4;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(74,63,51,.35);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  opacity: .85;
  transition: background .25s, opacity .25s;
}
.g-arrow:hover { background: rgba(184,146,90,.85); opacity: 1; }
.g-prev { left: 10px; }
.g-next { right: 10px; }

.g-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}
.g-dots .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(184,146,90,.35);
  cursor: pointer;
  transition: background .3s, width .3s;
}
.g-dots .dot.is-active { background: var(--gold); width: 18px; border-radius: 4px; }

/* ============ 婚礼信息 ============ */
.countdown { display: flex; justify-content: center; gap: 14px; margin-bottom: 34px; }
.cd-cell {
  min-width: 62px;
  padding: 12px 6px;
  text-align: center;
  background: #fff;
  border: 1px solid rgba(184,146,90,.35);
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(74,63,51,.08);
}
.cd-cell b { display: block; font-family: Georgia, serif; font-size: 24px; color: var(--gold); }
.cd-cell span { font-size: 11px; letter-spacing: .2em; text-indent: .2em; }

.info-card {
  background: #fff;
  border: 1px solid rgba(184,146,90,.3);
  border-radius: 14px;
  padding: 26px 22px;
  box-shadow: 0 8px 24px rgba(74,63,51,.08);
}
.info-row { display: flex; align-items: flex-start; gap: 14px; }
.info-row + .info-row { margin-top: 22px; padding-top: 22px; border-top: 1px dashed rgba(184,146,90,.35); }
.info-row .ico { font-size: 20px; line-height: 1.4; }
.info-row b { font-size: 14px; letter-spacing: .12em; color: var(--gold); }
.info-row p { margin-top: 5px; font-size: 15px; line-height: 1.6; }
/* 可点击的导航 / 拨号链接 */
.info-row .link {
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.info-row .link .go {
  font-style: normal;
  font-size: 12px;
  letter-spacing: .08em;
  padding: 3px 10px;
  border: 1px solid var(--gold-light);
  border-radius: 999px;
  color: var(--gold);
  white-space: nowrap;
}
.info-row .link:active .go { background: var(--gold); color: #fff; }

/* ============ 结尾 ============ */
.page-closing { min-height: 88vh; padding: 0; display: flex; align-items: center; justify-content: center; }
.closing-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.closing-mask { position: absolute; inset: 0; background: rgba(30,22,12,.42); }
.closing-text { position: relative; z-index: 2; text-align: center; color: #fff; }
.closing-text h2 {
  font-size: 34px;
  font-weight: 600;
  letter-spacing: .5em;
  text-indent: .5em;
  text-shadow: 0 2px 12px rgba(0,0,0,.4);
}
.closing-text p { margin-top: 18px; font-size: 15px; letter-spacing: .2em; opacity: .92; }

.foot {
  padding: 34px 0 44px;
  text-align: center;
  font-size: 12px;
  letter-spacing: .2em;
  color: var(--gold);
  opacity: .8;
}

/* ============ 花瓣 ============ */
.petal {
  position: absolute;
  top: -6vh;
  width: 14px;
  height: 14px;
  background: radial-gradient(circle at 30% 30%, rgba(255,228,214,.95), rgba(233,180,160,.75));
  border-radius: 100% 0 100% 0;
  opacity: 0;
  animation: petalFall linear infinite;
  will-change: transform;
}
@keyframes petalFall {
  0%   { opacity: 0; transform: translate3d(0, -6vh, 0) rotate(0deg); }
  8%   { opacity: .9; }
  50%  { transform: translate3d(26px, 50vh, 0) rotate(200deg); }
  90%  { opacity: .8; }
  100% { opacity: 0; transform: translate3d(-14px, 108vh, 0) rotate(420deg); }
}
