/* ============================================================
   婚礼请帖 · 纸感留白微编辑风格
   设计系统参考 gc-minimal-zine-poster/references/style-system.md
   ============================================================ */

:root {
  /* 纸与墨 */
  --paper: #f5efe2;
  --paper-deep: #ece2cf;
  --ink: #2b2620;
  --ink-soft: #7a7164;

  /* 点缀色(默认,由 config.js 里的 accent 覆盖) */
  --accent: #e4572e;
  --accent-ink: #ffffff;

  /* 字体 */
  --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "SimSun", "STSong", serif;
  --mono: "SF Mono", "Menlo", "Consolas", "Courier New", monospace;

  --line: rgba(43, 38, 32, 0.14);
  --gutter: 24px;
}

* { box-sizing: border-box; }

/* hidden 属性必须真的隐藏:下面 .field / .location-row 等自带的 display
   会盖掉浏览器默认的 [hidden]{display:none},导致「用餐时段」「地址」这类
   留空的字段仍然显示出来。 */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 纸张颗粒噪点(纯 CSS 生成,不依赖图片) */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20000;
  opacity: 0.055;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

/* 微信分享卡片封面:放在屏幕外,保持 800×800 的渲染尺寸。
   不要用 display:none / visibility:hidden,否则微信会跳过这张图。 */
.share-cover {
  position: absolute;
  left: -9999px;
  top: 0;
  width: 800px;
  height: 800px;
  overflow: hidden;
  pointer-events: none;
}
.share-cover img {
  width: 800px;
  max-width: none;
  height: 800px;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block;
  font-family: var(--serif);
  font-size: 0.76rem;
  letter-spacing: 0.35em;
  text-indent: 0.35em;
  padding: 0.72rem 1.5rem;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { filter: brightness(0.94); }
.btn-outline { border-color: var(--accent); color: var(--accent); }
.btn-outline:hover { background: var(--accent); color: var(--accent-ink); }
.btn-block { width: 100%; }

/* ============================================================
   开场层
   ============================================================ */
.opening {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  overflow: hidden;
  transition: opacity 1s ease;
}
.opening.is-done { opacity: 0; pointer-events: none; }

/* ---------- 开场视频(9:16) ---------- */
.opening-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;        /* 默认完整显示,不裁切 */
  background: var(--paper);
  opacity: 0;
  z-index: 0;
  transition: opacity 0.8s ease;
}
.opening.has-video .opening-video { opacity: 1; }

/* 视频模式:隐藏纸感舞台和文字,只留按钮 */
.opening.has-video .stage,
.opening.has-video .opening-text,
.opening.has-video .opening-hint { display: none; }

.opening.has-video .opening-inner {
  position: relative;
  z-index: 2;
  justify-content: flex-end;
  height: 100%;
  padding-bottom: max(54px, calc(env(safe-area-inset-bottom) + 34px));
}

/* 顶部渐暗,让「跳过 / 声音」在浅色画面上也看得清 */
.opening.video-cover::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 130px;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(43, 38, 32, 0.26), rgba(43, 38, 32, 0));
}

/* 底部渐暗,保证按钮在浅色画面上也看得清(仅铺满模式需要) */
.opening.video-cover::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 36%;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(to top, rgba(43, 38, 32, 0.3), rgba(43, 38, 32, 0));
}

/* 铺满模式:按钮浮在画面上,用半透明纸底 + 毛玻璃 */
.opening.video-cover .open-btn {
  background: rgba(245, 239, 226, 0.86);
  border-color: transparent;
  color: var(--ink);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: 0 2px 14px rgba(43, 38, 32, 0.18);
}
.opening.video-cover .open-btn:hover {
  background: var(--paper);
  color: var(--ink);
}
/* 完整显示模式:按钮落在纸边留白上,用最简的描边样式 */
.opening.video-contain .open-btn {
  background: var(--paper);
  box-shadow: 0 1px 10px rgba(43, 38, 32, 0.08);
}
/* 播放期间按钮完全隐藏(必须写在 [disabled] 之后,否则被它盖掉) */
.opening.has-video .open-btn {
  transition: opacity 1.3s ease, transform 1.3s ease,
              background 0.25s ease, color 0.25s ease;
}
.opening.has-video .open-btn.is-hidden {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}
.opening.video-cover .skip-btn { color: rgba(255, 255, 255, 0.9); text-shadow: 0 1px 6px rgba(0, 0, 0, 0.35); }
.opening.video-contain .opening-loading { color: var(--ink-soft); text-shadow: none; }

