/**
 * IE11 兼容性降级样式
 * 针对 IE11 不支持的 CSS 特性提供降级方案
 */

/* ---------- IE11 专用选择器 ---------- */
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
    
    /* 容器降级 */
    .container {
        width: 1200px !important;
        max-width: 100% !important;
        padding: 0 20px;
    }
    
    @media (max-width: 1520px) {
        .container { width: 1200px !important; }
    }
    @media (max-width: 1200px) {
        .container { width: 1100px !important; }
    }
    @media (max-width: 1024px) {
        .container { width: 100% !important; padding: 0 20px; }
    }
    
    /* Flexbox 降级（IE11 支持 Flexbox，但有些问题） */
    .products-grid,
    .suppliers-grid,
    .news-grid,
    .stats-grid,
    .footer-grid {
        display: -ms-flexbox !important;
        display: flex !important;
        -ms-flex-wrap: wrap !important;
        flex-wrap: wrap !important;
    }
    
    /* 产品网格 - 4列 */
    .products-grid > * {
        -ms-flex: 0 0 25% !important;
        flex: 0 0 25% !important;
        max-width: 25% !important;
        padding: 0 12px;
        box-sizing: border-box;
    }
    
    @media (max-width: 1520px) {
        .products-grid > * {
            -ms-flex: 0 0 33.333% !important;
            flex: 0 0 33.333% !important;
            max-width: 33.333% !important;
        }
    }
    
    @media (max-width: 1024px) {
        .products-grid > * {
            -ms-flex: 0 0 50% !important;
            flex: 0 0 50% !important;
            max-width: 50% !important;
        }
    }
    
    @media (max-width: 480px) {
        .products-grid > * {
            -ms-flex: 0 0 100% !important;
            flex: 0 0 100% !important;
            max-width: 100% !important;
        }
    }
    
    /* 供应商网格 - 3列 */
    .suppliers-grid > * {
        -ms-flex: 0 0 33.333% !important;
        flex: 0 0 33.333% !important;
        max-width: 33.333% !important;
    }
    
    @media (max-width: 1024px) {
        .suppliers-grid > * {
            -ms-flex: 0 0 50% !important;
            flex: 0 0 50% !important;
            max-width: 50% !important;
        }
    }
    
    @media (max-width: 480px) {
        .suppliers-grid > * {
            -ms-flex: 0 0 100% !important;
            flex: 0 0 100% !important;
            max-width: 100% !important;
        }
    }
    
    /* 新闻网格 - 3列 */
    .news-grid > * {
        -ms-flex: 0 0 33.333% !important;
        flex: 0 0 33.333% !important;
        max-width: 33.333% !important;
    }
    
    @media (max-width: 1024px) {
        .news-grid > * {
            -ms-flex: 0 0 50% !important;
            flex: 0 0 50% !important;
            max-width: 50% !important;
        }
    }
    
    @media (max-width: 480px) {
        .news-grid > * {
            -ms-flex: 0 0 100% !important;
            flex: 0 0 100% !important;
            max-width: 100% !important;
        }
    }
    
    /* 统计网格 - 4列 */
    .stats-grid > * {
        -ms-flex: 0 0 25% !important;
        flex: 0 0 25% !important;
        max-width: 25% !important;
    }
    
    @media (max-width: 1024px) {
        .stats-grid > * {
            -ms-flex: 0 0 50% !important;
            flex: 0 0 50% !important;
            max-width: 50% !important;
        }
    }
    
    /* 页脚网格 - 4列 */
    .footer-grid > * {
        -ms-flex: 0 0 25% !important;
        flex: 0 0 25% !important;
        max-width: 25% !important;
    }
    
    @media (max-width: 1024px) {
        .footer-grid > * {
            -ms-flex: 0 0 50% !important;
            flex: 0 0 50% !important;
            max-width: 50% !important;
        }
    }
    
    @media (max-width: 480px) {
        .footer-grid > * {
            -ms-flex: 0 0 100% !important;
            flex: 0 0 100% !important;
            max-width: 100% !important;
        }
    }
    
    /* Hero 区域 */
    .hero-section,
    .hero-section-v3 {
        display: -ms-flexbox !important;
        display: flex !important;
        -ms-flex-direction: column !important;
        flex-direction: column !important;
        -ms-flex-pack: center !important;
        justify-content: center !important;
    }
    
    .hero-content,
    .hero-content-v3 {
        -ms-flex: 1 1 auto !important;
        flex: 1 1 auto !important;
    }
    
    .hero-stats,
    .hero-stats-v3 {
        display: -ms-flexbox !important;
        display: flex !important;
        -ms-flex-pack: center !important;
        justify-content: center !important;
    }
    
    .hero-actions,
    .hero-actions-v3 {
        display: -ms-flexbox !important;
        display: flex !important;
        -ms-flex-pack: center !important;
        justify-content: center !important;
    }
    
    /* 表单行 */
    .form-row {
        display: -ms-flexbox !important;
        display: flex !important;
        -ms-flex-wrap: wrap !important;
        flex-wrap: wrap !important;
    }
    
    .form-row > * {
        -ms-flex: 0 0 50% !important;
        flex: 0 0 50% !important;
        max-width: 50% !important;
        padding: 0 8px;
        box-sizing: border-box;
    }
    
    @media (max-width: 480px) {
        .form-row > * {
            -ms-flex: 0 0 100% !important;
            flex: 0 0 100% !important;
            max-width: 100% !important;
        }
    }
    
    /* 产品详情页 */
    .product-detail-grid {
        display: -ms-flexbox !important;
        display: flex !important;
        -ms-flex-wrap: wrap !important;
        flex-wrap: wrap !important;
    }
    
    .product-gallery {
        -ms-flex: 0 0 50% !important;
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }
    
    .product-info {
        -ms-flex: 0 0 50% !important;
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }
    
    @media (max-width: 1024px) {
        .product-gallery,
        .product-info {
            -ms-flex: 0 0 100% !important;
            flex: 0 0 100% !important;
            max-width: 100% !important;
        }
    }
    
    /* 联系页面 */
    .contact-grid {
        display: -ms-flexbox !important;
        display: flex !important;
        -ms-flex-wrap: wrap !important;
        flex-wrap: wrap !important;
    }
    
    .contact-info {
        -ms-flex: 0 0 33.333% !important;
        flex: 0 0 33.333% !important;
        max-width: 33.333% !important;
    }
    
    .contact-form-wrap {
        -ms-flex: 0 0 66.666% !important;
        flex: 0 0 66.666% !important;
        max-width: 66.666% !important;
    }
    
    @media (max-width: 1024px) {
        .contact-info,
        .contact-form-wrap {
            -ms-flex: 0 0 100% !important;
            flex: 0 0 100% !important;
            max-width: 100% !important;
        }
    }
    
    /* 归档页面 */
    .archive-layout {
        display: -ms-flexbox !important;
        display: flex !important;
        -ms-flex-wrap: wrap !important;
        flex-wrap: wrap !important;
    }
    
    .archive-sidebar {
        -ms-flex: 0 0 25% !important;
        flex: 0 0 25% !important;
        max-width: 25% !important;
    }
    
    .archive-content {
        -ms-flex: 0 0 75% !important;
        flex: 0 0 75% !important;
        max-width: 75% !important;
    }
    
    @media (max-width: 1024px) {
        .archive-sidebar,
        .archive-content {
            -ms-flex: 0 0 100% !important;
            flex: 0 0 100% !important;
            max-width: 100% !important;
        }
    }
    
    /* object-fit 降级 */
    .product-thumb img,
    .news-thumb img,
    .supplier-logo img {
        width: 100% !important;
        height: 100% !important;
    }
    
    /* CSS 变量降级（IE11 不支持） */
    body {
        font-family: "Segoe UI", Arial, sans-serif !important;
    }
    
    .site-header {
        background: #fff !important;
    }
    
    .hero-section,
    .hero-section-v3 {
        background: #1e3a5f !important;
    }
    
    .btn-primary {
        background: #2563eb !important;
        color: #fff !important;
    }
    
    .btn-outline {
        background: transparent !important;
        color: #2563eb !important;
        border: 1px solid #2563eb !important;
    }
    
    /* 隐藏动画（IE11 不支持 animation） */
    .anim-fade-up {
        opacity: 1 !important;
    }
    
    /* 粘性定位降级 */
    .site-header {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
    }
    
    body {
        padding-top: 80px !important;
    }
    
    /* 滚动平滑降级 */
    html {
        scroll-behavior: auto !important;
    }
}
