/* 关键帧动画 */
@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        box-shadow: 0 10px 20px rgba(100, 255, 218, 0.2);
    }
    50% {
        transform: translateY(-20px) rotate(5deg);
        box-shadow: 0 25px 40px rgba(100, 255, 218, 0.4);
    }
}

@keyframes orbit {
    0% {
        transform: translateX(-50%) rotate(0deg) translateX(150px) rotate(0deg);
    }
    100% {
        transform: translateX(-50%) rotate(360deg) translateX(150px) rotate(-360deg);
    }
}

@keyframes scrollBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes rotateReverse {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(-360deg);
    }
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(100, 255, 218, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(100, 255, 218, 0.6);
    }
}

/* 滚动动画类 */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 特定元素动画 */
.hero-title {
    animation: fadeInUp 1s ease-out;
}

.hero-subtitle {
    animation: fadeInUp 1s ease-out 0.3s both;
}

.hero-buttons {
    animation: fadeInUp 1s ease-out 0.6s both;
}

.service-card {
    animation: fadeInUp 0.8s ease-out;
}

.service-card:nth-child(1) { animation-delay: 0.1s; }
.service-card:nth-child(2) { animation-delay: 0.2s; }
.service-card:nth-child(3) { animation-delay: 0.3s; }

.tech-item {
    animation: fadeInLeft 0.8s ease-out;
}

.tech-item:nth-child(1) { animation-delay: 0.1s; }
.tech-item:nth-child(2) { animation-delay: 0.2s; }
.tech-item:nth-child(3) { animation-delay: 0.3s; }
.tech-item:nth-child(4) { animation-delay: 0.4s; }

/* 悬停效果增强 */
.service-card:hover .service-icon {
    animation: pulse 1s ease-in-out;
    color: #00bcd4;
}

.btn:hover {
    animation: glow 1s ease-in-out infinite;
}

/* 导航栏滚动效果 */
.navbar.scrolled {
    background: rgba(10, 25, 47, 0.98);
    backdrop-filter: blur(15px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.nav-link.active {
    color: #64ffda;
}

.nav-link.active::after {
    width: 100%;
}

/* 加载动画 */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(100, 255, 218, 0.3);
    border-top: 3px solid #64ffda;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 文字打字机效果 */
.typewriter {
    overflow: hidden;
    border-right: 2px solid #64ffda;
    white-space: nowrap;
    animation: typing 3s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: #64ffda; }
}

/* 3D 翻转效果 */
.flip-card {
    perspective: 1000px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    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;
}

.flip-card-back {
    transform: rotateY(180deg);
}

/* 粒子效果增强 */
.particle {
    position: absolute;
    background: #64ffda;
    border-radius: 50%;
    animation: particleFloat 6s ease-in-out infinite;
}

@keyframes particleFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.7;
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
        opacity: 1;
    }
}

/* 响应式动画调整 */
@media (max-width: 768px) {
    .hero-title {
        animation: fadeInUp 0.8s ease-out;
    }
    
    .hero-subtitle {
        animation: fadeInUp 0.8s ease-out 0.2s both;
    }
    
    .hero-buttons {
        animation: fadeInUp 0.8s ease-out 0.4s both;
    }
    
    .service-card {
        animation: fadeInUp 0.6s ease-out;
    }
}