/* ===== 基础样式重置与全局变量 ===== */
:root {
    /* 暗黑系配色 */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a2e;
    --bg-card: rgba(26, 26, 46, 0.6);
    --bg-glass: rgba(255, 255, 255, 0.03);
    
    /* 文字颜色 */
    --text-primary: #e8e6e3;
    --text-secondary: rgba(232, 230, 227, 0.7);
    --text-muted: rgba(232, 230, 227, 0.4);
    
    /* 强调色 */
    --accent-pink: #e74c6f;
    --accent-rose: #f472b6;
    --accent-gold: #fbbf24;
    --accent-purple: #a78bfa;
    --accent-blue: #60a5fa;
    
    /* 渐变 */
    --gradient-main: linear-gradient(135deg, #e74c6f 0%, #a78bfa 50%, #60a5fa 100%);
    --gradient-warm: linear-gradient(135deg, #e74c6f 0%, #f472b6 100%);
    --gradient-cool: linear-gradient(135deg, #a78bfa 0%, #60a5fa 100%);
    --gradient-gold: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    
    /* 字体 */
    --font-serif: 'Noto Serif SC', 'STSong', 'SimSun', serif;
    --font-handwrite: 'Ma Shan Zheng', 'STKaiti', 'KaiTi', cursive;
    --font-display: 'ZCOOL XiaoWei', 'STKaiti', serif;
    
    /* 间距 */
    --section-padding: 120px 0;
    --container-width: 960px;
    
    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    
    /* 阴影 */
    --shadow-glow: 0 0 40px rgba(231, 76, 111, 0.15);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.3);
    
    /* 动画 */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.4s ease;
    --transition-slow: 0.8s ease;
}

/* 重置 */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-serif);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.8;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* Canvas层 */
#starfield,
#heartCanvas,
#fireworksCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

#heartCanvas { z-index: 1; }
#fireworksCanvas { z-index: 2; pointer-events: auto; }

/* 玫瑰花瓣容器 */
#petals-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
    overflow: hidden;
}

/* 通用section */
.section {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--section-padding);
}

.section-inner {
    max-width: var(--container-width);
    width: 100%;
    margin: 0 auto;
    padding: 0 24px;
}

.section-title {
    font-family: var(--font-display);
    font-size: 2.4rem;
    text-align: center;
    margin-bottom: 12px;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 4px;
}

.section-desc {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 48px;
    letter-spacing: 2px;
}

/* 选中样式 */
::selection {
    background: rgba(231, 76, 111, 0.3);
    color: var(--text-primary);
}

/* 滚动条 */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--accent-pink);
    border-radius: 3px;
}

/* 加载动画 */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-heart {
    animation: loaderPulse 1s ease-in-out infinite;
}

.loader-text {
    margin-top: 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    letter-spacing: 2px;
}

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

/* 音乐按钮 */
.music-btn {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 100;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.08);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-normal);
}

.music-btn:hover {
    background: rgba(231, 76, 111, 0.2);
    border-color: var(--accent-pink);
}

.music-btn.playing .music-icon {
    gap: 3px;
}

.music-icon {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 18px;
}

.music-icon .bar {
    width: 3px;
    background: var(--accent-pink);
    border-radius: 2px;
    height: 4px;
    transition: height 0.3s ease;
}

.music-btn.playing .music-icon .bar:nth-child(1) { animation: musicBar 0.5s ease-in-out infinite alternate; }
.music-btn.playing .music-icon .bar:nth-child(2) { animation: musicBar 0.5s ease-in-out infinite alternate 0.1s; }
.music-btn.playing .music-icon .bar:nth-child(3) { animation: musicBar 0.5s ease-in-out infinite alternate 0.2s; }
.music-btn.playing .music-icon .bar:nth-child(4) { animation: musicBar 0.5s ease-in-out infinite alternate 0.3s; }

@keyframes musicBar {
    0% { height: 4px; }
    100% { height: 18px; }
}
