/* invitation.css · 执手记账 电子请柬「公开分享页」（完整多段式查看器） */
/* v1.5.5 H5 三形式同步 · 待 W3设计/W4品牌/PM 视觉复核 */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
:root {
  --iv-accent: #C9A06A;
  --iv-ink: #5A4632;
  --iv-bg: #FBF4EA;
  --iv-bg2: #F4E8D8;

  /* v1.5.4 请柬底部区品牌 Token (H5) */
  --iv-brand-primary: #D65A78;
  --iv-brand-primary-dark: #B8436F;
  --iv-brand-primary-soft: rgba(214, 90, 120, 0.10);
  --iv-scene-wedding: #D65A78;
  --iv-scene-housewarming: #F5A623;
  --iv-scene-fullmonth: #F48FB1;
  --iv-scene-birthday: #BA68C8;
  --iv-surface: #FFFFFF;
  --iv-surface-secondary: #F7F5F6;
  --iv-surface-dark: #1C1C1E;
  --iv-input-ink: #1A1A1A;
  --iv-sub: #8A8A8E;
  --iv-line: rgba(0, 0, 0, 0.06);
  --iv-line-strong: rgba(0, 0, 0, 0.12);
  --iv-fz-action: 15px;
  --iv-fz-action-sub: 14px;
  --iv-fz-input: 14px;
  --iv-fz-chip: 12px;
  --iv-fz-tip: 11px;
  --iv-r-pill: 999px;
  --iv-r-btn-sub: 10px;
  --iv-r-input: 8px;
  --iv-pad-panel-x: 10px;
  --iv-pad-panel-top: 8px;
  --iv-pad-panel-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  --iv-gap-row: 7px;
  --iv-gap-col: 6px;
  --iv-shadow-soft: 0 -4px 12px rgba(0, 0, 0, 0.06);
  --iv-shadow-brand: 0 4px 12px rgba(214, 90, 120, 0.25);
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: #2b2b2b;
  background: #f3efe9;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }

/* 顶栏（H5 请柬导航一致性定稿 §五：返回/分享 2px 线描 currentColor 暖灰 #7A746E） */
.iv-top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  height: 48px; padding: 0 12px; box-sizing: border-box;
  background: rgba(255,255,255,0.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid #ece6df;
}
.iv-nav-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 6px; margin: 0;
  border: none; background: transparent; cursor: pointer;
  color: #7A746E; border-radius: 8px;
  transition: transform 120ms ease;
}
.iv-nav-btn:active { transform: scale(0.92); }
.iv-nav-btn svg { display: block; }
.iv-top-title {
  flex: 1; min-width: 0; padding: 0 8px;
  text-align: center; font-size: 14px; font-weight: 600; color: #2b2b2b;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* 主体：桌面居中手机列，移动端满宽 */
.iv-root {
  max-width: 480px; margin: 0 auto; padding: 0 0 calc(180px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, var(--iv-bg) 0%, var(--iv-bg2) 100%);
  min-height: 70vh;
}

/* 加载 / 错误 / 提示 */
.iv-loading, .iv-error, .iv-tip {
  text-align: center; color: #8b7f72; font-size: 14px; padding: 40px 24px; line-height: 1.7;
}
.iv-error { color: #b4524a; }
.iv-error a {
  display: inline-block; margin-top: 12px;
  padding: 8px 16px; border-radius: 20px;
  background: var(--iv-accent, #D65A78); color: #fff !important;
  text-decoration: none; font-weight: 600; font-size: 13px;
}

/* 1. 封面 hero */
.iv-hero { position: relative; height: 78vh; max-height: 680px; overflow: hidden; background: #e9e2da; }
.iv-hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center; filter: blur(28px) brightness(0.82); transform: scale(1.1); }
.iv-hero-img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.iv-hero-ph { background: linear-gradient(160deg, var(--iv-bg2) 0%, var(--iv-bg) 55%, var(--iv-accent) 100%); }
.iv-hero-mask {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,0.55) 100%);
}
.iv-hero-card {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 22px 30px; text-align: center; color: #fff;
}
.iv-hero-names { font-size: 30px; font-weight: 800; letter-spacing: 1px; text-shadow: 0 2px 12px rgba(0,0,0,0.4); }
.iv-hero-date { margin-top: 10px; font-size: 15px; opacity: 0.95; }
.iv-hero-place { margin-top: 4px; font-size: 14px; opacity: 0.9; }
.iv-hero-bless { margin-top: 12px; font-size: 13px; opacity: 0.92; line-height: 1.6; }
.iv-hero-music {
  position: absolute; top: 14px; right: 14px; z-index: 5;
  width: 40px; height: 40px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(0,0,0,0.35); color: #fff; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
}
.iv-hero-music:active { transform: scale(0.94); }

/* 区块卡片 */
.iv-sec {
  margin: 14px 14px 0; padding: 18px 16px;
  background: #fff; border-radius: 16px; box-shadow: 0 4px 16px rgba(0,0,0,0.05);
}
.iv-sec-h {
  font-size: 15px; font-weight: 800; color: var(--iv-ink); margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.iv-sec-h::before {
  content: ""; width: 4px; height: 16px; border-radius: 2px; background: var(--iv-accent);
}

/* 倒计时 */
.iv-countdown { text-align: center; }
.iv-countdown .iv-sec-h { justify-content: center; }
.iv-cd { display: flex; align-items: baseline; justify-content: center; gap: 6px; flex-wrap: wrap; }
.iv-cd-num {
  font-size: 30px; font-weight: 800; color: var(--iv-accent);
  min-width: 52px; padding: 8px 0; background: #faf6ef; border-radius: 12px;
  font-variant-numeric: tabular-nums;
}
.iv-cd-lab { font-size: 13px; color: #8b7f72; margin-right: 8px; }
.iv-cd-done { font-size: 20px; font-weight: 800; color: var(--iv-accent); }

/* 地点 */
.iv-venue-name { font-size: 16px; font-weight: 700; color: #333; margin-bottom: 12px; }

/* 按钮 */
.iv-btn {
  display: block; width: 100%; margin-top: 6px; padding: 13px 0;
  border: none; border-radius: 12px; font-size: 15px; font-weight: 700; cursor: pointer;
  background: #f1ece4; color: #6b6358;
}
.iv-btn:active { transform: translateY(1px); }
.iv-btn-accent {
  background: linear-gradient(135deg, #D65A78, #B8436F); color: #fff;
  box-shadow: 0 6px 18px rgba(214,90,120,0.28);
}

/* 相册 */
.iv-gallery-scroll { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.iv-gallery-img {
  flex: 0 0 auto; width: 160px; height: 200px; object-fit: cover; border-radius: 12px;
  cursor: pointer; background: #eee;
}

/* 音乐 */
.iv-music-row { display: flex; align-items: center; justify-content: space-between; }
.iv-music-name { font-size: 14px; color: #444; }
.iv-music-toggle {
  border: 1px solid var(--iv-accent); color: var(--iv-accent); background: #fff;
  border-radius: 999px; padding: 7px 16px; font-size: 13px; font-weight: 700; cursor: pointer;
}
.iv-music-tip { margin-top: 8px; font-size: 12px; color: #a89da4; }

/* 时间轴 */
.iv-tl { position: relative; }
.iv-tl-item { position: relative; padding: 0 0 18px 22px; }
.iv-tl-dot {
  position: absolute; left: 0; top: 4px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--iv-accent); box-shadow: 0 0 0 4px rgba(0,0,0,0.04);
}
.iv-tl-line { position: absolute; left: 5px; top: 16px; bottom: 0; width: 2px; background: #eee; }
.iv-tl-time { display: block; font-size: 13px; font-weight: 700; color: var(--iv-accent); }
.iv-tl-title { display: block; font-size: 15px; font-weight: 700; color: #333; margin-top: 2px; }
.iv-tl-desc { display: block; font-size: 13px; color: #8b7f72; margin-top: 2px; }

/* 祝福墙：已改为满屏弹幕（.iv-bless-dm）+ 底部输入面板（.iv-bless-bar），见下方 §B */

/* 表单 / 回执 / 祝福 */
.iv-form { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.iv-input {
  width: 100%; height: 46px; padding: 0 14px; border: 1px solid #ece6df; border-radius: 12px;
  background: #faf8f5; font-size: 15px; color: #333; outline: none;
}
.iv-input:focus { border-color: var(--iv-accent); background: #fff; }
.iv-row { display: flex; align-items: center; justify-content: space-between; }
.iv-lab { font-size: 14px; color: #6b6358; }
.iv-stepper { display: flex; align-items: center; gap: 12px; }
.iv-step {
  width: 34px; height: 34px; border-radius: 10px; border: 1px solid #ece6df;
  background: #faf8f5; font-size: 18px; color: #6b6358; cursor: pointer;
}
.iv-seg { display: flex; background: #f1ece4; border-radius: 10px; padding: 3px; }
.iv-seg-btn {
  border: none; background: transparent; padding: 8px 16px; border-radius: 8px;
  font-size: 14px; font-weight: 700; color: #8b7f72; cursor: pointer;
}
.iv-seg-btn.iv-on { background: #fff; color: var(--iv-accent); box-shadow: 0 2px 6px rgba(0,0,0,0.08); }
.iv-rsvp-stat { font-size: 14px; color: #6b6358; margin-bottom: 12px; }
.iv-rsvp-stat b { color: var(--iv-accent); font-size: 16px; }

/* 品牌署名 */
.iv-brand-sign { text-align: center; font-size: 12px; color: #b0a497; margin: 20px 16px 0; }
.iv-tip { margin-top: 14px; }

/* Toast */
.iv-toast {
  position: fixed; left: 50%; bottom: 36px; transform: translateX(-50%);
  background: rgba(40,34,30,0.92); color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: 14px; z-index: 50; box-shadow: 0 8px 24px rgba(0,0,0,0.25); max-width: 90vw;
}

/* 灯箱 */
.iv-lightbox {
  position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,0.92);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.iv-lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }

/* 页脚 */
.iv-footer {
  text-align: center; padding: 24px 16px 32px; font-size: 12px; color: #8b7f72;
  background: rgba(255,255,255,0.6); border-top: 1px solid rgba(0,0,0,0.06);
}
.iv-icp { display: block; margin-top: 6px; font-size: 11px; }

@media (max-width: 520px) {
  .iv-hero { height: 70vh; }
  .iv-sec { margin: 12px 10px 0; padding: 16px 14px; }
}

/* 小程序码弹层 */
.iv-mp-modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; }
.iv-mp-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.62); }
.iv-mp-card {
  position: relative; z-index: 1;
  width: min(300px, 84vw); padding: 28px 24px 24px;
  background: #fff; border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.22);
  text-align: center; animation: iv-mp-in 0.22s ease-out;
}
@keyframes iv-mp-in { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: scale(1); } }
.iv-mp-close {
  position: absolute; top: 10px; right: 14px;
  width: 32px; height: 32px; border: none; background: transparent;
  font-size: 22px; color: #999; cursor: pointer; line-height: 1;
}
.iv-mp-close:active { color: #666; }
.iv-mp-qr { display: block; width: 180px; height: 180px; margin: 0 auto 16px; border-radius: 12px; }
.iv-mp-title { font-size: 17px; font-weight: 700; color: #2b2b2b; margin: 0 0 6px; }
.iv-mp-tip { font-size: 13px; color: #8b7f72; margin: 0; line-height: 1.5; }

/* ============ v1.5.5 展示形式（hero / waterfall / timeline） ============ */

/* 矮封面带（瀑布流 / 时间轴 首屏）：复用 .iv-hero-bg 模糊背景层 + .iv-hero-img 清晰前景，
   横图(contain)不露死黑，与 v1.5.4 hero-bg-blur 黑边修复行为一致 */
.iv-hero-banner { position: relative; height: 34vh; max-height: 280px; overflow: hidden; background: #e9e2da; }
.iv-hero-card-mini { padding: 18px 20px 20px; }
.iv-hero-card-mini .iv-hero-names { font-size: 24px; }
.iv-hero-card-mini .iv-hero-date { margin-top: 6px; font-size: 13px; }
.iv-hero-card-mini .iv-hero-place { margin-top: 3px; font-size: 13px; }

/* 瀑布流照片墙：masonry（2 列，图片按原始比例 contain 不裁剪） */
.iv-gallery-masonry { column-count: 2; column-gap: 8px; }
.iv-masonry-img {
  display: block; width: 100%; margin: 0 0 8px;
  border-radius: 12px; background: #eee; cursor: pointer;
}

/* 时间轴叙事流（主体）节点可选配图 */
.iv-tl-img {
  display: block; width: 100%; margin-top: 8px;
  border-radius: 12px; background: #eee; cursor: pointer;
}
.iv-timeline-main .iv-tl-title { font-size: 16px; }

@media (max-width: 520px) {
  .iv-hero-banner { height: 30vh; }
}

/* ============ v1.5.4 交互优化·B：祝福弹幕（满屏竖向上升，非左侧抽屉） ============ */

/* 全屏竖向弹幕（左侧上升）：fixed、不拦截点击；宽度限制为左 75%（不超过左半屏） */
.iv-danmu-layer {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 30;
  width: 75%; max-width: 75%;
  pointer-events: none; overflow: hidden;
}
.iv-bless-dm {
  position: absolute; left: 12px; white-space: nowrap;
  max-width: 80%; overflow: hidden; text-overflow: ellipsis;
  display: inline-flex; align-items: center;
  padding: 7px 16px; border-radius: 999px;
  background: rgba(255,255,255,0.82); color: #333;
  font-size: 14px; line-height: 1.2;
  box-shadow: 0 3px 10px rgba(0,0,0,0.12);
  animation-name: ivDanmuMove;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
  will-change: transform;
}
.iv-bless-dm-nick { font-weight: 700; }
@keyframes ivDanmuMove {
  from { transform: translateY(110vh); }
  to { transform: translateY(-130%); }
}
/* 按账本场景类型配色（覆盖默认白底 rgba(255,255,255,0.82)） */
.iv-bless-dm-wedding { background:#D65A78; color:#fff; }
.iv-bless-dm-housewarming { background:#F5A623; color:#fff; }
.iv-bless-dm-fullmonth { background:#F48FB1; color:#fff; }
.iv-bless-dm-birthday { background:#BA68C8; color:#fff; }

/* 底部固定祝福输入面板（编辑/发送祝福原位保留，非抽屉 · v1.5.4·D 品牌重设计） */
.iv-bless-bar {
  position: fixed; left: 0; right: 0; bottom: 0;
  z-index: 40;
  background: rgba(255,255,255,0.96);
  border-top: 1px solid var(--iv-line, rgba(0,0,0,0.06));
  padding: var(--iv-pad-panel-top, 8px) var(--iv-pad-panel-x, 10px) var(--iv-pad-panel-bottom, calc(8px + env(safe-area-inset-bottom, 0px)));
  box-shadow: var(--iv-shadow-soft, 0 -4px 12px rgba(0,0,0,0.06));
  box-sizing: border-box;
}
.iv-bless-bar-row { display: flex; gap: var(--iv-gap-col, 6px); }
.iv-bless-bar-row + .iv-bless-bar-row { margin-top: var(--iv-gap-row, 7px); }
.iv-bless-mini {
  flex: 1; height: 42px; padding: 0 14px; border: none;
  border-radius: var(--iv-r-input, 8px); background: var(--iv-surface-secondary, #F7F5F6);
  font-size: var(--iv-fz-input, 14px); color: var(--iv-input-ink, #1A1A1A); outline: none; min-width: 0;
  box-sizing: border-box;
}
.iv-bless-mini.iv-bless-nick, .iv-bless-mini.iv-bless-rel { flex: 0 0 38%; }
.iv-bless-mini.iv-bless-text { flex: 1; }
.iv-bless-send-mini {
  flex: 0 0 auto; height: 42px; padding: 0 20px; border: none;
  border-radius: var(--iv-r-pill, 999px);
  font-size: var(--iv-fz-input, 14px); font-weight: 700; cursor: pointer;
  background: linear-gradient(135deg, var(--iv-brand-primary, #D65A78) 0%, var(--iv-brand-primary-dark, #B8436F) 100%);
  color: #fff; transition: transform 120ms ease;
}
.iv-bless-send-mini:active { transform: scale(0.97); }

/* ============ v1.5.4 请柬底部区品牌重设计（分享区 / 快捷 chips） ============ */

/* 深色模式 token：中性色反转（body.dark-mode 与 body.dark 兼容） */
body.dark-mode,
body.dark {
  --iv-surface-secondary: #2A2A2E;
  --iv-input-ink: #FFFFFF;
  --iv-sub: #8E8E93;
  --iv-line: rgba(255, 255, 255, 0.08);
  --iv-line-strong: rgba(255, 255, 255, 0.18);
}

/* 分享区（.iv-export）：三大操作 + 品牌淡色免费 chip */
.iv-export {
  display: flex; flex-direction: column;
  padding: 4px 0 8px;
}
.iv-share-main {
  width: 100%; height: 46px; line-height: 46px;
  border: none; border-radius: var(--iv-r-pill, 999px);
  background: linear-gradient(135deg, var(--iv-brand-primary, #D65A78) 0%, var(--iv-brand-primary-dark, #B8436F) 100%);
  color: #fff; font-size: var(--iv-fz-action, 15px); font-weight: 700;
  text-align: center; box-shadow: var(--iv-shadow-brand, 0 4px 12px rgba(214, 90, 120, 0.25));
  cursor: pointer; transition: transform 120ms ease;
}
.iv-share-main:active { transform: scale(0.97); }
.iv-share-sub { display: flex; gap: 10px; margin-top: 7px; }
.iv-share-btn {
  flex: 1; height: 40px; line-height: 38px;
  border-radius: var(--iv-r-btn-sub, 10px); text-align: center;
  font-size: var(--iv-fz-action-sub, 14px); font-weight: 600;
  background: var(--iv-surface, #fff); color: var(--iv-brand-primary, #D65A78);
  border: 1px solid var(--iv-brand-primary, #D65A78);
  box-sizing: border-box; cursor: pointer; transition: transform 120ms ease;
}
.iv-share-btn:active { transform: scale(0.97); }
.iv-share-btn.iv-locked {
  background: #F4F4F6; color: #C0C0C8; border-color: #E4E4E8; cursor: default;
}
.iv-free-badge {
  display: inline-flex; align-items: center; align-self: center;
  margin: 10px auto 0; padding: 3px 8px;
  font-size: var(--iv-fz-tip, 11px); font-weight: 500;
  color: var(--iv-brand-primary, #D65A78);
  background: var(--iv-brand-primary-soft, rgba(214, 90, 120, 0.10));
  border-radius: var(--iv-r-pill, 999px);
  text-align: center;
}
.iv-export .iv-tip {
  text-align: center; font-size: var(--iv-fz-tip, 11px); color: var(--iv-sub, #8A8A8E);
  line-height: 1.5; margin: 8px 0 0; max-width: 100%;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* 快捷祝福 chips（横滚 + 选中态高亮，位于「写下祝福」输入上方） */
.iv-quick-chips {
  display: flex; gap: 6px; overflow-x: auto;
  padding: 0 0 6px; margin-bottom: var(--iv-gap-row, 7px);
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.iv-quick-chips::-webkit-scrollbar { display: none; }
.iv-chip {
  flex: 0 0 auto; height: 28px; padding: 0 12px;
  background: var(--iv-surface, #fff); color: var(--iv-input-ink, #1A1A1A);
  border: 1px solid var(--iv-line-strong, rgba(0, 0, 0, 0.12)); border-radius: var(--iv-r-pill, 999px);
  font-size: var(--iv-fz-chip, 12px); font-weight: 500; line-height: 1;
  display: inline-flex; align-items: center; cursor: pointer;
  transition: all 120ms ease; white-space: nowrap;
}
.iv-chip:active,
.iv-chip.iv-active {
  background: var(--iv-brand-primary, #D65A78); color: #fff;
  border-color: var(--iv-brand-primary, #D65A78); font-weight: 600;
}

/* 深色模式：组件颜色反转（主按钮 / 场景色保持品牌锚点不变） */
body.dark-mode .iv-bless-dm,
body.dark .iv-bless-dm { background: rgba(0,0,0,0.5); color: #fff; }
body.dark-mode .iv-bless-bar,
body.dark .iv-bless-bar { background: rgba(28, 28, 30, 0.96); border-top-color: var(--iv-line, rgba(255, 255, 255, 0.08)); }
body.dark-mode .iv-bless-mini,
body.dark .iv-bless-mini { background: var(--iv-surface-secondary, #2A2A2E); color: var(--iv-input-ink, #fff); }
body.dark-mode .iv-share-btn,
body.dark .iv-share-btn { background: var(--iv-surface-dark, #1C1C1E); }
body.dark-mode .iv-quick-chips .iv-chip,
body.dark .iv-quick-chips .iv-chip {
  background: var(--iv-surface-dark, #1C1C1E); color: var(--iv-input-ink, #fff);
  border-color: var(--iv-line-strong, rgba(255, 255, 255, 0.18));
}
body.dark-mode .iv-export .iv-tip,
body.dark .iv-export .iv-tip { color: var(--iv-sub, #8E8E93); }