/* 载入提示(视频缓冲时) */
.opening-loading {
  margin: 0 0 4px;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.4em;
  text-indent: 0.4em;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
  animation: hintPulse 1.8s ease-in-out infinite;
}

/* 跳过按钮淡出 */
.skip-btn { transition: opacity 0.6s ease; }
.skip-btn.is-hidden { opacity: 0; pointer-events: none; }

/* ---------- 声音开关(右上角,始终浮在最上层) ---------- */
.sound-btn {
  position: fixed;
  top: max(16px, calc(env(safe-area-inset-top) + 8px));
  right: 14px;
  z-index: 15000;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 50%;
  /* 柔和的纸色光晕:滚动时压在正文上也不会糊 */
  background: radial-gradient(circle at 50% 50%,
    rgba(245, 239, 226, 0.94) 0%,
    rgba(245, 239, 226, 0.94) 56%,
    rgba(245, 239, 226, 0) 76%);
  color: var(--ink-soft);
  cursor: pointer;
  opacity: 0.8;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.4s ease, color 0.4s ease;
}
.sound-btn[hidden] { display: none; }
.sound-btn:hover { opacity: 1; }
.sound-btn .ico {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sound-btn .ico-off { display: none; }
.sound-btn.is-muted .ico-on { display: none; }
.sound-btn.is-muted .ico-off { display: block; }
/* 铺满视频时换白色图标,避开浅色画面 */
body.video-cover-bg .sound-btn {
  background: none;
  color: #fff;
  opacity: 0.92;
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.45));
}

/* 自动播放被浏览器拦下时,轻轻呼吸一下提示"点我" */
.sound-btn.is-nudge { animation: soundNudge 2.6s ease-in-out infinite; }
@keyframes soundNudge {
  0%, 62%, 100% { opacity: 0.5; }
  72% { opacity: 1; }
  84% { opacity: 0.72; }
}

.opening-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 28px;
  text-align: center;
}

/* 舞台:钻 / 照片 / 下划线,纵向排列 */
.stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.mark { height: auto; }
.mark-diamond { width: 30px; color: var(--accent); }
.mark-rule { width: 104px; color: var(--ink-soft); }
/* 2×2 拼贴网格:照片被「处理」成纸感灰调 + 洗印白边 + 单一点缀色 */
.grid {
  display: grid;
  grid-template-columns: repeat(2, min(40vw, 150px));
  gap: 10px;
}
.tile {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 5px solid #fffdf7;
  background: #fffdf7;
  box-shadow: 0 1px 3px rgba(43, 38, 32, 0.16), 0 10px 24px rgba(43, 38, 32, 0.12);
  opacity: 0;
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0.85) sepia(0.22) contrast(1.06) brightness(0.98);
}
/* 每张照片叠加一层扫描颗粒 */
.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.12;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}
/* 角上的相框编号(唯一点缀色) */
.tile-no {
  position: absolute;
  right: 6px;
  bottom: 3px;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  color: var(--accent);
  z-index: 2;
}

/* 四张照片从四角向中心「拼接」成一张 */
.tile:nth-child(1) { transform: translate(-48px, -36px) rotate(-4deg) scale(0.9); }
.tile:nth-child(2) { transform: translate(48px, -36px) rotate(4deg) scale(0.9); }
.tile:nth-child(3) { transform: translate(-48px, 36px) rotate(3deg) scale(0.9); }
.tile:nth-child(4) { transform: translate(48px, 36px) rotate(-3deg) scale(0.9); }
.tile.is-in { transform: translate(0, 0) rotate(0deg) scale(1); opacity: 1; }

