/**
 * CloudCDN动画和交互效果样式
 * 为网站添加更丰富的动画和交互体验的样式
 */

/* 波纹效果 */
.btn {
    position: relative;
    overflow: hidden;
}

.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.4);
    width: 100px;
    height: 100px;
    margin-top: -50px;
    margin-left: -50px;
    animation: ripple 0.6s linear;
    transform: scale(0);
    opacity: 1;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* 滚动显示动画 */
.feature-card, .section-title, .pricing-card, .case-card, .contact-form {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.feature-card.active, .section-title.active, .pricing-card.active, .case-card.active, .contact-form.active {
    opacity: 1;
    transform: translateY(0);
}

/* 特性卡片活动状态 */
.feature-card {
    transition: all 0.3s ease;
    cursor: pointer;
}

.feature-card.feature-active {
    border-color: var(--primary-color);
    box-shadow: 0 10px 30px rgba(0, 82, 217, 0.15);
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background-color: var(--primary-hover);
    transform: translateY(-5px);
}

/* 卡片悬停效果 */
.feature-card, .pricing-card, .case-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* 视差背景效果 */
.hero, .features, .solutions {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    position: relative;
    overflow: hidden;
}

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

@keyframes slideInUp {
    from {
        transform: translateY(50px);
        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;
    }
}

/* 应用动画到元素 */
.hero-content h1 {
    animation: slideInUp 1s ease forwards;
}

.hero-content p {
    animation: slideInUp 1s 0.2s ease forwards;
    opacity: 0;
    animation-fill-mode: forwards;
}

.hero-buttons {
    animation: slideInUp 1s 0.4s ease forwards;
    opacity: 0;
    animation-fill-mode: forwards;
}

.header {
    animation: fadeIn 1s ease forwards;
}