/* ===========================================================================
   页面结构与组件（复古喜报风）
   换颜色 / 字体请改 theme.css，这里一般不用动。
   =========================================================================== */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--paper-deep);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.9;
  letter-spacing: 0.02em;
  overflow-x: hidden;
}

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

/* 有 hidden 属性的元素必须真的不显示（上面 img 的 display:block 会盖掉浏览器默认规则） */
[hidden] {
  display: none !important;
}

button,
input,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

.page {
  max-width: var(--max-width);
  margin: 0 auto;
  background: var(--paper);
  position: relative;
  overflow: hidden;
}

/* --------------------------------------------------------- 通用板块与标题 */

.section {
  padding: 34px var(--page-padding) 40px;
  background: var(--paper);
}

.section--paper {
  background: var(--paper-soft);
}

/* 方块大标题：拼音 + 四个红方块 */
.block-title {
  margin: 0 0 26px;
}

.block-title__py {
  display: block;
  text-align: center;
  font-family: var(--font-en);
  font-size: 16px;
  letter-spacing: 0.5em;
  color: var(--red);
  margin-bottom: 10px;
  text-indent: 0.5em;
}

.block-title__row {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.block-title__ch {
  width: 62px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--red);
  color: var(--on-red);
  font-family: var(--font-title);
  font-size: 33px;
  font-weight: 700;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(255, 250, 240, 0.35), inset 0 0 0 5px transparent;
}

/* 红方块里的细网格纹理，仿喜报 */
.block-title__ch::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.14) 1px, transparent 1px);
  background-size: 12px 12px;
  opacity: 0.5;
  pointer-events: none;
}

.block-title--plain .block-title__row {
  display: block;
}

/* ------------------------------------------------------------------- 封面 */

.cover {
  position: relative;
  padding: 26px var(--page-padding) 30px;
  background: var(--paper);
  text-align: center;
}

.cover__slogan {
  margin: 0;
  font-family: var(--font-title);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--red);
}

.cover__slogan-en {
  margin: 4px 0 0;
  font-family: var(--font-en);
  font-size: 11px;
  letter-spacing: 0.52em;
  color: var(--red);
  text-indent: 0.52em;
}

.cover__top {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.cover__big {
  margin: 18px 0 0;
  font-family: var(--font-title);
  font-size: 58px;
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--red-deep);
}

.cover__big-en {
  margin: 6px 0 14px;
  font-family: var(--font-en);
  font-size: 13px;
  letter-spacing: 0.28em;
  color: var(--red);
  text-indent: 0.28em;
}

/* 主图舞台：红白斜纹 + 人像 */
.cover__stage {
  position: relative;
  margin: 0 auto;
  padding-top: 10px;
  overflow: hidden;
}

.cover__stripes {
  position: absolute;
  left: -6%;
  right: -6%;
  top: 14%;
  bottom: 12%;
  background: repeating-linear-gradient(
    115deg,
    var(--red) 0 26px,
    rgba(255, 255, 255, 0) 26px 74px
  );
  opacity: calc(0.92 * var(--stripe-opacity));
}

/* 两枚竖排英文水印：分列照片左右两侧的留白里，整枚完整露出 */
.cover__wm {
  position: absolute;
  z-index: 1;
  width: 220px;
  height: 34px;
  line-height: 34px;
  text-align: center;
  white-space: nowrap;
  font-family: var(--font-en);
  font-weight: 700;
  font-size: 30px;
  letter-spacing: 0.14em;
  color: transparent;
  /* 米白描边 + 淡红晕：压在红斜纹上看得见，落在米色纸上也有淡淡的影子 */
  -webkit-text-stroke: 1.2px rgba(253, 247, 236, 0.92);
  text-shadow: 0 0 3px rgba(122, 16, 19, 0.6), 0 0 1px rgba(122, 16, 19, 0.55);
  pointer-events: none;
}

.cover__wm--1 {
  left: -93px; /* 视觉中心正好落在左侧留白中间 */
  right: auto;
  top: calc(50% - 17px);
  transform: rotate(-90deg);
}

.cover__wm--2 {
  left: calc(100% - 127px); /* 视觉中心正好落在右侧留白中间 */
  right: auto;
  top: calc(50% - 17px);
  transform: rotate(90deg);
}