/* 手绘线条:描边动画 */
.opening .line {
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
  opacity: 0;
}
.opening.is-drawing .line {
  opacity: 1;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.4, 0, 0.2, 1), opacity 0s;
}

.opening-text { min-height: 92px; margin-top: 18px; }
.opening-date {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.3em;
  color: var(--ink-soft);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 1s ease, transform 1s ease;
}
.opening-names {
  margin: 8px 0 0;
  font-size: 1.5rem;
  letter-spacing: 0.18em;
  font-weight: 400;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 1s ease 0.15s, transform 1s ease 0.15s;
}
.opening-text.is-in .opening-date,
.opening-text.is-in .opening-names { opacity: 1; transform: none; }

.open-btn {
  margin-top: 24px;
  font-family: var(--serif);
  font-size: 0.82rem;
  letter-spacing: 0.5em;
  text-indent: 0.5em;
  padding: 0.8rem 1.8rem;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: opacity 0.5s ease, background 0.25s ease, color 0.25s ease;
}
.open-btn:hover { background: var(--ink); color: var(--paper); }
.open-btn.is-hidden { opacity: 0; pointer-events: none; }

.opening-hint {
  margin: 22px 0 0;
  font-size: 0.72rem;
  letter-spacing: 0.4em;
  color: var(--ink-soft);
  opacity: 0;
  animation: hintPulse 2.2s ease-in-out infinite;
}
@keyframes hintPulse { 0%, 100% { opacity: 0.15; } 50% { opacity: 0.7; } }

.skip-btn {
  position: absolute;
  top: max(18px, env(safe-area-inset-top));
  right: 58px;              /* 让出右上角给声音开关 */
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  cursor: pointer;
  padding: 6px 8px;
}

/* ============================================================
   主内容
   ============================================================ */
.main {
  position: relative;
  z-index: 2;               /* 位于飘落花瓣层之上 */
  max-width: 560px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- 开篇:钟楼 ---------- */
.opening-plate {
  width: min(100%, 262px);
  margin: 0 auto;
  padding: clamp(34px, 6.5vh, 68px) 0 0;
  text-align: center;
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 1.6s ease, transform 1.6s ease;
}
.opening-plate.is-in { opacity: 1; transform: none; }
.opening-plate img { width: 100%; height: auto; }
.opening-plate figcaption {
  /* 图片底部大半是淡出的纸色,图注往上收,贴住塔身收笔的地方 */
  margin: -44px 0 0;
  opacity: 0.72;
}
.plate-title {
  display: block;
  font-size: 0.94rem;
  letter-spacing: 0.42em;
  text-indent: 0.42em;      /* 补掉末字后的字距,保持视觉居中 */
  color: var(--ink);
}
.plate-en {
  display: block;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.46em;
  text-indent: 0.46em;
  color: var(--ink-soft);
}

/* 钟楼图底部本来就在淡出,紧接着的正文不用再留一大段空 */
.opening-plate + .hero { padding-top: clamp(18px, 4vh, 42px); }

@media (min-width: 640px) {
  .opening-plate { width: 300px; }
}

.section {
  padding: clamp(48px, 7.5vh, 92px) 0;
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}
.section.is-in { opacity: 1; transform: none; }
.section:first-child { padding-top: clamp(72px, 12vh, 130px); }
.section:last-child { padding-bottom: clamp(56px, 9vh, 110px); }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 26px;
}
.section-no {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 0.1em;
}
.section-title {
  font-size: 1.02rem;
  letter-spacing: 0.4em;
}
.section-head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
  transform: translateY(-4px);
}

/* ---------- 主请帖 hero ---------- */
.hero { text-align: center; }
.hero-names {
  margin: 0;
  font-size: clamp(1.5rem, 7.2vw, 2.4rem);
  font-weight: 400;
  letter-spacing: 0.14em;
  line-height: 1.5;
}
.hero-mark {
  width: clamp(70px, 18vw, 86px);
  margin: 22px auto 20px;
  color: var(--accent);
}
.hero-mark svg { width: 100%; height: auto; }
.hero-date {
  margin: 0;
  font-family: var(--mono);
  font-size: 1.02rem;
  letter-spacing: 0.22em;
}
.hero-lunar { margin: 6px 0 0; font-size: 0.82rem; color: var(--ink-soft); letter-spacing: 0.2em; }
.hero-venue { margin: 20px 0 0; font-size: 0.92rem; letter-spacing: 0.26em; }
.hero-greeting {
  margin: 30px auto 0;
  max-width: 26em;
  font-size: 0.9rem;
  color: var(--ink-soft);
  line-height: 2.1;
}

