/* ================= 0. 全局定义与新配色 ================= */
:root {
    --primary: #ff8fa3;       
    --primary-dark: #ff4d6d;  
    --primary-light: #fff0f3; 
    --text-main: #594a4e;     
    --bg-tint: #fff5f7;       
    --glass: rgba(255, 255, 255, 0.7);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Noto Serif SC', serif;
    background-color: var(--bg-tint);
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
}

body.no-scroll {
    overflow: hidden !important; /* 强制锁定滚动 */
    height: 100vh;
}

/* ================= 1. 动态背景元素 ================= */
.bg-animation {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 9999; overflow: hidden; pointer-events: none;
}
.bg-shape, .bg-heart {
    position: absolute; bottom: -50px;
    animation: floatUp linear infinite; opacity: 0;
}
.bg-shape { background: rgba(255, 220, 154, 0.518); border-radius: 50%; }
.bg-heart { color: rgba(255, 117, 140, 0.2); }

.falling-element {
    position: absolute; top: -20px;
    animation: fallDown linear infinite; opacity: 0;
    pointer-events: none;
}

.bg-shape:nth-child(1) { width: 40px; height: 40px; left: 10%; animation-duration: 10s; }
.bg-shape:nth-child(2) { width: 70px; height: 70px; left: 20%; animation-duration: 14s; background: rgba(254, 207, 239, 0.4); }
.bg-shape:nth-child(3) { width: 60px; height: 60px; left: 50%; animation-duration: 18s; }
.bg-heart:nth-child(4) { left: 15%; animation-duration: 12s; font-size: 30px; }
.bg-heart:nth-child(5) { left: 85%; animation-duration: 15s; font-size: 35px; }

@keyframes floatUp {
    0% { transform: translateY(0) rotate(0deg); opacity: 0; }
    20% { opacity: 0.6; }
    100% { transform: translateY(-100vh) rotate(360deg); opacity: 0; }
}

@keyframes fallDown {
    0% { transform: translateY(0) rotate(0deg) translateX(0); opacity: 0; }
    20% { opacity: 0.8; }
    100% { transform: translateY(110vh) rotate(720deg) translateX(50px); opacity: 0; }
}

/* ================= 2. 顶部视差区 ================= */
header {
    position: relative; height: 60vh;
    background: url('https://images.unsplash.com/photo-1518621736915-f3b1c41bfd00?q=80&w=1920&auto=format&fit=crop') no-repeat center center/cover;
    display: flex; justify-content: center; align-items: center;
}
.overlay { position: absolute; top:0; left:0; width:100%; height:100%; background: rgba(255, 154, 158, 0.15); }

