* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    overflow: hidden;
    background: linear-gradient(180deg, 
        #0d0d1a 0%, 
        #1a1a2e 30%,
        #16213e 60%,
        #1a1a2e 100%
    );
    min-height: 100vh;
    touch-action: manipulation;
}

/* ========== 开场动画 - 更有仪式感 ========== */
.intro-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, #1a1a2e 0%, #0d0d1a 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.intro-screen.opening {
    animation: screenFadeOut 2s ease-in-out forwards;
}

@keyframes screenFadeOut {
    0% { opacity: 1; }
    70% { opacity: 1; }
    100% { opacity: 0; pointer-events: none; }
}

.intro-screen.hidden {
    display: none;
}

/* 开场文字 */
.intro-text {
    color: rgba(255, 255, 255, 0);
    font-size: 18px;
    letter-spacing: 4px;
    margin-bottom: 50px;
    text-align: center;
    animation: textFadeIn 2s ease-out 0.5s forwards;
}

@keyframes textFadeIn {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 0.9; transform: translateY(0); }
}

/* 礼物盒光环 */
.gift-glow {
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 100, 150, 0.3) 0%, transparent 70%);
    animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.3); opacity: 0.8; }
}

.gift-box {
    position: relative;
    width: 140px;
    height: 120px;
    cursor: pointer;
    animation: floatGift 3s ease-in-out infinite;
    filter: drop-shadow(0 20px 40px rgba(255, 100, 150, 0.4));
    z-index: 2;
}

.gift-box.opening {
    animation: giftOpen 1.5s ease-out forwards;
}

@keyframes giftOpen {
    0% { transform: scale(1); }
    30% { transform: scale(1.1) rotate(-5deg); }
    50% { transform: scale(1.2) rotate(5deg); }
    70% { transform: scale(1.3); filter: drop-shadow(0 0 60px rgba(255, 215, 0, 0.8)); }
    100% { transform: scale(0); opacity: 0; }
}