.cover__photo {
  position: relative;
  z-index: 2;
  width: 100%;
  max-height: 74vh;
  object-fit: contain;
  object-position: bottom center;
  filter: drop-shadow(0 8px 18px rgba(60, 20, 20, 0.25));
}

.cover__photo.is-empty {
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: rgba(248, 243, 232, 0.72);
  border: 1px dashed var(--line);
  color: var(--red);
  font-size: 13px;
  letter-spacing: 0.1em;
  padding: 20px;
}

/* 封面舞台：背景层 + 人物层（人物会飘进来） */
.cover__scene {
  position: relative;
  z-index: 2;
  width: 88%;
  max-width: 430px;
  margin: 0 auto;
  aspect-ratio: 2 / 3;
  max-height: 74vh;
  overflow: hidden;
  border-radius: 3px;
  background: #0d1218;
  box-shadow: 0 16px 34px rgba(45, 12, 12, 0.32);
  opacity: 0;
  transition: opacity 200ms ease-out;
}

.cover__scene.is-ready {
  opacity: 1;
}

.cover__layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.cover__layer--bg {
  z-index: 1;
}

.cover__layer--soft {
  z-index: 2;
  opacity: 1;
  transition: opacity var(--focus-dur, 1200ms) ease-out;
}

.cover__layer--soft.is-off {
  opacity: 0;
}

.cover__layer--people {
  z-index: 3;
  opacity: 0;
  transform: translate3d(var(--px, 0px), var(--py, 0px), 0) rotate(var(--pr, 0deg))
    scale(var(--ps, 1));
  transition:
    transform var(--dur, 1800ms) cubic-bezier(0.16, 0.84, 0.28, 1),
    opacity var(--fade, 760ms) ease-out;
  will-change: transform, opacity;
}

.cover__layer--people.is-in {
  opacity: 1;
  transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
}

@media (prefers-reduced-motion: reduce) {
  .cover__layer--people {
    opacity: 1;
    transform: none;
    transition: none;
    animation: none;
  }
}

.cover__strip {
  margin: 16px 0 14px;
  font-family: var(--font-en);
  font-size: 15px;
  letter-spacing: 0.32em;
  color: var(--red);
  text-indent: 0.32em;
}

/* 底部信息框 */
.cover__box {
  display: flex;
  align-items: stretch;
  border: 2px solid var(--red);
  padding: 4px;
  gap: 4px;
}

.cover__box-title {
  flex: none;
  width: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--red);
  /* 四个字排成两行：吾家 / 有喜 */
  white-space: pre-line;
  text-indent: 0.06em;
  color: var(--on-red);
  font-family: var(--font-title);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.15;
}

.cover__box-body {
  flex: 1;
  padding: 8px 10px;
  text-align: left;
  border-left: 1px solid var(--line);
}

.cover__couple {
  margin: 0;
  font-family: var(--font-title);
  font-size: 18px;
  letter-spacing: 0.06em;
  color: var(--red-deep);
}

.cover__box-line {
  margin: 2px 0 0;
  font-family: var(--font-title);
  font-size: 17px;
  letter-spacing: 0.24em;
  color: var(--red);
}

.cover__datetime {
  margin: 6px 0 0;
  font-family: var(--font-en);
  font-size: 14px;
  letter-spacing: 0.08em;
  color: var(--ink);
}

.cover__music-hint {
  display: none;
  margin: 16px 0 0;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-indent: 0.2em;
  color: var(--ink-soft);
  animation: hintPulse 2.2s ease-in-out infinite;
}

.cover__music-hint.is-on {
  display: block;
}

@keyframes hintPulse {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

.cover__scroll {
  margin-top: 14px;
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--ink-soft);
  text-indent: 0.3em;
  animation: floatDown 2.6s ease-in-out infinite;
}

@keyframes floatDown {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.65;
  }
  50% {
    transform: translateY(6px);
    opacity: 1;
  }
}

/* ---------------------------------------------------------------- 邀请函 */

.invite__text {
  margin: 0;
  font-family: var(--font-title);
  font-size: 16px;
  line-height: 2.2;
  text-align: center;
  color: var(--ink);
}

