/* ===== 请柬增强样式（在 styles.css 之后加载） ===== */

:root {
  --danger: #E88A8A;
  --ok: #8FD3A8;
}

/* 安全区（iPhone 刘海 / 底部横条） */
.content-wrap {
  padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
}
.envelope-screen {
  padding-top: calc(24px + env(safe-area-inset-top, 0px));
}

/* 复古信封细节增强 */
.envelope-box {
  position: relative;
  overflow: hidden;
}
.env-satin-ribbon {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 28px;
  transform: translateY(-50%);
  background: linear-gradient(180deg, rgba(229, 195, 120, 0.15) 0%, rgba(229, 195, 120, 0.35) 50%, rgba(229, 195, 120, 0.15) 100%);
  border-top: 1px solid rgba(229, 195, 120, 0.3);
  border-bottom: 1px solid rgba(229, 195, 120, 0.3);
  pointer-events: none;
  z-index: 1;
}
.env-corner {
  position: absolute;
  width: 24px;
  height: 24px;
  border: 2px solid var(--gold-primary);
  pointer-events: none;
  z-index: 2;
  opacity: 0.7;
}
.env-corner.tl { top: 10px; left: 10px; border-right: none; border-bottom: none; border-top-left-radius: 4px; }
.env-corner.tr { top: 10px; right: 10px; border-left: none; border-bottom: none; border-top-right-radius: 4px; }
.env-corner.bl { bottom: 10px; left: 10px; border-right: none; border-top: none; border-bottom-left-radius: 4px; }
.env-corner.br { bottom: 10px; right: 10px; border-left: none; border-top: none; border-bottom-right-radius: 4px; }

/* 图文一体化 2K 高定海报开屏容器 */
.envelope-screen {
  background: #180306 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  overflow: hidden !important;
  transition: opacity 0.6s ease, transform 0.6s ease, visibility 0.6s !important;
}

.envelope-screen.opened {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
  transform: translateX(-50%) scale(1.08) !important;
}

.envelope-poster-wrap {
  width: 100%;
  max-width: 480px;
  height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  overflow: hidden;
  transition: transform 0.25s ease;
}
.envelope-poster-wrap:active {
  transform: scale(0.985);
}

.envelope-poster-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.env-floating-action {
  position: absolute;
  bottom: calc(36px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
}

.env-open-btn-pill {
  background: var(--gold-gradient);
  color: #3D0910;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 2.5px;
  padding: 10px 28px;
  border-radius: 30px;
  box-shadow: 0 8px 25px rgba(229, 195, 120, 0.55);
  transition: transform 0.2s ease;
  animation: pulseButton 2s infinite ease-in-out;
  white-space: nowrap;
}
@keyframes pulseButton {
  0%, 100% { transform: scale(1); box-shadow: 0 6px 20px rgba(229, 195, 120, 0.45); }
  50% { transform: scale(1.06); box-shadow: 0 8px 30px rgba(229, 195, 120, 0.75); }
}

.env-header-content {
  position: relative;
  z-index: 4;
}

.env-sub-tip {
  font-size: 11px;
  color: var(--gold-light);
  letter-spacing: 2px;
  margin-top: 6px;
  opacity: 0.85;
}

/* 视频加载 / 失败态 */
.video-fallback {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(160deg, #2b0a10, #120306);
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  padding: 24px;
  z-index: 4;
}
.video-fallback.show {
  display: flex;
}
.video-fallback code {
  font-size: 11px;
  color: var(--gold-light);
  word-break: break-all;
  background: rgba(0, 0, 0, 0.35);
  padding: 4px 8px;
  border-radius: 6px;
}

/* 表单辅助 */
.form-hint {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 6px;
}
.form-control.is-error {
  border-color: #d98a8a !important;
  box-shadow: 0 0 0 2px rgba(217, 138, 138, 0.15);
}
select.form-control {
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--gold-primary) 50%),
    linear-gradient(135deg, var(--gold-primary) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% + 1px), calc(100% - 13px) calc(50% + 1px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}
select.form-control option {
  background: #2b0a10;
  color: var(--text-cream);
}

.stepper-row.disabled {
  opacity: 0.45;
}
.stepper-row + .stepper-row {
  margin-top: 8px;
}

/* 折叠区域过渡 */
.collapsible {
  overflow: hidden;
  max-height: 1200px;
  opacity: 1;
  transition: max-height 0.35s ease, opacity 0.25s ease;
}
.collapsible.hidden {
  max-height: 0;
  opacity: 0;
}

/* 提交按钮 loading */
.submit-btn[disabled] {
  opacity: 0.65;
  cursor: not-allowed;
}
.submit-btn .spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(61, 9, 16, 0.35);
  border-top-color: #3d0910;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: -2px;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 已提交状态卡 */
.submitted-card {
  display: none;
  text-align: center;
  padding: 26px 20px;
}
.submitted-card.show {
  display: block;
}
.submitted-emoji {
  font-size: 40px;
  margin-bottom: 10px;
}
.submitted-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--gold-light);
  margin-bottom: 8px;
}
.submitted-detail {
  font-size: 13px;
  color: var(--text-cream);
  line-height: 1.9;
  text-align: left;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(229, 195, 120, 0.18);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 14px 0 18px;
}
.submitted-detail div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.submitted-detail span:first-child {
  color: var(--text-muted);
  flex: 0 0 auto;
}
.submitted-detail span:last-child {
  text-align: right;
  color: var(--gold-light);
}