/* ---------- 卡片 ---------- */
.card {
  border: 1px solid var(--line);
  padding: 26px 24px;
  position: relative;
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 60%, #fff);
}

/* ---------- 地点 ---------- */
.location-row {
  display: flex;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
  align-items: baseline;
}
.location-row:last-of-type { border-bottom: none; }
.loc-label {
  flex: 0 0 44px;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--ink-soft);
  letter-spacing: 0.1em;
}
.loc-value { font-size: 0.92rem; letter-spacing: 0.06em; }
.location-card .btn { margin-top: 22px; }

/* ---------- 选择地图(底部弹层) ---------- */
.map-sheet {
  position: fixed;
  inset: 0;
  z-index: 16000;              /* 压住声音按钮,弹层期间是模态的 */
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(43, 38, 32, 0.26);
  opacity: 0;
  transition: opacity 0.26s ease;
}
.map-sheet[hidden] { display: none; }
.map-sheet.is-open { opacity: 1; }

.map-panel {
  width: 100%;
  max-width: 560px;
  padding: 20px var(--gutter) calc(18px + env(safe-area-inset-bottom, 0px));
  background: var(--paper);
  border-top: 1px solid var(--line);
  transform: translateY(16px);
  transition: transform 0.32s cubic-bezier(0.22, 0.8, 0.3, 1);
}
.map-sheet.is-open .map-panel { transform: none; }

.map-panel-title {
  margin: 0 0 10px;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.24em;
  text-indent: 0.24em;
  color: var(--ink-soft);
  text-align: center;
}

.map-option {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  width: 100%;
  padding: 16px 2px;
  font-family: var(--serif);
  font-size: 0.98rem;
  letter-spacing: 0.14em;
  color: var(--ink);
  background: none;
  border: none;
  border-top: 1px dashed var(--line);
  cursor: pointer;
  transition: color 0.2s ease;
}
.map-option:active,
.map-option:hover { color: var(--accent); }
.map-option .map-arrow {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--accent);
}

.map-cancel {
  width: 100%;
  margin-top: 12px;
  padding: 13px 0;
  font-family: var(--serif);
  font-size: 0.8rem;
  letter-spacing: 0.32em;
  text-indent: 0.32em;
  color: var(--ink-soft);
  background: none;
  border: 1px solid var(--line);
  cursor: pointer;
}

/* ---------- 流程 timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  display: flex;
  align-items: baseline;
  gap: 20px;
  padding: 13px 0;
  border-bottom: 1px dashed var(--line);
}
.timeline li:last-child { border-bottom: none; }
.timeline .t-time {
  flex: 0 0 56px;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--accent);
  letter-spacing: 0.08em;
}
.timeline .t-label { font-size: 0.95rem; letter-spacing: 0.1em; }

/* ---------- 表单 ---------- */
.field { display: block; margin-bottom: 20px; }
.field-label {
  display: block;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
  margin-bottom: 9px;
}
.field-label em { color: var(--accent); font-style: normal; }

input[type="text"],
input[type="tel"],
textarea {
  width: 100%;
  font-family: var(--serif);
  font-size: 0.95rem;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  padding: 6px 0;
  outline: none;
  border-radius: 0;
  transition: border-color 0.25s ease;
}
input[type="text"]:focus,
input[type="tel"]:focus,
textarea:focus { border-bottom-color: var(--accent); }
textarea { resize: vertical; line-height: 1.8; }
::placeholder { color: var(--ink-soft); opacity: 0.55; }

