/* ========================================================
   订婚喜帖 · 样式表 (Zhao Yuhao & Chen Jie Engagement Invitation)
   Design System: Traditional Elegance meets Modern Romantic Luxury
   ======================================================== */

:root {
  --primary-red: #9e1d28;
  --deep-wine: #6e111a;
  --burgundy: #4a0d13;
  --accent-gold: #d4af37;
  --bright-gold: #f5d77f;
  --pale-gold: #fcf6e6;
  --cream-bg: #fffbf5;
  --warm-card: rgba(255, 255, 255, 0.94);
  --text-primary: #2d1a1b;
  --text-secondary: #7d5a5c;
  --text-muted: #a8898b;
  --border-gold: rgba(212, 175, 55, 0.35);
  --shadow-warm: 0 12px 36px rgba(110, 17, 26, 0.12);
  --shadow-gold: 0 4px 20px rgba(212, 175, 55, 0.25);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 8px;
  --font-serif: "Songti SC", "STSong", "Noto Serif SC", "SimSun", Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background: #2b080c;
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  position: relative;
  overflow-x: hidden;
}

/* Background canvas for petals */
#petals-canvas, #confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 99;
}

#confetti-canvas {
  z-index: 1000;
}

/* Outer Desktop Frame */
.page-wrapper {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  background: var(--cream-bg);
  position: relative;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ========================================================
   1. 封蜡启封仪式 (ENVELOPE SCREEN)
   ======================================================== */
.envelope-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, #8a1722 0%, #48090f 100%);
  z-index: 999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 24px;
  transition: opacity 0.8s ease, transform 0.8s ease, visibility 0.8s;
}

.envelope-overlay.opened {
  opacity: 0;
  visibility: hidden;
  transform: scale(1.08);
  pointer-events: none;
}

.envelope-container {
  width: 100%;
  max-width: 380px;
  background: linear-gradient(135deg, #a61f2c 0%, #7d131d 100%);
  border: 1px solid rgba(245, 215, 127, 0.4);
  border-radius: 20px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), inset 0 0 20px rgba(255, 255, 255, 0.1);
  padding: 32px 24px;
  text-align: center;
  position: relative;
  animation: floatUp 0.8s ease-out;
}

.envelope-border-ornament {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  bottom: 12px;
  border: 1px dashed rgba(245, 215, 127, 0.4);
  border-radius: 14px;
  pointer-events: none;
}

.envelope-header-tag {
  display: inline-block;
  padding: 4px 16px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(245, 215, 127, 0.5);
  border-radius: 50px;
  font-family: var(--font-serif);
  color: var(--bright-gold);
  font-size: 0.85rem;
  letter-spacing: 3px;
  margin-bottom: 20px;
}

.envelope-title {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  color: #fff;
  letter-spacing: 4px;
  margin-bottom: 8px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.envelope-subtitle {
  font-size: 0.85rem;
  color: var(--bright-gold);
  letter-spacing: 2px;
  margin-bottom: 24px;
  font-weight: 300;
}

.envelope-guest-card {
  background: rgba(43, 8, 12, 0.4);
  border: 1px solid rgba(245, 215, 127, 0.3);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 28px;
}

.envelope-guest-salutation {
  font-size: 0.8rem;
  color: #f7dcd9;
  letter-spacing: 2px;
  margin-bottom: 6px;
}

.envelope-guest-names {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  color: #fff;
  font-weight: bold;
  letter-spacing: 3px;
  text-shadow: 0 0 10px rgba(245, 215, 127, 0.6);
}

.envelope-seal-wrapper {
  margin: 15px auto 20px;
  width: 90px;
  height: 90px;
  cursor: pointer;
  position: relative;
  transition: transform 0.3s ease;
}

.envelope-seal-wrapper:hover {
  transform: scale(1.08);
}

.envelope-seal-img {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.5));
}

