/* 基础动画 */
@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

@keyframes moonFloat {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(5deg); }
}

/* 闪烁动画 */
@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* 脉冲动画 */
@keyframes pulse {
    0%, 100% { 
        opacity: 1;
        transform: scale(1);
    }
    50% { 
        opacity: 0.8;
        transform: scale(1.05);
    }
}


@keyframes planetOrbit {
    0% { transform: translateX(0) translateY(0); }
    25% { transform: translateX(20px) translateY(-10px); }
    50% { transform: translateX(0) translateY(-20px); }
    75% { transform: translateX(-20px) translateY(-10px); }
    100% { transform: translateX(0) translateY(0); }
}

/* 流星动画关键帧 - 改进物理效果 */
@keyframes meteorFall {
    0% {
        transform: translate(-50px, -50px) rotate(var(--meteor-rotation, 45deg)) scale(0.8);
        opacity: 0;
        filter: brightness(1.5) saturate(1.2);
    }
    5% {
        opacity: 1;
        filter: brightness(1.3) saturate(1.1);
    }
    20% {
        transform: translate(calc(20vw - 50px), calc(20vh - 50px)) rotate(var(--meteor-rotation, 45deg)) scale(1);
        filter: brightness(1.2) saturate(1);
    }
    60% {
        transform: translate(calc(60vw - 50px), calc(60vh - 50px)) rotate(var(--meteor-rotation, 45deg)) scale(0.9);
        filter: brightness(1) saturate(0.9);
    }
    85% {
        transform: translate(calc(85vw - 50px), calc(85vh - 50px)) rotate(var(--meteor-rotation, 45deg)) scale(0.7);
        filter: brightness(0.8) saturate(0.7);
    }
    95% {
        opacity: 0.6;
        filter: brightness(0.6) saturate(0.5);
    }
    100% {
        transform: translate(calc(100vw + 50px), calc(100vh + 50px)) rotate(var(--meteor-rotation, 45deg)) scale(0.5);
        opacity: 0;
        filter: brightness(0.3) saturate(0.3);
    }
}

@keyframes meteorFallFast {
    0% {
        transform: translate(-30px, -30px) rotate(var(--meteor-rotation, 50deg)) scale(0.6);
        opacity: 0;
        filter: brightness(1.8) saturate(1.4);
    }
    3% {
        opacity: 1;
        filter: brightness(1.5) saturate(1.2);
    }
    15% {
        transform: translate(calc(15vw - 30px), calc(15vh - 30px)) rotate(var(--meteor-rotation, 50deg)) scale(0.8);
        filter: brightness(1.3) saturate(1.1);
    }
    50% {
        transform: translate(calc(50vw - 30px), calc(50vh - 30px)) rotate(var(--meteor-rotation, 50deg)) scale(0.7);
        filter: brightness(1.1) saturate(1);
    }
    85% {
        transform: translate(calc(85vw - 30px), calc(85vh - 30px)) rotate(var(--meteor-rotation, 50deg)) scale(0.5);
        filter: brightness(0.8) saturate(0.8);
    }
    97% {
        opacity: 0.4;
        filter: brightness(0.5) saturate(0.6);
    }
    100% {
        transform: translate(calc(100vw + 30px), calc(100vh + 30px)) rotate(var(--meteor-rotation, 50deg)) scale(0.3);
        opacity: 0;
        filter: brightness(0.2) saturate(0.4);
    }
}

@keyframes meteorFallSlow {
    0% {
        transform: translate(-80px, -80px) rotate(var(--meteor-rotation, 40deg)) scale(1.2);
        opacity: 0;
        filter: brightness(1.3) saturate(1.1);
    }
    8% {
        opacity: 1;
        filter: brightness(1.2) saturate(1);
    }
    25% {
        transform: translate(calc(25vw - 80px), calc(25vh - 80px)) rotate(var(--meteor-rotation, 40deg)) scale(1.1);
        filter: brightness(1.1) saturate(0.95);
    }
    50% {
        transform: translate(calc(50vw - 80px), calc(50vh - 80px)) rotate(var(--meteor-rotation, 40deg)) scale(1);
        filter: brightness(1) saturate(0.9);
    }
    75% {
        transform: translate(calc(75vw - 80px), calc(75vh - 80px)) rotate(var(--meteor-rotation, 40deg)) scale(0.9);
        filter: brightness(0.9) saturate(0.8);
    }
    92% {
        opacity: 0.7;
        filter: brightness(0.7) saturate(0.6);
    }
    100% {
        transform: translate(calc(100vw + 80px), calc(100vh + 80px)) rotate(var(--meteor-rotation, 40deg)) scale(0.6);
        opacity: 0;
        filter: brightness(0.4) saturate(0.4);
    }
}

