/* ==========================================
   动画库 - UI/UX Pro-Max 增强
   ========================================== */

/* --- 基础动画关键帧 --- */

/* 渐入动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* 上滑渐入 */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 下滑渐入 */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 左滑渐入 */
@keyframes slideLeft {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 右滑渐入 */
@keyframes slideRight {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 缩放渐入 */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 脉冲光晕 */
@keyframes pulseGlow {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(57, 72, 210, 0.3),
            0 0 40px rgba(159, 26, 226, 0.1);
    }

    50% {
        box-shadow: 0 0 30px rgba(57, 72, 210, 0.5),
            0 0 60px rgba(159, 26, 226, 0.2);
    }
}

/* 悬浮效果 */
@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* 轻微悬浮 */
@keyframes floatSubtle {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

/* 闪烁效果 */
@keyframes shimmer {
    0% {
        background-position: -200% center;
    }

    100% {
        background-position: 200% center;
    }
}

/* 旋转 */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* 弹跳 */
@keyframes bounce {

    0%,
    20%,
    53%,
    100% {
        animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
        transform: translateY(0);
    }

    40%,
    43% {
        animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
        transform: translateY(-15px);
    }

    70% {
        animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
        transform: translateY(-7px);
    }

    80% {
        transform: translateY(0);
    }

    90% {
        transform: translateY(-3px);
    }
}

/* 波浪 */
@keyframes wave {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    25% {
        transform: translateY(-3px) rotate(1deg);
    }

    75% {
        transform: translateY(3px) rotate(-1deg);
    }
}

/* 背景渐变呼吸 */
@keyframes gradientBreath {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* 下划线展开 */
@keyframes underlineExpand {
    from {
        width: 0;
        left: 50%;
    }

    to {
        width: 80%;
        left: 10%;
    }
}


/* --- 动画工具类 --- */

.animate-fadeIn {
    animation: fadeIn 0.6s ease-out forwards;
}

.animate-slideUp {
    animation: slideUp 0.6s ease-out forwards;
}

.animate-slideDown {
    animation: slideDown 0.6s ease-out forwards;
}

.animate-slideLeft {
    animation: slideLeft 0.6s ease-out forwards;
}

.animate-slideRight {
    animation: slideRight 0.6s ease-out forwards;
}

.animate-scaleIn {
    animation: scaleIn 0.5s ease-out forwards;
}

.animate-pulseGlow {
    animation: pulseGlow 3s ease-in-out infinite;
}

.animate-float {
    animation: float 4s ease-in-out infinite;
}

.animate-floatSubtle {
    animation: floatSubtle 3s ease-in-out infinite;
}

.animate-shimmer {
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.4) 50%,
            transparent 100%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

.animate-bounce {
    animation: bounce 1s ease infinite;
}

.animate-wave {
    animation: wave 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;
}


/* --- 滚动触发动画初始状态 --- */

.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scroll-animate.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.scroll-animate-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scroll-animate-left.is-visible {
    opacity: 1;
    transform: translateX(0);
}

.scroll-animate-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scroll-animate-right.is-visible {
    opacity: 1;
    transform: translateX(0);
}

.scroll-animate-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scroll-animate-scale.is-visible {
    opacity: 1;
    transform: scale(1);
}


/* --- 特效类 --- */

/* 渐变文字 */
.gradient-text {
    background: linear-gradient(135deg, #3948d2, #9f1ae2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 动态渐变文字 */
.gradient-text-animated {
    background: linear-gradient(135deg, #3948d2, #9f1ae2, #3948d2);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientBreath 4s ease infinite;
}

/* 玻璃态卡片 */
.glass-card {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(57, 72, 210, 0.12);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 48px rgba(57, 72, 210, 0.18);
}

/* 霓虹光晕 */
.neon-glow {
    box-shadow: 0 0 10px rgba(57, 72, 210, 0.5),
        0 0 20px rgba(57, 72, 210, 0.3),
        0 0 30px rgba(159, 26, 226, 0.2);
}

/* 霓虹边框 */
.neon-border {
    border: 2px solid transparent;
    background: linear-gradient(white, white) padding-box,
        linear-gradient(135deg, #3948d2, #9f1ae2) border-box;
}


/* --- 减少动画偏好支持 --- */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .scroll-animate,
    .scroll-animate-left,
    .scroll-animate-right,
    .scroll-animate-scale {
        opacity: 1;
        transform: none;
    }
}