/* ==========================================================================
   移动端独立导航（mnav）- 仅在 ≤768px 生效
   与桌面端 .header + .nav 完全解耦，独立 DOM / CSS / JS
   主色 #0ABAB5 | 浅色系 | 抽屉式 | 触控友好
   ========================================================================== */

.mnav { display: none; }

@media (max-width: 768px) {
    /* 彻底隐藏桌面端导航（由独立 .mnav 接管） */
    html body > .header,
    html body .header,
    html body header.header,
    html body .nav,
    html body nav.nav,
    html body .nav.active,
    html body .mobile-menu-btn,
    html body > #nav-container,
    html body #nav-container {
        display: none !important;
    }

    .mnav {
        display: block;
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    }

    /* ---------- 顶栏 ---------- */
    .mnav-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 56px;
        background: #ffffff;
        box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 16px;
        z-index: 9001;
    }
    .mnav-logo {
        display: inline-flex;
        align-items: center;
        text-decoration: none;
    }
    .mnav-logo img {
        height: 32px;
        width: auto;
        display: block;
    }
    /* 占位防止首屏被遮 */
    body { padding-top: 56px !important; }

    /* ---------- 汉堡按钮 ---------- */
    .mnav-toggle {
        width: 40px;
        height: 40px;
        border: none;
        background: rgba(10, 186, 181, 0.10);
        border-radius: 10px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        cursor: pointer;
        padding: 0;
        transition: background 0.2s ease;
    }
    .mnav-toggle:active { background: rgba(10, 186, 181, 0.18); }
    .mnav-toggle span {
        display: block;
        width: 18px;
        height: 2px;
        background: #0ABAB5;
        border-radius: 1px;
        transition: transform 0.28s ease, opacity 0.2s ease;
    }
    .mnav-toggle[aria-expanded="true"] {
        background: #0ABAB5;
    }
    .mnav-toggle[aria-expanded="true"] span { background: #ffffff; }
    .mnav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
    .mnav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
    .mnav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

    /* ---------- 遮罩 ---------- */
    .mnav-backdrop {
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(15, 23, 42, 0.45);
        opacity: 0;
        visibility: hidden;
        z-index: 9002;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }
    .mnav-backdrop.show {
        opacity: 1;
        visibility: visible;
    }

    /* ---------- 抽屉 ---------- */
    .mnav-drawer {
        position: fixed;
        top: 0;
        right: -110%;
        width: 86%;
        max-width: 360px;
        height: 100vh;
        background: #ffffff;
        z-index: 9003;
        display: flex;
        flex-direction: column;
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -8px 0 28px rgba(15, 23, 42, 0.10);
        overflow: hidden;
    }
    .mnav-drawer.open { right: 0; }

    .mnav-drawer-head {
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 14px 18px;
        border-bottom: 1px solid #eef2f6;
        background: linear-gradient(135deg, #f0fdfa 0%, #ffffff 100%);
    }
    .mnav-brand {
        display: flex;
        align-items: center;
        gap: 10px;
        color: #0f172a;
        font-weight: 700;
        font-size: 15px;
    }
    .mnav-brand img { height: 28px; width: auto; display: block; }
    .mnav-close {
        width: 34px;
        height: 34px;
        border: none;
        background: transparent;
        color: #64748b;
        font-size: 26px;
        line-height: 1;
        cursor: pointer;
        border-radius: 8px;
        transition: background 0.2s ease, color 0.2s ease;
        padding: 0;
    }
    .mnav-close:active {
        background: rgba(10, 186, 181, 0.10);
        color: #0ABAB5;
    }

    /* ---------- 主 CTA 平台采购 ---------- */
    .mnav-cta-primary {
        flex-shrink: 0;
        margin: 14px 16px 4px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        padding: 14px 18px;
        background: linear-gradient(135deg, #10b981 0%, #059669 100%);
        color: #ffffff !important;
        font-size: 15px;
        font-weight: 700;
        border-radius: 12px;
        text-decoration: none;
        box-shadow: 0 6px 18px rgba(16, 185, 129, 0.3);
    }
    .mnav-cta-primary i { font-size: 16px; }

    /* ---------- 菜单列表 ---------- */
    .mnav-list {
        flex: 1;
        overflow-y: auto;
        padding: 8px 8px 4px;
        -webkit-overflow-scrolling: touch;
    }

    /* 单项链接 */
    .mnav-item {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 13px 14px;
        color: #1e293b;
        text-decoration: none;
        font-size: 15px;
        font-weight: 600;
        border-radius: 10px;
        transition: background 0.2s ease, color 0.2s ease;
    }
    .mnav-item > i {
        color: #0ABAB5;
        font-size: 15px;
        width: 20px;
        text-align: center;
        flex-shrink: 0;
    }
    .mnav-item:active,
    .mnav-item:hover {
        background: rgba(10, 186, 181, 0.08);
        color: #0ABAB5;
    }

    /* 可折叠组 */
    .mnav-group { margin: 2px 0; }
    .mnav-group-head {
        width: 100%;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 13px 14px;
        background: transparent;
        border: none;
        color: #1e293b;
        font-size: 15px;
        font-weight: 600;
        text-align: left;
        cursor: pointer;
        border-radius: 10px;
        transition: background 0.2s ease, color 0.2s ease;
    }
    .mnav-group-head > i:first-child {
        color: #0ABAB5;
        width: 20px;
        text-align: center;
        flex-shrink: 0;
        font-size: 15px;
    }
    .mnav-group-head > span { flex: 1; }
    .mnav-group-head:active,
    .mnav-group-head:hover,
    .mnav-group-head[aria-expanded="true"] {
        background: rgba(10, 186, 181, 0.08);
        color: #0ABAB5;
    }
    .mnav-arrow {
        color: #94a3b8;
        font-size: 12px;
        transition: transform 0.25s ease, color 0.2s ease;
    }
    .mnav-group-head[aria-expanded="true"] .mnav-arrow {
        transform: rotate(180deg);
        color: #0ABAB5;
    }

    .mnav-group-body {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s ease;
        padding: 0 4px;
    }
    .mnav-group.open .mnav-group-body { max-height: 1600px; }

    .mnav-sub-title {
        font-size: 11px;
        font-weight: 700;
        color: #0ABAB5;
        text-transform: uppercase;
        letter-spacing: 0.8px;
        padding: 2px 0 2px 10px;
        margin: 10px 10px 4px;
        border-left: 3px solid #0ABAB5;
        line-height: 1.4;
    }
    .mnav-group-body a {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 14px 10px 24px;
        color: #334155;
        text-decoration: none;
        font-size: 14px;
        font-weight: 500;
        border-radius: 8px;
        margin: 0 4px;
        transition: background 0.2s ease, color 0.2s ease;
        line-height: 1.3;
    }
    .mnav-group-body a > i {
        color: #0ABAB5;
        width: 16px;
        font-size: 12px;
        text-align: center;
        flex-shrink: 0;
    }
    .mnav-group-body a:active,
    .mnav-group-body a:hover {
        background: rgba(10, 186, 181, 0.08);
        color: #0ABAB5;
    }
    .mnav-group-body a.mnav-featured {
        background: rgba(16, 185, 129, 0.08);
        color: #059669;
        font-weight: 600;
    }
    .mnav-group-body a.mnav-featured > i { color: #059669; }

    /* ---------- 底部咨询 CTA ---------- */
    .mnav-cta-contact {
        flex-shrink: 0;
        margin: 8px 16px 18px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 14px 18px;
        background: #0ABAB5;
        color: #ffffff !important;
        font-size: 15px;
        font-weight: 700;
        border-radius: 12px;
        text-decoration: none;
        box-shadow: 0 6px 18px rgba(10, 186, 181, 0.35);
    }

    /* ---------- body 滚动锁 ---------- */
    body.mnav-open { overflow: hidden; }
}

@media (max-width: 400px) {
    .mnav-header { height: 52px; padding: 0 12px; }
    body { padding-top: 52px !important; }
    .mnav-logo img { height: 28px; }
    .mnav-toggle { width: 38px; height: 38px; }
}

/* ==========================================================================
   P0 全站移动端内容区兜底（≤768px）
   修复 inline style 写死多列 grid / 大字号 / 超宽元素
   ========================================================================== */
@media (max-width: 768px) {
    /* 1) inline 写死 repeat(2/3/4/5/6, ..) 强制降级为单列 */
    [style*="grid-template-columns: repeat(2,"],
    [style*="grid-template-columns: repeat(3,"],
    [style*="grid-template-columns: repeat(4,"],
    [style*="grid-template-columns: repeat(5,"],
    [style*="grid-template-columns: repeat(6,"],
    [style*="grid-template-columns:repeat(2,"],
    [style*="grid-template-columns:repeat(3,"],
    [style*="grid-template-columns:repeat(4,"] {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }

    /* 2) inline 极大字号降级（banner/数字徽章类） */
    [style*="font-size: 60px"],
    [style*="font-size: 56px"],
    [style*="font-size: 54px"],
    [style*="font-size: 52px"],
    [style*="font-size: 48px"] {
        font-size: 32px !important;
    }
    [style*="font-size: 42px"],
    [style*="font-size: 40px"],
    [style*="font-size: 38px"],
    [style*="font-size: 36px"] {
        font-size: 26px !important;
    }

    /* 3) 禁止媒体元素 / 表格 溢出视口 */
    img, video, iframe, embed, object {
        max-width: 100% !important;
        height: auto;
    }
    table {
        max-width: 100% !important;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* 4) 大 padding / 固定 width 内联样式降级 */
    [style*="padding: 80px"],
    [style*="padding: 100px"] {
        padding: 40px 16px !important;
    }
    [style*="padding: 60px 40px"],
    [style*="padding: 50px 40px"] {
        padding: 30px 16px !important;
    }

    /* 5) flex 多列横向排列降级为纵向堆叠 */
    [style*="display: flex"][style*="gap: 30px"],
    [style*="display: flex"][style*="gap: 40px"],
    [style*="display: flex"][style*="gap: 50px"] {
        flex-wrap: wrap !important;
        gap: 16px !important;
    }

    /* 6) 全局横向溢出防护（根容器） */
    html, body {
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }

    /* 7) 通用容器 padding 收紧 */
    .container, .section .container {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }
    .section {
        padding-top: 40px !important;
        padding-bottom: 40px !important;
    }
}
