/* 基础动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes slideDown {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-50px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

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

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

/* 应用动画的类 */
.fade-in {
    animation: fadeIn 0.8s ease forwards;
}

.slide-up {
    animation: slideUp 0.8s ease forwards;
}

.slide-down {
    animation: slideDown 0.8s ease forwards;
}

.slide-left {
    animation: slideInLeft 0.8s ease forwards;
}

.slide-right {
    animation: slideInRight 0.8s ease forwards;
}

.pulse {
    animation: pulse 2s infinite ease-in-out;
}

.bounce {
    animation: bounce 2s infinite;
}

/* 页面加载动画 */
body {
    opacity: 0;
    animation: fadeIn 0.5s ease 0.2s forwards;
}

/* 首页元素动画 */
.hero h1 {
    opacity: 0;
    animation: slideInLeft 0.8s ease 0.3s forwards;
}

.hero p {
    opacity: 0;
    animation: slideInLeft 0.8s ease 0.5s forwards;
}

.hero-buttons {
    opacity: 0;
    animation: slideInLeft 0.8s ease 0.7s forwards;
}

/* 延迟加载卡片动画 */
.card {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.card.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* 统计数字动画 */
.stat-item h3 {
    display: inline-block;
    position: relative;
}

.stat-item h3.counting::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.5);
    animation: slideInLeft 1.5s ease forwards;
}

/* 鼠标悬停动画增强 */
.btn {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.nav-links a {
    transition: color 0.3s;
}

.nav-links a:hover {
    transform: translateY(0);
}

.nav-links a::after {
    transition: width 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* 滚动触发动画 */
[data-aos] {
    opacity: 0;
    transition-property: opacity, transform;
    transition-duration: 0.8s;
    transition-timing-function: ease;
}

[data-aos="fade-up"] {
    transform: translateY(30px);
}

[data-aos="fade-down"] {
    transform: translateY(-30px);
}

[data-aos="fade-left"] {
    transform: translateX(30px);
}

[data-aos="fade-right"] {
    transform: translateX(-30px);
}

[data-aos="zoom-in"] {
    transform: scale(0.9);
}

[data-aos].aos-animate {
    opacity: 1;
    transform: translateX(0) translateY(0) scale(1);
}

/* 客户Logo 悬停效果 */
.client-logo {
    filter: grayscale(100%);
    transition: filter 0.4s ease, transform 0.3s ease;
}

.client-logo:hover {
    filter: grayscale(0%);
}

/* 解决方案卡片动画增强 */
.solution-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.solution-card:hover {
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

.solution-card .solution-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.solution-card:hover .solution-image::before {
    opacity: 1;
}

/* 移动菜单动画 */
.mobile-menu-btn span {
    transition: transform 0.3s ease 0.1s, opacity 0.3s ease;
}

/* 页面平滑过渡 */
.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--primary);
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.page-transition.active {
    transform: translateY(0%);
}

.page-transition.leaving {
    transform: translateY(-100%);
}

/* 滚动到顶部按钮动画 */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s;
    z-index: 10;
}

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

.scroll-top:hover {
    background-color: var(--primary-light);
}

/* 优化预加载图片时的渐变效果 */
img.lazy-load {
    opacity: 0;
    transition: opacity 0.5s;
}

img.lazy-load.loaded {
    opacity: 1;
}

/* 响应式动画调整 */
@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;
    }
    
    body {
        opacity: 1;
    }
    
    .hero h1, 
    .hero p, 
    .hero-buttons,
    .card,
    [data-aos] {
        opacity: 1;
        transform: none;
    }
} 