.invite__text span {
  display: block;
}

.invite__sign {
  margin: 22px 0 0;
  text-align: center;
  font-family: var(--font-title);
  font-size: 17px;
  letter-spacing: 0.16em;
  color: var(--red-deep);
}

/* ------------------------------------------------------------- 照片堆叠 */

.photo-stack {
  display: block;
}

.photo-stack__item {
  position: relative;
  margin: 0 0 6px;
  border: 2px solid var(--line);
  padding: 6px;
  background: var(--paper-soft);
  cursor: zoom-in;
}

.photo-stack__item img {
  width: 100%;
  display: block;
}

.photo-stack__item.is-empty {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--paper-deep), var(--paper-soft));
  color: var(--red);
  font-family: var(--font-title);
  font-size: 15px;
  letter-spacing: 0.16em;
}

.photo-stack__caption {
  margin: 4px 0 26px;
  font-family: var(--font-en);
  font-size: 11px;
  letter-spacing: 0.26em;
  color: var(--ink-soft);
  text-align: center;
  word-spacing: 1.6em;
}

/* ------------------------------------------------------------- 婚宴时间 */

.time-card {
  position: relative;
  margin-bottom: 28px;
  min-height: 470px;
  border: 2px solid var(--line);
  padding: 6px;
  background: var(--paper-soft);
  overflow: hidden;
}

.time-card__bg {
  position: absolute;
  inset: 6px;
  width: calc(100% - 12px);
  height: calc(100% - 12px);
  object-fit: cover;
  display: block;
  background: var(--paper-deep);
}

.time-card__panel {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 76%;
  top: 46%;
  background: rgba(248, 243, 232, 0.94);
  padding: 12px 12px 14px;
  box-shadow: 0 6px 18px rgba(70, 30, 20, 0.18);
}

/* 没有照片时的兜底底色 */
.time-card.is-empty {
  background: linear-gradient(160deg, var(--red-deep), var(--red));
}

.time-card__ym {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 6px 6px;
  font-family: var(--font-title);
  color: var(--red);
}

.time-card__ym span:first-child {
  font-size: 22px;
  letter-spacing: 0.06em;
}

.time-card__ym span:last-child {
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
}

.cal__head {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--red-deep);
  border-radius: var(--radius-pill);
  padding: 4px 0;
  margin-bottom: 6px;
}

.cal__head span {
  text-align: center;
  font-size: 11px;
  color: var(--on-red);
}

.cal__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px 0;
}

.cal__cell {
  text-align: center;
  font-family: var(--font-en);
  font-size: 12.5px;
  color: var(--ink);
  line-height: 1.9;
  position: relative;
}

.cal__cell--empty {
  visibility: hidden;
}

.cal__cell--today {
  color: transparent;
}

.cal__cell--today::after {
  content: attr(data-day);
  position: absolute;
  inset: 0;
  color: var(--on-red);
  font-weight: 700;
  background: var(--red);
  border-radius: 50% 50% 50% 50% / 45% 45% 55% 55%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(0.92);
}

/* 倒计时：四个红方块 */

.countdown {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.countdown__item {
  width: 76px;
  padding: 10px 0 8px;
  background: var(--red);
  color: var(--on-red);
  border-radius: var(--radius);
  text-align: center;
}

.countdown__num {
  font-family: var(--font-en);
  font-size: 26px;
  line-height: 1.1;
}

.countdown__label {
  font-size: 11px;
  letter-spacing: 0.16em;
  opacity: 0.9;
  margin-top: 2px;
}

.countdown__done {
  font-family: var(--font-title);
  font-size: 17px;
  color: var(--red-deep);
  letter-spacing: 0.1em;
  margin: 0;
}

/* ------------------------------------------------------------- 不见不散 */

.meeting__note {
  margin: 14px 0 18px;
  text-align: center;
  font-size: 13px;
  color: var(--ink-soft);
}

/* ------------------------------------------------------------------ 按钮 */

.info-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  flex: 1 1 120px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--red);
  background: transparent;
  color: var(--red-deep);
  font-size: 14px;
  letter-spacing: 0.08em;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.btn:active {
  transform: scale(0.98);
  opacity: 0.85;
}