.btn-ghost {
  display: inline-block;
  background: transparent;
  border: 1px solid var(--border-gold);
  color: var(--gold-light);
  border-radius: 10px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-ghost:active {
  transform: scale(0.98);
  background: rgba(229, 195, 120, 0.1);
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 20px);
  max-width: 88%;
  background: rgba(24, 5, 9, 0.96);
  border: 1px solid var(--border-gold);
  color: var(--text-cream);
  font-size: 13px;
  line-height: 1.5;
  padding: 11px 18px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  z-index: 300;
  text-align: center;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.toast.error {
  border-color: rgba(232, 138, 138, 0.6);
  color: #FFD9D9;
}

/* 离线提示条 */
.offline-bar {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: rgba(120, 60, 20, 0.96);
  color: #FFE8CC;
  font-size: 11.5px;
  text-align: center;
  padding: 6px 12px;
  z-index: 210;
  display: none;
}
.offline-bar.show {
  display: block;
}

/* 倒计时结束后 */
.countdown-grid.done .count-num {
  font-size: 15px;
}

/* 打卡 pill */
.pill-soft {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--gold-light);
  background: rgba(229, 195, 120, 0.1);
  border: 1px solid rgba(229, 195, 120, 0.25);
  border-radius: 999px;
  padding: 3px 10px;
  margin-bottom: 10px;
}

/* ===== 窄屏（iPhone SE / 390px）排版修正 ===== */
.card-header {
  flex-wrap: wrap;
  align-items: baseline;
  row-gap: 4px;
}
.card-title {
  flex: 1 1 auto;
  min-width: 0;
}
.card-subtitle {
  flex: 0 0 auto;
  margin-left: auto;
  white-space: nowrap;
}

/* 窄屏下英文副标题独立一行左对齐，避免与右上角音乐按钮叠压 / 被挤断 */
@media (max-width: 430px) {
  .card-title { font-size: 16.5px; letter-spacing: 0.5px; }
  .card-subtitle {
    flex: 1 1 100%;
    margin-left: 0;
    margin-top: -2px;
    text-align: left;
    font-size: 9.5px;
    letter-spacing: 1.6px;
    opacity: 0.8;
  }
  .card-header { row-gap: 2px; }
  .music-btn {
    top: calc(14px + env(safe-area-inset-top, 0px));
    right: 14px;
    width: 40px;
    height: 40px;
  }
  .music-btn svg { width: 19px; height: 19px; }
}

