/* 2025ai AI特效样式 */

/* 粒子背景 */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: rgba(10, 143, 79, 0.4);
    border-radius: 50%;
    animation: particleFloat 15s infinite ease-in-out;
}

@keyframes particleFloat {
    0%, 100% {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(100px);
        opacity: 0;
    }
}

/* 渐变动画 */
.gradient-bg {
    background: linear-gradient(-45deg, #0a5d2c, #00a0e9, #0d7a36, #1abc9c);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 悬浮效果 */
.float-element {
    animation: floatUpDown 3s ease-in-out infinite;
}

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

/* 发光效果 */
.glow {
    box-shadow: 0 0 20px rgba(10, 143, 79, 0.5);
    transition: box-shadow 0.3s ease;
}

.glow:hover {
    box-shadow: 0 0 40px rgba(10, 143, 79, 0.8);
}

/* 玻璃态效果增强 */
.glass-morphism {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 3D翻转效果 */
.flip-card {
    perspective: 1000px;
}

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

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

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

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

/* 文字渐变 */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 加载动画 */
.loading-dots {
    display: flex;
    gap: 5px;
    justify-content: center;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: var(--primary-green, #0a5d2c);
    border-radius: 50%;
    animation: bounceDot 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounceDot {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* 打字机效果 */
.typewriter {
    overflow: hidden;
    border-right: 3px solid var(--primary-green, #0a5d2c);
    white-space: nowrap;
    animation: typing 3s steps(30) forwards, blinkCursor 0.8s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blinkCursor {
    50% { border-color: transparent; }
}

/* 涟漪效果 */
.ripple {
    position: relative;
    overflow: hidden;
}

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

.ripple:active::after {
    width: 300px;
    height: 300px;
}

/* 滑块指示器 */
.slider-indicator {
    display: flex;
    gap: 10px;
}

.slider-indicator .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.slider-indicator .dot.active {
    background: #fff;
    width: 30px;
    border-radius: 5px;
}

/* 视差效果 */
.parallax {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* 淡入上浮动画 */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 0.6s ease forwards;
}

.fade-up.delay-1 { animation-delay: 0.1s; }
.fade-up.delay-2 { animation-delay: 0.2s; }
.fade-up.delay-3 { animation-delay: 0.3s; }
.fade-up.delay-4 { animation-delay: 0.4s; }
.fade-up.delay-5 { animation-delay: 0.5s; }
.fade-up.delay-6 { animation-delay: 0.6s; }

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 右滑入动画 */
.fade-right {
    opacity: 0;
    transform: translateX(50px);
    animation: fadeRight 0.8s ease forwards;
}

@keyframes fadeRight {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 缩放淡入 */
.fade-scale {
    opacity: 0;
    transform: scale(0.9);
    animation: fadeScale 0.6s ease forwards;
}

@keyframes fadeScale {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 闪烁效果 */
.blink {
    animation: blinkEffect 1s infinite;
}

@keyframes blinkEffect {
    0%, 50%, 100% { opacity: 1; }
    25%, 75% { opacity: 0.5; }
}

/* 旋转效果 */
.spin {
    animation: spinEffect 2s linear infinite;
}

@keyframes spinEffect {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 脉冲效果 */
.pulse {
    animation: pulseEffect 2s ease-in-out infinite;
}

@keyframes pulseEffect {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* 边框动画 */
.border-animate {
    position: relative;
}

.border-animate::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid var(--primary-green, #0a5d2c);
    border-radius: inherit;
    animation: borderDraw 2s ease infinite;
}

@keyframes borderDraw {
    0% {
        clip-path: inset(0 100% 100% 0);
    }
    50% {
        clip-path: inset(0 0 0 0);
    }
    100% {
        clip-path: inset(100% 0 0 0);
    }
}

/* 背景扫光效果 */
.shine-bg {
    position: relative;
    overflow: hidden;
}

.shine-bg::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to right,
        transparent 0%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 100%
    );
    transform: rotate(30deg);
    animation: shineEffect 3s infinite;
}

@keyframes shineEffect {
    0% {
        transform: translateX(-100%) rotate(30deg);
    }
    100% {
        transform: translateX(100%) rotate(30deg);
    }
}

/* 卡片悬浮效果 */
.card-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* 文字扫光 */
.text-shine {
    background: linear-gradient(
        90deg,
        var(--primary-color) 0%,
        var(--accent-color) 50%,
        var(--primary-color) 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: textShine 3s linear infinite;
}

@keyframes textShine {
    to {
        background-position: 200% center;
    }
}

/* 加载骨架屏 */
.skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: skeletonLoading 1.5s ease infinite;
}

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

/* 响应式动画 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
