/* 动画效果 */

/* 页面加载动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

/* 页面元素动画 */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* 导航栏动画 */
.navbar {
    animation: fadeInDown 0.5s ease;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 语言切换器动画 */
.language-switcher {
    animation: fadeIn 0.8s ease 0.3s both;
}

/* 英雄区域动画 */
.hero-content {
    animation: slideInLeft 0.8s ease 0.2s both;
}

.hero-image {
    animation: slideInRight 0.8s ease 0.4s both;
}

/* 卡片悬停效果 */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* 按钮动画 */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.btn:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    20% {
        transform: scale(25, 25);
        opacity: 0.3;
    }
    100% {
        transform: scale(40, 40);
        opacity: 0;
    }
}

/* 图标动画 */
.advantage-icon,
.service-icon,
.tech-icon,
.contact-icon {
    transition: all 0.3s ease;
}

.advantage-card:hover .advantage-icon,
.service-card:hover .service-icon,
.tech-item:hover .tech-icon,
.contact-card:hover .contact-icon {
    transform: scale(1.2) rotate(5deg);
    color: #2563eb;
}

/* 进度条动画 */
.progress-bar {
    position: relative;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    border-radius: 4px;
    animation: progress 2s ease-in-out;
}

@keyframes progress {
    from {
        width: 0;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 3px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-small {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

/* 渐变背景动画 */
.animated-gradient {
    background: linear-gradient(-45deg, #3b82f6, #8b5cf6, #ec4899, #3b82f6);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

/* 打字机效果 */
.typewriter {
    overflow: hidden;
    border-right: 2px solid #3b82f6;
    white-space: nowrap;
    margin: 0 auto;
    animation: typing 3.5s steps(40, end), blink 0.75s step-end infinite;
}

/* 数字计数动画 */
.counter {
    font-variant-numeric: tabular-nums;
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.counting {
    animation: countUp 1s ease-out;
}

/* 图表动画 */
.chart-bar {
    animation: growBar 1.5s ease-out;
    animation-fill-mode: both;
}

.chart-bar:nth-child(1) { animation-delay: 0.1s; }
.chart-bar:nth-child(2) { animation-delay: 0.3s; }
.chart-bar:nth-child(3) { animation-delay: 0.5s; }
.chart-bar:nth-child(4) { animation-delay: 0.7s; }
.chart-bar:nth-child(5) { animation-delay: 0.9s; }

@keyframes growBar {
    0% {
        height: 0;
        opacity: 0;
    }
    100% {
        height: var(--target-height);
        opacity: 1;
    }
}

/* 波浪动画 */
.wave-animation {
    animation: wave 20s linear infinite;
}

@keyframes wave {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* 呼吸灯效果 */
.breathing {
    animation: pulse 2s ease-in-out infinite;
}

/* 旋转卡片 */
.rotate-card {
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.rotate-card:hover {
    transform: rotateY(180deg);
}

.rotate-card-front,
.rotate-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
}

.rotate-card-back {
    transform: rotateY(180deg);
}

/* 滑动指示器 */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
}

.scroll-indicator::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-bottom: 2px solid #3b82f6;
    border-right: 2px solid #3b82f6;
    transform: rotate(45deg);
    animation: scrollDown 2s infinite;
}

@keyframes scrollDown {
    0%, 100% {
        transform: rotate(45deg) translate(0, 0);
        opacity: 0;
    }
    50% {
        transform: rotate(45deg) translate(10px, 10px);
        opacity: 1;
    }
}

/* 表单输入动画 */
.form-group input:focus,
.form-group textarea:focus {
    animation: inputFocus 0.3s ease;
}

@keyframes inputFocus {
    0% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.2);
    }
    100% {
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    }
}

/* 成功/错误消息动画 */
.form-message {
    animation: messageIn 0.5s ease;
}

@keyframes messageIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* FAQ展开动画 */
.faq-answer {
    animation: faqExpand 0.3s ease;
}

@keyframes faqExpand {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
    }
}

/* 页面切换动画 */
.page-transition {
    animation: pageFade 0.5s ease;
}

@keyframes pageFade {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 视差滚动效果 */
.parallax {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* 网格动画 */
.grid-item {
    animation: gridAppear 0.6s ease;
    animation-fill-mode: both;
}

.grid-item:nth-child(1) { animation-delay: 0.1s; }
.grid-item:nth-child(2) { animation-delay: 0.2s; }
.grid-item:nth-child(3) { animation-delay: 0.3s; }
.grid-item:nth-child(4) { animation-delay: 0.4s; }
.grid-item:nth-child(5) { animation-delay: 0.5s; }
.grid-item:nth-child(6) { animation-delay: 0.6s; }

@keyframes gridAppear {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 闪烁高亮 */
.highlight {
    animation: highlight 1.5s ease;
}

@keyframes highlight {
    0% {
        background-color: transparent;
    }
    50% {
        background-color: rgba(59, 130, 246, 0.2);
    }
    100% {
        background-color: transparent;
    }
}

/* 工具类 */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

.duration-1 { animation-duration: 0.3s; }
.duration-2 { animation-duration: 0.6s; }
.duration-3 { animation-duration: 0.9s; }
.duration-4 { animation-duration: 1.2s; }
.duration-5 { animation-duration: 1.5s; }

.fade-in { animation: fadeIn 0.6s ease; }
.slide-in-left { animation: slideInLeft 0.6s ease; }
.slide-in-right { animation: slideInRight 0.6s ease; }
.scale-in { animation: scaleIn 0.6s ease; }
.bounce { animation: bounce 1s infinite; }
.pulse { animation: pulse 2s infinite; }
.spin { animation: spin 1s linear infinite; }