/* 已提交明细：标签固定宽，值右对齐可换行 */
.submitted-detail div { align-items: flex-start; }
.submitted-detail span:first-child {
  flex: 0 0 44px;
  text-align: left;
}
.submitted-detail span:last-child {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* 视频全画幅展示（严禁裁剪头部和底部文字） */
.video-wrapper video {
  width: 100% !important;
  height: auto !important;
  max-height: none !important;
  display: block !important;
  object-fit: contain !important;
  border-radius: 10px !important;
}

/* 视频 404 兜底：隐藏原生错误 UI，并给容器撑高 */
.video-wrapper.no-video video { display: none; }
.video-wrapper.no-video {
  min-height: 200px;
  display: flex;
}
.video-wrapper.no-video .video-fallback {
  position: relative;
  inset: auto;
  flex: 1 1 auto;
}

/* ==================== 童年大头贴手绘拼贴卡片 (Childhood Collage - 融于暗红背景) ==================== */
.childhood-card {
  background: var(--bg-card) !important;
  color: var(--text-cream) !important;
  border: 1px solid var(--border-gold) !important;
  box-shadow: var(--shadow-luxury) !important;
  padding: 26px 20px 22px 20px !important;
  text-align: center;
  position: relative;
  backdrop-filter: blur(12px);
}
.childhood-header-doodle {
  font-family: 'Cinzel', serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--gold-light);
  margin-bottom: 4px;
}
.childhood-tag-doodle {
  display: inline-block;
  background: rgba(229, 195, 120, 0.12);
  color: var(--gold-light);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 12px;
  border-radius: 14px;
  letter-spacing: 1.5px;
  margin-bottom: 20px;
  border: 1px dashed rgba(229, 195, 120, 0.35);
}

.childhood-avatars-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin-bottom: 20px;
}
.childhood-person {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.childhood-avatar-box {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 2px solid var(--gold-primary);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6), 0 0 15px rgba(229, 195, 120, 0.25);
  overflow: hidden;
  background: #2D080E;
  position: relative;
}
.childhood-avatar-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.childhood-name-label {
  font-family: 'Noto Serif SC', serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--gold-light);
  margin-top: 8px;
  letter-spacing: 1.5px;
}
.childhood-heart-knot {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 22px;
  color: #E84A5F;
  animation: heartPulse 1.8s infinite ease-in-out;
}
@keyframes heartPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); filter: drop-shadow(0 0 8px rgba(232, 74, 95, 0.6)); }
}

.childhood-copy-body {
  font-family: 'Noto Serif SC', serif;
  font-size: 13.5px;
  line-height: 2.1;
  color: var(--text-cream);
  letter-spacing: 1.5px;
  border-top: 1px dashed rgba(229, 195, 120, 0.25);
  padding-top: 18px;
  margin-top: 8px;
}
.childhood-copy-body p {
  margin-bottom: 6px;
}
.childhood-smiley {
  font-size: 16px;
  font-weight: 700;
  color: var(--gold-primary);
  margin-top: 10px;
}