.gift-body {
    position: absolute;
    bottom: 0;
    width: 140px;
    height: 100px;
    background: linear-gradient(145deg, #ff6b9d, #c44569);
    border-radius: 8px;
    box-shadow: inset 0 -10px 20px rgba(0,0,0,0.2);
}

.gift-lid {
    position: absolute;
    top: 10px;
    left: -8px;
    width: 156px;
    height: 30px;
    background: linear-gradient(145deg, #c44569, #a63d5a);
    border-radius: 6px;
    transition: all 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.gift-box.opening .gift-lid {
    transform: translateY(-80px) rotate(-45deg);
    opacity: 0;
}

.gift-ribbon-v {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 25px;
    height: 100px;
    background: linear-gradient(90deg, #ffd700, #ffec8b, #ffd700);
}

.gift-ribbon-h {
    position: absolute;
    bottom: 40px;
    width: 140px;
    height: 25px;
    background: linear-gradient(180deg, #ffd700, #ffec8b, #ffd700);
}

.gift-bow {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 35px;
    background: radial-gradient(ellipse, #ffd700, #daa520);
    border-radius: 50%;
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.5);
}

.gift-bow::before,
.gift-bow::after {
    content: '';
    position: absolute;
    width: 35px;
    height: 28px;
    background: linear-gradient(135deg, #ffd700, #ffec8b);
    border-radius: 50%;
    top: 5px;
}

.gift-bow::before { left: -20px; transform: rotate(-20deg); }
.gift-bow::after { right: -20px; transform: rotate(20deg); }

.tap-hint {
    color: rgba(255, 255, 255, 0.9);
    margin-top: 40px;
    font-size: 15px;
    letter-spacing: 3px;
    animation: hintPulse 2s ease-in-out infinite;
    z-index: 2;
}

@keyframes hintPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.98); }
}

/* 开场星星背景 */
.intro-stars {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.intro-star {
    position: absolute;
    background: #fff;
    border-radius: 50%;
    animation: introTwinkle 2s ease-in-out infinite;
}

@keyframes introTwinkle {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.8; }
}

@keyframes floatGift {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50% { transform: translateY(-20px) rotate(2deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ========== 主场景 ========== */
.main-scene {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 2s ease;
    pointer-events: none;
    overflow: hidden;
}

.main-scene.visible {
    opacity: 1;
    pointer-events: all;
}

/* 星星背景 */
.stars {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.star {
    position: absolute;
    background: #fff;
    border-radius: 50%;
    animation: twinkle 3s ease-in-out infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.2; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.5); }
}

/* ========== 雪花 ========== */
.snowflakes {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 2;
}

.snowflake {
    position: absolute;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    animation: fall linear infinite;
}

@keyframes fall {
    0% {
        transform: translateY(-5vh) translateX(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(105vh) translateX(20px) rotate(360deg);
        opacity: 0.3;
    }
}


/* ========== 圣诞树 ========== */
.tree-container {
    position: absolute;
    top: 5%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
    animation: treeFloat 4s ease-in-out infinite;
}

@keyframes treeFloat {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-8px); }
}

/* 树顶超级星星 */
.tree-star {
    font-size: 55px;
    animation: starPulse 1s ease-in-out infinite, starRainbow 2s linear infinite, star3D 3s ease-in-out infinite;
    z-index: 10;
    position: relative;
}

.tree-star::before {
    content: '✨';
    position: absolute;
    font-size: 25px;
    top: -10px;
    left: -20px;
    animation: miniStarOrbit 2s linear infinite;
}

.tree-star::after {
    content: '⭐';
    position: absolute;
    font-size: 20px;
    top: -5px;
    right: -25px;
    animation: miniStarOrbit 2s linear infinite reverse;
}

@keyframes miniStarOrbit {
    0% { transform: rotate(0deg) translateX(30px) rotate(0deg); }
    100% { transform: rotate(360deg) translateX(30px) rotate(-360deg); }
}

@keyframes starPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.4); }
}

@keyframes starRainbow {
    0% { filter: drop-shadow(0 0 30px #ff0000) drop-shadow(0 0 60px #ff0000) drop-shadow(0 0 100px #ff000080); }
    14% { filter: drop-shadow(0 0 30px #ff8800) drop-shadow(0 0 60px #ffaa00) drop-shadow(0 0 100px #ff880080); }
    28% { filter: drop-shadow(0 0 30px #ffff00) drop-shadow(0 0 60px #ffff00) drop-shadow(0 0 100px #ffff0080); }
    42% { filter: drop-shadow(0 0 30px #00ff00) drop-shadow(0 0 60px #00ff88) drop-shadow(0 0 100px #00ff0080); }
    57% { filter: drop-shadow(0 0 30px #00ffff) drop-shadow(0 0 60px #00ffff) drop-shadow(0 0 100px #00ffff80); }
    71% { filter: drop-shadow(0 0 30px #0088ff) drop-shadow(0 0 60px #00aaff) drop-shadow(0 0 100px #0088ff80); }
    85% { filter: drop-shadow(0 0 30px #8800ff) drop-shadow(0 0 60px #aa00ff) drop-shadow(0 0 100px #8800ff80); }
    100% { filter: drop-shadow(0 0 30px #ff0000) drop-shadow(0 0 60px #ff0000) drop-shadow(0 0 100px #ff000080); }
}

@keyframes star3D {
    0%, 100% { transform: rotateY(0deg) scale(1); }
    25% { transform: rotateY(15deg) scale(1.1); }
    50% { transform: rotateY(0deg) scale(1.2); }
    75% { transform: rotateY(-15deg) scale(1.1); }
}

.tree {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: -15px;
}

/* 树的霓虹边框效果 */
.tree-layer {
    width: 0;
    height: 0;
    border-style: solid;
    position: relative;
    transition: all 0.3s ease;
}

.layer-1 {
    border-width: 0 35px 60px 35px;
    border-color: transparent transparent #1e8449 transparent;
    animation: treeGrow 0.8s ease-out forwards, treeNeon 1.5s ease-in-out infinite 2s, treeWave 3s ease-in-out infinite;
    animation-delay: 0.3s;
    opacity: 0;
}

.layer-2 {
    border-width: 0 50px 70px 50px;
    border-color: transparent transparent #1a7a40 transparent;
    margin-top: -20px;
    animation: treeGrow 0.8s ease-out forwards, treeNeon 1.5s ease-in-out infinite 2.2s, treeWave 3s ease-in-out infinite 0.2s;
    animation-delay: 0.6s;
    opacity: 0;
}

.layer-3 {
    border-width: 0 65px 80px 65px;
    border-color: transparent transparent #166d38 transparent;
    margin-top: -25px;
    animation: treeGrow 0.8s ease-out forwards, treeNeon 1.5s ease-in-out infinite 2.4s, treeWave 3s ease-in-out infinite 0.4s;
    animation-delay: 0.9s;
    opacity: 0;
}

.layer-4 {
    border-width: 0 80px 90px 80px;
    border-color: transparent transparent #126030 transparent;
    margin-top: -30px;
    animation: treeGrow 0.8s ease-out forwards, treeNeon 1.5s ease-in-out infinite 2.6s, treeWave 3s ease-in-out infinite 0.6s;
    animation-delay: 1.2s;
    opacity: 0;
}

@keyframes treeGrow {
    0% { transform: scaleY(0) scaleX(0.5); opacity: 0; }
    100% { transform: scaleY(1) scaleX(1); opacity: 1; }
}

@keyframes treeNeon {
    0%, 100% { 
        filter: drop-shadow(0 0 15px rgba(0, 255, 100, 0.5)) drop-shadow(0 0 30px rgba(0, 255, 150, 0.3)) brightness(1);
    }
    50% { 
        filter: drop-shadow(0 0 30px rgba(0, 255, 100, 0.8)) drop-shadow(0 0 50px rgba(255, 215, 0, 0.5)) drop-shadow(0 0 80px rgba(255, 100, 200, 0.3)) brightness(1.2);
    }
}

@keyframes treeWave {
    0%, 100% { transform: scaleX(1); }
    50% { transform: scaleX(1.02); }
}

.tree-trunk {
    width: 35px;
    height: 45px;
    background: linear-gradient(90deg, #5d4037, #8d6e63, #5d4037);
    border-radius: 0 0 8px 8px;
    margin-top: -5px;
    animation: trunkGrow 0.5s ease-out forwards;
    animation-delay: 1.5s;
    opacity: 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4), 0 0 20px rgba(139, 90, 43, 0.5);
}

@keyframes trunkGrow {
    0% { transform: scaleY(0); opacity: 0; }
    100% { transform: scaleY(1); opacity: 1; }
}

/* ========== 超级彩灯 ========== */
.lights {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.light {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    animation: lightGlow 0.6s ease-in-out infinite alternate, lightDance 2s ease-in-out infinite;
}

@keyframes lightGlow {
    0% { 
        opacity: 0.5; 
        transform: scale(0.6);
        box-shadow: 0 0 10px currentColor;
    }
    100% { 
        opacity: 1; 
        transform: scale(1.4);
        box-shadow: 0 0 25px currentColor, 0 0 50px currentColor, 0 0 80px currentColor;
    }
}

@keyframes lightDance {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* ========== 超级装饰球 ========== */
.ornaments {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.ornament {
    position: absolute;
    animation: ornamentSwing 1.5s ease-in-out infinite, ornamentGlow 1s ease-in-out infinite, ornament3D 4s ease-in-out infinite;
}

@keyframes ornamentSwing {
    0%, 100% { transform: rotate(-12deg) scale(1); }
    50% { transform: rotate(12deg) scale(1.15); }
}

@keyframes ornamentGlow {
    0%, 100% { filter: drop-shadow(0 0 8px rgba(255,255,255,0.6)) brightness(1); }
    50% { filter: drop-shadow(0 0 20px rgba(255,255,255,1)) drop-shadow(0 0 35px currentColor) brightness(1.3); }
}

@keyframes ornament3D {
    0%, 100% { transform: perspective(100px) rotateY(0deg); }
    50% { transform: perspective(100px) rotateY(20deg); }
}

/* ========== 礼物堆 ========== */
.gifts-pile {
    position: absolute;
    top: 42%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    animation: giftsAppear 1s ease-out forwards;
    animation-delay: 1.8s;
    opacity: 0;
    z-index: 3;
}

@keyframes giftsAppear {
    0% { transform: translateX(-50%) translateY(30px) scale(0.5); opacity: 0; }
    100% { transform: translateX(-50%) translateY(0) scale(1); opacity: 1; }
}

.gift {
    font-size: 24px;
    animation: giftBounce 2.5s ease-in-out infinite;
    filter: drop-shadow(0 5px 10px rgba(0,0,0,0.3));
}

.gift-1 { animation-delay: 0s; }
.gift-2 { animation-delay: 0.4s; }
.gift-3 { animation-delay: 0.8s; }

@keyframes giftBounce {
    0%, 100% { transform: translateY(0) rotate(-3deg); }
    50% { transform: translateY(-8px) rotate(3deg); }
}


/* ========== 祝福语卡片 - 精致设计 ========== */
.message-container {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 30px);
    max-width: 360px;
    animation: cardFloat 1.2s ease-out forwards;
    animation-delay: 2.2s;
    opacity: 0;
    z-index: 10;
}

@keyframes cardFloat {
    0% { transform: translateX(-50%) translateY(60px); opacity: 0; }
    100% { transform: translateX(-50%) translateY(0); opacity: 1; }
}

.message-card {
    background: linear-gradient(145deg, 
        rgba(255, 255, 255, 0.12) 0%,
        rgba(255, 200, 220, 0.08) 50%,
        rgba(255, 255, 255, 0.05) 100%
    );
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 25px;
    padding: 25px 20px;
    text-align: center;
    border: 1px solid rgba(255, 200, 220, 0.25);
    box-shadow: 
        0 15px 50px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(255, 150, 180, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.message-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,215,0,0.03) 0%, transparent 60%);
    animation: shimmer 8s linear infinite;
}

@keyframes shimmer {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.title {
    color: #ffd700;
    font-size: 22px;
    font-weight: normal;
    margin-bottom: 8px;
    letter-spacing: 3px;
    text-shadow: 
        0 0 20px rgba(255, 215, 0, 0.6),
        0 0 40px rgba(255, 215, 0, 0.3);
    position: relative;
}

.subtitle {
    color: #ffb6c1;
    font-size: 14px;
    margin-bottom: 15px;
    letter-spacing: 4px;
    font-weight: 300;
}

.message-text {
    color: rgba(255, 255, 255, 0.95);
    font-size: 14px;
    line-height: 2;
    margin-bottom: 15px;
    min-height: 80px;
    letter-spacing: 1px;
    position: relative;
}

.signature {
    color: #ff9ec4;
    font-size: 13px;
    font-style: italic;
    letter-spacing: 2px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 200, 220, 0.2);
}

/* ========== 烟花 ========== */
#fireworks {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

/* ========== 音乐按钮 ========== */
.music-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid rgba(255, 200, 220, 0.4);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    font-size: 20px;
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s ease;
}

.music-btn:hover {
    transform: scale(1.1);
    border-color: rgba(255, 200, 220, 0.8);
    box-shadow: 0 0 20px rgba(255, 150, 180, 0.4);
}

.music-btn.playing {
    animation: musicWave 1.5s ease-in-out infinite;
}

.music-btn.paused {
    opacity: 0.5;
}

@keyframes musicWave {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 150, 180, 0.4); }
    50% { box-shadow: 0 0 0 12px rgba(255, 150, 180, 0); }
}

/* ========== 响应式 ========== */
@media (max-height: 700px) {
    .tree-container { top: 2%; transform: translateX(-50%) scale(0.85); }
    .gifts-pile { top: 42%; }
    .message-card { padding: 18px 15px; }
    .title { font-size: 18px; }
}

@media (max-width: 350px) {
    .message-card { padding: 18px 15px; }
    .title { font-size: 18px; letter-spacing: 2px; }
    .message-text { font-size: 13px; }
}

/* ========== 点击特效 ========== */
.sparkle {
    position: fixed;
    pointer-events: none;
    font-size: 20px;
    animation: sparkleFloat 1s ease-out forwards;
    z-index: 1000;
}

@keyframes sparkleFloat {
    0% { transform: scale(0) rotate(0deg); opacity: 1; }
    100% { transform: scale(1) translateY(-30px) rotate(180deg); opacity: 0; }
}

/* ========== 极光效果 ========== */
.aurora {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(255, 100, 150, 0.02) 20%,
        rgba(100, 200, 255, 0.03) 40%,
        rgba(200, 100, 255, 0.02) 60%,
        transparent 100%
    );
    animation: auroraMove 10s ease-in-out infinite;
    pointer-events: none;
}

@keyframes auroraMove {
    0%, 100% { transform: translateX(-10%) skewX(-3deg); opacity: 0.6; }
    50% { transform: translateX(10%) skewX(3deg); opacity: 1; }
}

/* ========== 爱心飘落 ========== */
.floating-heart {
    position: fixed;
    color: #ff6b9d;
    font-size: 16px;
    animation: heartFloat 4s ease-in-out forwards;
    pointer-events: none;
    z-index: 50;
    opacity: 0.8;
}

@keyframes heartFloat {
    0% { transform: translateY(0) scale(1); opacity: 0.8; }
    100% { transform: translateY(-100px) scale(0.5); opacity: 0; }
}
