/**
 * 动画定义文件
 * 统一管理所有动画效果，避免重复定义
 * 优化日期: 2026-01-22
 */

/* ========== 淡入动画 ========== */

/* 淡入上移 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 淡入下移 */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 淡入 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 淡出 */
@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* ========== 滑入动画 ========== */

/* 从左滑入 */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 从右滑入 */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 从上滑入 */
@keyframes slideInTop {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 从下滑入 */
@keyframes slideInBottom {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== 缩放动画 ========== */

/* 放大 */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 缩小 */
@keyframes zoomOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.8);
    }
}

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

/* ========== 旋转动画 ========== */

/* 旋转 */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 摇摆 */
@keyframes swing {
    0%, 100% {
        transform: rotate(0deg);
    }
    20% {
        transform: rotate(15deg);
    }
    40% {
        transform: rotate(-10deg);
    }
    60% {
        transform: rotate(5deg);
    }
    80% {
        transform: rotate(-5deg);
    }
}

/* ========== 弹跳动画 ========== */

/* 弹跳 */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* 弹跳进入 */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

/* ========== 浮动动画 ========== */

/* 上下浮动 */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* 左右浮动 */
@keyframes floatHorizontal {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(10px);
    }
}

/* ========== 发光动画 ========== */

/* 霓虹发光 */
@keyframes neonGlow {
    0%, 100% {
        text-shadow: 0 0 10px rgba(255, 215, 0, 0.5),
                     0 0 20px rgba(255, 215, 0, 0.3),
                     0 0 30px rgba(255, 215, 0, 0.2);
    }
    50% {
        text-shadow: 0 0 20px rgba(255, 215, 0, 0.8),
                     0 0 30px rgba(255, 215, 0, 0.6),
                     0 0 40px rgba(255, 215, 0, 0.4);
    }
}

/* 金色发光 */
@keyframes goldGlow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.3),
                    0 0 20px rgba(255, 215, 0, 0.2);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.6),
                    0 0 30px rgba(255, 215, 0, 0.4);
    }
}

/* 青色发光 */
@keyframes cyanGlow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(0, 255, 255, 0.3),
                    0 0 20px rgba(0, 255, 255, 0.2);
    }
    50% {
        box-shadow: 0 0 20px rgba(0, 255, 255, 0.6),
                    0 0 30px rgba(0, 255, 255, 0.4);
    }
}

/* ========== 扩展动画 ========== */

/* 分隔线扩展 */
@keyframes expandDivider {
    from {
        transform: scaleX(0);
        opacity: 0;
    }
    to {
        transform: scaleX(1);
        opacity: 1;
    }
}

/* 宽度扩展 */
@keyframes expandWidth {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

/* 高度扩展 */
@keyframes expandHeight {
    from {
        height: 0;
    }
    to {
        height: 100%;
    }
}

/* ========== 闪烁动画 ========== */

/* 闪烁 */
@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

/* 闪光 */
@keyframes flash {
    0%, 50%, 100% {
        opacity: 1;
    }
    25%, 75% {
        opacity: 0;
    }
}

/* ========== 摇晃动画 ========== */

/* 水平摇晃 */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

/* 垂直摇晃 */
@keyframes shakeVertical {
    0%, 100% {
        transform: translateY(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateY(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateY(5px);
    }
}

/* ========== 波纹动画 ========== */

/* 波纹扩散 */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* 波浪 */
@keyframes wave {
    0%, 100% {
        transform: translateY(0);
    }
    25% {
        transform: translateY(-5px);
    }
    50% {
        transform: translateY(0);
    }
    75% {
        transform: translateY(5px);
    }
}

/* ========== 翻转动画 ========== */

/* 水平翻转 */
@keyframes flipX {
    from {
        transform: perspective(400px) rotateX(90deg);
        opacity: 0;
    }
    to {
        transform: perspective(400px) rotateX(0deg);
        opacity: 1;
    }
}

/* 垂直翻转 */
@keyframes flipY {
    from {
        transform: perspective(400px) rotateY(90deg);
        opacity: 0;
    }
    to {
        transform: perspective(400px) rotateY(0deg);
        opacity: 1;
    }
}

/* ========== 实用动画类 ========== */

/* 应用淡入上移动画 */
.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

/* 应用滑入左侧动画 */
.animate-slide-in-left {
    animation: slideInLeft 0.6s ease-out forwards;
}

/* 应用滑入右侧动画 */
.animate-slide-in-right {
    animation: slideInRight 0.6s ease-out forwards;
}

/* 应用浮动动画 */
.animate-float {
    animation: float 3s ease-in-out infinite;
}

/* 应用脉冲动画 */
.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* 应用旋转动画 */
.animate-rotate {
    animation: rotate 2s linear infinite;
}

/* 应用弹跳动画 */
.animate-bounce {
    animation: bounce 1s ease-in-out infinite;
}

/* 应用霓虹发光动画 */
.animate-neon-glow {
    animation: neonGlow 2s ease-in-out infinite;
}

/* ========== 延迟类 ========== */

.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }
.delay-700 { animation-delay: 0.7s; }
.delay-800 { animation-delay: 0.8s; }
.delay-900 { animation-delay: 0.9s; }
.delay-1000 { animation-delay: 1s; }

/* ========== 持续时间类 ========== */

.duration-fast { animation-duration: 0.3s; }
.duration-normal { animation-duration: 0.6s; }
.duration-slow { animation-duration: 1s; }
.duration-slower { animation-duration: 2s; }
