/* ========================================
   东创蓝图科技企业官网 - 动画效果样式文件
   ======================================== */

/* ========================================
   页面加载动画
   ======================================== */

/* Hero 区域加载动画 */
.hero-content {
    animation: heroFadeIn 1s ease-out;
}

.hero-title {
    animation: heroSlideUp 0.8s ease-out 0.2s both;
}

.hero-subtitle {
    animation: heroSlideUp 0.8s ease-out 0.4s both;
}

.hero-description {
    animation: heroSlideUp 0.8s ease-out 0.6s both;
}

.hero-actions {
    animation: heroSlideUp 0.8s ease-out 0.8s both;
}

@keyframes heroFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes heroSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   滚动触发动画
   ======================================== */

/* 元素淡入动画 */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 元素从左侧滑入 */
.slide-in-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.slide-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

/* 元素从右侧滑入 */
.slide-in-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.slide-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* 元素缩放淡入 */
.scale-in {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scale-in.visible {
    opacity: 1;
    transform: scale(1);
}

/* ========================================
   卡片动画
   ======================================== */

/* 服务卡片悬停动画 */
.service-card {
    transition: transform 0.3s ease-out, box-shadow 0.3s ease-out;
}

.service-card:hover {
    animation: cardPulse 0.3s ease-out;
}

@keyframes cardPulse {
    0%, 100% {
        transform: translateY(-8px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* 案例卡片悬停动画 */
.case-card {
    transition: transform 0.3s ease-out, box-shadow 0.3s ease-out;
}

.case-card:hover .case-image-content {
    animation: imageZoom 0.3s ease-out;
}

@keyframes imageZoom {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(1.05);
    }
}

/* ========================================
   数字计数动画
   ======================================== */

.advantage-number {
    transition: all 0.3s ease-out;
}

.advantage-number.counting {
    animation: numberGrow 0.1s ease-out;
}

@keyframes numberGrow {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(1.1);
    }
}

/* ========================================
   按钮动画
   ======================================== */

/* 按钮点击动画 */
.btn {
    transition: all 0.3s ease-out;
}

.btn:active {
    transform: scale(0.95);
}

/* 主按钮悬停动画 */
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    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 ease-out, height 0.6s ease-out;
}

.btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

/* ========================================
   导航栏动画
   ======================================== */

/* 导航栏滚动动画 */
.navbar {
    transition: background-color 0.3s ease-out, box-shadow 0.3s ease-out;
}

/* 导航链接悬停动画 */
.nav-link::after {
    transition: width 0.3s ease-out;
}

/* 汉堡菜单动画 */
.hamburger,
.hamburger::before,
.hamburger::after {
    transition: all 0.3s ease-out;
}

/* ========================================
   表单动画
   ======================================== */

/* 输入框聚焦动画 */
.form-group input,
.form-group textarea {
    transition: all 0.3s ease-out;
}

/* 表单提交按钮动画 */
.contact-form .btn-primary {
    animation: buttonReady 2s ease-in-out infinite;
}

@keyframes buttonReady {
    0%, 100% {
        box-shadow: 0 4px 6px rgba(59, 130, 246, 0.3);
    }
    50% {
        box-shadow: 0 6px 12px rgba(59, 130, 246, 0.4);
    }
}

/* ========================================
   返回顶部按钮动画
   ======================================== */

.back-to-top {
    transition: all 0.3s ease-out;
}

.back-to-top:hover {
    animation: bounceUp 0.5s ease-out;
}

@keyframes bounceUp {
    0%, 100% {
        transform: translateY(-4px);
    }
    50% {
        transform: translateY(-8px);
    }
}

/* ========================================
   滚动指示器动画
   ======================================== */

.scroll-icon::before {
    animation: scrollBounce 2s ease-in-out infinite;
}

/* ========================================
   粒子背景动画
   ======================================== */

.hero-particles {
    animation: particleFloat 20s linear infinite;
}

@keyframes particleFloat {
    0%, 100% {
        transform: translateY(0) translateX(0);
    }
    25% {
        transform: translateY(-15px) translateX(5px);
    }
    50% {
        transform: translateY(-20px) translateX(10px);
    }
    75% {
        transform: translateY(-15px) translateX(5px);
    }
}

/* ========================================
   图标动画
   ======================================== */

/* 服务图标旋转动画 */
.service-icon {
    transition: transform 0.3s ease-out;
}

.service-card:hover .service-icon {
    transform: rotate(5deg) scale(1.05);
}

/* 优势图标动画 */
.advantage-icon {
    animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* ========================================
   页脚动画
   ======================================== */

/* 页脚链接悬停动画 */
.footer-links a {
    transition: color 0.3s ease-out, transform 0.3s ease-out;
}

.footer-links a:hover {
    transform: translateX(5px);
}

/* ========================================
   加载状态动画
   ======================================== */

/* 加载骨架屏动画 */
.skeleton {
    background: linear-gradient(90deg, var(--color-gray-200) 25%, var(--color-gray-300) 50%, var(--color-gray-200) 75%);
    background-size: 200% 100%;
    animation: skeletonLoading 1.5s ease-in-out infinite;
}

@keyframes skeletonLoading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ========================================
   成功/错误提示动画
   ======================================== */

/* 成功提示动画 */
.success-message {
    animation: successSlideIn 0.3s ease-out;
}

@keyframes successSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 错误提示动画 */
.error-message {
    animation: errorShake 0.3s ease-out;
}

@keyframes errorShake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

/* ========================================
   响应式动画调整
   ======================================== */

@media screen and (max-width: 767px) {
    /* 移动端减少动画复杂度 */
    .hero-title,
    .hero-subtitle,
    .hero-description,
    .hero-actions {
        animation-duration: 0.5s;
    }

    .hero-particles {
        animation: none;
    }

    .advantage-icon {
        animation: none;
    }

    /* 简化按钮动画 */
    .btn-primary::before {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    /* 减少动画模式 */
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .hero-particles,
    .scroll-icon::before,
    .advantage-icon {
        animation: none;
    }
}