/* ========================================
   品牌Logo阵列 - Bootstrap优化版本
   使用Bootstrap工具类，减少自定义CSS
   ======================================== */

/* 主容器 - 使用Bootstrap容器 */
.logo-grid-section {
    background: #ffffff;
    /* Bootstrap: py-5 px-4 */
    padding: 3rem 1.5rem;
    position: relative;
    overflow: hidden;
}

/* 标题区域 - 使用Bootstrap flexbox */
.logo-grid-title {
    /* Bootstrap: d-flex justify-content-between align-items-center mb-4 */
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.logo-grid-title h2 {
    /* Bootstrap: fs-2 fw-bold text-dark mb-0 */
    font-size: 1.5rem;
    font-weight: 700;
    color: #212529;
    margin: 0;
}

.logo-grid-title .more-link {
    /* Bootstrap: text-muted text-decoration-none */
    color: #6c757d;
    text-decoration: none;
}

/* 网格包装器 - 使用Bootstrap高度工具 */
.logo-grid-wrapper {
    position: relative;
    overflow: hidden;
    /* Bootstrap: 使用固定高度类 */
    height: 232px; /* 2行 * 112px + 8px间距 (0.5rem * 2) */
}

/* 网格容器 - 使用Bootstrap网格系统 */
.logo-grid {
    /* Bootstrap: d-flex flex-wrap gap-2 (减少间距) */
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem; /* 减少间距：从1rem改为0.5rem */
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Logo项目 - 使用Bootstrap尺寸和交互类 */
.logo-item {
    /* Bootstrap: d-flex align-items-center justify-content-center */
    width: 112px;
    height: 112px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    /* 桌面端删除边框和圆角 */
    border: none;
    border-radius: 0;
}

.logo-item:hover {
    /* 改为图标微微放大效果 */
    transform: scale(1.05);
}

.logo-item:active {
    transform: scale(1.02);
}

.logo-item img {
    /* Bootstrap: img-fluid */
    max-width: 80%;
    max-height: 80%;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
    transition: all 0.3s ease;
    display: block;
    margin: 0 auto;
    /* SVG特定样式 */
    fill: currentColor;
    stroke: none;
}

.logo-item:hover img {
    /* 图标微微放大效果 */
    transform: scale(1.1);
}

/* 渐变遮罩 - 移动端底部隐藏 */
.logo-grid-mask {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to bottom, transparent, #ffffff);
    pointer-events: none;
    z-index: 10;
    display: none;
}

.logo-grid-mask .mask-more-link {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    color: #6c757d;
    text-decoration: none;
    font-size: 1rem;
    pointer-events: auto;
    z-index: 11;
}

/* 响应式设计 - 使用Bootstrap断点 */
@media (max-width: 768px) {
    .logo-grid-section {
        /* Bootstrap: py-4 px-3 */
        padding: 2rem 1rem;
    }
    
    .logo-grid-title h2 {
        /* Bootstrap: fs-4 */
        font-size: 1.25rem;
    }
    
    .logo-grid-wrapper {
        height: 252px; /* 3行 * 80px + 12px间距 (0.25rem * 2) */
    }
    
    .logo-grid {
        /* 移动端网格 - 一行四个，覆盖桌面端的flex布局 */
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 0.25rem; /* 减少间距：从0.5rem改为0.25rem */
        padding: 0 0.625rem;
    }
    
    .logo-item {
        width: 100% !important;
        height: 80px;
        /* 移动端添加边框 */
        border: 1px solid #dee2e6;
        border-radius: 0; /* 不要圆角 */
        aspect-ratio: 1;
    }
    
    .logo-grid-title .more-link {
        display: none;
    }
    
    .logo-grid-mask {
        display: block;
    }
}

@media (max-width: 480px) {
    .logo-grid-section {
        /* Bootstrap: py-3 px-2 */
        padding: 1.5rem 0.5rem;
    }
    
    .logo-grid-title h2 {
        /* Bootstrap: fs-5 */
        font-size: 1.1rem;
    }
    
    .logo-grid {
        /* 确保小屏幕也是一行四个 */
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 0.125rem; /* 减少间距：从0.375rem改为0.125rem */
        padding: 0 0.3125rem;
    }
    
    .logo-item {
        width: 100% !important;
        height: 70px;
        /* 小屏幕也添加边框 */
        border: 1px solid #dee2e6;
        border-radius: 0; /* 不要圆角 */
    }
    
    .logo-grid-wrapper {
        height: 210px; /* 3行 * 70px + 6px间距 (0.125rem * 2) */
    }
}

/* 导航栏同步状态 */
.logo-grid-section.nav-scrolled {
    margin-top: 0;
}

/* 加载动画 - 使用Bootstrap动画 */
.logo-item.loading {
    background: linear-gradient(90deg, #f8f9fa 25%, #e9ecef 50%, #f8f9fa 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

.logo-item.loaded {
    background: transparent;
}

.logo-item.error {
    background: #f8f9fa;
    border: 1px dashed #dee2e6;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
