/* ========================================
   表白网站 - 主样式
   ======================================== */

/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: linear-gradient(135deg, #1a0a2e 0%, #16213e 50%, #0f0c29 100%);
    min-height: 100vh;
    font-family: 'Noto Serif SC', serif;
}

/* 星空画布 */
#starry-sky {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* 流星 */
.meteor {
    position: fixed;
    width: 2px;
    height: 80px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.8), transparent);
    animation: meteor 1.5s linear forwards;
    pointer-events: none;
    z-index: 1;
}

.meteor::before {
    content: '';
    position: absolute;
    top: 0;
    left: -2px;
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 10px white, 0 0 20px white;
}

@keyframes meteor {
    0% {
        transform: translateY(-100px) translateX(0);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) translateX(200px);
        opacity: 0;
    }
}

/* 飘落的爱心 */
.falling-heart {
    position: fixed;
    font-size: 20px;
    animation: fall linear forwards;
    pointer-events: none;
    z-index: 2;
}

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

/* 点击爱心 */
.click-heart {
    position: fixed;
    font-size: 24px;
    pointer-events: none;
    animation: clickHeart 1s ease-out forwards;
    z-index: 100;
}

@keyframes clickHeart {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: scale(1.5) rotate(15deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(-15deg) translateY(-50px);
        opacity: 0;
    }
}

/* 章节标题动画 */
.section-title {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.section-title.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 时间轴动画 */
.timeline-item {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.timeline-item.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 照片墙动画 */
.photo-item {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.5s ease;
}

.photo-item.visible {
    opacity: 1;
    transform: scale(1) rotate(var(--rotate, 0deg));
}

.photo-item:hover {
    transform: scale(1.1) rotate(0deg) !important;
    z-index: 10;
    box-shadow: 0 10px 40px rgba(255, 105, 180, 0.4);
}

/* Hero 标题动画 */
.hero-title {
    opacity: 0;
    transform: translateY(30px);
}

.hero-subtitle {
    opacity: 0;
    transform: translateY(20px);
}

/* 打字机光标 */
.typing-cursor::after {
    content: '|';
    animation: blink 0.8s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* 按钮效果 */
#yes-btn {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(236, 72, 153, 0.5);
    }
    50% {
        box-shadow: 0 0 40px rgba(236, 72, 153, 0.8);
    }
}

/* 成功页面 */
#success-page {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 音乐播放器旋转 */
.playing #music-icon {
    animation: spin 2s linear infinite;
}

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

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #ec4899, #a855f7);
    border-radius: 4px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .timeline-item > div:first-child,
    .timeline-item > div:last-child {
        width: 45%;
    }

    #countdown .flex {
        gap: 2px;
    }

    #countdown .bg-white\/10 {
        padding: 8px 12px;
    }

    #countdown .text-4xl {
        font-size: 1.5rem;
    }
}

/* 彩蛋提示 */
#secret-hint {
    animation: hintPulse 3s ease-in-out infinite;
}

@keyframes hintPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* 密码弹窗动画 */
#password-modal > div {
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}