/* ========================================
   婚礼邀请函 H5 · 清新简约风格
   温泉 & 刘纪玲
   ======================================== */

/* ---- 字体引入 ---- */
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@300;400;500;600&family=Noto+Sans+SC:wght@300;400;500&family=Playfair+Display:ital,wght@0,400;0,500;1,400&display=swap');

/* ---- 重置 ---- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #FFFBF8;
    color: #4A4A4A;
    line-height: 1.8;
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
    /* 禁止橡皮筋滚动 */
    overscroll-behavior: none;
}

a { text-decoration: none; color: inherit; }

/* ---- 颜色变量 ---- */
:root {
    --c-bg: #FFFBF8;
    --c-rose: #E8B4B8;
    --c-rose-light: #F5E0E3;
    --c-sage: #A8C4A2;
    --c-sage-light: #D9E8D5;
    --c-gold: #D4AF7A;
    --c-text: #4A4A4A;
    --c-text-light: #9B9B9B;
    --c-text-muted: #C4C4C4;
    --c-line: #E8E0DC;
    --font-serif: 'Noto Serif SC', 'Songti SC', serif;
    --font-display: 'Playfair Display', serif;
    --font-sans: 'Noto Sans SC', sans-serif;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-top: env(safe-area-inset-top, 0px);
}

/* ========================================
   加载层
   ======================================== */
.loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--c-bg);
    transition: opacity 0.6s ease;
}
.loader.hidden {
    opacity: 0;
    pointer-events: none;
}
.loader-heart {
    font-size: 36px;
    color: var(--c-rose);
    animation: heartbeat 1.2s ease-in-out infinite;
}
.loader-text {
    margin-top: 16px;
    font-size: 13px;
    color: var(--c-text-light);
    letter-spacing: 1px;
}
@keyframes heartbeat {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.15); opacity: 1; }
}

/* ========================================
   翻页容器
   ======================================== */
.container {
    height: 100vh;
    height: 100dvh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.container::-webkit-scrollbar { display: none; }

.page {
    height: 100vh;
    height: 100dvh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 0 24px;
    padding-top: var(--safe-top);
    padding-bottom: var(--safe-bottom);
}

/* ---- 通用入场动画 ---- */
[data-anim] {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}
[data-anim].animated {
    opacity: 1;
    transform: translateY(0);
}
/* 逐级延迟 */
[data-anim]:nth-child(1) { transition-delay: 0.1s; }
[data-anim]:nth-child(2) { transition-delay: 0.25s; }
[data-anim]:nth-child(3) { transition-delay: 0.4s; }
[data-anim]:nth-child(4) { transition-delay: 0.55s; }
[data-anim]:nth-child(5) { transition-delay: 0.7s; }
[data-anim]:nth-child(6) { transition-delay: 0.85s; }

/* ========================================
   第1页 · 封面
   ======================================== */
.page-cover {
    padding: 0;
}
.cover-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    /* 如有照片，取消下行注释并替换路径 */
    /* background-image: url('../photos/cover.jpg'); */
}
.cover-placeholder-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: rgba(155, 155, 155, 0.5);
    font-size: 14px;
    line-height: 2;
}
.cover-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(255, 251, 248, 0.3) 0%,
        rgba(255, 251, 248, 0.1) 40%,
        rgba(255, 251, 248, 0.5) 80%,
        rgba(255, 251, 248, 0.8) 100%
    );
}
.cover-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 0 30px;
}
.cover-save-date {
    font-family: var(--font-display);
    font-size: 13px;
    letter-spacing: 4px;
    color: var(--c-gold);
    margin-bottom: 24px;
    text-transform: uppercase;
}
.cover-names {
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: clamp(2rem, 8vw, 2.8rem);
    color: var(--c-text);
    line-height: 1.4;
    letter-spacing: 4px;
}
.cover-names .name {
    display: inline-block;
}
.cover-names .amp {
    display: inline-block;
    margin: 0 12px;
    font-family: var(--font-display);
    font-style: italic;
    color: var(--c-rose);
    font-size: 0.8em;
    vertical-align: middle;
}
.cover-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 28px auto;
}
.cover-divider .line {
    width: 50px;
    height: 1px;
    background: var(--c-rose);
    opacity: 0.5;
}
.cover-divider .heart {
    color: var(--c-rose);
    font-size: 14px;
}
.cover-invite {
    font-size: 14px;
    color: var(--c-text-light);
    letter-spacing: 2px;
}
.enter-btn {
    position: absolute;
    bottom: 14%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--c-rose);
    color: var(--c-rose);
    padding: 12px 32px;
    font-size: 14px;
    letter-spacing: 2px;
    border-radius: 40px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-sans);
}
.enter-btn:active {
    transform: translateX(-50%) scale(0.95);
    background: var(--c-rose);
    color: #fff;
}

