/* =====================================================
   婚礼记 H5 - 公共样式(移动端优先，粉色婚礼主题)
   ===================================================== */
:root {
  --pink: #e8748a;        /* 主色-粉 */
  --pink-dark: #d15a72;
  --pink-light: #fdf0f2;
  --gold: #c9a86a;        /* 点缀-金 */
  --ink: #4a3b3e;         /* 正文深色 */
  --ink-light: #8a7a7d;   /* 次要文字 */
  --bg: #fff9f5;          /* 页面底色-奶油 */
  --card: #ffffff;
  --line: #f3e3e6;
  --radius: 14px;
  --shadow: 0 4px 16px rgba(232, 116, 138, .08);
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.6; min-height: 100vh;
}
a { color: var(--pink); text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 1rem; color: var(--ink); }

/* ---------- 布局 ---------- */
.page { max-width: 520px; margin: 0 auto; padding: 16px 16px 90px; }
.page-wide { max-width: 1100px; }
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; margin-bottom: 14px;
}
.row { display: flex; gap: 10px; align-items: center; }
.row-between { display: flex; justify-content: space-between; align-items: center; }
.grow { flex: 1; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mb8 { margin-bottom: 8px; }
.tc { text-align: center; }
.muted { color: var(--ink-light); font-size: .85rem; }
.danger { color: #e05656; }

/* ---------- 顶部导航 ---------- */
.navbar {
  position: sticky; top: 0; z-index: 50; background: rgba(255, 249, 245, .95);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.navbar-inner { max-width: 520px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 10px; }
.navbar .logo { font-weight: 700; color: var(--pink); font-size: 1.15rem; letter-spacing: 1px; }
.navbar .back { color: var(--ink); font-size: 1.2rem; line-height: 1; padding: 2px 8px 2px 0; }

/* ---------- 底部标签栏 ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  background: #fff; border-top: 1px solid var(--line);
  display: flex; justify-content: space-around; padding: 6px 0 max(6px, env(safe-area-inset-bottom));
}
.tabbar a { flex: 1; text-align: center; color: var(--ink-light); font-size: .72rem; padding: 4px 0; }
.tabbar a .ico { display: block; font-size: 1.25rem; line-height: 1.3; }
.tabbar a.active { color: var(--pink); font-weight: 600; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block; border: none; border-radius: 999px; cursor: pointer;
  background: linear-gradient(135deg, var(--pink), #f09ca8); color: #fff;
  padding: 11px 26px; font-size: 1rem; font-weight: 600; letter-spacing: 1px;
  box-shadow: 0 4px 12px rgba(232, 116, 138, .3); transition: opacity .15s;
}
.btn:active { opacity: .8; }
.btn:disabled { opacity: .5; }
.btn-outline {
  background: #fff; color: var(--pink); border: 1.5px solid var(--pink); box-shadow: none;
}
.btn-sm { padding: 6px 14px; font-size: .85rem; }
.btn-ghost { background: var(--pink-light); color: var(--pink-dark); box-shadow: none; }
.btn-danger { background: #fff; color: #e05656; border: 1.5px solid #e05656; box-shadow: none; }
.btn-block { display: block; width: 100%; text-align: center; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: .88rem; color: var(--ink-light); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: 10px;
  padding: 11px 14px; background: #fff; outline: none; transition: border .15s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--pink); }
.field textarea { resize: vertical; min-height: 80px; }

/* ---------- 列表/标签 ---------- */
.tag {
  display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .75rem;
  background: var(--pink-light); color: var(--pink-dark); margin-right: 6px;
}
.tag-green { background: #eef8ee; color: #4a9a4a; }
.tag-gray { background: #f2f2f2; color: #888; }
.tag-gold { background: #faf3e6; color: var(--gold); }
.list-item {
  background: #fff; border-radius: 12px; padding: 14px; margin-bottom: 10px;
  box-shadow: var(--shadow);
}
.empty { text-align: center; color: var(--ink-light); padding: 40px 0; font-size: .9rem; }
.empty .big { font-size: 2.4rem; margin-bottom: 8px; }

/* ---------- 首页头部 ---------- */
.hero {
  text-align: center; padding: 46px 16px 30px;
  background:
    radial-gradient(circle at 20% 10%, rgba(232,116,138,.12), transparent 40%),
    radial-gradient(circle at 85% 25%, rgba(201,168,106,.15), transparent 45%);
}
.hero h1 { font-size: 1.9rem; color: var(--pink-dark); letter-spacing: 3px; }
.hero .sub { color: var(--ink-light); margin-top: 6px; letter-spacing: 2px; }
.hero .heart { font-size: 2rem; }

/* 功能宫格 */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid .item {
  background: #fff; border-radius: 14px; padding: 18px 8px; text-align: center;
  box-shadow: var(--shadow); color: var(--ink);
}
.grid .item .ico { font-size: 1.7rem; display: block; margin-bottom: 6px; }
.grid .item .name { font-size: .88rem; }

/* ---------- 请柬展示页 ---------- */
.inv-hero {
  min-height: 78vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(160deg, #e8748a 0%, #d15a72 55%, #a9445e 100%);
  padding: 40px 20px;
}
.inv-hero.has-cover { background-size: cover; background-position: center; }
.inv-hero.has-cover::after { content: ''; position: absolute; inset: 0; background: rgba(60, 20, 30, .45); }
.inv-hero > * { position: relative; z-index: 1; }
.inv-hero .we-invite { letter-spacing: 8px; font-size: .9rem; opacity: .9; margin-bottom: 18px; }
.inv-hero .names {
  font-family: "Songti SC", "STSong", "SimSun", serif; font-size: 2.5rem; font-weight: 700;
  text-shadow: 0 2px 10px rgba(0,0,0,.25); margin-bottom: 12px;
}
.inv-hero .names .amp { font-size: 1.6rem; margin: 0 10px; color: var(--gold); }
.inv-hero .date { font-size: 1.05rem; letter-spacing: 2px; }
.inv-hero .lunar { font-size: .85rem; opacity: .85; margin-top: 4px; }

/* 倒计时 */
.countdown { display: flex; justify-content: center; gap: 14px; margin: 26px 0; }
.countdown .cell {
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.35);
  border-radius: 10px; padding: 10px 14px; min-width: 68px; text-align: center;
}
.countdown .num { font-size: 1.5rem; font-weight: 700; }
.countdown .lab { font-size: .72rem; opacity: .85; }

.section-title {
  text-align: center; margin: 26px 0 16px; color: var(--pink-dark); letter-spacing: 3px;
  font-size: 1.15rem; font-weight: 600;
}
.section-title::before, .section-title::after { content: '❀'; color: var(--gold); font-size: .8rem; margin: 0 10px; vertical-align: 3px; }

/* 祝福卡片 */
.bless-card { background: #fff; border-radius: 12px; padding: 14px; margin-bottom: 10px; box-shadow: var(--shadow); }
.bless-card .who { color: var(--pink-dark); font-weight: 600; font-size: .9rem; }
.bless-card .txt { margin-top: 4px; }
.bless-card .time { font-size: .75rem; color: var(--ink-light); margin-top: 4px; }

/* 相册九宫格 */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.photo-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.album-cover { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 10px; }

/* 弹窗 */
.mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 90;
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.mask.show { display: flex; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 420px; padding: 22px; max-height: 86vh; overflow-y: auto; }
.modal h3 { color: var(--pink-dark); margin-bottom: 14px; text-align: center; }

/* 分享面板二维码 */
.share-qr { display: flex; justify-content: center; }
.share-qr img, .share-qr canvas {
  border: 8px solid #fff; border-radius: 10px;
  box-shadow: 0 2px 14px rgba(214, 108, 122, .18);
}

/* toast 提示 */
#toast {
  position: fixed; left: 50%; bottom: 18%; transform: translateX(-50%) translateY(20px);
  background: rgba(60, 40, 45, .9); color: #fff; padding: 10px 22px; border-radius: 999px;
  font-size: .9rem; z-index: 99; opacity: 0; pointer-events: none; transition: all .25s;
  max-width: 80vw; text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 管理后台专用(桌面) ---------- */
@media (min-width: 768px) { .page { padding-top: 24px; } }

/* ---------- 婚礼MV ---------- */
.mv-box { border-radius: 14px; overflow: hidden; background: #000; box-shadow: var(--shadow); }
.mv-box video, .mv-box iframe { width: 100%; display: block; aspect-ratio: 16 / 9; border: 0; background: #000; }
.mv-empty { text-align: center; padding: 26px 16px; }

/* ---------- 请柬模板(12 套) ---------- */
/* 模板变量: --g1/--g2/--g3 封面渐变, --acc 主强调色, --acc2 点缀色, --acc-soft 浅底 */
.tpl-pink      { --g1:#e8748a; --g2:#d15a72; --g3:#a9445e; --acc:#d15a72; --acc2:#e9c46a; --acc-soft:#fdf0f2; }
.tpl-redgold   { --g1:#c0392f; --g2:#a02c24; --g3:#6e1712; --acc:#b3282d; --acc2:#e9c46a; --acc-soft:#fdeeee; }
.tpl-forest    { --g1:#8db5a0; --g2:#639178; --g3:#43695a; --acc:#5c8a6e; --acc2:#d9c087; --acc-soft:#eef5ef; }
.tpl-starry    { --g1:#3d5091; --g2:#2b3a67; --g3:#1a2444; --acc:#4a5fa5; --acc2:#cfd8ff; --acc-soft:#eef1fb; }
.tpl-champagne { --g1:#d8bf94; --g2:#c2a26c; --g3:#96774a; --acc:#a8894f; --acc2:#fff6e3; --acc-soft:#faf4e8; }
.tpl-morandi   { --g1:#b3a3b8; --g2:#95829c; --g3:#6f5c77; --acc:#7c6a80; --acc2:#e8d9c5; --acc-soft:#f4eff5; }
.tpl-ocean     { --g1:#63b1c9; --g2:#3f8aa5; --g3:#28637d; --acc:#2f7a94; --acc2:#ffe1b8; --acc-soft:#eaf5f8; }
.tpl-minimal   { --g1:#5a5a5a; --g2:#383838; --g3:#1b1b1b; --acc:#3a3a3a; --acc2:#d9b36a; --acc-soft:#f2f2f2; }
.tpl-sunset    { --g1:#f2a05e; --g2:#e07b41; --g3:#b85527; --acc:#d96b3c; --acc2:#ffe3c4; --acc-soft:#fdf1e7; }
.tpl-sakura    { --g1:#f6b8cd; --g2:#e28fad; --g3:#c2698d; --acc:#c96f95; --acc2:#a4d8cd; --acc-soft:#fdeff4; }
.tpl-vintage   { --g1:#b98a63; --g2:#96683f; --g3:#6b462a; --acc:#7d543a; --acc2:#d8c49a; --acc-soft:#f7f0e6; }
.tpl-aurora    { --g1:#7fc4b0; --g2:#6f9cb8; --g3:#7f6fae; --acc:#5f8fae; --acc2:#f4d9a0; --acc-soft:#eef6f3; }

/* 应用模板变量到请柬页各元素 */
body[class*="tpl-"] .inv-hero { background: linear-gradient(160deg, var(--g1) 0%, var(--g2) 55%, var(--g3) 100%); }
body[class*="tpl-"] .inv-hero .names .amp { color: var(--acc2); }
body[class*="tpl-"] .section-title { color: var(--acc); }
body[class*="tpl-"] .section-title::before, body[class*="tpl-"] .section-title::after { color: var(--acc2); }
body[class*="tpl-"] .bless-card .who { color: var(--acc); }
body[class*="tpl-"] .card { border-top: 3px solid var(--acc-soft); }
/* 中式红金/复古模板使用楷体标题更有韵味 */
.tpl-redgold .inv-hero .names, .tpl-vintage .inv-hero .names,
.tpl-redgold #inv-text, .tpl-vintage #inv-text { font-family: "Kaiti SC", "STKaiti", "KaiTi", "Songti SC", serif; }
.tpl-minimal .inv-hero .names { letter-spacing: 6px; font-weight: 300; }

/* ---------- 编辑页模板墙 ---------- */
.tpl-wall { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tpl-item {
  border-radius: 12px; overflow: hidden; cursor: pointer; background: #fff;
  border: 2px solid transparent; box-shadow: var(--shadow); transition: transform .15s, border-color .15s;
  position: relative;
}
.tpl-item:active { transform: scale(.96); }
.tpl-item.active { border-color: var(--pink); }
.tpl-item.active::after {
  content: '✓ 已选用'; position: absolute; top: 6px; right: 6px; background: var(--pink);
  color: #fff; font-size: .65rem; padding: 2px 7px; border-radius: 20px;
}
.tpl-item .swatch { height: 62px; position: relative; }
.tpl-item .swatch i {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  font-style: normal; color: #fff; font-size: 1.05rem; text-shadow: 0 1px 6px rgba(0,0,0,.35); white-space: nowrap;
}
.tpl-item .cap { font-size: .74rem; text-align: center; padding: 6px 2px; color: var(--ink); }

