/* 高级动画效果 */
@keyframes floatUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInLeft {
    0% {
        opacity: 0;
        transform: translateX(-30px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    0% {
        opacity: 0;
        transform: translateX(30px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes rotateIn {
    0% {
        opacity: 0;
        transform: rotate(-180deg) scale(0.7);
    }
    100% {
        opacity: 1;
        transform: rotate(0) scale(1);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(var(--primary-rgb), 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(var(--primary-rgb), 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(var(--primary-rgb), 0);
    }
}

/* 应用动画的类 */
.animate-float-up {
    animation: floatUp 0.6s ease-out backwards;
}

.animate-scale-in {
    animation: scaleIn 0.5s ease-out backwards;
}

.animate-slide-left {
    animation: slideInLeft 0.5s ease-out backwards;
}

.animate-slide-right {
    animation: slideInRight 0.5s ease-out backwards;
}

.animate-rotate {
    animation: rotateIn 0.6s ease-out backwards;
}

.animate-bounce {
    animation: bounce 2s infinite;
}

/* 交错动画 */
.stagger-animation > * {
    opacity: 0;
}

.stagger-animation > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-animation > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-animation > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-animation > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-animation > *:nth-child(5) { animation-delay: 0.5s; }

/* 悬停效果 */
.hover-float {
    transition: transform 0.3s ease;
}

.hover-float:hover {
    transform: translateY(-5px);
}

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-rotate {
    transition: transform 0.3s ease;
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

/* 加载动画 */
.loading-shimmer {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.loading-pulse {
    animation: pulse 2s infinite;
}

/* 滚动动画 */
.scroll-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease-out;
}

.scroll-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 交互反馈 */
.click-effect {
    position: relative;
    overflow: hidden;
}

.click-effect::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease-out, height 0.3s ease-out;
}

.click-effect:active::after {
    width: 300px;
    height: 300px;
}

/* 3D 变换效果 */
.card-3d {
    transform-style: preserve-3d;
    perspective: 1000px;
}

.card-3d:hover .card-3d-inner {
    transform: rotateY(180deg);
}

.card-3d-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.card-3d-front,
.card-3d-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
}

.card-3d-back {
    transform: rotateY(180deg);
}

/* 高级渐变和光效动画 */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.4),
                    0 0 40px rgba(5, 150, 105, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(16, 185, 129, 0.6),
                    0 0 60px rgba(5, 150, 105, 0.5);
    }
}

@keyframes floatSlow {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleInBounce {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes ripple {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4),
                    0 0 0 0 rgba(5, 150, 105, 0.4);
    }
    50% {
        box-shadow: 0 0 0 15px rgba(16, 185, 129, 0.1),
                    0 0 0 30px rgba(5, 150, 105, 0.1);
    }
    100% {
        box-shadow: 0 0 0 30px rgba(16, 185, 129, 0),
                    0 0 0 60px rgba(5, 150, 105, 0);
    }
}

@keyframes textGlow {
    0%, 100% {
        text-shadow: 0 0 10px rgba(16, 185, 129, 0.5),
                     0 0 20px rgba(5, 150, 105, 0.3);
    }
    50% {
        text-shadow: 0 0 20px rgba(16, 185, 129, 0.8),
                     0 0 40px rgba(5, 150, 105, 0.6);
    }
}

/* 新增动画类 */
.animate-gradient {
    background: linear-gradient(45deg, #10b981, #059669, #10b981);
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

.animate-glow {
    animation: glowPulse 2s ease-in-out infinite;
}

.animate-float-slow {
    animation: floatSlow 6s ease-in-out infinite;
}

.animate-slide-up {
    animation: slideInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

.animate-scale-bounce {
    animation: scaleInBounce 0.7s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

.animate-ripple {
    animation: ripple 2s ease-out infinite;
}

.animate-text-glow {
    animation: textGlow 2s ease-in-out infinite;
}

/* 悬停增强效果 */
.hover-lift {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(16, 185, 129, 0.3),
                0 10px 20px rgba(5, 150, 105, 0.2);
}

.hover-gradient-shift {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.hover-gradient-shift::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.hover-gradient-shift:hover::before {
    left: 100%;
}

/* 延迟交错动画增强 */
.stagger-delay-1 { animation-delay: 0.1s; }
.stagger-delay-2 { animation-delay: 0.2s; }
.stagger-delay-3 { animation-delay: 0.3s; }
.stagger-delay-4 { animation-delay: 0.4s; }
.stagger-delay-5 { animation-delay: 0.5s; }
.stagger-delay-6 { animation-delay: 0.6s; }

/* 粒子效果 */
.particles-bg {
    position: relative;
    overflow: hidden;
}

.particles-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(16, 185, 129, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(5, 150, 105, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(16, 185, 129, 0.05) 0%, transparent 50%);
    animation: floatSlow 15s ease-in-out infinite;
    pointer-events: none;
}

/* 无障碍支持 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
