/* 星空背景动画 */
@keyframes animateStars {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(-2000px);
    }
}

#stars {
    background: url('../images/stars.png') repeat;
    animation: animateStars 200s linear infinite;
}

#stars2 {
    background: url('../images/stars2.png') repeat;
    animation: animateStars 150s linear infinite;
}

#stars3 {
    background: url('../images/stars3.png') repeat;
    animation: animateStars 100s linear infinite;
}

/* 闪烁文字效果 */
.glitch {
    position: relative;
    color: white;
    text-shadow: 0 0 10px rgba(0, 102, 255, 0.8);
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 #00ccff;
    animation: glitch-animation 2s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: 2px 0 #ff00cc;
    animation: glitch-animation 3s infinite linear alternate-reverse;
}

@keyframes glitch-animation {
    0% {
        clip-path: inset(0% 0% 98% 0%);
    }
    5% {
        clip-path: inset(80% 0% 0% 0%);
    }
    10% {
        clip-path: inset(0% 65% 0% 30%);
    }
    15% {
        clip-path: inset(0% 0% 100% 0%);
    }
    20% {
        clip-path: inset(0% 0% 0% 0%);
    }
    80% {
        clip-path: inset(0% 0% 0% 0%);
    }
    85% {
        clip-path: inset(50% 0% 0% 0%);
    }
    90% {
        clip-path: inset(0% 70% 0% 20%);
    }
    95% {
        clip-path: inset(0% 0% 90% 0%);
    }
    100% {
        clip-path: inset(0% 0% 0% 0%);
    }
}

/* 悬浮效果 */
@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0px);
    }
}

.float {
    animation: float 4s ease-in-out infinite;
}

/* 渐入效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 1s ease forwards;
}

/* 脉冲效果 */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 102, 255, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(0, 102, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 102, 255, 0);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* 打字机效果 */
@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink-caret {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: var(--primary-color);
    }
}

.typing {
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid var(--primary-color);
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

/* 滚动显示动画 */
.reveal {
    position: relative;
    opacity: 0;
    transform: translateY(50px);
    transition: all 1s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}