@font-face {
  font-family: "ZCOOL KuaiLe";
  src: url("/fonts/zcool-kuaile-subset.woff2") format("woff2"),
       url("/fonts/zcool-kuaile-subset.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* 板块小标题专用「可爱小楷」：马善政毛笔楷书（Google 开源书法字体子集，
   只含站点文案用字，89KB）。子集外的字自动回退系统楷体/华文行楷，不会出方框。 */
@font-face {
  font-family: "Ma Shan Zheng";
  src: url("/fonts/ma-shan-zheng-subset.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* 首屏大标题专用「草书」：刘建毛草（Google 书法字体子集，常用汉字+婚礼高频字）。
   子集外的字自动回退到 --font-script（华文行楷），不会出方框。 */
@font-face {
  font-family: "Liu Jian Mao Cao";
  src: url("/fonts/liu-jian-mao-cao-subset.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f3f0fa;
  --bg-soft: #faf8ff;
  --card: rgba(252, 250, 255, 0.9);
  --card-strong: #fdfcff;
  --text: #2c2440;
  --muted: #6f6885;
  --brand: #7c5cbf;
  --brand-deep: #5b3fa0;
  --line: rgba(124, 92, 191, 0.12);
  --shadow: 0 18px 48px rgba(91, 63, 160, 0.12);
  --radius: 28px;
  --radius-sm: 18px;
  /* 照片边缘羽化色：接近卡片/页面底色，让照片边界柔和融进背景 */
  --photo-feather: rgba(250, 247, 255, 0.92);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(circle at top, rgba(226, 217, 255, 0.8), transparent 32%),
    linear-gradient(180deg, #faf7ff 0%, #f3f0fa 28%, #eeeafb 100%);
  color: var(--text);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

body {
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  width: 100%;
}

button,
input,
textarea {
  font: inherit;
}

.page-shell {
  width: min(100%, 460px);
  margin: 0 auto;
  padding: 18px 14px 120px;
}

/* 整页只有一层淡紫渐变背景（见 html/body），.page-shell 不铺任何糊图/蒙层；
   各内容区域保留各自的底色+圆角边框（首屏卡、section 卡、时间缎带等）。 */

.page-loading {
  min-height: 100vh;
  display: grid;
  place-items: center;
  color: var(--muted);
  letter-spacing: 0.08em;
}

/* 首屏卡片：整页只有淡紫渐变一层背景，卡片自己不铺封面糊图，
   保留自身奶油底 + 圆角 + 投影（与其它区域卡一致，各自有底有框）。
   封面原图：不裁切、按原比例显示（只给 width，height 默认 auto 等比缩放，不会拉长）。
   左右用 calc(100% + 36px) + 负 margin 抵消卡片左右内边距（18px×2），底边负 margin
   吃掉卡片下内边距 + hero-visual 下留白（22+18=40px），让照片左右下三边顶到卡片边界，
   由 overflow:hidden 裁出卡片圆角；因此只留顶部圆角，边缘羽化阴影照旧。 */
.hero {
  position: relative;
  padding: 28px 18px 22px;
  border-radius: 34px;
  background: linear-gradient(180deg, rgba(255, 251, 246, 0.98), rgba(247, 235, 226, 0.96));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero > .hero-title,
.hero > .hero-meta,
.hero > .hero-visual,
.hero > .hero-quote {
  position: relative;
  z-index: 2;
}

/* 首屏背景虚化：虚化层铺满「整张卡片」（.hero::before，同图放大+高斯模糊），
   下重上轻渐显——照片身后是浓的虚化底，越往标题方向越淡、化回奶油底，
   照片与上方文字区之间没有硬边。之前虚化层放在 .hero-media 里被
   overflow:hidden 裁在照片框内，卡片上半截看不到背景，故上移到卡片级。 */
.hero.has-cover-bg::before {
  content: "";
  position: absolute;
  inset: -40px; /* 外扩吃掉 blur 边缘的透明晕圈 */
  z-index: 1;
  background: var(--hero-img, none) center / cover no-repeat;
  filter: blur(18px) saturate(1.1) brightness(1.04);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, rgba(0, 0, 0, 0.35) 30%, #000 58%);
  mask-image: linear-gradient(to bottom, transparent 0, rgba(0, 0, 0, 0.35) 30%, #000 58%);
  pointer-events: none;
}

/* 照片容器：负 margin 顶到卡片左右下边界（外侧圆角由卡片 overflow 裁齐）。
   注意这里不能再 overflow:hidden —— 照片上缘的渐隐要直接透出卡片级虚化底 */
.hero-visual .hero-media {
  position: relative;
  z-index: 1;
  margin: 0 -18px -40px;
}

.hero-visual .hero-cover {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  border-radius: 26px 26px 0 0;
  /* 顶部约 1/4 高度渐显：上缘「化」进卡片级虚化背景，与上方标题区渐变融合 */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 24%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 24%);
}

/* 首页标题字体：主标题走「行楷/楷体」手写笔意（iOS/微信自带 华文行楷、楷体），
   名字走细衬线宋体（iOS 宋体-简、安卓/iPad 华文中宋）。逐字回退到系统无衬线，
   避免安卓缺字时整行掉成默认字体。改字体只动这两个变量。 */
:root {
  --font-script: "STXingkai", "华文行楷", "STKaiti", "KaiTi", "楷体",
    "ZCOOL KuaiLe", "PingFang SC", sans-serif;
  --font-display: "Songti SC", "STSong", "宋体-简", "STZhongsong", "SimSun",
    "PingFang SC", sans-serif;
}

.hero-title {
  text-align: center;
  font-size: 40px;
  line-height: 1.35;
  letter-spacing: 0.1em;
  font-family: "Liu Jian Mao Cao", var(--font-script);
  /* 大标题改藕粉米白：粉中带米、柔和耐看；淡紫灰柔影保可读 */
  color: #f6e3e0;
  text-shadow:
    0 2px 10px rgba(124, 92, 191, 0.45),
    0 1px 2px rgba(91, 63, 160, 0.35);
}

/* 大标题两行「上下交错」：文案以第一个逗号拆成前后两截（见 app.js heroTitleLines），
   各占一行，行距收紧并反向错位 —— 前句整体偏左上、后句偏右下，做出错落的手写感。 */
.hero-title .title-line {
  display: block;
  line-height: 1.15;
}

.hero-title .title-line:first-child {
  transform: translateX(-0.7em);
}

.hero-title .title-line + .title-line {
  margin-top: -0.28em;
  transform: translateX(0.9em);
}

.hero-title strong {
  display: block;
  margin-top: 10px;
  font-size: 26px;
  font-weight: 600;
  font-family: var(--font-display);
  letter-spacing: 0.22em;
  /* 名字改薰衣草奶油：极淡奶油紫单色，让位给大标题当主角 */
  color: #d9cdf0;
  -webkit-text-fill-color: #d9cdf0;
}

.hero-meta {
  margin-top: 16px;
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

.hero-visual {
  position: relative;
  margin-top: 24px;
  padding-bottom: 18px;
}

.hero-visual .cover-word {
  position: absolute;
  left: -18px;
  bottom: -6px;
  width: 62%;
  opacity: 0.88;
}

.hero-visual .invitation-mark {
  width: 58%;
  margin-left: auto;
  margin-bottom: 8px;
}

.hero-quote {
  margin-top: 14px;
  text-align: right;
  letter-spacing: 0.18em;
  color: var(--muted);
}

/* 没配引言时这个空 div 仍会贡献 14px 上边距，把封面照底边抬起来，
   导致 .hero-cover 的 -40px 负 margin 不够顶到卡片下边界；空则不占位 */
.hero-quote:empty {
  display: none;
}

.music-bar {
  /* 不再 sticky 悬浮，作为普通文档流元素随页面滚动 */
  margin: 18px 4px 0;
}

/* 音乐条恢复独立卡片底+投影（不再需要 backdrop-filter：页面已无糊背景可透）。 */
.music-card {
  display: grid;
  grid-template-columns: 54px 1fr 64px;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 24px;
  background: rgba(255, 253, 251, 0.86);
  box-shadow: 0 12px 24px rgba(90, 53, 41, 0.1);
}

.music-trigger {
  width: 54px;
  height: 54px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--brand), var(--brand-deep));
  color: #fff;
  cursor: pointer;
  box-shadow: 0 10px 18px rgba(124, 92, 191, 0.3);
}

.music-trigger.is-playing {
  animation: spin 5s linear infinite;
}

.music-copy {
  min-width: 0;
}

.music-copy h3,
.music-copy p {
  margin: 0;
}

.music-copy h3 {
  font-size: 15px;
}

.music-copy p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.music-poster {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  overflow: hidden;
}

.time-ribbon {
  margin: 22px 4px 0;
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  border-radius: 24px;
  background: rgba(255, 252, 248, 0.92);
  box-shadow: 0 14px 30px rgba(89, 49, 38, 0.08);
}

.time-box {
  padding: 14px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(124, 92, 191, 0.08), rgba(124, 92, 191, 0.02));
}

.time-box strong,
.time-box span {
  display: block;
}

.time-box strong {
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.time-box span {
  font-size: 17px;
  line-height: 1.45;
}

.section-card {
  margin-top: 18px;
  padding: 22px 18px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--card);
  box-shadow: 0 12px 28px rgba(94, 58, 48, 0.06);
}

.section-card.centered {
  text-align: center;
}

/* 故事卡背景 = 该故事照片的模糊放大版：
   --story-bg 由 app.js 挂在卡片内联样式上。糊图用 ::before 垫在卡片底色之上、
   正文之下；inset 向外扩出 blur 半径的约 3 倍，避免四周晕出一圈透明边。
   再叠一层近白的柔和蒙层（::after）压住糊图，保证文案可读。 */
.section-card.has-story-bg {
  position: relative;
  overflow: hidden;
}

.section-card.has-story-bg::before {
  content: "";
  position: absolute;
  inset: -48px;
  z-index: 0;
  background: var(--story-bg, none) center / cover no-repeat;
  filter: blur(16px) saturate(1.08);
}

.section-card.has-story-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    180deg,
    rgba(255, 253, 255, 0.82) 0%,
    rgba(255, 253, 255, 0.6) 55%,
    rgba(250, 246, 255, 0.78) 100%
  );
}

.section-card.has-story-bg > * {
  position: relative;
  z-index: 2;
}

.section-eyebrow {
  margin-bottom: 10px;
  color: var(--brand);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.section-title {
  margin: 0 0 10px;
  font-size: 26px;
  /* 可爱小楷：马善政毛笔楷书（见顶部 @font-face 子集），缺字回退系统楷体/华文行楷 */
  font-family: "Ma Shan Zheng", "STKaiti", "KaiTi", "楷体", var(--font-script);
  line-height: 1.35;
  letter-spacing: 0.08em;
  /* h2 默认加粗会让只有常规字重的楷书被浏览器伪加粗、墨色变重——归到常规字重保轻盈 */
  font-weight: normal;
  /* 颜色调轻：柔和薰衣草紫（比正文深紫黑浅两档），配一层极淡紫雾影，轻盈可爱 */
  color: #9b7fd4;
  text-shadow: 0 1px 6px rgba(155, 127, 212, 0.18);
}

.section-subtitle {
  margin: -4px 0 14px;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.section-lines {
  display: grid;
  gap: 6px;
  color: var(--text);
  line-height: 1.9;
}

.moon-pair {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.moon-pair img {
  border-radius: 24px;
  aspect-ratio: 31 / 46;
  object-fit: cover;
}

.moon-labels {
  position: absolute;
  inset: auto 10px 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  color: #fff;
  text-align: center;
  font-size: 15px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.split-story {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.32fr) minmax(0, 0.68fr);
  gap: 16px;
  align-items: center;
}

.split-story.reverse {
  grid-template-columns: minmax(0, 0.68fr) minmax(0, 1.32fr);
}

/* 故事照片三边贴到卡片边界（左图贴左边，右图贴右边），上下顶满卡片内边距，
   负 margin 抵掉 .section-card 的 22px/18px padding；外侧圆角交给卡片
   overflow:hidden 按 30px 裁齐，内侧三边保留圆角与文案区过渡。 */
.split-story .story-media {
  margin: -22px -16px -22px -18px;
  border-radius: 0 28px 28px 0;
}

.split-story.reverse .story-media {
  margin: -22px -18px -22px -16px;
  border-radius: 28px 0 0 28px;
}

/* 贴边三侧不能再做径向渐隐（会把贴边侧淡化露不出来），故事图取消 mask */

.split-story img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  /* 照片按原比例整张显示，人像不被裁头裁脚 */
  object-fit: contain;
}

/* 内侧（朝文案一侧）渐变融合：主图 contain 会在框内留出虚化底衬的边条，
   底衬/照片与卡片背景在直边处会掐出明显轮廓。给整个 .story-media 加
   横向 mask —— 贴边的三侧保持实心，朝文案一侧约后 24% 渐隐到透明，
   照片、虚化底衬一起「化」进卡片背景，不再有一刀切的边界。 */
.split-story .story-media {
  -webkit-mask-image: linear-gradient(to right, #000 0, #000 76%, rgba(0, 0, 0, 0.35) 92%, transparent 100%);
  mask-image: linear-gradient(to right, #000 0, #000 76%, rgba(0, 0, 0, 0.35) 92%, transparent 100%);
}

.split-story.reverse .story-media {
  -webkit-mask-image: linear-gradient(to left, #000 0, #000 76%, rgba(0, 0, 0, 0.35) 92%, transparent 100%);
  mask-image: linear-gradient(to left, #000 0, #000 76%, rgba(0, 0, 0, 0.35) 92%, transparent 100%);
}

/* 图片框：虚化底衬和边缘渐变严格限制在框内，不外溢到卡片背景 */
.story-media {
  position: relative;
  z-index: 0;
  overflow: hidden;
  border-radius: 28px;
}

/* 虚化底衬：同一张照片放大 + 高斯模糊垫在后面，
   补上主图边缘的羽化感；被 .story-media 的 overflow 裁住，只在图片内可见 */
.story-media::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--story-img, none);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(22px) saturate(1.15) brightness(1.04);
  opacity: 0.85;
  pointer-events: none;
}

/* 全站照片统一处理：直接给照片加径向 mask —— 中心清晰、越靠边越透明、
   四角完全渐隐，照片本体「化」进背景里，比任何覆盖色都柔和。
   mask 会连 box-shadow 一起渐隐，所以不再叠加 inset 阴影。
   story 图已三边贴卡片边界，不再做径向渐隐（渐隐会让贴边侧露不出实图），
   其余图片渐隐处露出卡片底色。
   （-webkit 前缀给微信老 WebView） */
.carousel-slide img,
.image-list img,
.grid-gallery img {
  -webkit-mask-image: radial-gradient(
    ellipse 92% 90% at 50% 50%,
    #000 48%,
    rgba(0, 0, 0, 0.6) 74%,
    transparent 97%
  );
  mask-image: radial-gradient(
    ellipse 92% 90% at 50% 50%,
    #000 48%,
    rgba(0, 0, 0, 0.6) 74%,
    transparent 97%
  );
}

/* 新人故事图：主图渐隐后露出 .story-media::before 的模糊副本，
   照片到虚化的过渡全程无硬边；外侧保留很轻的投影托底 */
.story-media {
  box-shadow: 0 10px 26px rgba(94, 58, 48, 0.1);
}

.split-copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
  line-height: 1.9;
}

.split-copy.right {
  text-align: right;
}

.carousel {
  position: relative;
}

.carousel-track {
  position: relative;
  min-height: 230px;
}

.carousel-slide {
  display: none;
}

.carousel-slide.is-active {
  display: block;
}

.carousel-slide img {
  border-radius: 24px;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.carousel-dots {
  margin-top: 12px;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.carousel-dots button {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  background: rgba(124, 92, 191, 0.2);
  padding: 0;
}

.carousel-dots button.is-active {
  background: var(--brand);
}

/* 图文板块 3 图版式：用 site.json 里的 layout 显式声明，不依赖 :has()
   （微信老 WebView 不支持 :has 会导致退成一列）。
   landscape-first：一张横图通栏在前 + 两张竖图并排在后
   two-up-first：    两张竖图并排在先 + 一张横图通栏在后 */
.image-list {
  display: grid;
  gap: 10px;
}

.image-list.landscape-first,
.image-list.two-up-first {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.image-list.landscape-first img:first-child {
  grid-column: 1 / -1;
  aspect-ratio: 16 / 9;
}

.image-list.landscape-first img:nth-child(n + 2) {
  aspect-ratio: 3 / 4;
}

/* 两张竖图显式钉在第一行的左右两列，确保并排成一行 */
.image-list.two-up-first img:nth-child(1) {
  grid-column: 1;
  grid-row: 1;
  aspect-ratio: 3 / 4;
}

.image-list.two-up-first img:nth-child(2) {
  grid-column: 2;
  grid-row: 1;
  aspect-ratio: 3 / 4;
}

.image-list.two-up-first img:nth-child(3) {
  grid-column: 1 / -1;
  grid-row: 2;
  aspect-ratio: 16 / 9;
}

.image-list img,
.grid-gallery img {
  width: 100%;
  display: block;
  border-radius: 22px;
  object-fit: cover;
}

.grid-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

/* 九宫格照片改心形边框：外层 span 做心形裁切，并顶掉上面「全站照片径向渐隐」
   的 mask，保证心形轮廓干净。描边用 filter: drop-shadow 贴着裁切后的形状出
   （box-shadow 会被裁掉，不适用）。
   心形用经典心形线 x=16sin³t, y=13cost−5cos2t−2cos3t−cos4t 均匀采样 48 点生成，
   曲线足够圆滑（多段折线每段 <3° 转折），仍走 clip-path: polygon 保证微信老
   WebView 兼容（path() 支持不佳）。 */
.heart-frame {
  display: block;
  aspect-ratio: 1 / 1;
  clip-path: polygon(
    50% 25.7%,
    50.1% 24.6%,
    50.8% 21.5%,
    52.7% 17.1%,
    56% 12.1%,
    60.8% 7.7%,
    67% 4.6%,
    74% 3.6%,
    81.2% 5%,
    87.9% 8.6%,
    93.3% 14.2%,
    96.8% 21.2%,
    98% 28.9%,
    96.8% 36.9%,
    93.3% 44.7%,
    87.9% 52.2%,
    81.2% 59.3%,
    74% 66%,
    67% 72.4%,
    60.8% 78.5%,
    56% 84%,
    52.7% 88.9%,
    50.8% 92.7%,
    50.1% 95.2%,
    50% 96%,
    49.9% 95.2%,
    49.2% 92.7%,
    47.3% 88.9%,
    44% 84%,
    39.2% 78.5%,
    33% 72.4%,
    26% 66%,
    18.8% 59.3%,
    12.1% 52.2%,
    6.7% 44.7%,
    3.2% 36.9%,
    2% 28.9%,
    3.2% 21.2%,
    6.7% 14.2%,
    12.1% 8.6%,
    18.8% 5%,
    26% 3.6%,
    33% 4.6%,
    39.2% 7.7%,
    44% 12.1%,
    47.3% 17.1%,
    49.2% 21.5%,
    49.9% 24.6%
  );
  filter: drop-shadow(0 0 1.5px rgba(201, 100, 142, 0.9)) drop-shadow(0 4px 14px rgba(91, 63, 160, 0.22));
}
.heart-frame img {
  width: 100%;
  height: 100%;
  border-radius: 0;
  object-fit: cover;
  -webkit-mask-image: none;
  mask-image: none;
}

.video-frame {
  margin-top: 14px;
  border-radius: 24px;
  overflow: hidden;
  background: #17121f;
  box-shadow: 0 14px 30px rgba(91, 63, 160, 0.16);
}

.video-frame video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #17121f;
}

.invite-divider {
  margin: 30px auto 14px;
  width: 120px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(124, 92, 191, 0.4), transparent);
}

.venue-card,
.contact-card,
.form-card {
  margin-top: 18px;
  padding: 22px 18px;
  border-radius: 30px;
  background: var(--card-strong);
  box-shadow: var(--shadow);
}

.venue-photo {
  margin-top: 14px;
  border-radius: 24px;
  overflow: hidden;
}

.venue-actions,
.contact-grid,
.floating-actions {
  display: grid;
  gap: 12px;
}

.venue-actions {
  margin-top: 14px;
}

.cta,
.ghost-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
}

.cta {
  background: linear-gradient(180deg, var(--brand), var(--brand-deep));
  color: #fff;
  box-shadow: 0 10px 18px rgba(124, 92, 191, 0.18);
}

.ghost-button {
  border-color: rgba(124, 92, 191, 0.2);
  color: var(--brand);
  background: rgba(124, 92, 191, 0.04);
}

.contact-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 14px;
}

.contact-person {
  padding: 14px;
  border-radius: 22px;
  background: rgba(124, 92, 191, 0.04);
  text-align: center;
}

.contact-person img {
  border-radius: 20px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.contact-person strong,
.contact-person span {
  display: block;
}

.contact-person strong {
  margin-top: 10px;
  font-size: 18px;
}

.contact-person span {
  margin-top: 4px;
  color: var(--muted);
}

.form-card p {
  color: var(--muted);
}

.invite-form {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.invite-form input,
.invite-form textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(124, 92, 191, 0.12);
  border-radius: 18px;
  background: #fff;
  outline: none;
}

.invite-form textarea {
  min-height: 116px;
  resize: vertical;
}

.form-status {
  min-height: 20px;
  margin-top: 10px;
  color: var(--brand);
  font-size: 13px;
}

.greetings-wall {
  margin-top: 18px;
  padding: 18px;
  border-radius: 28px;
  background: rgba(255, 250, 246, 0.92);
  box-shadow: 0 10px 24px rgba(91, 47, 37, 0.08);
}

/* 弹幕式留言墙：若干条横向跑道，条目绝对定位 + translateX 无限循环飘过。
   跑道高度/随机速度由 JS 内联变量驱动（--dm-dist 位移、--dm-dur 时长）。 */
.greetings-danmaku {
  position: relative;
  overflow: hidden;
  min-height: 96px;
  margin-bottom: 14px;
}

.greetings-danmaku .danmaku-empty {
  padding: 14px 16px;
  border-radius: 20px;
  background: rgba(124, 92, 191, 0.06);
  color: var(--muted);
  text-align: center;
}

.greetings-danmaku .greeting-item {
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform;
  white-space: nowrap;
  /* 单条最长约 16em，超长的祝福截断，防止把跑道挤爆 */
  max-width: 16em;
  overflow: hidden;
  text-overflow: ellipsis;
}

.greetings-danmaku .greeting-item strong,
.greetings-danmaku .greeting-item span {
  display: inline;
}

.greetings-danmaku .greeting-item strong {
  color: var(--brand-deep);
  margin-right: 6px;
}

.greetings-danmaku .greeting-item strong::after {
  content: "：";
}

.greetings-danmaku .greeting-item span {
  margin-top: 0;
  line-height: 1.5;
  color: var(--muted);
}

/* 纯文字弹幕：去掉列表版式留下的胶囊底（padding/圆角/底色），只飘文字；
   浅色卡片上给文字加一圈白色柔光，压住飘落花瓣保证可读 */
/* 浪漫浅紫弹幕：文字用淡丁香紫→粉的渐变字（不支持 background-clip 的老内核
   回落到上面的纯色），白+粉双色柔光让文字在糊底上发着柔光飘过 */
.greetings-danmaku .greeting-item.danmaku-item {
  padding: 0;
  border-radius: 0;
  background: none;
  color: #b48ae0;
  background-image: linear-gradient(120deg, #c9a6f2 0%, #b78ce8 45%, #f0a6cd 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.04em;
  text-shadow:
    0 0 8px rgba(255, 255, 255, 0.85),
    0 0 18px rgba(216, 180, 254, 0.55);
}

/* 渐变字靠 background-clip:text，父级别再盖背景/填色 */
.greetings-danmaku .greeting-item.danmaku-item span {
  color: inherit;
  -webkit-text-fill-color: inherit;
}

/* 不支持 background-clip:text 的内核会露出渐变底块，直接关掉 */
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .greetings-danmaku .greeting-item.danmaku-item {
    background-image: none;
    -webkit-text-fill-color: currentColor;
  }
}

@keyframes danmaku-left {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(calc(-1 * var(--dm-dist, 100vw)));
  }
}

@keyframes danmaku-right {
  from {
    transform: translateX(var(--dm-dist, 100vw));
  }
  to {
    transform: translateX(0);
  }
}

.greetings-danmaku .danmaku-item {
  left: 100%;
  top: calc(var(--dm-lane-top, 0px));
  animation: danmaku-left var(--dm-dur, 18s) linear infinite;
}

.greetings-danmaku .danmaku-item.is-reverse {
  left: auto;
  right: 100%;
  animation-name: danmaku-right;
}

.greeting-item {
  padding: 14px 16px;
  border-radius: 20px;
  background: rgba(124, 92, 191, 0.06);
}

.greeting-item + .greeting-item {
  margin-top: 10px;
}

.greeting-item strong,
.greeting-item span {
  display: block;
}

.greeting-item span {
  margin-top: 6px;
  line-height: 1.7;
  color: var(--muted);
}

/* 留言墙下的直提表单：复用 .invite-form 的输入样式，间距收紧一点 */
.greeting-form {
  margin-top: 4px;
}

.floating-actions {
  position: fixed;
  right: max(16px, calc(50vw - 214px));
  bottom: 24px;
  width: 56px;
}

.floating-actions a {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 253, 250, 0.9);
  display: grid;
  place-items: center;
  box-shadow: 0 12px 24px rgba(91, 63, 160, 0.16);
  color: var(--brand);
  font-size: 12px;
  text-align: center;
  line-height: 1.3;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 420px) {
  .hero-title {
    font-size: 32px;
  }

  .hero-title strong {
    font-size: 22px;
  }

  .split-story,
  .split-story.reverse {
    grid-template-columns: minmax(0, 1fr);
  }

  /* 窄屏单列：图片改为满宽贴卡片顶/底边（左右+一侧贴边），圆角随之调整；
     渐隐方向跟着改成竖向——朝文案的一侧渐隐，贴边侧保持实心 */
  .split-story .story-media {
    margin: -22px -18px 0;
    border-radius: 0 0 28px 28px;
    -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 72%, rgba(0, 0, 0, 0.35) 90%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 0, #000 72%, rgba(0, 0, 0, 0.35) 90%, transparent 100%);
  }

  .split-story.reverse .story-media {
    margin: 0 -18px -22px;
    border-radius: 28px 28px 0 0;
    -webkit-mask-image: linear-gradient(to top, #000 0, #000 72%, rgba(0, 0, 0, 0.35) 90%, transparent 100%);
    mask-image: linear-gradient(to top, #000 0, #000 72%, rgba(0, 0, 0, 0.35) 90%, transparent 100%);
  }

  /* 联系新人、婚礼日期/倒计时在手机上保持两列，字号收小防溢出 */
  .contact-person strong {
    font-size: 16px;
  }

  .time-box span {
    font-size: 15px;
  }

  .floating-actions {
    right: 16px;
  }
}

/* ===================== 羽毛飘落层 ===================== */
.feathers-layer {
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  overflow: hidden;
}
.feathers-layer canvas { display: block; width: 100%; height: 100%; }

/* ===================== 开场信封（仿上级目录 EnvelopeGate）===================== */
.gate {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  align-content: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 22% 12%, rgba(255, 255, 255, 0.7), transparent 42%),
    radial-gradient(circle at 84% 90%, rgba(180, 150, 220, 0.42), transparent 46%),
    linear-gradient(165deg, #f7f3fc 0%, #e9def9 55%, #d9c9f0 100%);
  transition: opacity 680ms ease 40ms, visibility 0s linear 720ms;
}
.gate.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
/* 本会话已拆过信（<head> 脚本给 <html> 挂 gate-seen）：刷新时信封整屏不出现。
   必须用 visibility 而不是只把 opacity 归零，否则它还会吃掉首屏点击。 */
html.gate-seen .gate { opacity: 0; visibility: hidden; pointer-events: none; transition: none; }
.gate.is-done { opacity: 0; visibility: hidden; pointer-events: none; }

.gate__sky { position: absolute; inset: 0; pointer-events: none; }

.gate__kicker {
  position: absolute;
  top: max(16%, calc(env(safe-area-inset-top) + 40px));
  left: 0; right: 0; margin: 0;
  text-align: center; color: var(--brand-deep);
  letter-spacing: 0.5em; text-indent: 0.5em;
  font-size: 0.9rem; line-height: 1.5; overflow-wrap: anywhere;
  opacity: 0; animation: gate-in 900ms cubic-bezier(0.22, 1, 0.36, 1) 300ms forwards;
}

.env {
  position: relative; z-index: 3;
  width: min(80vw, 322px); min-height: 214px; height: 214px;
  perspective: 1100px; cursor: pointer;
  -webkit-tap-highlight-color: transparent; outline: none;
  transition: transform 700ms cubic-bezier(0.22, 1, 0.36, 1), filter 700ms ease;
}
.env:focus-visible { box-shadow: 0 0 0 3px rgba(169, 122, 72, 0.55); border-radius: 18px; }
.gate.is-opening .env { transform: translateY(-22px) scale(1.02); }
.gate.is-done .env { transform: translateY(-52px) scale(1.08); filter: blur(2px); }
.env::before {
  content: ""; position: absolute; inset: -64px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 244, 214, 0.85), rgba(255, 244, 214, 0) 62%);
  opacity: 0; transition: opacity 800ms ease 380ms; pointer-events: none;
}
.gate.is-opening .env::before { opacity: 1; }

.env__back {
  position: absolute; inset: 0; border-radius: 14px;
  background: linear-gradient(170deg, #f3ecfa, #e2d7f0);
  box-shadow: 0 26px 60px rgba(91, 63, 160, 0.3), 0 4px 14px rgba(91, 63, 160, 0.16);
}
.env__letter {
  position: absolute; left: 6.5%; right: 6.5%; bottom: 5%; height: 108%;
  border-radius: 10px;
  background: linear-gradient(180deg, #fffdf9 0%, #f9f4ec 100%);
  box-shadow: 0 10px 26px rgba(91, 63, 160, 0.18);
  padding: 22px 18px 14px; text-align: center; z-index: 2;
  transform: translateY(9%) scale(0.985);
  transition: transform 820ms cubic-bezier(0.22, 1, 0.36, 1) 560ms;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.gate.is-opening .env__letter { transform: translateY(-57%) scale(1); }
/* 花瓣聚心阶段：信纸收拢隐去让位给心形花舞（不动 .env 整体 transform，避免打断封盖翻起） */
.gate.is-heart .env__letter {
  transform: translateY(-74%) scale(0.42);
  opacity: 0;
  filter: blur(3px);
  transition: transform 800ms cubic-bezier(0.55, 0, 0.55, 0.2), opacity 620ms ease, filter 620ms ease;
}
.env__to { margin: 0; font-size: 0.8rem; letter-spacing: 0.4em; text-indent: 0.4em; color: #a97a48; line-height: 1.5; }
.env__names { margin: 10px 0 0; font-size: 1.14rem; letter-spacing: 0.3em; text-indent: 0.3em; color: var(--brand-deep); font-family: "STSong", "Songti SC", serif; }
.env__date { margin: 12px 0 0; font-size: 1.1rem; color: #a97a48; letter-spacing: 0.12em; }
.env__venue { margin: 8px 0 0; font-size: 0.78rem; letter-spacing: 0.14em; color: rgba(91, 63, 160, 0.62); }

.env__pocket {
  position: absolute; left: 0; right: 0; bottom: 0; top: 28%;
  border-radius: 0 0 14px 14px;
  clip-path: polygon(0 0, 50% 52.4%, 100% 0, 100% 100%, 0 100%);
  background: linear-gradient(180deg, #efe7f9 0%, #e4daf2 100%);
  z-index: 3;
}
.env__flap {
  position: absolute; top: 0; left: 0; right: 0; height: 66%;
  clip-path: polygon(0 0, 100% 0, 100% 42%, 50% 100.6%, 0 42%);
  border-radius: 14px 14px 0 0;
  background: linear-gradient(180deg, #f6f0fc 0%, #e9dff5 100%);
  transform-origin: top center; z-index: 4;
  transition: transform 950ms cubic-bezier(0.45, 0.05, 0.25, 1), z-index 0s 430ms;
}
.gate.is-opening .env__flap { transform: rotateX(158deg); z-index: 2; }
.env__stamp {
  position: absolute; top: 9%; left: 9%; z-index: 5;
  width: 52px; height: 52px; border-radius: 50%;
  border: 1.5px dashed rgba(122, 92, 120, 0.55); color: rgba(122, 92, 120, 0.72);
  font-size: 0.72rem; letter-spacing: 0.06em; display: grid; place-items: center;
  transform: rotate(-14deg); transition: opacity 350ms ease;
}
.gate.is-opening .env__stamp, .gate.is-done .env__stamp { opacity: 0; }
.env__seal {
  position: absolute; left: 50%; top: 64%; z-index: 6; width: 62px; height: 62px;
  transform: translate(-50%, -50%);
  transition: transform 520ms cubic-bezier(0.34, 1.4, 0.4, 1), opacity 420ms ease 120ms;
}
.env__seal b {
  position: absolute; inset: 0; border-radius: 50%; display: grid; place-items: center;
  font-size: 0.82rem; font-weight: 500; color: #fdf3df;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.5), transparent 42%),
    radial-gradient(circle at 60% 70%, rgba(60, 40, 80, 0.55), transparent 60%),
    linear-gradient(135deg, #c89b6a 0%, #a97a48 58%, #8d5f34 100%);
  box-shadow: 0 8px 22px rgba(141, 95, 52, 0.45), inset 0 -3px 8px rgba(60, 34, 16, 0.4);
}
.env__seal em {
  position: absolute; inset: -5px; border-radius: 47% 53% 50% 50% / 52% 48% 52% 48%;
  background: linear-gradient(135deg, #b98850, #93683c); z-index: -1;
  animation: seal-breathe 2.8s ease-in-out infinite;
}
.gate.is-opening .env__seal { transform: translate(-50%, -50%) scale(1.75) rotate(16deg); opacity: 0; }

.gate__hint {
  position: absolute; bottom: max(11%, calc(env(safe-area-inset-bottom) + 34px));
  left: 0; right: 0; margin: 0; text-align: center; color: var(--brand-deep);
  letter-spacing: 0.2em; font-size: 0.86rem;
  opacity: 0; animation: gate-hint-in 900ms ease 1.25s forwards, gate-breathe 2.6s ease-in-out 2.2s infinite;
}
.gate.is-opening .gate__hint { opacity: 0 !important; transition: opacity 240ms ease; }
.gate__skip {
  position: absolute; top: max(16px, calc(env(safe-area-inset-top) + 14px)); right: 18px;
  border: 0; background: transparent; cursor: pointer; color: rgba(91, 63, 160, 0.55);
  font-size: 0.78rem; letter-spacing: 0.12em; padding: 8px 10px;
}
.gate__skip:active { color: var(--brand-deep); }

/* —— 拆信花舞：全屏粒子画布 + 心成形后的题字 —— */
.gate__fx {
  position: absolute; inset: 0; z-index: 6;
  width: 100%; height: 100%;
  pointer-events: none;
}
.gate__bloom {
  position: absolute; left: 0; right: 0; z-index: 7;
  top: calc(50% + clamp(96px, 26vh, 160px));
  margin: 0; text-align: center; pointer-events: none;
  color: var(--brand-deep); letter-spacing: 0.34em; text-indent: 0.34em;
  font-size: 0.86rem;
  opacity: 0; transform: translateY(10px);
  transition: opacity 700ms ease, transform 700ms ease;
}
.gate.is-bloom .gate__bloom { opacity: 0.9; transform: none; }
.gate.is-done .gate__bloom { opacity: 0; transition-duration: 320ms; }

@keyframes gate-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes gate-hint-in { from { opacity: 0; } to { opacity: 0.85; } }
@keyframes gate-breathe { 0%, 100% { opacity: 0.85; } 50% { opacity: 0.4; } }
@keyframes seal-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }

@media (prefers-reduced-motion: reduce) {
  .gate, .env, .env__letter, .env__flap, .env__seal, .env__stamp, .gate__bloom { transition-duration: 1ms !important; transition-delay: 0s !important; }
  .gate__fx { display: none; }
  .gate__kicker, .gate__hint { animation-duration: 1ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; }
  .env__seal em { animation: none; opacity: 0.6; }
  /* 弹幕留言降级为普通纵向列表 */
  .greetings-danmaku { min-height: 0; }
  .greetings-danmaku .greeting-item {
    position: static;
    max-width: none;
    white-space: normal;
    animation: none;
  }
  .greetings-danmaku .greeting-item strong { display: block; margin-right: 0; }
  .greetings-danmaku .greeting-item strong::after { content: ""; }
  .greetings-danmaku .greeting-item span { display: block; }
}