/* ========================================
   第2页 · 我们的故事
   ======================================== */
.section-inner {
    width: 100%;
    max-width: 420px;
    text-align: center;
}
.section-title {
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: 1.5rem;
    color: var(--c-text);
    margin-bottom: 8px;
    letter-spacing: 3px;
}
.section-subtitle {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 12px;
    color: var(--c-text-muted);
    margin-bottom: 36px;
}
.timeline {
    text-align: left;
    padding: 0 12px;
    position: relative;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 60px;
    top: 12px;
    bottom: 12px;
    width: 1px;
    background: linear-gradient(180deg, var(--c-rose) 0%, var(--c-sage) 100%);
    opacity: 0.4;
}
.timeline-item {
    position: relative;
    padding-left: 90px;
    margin-bottom: 28px;
}
.timeline-item:last-child { margin-bottom: 0; }
.timeline-date {
    position: absolute;
    left: 0;
    top: 2px;
    font-size: 12px;
    color: var(--c-gold);
    font-weight: 500;
    letter-spacing: 0.5px;
    width: 52px;
    text-align: right;
}
.timeline-dot {
    position: absolute;
    left: 56px;
    top: 6px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--c-rose);
    border: 2px solid var(--c-bg);
    box-shadow: 0 0 0 2px var(--c-rose-light);
}
.timeline-dot.highlight {
    background: var(--c-sage);
    box-shadow: 0 0 0 2px var(--c-sage-light);
    width: 11px;
    height: 11px;
    left: 55px;
    top: 5px;
}
.timeline-content h3 {
    font-family: var(--font-serif);
    font-size: 15px;
    font-weight: 500;
    color: var(--c-text);
    margin-bottom: 4px;
}
.timeline-content p {
    font-size: 13px;
    color: var(--c-text-light);
    line-height: 1.7;
}

/* ========================================
   第3页 · 婚纱照画廊
   ======================================== */
.gallery-inner {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.wedding-swiper {
    width: 100%;
    max-width: 360px;
    margin: 20px auto;
    border-radius: 12px;
    overflow: hidden;
}
.wedding-swiper .swiper-slide {
    aspect-ratio: 3 / 4;
    border-radius: 12px;
    overflow: hidden;
}
/* 照片占位样式 */
.photo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
}
.photo-placeholder span {
    font-size: 18px;
    letter-spacing: 2px;
    margin-bottom: 6px;
}
.photo-placeholder small {
    font-size: 11px;
    opacity: 0.7;
}
/* 有真实照片时用这个样式 */
.wedding-swiper .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.swiper-pagination-bullet {
    background: var(--c-text-muted);
    opacity: 0.5;
}
.swiper-pagination-bullet-active {
    background: var(--c-rose);
    opacity: 1;
}
.gallery-hint {
    font-size: 12px;
    color: var(--c-text-muted);
    letter-spacing: 1px;
    margin-top: 16px;
}

/* ========================================
   第4页 · 婚礼信息 + 倒计时
   ======================================== */
.info-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--c-line);
    border-radius: 16px;
    padding: 28px 24px;
    margin: 20px auto 0;
    max-width: 340px;
    width: 100%;
}
.info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
}
.info-label {
    font-size: 13px;
    color: var(--c-text-light);
    letter-spacing: 2px;
}
.info-value {
    font-family: var(--font-serif);
    font-size: 15px;
    font-weight: 500;
    color: var(--c-text);
}
.info-divider {
    height: 1px;
    background: var(--c-line);
    margin: 0 4px;
}
.countdown-block {
    margin-top: 32px;
    text-align: center;
}
.countdown-title {
    font-size: 13px;
    color: var(--c-text-light);
    letter-spacing: 3px;
    margin-bottom: 16px;
}
.countdown-timer {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 4px;
}
.cd-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 52px;
}
.cd-num {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 500;
    color: var(--c-rose);
    line-height: 1;
}
.cd-label {
    font-size: 11px;
    color: var(--c-text-muted);
    margin-top: 6px;
    letter-spacing: 1px;
}
.cd-sep {
    font-family: var(--font-display);
    font-size: 1.4rem;
    color: var(--c-text-muted);
    line-height: 1.8;
    margin: 0 2px;
}