.btn--red {
  background: var(--red-bright);
  border-color: var(--red-bright);
  color: #fff;
}

.btn--ghost {
  background: transparent;
}

/* ---------------------------------------------------------------- 留言板 */

.guestbook__tip {
  margin: 0 0 16px;
  text-align: center;
  font-size: 13px;
  color: var(--ink-soft);
}

.guestbook__form {
  display: grid;
  gap: 10px;
}

.field {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--paper-soft);
  outline: none;
}

.field:focus {
  border-color: var(--red);
}

.field--select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%238b6a5a' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  color: var(--ink);
  font-size: 14px;
}

textarea.field {
  min-height: 92px;
  resize: vertical;
  line-height: 1.7;
}

.guestbook__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--ink-soft);
}

.guestbook__status {
  min-height: 18px;
}

.guestbook__list {
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.guestbook__item {
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--paper-soft);
  border: 1px solid var(--line-soft);
}

.guestbook__item-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.guestbook__name {
  font-size: 14px;
  color: var(--red-deep);
}

.guestbook__time {
  font-size: 11px;
  color: var(--ink-soft);
}

.guestbook__text {
  margin: 0;
  font-size: 14px;
  color: var(--ink);
  word-break: break-word;
}

.guestbook__empty {
  margin-top: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--ink-soft);
}

/* -------------------------------------------------------- SAVE THE DATE */

.ending {
  position: relative;
  overflow: hidden;
  color: #fff;
  text-align: center;
}

.ending__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* 竖版底图：宽屏时露出中间偏下（人物）这一段，手机上是整张 */
  object-position: 50% 72%;
}

.ending__bg.is-empty {
  background: var(--red-deep);
}

.ending__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(70, 10, 12, 0.3),
    rgba(70, 10, 12, 0.48) 45%,
    rgba(55, 8, 10, 0.72)
  );
}

.ending__inner {
  position: relative;
  z-index: 2;
  padding: 52px var(--page-padding) 46px;
}

.ending__title {
  margin: 0 0 30px;
  font-family: var(--font-en);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.24em;
  text-indent: 0.24em;
}

.ending__label {
  margin: 22px 0 6px;
  font-family: var(--font-en);
  font-size: 15px;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  opacity: 0.92;
}

.ending__value {
  margin: 0;
  font-family: var(--font-title);
  font-size: 16px;
  line-height: 1.9;
  letter-spacing: 0.04em;
}

.ending__value--sm {
  font-size: 14px;
  opacity: 0.9;
}

.ending__map {
  display: block;
  margin: 24px 0 6px;
  padding: 22px 16px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #f6f1e6, #e6ddcb);
  color: var(--red-deep);
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
}

.ending__pin {
  display: block;
  font-size: 24px;
  line-height: 1;
  margin-bottom: 6px;
}

.ending__map-text {
  font-size: 13px;
  letter-spacing: 0.12em;
}

