/* ============================================================
   移动端 UI 统一改造（2026-11-28）
   设计目标：简洁 / 清晰 / 显示合理
   与预览稿一致：底部 Tab + 顶栏精简 + 单列卡片 + 触摸友好
   本文件只做覆盖，不改动 front.css 原有规则；PC 端不受影响
   ============================================================ */

/* 桌面端默认隐藏手机底部 Tab，仅在移动端媒体查询内显示 */
.mb-tabbar { display: none; }

@media (max-width: 680px) {

    /* ---------- 1. 全局：为底部 Tab 留出空间 ---------- */
    body {
        padding-bottom: calc(62px + env(safe-area-inset-bottom, 0px));
        -webkit-tap-highlight-color: transparent;
    }
    .site-main { padding-bottom: 8px; }

    /* ---------- 2. 底部 Tab 导航 ---------- */
    .mb-tabbar {
        position: fixed;
        left: 0; right: 0; bottom: 0;
        height: calc(60px + env(safe-area-inset-bottom, 0px));
        padding-bottom: env(safe-area-inset-bottom, 0px);
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        align-items: center;
        background: #fff;
        border-top: 1px solid var(--line, #dce4ef);
        box-shadow: 0 -2px 14px rgba(11,31,58,.06);
        z-index: 90;
    }
    .mb-tab {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        height: 100%;
        color: #8a99ac;
        font-size: 10px;
        text-decoration: none;
        transition: color .15s;
    }
    .mb-tab:hover { text-decoration: none; }
    .mb-tab svg { width: 22px; height: 22px; }
    .mb-tab.on { color: var(--blue, #1d4ed8); font-weight: 700; }

    /* ---------- 3. 顶栏：品牌 + 管理入口一行，链接单独一行（可横滑） ---------- */
    .site-header { position: sticky; }
    .site-nav {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        min-height: 0 !important;
        padding: 10px 0 8px !important;
        gap: 8px !important;
    }
    /* 品牌行：品牌在左，管理入口图标在右（始终可见，不受底部 Tab 遮挡） */
    .site-brand-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
    }
    .site-brand-row .site-brand { flex: 1; min-width: 0; }
    .mb-admin-link {
        flex: none;
        width: 38px; height: 38px;
        display: flex; align-items: center; justify-content: center;
        color: var(--ink-2, #263a55);
        background: #f4f7fc;
        border-radius: 10px;
        border: 1px solid var(--line, #dce4ef);
    }
    .mb-admin-link svg { width: 19px; height: 19px; }
    .mb-admin-link:active { background: #eaf0ff; color: var(--blue, #1d4ed8); }
    .site-brand-logo { height: 38px !important; }
    .site-brand-txt b { font-size: 15px !important; }
    .site-brand-txt em { font-size: 8px !important; letter-spacing: 1.2px !important; }
    /* 顶部链接：单独一行可横向滑动，不撑破容器 */
    .site-links {
        display: flex !important;
        gap: 18px !important;
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 2px;
    }
    .site-links::-webkit-scrollbar { display: none; }
    .site-links a { font-size: 13px !important; padding: 5px 0 !important; white-space: nowrap; flex: none; }
    .site-links a.site-cta, .site-links .site-cta { display: none !important; visibility: hidden !important; width: 0 !important; overflow: hidden !important; }

    /* ---------- 4. 通用：卡片、标题、按钮触摸友好 ---------- */
    .wrap { padding-left: 16px !important; padding-right: 16px !important; }
    .page-hero { padding: 30px 0 26px !important; }
    .page-hero h1 { font-size: 25px !important; line-height: 1.35 !important; }
    .page-hero .wrap { padding-left: 16px !important; padding-right: 16px !important; }
    .page-hero p { font-size: 12.5px !important; line-height: 1.75 !important; max-width: 100% !important; word-break: break-word !important; padding-right: 8px !important; }
    .page-panel { padding: 18px 16px !important; border-radius: 14px !important; }
    .hp-btn, .site-links .site-cta {
        min-height: 46px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 10px !important;
        font-size: 14px !important;
    }
    input[type="text"], input[type="tel"], input[type="email"],
    input[type="number"], input[type="date"], select, textarea {
        font-size: 16px !important;   /* 防 iOS 自动放大 */
        min-height: 44px !important;
    }
    .site-main input, .site-main select, .site-main textarea { border-radius: 9px !important; }

    /* ---------- 5. 首页（按预览稿：深蓝渐变 Hero 卡片） ---------- */
    .hp-hero { padding: 16px 0 0 !important; background: none !important; overflow: hidden !important; }
    .hp-hero-grid {
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
        gap: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    .hp-hero-copy {
        padding: 20px 18px !important;
        width: 100% !important;
        background: linear-gradient(135deg, #122b52, #1d4ed8) !important;
        border-radius: 16px !important;
        color: #fff !important;
    }
    .hp-eyebrow { font-size: 10px !important; letter-spacing: 2px !important; opacity: .8 !important; margin-bottom: 10px !important; color: #fff !important; }
    .hp-hero h1 { font-size: 25px !important; line-height: 1.35 !important; margin-bottom: 9px !important; color: #fff !important; }
    .hp-hero h1 span { color: #bcd0ff !important; }
    .hp-hero-desc {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        font-size: 12px !important; line-height: 1.7 !important;
        color: rgba(255,255,255,.88) !important;
        word-break: break-word !important;
        margin-bottom: 0 !important;
    }
    .hp-hero-actions { display: flex !important; flex-direction: row !important; gap: 8px !important; margin-top: 15px !important; width: 100% !important; max-width: 100% !important; }
    .hp-hero-actions .hp-btn {
        flex: 1 1 0 !important;
        width: auto !important;
        margin: 0 !important;
        min-width: 0 !important;
        padding: 10px 4px !important;
        box-sizing: border-box !important;
        font-size: 12.5px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        border-radius: 9px !important;
    }
    .hp-hero-actions .hp-btn-primary { background: #fff !important; color: var(--blue, #1d4ed8) !important; }
    .hp-hero-actions .hp-btn-ghost { background: rgba(255,255,255,.12) !important; color: #fff !important; border: 1px solid rgba(255,255,255,.5) !important; }
    .hp-hero-meta { display: flex !important; flex-wrap: wrap !important; gap: 6px !important; margin-top: 15px !important; }
    .hp-hero-meta span {
        font-size: 10px !important;
        background: rgba(255,255,255,.14) !important;
        border: 1px solid rgba(255,255,255,.22) !important;
        color: rgba(255,255,255,.9) !important;
        padding: 5px 9px !important;
        border-radius: 6px !important;
    }
    .hp-hero-meta b { color: #fff !important; }
    .hp-hero-copy, .hp-hero-grid > * { margin-left: 0 !important; }
    .hp-hero-copy, .hp-hero-copy * { box-sizing: border-box !important; }
    /* 三张悬浮案例卡片在手机端隐藏（预览稿 Hero 内为纯文案卡片） */
    .hp-hero-visual { display: none !important; }
    .hp-float-badge { display: none !important; }

    /* 首页常用品类（由脚本移到案例前，预览稿位置） */
    .mb-quick-cats { padding: 4px 0 24px !important; }
    .mb-quick-cats-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px !important; }
    .mb-quick-cats-h h3 { font-size: 16px !important; font-weight: 800 !important; }
    .mb-quick-cats .hp-cats {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 8px !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    /* 移到浅色区后改为白底深字（原样式是深蓝带上的白字） */
    .mb-quick-cats .hp-cat {
        background: #fff !important;
        border: 1px solid var(--line, #dce4ef) !important;
        color: var(--ink, #0b1f3a) !important;
        padding: 12px 4px !important;
        border-radius: 12px !important;
        min-height: 84px !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
    }
    .mb-quick-cats .hp-cat svg { stroke: var(--blue, #1d4ed8) !important; width: 22px !important; height: 22px !important; margin-bottom: 6px !important; }
    .mb-quick-cats .hp-cat b { font-size: 12px !important; color: var(--ink, #0b1f3a) !important; }
    .mb-quick-cats .hp-cat span { display: none !important; }

    .hp-cases { padding: 26px 0 !important; }
    .hp-section-head { flex-direction: column; align-items: flex-start !important; gap: 10px !important; }
    .hp-section-head h2 { font-size: 21px !important; }
    .hp-case-grid { grid-template-columns: 1fr !important; gap: 12px !important; }
    .hp-case-card {
        display: flex !important;
        align-items: center;
        gap: 12px;
        padding: 10px !important;
        border-radius: 13px !important;
    }
    .hp-case-thumb { width: 84px !important; height: 72px !important; flex: none !important; border-radius: 9px !important; }
    .hp-case-body { padding: 0 !important; min-width: 0; }
    .hp-case-body h3 { font-size: 14px !important; margin-bottom: 4px !important; }
    .hp-case-body p { font-size: 11px !important; color: var(--muted, #5f6f85) !important; }
    .hp-case-tags { margin-bottom: 4px !important; }
    .hp-case-filter { flex-wrap: wrap !important; gap: 6px !important; }
    .hp-case-filter a { font-size: 11.5px !important; padding: 6px 10px !important; border-radius: 16px !important; }

    /* 常用品类九宫格 */
    .hp-cats { grid-template-columns: repeat(4, 1fr) !important; gap: 8px !important; }
    .hp-cat {
        flex-direction: column !important;
        padding: 12px 4px !important;
        border-radius: 12px !important;
        text-align: center !important;
        min-height: 88px;
        justify-content: center !important;
    }
    .hp-cat svg { width: 22px !important; height: 22px !important; margin: 0 0 6px !important; }
    .hp-cat b { font-size: 12px !important; }
    .hp-cat span { font-size: 9px !important; line-height: 1.4 !important; display: none !important; }

    /* 公司动态列表 */
    .hp-news-list a { padding: 12px 0 !important; }
    .hp-news-list b { font-size: 13.5px !important; }
    .hp-news-list em { font-size: 11px !important; }

    /* 公司介绍块 */
    .hp-company { padding: 26px 0 !important; }
    .hp-company-card { padding: 18px 16px !important; border-radius: 14px !important; }
    .hp-company-main h3 { font-size: 17px !important; }
    .hp-company-main > p { font-size: 12.5px !important; }
    .hp-points li { font-size: 12px !important; }
    .hp-company-fact { padding: 10px !important; }
    .hp-company-fact b { font-size: 12.5px !important; }
    .hp-company-fact span { font-size: 11px !important; }

    /* 下单引导带 */
    .hp-order-grid { padding: 30px 0 !important; }
    .hp-order-copy h2 { font-size: 24px !important; }
    .hp-order-copy > p { font-size: 12.5px !important; }

    /* ---------- 6. 公司介绍页 ---------- */
    .page-tabs { gap: 8px !important; margin-bottom: 16px !important; }
    .page-tabs a { padding: 10px 14px !important; border-radius: 18px !important; font-size: 12.5px !important; }
    .about-intro { padding: 20px 16px !important; }
    .about-lead { font-size: 13px !important; line-height: 1.8 !important; }
    .hp-points.big li { font-size: 12.5px !important; }
    .qual-grid, .equip-grid, .cert-strip { grid-template-columns: 1fr !important; gap: 10px !important; }
    .qual-card, .equip-card, .cert-card { padding: 14px !important; border-radius: 12px !important; }
    .about-side-card { padding: 16px !important; border-radius: 13px !important; }

    /* ---------- 7. 案例列表页 ---------- */
    .case-filter-bar { flex-wrap: wrap !important; gap: 7px !important; margin-bottom: 16px !important; }
    .case-filter-bar a { font-size: 11.5px !important; padding: 7px 12px !important; border-radius: 16px !important; }
    .case-list-grid { grid-template-columns: 1fr !important; gap: 12px !important; }
    .case-list-card {
        display: flex !important;
        align-items: center;
        gap: 12px;
        padding: 10px !important;
        border-radius: 13px !important;
    }
    .case-list-thumb { width: 84px !important; height: 72px !important; flex: none !important; border-radius: 9px !important; }
    .case-list-body { padding: 0 !important; min-width: 0; }
    .case-list-body h3 { font-size: 14px !important; margin-bottom: 4px !important; }
    .case-list-body p { font-size: 11px !important; }

    /* 案例详情 */
    .case-detail-hero { padding: 26px 0 !important; }
    .case-detail-hero h1 { font-size: 24px !important; }
    .case-detail-meta { flex-wrap: wrap !important; gap: 8px !important; font-size: 11px !important; }
    .case-detail-cover img { border-radius: 12px !important; }
    .case-detail-text { font-size: 13px !important; line-height: 1.85 !important; }
    .case-gallery { grid-template-columns: 1fr !important; }
    .case-detail-cta { flex-direction: column !important; align-items: stretch !important; gap: 12px !important; }
    .case-detail-cta .hp-btn { width: 100% !important; }

    /* ---------- 8. 下单页 ---------- */
    /* 步骤指示（预览稿：01 选品类 → 02 填规格 → 03 提交） */
    .order-steps { display: flex !important; align-items: center; margin-bottom: 16px !important; }
    .order-step { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 10px; color: var(--muted, #5f6f85); flex: none; }
    .order-step b {
        width: 26px; height: 26px; border-radius: 50%;
        background: var(--blue, #1d4ed8); color: #fff;
        display: flex; align-items: center; justify-content: center; font-size: 11px;
    }
    .order-step.on b { background: var(--blue, #1d4ed8); }
    .order-step-line { flex: 1; height: 1px; background: var(--line, #dce4ef); margin: 0 6px; margin-bottom: 14px; }
    .order-page .page-hero h1 { font-size: 25px !important; }
    .order-form .page-panel { padding: 18px 16px !important; border-radius: 14px !important; margin-bottom: 12px !important; }
    .page-panel-head { flex-direction: column; align-items: flex-start !important; gap: 4px !important; }
    .page-panel-head h3 { font-size: 15px !important; }
    .order-contact-grid { grid-template-columns: 1fr !important; gap: 12px !important; }
    .order-contact-grid > div label { font-size: 12px !important; }
    /* 制作明细表格：改为紧凑卡片行 */
    .order-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .order-table-wrap table { min-width: 520px; }
    .order-items input, .order-items select { font-size: 14px !important; min-height: 38px !important; }
    .order-file-drop { padding: 20px 12px !important; border-radius: 12px !important; font-size: 12px !important; }
    .order-consent { font-size: 12px !important; line-height: 1.7 !important; }
    .order-guard-panel { padding: 18px 16px !important; }
    .order-guard-row { flex-direction: column !important; align-items: flex-start !important; gap: 8px !important; }
    .order-guard-row label { font-size: 13px !important; }
    .order-guard-row input { width: 100% !important; }
    .order-submit { display: flex !important; flex-direction: column !important; gap: 10px !important; }
    .order-submit .hp-btn { width: 100% !important; }

    /* ---------- 9. 订单查询页 ---------- */
    .order-query-form { grid-template-columns: 1fr !important; gap: 14px !important; }
    .order-query-form label { font-size: 12px !important; }
    .order-query-form .hp-btn { width: 100% !important; min-height: 48px !important; }
    .order-query-note { font-size: 12px !important; line-height: 1.8 !important; }

    /* ---------- 10. 联系我们页（对齐预览稿） ---------- */
    .contact-page { padding: 20px 16px !important; border-radius: 14px !important; }
    .contact-page h2 { font-size: 21px !important; }
    .contact-info {
        padding: 4px 14px !important;
        border-radius: 12px !important;
        font-size: 12.5px !important;
        background: transparent !important;
    }
    .contact-info p {
        display: flex !important;
        align-items: flex-start;
        gap: 10px;
        padding: 12px 0 !important;
        margin: 0 !important;
        border-bottom: 1px solid var(--line, #dce4ef) !important;
        line-height: 1.7 !important;
    }
    .contact-info p:last-child { border-bottom: none !important; }
    .contact-info strong { color: var(--ink, #0b1f3a) !important; flex: none; }
    .contact-form label { font-size: 12px !important; display: block !important; margin: 14px 0 6px !important; }
    .contact-form label:first-child { margin-top: 0 !important; }
    .contact-form input, .contact-form textarea { width: 100% !important; }
    .contact-form button {
        width: 100% !important;
        min-height: 48px !important;
        border-radius: 10px !important;
        background: var(--blue, #1d4ed8) !important;
        color: #fff !important;
        border: none !important;
        font-size: 14px !important;
        font-weight: 700 !important;
        margin-top: 18px !important;
    }
    .contact-form textarea { min-height: 110px !important; }

    /* ---------- 11. 文章列表/详情 ---------- */
    .article-list, .article-detail { padding: 20px 16px !important; border-radius: 14px !important; }
    .article-list h2 { font-size: 19px !important; }
    .article-item h3 { font-size: 15px !important; }
    .article-item .summary { font-size: 12px !important; }
    .article-detail h1 { font-size: 22px !important; }
    .article-detail .content { font-size: 13.5px !important; line-height: 1.9 !important; }
    .pagination a { padding: 8px 12px !important; font-size: 13px !important; }

    /* ---------- 12. 下单成功页 ---------- */
    .order-success-info { grid-template-columns: 1fr !important; gap: 10px !important; }
    .order-success-card { padding: 20px 16px !important; }
    .order-success-total { font-size: 22px !important; }
    .order-success-actions { flex-direction: column !important; }
    .order-success-actions .hp-btn { width: 100% !important; }
    .order-success-table { min-width: 480px; }

    /* ---------- 13. 页脚：手机端精简（管理入口已移到顶栏） ---------- */
    .site-footer { padding: 20px 0 !important; margin-top: 10px !important; }
    .site-foot { flex-direction: column !important; align-items: flex-start !important; gap: 10px !important; text-align: left !important; }
    .site-foot-mid { text-align: left !important; }
    .site-foot-links { display: flex !important; gap: 16px !important; flex-wrap: wrap !important; margin-top: 4px !important; }
    .site-foot-links a { font-size: 12px !important; color: #6b7c92 !important; }
    .site-foot-links a.foot-admin-link { display: none !important; }   /* 管理入口已移到顶栏，页脚不再重复 */
}

/* ============================================================
   PC 端默认：管理入口图标隐藏（PC 端页脚已有入口）
   ============================================================ */
@media (min-width: 681px) {
    .mb-admin-link { display: none !important; }
    .site-brand-row { display: contents !important; }
}
