/* ===== 全局样式 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* ===== 身体样式 ===== */
body {
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    overflow-x: hidden;
    background: linear-gradient(135deg, #fdf2f8, #fce7f3, #f3e8ff, #ede9fe);
    background-size: 400% 400%;
    animation: gradientShift 12s ease infinite;
    min-height: 100vh;
    color: #6b4c6e;
}

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

/* ===== 通用动画 ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.15); }
    50% { transform: scale(1); }
    75% { transform: scale(1.1); }
}

/* ===== 页面导航栏 ===== */
.nav-bar {
    position: fixed; top: 18px; left: 18px; z-index: 1001; display: flex; gap: 8px;
}

.nav-link {
    padding: 9px 16px; border-radius: 50px; text-decoration: none;
    background: linear-gradient(135deg, #fff5f9, #fde8ff); color: #ab6bab;
    box-shadow: 0 4px 15px rgba(200, 150, 200, 0.3);
    font-size: 12px; backdrop-filter: blur(8px); transition: all 0.3s ease;
}

.nav-link:hover { 
    transform: scale(1.05); 
    box-shadow: 0 6px 20px rgba(249, 168, 212, 0.5);
}

/* ===== 音乐控制按钮 ===== */
.music-btn {
    position: fixed; top: 18px; right: 18px; z-index: 1001;
    width: 48px; height: 48px; border-radius: 50%;
    border: none; background: linear-gradient(135deg, #fff5f9, #fde8ff);
    box-shadow: 0 4px 15px rgba(200, 150, 200, 0.3);
    font-size: 24px; cursor: pointer; transition: all 0.3s ease;
    backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center;
}

.music-btn.playing { animation: spin 3s linear infinite; }

@keyframes spin { 
    from { transform: rotate(0); } 
    to { transform: rotate(360deg); } 
}

#bgmAudio { display: none; }

/* ===== 开场部分 ===== */
#opening {
    position: fixed; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: linear-gradient(160deg, #fff1f5, #fde8ef, #f5e6ff);
    z-index: 1000; transition: opacity 1s ease, transform 1s ease;
}

#opening.hide { opacity: 0; transform: scale(1.1); pointer-events: none; }

.opening-heart, .opening-gift, .opening-book {
    font-size: 80px; 
    cursor: pointer; user-select: none;
}

.opening-heart { animation: heartbeat 1.2s ease-in-out infinite; }
.opening-gift { animation: wiggle 1.2s ease-in-out infinite; }
.opening-book { animation: floatSoft 2.5s ease-in-out infinite; }

@keyframes wiggle {
    0%, 100% { transform: rotate(-6deg); }
    50% { transform: rotate(6deg); }
}

@keyframes floatSoft {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.opening-text { 
    margin-top: 30px; 
    font-size: 18px; 
    color: #b06a8f; 
    letter-spacing: 2px; 
    animation: fadeInUp 1s ease 0.5s both; 
    text-align: center; 
    padding: 0 20px; 
}

.opening-sub { 
    margin-top: 12px; 
    font-size: 13px; 
    color: #d4a0c4; 
    animation: fadeInUp 1s ease 0.8s both; 
    text-align: center; 
    padding: 0 20px; 
}

.opening-btn {
    margin-top: 40px; 
    padding: 14px 42px; 
    border: none; 
    border-radius: 50px;
    background: linear-gradient(135deg, #f9a8d4, #c4b5fd); 
    color: #fff;
    font-size: 16px; 
    letter-spacing: 3px; 
    cursor: pointer;
    box-shadow: 0 8px 30px rgba(244,143,177,0.4); 
    transition: all 0.3s ease;
    animation: fadeInUp 1s ease 1s both;
}

.opening-btn:hover { 
    transform: translateY(-3px) scale(1.05); 
    box-shadow: 0 12px 40px rgba(244,143,177,0.6); 
}

/* ===== 主内容区域 ===== */
#main-content { display: none; padding: 40px 20px 100px; max-width: 620px; margin: 0 auto; }
#main-content.show { display: block; }

/* ===== 章节标题 ===== */
.section-title {
    text-align: center; 
    font-size: 22px; 
    color: #9d5c8a; 
    margin: 55px 0 25px; 
    position: relative;
}

.section-title::after {
    content: ''; 
    display: block; 
    width: 50px; 
    height: 3px;
    background: linear-gradient(90deg, #f9a8d4, #c4b5fd); 
    margin: 10px auto 0; 
    border-radius: 2px;
}

.section-desc {
    text-align: center; 
    font-size: 13px; 
    color: #c9a0c9; 
    margin-bottom: 25px;
}

/* ===== 卡片容器 ===== */
.card {
    background: rgba(255,255,255,0.75); 
    backdrop-filter: blur(10px);
    border-radius: 20px; 
    padding: 28px 22px; 
    margin: 0 0 25px;
    box-shadow: 0 8px 32px rgba(200,150,200,0.15); 
    border: 1px solid rgba(255,255,255,0.6);
}

/* ===== 底部信息 ===== */
.footer-msg {
    text-align: center; 
    margin-top: 60px; 
    font-size: 14px; 
    color: #c9a0c9; 
    letter-spacing: 1px;
}

/* ===== 爱心粒子效果 ===== */
.click-heart { 
    position: fixed; 
    pointer-events: none; 
    z-index: 998; 
    animation: clickHeartAnim 1.5s ease-out forwards; 
}

@keyframes clickHeartAnim {
    0% { 
        opacity: 1; 
        transform: translate(-50%,-50%) scale(0.3); 
    }
    50% { 
        opacity: 0.8; 
        transform: translate(-50%,-80%) scale(1.2); 
    }
    100% { 
        opacity: 0; 
        transform: translate(-50%,-120%) scale(0.6); 
    }
}

/* ===== 浮动粒子 ===== */
.float-particle { 
    position: fixed; 
    pointer-events: none; 
    z-index: 999; 
    animation: floatUp 3s ease-out forwards; 
    font-size: 20px; 
}

@keyframes floatUp {
    0% { 
        opacity: 1; 
        transform: translateY(0) scale(1) rotate(0deg); 
    }
    100% { 
        opacity: 0; 
        transform: translateY(-150px) scale(0.5) rotate(20deg); 
    }
}

/* ===== 彩带效果 ===== */
.confetti { 
    position: fixed; 
    width: 8px; 
    height: 8px; 
    pointer-events: none; 
    z-index: 999; 
    animation: confettiFall 2.5s ease-out forwards; 
}

@keyframes confettiFall {
    0% { 
        opacity: 1; 
        transform: translateY(0) rotate(0deg) scale(1); 
    }
    100% { 
        opacity: 0; 
        transform: translateY(200px) rotate(720deg) scale(0.3); 
    }
}

/* ===== 心雨效果 ===== */
.heart-rain-item { 
    position: fixed; 
    pointer-events: none; 
    z-index: 999; 
    animation: heartRainFall 3s ease-out forwards; 
    font-size: 20px; 
}

@keyframes heartRainFall {
    0% { 
        opacity: 1; 
        transform: translateY(0) scale(1) rotate(0deg); 
    }
    100% { 
        opacity: 0; 
        transform: translateY(-150px) scale(0.5) rotate(20deg); 
    }
}

/* ===== 响应式适配 ===== */
@media (max-width: 480px) {
    .opening-heart, .opening-gift, .opening-book { 
        font-size: 60px; 
    }
    
    .section-title { 
        font-size: 19px; 
    }
    
    .nav-link {
        padding: 7px 12px;
        font-size: 11px;
    }
}
