/* ==================== 基础样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #FFB6C1;
    --secondary: #FFC0CB;
    --accent: #FFD700;
    --background: #FFF0F5;
    --text: #333333;
    --text-light: #666666;
    --white: #ffffff;
    --shadow: rgba(0, 0, 0, 0.1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans SC', sans-serif;
    background: #1a1a2e;
    color: var(--text);
    min-height: 100vh;
    overflow: hidden;
}

/* ==================== 页面容器 ==================== */
.page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    overflow-y: auto;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.page.active {
    visibility: visible;
    opacity: 1;
}

/* ==================== 通用按钮 ==================== */
.btn-cute {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--white);
    border: none;
    padding: 12px 28px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 182, 193, 0.4);
}

.btn-cute:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 182, 193, 0.6);
}

.btn-cute:active {
    transform: translateY(0);
}

/* ==================== 密码页面 ==================== */
#password-page {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    z-index: 100;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.password-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 50px 40px;
    border-radius: 30px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: 90%;
}

.lock-icon {
    font-size: 60px;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.password-container h2 {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 28px;
    color: var(--text);
    margin-bottom: 10px;
}

.password-container p {
    color: var(--text-light);
    margin-bottom: 20px;
}

.password-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#password-input {
    padding: 15px 20px;
    border: 2px solid var(--primary);
    border-radius: 50px;
    font-size: 18px;
    text-align: center;
    outline: none;
    transition: all 0.3s ease;
}

#password-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(255, 182, 193, 0.5);
}

.error-msg {
    color: #ff6b6b;
    font-size: 14px;
    margin-top: 10px;
}

.hidden {
    display: none !important;
}

.hint {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 20px;
}

/* ==================== 开场动画页面 ==================== */
#intro-page {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    overflow: hidden;
    cursor: pointer;
}

.hearts-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.intro-text {
    text-align: center;
    z-index: 10;
}

.intro-text h1 {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 72px;
    color: var(--white);
    text-shadow: 0 0 30px rgba(255, 182, 193, 0.8);
    margin-bottom: 20px;
}

.intro-text .subtitle {
    font-size: 24px;
    color: var(--primary);
    opacity: 0;
    animation: fadeInUp 1s ease forwards;
    animation-delay: 2s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.skip-hint {
    position: absolute;
    bottom: 30px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* ==================== 主菜单页面 ==================== */
.main-menu {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #FFE4E1 0%, #FFF0F5 50%, #E6E6FA 100%);
}

.menu-title {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 48px;
    color: var(--text);
    margin-bottom: 10px;
    text-align: center;
}

.menu-subtitle {
    font-size: 18px;
    color: var(--text-light);
    margin-bottom: 40px;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 500px;
    width: 100%;
    margin-bottom: 40px;
}

.menu-item {
    background: var(--white);
    border-radius: 20px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px var(--shadow);
}

.menu-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(255, 182, 193, 0.4);
}

.menu-item:active {
    transform: translateY(-2px);
}

.menu-icon {
    font-size: 40px;
    display: block;
    margin-bottom: 10px;
}

.menu-text {
    font-size: 14px;
    color: var(--text);
    font-weight: 500;
}

.music-btn-main {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--white);
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 182, 193, 0.4);
}

.music-btn-main:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 182, 193, 0.6);
}

.music-btn-main.playing {
    animation: musicPulse 1s infinite;
}

@keyframes musicPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* ==================== 子页面通用样式 ==================== */
.sub-page {
    background: linear-gradient(135deg, #FFF0F5 0%, #FFE4E1 100%);
    overflow-y: auto;
}

.page-content {
    min-height: 100vh;
    padding: 80px 20px 40px;
    max-width: 1000px;
    margin: 0 auto;
}

.back-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    background: var(--white);
    border: none;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--shadow);
    z-index: 100;
    color: var(--text);
}

.back-btn:hover {
    transform: translateX(-5px);
    box-shadow: 0 6px 20px var(--shadow);
}

.back-btn.light {
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
    backdrop-filter: blur(10px);
}

.back-btn.light:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ==================== 通用区块样式 ==================== */
.section-title {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 42px;
    color: var(--text);
    margin-bottom: 40px;
    text-align: center;
}

.section-title.light {
    color: var(--white);
}

/* ==================== 倒计时区域 ==================== */
#countdown-page .page-content {
    display: flex;
    align-items: center;
    justify-content: center;
}

.countdown-display {
    text-align: center;
}

