/*
 * nav.css - 边缘云导航页面专用样式
 * 包含瀑布流布局、产品分类卡片、国家列表等样式
 */

/* 导航页面专用样式 */
.nav-hero {
    background: var(--primary-gradient);
    color: white;
    padding: 4rem 0 3rem 0;
    position: relative;
    overflow: hidden;
}

.nav-hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width=\"60\" height=\"60\" viewBox=\"0 0 60 60\" xmlns=\"http://www.w3.org/2000/svg\"%3E%3Cg fill=\"none\" fill-rule=\"evenodd\"%3E%3Cg fill=\"%23ffffff\" fill-opacity=\"0.05\"%3E%3Ccircle cx=\"30\" cy=\"30\" r=\"4\"/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* 瀑布流容器 */
.masonry-container {
    column-count: 2;
    column-gap: 2rem;
    column-fill: balance;
}

@media (max-width: 768px) {
    .masonry-container {
        column-count: 1;
        column-gap: 1rem;
    }
}

@media (min-width: 1200px) {
    .masonry-container {
        column-count: 3;
    }
}

.product-category {
    background: white;
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    padding: 2rem;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(22, 119, 255, 0.1);
    break-inside: avoid;
    page-break-inside: avoid;
    display: inline-block;
    width: 100%;
}

.product-category:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
}

.category-title {
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.category-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.country-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.country-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s ease;
    border: 1px solid transparent;
    position: relative;
}

.country-item:hover {
    background: var(--primary-color);
    color: white;
    transform: translateX(5px);
    border-color: var(--primary-color);
}

.country-item-left {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.product-count {
    color: var(--light-text);
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

.country-item:hover .product-count {
    color: rgba(255, 255, 255, 0.8);
}

.country-flag {
    width: 24px;
    height: 18px;
    border-radius: 4px;
    margin-right: 0.75rem;
    object-fit: cover;
    border: 1px solid rgba(0,0,0,0.1);
}

.gpu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.gpu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.gpu-item:hover {
    background: var(--primary-color);
    color: white;
    transform: translateX(5px);
    border-color: var(--primary-color);
}

.gpu-count {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.gpu-item:hover .gpu-count {
    background: white;
    color: var(--primary-color);
}

.section-subtitle {
    color: var(--light-text);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

@media (max-width: 768px) {
    .country-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.5rem;
    }
    
    .gpu-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .product-category {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .category-title {
        font-size: 1.3rem;
    }
}

/* 瀑布流优化 */
@media (min-width: 769px) and (max-width: 1199px) {
    .masonry-container {
        column-count: 2;
        column-gap: 1.5rem;
    }
}

/* 确保瀑布流项目不被分割 */
.product-category * {
    break-inside: avoid;
}

/* 优化瀑布流间距 */
.masonry-container .product-category:first-child {
    margin-top: 0;
}