/* 人数 stepper */
.stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
}
.stepper-btn {
  width: 44px;
  height: 40px;
  border: none;
  background: transparent;
  color: var(--ink);
  font-size: 1.1rem;
  cursor: pointer;
  font-family: var(--serif);
}
.stepper-btn:hover { color: var(--accent); }
.stepper-val {
  min-width: 44px;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.95rem;
}

/* 用餐时段:午宴 / 晚宴 */
.meal-options { display: flex; flex-wrap: wrap; gap: 10px; }
.meal-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  font-size: 0.88rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  user-select: none;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.meal-option input { margin: 0; accent-color: var(--accent); }
.meal-option.is-on {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

/* 预约 chips */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  border: 1px solid var(--line);
  padding: 7px 14px;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}
.chip.is-on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.form .btn-block { margin-top: 8px; }
.form-note {
  margin: 18px 0 0;
  text-align: center;
  font-size: 0.74rem;
  color: var(--ink-soft);
  letter-spacing: 0.08em;
}

/* ---------- 结尾 ---------- */
.footer { text-align: center; }
.footer-names {
  margin: 0;
  font-size: 1.5rem;
  letter-spacing: 0.3em;
}
.footer-host { margin: 18px 0 0; font-family: var(--serif); font-size: 0.74rem; letter-spacing: 0.28em; text-indent: 0.28em; color: var(--ink-soft); }
.footer-thanks { margin: 16px 0 0; font-size: 0.82rem; color: var(--ink-soft); letter-spacing: 0.3em; }
.footer-date { margin: 34px 0 0; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.25em; color: var(--ink-soft); }
.footer-icp {
  margin: 26px 0 0;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  opacity: 0.72;
}
.footer-icp a { color: inherit; text-decoration: none; border-bottom: 1px solid currentColor; }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: max(40px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 11000;
  background: var(--ink);
  color: var(--paper);
  padding: 12px 22px;
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.toast.is-show { opacity: 1; }

/* 铺放方式由 config.openingVideoFit 决定 */
.opening.video-cover .opening-video { object-fit: cover; }

/* ============================================================
   背景氛围:刺桐花飘落 / 点击生心
   ============================================================ */
.petal-layer {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;               /* 在纸底之上、正文之下,花瓣会从卡片后面飘过 */
}

.petal {
  position: absolute;
  top: 0;
  width: var(--s, 16px);
  height: var(--s, 16px);
  color: var(--accent);
  will-change: transform;
  animation: petal-drop var(--dur, 13s) linear forwards;
}
.petal svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: currentColor;
  animation:
    petal-sway var(--sway, 3.6s) ease-in-out infinite alternate,
    petal-fade var(--dur, 13s) linear forwards;
}

@keyframes petal-drop {
  0%   { transform: translate3d(0, -14vh, 0); }
  100% { transform: translate3d(0, 114vh, 0); }
}
@keyframes petal-sway {
  0%   { transform: translateX(calc(var(--dx, 14px) * -1)) rotate(-32deg); }
  100% { transform: translateX(var(--dx, 14px)) rotate(38deg); }
}
@keyframes petal-fade {
  0%   { opacity: 0; }
  9%   { opacity: var(--o, 0.5); }
  82%  { opacity: var(--o, 0.5); }
  100% { opacity: 0; }
}

/* 点击背景的小爱心 */
.heart-layer {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 9000;
}
.heart {
  position: absolute;
  color: var(--accent);
  transform: translate(-50%, -50%);
  animation: heart-pop 0.62s ease-out forwards;
}
.heart svg { display: block; width: 100%; height: 100%; fill: currentColor; }

@keyframes heart-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.3) rotate(var(--rot, 0deg));
  }
  16% { opacity: 0.95; }
  55% {
    opacity: 0.85;
    transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% - 18px))
               scale(1) rotate(var(--rot, 0deg));
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% - 38px))
               scale(1.06) rotate(var(--rot, 0deg));
  }
}

/* 尊重减少动态偏好 */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .section,
  .opening-plate { opacity: 1; transform: none; transition: none; }
  .opening .line { opacity: 1; stroke-dashoffset: 0; }
  .tile { transition: none; }
  .tile.is-in { opacity: 1; transform: none; }
  .petal-layer { display: none; }
}
