/* ========================================
   AI 探险家 - 动效文件
   ======================================== */

/* ========================================
   Glitch 效果
   ======================================== */
.glitch {
    position: relative;
}

.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 var(--neon-pink);
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 var(--neon-cyan);
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim 2.5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% { clip: rect(51px, 9999px, 28px, 0); }
    5% { clip: rect(70px, 9999px, 94px, 0); }
    10% { clip: rect(29px, 9999px, 83px, 0); }
    15% { clip: rect(86px, 9999px, 56px, 0); }
    20% { clip: rect(23px, 9999px, 44px, 0); }
    25% { clip: rect(12px, 9999px, 95px, 0); }
    30% { clip: rect(42px, 9999px, 67px, 0); }
    35% { clip: rect(78px, 9999px, 19px, 0); }
    40% { clip: rect(94px, 9999px, 35px, 0); }
    45% { clip: rect(5px, 9999px, 71px, 0); }
    50% { clip: rect(64px, 9999px, 23px, 0); }
    55% { clip: rect(89px, 9999px, 52px, 0); }
    60% { clip: rect(31px, 9999px, 78px, 0); }
    65% { clip: rect(17px, 9999px, 42px, 0); }
    70% { clip: rect(56px, 9999px, 87px, 0); }
    75% { clip: rect(3px, 9999px, 61px, 0); }
    80% { clip: rect(72px, 9999px, 15px, 0); }
    85% { clip: rect(45px, 9999px, 93px, 0); }
    90% { clip: rect(11px, 9999px, 34px, 0); }
    95% { clip: rect(82px, 9999px, 67px, 0); }
    100% { clip: rect(38px, 9999px, 49px, 0); }
}

@keyframes glitch-anim-2 {
    0% { clip: rect(65px, 9999px, 100px, 0); }
    5% { clip: rect(52px, 9999px, 74px, 0); }
    10% { clip: rect(79px, 9999px, 85px, 0); }
    15% { clip: rect(26px, 9999px, 48px, 0); }
    20% { clip: rect(93px, 9999px, 31px, 0); }
    25% { clip: rect(15px, 9999px, 67px, 0); }
    30% { clip: rect(88px, 9999px, 54px, 0); }
    35% { clip: rect(41px, 9999px, 19px, 0); }
    40% { clip: rect(72px, 9999px, 86px, 0); }
    45% { clip: rect(9px, 9999px, 42px, 0); }
    50% { clip: rect(56px, 9999px, 73px, 0); }
    55% { clip: rect(31px, 9999px, 28px, 0); }
    60% { clip: rect(84px, 9999px, 61px, 0); }
    65% { clip: rect(47px, 9999px, 15px, 0); }
    70% { clip: rect(23px, 9999px, 92px, 0); }
    75% { clip: rect(68px, 9999px, 37px, 0); }
    80% { clip: rect(14px, 9999px, 59px, 0); }
    85% { clip: rect(91px, 9999px, 24px, 0); }
    90% { clip: rect(36px, 9999px, 78px, 0); }
    95% { clip: rect(63px, 9999px, 43px, 0); }
    100% { clip: rect(27px, 9999px, 81px, 0); }
}

/* ========================================
   扫描线效果
   ======================================== */
.scanline {
    position: relative;
    overflow: hidden;
}

.scanline::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--neon-cyan);
    box-shadow: 0 0 10px var(--neon-cyan);
    animation: scanMove 2s linear infinite;
}

@keyframes scanMove {
    0% { top: 0; }
    100% { top: 100%; }
}

/* ========================================
   脉冲发光效果
   ======================================== */
.pulse-glow {
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 5px var(--neon-cyan);
    }
    50% {
        box-shadow: 0 0 20px var(--neon-cyan), 0 0 40px var(--neon-cyan);
    }
}

/* ========================================
   霓虹闪烁效果
   ======================================== */
.neon-flicker {
    animation: neonFlicker 3s infinite;
}

@keyframes neonFlicker {
    0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
        text-shadow:
            0 0 4px var(--neon-cyan),
            0 0 11px var(--neon-cyan),
            0 0 19px var(--neon-cyan),
            0 0 40px var(--neon-cyan);
    }
    20%, 24%, 55% {
        text-shadow: none;
    }
}

/* ========================================
   打字机效果
   ======================================== */
.typewriter {
    overflow: hidden;
    white-space: nowrap;
    animation: typing 2s steps(30, end);
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

/* ========================================
   淡入上浮效果
   ======================================== */
.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   弹性缩放效果
   ======================================== */
.bounce-scale {
    animation: bounceScale 0.5s ease;
}

@keyframes bounceScale {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

/* ========================================
   加载旋转效果
   ======================================== */
.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ========================================
   进度条动画
   ======================================== */
.progress-animate {
    position: relative;
    overflow: hidden;
}

.progress-animate::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    animation: progressShine 1.5s infinite;
}

@keyframes progressShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ========================================
   成功动画
   ======================================== */
.success-burst {
    position: relative;
}

.success-burst::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, var(--neon-green) 0%, transparent 70%);
    transform: translate(-50%, -50%) scale(0);
    animation: successBurst 0.6s ease-out;
    pointer-events: none;
}

@keyframes successBurst {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(2); opacity: 0; }
}

/* ========================================
   故障扫描效果
   ======================================== */
.glitch-scan {
    position: relative;
}

.glitch-scan::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        transparent 50%,
        rgba(0, 245, 255, 0.03) 50%
    );
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 10;
}

/* ========================================
   延迟动画类
   ======================================== */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

/* ========================================
   持续旋转
   ======================================== */
.orbit {
    animation: orbit 10s linear infinite;
}

@keyframes orbit {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ========================================
   呼吸效果
   ======================================== */
.breathe {
    animation: breathe 3s ease-in-out infinite;
}

@keyframes breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}