/* ========================================
   第5页 · 地图导航
   ======================================== */
.venue-name {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--c-text);
    margin-top: 8px;
}
.venue-address {
    font-size: 13px;
    color: var(--c-text-light);
    margin-top: 6px;
    margin-bottom: 24px;
}
.map-placeholder {
    width: 100%;
    max-width: 340px;
    aspect-ratio: 16 / 10;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--c-line);
    background: #f5f5f5;
    margin-bottom: 24px;
}
.map-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 280px;
}
.map-btn {
    display: block;
    text-align: center;
    padding: 12px;
    border-radius: 30px;
    font-size: 14px;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    border: 1px solid;
}
.map-btn:active { transform: scale(0.97); }
.map-btn.amap {
    background: #fff;
    border-color: #0090FF;
    color: #0090FF;
}
.map-btn.bmap {
    background: #fff;
    border-color: #2932E1;
    color: #2932E1;
}
.map-btn.apple {
    background: #fff;
    border-color: var(--c-text-muted);
    color: var(--c-text-light);
}

/* ========================================
   第6页 · 结尾
   ======================================== */
.end-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.end-decoration {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}
.end-decoration .line {
    width: 40px;
    height: 1px;
    background: var(--c-rose);
    opacity: 0.5;
}
.end-decoration .heart {
    color: var(--c-rose);
    font-size: 14px;
}
.end-title {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    font-weight: 500;
    color: var(--c-text);
    letter-spacing: 4px;
    margin-bottom: 24px;
}
.end-quote {
    font-family: var(--font-serif);
    font-size: 14px;
    color: var(--c-text-light);
    line-height: 2;
    font-style: italic;
    margin-bottom: 32px;
}
.end-names {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    color: var(--c-text);
    letter-spacing: 4px;
}
.end-names .amp {
    font-family: var(--font-display);
    font-style: italic;
    color: var(--c-rose);
    margin: 0 10px;
    font-size: 0.8em;
}
.end-date {
    font-size: 13px;
    color: var(--c-gold);
    margin-top: 8px;
    letter-spacing: 2px;
}
.end-thanks {
    margin-top: 40px;
    font-size: 13px;
    color: var(--c-text-muted);
    line-height: 2;
}

/* ========================================
   音乐控制按钮
   ======================================== */
.music-btn {
    position: fixed;
    top: calc(16px + var(--safe-top));
    right: 16px;
    z-index: 100;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--c-line);
    color: var(--c-rose);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}
.music-btn[hidden] { display: none; }
.music-btn.playing {
    animation: musicSpin 4s linear infinite;
    color: var(--c-sage);
    border-color: var(--c-sage);
}
@keyframes musicSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ========================================
   页面指示器
   ======================================== */
.page-indicator {
    position: fixed;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--c-text-muted);
    opacity: 0.3;
    transition: all 0.3s ease;
}
.dot.active {
    background: var(--c-rose);
    opacity: 1;
    height: 18px;
    border-radius: 3px;
}

/* ========================================
   翻页提示
   ======================================== */
.scroll-hint {
    position: fixed;
    bottom: calc(20px + var(--safe-bottom));
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    color: var(--c-rose);
    opacity: 0.6;
    animation: bounce 1.5s ease-in-out infinite;
    transition: opacity 0.3s ease;
}
.scroll-hint.hidden { opacity: 0; pointer-events: none; }
@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(8px); }
}

/* ========================================
   响应式适配
   ======================================== */
@media (max-width: 360px) {
    .cover-names { font-size: 1.7rem; letter-spacing: 2px; }
    .section-title { font-size: 1.3rem; }
    .cd-num { font-size: 1.5rem; }
    .cd-unit { min-width: 44px; }
    .timeline-item { padding-left: 80px; }
    .timeline::before { left: 52px; }
    .timeline-dot { left: 48px; }
    .timeline-date { width: 44px; font-size: 11px; }
}

/* 平板/桌面适配 */
@media (min-width: 768px) {
    .section-inner { max-width: 500px; }
    .wedding-swiper { max-width: 420px; }
    .cover-names { font-size: 3rem; }
}

/* ========================================
   微信特殊处理
   ======================================== */
/* 禁止长按弹出菜单 */
body { -webkit-touch-callout: none; }
img { -webkit-user-drag: none; }

/* 微信横屏适配 */
@media (orientation: landscape) and (max-height: 500px) {
    .page {
        height: auto;
        min-height: 100vh;
        padding: 40px 24px;
    }
}