@keyframes meteorTrail {
    0% {
        width: 0px;
        opacity: 0;
    }
    10% {
        width: 100px;
        opacity: 1;
    }
    90% {
        width: 120px;
        opacity: 0.8;
    }
    100% {
        width: 0px;
        opacity: 0;
    }
}

@keyframes meteorGlow {
    0%, 100% {
        box-shadow: 0 0 4px currentColor, 0 0 8px currentColor, 0 0 12px currentColor;
    }
    50% {
        box-shadow: 0 0 8px currentColor, 0 0 16px currentColor, 0 0 24px currentColor;
    }
}

/* 流星爆炸效果 */
@keyframes meteorExplosion {
    0% {
        transform: scale(1);
        opacity: 1;
        filter: brightness(2) saturate(1.5);
    }
    50% {
        transform: scale(1.5);
        opacity: 0.8;
        filter: brightness(3) saturate(2);
    }
    100% {
        transform: scale(2);
        opacity: 0;
        filter: brightness(0.5) saturate(0.5);
    }
}

/* 流星粒子效果 */
@keyframes meteorParticle {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    50% {
        transform: translate(var(--particle-x, 20px), var(--particle-y, 20px)) scale(0.5);
        opacity: 0.6;
    }
    100% {
        transform: translate(var(--particle-x, 40px), var(--particle-y, 40px)) scale(0);
        opacity: 0;
    }
}

/* 流星尾迹粒子 */
@keyframes trailParticle {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 0.8;
    }
    100% {
        transform: translate(var(--trail-x, 30px), var(--trail-y, 30px)) scale(0);
        opacity: 0;
    }
}

@keyframes sunFloat {
    0%, 100% {
        transform: translateY(0px) scale(1);
    }
    50% {
        transform: translateY(-15px) scale(1.05);
    }
}

@keyframes rayRotate {
    0% {
        opacity: 0.6;
        transform: translate(-50%, -50%) rotate(var(--rotation, 0deg)) scale(1);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) rotate(var(--rotation, 0deg)) scale(1.1);
    }
    100% {
        opacity: 0.6;
        transform: translate(-50%, -50%) rotate(var(--rotation, 0deg)) scale(1);
    }
}

@keyframes cloudFloat {
    0% {
        transform: translateX(-100px);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateX(calc(100vw + 100px));
        opacity: 0;
    }
}

@keyframes birdFly {
    0% {
        transform: translateX(-50px) scaleX(1) translateY(0px);
        opacity: 0;
    }
    5% {
        opacity: 1;
    }
    15% {
        transform: translateX(10vw) scaleX(1) translateY(-5px);
    }
    30% {
        transform: translateX(25vw) scaleX(1) translateY(3px);
    }
    45% {
        transform: translateX(40vw) scaleX(1) translateY(-2px);
    }
    60% {
        transform: translateX(55vw) scaleX(1) translateY(4px);
    }
    75% {
        transform: translateX(70vw) scaleX(1) translateY(-1px);
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateX(calc(100vw + 50px)) scaleX(1) translateY(0px);
        opacity: 0;
    }
}

@keyframes wingFlap {
    0% {
        transform: scaleY(1) rotateX(0deg);
    }
    100% {
        transform: scaleY(0.7) rotateX(15deg);
    }
}

@keyframes bodySway {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    25% {
        transform: translateY(-1px) rotate(1deg);
    }
    50% {
        transform: translateY(0px) rotate(0deg);
    }
    75% {
        transform: translateY(1px) rotate(-1deg);
    }
}

@keyframes blink {
    0%, 90%, 100% {
        transform: scaleY(1);
    }
    95% {
        transform: scaleY(0.1);
    }
}