.seal-ripple {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 2px solid rgba(245, 215, 127, 0.6);
  animation: ripple 2s infinite ease-out;
  pointer-events: none;
}

.open-btn {
  background: linear-gradient(135deg, #f5d77f 0%, #d4af37 50%, #aa8024 100%);
  color: #3b0b10;
  border: none;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 3px;
  padding: 12px 36px;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(212, 175, 55, 0.4);
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.open-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(212, 175, 55, 0.6);
}

/* ========================================================
   2. 悬浮控制工具栏 (FLOATING TOP ACTIONS)
   ======================================================== */
.top-controls {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 100;
  display: flex;
  gap: 10px;
}

.control-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-gold);
  box-shadow: var(--shadow-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--primary-red);
  transition: all 0.3s ease;
}

.control-btn:hover {
  transform: scale(1.1);
  background: #fff;
}

.control-btn.rotating svg {
  animation: spin 4s linear infinite;
}

/* ========================================================
   3. 顶部主视觉 HERO SECTION
   ======================================================== */
.hero-section {
  position: relative;
  background: linear-gradient(180deg, #941c26 0%, #b32a36 40%, #fffbf5 100%);
  padding: 48px 20px 32px;
  text-align: center;
  color: #fff;
  overflow: hidden;
}

.hero-ornament-corner {
  position: absolute;
  width: 50px;
  height: 50px;
  opacity: 0.6;
}
.hero-ornament-corner.top-left { top: 12px; left: 12px; }
.hero-ornament-corner.top-right { top: 12px; right: 12px; transform: scaleX(-1); }

.hero-badge {
  display: inline-block;
  font-family: var(--font-serif);
  font-size: 0.85rem;
  letter-spacing: 4px;
  padding: 4px 18px;
  border: 1px solid rgba(245, 215, 127, 0.6);
  border-radius: 30px;
  color: var(--bright-gold);
  background: rgba(0, 0, 0, 0.15);
  margin-bottom: 16px;
}

.hero-title-main {
  font-family: var(--font-serif);
  font-size: 2.3rem;
  letter-spacing: 6px;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  margin-bottom: 6px;
}

.hero-title-en {
  font-size: 0.75rem;
  letter-spacing: 5px;
  color: var(--bright-gold);
  font-weight: 400;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.rings-illustration {
  width: 140px;
  height: 85px;
  margin: 0 auto 20px;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.25));
  animation: gentlePulse 3s ease-in-out infinite;
}

.couple-names-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 12px;
}

.couple-name {
  font-family: var(--font-serif);
  font-size: 1.85rem;
  font-weight: bold;
  letter-spacing: 3px;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.couple-heart {
  font-size: 1.4rem;
  color: var(--bright-gold);
  animation: heartBeat 1.8s infinite;
}

.couple-labels {
  display: flex;
  justify-content: center;
  gap: 75px;
  font-size: 0.78rem;
  color: var(--bright-gold);
  letter-spacing: 2px;
  margin-bottom: 24px;
}

/* VIP Special Guest Box */
.vip-guest-box {
  background: rgba(255, 255, 255, 0.96);
  border: 1.5px solid var(--accent-gold);
  border-radius: var(--radius-md);
  padding: 22px 18px;
  margin: 20px auto 0;
  box-shadow: 0 10px 30px rgba(110, 17, 26, 0.15);
  position: relative;
}

.vip-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #d4af37, #aa8024);
  color: #fff;
  font-size: 0.75rem;
  letter-spacing: 2px;
  padding: 3px 16px;
  border-radius: 20px;
  font-family: var(--font-serif);
  box-shadow: 0 3px 10px rgba(212, 175, 55, 0.4);
}

.vip-salute-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 6px;
  margin-bottom: 6px;
}

.vip-guest-highlight {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: bold;
  color: var(--primary-red);
  letter-spacing: 2px;
  margin-bottom: 12px;
}

