/* =====================================================
   婚贴展示页 · 黑金大气 H5（氛围版）
   ===================================================== */
:root {
    --m-bg: #4a0e18;
    --m-bg2: #6b1523;
    --gold: #d4af37;
    --gold-light: #f0d98c;
    --gold-dim: rgba(212, 175, 55, .5);
    --m-text: #f5efe0;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body.merry {
    font-family: "STKaiti", "KaiTi", "Noto Serif SC", "PingFang SC", "Microsoft YaHei", serif;
    color: var(--m-text);
    background:
        radial-gradient(ellipse at 50% -10%, #7a1626 0%, transparent 55%),
        radial-gradient(ellipse at 50% 110%, #5c1019 0%, transparent 50%),
        linear-gradient(180deg, var(--m-bg), var(--m-bg2) 55%, var(--m-bg));
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

/* ---------- 氛围层：金色星尘 + 飘落花瓣 ---------- */
.fx-zone { position: fixed; inset: 0; pointer-events: none; z-index: 1; }
.gd { position: absolute; bottom: -20px; color: var(--gold-dim); animation: gdFloat linear forwards; }
@keyframes gdFloat {
    0% { transform: translateY(0) scale(1); opacity: 0; }
    12% { opacity: .9; }
    100% { transform: translateY(-108vh) scale(.5); opacity: 0; }
}
.petal { position: absolute; top: -34px; opacity: .8; animation: petalFall linear forwards; }
@keyframes petalFall {
    0% { transform: translateY(0) translateX(0) rotate(0); opacity: 0; }
    8% { opacity: .8; }
    50% { transform: translateY(55vh) translateX(28px) rotate(180deg); }
    100% { transform: translateY(110vh) translateX(-18px) rotate(360deg); opacity: 0; }
}

/* ---------- 音乐按钮 ---------- */
.music-btn {
    position: fixed;
    top: calc(16px + env(safe-area-inset-top));
    right: 16px;
    z-index: 60;
    width: 48px; height: 48px;
    border: 1.5px solid var(--gold);
    border-radius: 50%;
    background: rgba(74, 14, 24, .75);
    backdrop-filter: blur(8px);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 22px rgba(212, 175, 55, .4), 0 0 0 5px rgba(212, 175, 55, .1);
    transition: transform .3s;
}
.music-btn:active { transform: scale(.9); }
.mb-disc { font-size: 1.35rem; }
.music-btn.playing .mb-disc { animation: spin 3.2s linear infinite; }
.music-btn.playing { box-shadow: 0 4px 26px rgba(212, 175, 55, .65), 0 0 0 5px rgba(212, 175, 55, .22); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 滚动渐显 ---------- */
.reveal { opacity: 0; transform: translateY(34px); transition: opacity 1.1s ease, transform 1.1s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- 封面 ---------- */
.mr-hero {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 34px 18px 44px;
    position: relative;
    z-index: 2;
    overflow: hidden;
}
/* 背景大图（相册第一张）+ 深色遮罩 */
.mh-bg {
    position: absolute;
    inset: -6%;
    background-size: cover;
    background-position: center;
    filter: blur(0) brightness(.42) saturate(.85);
    transform: scale(1.06);
    animation: bgSlow 26s ease-in-out infinite alternate;
    z-index: 0;
}
@keyframes bgSlow { from { transform: scale(1.06); } to { transform: scale(1.14); } }
.mh-mask {
    position: absolute; inset: 0; z-index: 1;
    background:
        radial-gradient(ellipse at 50% 42%, rgba(74, 14, 24, .18) 0%, rgba(74, 14, 24, .72) 100%),
        linear-gradient(180deg, rgba(74, 14, 24, .55), transparent 30%, transparent 68%, var(--m-bg) 100%);
}

.mr-frame {
    position: relative;
    z-index: 2;
    width: min(560px, 94vw);
    text-align: center;
    padding: clamp(38px, 9vw, 68px) clamp(18px, 6vw, 44px);
    border: 1.5px solid var(--gold);
    border-radius: 14px;
    background: rgba(74, 14, 24, .36);
    backdrop-filter: blur(3px);
    box-shadow: 0 0 80px rgba(212, 175, 55, .16), inset 0 0 40px rgba(212, 175, 55, .05);
    animation: frameIn 1.6s ease;
}
@keyframes frameIn { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }
.mr-frame::before {
    content: '';
    position: absolute;
    inset: 7px;
    border: 1px solid var(--gold-dim);
    border-radius: 9px;
    pointer-events: none;
}
.mr-frame::after {
    content: '❦ ───────── ❦';
    position: absolute;
    bottom: -11px; left: 50%;
    transform: translateX(-50%);
    font-size: .78rem;
    letter-spacing: .18em;
    color: var(--gold);
    background: var(--m-bg);
    padding: 0 14px;
    white-space: nowrap;
}
.mr-en { letter-spacing: .34em; font-size: .72rem; color: var(--gold-light); margin-bottom: 24px; text-shadow: 0 0 14px rgba(212, 175, 55, .5); }
.mr-names {
    font-size: clamp(2rem, 9.5vw, 4.2rem);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(8px, 2.5vw, 18px);
    color: var(--gold-light);
    text-shadow: 0 2px 30px rgba(212, 175, 55, .55), 0 0 60px rgba(212, 175, 55, .25);
    font-weight: 400;
    letter-spacing: .04em;
    max-width: 100%;
}
.mr-names span { white-space: nowrap; flex-shrink: 0; }
.mr-xi {
    font-style: normal;
    font-size: .6em;
    color: #b03a48;
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    border-radius: 8px;
    padding: 3px 6px;
    box-shadow: 0 4px 20px rgba(212, 175, 55, .5);
    animation: xiBeat 2.4s ease-in-out infinite;
    text-shadow: none;
}
@keyframes xiBeat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }

.mh-divider {
    display: flex; align-items: center; gap: 14px;
    margin: 24px auto 0;
    max-width: 260px;
}
.mh-divider::before, .mh-divider::after {
    content: '';
    flex: 1; height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.mh-divider i { color: var(--gold); font-style: normal; font-size: .95rem; text-shadow: 0 0 12px rgba(212, 175, 55, .8); }

.mr-hero-date {
    margin-top: 22px;
    font-size: clamp(1.02rem, 4.2vw, 1.32rem);
    letter-spacing: .3em;
    color: var(--m-text);
    text-shadow: 0 2px 12px rgba(0, 0, 0, .6);
}
.mr-hero-city { margin-top: 10px; font-size: .9rem; letter-spacing: .18em; color: var(--gold-light); opacity: .92; }

/* 倒计时 */
.mh-countdown {
    display: flex;
    justify-content: center;
    gap: clamp(8px, 2.5vw, 16px);
    margin-top: 26px;
    flex-wrap: wrap;
    position: relative;
}
.cd-cell {
    min-width: 64px;
    border: 1px solid var(--gold-dim);
    border-radius: 12px;
    padding: 10px 8px 8px;
    background: rgba(74, 14, 24, .45);
    backdrop-filter: blur(4px);
    box-shadow: inset 0 0 16px rgba(212, 175, 55, .08);
}
.cd-cell b {
    display: block;
    font-size: clamp(1.5rem, 6vw, 2rem);
    color: var(--gold-light);
    font-family: Georgia, serif;
    line-height: 1.2;
    text-shadow: 0 0 18px rgba(212, 175, 55, .5);
}
.cd-cell span { font-size: .72rem; letter-spacing: .3em; color: var(--gold-dim); }
.cd-label {
    width: 100%;
    margin-top: 4px;
    text-align: center;
    font-size: .74rem;
    letter-spacing: .4em;
    color: var(--gold-dim);
}

.mr-scroll {
    position: relative; z-index: 2;
    margin-top: 30px;
    font-size: .72rem;
    letter-spacing: .3em;
    color: var(--gold-dim);
    animation: scrollHint 2s ease-in-out infinite;
}
@keyframes scrollHint { 0%, 100% { opacity: .35; transform: translateY(0); } 50% { opacity: 1; transform: translateY(4px); } }

/* ---------- 区块标题 ---------- */
.mr-h2 {
    font-size: clamp(1.5rem, 6vw, 2.1rem);
    letter-spacing: .28em;
    color: var(--gold-light);
    text-shadow: 0 2px 22px rgba(212, 175, 55, .4);
    display: flex; align-items: center; justify-content: center; gap: 14px;
    font-weight: 400;
}
.mr-deco { font-size: .8em; color: var(--gold-dim); }

/* ---------- 相册轮播 ---------- */
.mr-gallery { padding: 50px 16px 16px; position: relative; z-index: 2; text-align: center; }
.mr-slider {
    position: relative;
    width: min(920px, 94vw);
    margin: 26px auto 0;
    border: 1.5px solid var(--gold);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 24px 90px rgba(0, 0, 0, .65), 0 0 60px rgba(212, 175, 55, .14);
    background: #3c0c14;
}
.mr-slides { position: relative; height: clamp(300px, 58vw, 560px); }
.mr-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1.4s ease;
}
.mr-slide.on { opacity: 1; }
.mr-slide img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transform: scale(1.08);
    transition: transform 7s linear;
}
.mr-slide.on img { transform: scale(1); }
.mr-cap {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 38px 20px 18px;
    text-align: center;
    font-size: .95rem;
    letter-spacing: .16em;
    color: #fff;
    text-shadow: 0 1px 8px rgba(0, 0, 0, .8);
    background: linear-gradient(transparent, rgba(60, 12, 20, .88));
    z-index: 3;
}
.mr-dots {
    position: absolute;
    left: 0; right: 0; bottom: 12px;
    display: flex; justify-content: center; gap: 8px;
    z-index: 4;
}
.mr-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    border: 1px solid var(--gold);
    background: transparent;
    cursor: pointer;
    transition: all .3s;
    padding: 0;
}
.mr-dot.on { background: var(--gold); transform: scale(1.25); box-shadow: 0 0 10px rgba(212, 175, 55, .7); }

/* ---------- 婚礼信息 ---------- */
.mr-info { padding: 52px 16px 16px; position: relative; z-index: 2; text-align: center; }
.mr-invite-text { margin: 24px auto 0; line-height: 2.5; font-size: 1rem; max-width: 480px; color: #e8dfc8; }
.mr-invite-text b { color: var(--gold-light); font-size: 1.1em; text-shadow: 0 0 14px rgba(212, 175, 55, .3); }
.mr-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 16px;
    max-width: 860px;
    margin: 34px auto 0;
}
.mr-card {
    border: 1px solid var(--gold-dim);
    border-radius: 14px;
    padding: 28px 16px 24px;
    background: linear-gradient(160deg, rgba(212, 175, 55, .08), rgba(212, 175, 55, .02));
    position: relative;
    transition: transform .35s, box-shadow .35s;
}
.mr-card:hover { transform: translateY(-5px); box-shadow: 0 16px 44px rgba(212, 175, 55, .18); }
.mr-card::before {
    content: '';
    position: absolute; inset: 5px;
    border: 1px solid rgba(212, 175, 55, .22);
    border-radius: 10px;
    pointer-events: none;
}
.mc-icon { font-size: 1.8rem; display: block; margin-bottom: 12px; filter: drop-shadow(0 2px 10px rgba(212, 175, 55, .4)); }
.mr-card b { display: block; color: var(--gold-light); letter-spacing: .2em; font-size: .9rem; margin-bottom: 8px; font-weight: 400; }
.mr-card p { font-size: .94rem; line-height: 1.8; color: var(--m-text); }

/* ---------- 我们的故事 ---------- */
.mr-story { padding: 52px 16px 20px; position: relative; z-index: 2; }
.mr-story-inner {
    max-width: 640px;
    margin: 0 auto;
    border: 1px solid var(--gold-dim);
    border-radius: 14px;
    padding: 38px 28px;
    text-align: center;
    background: linear-gradient(160deg, rgba(212, 175, 55, .06), transparent);
    position: relative;
}
.mr-story-inner::before {
    content: '❝';
    position: absolute;
    top: -20px; left: 50%;
    transform: translateX(-50%);
    font-size: 2.4rem;
    color: var(--gold);
    background: var(--m-bg2);
    padding: 0 12px;
    line-height: 1;
    text-shadow: 0 0 16px rgba(212, 175, 55, .5);
}
.mr-story-text { margin-top: 22px; line-height: 2.8; font-size: .98rem; color: #e8dfc8; letter-spacing: .05em; }

/* ---------- 底部 ---------- */
.mr-footer {
    text-align: center;
    padding: 64px 18px calc(54px + env(safe-area-inset-bottom));
    position: relative;
    z-index: 2;
}
.mr-footer-names {
    font-size: clamp(1.5rem, 7vw, 2rem);
    color: var(--gold-light);
    display: flex; align-items: center; justify-content: center; gap: 12px;
    text-shadow: 0 2px 26px rgba(212, 175, 55, .45);
}
.mr-footer-names span { white-space: nowrap; flex-shrink: 0; }
.mr-footer > p { margin-top: 12px; letter-spacing: .34em; font-size: .84rem; color: var(--gold-dim); }

/* ---------- 编辑浮动按钮 ---------- */
.edit-fab {
    position: fixed;
    right: 16px;
    bottom: calc(24px + env(safe-area-inset-bottom));
    z-index: 60;
    width: 52px; height: 52px;
    border: 1.5px solid var(--gold);
    border-radius: 50%;
    background: rgba(74, 14, 24, .8);
    backdrop-filter: blur(8px);
    font-size: 1.3rem;
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(212, 175, 55, .35);
    transition: transform .3s, box-shadow .3s;
}
.edit-fab:hover { transform: scale(1.1); box-shadow: 0 8px 30px rgba(212, 175, 55, .55); }
.edit-fab:active { transform: scale(.92); }

/* ---------- 编辑面板 ---------- */
.edit-mask {
    display: none;
    position: fixed; inset: 0; z-index: 100;
    background: rgba(40, 6, 12, .68);
    backdrop-filter: blur(6px);
    align-items: flex-end;
    justify-content: center;
}
.edit-mask.open { display: flex; }
.edit-panel {
    width: min(680px, 100vw);
    max-height: 88vh;
    background: linear-gradient(170deg, #5f1322, #4a0e18);
    border: 1px solid var(--gold-dim);
    border-radius: 22px 22px 0 0;
    padding: 0 22px calc(20px + env(safe-area-inset-bottom));
    overflow-y: auto;
    animation: panelUp .4s ease;
}
@keyframes panelUp { from { transform: translateY(60px); opacity: 0; } to { transform: none; opacity: 1; } }
.ep-head {
    position: sticky; top: 0;
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 2px 14px;
    background: linear-gradient(170deg, #5f1322, #4a0e18);
    border-bottom: 1px solid rgba(212, 175, 55, .25);
    margin-bottom: 16px;
    z-index: 2;
}
.ep-head b { color: var(--gold-light); font-size: 1.05rem; letter-spacing: .08em; }
.ep-close {
    border: none; background: none;
    font-size: 1.7rem; color: var(--gold-dim);
    cursor: pointer; line-height: 1;
}
.ep-close:hover { color: var(--gold-light); }

.ep-auth { text-align: center; padding: 26px 0 34px; }
.epa-tip { color: var(--gold-light); margin-bottom: 16px; font-size: .95rem; }
#ep-auth-form { display: flex; gap: 10px; justify-content: center; }
#ep-auth-form input {
    width: min(260px, 60vw);
    padding: 11px 16px;
    border: 1.5px solid var(--gold-dim);
    border-radius: 10px;
    background: rgba(255, 255, 255, .06);
    color: var(--m-text);
    text-align: center;
    font-size: .95rem;
    outline: none;
}
#ep-auth-form input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212, 175, 55, .18); }

.ep-sec { color: var(--gold-light); font-size: .85rem; font-weight: 700; letter-spacing: .1em; margin: 18px 0 10px; }
.ep-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ep-grid label { display: flex; flex-direction: column; gap: 4px; font-size: .78rem; color: #b8a9d6; }
.ep-grid .ep-wide { grid-column: span 2; }
.ep-grid input, .ep-grid textarea {
    font-family: inherit;
    font-size: .9rem;
    color: var(--m-text);
    padding: 9px 12px;
    border: 1.5px solid rgba(212, 175, 55, .3);
    border-radius: 10px;
    background: rgba(255, 255, 255, .05);
    outline: none;
}
.ep-grid input:focus, .ep-grid textarea:focus { border-color: var(--gold); }
.ep-grid textarea { resize: vertical; }

.ep-btn {
    display: inline-block;
    margin-top: 12px;
    padding: 10px 26px;
    border: 1.5px solid var(--gold);
    border-radius: 999px;
    background: linear-gradient(120deg, rgba(212, 175, 55, .2), rgba(212, 175, 55, .08));
    color: var(--gold-light);
    font-family: inherit;
    font-size: .9rem;
    letter-spacing: .1em;
    cursor: pointer;
    transition: all .25s;
}
.ep-btn:hover { background: linear-gradient(120deg, var(--gold), #b8941f); color: #2e080f; box-shadow: 0 6px 22px rgba(212, 175, 55, .4); }
.ep-btn-sm { padding: 8px 18px; font-size: .82rem; margin-top: 0; }

.ep-upload { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ep-upload input[type="file"] { flex: 1.2; min-width: 170px; font-size: .82rem; color: #b8a9d6; }
.ep-upload input[type="text"] {
    flex: 1; min-width: 120px; font-size: .84rem;
    padding: 8px 10px; border: 1.5px solid rgba(212, 175, 55, .3);
    border-radius: 8px; background: rgba(255, 255, 255, .05); color: var(--m-text); outline: none;
}
.ep-hint { margin-top: 6px; font-size: .74rem; color: #8f7fae; }
.ep-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-top: 12px; }
.ep-photo { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid rgba(212, 175, 55, .3); }
.ep-photo img { width: 100%; height: 78px; object-fit: cover; display: block; }
.ep-photo button {
    position: absolute; top: 4px; right: 4px;
    border: none; border-radius: 6px;
    background: rgba(176, 58, 72, .92); color: #fff;
    font-size: .7rem; padding: 3px 7px; cursor: pointer;
}

/* ---------- Toast ---------- */
.toast {
    position: fixed; bottom: 90px; left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: linear-gradient(120deg, var(--gold), #b8941f);
    color: #2e080f;
    padding: 11px 26px;
    border-radius: 999px;
    font-size: .88rem;
    letter-spacing: .05em;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(212, 175, 55, .4);
    opacity: 0; pointer-events: none;
    transition: opacity .35s, transform .35s;
    z-index: 120;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- H5 移动端 ---------- */
@media (max-width: 640px) {
    .mr-names { letter-spacing: .02em; }
    .mr-hero-date { letter-spacing: .16em; }
    .mr-cards { grid-template-columns: 1fr; }
    .music-btn { width: 42px; height: 42px; }
    .mb-disc { font-size: 1.15rem; }
    .mr-slides { height: 62vw; }
    .ep-grid { grid-template-columns: 1fr; }
    .ep-grid .ep-wide { grid-column: span 1; }
    .cd-cell { min-width: 56px; }
    #ep-auth-form { flex-direction: column; align-items: center; }
    .edit-fab { width: 46px; height: 46px; font-size: 1.1rem; }
}