.ending__phones {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.ending__phones .btn {
  border-color: rgba(255, 255, 255, 0.4);
}

.ending__thanks {
  margin: 30px 0 0;
  font-family: var(--font-title);
  font-size: 15px;
  letter-spacing: 0.2em;
  opacity: 0.9;
}

/* ------------------------------------------------------------ 音乐按钮 */

.music-btn {
  position: fixed;
  right: max(14px, calc(50% - var(--max-width) / 2 + 14px));
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(248, 243, 232, 0.92);
  color: var(--red);
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.music-btn.is-ready {
  display: flex;
}

.music-btn__icon {
  font-size: 16px;
}

.music-btn.is-playing .music-btn__icon {
  animation: spin 3.4s linear infinite;
}

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

/* ------------------------------------------------------------ 大图预览 */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(20, 10, 10, 0.94);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lightbox.is-open {
  display: flex;
}

.lightbox img {
  max-width: 100%;
  max-height: 88vh;
}

/* -------------------------------------------------------- 设计模式面板 */

.design-panel {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 70;
  display: none;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  align-items: center;
}

.design-panel.is-open {
  display: flex;
}

.design-panel__label {
  font-size: 11px;
  color: var(--ink-soft);
  letter-spacing: 0.16em;
  padding: 0 4px;
  white-space: nowrap;
}

.swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
}

.swatch.is-active {
  border-color: var(--ink);
}

.swatch[data-theme-value="redposter"] {
  background: linear-gradient(135deg, #9e1b1e, #f2ead9);
}

.swatch[data-theme-value="night"] {
  background: linear-gradient(135deg, #17110f, #d8b877);
}

.swatch[data-theme-value="celadon"] {
  background: linear-gradient(135deg, #33604f, #eef2ea);
}

/* --------------------------------------------------------------- 入场动画 */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ------------------------------------------------------------------ 宽屏 */

@media (min-width: 640px) {
  body {
    background: #d9cfbb;
  }

  .page {
    box-shadow: 0 0 60px rgba(70, 35, 25, 0.28);
    min-height: 100vh;
  }
}

/* ===========================================================================
   翻屏结构：一屏一张，可自动翻页（逻辑在 js/app.js 的 initDeck）
   =========================================================================== */

.deck {
  position: relative;
  height: 100vh;
  height: 100svh;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  background: var(--paper-deep);
  /* 隐藏滚动条：桌面端也不会有 15px 的偏心，手机上照旧能滑动 */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.deck::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.slide {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20px var(--page-padding);
  background: var(--paper);
  overflow: visible;
  color: var(--ink);
  text-align: center;
}

.slide__inner {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
}

/* ---- 第 1 屏：封面（版式保持原样，只把内容压进一屏） ---- */

.slide--cover {
  padding: 14px var(--page-padding) 10px;
  /* 封面照片的高度 = 屏幕剩下的全部空间，保证整屏不超出一页 */
  --cover-photo-h: clamp(190px, calc(100svh - 375px), 470px);
}

.slide--cover .cover {
  padding: 0;
}

.slide--cover .cover__top {
  padding-bottom: 6px;
}

.slide--cover .cover__big {
  margin: 6px 0 0;
  font-size: 38px;
}

.slide--cover .cover__big-en {
  margin: 3px 0 6px;
  font-size: 12px;
}

.slide--cover .cover__stage {
  padding-top: 4px;
}

.slide--cover .cover__scene {
  /* 宽度跟着"可用高度"走，保证框和照片一样是 2:3，照片整张显示且没有黑边 */
  width: min(88%, calc(var(--cover-photo-h) * 2 / 3));
  margin: 0 auto;
  max-height: var(--cover-photo-h);
}

.slide--cover .cover__photo {
  max-height: var(--cover-photo-h);
}

/* 婚宴时间：日历下面那行日期 */
.banquet__datetime {
  margin: -6px 0 10px;
  text-align: center;
  font-family: var(--font-title);
  font-size: 18px;
  letter-spacing: 0.06em;
  color: var(--red);
}

/* 封面照整张显示（不裁切），两侧留一点夜色底 */
.slide--cover .cover__layer {
  object-fit: contain;
}

.slide--cover .cover__wm {
  font-size: 26px;
  letter-spacing: 0.12em;
  -webkit-text-stroke-width: 1.1px;
}

.slide--cover .cover__strip {
  margin: 8px 0 6px;
  font-size: 12px;
}

.slide--cover .cover__box {
  margin-bottom: 4px;
}

.slide--cover .cover__music-hint {
  margin-top: 2px;
}

.slide--cover .cover__scroll {
  margin-top: 4px;
}

/* ---- 第 2 屏：我们结婚啦（两个大头贴 + 囍 + 名字 + 文案） ---- */

.rounds {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 6px;
}

.rounds__item {
  width: 38%;
  max-width: 150px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  overflow: hidden;
  background: var(--paper-soft);
  border: 3px solid var(--on-red);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-in;
}

.rounds__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rounds__item.is-empty {
  border: 2px dashed var(--line);
  cursor: default;
}

.rounds__item.is-empty span {
  font-size: 11px;
  line-height: 1.6;
  color: var(--red);
  padding: 0 10px;
  letter-spacing: 0.04em;
}

.xi-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 8px 0 4px;
}

.xi-row__name {
  /* 左右各占一半，让中间的「囍」永远落在屏幕正中央 */
  flex: 1 1 0;
  min-width: 0;
  font-family: var(--font-title);
  font-size: 20px;
  font-weight: 700;
  color: var(--red-deep);
  letter-spacing: 0.06em;
  white-space: pre-wrap;
}

.xi-row__name:first-child {
  text-align: right;
}

.xi-row__name:last-child {
  text-align: left;
}

.xi-row__xi {
  font-family: var(--font-title);
  font-size: 44px;
  font-weight: 700;
  line-height: 1;
  color: var(--red);
}

.couple-lines {
  margin-top: 10px;
}

.couple-lines p {
  margin: 0 0 3px;
  font-family: var(--font-title);
  font-size: 14.5px;
  font-weight: 700;
  color: var(--red-deep);
  letter-spacing: 0.02em;
}

/* ---- 第 3 屏：婚宴时间（压缩到一屏） ---- */

.slide--banquet .block-title {
  margin-bottom: 12px;
}

.slide--banquet .time-card {
  /* 参考图那种版式：照片通栏，日历卡压在照片下沿、并向纸面延伸一点 */
  min-height: 0;
  height: auto;
  margin-bottom: 16px;
  border: 0;
  padding: 0;
  background: transparent;
  overflow: visible;
}

.slide--banquet .time-card__bg {
  position: static;
  width: 100%;
  height: 34vh;
  min-height: 200px;
  object-fit: cover;
}

.slide--banquet .time-card.is-empty .time-card__bg {
  background: linear-gradient(160deg, var(--red-deep), var(--red));
}

.slide--banquet .time-card__panel {
  position: relative;
  left: auto;
  top: auto;
  bottom: auto;
  transform: none;
  width: 86%;
  margin: -22% auto 0;
  padding: 10px 12px 12px;
  background: rgba(248, 243, 232, 0.95);
  box-shadow: 0 8px 22px rgba(70, 30, 20, 0.2);
}

.slide--banquet .time-card__ym span:first-child {
  font-size: 18px;
}

.slide--banquet .time-card__ym span:last-child {
  font-size: 32px;
}

.slide--banquet .cal__cell {
  font-size: 11.5px;
  line-height: 1.7;
}

/* ---- 第 4 屏：不见不散（两张并排，一左一右，互不重叠） ---- */

.slide--meeting .block-title {
  margin-bottom: 12px;
}

.meet-photos {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
}

.meet-photos__item {
  flex: none;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  overflow: hidden;
  border: 2px solid var(--line);
  background: var(--paper-soft);
  box-shadow: 0 6px 16px rgba(70, 30, 20, 0.12);
  cursor: zoom-in;
}

.meet-photos__item img {
  width: 100%;
  height: auto;
  max-height: 32vh;
  object-fit: cover;
  display: block;
}

.meet-photos__item.is-empty {
  min-height: 150px;
  text-align: center;
  padding: 0 10px;
  background: linear-gradient(160deg, var(--paper-deep), var(--paper-soft));
  color: var(--red);
  font-family: var(--font-title);
  font-size: 13px;
  letter-spacing: 0.1em;
  cursor: default;
}

.slide--meeting .meeting__venue {
  margin: 14px 0 2px;
  text-align: center;
  font-family: var(--font-title);
  font-size: 17px;
  letter-spacing: 0.06em;
  color: var(--red);
}

.slide--meeting .meeting__note {
  margin: 6px 0 8px;
}

.slide--meeting .info-actions {
  margin-top: 6px;
  /* 三个导航按钮均分一行，避免最后一个单独掉到第二行 */
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.slide--meeting .info-actions .btn {
  flex: none;
  padding: 11px 4px;
  font-size: 13px;
  letter-spacing: 0.02em;
}

/* 不见不散：竖版流程（一个时间点一行 + 简笔画图标 + 虚线串联） */
.flow {
  position: relative;
  margin: 14px 0 0;
}

.flow__item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 6px 9px 44px;
  text-align: left;
}

.flow__item::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  border-left: 1.5px dashed rgba(158, 27, 30, 0.38);
}

.flow__item--first::before {
  top: 50%;
}

.flow__item--last::before {
  bottom: 50%;
}

.flow__icon {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: var(--paper-soft);
}

.flow__icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: var(--red);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.flow__time {
  flex: none;
  min-width: 58px;
  font-family: var(--font-en);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--red);
}

.flow__text {
  font-family: var(--font-title);
  font-size: 15px;
  letter-spacing: 0.04em;
  color: var(--ink);
}

/* 角落的两枚小简笔画：一颗小星星 + 一个小闪光 */
.flow__spark {
  position: absolute;
  pointer-events: none;
  opacity: 0.6;
}

.flow__spark--a {
  width: 15px;
  height: 15px;
  right: 3px;
  top: 6px;
  fill: none;
  stroke: var(--red);
  stroke-width: 1.5;
  stroke-linecap: round;
}

.flow__spark--b {
  width: 18px;
  height: 18px;
  right: 13px;
  bottom: 4px;
  fill: rgba(158, 27, 30, 0.34);
  stroke: none;
}

/* 矮一点的手机（iPhone SE 这类）：照片和留白都收一点，保证不超出一屏 */
@media (max-height: 720px) {
  .slide--meeting .block-title {
    margin-bottom: 8px;
  }

  .meet-photos {
    gap: 8px;
  }

  .meet-photos__item {
    padding: 4px;
  }

  .meet-photos__item img {
    max-height: 24vh;
  }

  .slide--meeting .meeting__venue {
    margin: 8px 0 0;
    font-size: 15px;
  }

  .slide--meeting .meeting__note {
    margin: 4px 0 6px;
    font-size: 12px;
  }

  .flow {
    margin-top: 8px;
  }

  .flow__item {
    padding: 6px 4px 6px 40px;
  }

  .flow__item::before {
    left: 13px;
  }

  .flow__icon {
    width: 27px;
    height: 27px;
  }

  .flow__icon svg {
    width: 15px;
    height: 15px;
  }

  .flow__time {
    min-width: 52px;
    font-size: 15px;
  }

  .flow__text {
    font-size: 14px;
  }

  /* 封面在矮屏上也收一收，把空间留给照片 */
  .slide--cover {
    --cover-photo-h: clamp(180px, calc(100svh - 335px), 470px);
  }

  .slide--cover .cover__slogan {
    font-size: 18px;
  }

  .slide--cover .cover__box-title {
    width: 78px;
    font-size: 22px;
  }

  .slide--cover .cover__couple {
    font-size: 16px;
  }

  .slide--cover .cover__box-line {
    font-size: 15px;
    letter-spacing: 0.18em;
  }

  .slide--cover .cover__datetime {
    font-size: 13px;
  }

  .slide--cover .cover__strip {
    margin: 6px 0 4px;
  }
}

/* ---- 第 5 屏：封底（整屏照片 + 赴宴报名） ---- */

.slide--ending {
  padding: 0;
  color: #fff;
  background: var(--red-deep);
  /* 内容压到底部，把画面上方留给两个人（脸不会被表单挡住） */
  justify-content: flex-end;
}

.slide--ending .ending__inner {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 30px var(--page-padding) calc(34px + env(safe-area-inset-bottom, 0px));
  color: #fff;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.55);
}

.slide--ending .ending__title {
  margin-bottom: 12px;
  font-size: 20px;
}

.slide--ending .ending__label {
  margin: 12px 0 4px;
  font-size: 14px;
}

.slide--ending .ending__value {
  font-size: 15px;
  line-height: 1.8;
}

.slide--ending .ending__phones {
  margin-top: 12px;
}

.slide--ending .ending__thanks {
  margin-top: 14px;
  font-size: 14px;
}

/* 赴宴报名（姓名 + 出席人数） */

.rsvp {
  margin-top: 16px;
}

.rsvp__tip {
  margin: 0 0 8px;
  font-size: 13px;
  letter-spacing: 0.06em;
  opacity: 0.92;
}

.rsvp__form {
  display: grid;
  gap: 8px;
}

.field--dark {
  background: rgba(255, 252, 246, 0.94);
  border-color: rgba(255, 255, 255, 0.55);
  color: #3a2a25;
}

.field--dark::placeholder {
  color: rgba(58, 42, 37, 0.5);
}

.rsvp__btn {
  width: 100%;
  border-color: var(--red-bright);
  background: var(--red-bright);
  color: #fff;
}

.rsvp__status {
  min-height: 16px;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: #ffe7cf;
}

/* ---- 第 3 屏：吾家有喜（上大图 + 一行小字 + 下两张并排） ---- */

.slide--gallery .block-title {
  margin-bottom: 14px;
}

.gallery-top {
  width: 100%;
  overflow: hidden;
  border: 2px solid var(--line);
  background: var(--paper-soft);
  cursor: zoom-in;
}

.gallery-top img {
  width: 100%;
  height: 30vh;
  object-fit: cover;
}

.gallery-top.is-empty {
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--paper-deep), var(--paper-soft));
  color: var(--red);
  font-family: var(--font-title);
  font-size: 14px;
  letter-spacing: 0.12em;
  cursor: default;
}