/* ==================== 爱情里程碑 (Love Milestones) ==================== */
.milestone-card {
  text-align: center;
  padding: 26px 20px !important;
}
.milestone-item {
  margin: 16px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.milestone-date {
  font-family: 'Cinzel', serif;
  font-size: 16.5px;
  font-weight: 700;
  color: var(--gold-light);
  letter-spacing: 1.5px;
}
.milestone-date span {
  font-family: 'Noto Serif SC', serif;
  font-size: 14.5px;
  font-weight: 600;
  margin-left: 6px;
}
.milestone-tagline {
  font-family: 'Noto Serif SC', serif;
  font-size: 12.5px;
  color: var(--text-muted);
  letter-spacing: 1.5px;
}

.milestone-center-photo {
  margin: 22px auto;
  max-width: 320px;
  border-radius: 12px;
  overflow: hidden;
  border: 1.5px solid var(--gold-primary);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  background: #180306;
}
.milestone-center-photo img {
  width: 100%;
  height: auto;
  display: block;
}

/* ==================== 走心文案 & 我们的故事 (Our Story) ==================== */
.story-card {
  position: relative;
  padding: 28px 20px 24px 20px;
  text-align: center;
}
.story-quote-mark {
  font-family: 'Cinzel', serif;
  font-size: 34px;
  color: var(--gold-primary);
  line-height: 1;
  margin-bottom: 6px;
  opacity: 0.85;
}
.story-body {
  font-size: 14.5px;
  line-height: 2.1;
  color: rgba(245, 240, 232, 0.95);
  letter-spacing: 1.2px;
  margin: 16px 0 18px 0;
  text-align: center;
}
.story-body .story-p {
  margin: 16px 0;
  word-break: keep-all;
  white-space: normal;
}
.story-signature {
  font-family: 'Cinzel', serif;
  font-size: 11.5px;
  letter-spacing: 3px;
  color: var(--gold-light);
  text-transform: uppercase;
  margin-top: 18px;
  border-top: 1px dashed rgba(229, 195, 120, 0.25);
  padding-top: 14px;
}

/* ==================== 浪漫相片画廊 (Photo Gallery 章节式排版) ==================== */
.gallery-chapters-wrap {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 14px;
}
.gallery-chapter-box {
  background: rgba(30, 5, 10, 0.65);
  border: 1px solid rgba(229, 195, 120, 0.3);
  border-radius: 14px;
  padding: 16px 14px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}
.gallery-chapter-tag {
  font-family: 'Cinzel', serif;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--gold-light);
  margin-bottom: 12px;
  text-align: center;
  border-bottom: 1px dashed rgba(229, 195, 120, 0.25);
  padding-bottom: 8px;
}
.gallery-main-frame {
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  border: 1.5px solid var(--gold-primary);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
  background: #110204;
}
.gallery-full-img {
  width: 100%;
  height: auto;
  display: block;
}
.gallery-dual-frames {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: start;
}
.gallery-sub-frame {
  width: 100%;
  height: auto;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(229, 195, 120, 0.4);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
  background: #110204;
}
.gallery-sub-frame img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}
.gallery-caption {
  font-family: 'Noto Serif SC', serif;
  font-size: 12.5px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 10px;
  letter-spacing: 1.5px;
}

/* ==================== 婚礼与游园会时间轴 (Timeline) ==================== */
.timeline-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 14px;
  position: relative;
  padding-left: 24px;
}
.timeline-wrap::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, var(--gold-light) 0%, rgba(229, 195, 120, 0.2) 100%);
}
.timeline-node {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.timeline-node::before {
  content: '';
  position: absolute;
  left: -24px;
  top: 5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold-primary);
  box-shadow: 0 0 10px var(--gold-light);
  border: 2px solid var(--bg-burgundy);
}
.timeline-time {
  font-family: 'Cinzel', serif;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--gold-light);
  letter-spacing: 1px;
}
.timeline-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-cream);
}
.timeline-detail {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ==================== 方案组合：方案1飘雪 + 方案2冷杉暗纹 + 方案3烫金角花 ==================== */
body {
  background-color: #24050A !important;
  background-image: 
    radial-gradient(circle at 50% 12%, rgba(145, 28, 50, 0.45) 0%, rgba(42, 6, 14, 0.94) 55%, #150205 100%),
    url('assets/damask_alpine_fir.svg') !important;
  background-repeat: no-repeat, repeat !important;
  background-size: 100% 100%, 360px 360px !important;
  background-attachment: fixed, fixed !important;
}

/* 方案3：卡片增加法式复古烫金花草角花（上下四角齐全） */
.glass-card {
  position: relative;
  background: rgba(36, 6, 12, 0.82) !important;
  border: 1px solid rgba(229, 195, 120, 0.35) !important;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.65), inset 0 0 25px rgba(229, 195, 120, 0.04) !important;
}

.card-filigree-corner {
  position: absolute;
  width: 32px;
  height: 32px;
  background: url('assets/gold_filigree_corner.svg') no-repeat center/contain;
  pointer-events: none;
  opacity: 0.85;
  z-index: 3;
}

.card-filigree-corner.tl {
  top: 6px;
  left: 6px;
}

.card-filigree-corner.tr {
  top: 6px;
  right: 6px;
  transform: scaleX(-1);
}

.card-filigree-corner.bl {
  bottom: 6px;
  left: 6px;
  transform: scaleY(-1);
}

.card-filigree-corner.br {
  bottom: 6px;
  right: 6px;
  transform: scale(-1, -1);
}