.vip-message-text {
  font-size: 0.88rem;
  line-height: 1.75;
  color: var(--text-primary);
  text-align: justify;
  text-justify: inter-ideograph;
  position: relative;
  padding: 0 6px;
}

/* ========================================================
   4. 幸福倒计时 COUNTDOWN SECTION
   ======================================================== */
.countdown-section {
  padding: 24px 20px 10px;
  text-align: center;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--primary-red);
  letter-spacing: 3px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.section-title::before, .section-title::after {
  content: "";
  display: inline-block;
  width: 28px;
  height: 1px;
  background: var(--accent-gold);
}

.section-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.countdown-card {
  background: #fff;
  border: 1px solid var(--border-gold);
  border-radius: 12px;
  padding: 12px 6px;
  box-shadow: 0 4px 12px rgba(110, 17, 26, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.countdown-num {
  font-family: var(--font-serif);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--primary-red);
  line-height: 1.1;
}

.countdown-unit {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 4px;
  letter-spacing: 1px;
}

.countdown-target-date {
  font-size: 0.82rem;
  color: var(--text-secondary);
  background: var(--pale-gold);
  display: inline-block;
  padding: 5px 16px;
  border-radius: 20px;
  border: 1px solid rgba(212, 175, 55, 0.3);
}

/* ========================================================
   5. 宴席时光与地点 DETAILS SECTION
   ======================================================== */
.details-section {
  padding: 24px 20px;
}

.details-card {
  background: var(--warm-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: 24px 18px;
  box-shadow: var(--shadow-warm);
}

.info-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 20px;
  position: relative;
}

.info-item:last-child {
  margin-bottom: 0;
}

.info-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #fcedeb 0%, #f7dcd9 100%);
  border: 1px solid rgba(158, 29, 40, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-red);
  flex-shrink: 0;
}

.info-content {
  flex: 1;
}

.info-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-bottom: 3px;
}

.info-value-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.info-value-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.timeline-box {
  background: #fdfaf5;
  border: 1px dashed rgba(212, 175, 55, 0.5);
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 10px;
}

.timeline-step {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 0.82rem;
  margin-bottom: 6px;
}

.timeline-step:last-child {
  margin-bottom: 0;
}

.timeline-time {
  font-weight: bold;
  color: var(--primary-red);
  font-family: var(--font-serif);
  min-width: 46px;
}

.timeline-desc {
  color: var(--text-secondary);
}

.quick-action-btns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(212, 175, 55, 0.25);
}

.action-pill-btn {
  background: #fff;
  border: 1px solid var(--border-gold);
  border-radius: 10px;
  padding: 9px 4px;
  font-size: 0.78rem;
  color: var(--primary-red);
  font-weight: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.action-pill-btn:hover {
  background: var(--pale-gold);
  transform: translateY(-2px);
  box-shadow: var(--shadow-gold);
}

/* ========================================================
   6. 甜蜜相伴 · 恋爱印记 (STORY & MOMENTS)
   ======================================================== */
.story-section {
  padding: 24px 20px;
  text-align: center;
}

.story-polaroid-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-top: 10px;
}

.polaroid-card {
  background: #fff;
  padding: 12px 12px 18px;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(110, 17, 26, 0.09);
  border: 1px solid rgba(212, 175, 55, 0.2);
  transform: rotate(-1deg);
  transition: transform 0.3s ease;
}

.polaroid-card:nth-child(even) {
  transform: rotate(1deg);
}

.polaroid-card:hover {
  transform: rotate(0deg) scale(1.02);
}

.polaroid-img-wrapper {
  width: 100%;
  height: 190px;
  border-radius: 4px;
  overflow: hidden;
  background: linear-gradient(135deg, #fbf2ea 0%, #fae8d8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.polaroid-img-wrapper img, .polaroid-img-wrapper svg {
  max-width: 80%;
  max-height: 80%;
}

.polaroid-caption {
  margin-top: 12px;
  text-align: center;
}

.polaroid-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--primary-red);
  margin-bottom: 4px;
}