.slide--gallery .photo-stack__caption {
  margin: 12px 0;
  /* 中文小字一行居中，字距别拉太开 */
  white-space: pre-line;
  word-spacing: normal;
  letter-spacing: 0.16em;
  text-indent: 0.16em;
  font-size: 13px;
  line-height: 1.9;
  color: var(--ink-soft);
}

.gallery-pair {
  display: flex;
  gap: 12px;
}

.gallery-pair__item {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  border: 2px solid var(--line);
  background: var(--paper-soft);
  cursor: zoom-in;
}

.gallery-pair__item img {
  width: 100%;
  height: 30vh;
  object-fit: cover;
}

.gallery-pair__item.is-empty {
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 10px;
  background: linear-gradient(160deg, var(--paper-deep), var(--paper-soft));
  color: var(--red);
  font-family: var(--font-title);
  font-size: 13px;
  letter-spacing: 0.1em;
  cursor: default;
}

/* ---- 出席人数：好看版下拉（按钮 + 底部弹出数字面板） ---- */

.picker {
  position: relative;
}

.picker__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  font-size: 14px;
  letter-spacing: 0.04em;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.picker__trigger:focus-visible {
  outline: none;
  border-color: var(--red-bright);
  box-shadow: 0 0 0 3px rgba(200, 32, 40, 0.16);
}