@keyframes pupilMove {
    0%, 100% {
        transform: translateX(0px);
    }
    50% {
        transform: translateX(0.2px);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* 夜间星空背景样式 */
.night-sky {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    transition: opacity 0.8s ease;
    pointer-events: none;
    z-index: 1;
}

[data-theme="night"] .night-sky {
    opacity: 1;
}

/* 星空容器 */
.stars-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center, #1a1a2e 0%, #0f0f23 100%);
}

/* 星星样式 */
.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: twinkle 3s ease-in-out infinite;
}

.star.small {
    width: 1px;
    height: 1px;
    box-shadow: 0 0 2px white;
}

.star.medium {
    width: 2px;
    height: 2px;
    box-shadow: 0 0 4px white, 0 0 8px rgba(255, 255, 255, 0.3);
}

.star.large {
    width: 3px;
    height: 3px;
    box-shadow: 0 0 6px white, 0 0 12px rgba(255, 255, 255, 0.4);
}

/* 星座连线 */
.constellation-lines {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.3;
}

.constellation-line {
    position: absolute;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform-origin: left center;
}

/* 月亮样式 */
.moon {
    position: absolute;
    top: 8%;
    right: 8%;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(248, 249, 250, 0.3), 0 0 40px rgba(248, 249, 250, 0.1);
    animation: moonFloat 8s ease-in-out infinite;
    z-index: 5;
}


.moon-craters {
    position: relative;
    width: 100%;
    height: 100%;
}

.crater {
    position: absolute;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
}

.crater-1 {
    width: 12px;
    height: 12px;
    top: 20%;
    left: 30%;
}

.crater-2 {
    width: 8px;
    height: 8px;
    top: 60%;
    left: 60%;
}

.crater-3 {
    width: 6px;
    height: 6px;
    top: 40%;
    left: 70%;
}

/* 行星样式 */
.planets {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.planet {
    position: absolute;
    border-radius: 50%;
    animation: planetOrbit 20s linear infinite;
}

.planet-1 {
    width: 12px;
    height: 12px;
    background: linear-gradient(45deg, #ff6b6b, #ff8e8e);
    top: 25%;
    left: 15%;
    animation-duration: 15s;
    box-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
}

.planet-2 {
    width: 8px;
    height: 8px;
    background: linear-gradient(45deg, #4ecdc4, #7fdbda);
    top: 60%;
    left: 80%;
    animation-duration: 25s;
    animation-delay: -5s;
    box-shadow: 0 0 8px rgba(78, 205, 196, 0.5);
}

.planet-3 {
    width: 6px;
    height: 6px;
    background: linear-gradient(45deg, #ffe66d, #fff3a0);
    top: 40%;
    left: 5%;
    animation-duration: 30s;
    animation-delay: -10s;
    box-shadow: 0 0 6px rgba(255, 230, 109, 0.5);
}

/* 流星雨效果 */
.meteor-shower {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    transition: opacity 0.8s ease;
    pointer-events: none;
    z-index: 10;
}

[data-theme="night"] .meteor-shower {
    opacity: 1;
}

/* 流星基础样式 */
.meteor {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 15;
}

/* 小流星 */
.meteor.small {
    width: 2px;
    height: 2px;
    background: #87CEEB;
    color: #87CEEB;
    animation: meteorFallFast 2.5s linear forwards, meteorGlow 0.3s ease-in-out infinite;
}

.meteor.small::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, currentColor, rgba(135, 206, 235, 0.6), transparent);
    transform: rotate(var(--meteor-rotation, 45deg));
    transform-origin: left center;
    animation: meteorTrail 2.5s linear forwards;
}

/* 中等流星 */
.meteor.medium {
    width: 3px;
    height: 3px;
    background: #fff;
    color: #fff;
    animation: meteorFall 4s linear forwards, meteorGlow 0.4s ease-in-out infinite;
}

.meteor.medium::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100px;
    height: 2px;
    background: linear-gradient(90deg, currentColor, rgba(255, 255, 255, 0.8), transparent);
    transform: rotate(var(--meteor-rotation, 45deg));
    transform-origin: left center;
    animation: meteorTrail 4s linear forwards;
}

/* 大流星 */
.meteor.large {
    width: 4px;
    height: 4px;
    background: #FFD700;
    color: #FFD700;
    animation: meteorFallSlow 5.5s linear forwards, meteorGlow 0.5s ease-in-out infinite;
}

.meteor.large::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 150px;
    height: 3px;
    background: linear-gradient(90deg, currentColor, rgba(255, 215, 0, 0.7), transparent);
    transform: rotate(var(--meteor-rotation, 45deg));
    transform-origin: left center;
    animation: meteorTrail 5.5s linear forwards;
}

