/* CDN动画区域样式 */
#cdn-animation-section {
    background-color: transparent; /* 改为透明背景 */
    position: relative;
    overflow: hidden;
}

#cdn-animation-section.py-5 {
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
}

#cdn-animation-section .container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

#cdn-animation-section .container.text-center {
    text-align: center;
}

/* CDN动画容器 */
.cdn-animation-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    position: relative;
    height: 200px; /* 您可以根据需要调整高度 */
}

/* CDN图标包装器 */
.cdn-icon-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10;
    width: 120px; /* 给一个固定宽度防止文字换行影响布局 */
    text-align: center;
    position: relative; /* 为绝对定位的悬停文本提供容器 */
    cursor: pointer;
}

.cdn-icon-wrapper img {
    height: 80px; /* 您可以根据需要调整图标大小 */
    transition: transform 0.3s ease; /* 为放大效果添加平滑过渡 */
}

.cdn-icon-wrapper:hover img {
    transform: scale(1.1); /* 鼠标悬停时放大图标 */
}

/* 图标悬停文本 */
.icon-hover-text {
    position: absolute;
    bottom: -50px; /* 定位在图标下方，留出一些间距 */
    left: 50%;
    transform: translateX(-50%);
    background-color: #1e293b; /* 深色背景 */
    color: #e2e8f0; /* 亮色文字 */
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.875rem;
    white-space: nowrap; /* 确保文字在一行显示 */
    opacity: 0; /* 默认隐藏 */
    visibility: hidden; /* 默认不可见 */
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 20;
    pointer-events: none; /* 防止悬停文本干扰鼠标事件 */
}

.cdn-icon-wrapper:hover .icon-hover-text {
    opacity: 1; /* 悬停时显示 */
    visibility: visible;
    transform: translateX(-50%) translateY(5px); /* 轻微向上移动 */
}

/* 粒子画布 */
#particle-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
}

/* 源服务器图标脉冲动画 */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

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

/* 图标ID特定的样式 */
#network-icon,
#cdn-shield-icon,
#server-icon {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* 响应式设计 */
@media (max-width: 768px) {
    .cdn-animation-container {
        flex-direction: column;
        height: auto;
        gap: 40px;
        padding: 20px 0;
    }
    
    .cdn-icon-wrapper {
        width: 100px;
    }
    
    .cdn-icon-wrapper img {
        height: 60px;
    }
    
    #particle-canvas {
        display: none; /* 在移动设备上隐藏粒子效果 */
    }
}

@media (max-width: 480px) {
    #cdn-animation-section.py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    
    .cdn-icon-wrapper {
        width: 80px;
    }
    
    .cdn-icon-wrapper img {
        height: 50px;
    }
    
    .icon-hover-text {
        font-size: 0.75rem;
        padding: 4px 8px;
    }
}