.polaroid-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ========================================================
   7. 贵宾回执 & 祝福留念 (VIP RSVP & BLESSING WALL)
   ======================================================== */
.rsvp-section {
  padding: 24px 20px;
}

.rsvp-box {
  background: var(--warm-card);
  border: 1.5px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: 24px 18px;
  box-shadow: var(--shadow-warm);
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #e0c8aa;
  background: #fff;
  font-size: 0.9rem;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus {
  border-color: var(--primary-red);
  box-shadow: 0 0 0 3px rgba(158, 29, 40, 0.1);
}

.attendance-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.radio-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #ebd9c5;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.82rem;
  transition: all 0.2s;
}

.radio-card input {
  accent-color: var(--primary-red);
}

.radio-card.active {
  border-color: var(--primary-red);
  background: #fff5f5;
  color: var(--primary-red);
  font-weight: 600;
}

/* Quick blessing tags */
.preset-tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.preset-tag {
  background: var(--pale-gold);
  border: 1px solid rgba(212, 175, 55, 0.35);
  color: #7a5416;
  font-size: 0.76rem;
  padding: 4px 10px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
}

.preset-tag:hover {
  background: #f7e6b8;
  border-color: var(--accent-gold);
}

.submit-blessing-btn {
  width: 100%;
  padding: 13px;
  border-radius: 50px;
  border: none;
  background: linear-gradient(135deg, #a61f2c 0%, #7d131d 100%);
  color: #fff;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 2px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(125, 19, 29, 0.35);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.submit-blessing-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(125, 19, 29, 0.5);
}

/* Blessing stream list */
.blessings-wall-container {
  margin-top: 24px;
}

.blessings-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
}

.blessing-card-item {
  background: #fff;
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.03);
  animation: slideInDown 0.4s ease-out;
}

.blessing-sender-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.blessing-sender-name {
  font-family: var(--font-serif);
  font-size: 0.88rem;
  font-weight: bold;
  color: var(--primary-red);
}

.blessing-badge {
  font-size: 0.7rem;
  background: #fdf2e9;
  color: #c05621;
  padding: 2px 8px;
  border-radius: 10px;
}

.blessing-text-body {
  font-size: 0.84rem;
  color: var(--text-primary);
  line-height: 1.5;
}

.blessing-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: right;
  margin-top: 4px;
}

/* ========================================================
   8. 赴宴贴士 & 联络新郎新娘 (TIPS & FOOTER)
   ======================================================== */
.tips-section {
  padding: 20px;
}

.tips-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.tip-card {
  background: #fff;
  border: 1px solid var(--border-gold);
  border-radius: 14px;
  padding: 14px 12px;
  text-align: center;
}

.tip-icon {
  font-size: 1.5rem;
  margin-bottom: 6px;
}

.tip-title {
  font-size: 0.85rem;
  font-weight: bold;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.tip-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.contact-couple-box {
  background: linear-gradient(135deg, #fdf8f4 0%, #faeee5 100%);
  border: 1px solid var(--border-gold);
  border-radius: 16px;
  padding: 18px 16px;
  text-align: center;
  margin-bottom: 30px;
}

.contact-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--primary-red);
  margin-bottom: 12px;
}

.contact-btns {
  display: flex;
  justify-content: center;
  gap: 14px;
}

.contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 50px;
  background: #fff;
  border: 1px solid rgba(158, 29, 40, 0.3);
  color: var(--primary-red);
  font-size: 0.82rem;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.contact-btn:hover {
  background: var(--primary-red);
  color: #fff;
}

.footer-section {
  text-align: center;
  padding: 24px 20px 48px;
  background: #2b080c;
  color: var(--bright-gold);
}

.footer-quote {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  letter-spacing: 4px;
  margin-bottom: 8px;
  color: #fff;
}