.picker__value {
  color: #3a2a25;
}

.picker__trigger.is-empty .picker__value {
  color: rgba(58, 42, 37, 0.5);
}

.picker__chev {
  flex: none;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: var(--red-bright);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.22s ease;
}

.picker__trigger.is-open .picker__chev {
  transform: rotate(180deg);
}

/* 原来的原生下拉还在页面上（提交时用），只是藏起来 */
.picker__native {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.sheet {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sheet[hidden] {
  display: none;
}

.sheet__mask {
  position: absolute;
  inset: 0;
  background: rgba(34, 10, 10, 0.48);
  touch-action: none;
  animation: sheetFade 0.2s ease-out;
}

.sheet__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  padding: 16px var(--page-padding) calc(16px + env(safe-area-inset-bottom, 0px));
  background: var(--paper);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -12px 34px rgba(40, 10, 10, 0.35);
  animation: sheetUp 0.26s cubic-bezier(0.16, 0.84, 0.28, 1);
}

.sheet__title {
  margin: 0 0 4px;
  text-align: center;
  font-family: var(--font-title);
  font-size: 16px;
  letter-spacing: 0.12em;
  color: var(--red-deep);
}

.sheet__title::after {
  content: "";
  display: block;
  width: 42px;
  height: 2px;
  margin: 8px auto 12px;
  background: var(--line);
  border-radius: 2px;
}

.sheet__grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 9px;
  margin-bottom: 14px;
}

.sheet__num {
  padding: 12px 0;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--paper-soft);
  color: var(--red-deep);
  font-family: var(--font-en);
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.14s ease, background 0.18s ease, border-color 0.18s ease,
    color 0.18s ease;
}

.sheet__num:active {
  transform: scale(0.94);
}

.sheet__num.is-on {
  background: var(--red-bright);
  border-color: var(--red-bright);
  color: #fff;
  box-shadow: 0 6px 16px rgba(200, 32, 40, 0.28);
}

.sheet__cancel {
  width: 100%;
  padding: 11px 0;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  font-size: 14px;
  letter-spacing: 0.14em;
  font-family: inherit;
  cursor: pointer;
}

@keyframes sheetUp {
  from {
    transform: translateY(14%);
    opacity: 0.5;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

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