/* 基础动画定义 */
@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 slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 动画类 */
.animate-on-scroll {
    opacity: 0;
}

.animate-on-scroll.animated {
    animation-duration: 0.8s;
    animation-fill-mode: both;
    animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* 不同的动画效果 */
.slide-in-left.animated {
    animation-name: slideInLeft;
}

.slide-in-right.animated {
    animation-name: slideInRight;
}

.slide-in-up.animated {
    animation-name: slideInUp;
}

.fade-in.animated {
    animation-name: fadeIn;
}

.scale-in.animated {
    animation-name: scaleIn;
}

/* 延迟动画 */
.delay-100 {
    animation-delay: 0.1s;
}

.delay-200 {
    animation-delay: 0.2s;
}

.delay-300 {
    animation-delay: 0.3s;
}

.delay-400 {
    animation-delay: 0.4s;
}

.delay-500 {
    animation-delay: 0.5s;
}

.delay-600 {
    animation-delay: 0.6s;
}

/* 特殊效果：数字计数器 */
.counter {
    font-variant-numeric: tabular-nums;
}

/* Hero区域特殊动画 */
.loan-hero-text h1 {
    animation: slideInLeft 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.2s both;
}

.loan-hero-text .hero-subtitle {
    animation: slideInLeft 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.4s both;
}

.loan-hero-text .feature-list {
    animation: slideInLeft 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.6s both;
}

.loan-hero-image {
    animation: slideInRight 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.4s both;
}

/* 卡片悬停效果 */
.feature-card,
.app-feature-item,
.detail-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-card:hover,
.app-feature-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.detail-item:hover {
    transform: scale(1.05);
}

/* 步骤项目动画 */
.step-item {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.step-item:hover {
    transform: scale(1.08);
}

.step-number {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.step-item:hover .step-number {
    transform: rotate(360deg);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* 按钮悬停效果增强 */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* 连接线动画 */
.step-connector {
    position: relative;
    overflow: hidden;
}

.step-connector::after {
    content: '';
    position: absolute;
    top: 50%;
    left: -100%;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, #667eea, transparent);
    animation: slideConnector 3s ease-in-out infinite;
}

@keyframes slideConnector {
    0% {
        left: -100%;
    }
    100% {
        left: 200%;
    }
}

/* 图标旋转效果 */
.feature-icon img,
.app-feature-icon img {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-card:hover .feature-icon img,
.app-feature-item:hover .app-feature-icon img {
    transform: scale(1.1) rotate(5deg);
}

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