.footer-sub {
  font-size: 0.78rem;
  letter-spacing: 2px;
  color: rgba(245, 215, 127, 0.75);
}

/* ========================================================
   9. 弹窗提示与交互动画 (MODAL & TOAST)
   ======================================================== */
.toast-msg {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%) translateY(30px);
  background: rgba(43, 8, 12, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  border: 1px solid var(--accent-gold);
  padding: 10px 22px;
  border-radius: 30px;
  font-size: 0.85rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast-msg.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Map Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background: #fff;
  width: 100%;
  max-width: 340px;
  border-radius: 20px;
  padding: 22px 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  text-align: center;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.modal-overlay.open .modal-card {
  transform: scale(1);
}

.modal-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--primary-red);
  margin-bottom: 6px;
}

.modal-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

.map-choices-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.map-choice-btn {
  display: block;
  padding: 10px;
  background: #fbf8f5;
  border: 1px solid #ebd9c5;
  border-radius: 10px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.2s;
}

.map-choice-btn:hover {
  background: var(--pale-gold);
  border-color: var(--accent-gold);
  color: var(--primary-red);
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 6px 12px;
}

/* Animations */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes gentlePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

@keyframes heartBeat {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.2); }
  50% { transform: scale(1); }
  75% { transform: scale(1.15); }
}

@keyframes ripple {
  0% { transform: translate(-50%, -50%) scale(0.9); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.4); opacity: 0; }
}

@keyframes floatUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes slideInDown {
  from { transform: translateY(-10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ========================================================
   10. 移动端与全屏幕极致适配 (MOBILE ADAPTATION)
   ======================================================== */
@supports (min-height: 100dvh) {
  body {
    min-height: 100dvh;
  }
  .page-wrapper {
    min-height: 100dvh;
  }
  .envelope-overlay {
    height: 100dvh;
  }
}

/* 适配 iOS 底部安全距离（Home Indicator）与顶部灵动岛/刘海屏 */
.top-controls {
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
}

.footer-section {
  padding-bottom: max(36px, calc(env(safe-area-inset-bottom) + 24px));
}

/* 防止 iOS 点击输入框时页面被浏览器强行放大 */
.form-input {
  font-size: 16px !important;
}

/* 按钮点击触觉轻反馈 */
.open-btn:active,
.action-pill-btn:active,
.submit-blessing-btn:active,
.contact-btn:active,
.preset-tag:active,
.map-choice-btn:active {
  transform: scale(0.96) !important;
  opacity: 0.92;
}

/* 小屏设备适配（例如 iPhone SE / mini / 宽 ≤ 375px） */
@media screen and (max-width: 375px) {
  .hero-title-main {
    font-size: 2rem;
    letter-spacing: 4px;
  }
  .couple-name {
    font-size: 1.6rem;
  }
  .couple-labels {
    gap: 55px;
  }
  .countdown-num {
    font-size: 1.45rem;
  }
  .envelope-title {
    font-size: 1.5rem;
  }
  .envelope-guest-names {
    font-size: 1.25rem;
  }
  .quick-action-btns {
    gap: 6px;
  }
  .action-pill-btn {
    padding: 8px 2px;
    font-size: 0.74rem;
  }
  .contact-btns {
    flex-direction: column;
    gap: 10px;
  }
  .contact-btn {
    width: 100%;
    justify-content: center;
  }
}

/* 矮屏设备垂直适配（例如横屏或高度 ≤ 720px） */
@media screen and (max-height: 720px) {
  .envelope-container {
    padding: 20px 18px;
  }
  .envelope-header-tag {
    margin-bottom: 12px;
  }
  .envelope-guest-card {
    margin-bottom: 16px;
    padding: 12px;
  }
  .envelope-seal-wrapper {
    margin: 10px auto 14px;
    width: 75px;
    height: 75px;
  }
  .open-btn {
    padding: 10px 28px;
    font-size: 0.95rem;
  }
}