/* 火流星 */
.meteor.fire {
    width: 5px;
    height: 5px;
    background: #FF4500;
    color: #FF4500;
    animation: meteorFall 3.5s linear forwards, meteorGlow 0.2s ease-in-out infinite;
}

.meteor.fire::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 200px;
    height: 4px;
    background: linear-gradient(90deg, currentColor, rgba(255, 69, 0, 0.8), rgba(255, 165, 0, 0.4), transparent);
    transform: rotate(var(--meteor-rotation, 45deg));
    transform-origin: left center;
    animation: meteorTrail 3.5s linear forwards;
}

/* 流星尾迹增强效果 */
.meteor::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-left: 2px solid transparent;
    border-right: 2px solid transparent;
    border-bottom: 4px solid currentColor;
    transform: rotate(var(--meteor-rotation, 45deg));
    transform-origin: left center;
    opacity: 0.6;
}

/* 流星爆炸效果 */
.meteor.exploding {
    animation: meteorExplosion 0.8s ease-out forwards;
    z-index: 20;
}

/* 流星粒子效果 */
.meteor-particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: currentColor;
    border-radius: 50%;
    pointer-events: none;
    z-index: 16;
    animation: meteorParticle 1.5s ease-out forwards;
}

/* 流星尾迹粒子 */
.meteor-trail-particle {
    position: absolute;
    width: 1px;
    height: 1px;
    background: currentColor;
    border-radius: 50%;
    pointer-events: none;
    z-index: 14;
    animation: trailParticle 2s ease-out forwards;
    opacity: 0.6;
}