.countdown-title {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 36px;
    color: var(--text);
    margin-bottom: 30px;
}

.countdown-timer {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.countdown-item {
    background: var(--white);
    padding: 30px 25px;
    border-radius: 20px;
    min-width: 120px;
    box-shadow: 0 10px 30px var(--shadow);
}

.countdown-number {
    font-size: 48px;
    font-weight: 700;
    color: var(--primary);
    display: block;
}

.countdown-label {
    font-size: 14px;
    color: var(--text-light);
    margin-top: 5px;
}

.birthday-message {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 56px;
    color: var(--primary);
    text-shadow: 0 0 30px rgba(255, 182, 193, 0.5);
    animation: glow 2s infinite;
}

@keyframes glow {
    0%, 100% { text-shadow: 0 0 30px rgba(255, 182, 193, 0.5); }
    50% { text-shadow: 0 0 50px rgba(255, 182, 193, 0.8); }
}


/* ==================== 时间轴 ==================== */
.timeline-container {
    position: relative;
    max-width: 800px;
    width: 100%;
    padding: 20px 0;
}

.timeline-container::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary), var(--secondary));
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    width: 50%;
    padding: 20px 40px;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.timeline-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.timeline-item:nth-child(odd) {
    left: 0;
    text-align: right;
}

.timeline-item:nth-child(even) {
    left: 50%;
    text-align: left;
}

.timeline-item::before {
    content: '';
    position: absolute;
    top: 30px;
    width: 20px;
    height: 20px;
    background: var(--accent);
    border-radius: 50%;
    border: 4px solid var(--white);
    box-shadow: 0 0 0 4px var(--primary);
}

.timeline-item:nth-child(odd)::before {
    right: -10px;
}

.timeline-item:nth-child(even)::before {
    left: -10px;
}

.timeline-content {
    background: var(--background);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 20px var(--shadow);
}

.timeline-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.timeline-img:hover {
    transform: scale(1.02);
}

.timeline-date {
    font-size: 12px;
    color: var(--primary);
    margin-top: 10px;
}

.timeline-caption {
    font-size: 14px;
    color: var(--text);
    margin-top: 5px;
}

/* 时间轴视频样式 */
.timeline-video-wrapper {
    position: relative;
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
}

.timeline-video {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
    background: #000;
}

.video-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: background 0.3s ease;
}

.video-play-overlay:hover {
    background: rgba(0, 0, 0, 0.4);
}

.play-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--primary);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.video-play-overlay:hover .play-icon {
    transform: scale(1.1);
}

.view-all-btn {
    margin-top: 40px;
}

/* ==================== 相册 ==================== */
.album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    max-width: 1200px;
    width: 100%;
}

.album-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 5px 20px var(--shadow);
    transition: all 0.3s ease;
}

.album-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--shadow);
}

.album-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.album-item:hover img {
    transform: scale(1.1);
}

.load-more {
    margin-top: 40px;
}

/* ==================== 祝福区域 ==================== */
.wishes-content {
    display: flex;
    align-items: center;
    justify-content: center;
}

.wish-card {
    background: var(--white);
    padding: 50px 40px;
    border-radius: 30px;
    box-shadow: 0 20px 60px var(--shadow);
    position: relative;
}

.wish-card::before {
    content: '💌';
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 60px;
}

.wish-title {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 28px;
    color: var(--primary);
    margin-bottom: 30px;
    text-align: center;
}

.wish-content {
    font-size: 18px;
    line-height: 2;
    color: var(--text);
    white-space: pre-line;
}

.wish-signature {
    text-align: right;
    margin-top: 30px;
    font-style: italic;
    color: var(--text-light);
}

/* ==================== 生日蛋糕 ==================== */
.cake-page-bg {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%) !important;
}

.cake-page-bg .page-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.cake-container {
    text-align: center;
}

.cake {
    position: relative;
    display: inline-block;
    margin-bottom: 30px;
}