.couple-card {
    position: relative;
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 50px; padding: 30px 60px;
    display: flex; align-items: center; gap: 40px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.1);
    animation: float 6s ease-in-out infinite; z-index: 10;
    transition: all 0.5s ease;
}
.couple-card:hover {
    background: rgba(255, 255, 255, 0.55);
    box-shadow: 0 25px 60px rgba(255, 154, 158, 0.3);
    transform: translateY(-5px);
}
.avatar-img { 
    width: 130px; height: 130px; border-radius: 50%; border: 5px solid #fff; object-fit: cover; 
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
    box-shadow: 0 8px 25px rgba(255, 154, 158, 0.5);
    cursor: pointer;
}
.avatar-img:hover { transform: scale(1.1) rotate(5deg); border-color: var(--primary); }
.name { margin-top: 12px; font-weight: bold; color: #fff; text-shadow: 0 2px 4px rgba(0,0,0,0.3); font-family: 'Ma Shan Zheng'; font-size: 1.6rem;}
.heart-icon { font-size: 3rem; color: #ff6b81; animation: beat 1.2s infinite; filter: drop-shadow(0 0 8px rgba(255,107,129,0.8)); cursor: pointer; transition: 0.3s;}
.heart-icon:hover { transform: scale(1.2); }

.waves-container { position: absolute; bottom: -1px; left: 0; width: 100%; height: 12vh; z-index: 5; }
.parallax > use { animation: move-forever 25s cubic-bezier(.55,.5,.45,.5) infinite; }
.parallax > use:nth-child(1) { fill: rgba(255, 249, 249, 0.7); }
.parallax > use:nth-child(2) { fill: rgba(255, 249, 249, 0.5); }
.parallax > use:nth-child(3) { fill: rgba(255, 249, 249, 0.3); }
.parallax > use:nth-child(4) { fill: var(--bg-tint); }

/* ================= 3. 主体区域 ================= */
.main-area { background-color: var(--bg-tint); padding-bottom: 80px; position: relative; }
.container { max-width: 900px; margin: 0 auto; padding: 0 20px; position: relative; z-index: 2; }

.timer-section { text-align: center; padding: 50px 0 40px; }
.timer-title { color: var(--primary-dark); margin-bottom: 10px; font-size: 1.1rem; letter-spacing: 2px; opacity: 0.8;}
.timer-count { 
    font-family: 'ZCOOL XiaoWei', serif; font-size: 2.8rem; font-weight: bold; 
    background: -webkit-linear-gradient(45deg, var(--primary), var(--primary-dark));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

/* ================= 导航菜单 ================= */
.nav-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-bottom: 50px; }
.nav-card {
    background: #fff; 
    border-radius: 24px; 
    padding: 22px;
    display: flex; flex-direction: column; align-items: center; cursor: pointer; 
    border: none;
    box-shadow: 0 10px 20px rgba(255, 154, 158, 0.15); 
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    transform-origin: center bottom;
}
.nav-card.active { 
    background: linear-gradient(135deg, #fff 0%, #fff0f3 100%);
    box-shadow: inset 0 0 0 2px var(--primary), 0 15px 30px rgba(255, 77, 109, 0.2);
}
.nav-card:hover { transform: translateY(-5px); }
.jelly-animate { animation: jelly-soft 0.7s cubic-bezier(0.2, 0.8, 0.2, 1.1) both; }
@keyframes jelly-soft {
    0% { transform: scale(1, 1); } 25% { transform: scale(0.95, 1.05); } 
    50% { transform: scale(1.05, 0.95); } 75% { transform: scale(0.98, 1.02); } 
    100% { transform: scale(1, 1); }
}
.nav-icon { font-size: 1.8rem; margin-bottom: 10px; color: var(--primary); transition: 0.3s; }
.nav-card.active .nav-icon { color: var(--primary-dark); transform: scale(1.1); }
.nav-text { font-family: 'ZCOOL XiaoWei'; font-size: 1.1rem; color: #666; }
.nav-card.active .nav-text { color: var(--primary-dark); font-weight: bold; }

.content-display { display: none; opacity: 0; transform: translateY(20px); transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1); }
.content-display.active { display: block; opacity: 1; transform: translateY(0); }

/* ================= 4. 绚烂浪漫：升级版时间轴 ================= */
.timeline-container { position: relative; padding: 40px 0; margin-top: 20px; }

/* 中轴线：粉色流光渐变+发光 */
.timeline-container::before {
    content: ''; position: absolute; top: 0; bottom: 0; left: 50%; width: 4px; 
    background: linear-gradient(180deg, transparent, #ff9a9e, #ff6b81, #ff9a9e, transparent);
    box-shadow: 0 0 15px rgba(255, 107, 129, 0.4);
    transform: translateX(-50%); border-radius: 4px;
}

.tl-item { position: relative; width: 50%; padding: 0 35px 50px 35px; box-sizing: border-box; }
.tl-item:nth-child(odd) { left: 0; text-align: right; }
.tl-item:nth-child(even) { left: 50%; text-align: left; }

/* 节点：会呼吸的爱心图标 */
.tl-item::after {
    content: '\f004'; /* FontAwesome 爱心 */
    font-family: "Font Awesome 6 Free"; font-weight: 900;
    position: absolute; top: 25px; 
    width: 36px; height: 36px;
    background: #fff; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #ff4d6d; font-size: 1.2rem;
    border: 3px solid #ffe3e3;
    box-shadow: 0 0 15px rgba(255, 77, 109, 0.4);
    z-index: 2;
    animation: heart-beat-glow 2s infinite ease-in-out;
}
.tl-item:nth-child(odd)::after { right: -18px; } /* 修正位置 */
.tl-item:nth-child(even)::after { left: -18px; }

@keyframes heart-beat-glow {
    0%, 100% { transform: scale(1); box-shadow: 0 0 10px rgba(255, 77, 109, 0.3); }
    50% { transform: scale(1.15); box-shadow: 0 0 20px rgba(255, 77, 109, 0.6); }
}

/* 内容卡片：磨砂玻璃 + 浪漫装饰 */
.tl-content {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 20px; padding: 25px;
    box-shadow: 0 10px 30px rgba(255, 154, 158, 0.15);
    position: relative; overflow: hidden;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* 卡片顶部的彩虹渐变条 */
.tl-content::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 4px;
    background: linear-gradient(90deg, #ff9a9e, #fad0c4);
}

/* 卡片背景里的淡爱心水印 */
.tl-content::after {
    content: '\f004'; font-family: "Font Awesome 6 Free"; font-weight: 900;
    position: absolute; bottom: -20px; right: -20px;
    font-size: 8rem; color: rgba(255, 154, 158, 0.05);
    transform: rotate(-20deg); pointer-events: none;
}

.tl-content:hover { 
    transform: translateY(-8px) scale(1.02); 
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 20px 50px rgba(255, 107, 129, 0.25);
    border-color: #ffc2c2;
}

.tl-date { 
    background: linear-gradient(45deg, #ff758c, #ff7eb3);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    font-weight: bold; font-family: 'ZCOOL XiaoWei', serif; letter-spacing: 1px;
    margin-bottom: 5px;
}
.tl-title { font-size: 1.3rem; color: #444; margin-bottom: 10px; font-weight: bold; }
.tl-desc { color: #666; font-size: 1rem; line-height: 1.6; }
.tl-img { border-radius: 12px; }

/* ================= 5. 核心：拍立得图文相册 ================= */
.gallery-grid { display: block; width: 100%; }
.photo-box { 
    background: #fff; padding: 12px 12px 50px 12px;
    transform: rotate(-2deg); box-shadow: 0 8px 15px rgba(0,0,0,0.1); 
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); position: relative;
    will-change: transform;
}
.photo-box:nth-child(even) { transform: rotate(2deg); }
.photo-box:hover { 
    transform: rotate(0) scale(1.08) translateY(-10px); 
    z-index: 5; box-shadow: 0 30px 50px rgba(0,0,0,0.2); 
}
.photo-box img { height: 220px; object-fit: cover; filter: sepia(10%); }
.photo-box:hover img { filter: sepia(0); }
.photo-caption {
    position: absolute; bottom: 12px; left: 0; width: 100%; text-align: center;
    font-family: 'Ma Shan Zheng', cursive; color: #666; font-size: 1.1rem;
}

/* 恋爱清单 */
.list-item { 
    padding: 18px; border-bottom: 1px dashed rgba(255, 154, 158, 0.4); 
    display: flex; align-items: center; border-radius: 12px; margin-bottom: 10px; 
    background: rgba(255,255,255,0.7); 
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}
.list-item:hover { 
    background: #fff; padding-left: 30px; 
    transform: scale(1.02); box-shadow: 0 5px 15px rgba(255, 154, 158, 0.1); 
}
.list-item.done { color: #aaa; text-decoration: line-through; opacity: 0.8; }
.list-item.done i { color: #81ecec; }
.list-item i { margin-right: 15px; color: var(--primary); font-size: 1.2rem; }

/* ================= 6. 音乐控件 ================= */
#music-wrapper {
    position: fixed; top: 25px; right: 25px; z-index: 2000;
    display: flex; align-items: center; gap: 12px;
}
#music-toggle-btn {
    width: 55px; height: 55px;
    background: rgba(255,255,255,0.95);
    border-radius: 50%; display: flex; justify-content: center; align-items: center;
    box-shadow: 0 8px 16px rgba(255, 117, 140, 0.4);
    cursor: pointer; border: 2px solid var(--primary);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
    font-size: 1.4rem; color: var(--primary);
    position: relative; overflow: hidden;
}
#music-toggle-btn.playing { 
    animation: pulse-soft 2s infinite, spin-slow 8s linear infinite; 
    border-color: var(--primary-dark);
    box-shadow: 0 0 20px rgba(255, 154, 158, 0.6);
}
#music-toggle-btn:hover { transform: scale(1.1); background: #fff; }

#playlist-toggle-btn {
    width: 42px; height: 42px;
    background: rgba(255,255,255,0.9);
    border-radius: 50%; display: flex; justify-content: center; align-items: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1); cursor: pointer;
    color: var(--primary-dark); transition: all 0.3s ease;
    border: 1px solid rgba(255, 154, 158, 0.2);
}
#playlist-toggle-btn:hover { transform: translateY(-3px) rotate(15deg); background: #fff; box-shadow: 0 6px 15px rgba(255, 154, 158, 0.3); }

.playlist-panel {
    position: absolute; top: 70px; right: 0; width: 240px;
    background: rgba(255, 255, 255, 0.98); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-radius: 20px; box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    padding: 15px 0; display: none;
    transform-origin: top right; border: 1px solid rgba(255, 154, 158, 0.1);
}
.playlist-panel.show { display: block; animation: slideInAndScale 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
.song-item {
    padding: 14px 25px; font-size: 0.95rem; color: #555; cursor: pointer; transition: all 0.25s ease;
    display: flex; align-items: center; border-left: 4px solid transparent;
}
.song-item:hover { background: #fff0f3; color: var(--primary); padding-left: 30px; }
.song-item.active { color: var(--primary-dark); font-weight: bold; background: #fff5f7; border-left-color: var(--primary); }
.song-item i { margin-right: 12px; font-size: 0.8rem; opacity: 0.6; transition: 0.3s; }
.song-item.active i { opacity: 1; transform: scale(1.2) rotate(10deg); }

/* ================= 移动端适配 (已包含之前的修复) ================= */
@media (max-width: 768px) {
    .timeline-container::before { left: 24px; } /* 移动端轴线位置调整 */
    .tl-item { width: 100%; padding-left: 60px; padding-right: 10px; text-align: left; }
    .tl-item:nth-child(odd), .tl-item:nth-child(even) { left: 0; text-align: left; }
    
    /* 修正移动端爱心节点位置 */
    .tl-item::after { left: 4px !important; right: auto !important; } 
    .tl-item:nth-child(odd)::after { left: 4px !important; right: auto !important; }
    
    .nav-grid { gap: 15px; }
    .nav-card { padding: 15px; border-radius: 18px; }
    
    #music-wrapper { top: 15px; right: 15px; }
    
    /* 核心：情侣卡片修复 */
    .couple-card {
        width: 90%; 
        justify-content: center; 
        padding: 20px 0; 
        margin: 0 auto;
        gap: 15px;
    }

    .avatar-img {
        width: 75px; 
        height: 75px;
        border-width: 3px;
        box-shadow: 0 4px 10px rgba(255, 154, 158, 0.4); 
    }

    .heart-icon { font-size: 1.8rem; }
    .name { font-size: 1rem; margin-top: 8px; }
    .timer-count { font-size: 1.8rem; }
}

/* 基础动画 */
@keyframes float { 0%,100% {transform: translateY(0);} 50% {transform: translateY(-12px);} }
@keyframes beat { 0%,100% {transform: scale(1);} 50% {transform: scale(1.3);} }
@keyframes move-forever { 0% { transform: translate3d(-90px,0,0); } 100% { transform: translate3d(85px,0,0); } }
@keyframes slideInAndScale {
    from { opacity: 0; transform: scale(0.8) translateY(-20px) translateX(20px); }
    to { opacity: 1; transform: scale(1) translateY(0) translateX(0); }
}
@keyframes pulse-soft {
    0% { box-shadow: 0 0 0 0 rgba(255, 154, 158, 0.5); }
    70% { box-shadow: 0 0 0 15px rgba(255, 154, 158, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 154, 158, 0); }
}
@keyframes spin-slow { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* --- 图片加载占位与动画 --- */
.img-wrapper {
    position: relative;
    background: #fdf2f4;
    overflow: hidden;
    border-radius: 12px;
    margin-top: 15px;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 骨架屏扫光 */
.img-wrapper::after {
    content: "";
    position: absolute;
    top: 0; left: -100%; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    animation: shimmer 1.5s infinite;
}

.img-wrapper.loaded::after { display: none; }

.img-wrapper img {
    opacity: 0;
    transition: opacity 0.8s ease;
    width: 100%;
    display: block;
}

.img-wrapper.loaded img { opacity: 1; }

/* 专门适配拍立得相册的容器 */
.photo-box .img-wrapper {
    margin-top: 0;
    border-radius: 4px;
    min-height: 220px;
}

@keyframes shimmer {
    100% { left: 100%; }
}

/* 特效：极速烟花 */
.firework-particle {
    position: fixed; pointer-events: none; z-index: 10001;
    width: 6px; height: 6px; border-radius: 50%;
    box-shadow: 0 0 8px rgba(255, 77, 109, 0.6);
    animation: explode-fast 0.6s cubic-bezier(0, 0, 0.2, 1) forwards;
}

.firework-particle.super {
    width: 8px; height: 8px;
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.9);
}

@keyframes explode-fast {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    20% { opacity: 1; }
    100% { transform: translate(var(--tx), calc(var(--ty) + 20px)) scale(0); opacity: 0; }
}

.shockwave {
    position: fixed; pointer-events: none; z-index: 9998;
    border: 2px solid var(--primary); border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: shockwave-fast 0.5s ease-out forwards;
}

@keyframes shockwave-fast {
    0% { width: 0; height: 0; opacity: 0.8; border-width: 4px; }
    100% { width: 120px; height: 120px; opacity: 0; border-width: 0px; }
}

.drift-particle {
    position: fixed; pointer-events: none; z-index: 10000;
    font-size: 18px; 
    animation: drift-up 1s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}

@keyframes drift-up {
    0% { transform: translate(-50%, -50%) scale(0) rotate(0deg); opacity: 0; }
    20% { opacity: 1; transform: translate(-50%, -50%) scale(1.2) rotate(20deg); }
    100% { transform: translate(var(--dx), var(--dy)) scale(0.5) rotate(var(--dr)); opacity: 0; }
}

/* ================= 留言板 ================= */
.message-form {
    background: rgba(255, 255, 255, 0.9);
            padding: 30px;
            border-radius: 20px;
            box-shadow: 0 15px 35px rgba(255, 182, 193, 0.25);
            margin-bottom: 40px;
            position: relative;
            z-index: 10;
            border: 1px solid rgba(255, 255, 255, 0.8);
            backdrop-filter: blur(10px);
        }
        .form-group {
            margin-bottom: 20px;
        }
        .msg-input {
            width: 100%;
            padding: 12px 15px;
            border: 2px solid #ffe3e3;
            border-radius: 12px;
            font-size: 1rem;
            color: #555;
            outline: none;
            transition: all 0.3s;
            font-family: inherit;
            background: rgba(255, 255, 255, 0.8);
        }
        .msg-input:focus, .msg-textarea:focus {
            border-color: var(--primary);
            box-shadow: 0 0 15px rgba(255, 107, 129, 0.15);
            background: #fff;
            transform: translateY(-2px);
        }
        .msg-textarea {
            width: 100%;
            height: 120px;
            border: 2px solid #ffe3e3;
            border-radius: 15px;
            padding: 15px;
            font-size: 1rem;
            color: #555;
            resize: none;
            outline: none;
            transition: all 0.3s;
            font-family: inherit;
            background: rgba(255, 255, 255, 0.8);
        }
        .msg-btn {
            background: linear-gradient(135deg, #ff9a9e 0%, #ff6b81 100%);
            color: white;
            border: none;
            padding: 12px 35px;
            border-radius: 30px;
            font-size: 1.05rem;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            float: right;
            font-weight: bold;
            box-shadow: 0 5px 15px rgba(255, 107, 129, 0.3);
            letter-spacing: 1px;
        }
        .msg-btn:hover {
            transform: translateY(-3px) scale(1.02);
            box-shadow: 0 8px 20px rgba(255, 107, 129, 0.5);
        }
        .msg-btn:active {
            transform: translateY(-1px);
        }
        .msg-list {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 25px;
        }
        .msg-card {
            background: #fff;
            padding: 25px 25px 20px;
            border-radius: 18px;
            box-shadow: 0 8px 20px rgba(0,0,0,0.04);
            transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
            border-bottom: 4px solid #fff0f3;
            position: relative;
            overflow: hidden;
            animation: slideInAndScale 0.6s ease backwards;
            display: flex;
            flex-direction: column;
        }
        .msg-card:hover {
            transform: translateY(-8px) rotate(1deg);
            box-shadow: 0 15px 30px rgba(255, 154, 158, 0.15);
            border-bottom-color: var(--primary);
        }
        .msg-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 12px;
            padding-bottom: 12px;
            border-bottom: 1px dashed #eee;
        }
        .msg-nickname {
            font-weight: bold;
            color: var(--primary-dark);
            font-size: 1.05rem;
            display: flex; align-items: center;
        }
        .msg-nickname::before {
            content: '';
            display: inline-block;
            width: 8px; height: 8px;
            background: var(--primary);
            border-radius: 50%;
            margin-right: 8px;
        }
        .msg-time {
            font-size: 0.75rem;
            color: #ccc;
        }
        .msg-text {
            color: #666;
            line-height: 1.7;
            font-size: 0.95rem;
            white-space: pre-wrap;
            flex-grow: 1;
        }

/* ================= 7. 相册升级 (Lightbox & Albums) ================= */

/* 相册列表样式 */
.album-grid {
    display: flex;
    flex-direction: column; /* 改为垂直列表 */
    align-items: center;    /* 居中对齐 */
    gap: 60px;
    padding: 30px 20px;
}

.photo-grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); /* 加大照片尺寸 */
    gap: 20px;
    padding-bottom: 30px;
}

.album-card {
    position: relative;
    background: #fff;
    width: 100%;
    max-width: 600px; /* 适当调小相册封面 */
    height: auto;     /* 高度自适应 */
    padding: 20px 20px 30px;
    border-radius: 4px;
    box-shadow: 0 15px 35px rgba(50,50,93,0.1), 0 5px 15px rgba(0,0,0,0.07);
    transition: all 0.4s ease;
    cursor: pointer;
    z-index: 1;
    display: flex;
    flex-direction: column;
}

/* 伪元素做堆叠背景 */
.album-card::before, .album-card::after {
    content: "";
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: #fff;
    border: 1px solid #f0f0f0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    z-index: -1;
    transition: all 0.4s ease;
    border-radius: 4px;
}

/* 第一层堆叠 - 左旋 */
.album-card::before { transform: rotate(-2deg); }
/* 第二层堆叠 - 右旋 */
.album-card::after { transform: rotate(2deg); }

.album-card:hover { 
    transform: translateY(-5px); 
    z-index: 10;
    box-shadow: 0 20px 50px rgba(255, 107, 129, 0.3);
}

/* 悬停时堆叠散开效果 */
.album-card:hover::before { transform: rotate(-4deg) translateX(-5px); }
.album-card:hover::after { transform: rotate(4deg) translateX(5px); }

.album-cover {
    width: 100%;
    height: 400px; /* 调整封面高度 */
    background: #f8f8f8;
    border: 1px solid #eee;
    overflow: hidden;
    position: relative;
    margin-bottom: 20px;
}
.album-cover img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.6s;
    filter: brightness(1.02) contrast(1.05);
}
.album-card:hover .album-cover img { transform: scale(1.05); }

.album-info { 
    text-align: center; 
    font-family: 'Ma Shan Zheng', cursive; 
    padding: 0 20px;
}
.album-title { 
    font-weight: bold; 
    font-size: 1.5rem; /* 标题适配大小 */
    color: #333; 
    margin-bottom: 10px;
    letter-spacing: 2px;
}
.album-desc { 
    font-size: 1rem; 
    color: #888; 
    font-style: italic;
    font-family: serif; 
    line-height: 1.6;
}

/* 详情导航栏 */
.gallery-nav {
    display: flex; align-items: center; margin-bottom: 25px;
    animation: fadeIn 0.5s ease;
}
.back-btn {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: #fff;
    color: var(--primary);
    display: flex; justify-content: center; align-items: center;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: 0.3s;
    margin-right: 15px;
    border: 1px solid #ffe3e3;
}
.back-btn:hover {
    transform: translateX(-5px);
    background: var(--primary); color: #fff;
}
.current-album-title { font-size: 1.2rem; font-weight: bold; color: #555; }

/* 轻量级灯箱 (Lightbox) */
.lightbox {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 11000;
    
    /* 优化为透明度过渡，实现丝滑开关 */
    display: flex;
    justify-content: center; align-items: center;
    flex-direction: column;
    
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    
    backdrop-filter: blur(5px);
    transition: all 0.4s ease;
}
.lightbox.active { 
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.lightbox-img {
    max-width: 90%; max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
    border: 4px solid #fff;
    
    /* 配合父级做缩放动画 */
    transform: scale(0.8);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: zoom-out;
}
.lightbox.active .lightbox-img {
    transform: scale(1);
}

.lightbox-close {
    position: absolute; top: 30px; right: 40px;
    color: #fff; font-size: 40px; cursor: pointer;
    opacity: 0.8; transition: 0.3s;
}
.lightbox-close:hover { opacity: 1; transform: rotate(90deg); }

.lightbox-caption {
    margin-top: 20px;
    color: #fff; font-size: 1.1rem;
    font-family: 'Ma Shan Zheng', cursive;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes zoomIn { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }


/* Lightbox 切换按钮样式 */
.lightbox-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px; height: 100px;
    display: flex; justify-content: center; align-items: center;
    color: rgba(255,255,255,0.6);
    font-size: 2.5rem;
    cursor: pointer;
    z-index: 10002;
    transition: all 0.3s;
    border-radius: 8px;
}
.lightbox-btn:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}
.prev-btn { left: 20px; }
.next-btn { right: 20px; }

/* 移动端调整按钮大小和位置 */
@media (max-width: 768px) {
    .lightbox-btn { 
        width: 40px; height: 60px; 
        font-size: 1.5rem;
        background: rgba(0,0,0,0.3); /* 移动端增加底色方便点击 */
    }
    .prev-btn { left: 10px; }
    .next-btn { right: 10px; }
}

/* ================= 8. 开场信封动画 ================= */
#intro-screen {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100vh;
    background: linear-gradient(135deg, #fff0f3 0%, #ffe3e3 100%);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 1s ease, visibility 1s ease;
    overflow: hidden;
    overscroll-behavior: none; /* 防止滚动穿透效果 */
    touch-action: none;        /* 拦截触摸操作 */
}

#intro-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.intro-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: relative;
    padding-bottom: 50px; /* 给底部按钮留空 */
}

/* 计时器 - 优化版 */
.intro-left {
    position: absolute;
    bottom: 120px;
    z-index: 100;
    opacity: 0;
    animation: fadeInUp 0.8s ease 1s forwards;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none; /* 防止遮挡点击 */
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.intro-timer-box {
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    padding: 8px 30px;
    border-radius: 50px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    border: 1px solid rgba(255,255,255,0.3);
    display: flex;
    flex-direction: column; /* 统一改为垂直排列 */
    align-items: center; /* 垂直居中 */
    gap: 5px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.intro-timer-box:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.4);
}

.intro-label {
    font-size: 1.1rem;
    color: var(--primary); /* 改为粉色 */
    letter-spacing: 1px;
    font-weight: normal;
    font-family: 'Ma Shan Zheng', cursive; /* 手写字体 */
    margin: 0;
}

.intro-timer {
    font-family: 'Courier New', Courier, monospace; /* 复古打字机风格 */
    font-size: 1.3rem;
    font-weight: bold;
    margin: 0;
    display: flex;
    gap: 5px;
    align-items: center;
    /* 炫彩渐变 */
    background: linear-gradient(120deg, #ff9a9e, #f6d365, #fda085, #fbc2eb, #a18cd1);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: gradientFlow 5s ease infinite;
}

@keyframes gradientFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 移除之前的渐变和阴影，走简约高雅路线 */

/* 倒计时跳动动画 - 丝滑版 */
.intro-timer.tick {
    animation: pulseText 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes pulseText {
    0% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.05); filter: brightness(1.1); }
    100% { transform: scale(1); filter: brightness(1); }
}

.intro-sub-label {
    display: none; /* 隐藏底部文字 */
}

/* 信封区域 - 极致重构版 (v3) */
.intro-right {
    position: relative;
    /* 向下移动，使信封位于屏幕中下部 */
    margin-top: 130px; 
    z-index: 50;
    width: 480px; 
    height: 320px;
    display: flex;
    justify-content: center;
}

/* 容器 - .wrapper 对应 */
.envelope-wrapper {
    position: relative;
    width: 480px; 
    height: 320px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.envelope-wrapper:hover {
    transform: scale(1.02);
}

/* --- 信封层级结构设计 --- */
/* 层级 1: 信封背板 */
.envelope-back {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 100%;
    background-color: #c07878;
    border-radius: 0 0 8px 8px; /* 关键调整：顶部直角，底部圆角，解决翻盖后的缝隙问题 */
    box-shadow: 0 20px 45px rgba(139, 69, 69, 0.25);
    z-index: 1;
}

/* 层级 2: 信纸 */
.letter {
    position: absolute;
    bottom: 0px; 
    left: 20px;
    width: 440px; 
    height: 280px; /* 初始高度 */
    background: #fffcf7;
    z-index: 2; /* 关键：始终保持在层级 3(侧翼) 和 4(口袋) 之下 */
    padding: 5px 30px 40px 30px; 
    box-sizing: border-box;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
    /* 关键动画配置 */
    transition: 
        transform 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) 0.6s, 
        height 1.2s ease 0.6s, 
        box-shadow 1.2s ease 0.6s;
    overflow: hidden;
    border-radius: 4px 4px 0 0;
    
    /* 信纸纹理 - 调整行高适配小字体 */
    background-image: 
        linear-gradient(90deg, rgba(0,0,0,0.02) 1px, transparent 1px),
        repeating-linear-gradient(#fffcf7, #fffcf7 29px, #efe6dd 30px); /* 30px 行高 */
    background-size: 100% 100%, 100% 30px;
}

/* 层级 3: 信封左右侧翼 */
/* 计算逻辑：高度320的一半是160，宽度480的一半是240 */
.envelope-left {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 160px 0 160px 240px;
    border-color: transparent transparent transparent #e69c9c;
    z-index: 3;
    border-radius: 0 0 0 8px; /* 顶部直角，底部圆角 */
    pointer-events: none;
}

.envelope-right {
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 160px 240px 160px 0;
    border-color: transparent #e69c9c transparent transparent;
    z-index: 3;
    border-radius: 0 0 8px 0; /* 顶部直角，底部圆角 */
    pointer-events: none;
}

/* 层级 4: 信封底部口袋 */
.envelope-pocket {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0;
    border-style: solid;
    border-width: 0 240px 190px 240px; /* 调整高度比例 */
    border-color: transparent transparent #eeaaaa transparent;
    z-index: 4; 
    filter: drop-shadow(0 -4px 6px rgba(163, 76, 76, 0.15));
    pointer-events: none;
    border-radius: 0 0 8px 8px; /* 底部圆角 */
}

/* 层级 5: 信封盖子 */
.lid {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 170px 240px 0 240px;
    border-color: #dfa3a3 transparent transparent transparent;
    z-index: 5; 
    transform-origin: top;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), z-index 0.2s 0.3s;
    /* 增加投影层次感 */
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.15));
    border-radius: 0; /* 恢复直角，确保翻转后与背板无缝衔接 */
}

/* 打开盖子 */
.envelope-wrapper.open .lid {
    transform: rotateX(180deg);
    z-index: 0; 
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), z-index 0s 0.3s;
}

/* 抽出信纸 */
.envelope-wrapper.open .letter {
    /* 
       减少向上抽出的幅度，给顶部留白。
       translateY(-160px) -> 相对Wrapper顶部高出一点  
       PC端减少弹出高度
    */
    transform: translateY(-130px); 
    height: 550px; /* 加长信纸长度 */
    box-shadow: 0 -5px 15px rgba(0,0,0,0.08); 
    /* 移除 z-index: 200，确保被 pocket(z=4) 遮挡 */
}
/* 注意：这里如果要让信纸盖住下面的口袋，需要调整层级。
   原代码 z-index 是 2。open后 还是 2。但是在 3,4下面。
   原效果是“半抽出”，即底部被遮挡。
   如果 open 后 z-index 不变，那么它会被 pocket (z-index 4) 遮挡底部。
   这符合物理逻辑。
   但如果为了看清全文，用户可能希望它浮上来。
   原参考代码里 .wrapper.open .letter 并没有改变 z-index，只是变高了。
   我们保持一致。
*/


/* 文字内容 */
.text-content {
    font-family: 'Long Cang', cursive; /* 使用新的手写体 */
    font-size: 18px; /* 字体调小 */
    line-height: 30px; /* 对应行高 */
    color: #5d4037;
    white-space: pre-wrap;
    /* 滚动条 */
    height: 100%;
    overflow-y: auto;
    scrollbar-width: none; /* 隐藏滚动条 */
    padding-bottom: 50px;
}
.text-content::-webkit-scrollbar { display: none; }

/* 火漆印 */
.seal {
    position: absolute;
    top: 150px; /* 调整位置 */
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px; /* 加大 */
    height: 60px;
    background: #e88080;
    border-radius: 50%;
    z-index: 6;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15), inset 0 2px 4px rgba(255,255,255,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    cursor: pointer;
    transition: all 0.5s ease;
    border: 4px solid rgba(255,255,255,0.2);
}

.seal::after {
    content: '🐰';
    filter: grayscale(0.2) contrast(1.2) brightness(1.2);
    margin-top: 4px;
}

.envelope-wrapper.open .seal {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.5) rotate(20deg);
    filter: blur(5px);
    pointer-events: none;
}

/* 提示语 */
.hint {
    position: absolute;
    bottom: -60px;
    width: 100%;
    text-align: center;
    color: #a89f91;
    font-family: 'Noto Serif SC', serif;
    font-size: 14px;
    letter-spacing: 3px;
    transition: opacity 0.5s;
}
.envelope-wrapper.open .hint {
    opacity: 0;
}

/* 光标 - 打字机风格增强 */
.cursor {
    display: inline-block;
    width: 12px;
    height: 3px; /* 变成下划线风格 */
    background-color: #5d4037;
    animation: cursorBlink 0.8s steps(2, start) infinite;
    vertical-align: baseline;
    margin-left: 2px;
}
@keyframes cursorBlink { 0%, 100% { opacity: 0; } 50% { opacity: 1; } }

/* 签名区域样式微调 */
.letter-footer {
    display: none; /* 暂时隐藏，因为新版全部在 text-content 里处理或者追加 */
}

/* 覆盖之前可能存在的 .letter.done 样式 */
.letter.done .letter-footer {
    display: block;
    margin-top: 20px;
    font-family: 'Long Cang', cursive;
    color: #5d4037;
    opacity: 0; 
    animation: fadeIn 1s forwards;
}
.letter.done .letter-footer { opacity: 1; }

.letter-text::after {
    content: '|';
    animation: blink 1s infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }


/* 进入按钮 - 圆润丝滑 */
.enter-btn {
    /* position: absolute;  <-- Removed */
    /* bottom: 45px;        <-- Removed */
    margin-bottom: 20px; /* Add margin */
    padding: 12px 40px;
    background: #fff;
    color: #ff758c;
    border: none;
    pointer-events: auto; /* 关键修复：允许点击 */
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    box-shadow: 0 10px 25px rgba(255, 117, 140, 0.3);
    cursor: pointer;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    opacity: 0;
    transform: translateY(20px);
}

.enter-btn.visible {
    opacity: 1;
    transform: translateY(0);
}

.enter-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 35px rgba(255, 117, 140, 0.4);
    color: #ff476e;
}