/* 特殊流星效果 */
.meteor.special {
    background: linear-gradient(45deg, #FFD700, #FFA500, #FF6347);
    color: #FFD700;
    box-shadow: 0 0 20px #FFD700, 0 0 40px rgba(255, 215, 0, 0.3);
    animation: meteorFall 4s linear forwards, meteorGlow 0.3s ease-in-out infinite;
}

.meteor.special::before {
    background: linear-gradient(90deg, #FFD700, rgba(255, 215, 0, 0.8), rgba(255, 165, 0, 0.6), transparent);
    width: 180px;
    height: 4px;
}

/* 彗星效果 */
.meteor.comet {
    background: radial-gradient(circle, #87CEEB, #4682B4);
    color: #87CEEB;
    box-shadow: 0 0 15px #87CEEB, 0 0 30px rgba(135, 206, 235, 0.4);
    animation: meteorFallSlow 6s linear forwards, meteorGlow 0.5s ease-in-out infinite;
}

.meteor.comet::before {
    background: linear-gradient(90deg, #87CEEB, rgba(135, 206, 235, 0.7), rgba(70, 130, 180, 0.5), transparent);
    width: 250px;
    height: 3px;
}

.meteor.comet::after {
    border-bottom: 6px solid currentColor;
    opacity: 0.4;
}

/* 白天天空背景 */
.day-sky {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    transition: opacity 0.8s ease;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

[data-theme="day"] .day-sky {
    opacity: 1;
}

/* 太阳效果 */
.sun {
    position: absolute;
    top: 5%;
    right: 5%;
    width: 100px;
    height: 100px;
    z-index: 3;
    animation: sunFloat 10s ease-in-out infinite;
}

.sun-core {
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, #ffd700 0%, #ffed4e 30%, #ff8c00 100%);
    border-radius: 50%;
    box-shadow: 
        0 0 30px rgba(255, 215, 0, 0.6),
        0 0 60px rgba(255, 215, 0, 0.4),
        0 0 90px rgba(255, 215, 0, 0.2);
    position: relative;
    z-index: 2;
}

.sun-rays {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    z-index: 1;
}

.ray {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 40px;
    background: linear-gradient(180deg, rgba(255, 215, 0, 0.8), transparent);
    transform-origin: center bottom;
    border-radius: 1px;
    animation: rayRotate 4s linear infinite;
}

.ray-1 { transform: translate(-50%, -50%) rotate(0deg); }
.ray-2 { transform: translate(-50%, -50%) rotate(45deg); }
.ray-3 { transform: translate(-50%, -50%) rotate(90deg); }
.ray-4 { transform: translate(-50%, -50%) rotate(135deg); }
.ray-5 { transform: translate(-50%, -50%) rotate(180deg); }
.ray-6 { transform: translate(-50%, -50%) rotate(225deg); }
.ray-7 { transform: translate(-50%, -50%) rotate(270deg); }
.ray-8 { transform: translate(-50%, -50%) rotate(315deg); }

/* 云朵效果 */
.clouds-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
}

.cloud {
    position: absolute;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.7) 100%);
    border-radius: 50px;
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.3);
    animation: cloudFloat 20s linear infinite;
}

.cloud::before,
.cloud::after {
    content: '';
    position: absolute;
    background: inherit;
    border-radius: 50px;
}

.cloud-1 {
    width: 80px;
    height: 30px;
    top: 20%;
    left: 10%;
    animation-duration: 25s;
    animation-delay: 0s;
}

.cloud-1::before {
    width: 50px;
    height: 50px;
    top: -25px;
    left: 10px;
}

.cloud-1::after {
    width: 60px;
    height: 40px;
    top: -15px;
    right: 10px;
}

.cloud-2 {
    width: 100px;
    height: 35px;
    top: 30%;
    left: 60%;
    animation-duration: 30s;
    animation-delay: -5s;
}

.cloud-2::before {
    width: 60px;
    height: 60px;
    top: -30px;
    left: 15px;
}

.cloud-2::after {
    width: 70px;
    height: 45px;
    top: -20px;
    right: 15px;
}

.cloud-3 {
    width: 70px;
    height: 25px;
    top: 15%;
    left: 40%;
    animation-duration: 22s;
    animation-delay: -10s;
}

.cloud-3::before {
    width: 45px;
    height: 45px;
    top: -22px;
    left: 8px;
}

.cloud-3::after {
    width: 55px;
    height: 35px;
    top: -12px;
    right: 8px;
}

.cloud-4 {
    width: 90px;
    height: 32px;
    top: 25%;
    left: 80%;
    animation-duration: 28s;
    animation-delay: -15s;
}

.cloud-4::before {
    width: 55px;
    height: 55px;
    top: -27px;
    left: 12px;
}

.cloud-4::after {
    width: 65px;
    height: 42px;
    top: -17px;
    right: 12px;
}

.cloud-5 {
    width: 85px;
    height: 28px;
    top: 35%;
    left: 20%;
    animation-duration: 26s;
    animation-delay: -8s;
}

.cloud-5::before {
    width: 52px;
    height: 52px;
    top: -26px;
    left: 10px;
}

.cloud-5::after {
    width: 62px;
    height: 38px;
    top: -16px;
    right: 10px;
}

/* 飞鸟动画 */
.birds-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
}

.bird {
    position: absolute;
    width: 40px;
    height: 20px;
    animation: birdFly 15s linear infinite;
}

.bird-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
}

/* 翅膀扇动动画 */
.bird-wing-left {
    animation: wingFlap 0.3s ease-in-out infinite alternate;
    transform-origin: center;
}

.bird-wing-right {
    animation: wingFlap 0.3s ease-in-out infinite alternate-reverse;
    transform-origin: center;
}

/* 飞鸟身体轻微摆动 */
.bird-body {
    animation: bodySway 2s ease-in-out infinite;
    transform-origin: center;
}

/* 眼睛眨眼效果 */
.bird-eye {
    animation: blink 3s ease-in-out infinite;
}

.bird-pupil {
    animation: pupilMove 4s ease-in-out infinite;
}

.bird-1 {
    top: 25%;
    animation-duration: 18s;
    animation-delay: 0s;
}

.bird-2 {
    top: 40%;
    animation-duration: 22s;
    animation-delay: -7s;
    width: 35px;
    height: 18px;
}

.bird-3 {
    top: 15%;
    animation-duration: 20s;
    animation-delay: -12s;
    width: 38px;
    height: 19px;
}