.candles {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.candle {
    width: 10px;
    height: 50px;
    background: linear-gradient(to bottom, #fff8dc, #ffd700);
    border-radius: 5px 5px 0 0;
    position: relative;
    cursor: pointer;
}

.candle::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 15px;
    height: 25px;
    background: radial-gradient(ellipse at bottom, #ffd700, #ff6b35, transparent);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    animation: flicker 0.5s infinite alternate;
}

.candle.blown::before {
    display: none;
}

.candle.blown::after {
    content: '';
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 30px;
    background: rgba(200, 200, 200, 0.5);
    border-radius: 50%;
    animation: smoke 1s ease-out forwards;
}

@keyframes flicker {
    0% { transform: translateX(-50%) scale(1); opacity: 1; }
    100% { transform: translateX(-50%) scale(1.1); opacity: 0.8; }
}

@keyframes smoke {
    0% { opacity: 0.5; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-30px); }
}

.cake-top {
    width: 200px;
    height: 30px;
    background: linear-gradient(to bottom, #ff69b4, #ff1493);
    border-radius: 10px 10px 0 0;
    margin: 0 auto;
}

.cake-middle {
    width: 220px;
    height: 60px;
    background: linear-gradient(to bottom, #fffacd, #ffefd5);
    margin: 0 auto;
    border-left: 5px solid #ffd700;
    border-right: 5px solid #ffd700;
}

.cake-bottom {
    width: 250px;
    height: 80px;
    background: linear-gradient(to bottom, #ff69b4, #ff1493);
    border-radius: 0 0 20px 20px;
    margin: 0 auto;
}

.cake-hint {
    color: var(--white);
    font-size: 16px;
    opacity: 0.8;
}

.wish-result {
    color: var(--white);
    animation: fadeInUp 0.5s ease;
}

.wish-result h3 {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 48px;
    color: var(--accent);
    margin-bottom: 10px;
}

/* ==================== 拼图游戏 ==================== */
.game-container {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.puzzle-board {
    display: inline-grid;
    grid-template-columns: repeat(3, 150px);
    grid-template-rows: repeat(3, 150px);
    gap: 6px;
    background: var(--background);
    padding: 12px;
    border-radius: 15px;
    box-shadow: 0 10px 30px var(--shadow);
}

.puzzle-piece {
    width: 150px;
    height: 150px;
    background-size: 450px 450px;
    border-radius: 5px;
    cursor: grab;
    transition: transform 0.2s ease;
}

.puzzle-piece:hover {
    transform: scale(1.05);
}

.puzzle-piece.correct {
    box-shadow: 0 0 10px var(--accent);
}

.game-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.game-status {
    color: var(--text-light);
    font-size: 14px;
}

/* ==================== 照片查看器 ==================== */
.photo-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.viewer-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: var(--white);
    font-size: 40px;
    cursor: pointer;
    z-index: 10;
}

.viewer-prev,
.viewer-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: var(--white);
    font-size: 40px;
    padding: 20px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.viewer-prev:hover,
.viewer-next:hover {
    background: rgba(255, 255, 255, 0.3);
}

.viewer-prev {
    left: 20px;
}

.viewer-next {
    right: 20px;
}

.viewer-content {
    max-width: 90%;
    max-height: 90%;
}

.viewer-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

/* ==================== 烟花画布 ==================== */
#fireworks-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 768px) {
    .menu-title {
        font-size: 36px;
    }
    
    .menu-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .menu-item {
        padding: 25px 15px;
    }
    
    .menu-icon {
        font-size: 32px;
    }
    
    .intro-text h1 {
        font-size: 42px;
    }
    
    .section-title {
        font-size: 32px;
    }
    
    .countdown-item {
        min-width: 80px;
        padding: 20px 15px;
    }
    
    .countdown-number {
        font-size: 32px;
    }
    
    .timeline-container::before {
        left: 20px;
    }
    
    .timeline-item {
        width: 100%;
        left: 0 !important;
        text-align: left !important;
        padding-left: 50px;
        padding-right: 20px;
    }
    
    .timeline-item::before {
        left: 10px !important;
        right: auto !important;
    }
    
    .album-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .wish-card {
        padding: 40px 25px;
    }
    
    .puzzle-board {
        grid-template-columns: repeat(3, 100px);
        grid-template-rows: repeat(3, 100px);
    }
    
    .puzzle-piece {
        width: 100px;
        height: 100px;
        background-size: 300px 300px;
    }
    
    .birthday-message {
        font-size: 36px;
    }
    
    .back-btn {
        padding: 10px 18px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .password-container {
        padding: 30px 20px;
    }
    
    .intro-text h1 {
        font-size: 32px;
    }
    
    .countdown-timer {
        gap: 10px;
    }
    
    .countdown-item {
        min-width: 70px;
        padding: 15px 10px;
    }
    
    .countdown-number {
        font-size: 28px;
    }
    
    .album-grid {
        grid-template-columns: 1fr;
    }
}