.enter-btn:active {
    transform: scale(0.95);
}

/* 按钮内部流光 */
.enter-btn::after {
    content: "";
    position: absolute;
    top: 0; left: -100%;
    width: 200%; height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255, 0.6), transparent);
    transition: 0.6s;
}
.enter-btn:hover::after {
    left: 100%;
    transition: 0.6s;
}

@media (max-width: 768px) {
    /* 调整整体垂直位置：略微偏下 */
    #intro-screen {
        padding-top: 5vh;
        justify-content: flex-start;
    }
    
    .intro-content {
        gap: 30px; 
        margin-top: 10vh; /* 减少留白，确保不溢出 */
    }
    
    /* === 信封移动端重构 (固定尺寸主要策略) === */
    .envelope-wrapper { 
        width: 300px;        
        height: 200px; 
    }
    
    /* 1. 调整信纸尺寸 */
    .letter {
        width: 280px;       /* 300 - 20 = 280 */
        left: 10px;         /* 居中偏移 */
        height: 190px;
        /* 关键修复：padding-top 改为 30px (与行高背景图对齐，防止文字压线) */
        padding: 30px 15px 15px 15px; 
        font-size: 0.9rem;
    }

    /* 2. 调整三角形构件 (Width=300, HalfW=150; Height=200, HalfH=100) */
    .envelope-left {
        border-width: 100px 0 100px 150px;
        border-radius: 0 0 0 8px; /* 移动端适配圆角 */
    }
    .envelope-right {
        border-width: 100px 150px 100px 0;
        border-radius: 0 0 8px 0; /* 移动端适配圆角 */
    }
    
    /* 口袋高度 120px */
    .envelope-pocket {
        border-width: 0 150px 120px 150px;
    }
    
    /* 盖子高度 110px */
    .lid {
        border-width: 110px 150px 0 150px;
    }
    
    /* 3. 调整火漆印位置 */
    .seal {
        top: 100px; /* 垂直居中 */
        transform: translate(-50%, -50%) scale(0.8); /* 略微缩小 */
    }
    .envelope-wrapper.open .seal {
        transform: translate(-50%, -50%) scale(1.2) rotate(20deg);
    }

    /* 4. 移动端优化时间显示 */
    .intro-timer-box { 
        width: 300px;
        padding: 5px; 
        flex-direction: column; 
        gap: 5px;
        background: rgba(255, 255, 255, 0.3); 
    }
    .intro-timer { font-size: 1.3rem; }
    .intro-label { font-size: 1.1rem; }
    
    /* 5. 修正移动端抽出动画 */
    .envelope-wrapper.open .letter { 
        height: 480px; /* 移动端信纸加长 */
        transform: translateY(-90px); /* 向上抽出距离 */
    }
}


