/* =====================================================================
   mobile.css —— 手机端版式（≤1023px 生效，桌面端沿用原站版面）
   结构由 Services/MobileRenderer.cs 生成：
   .layout-mobile > .m-header / .m-drawer / .m-main / .m-footer
   颜色沿用站点主色 --brand（后台「主题色」）
   ===================================================================== */

.layout-mobile { display: none; }

@media (max-width: 1199px) {
    .layout-desktop { display: none !important; }

    .layout-mobile {
        display: block;
        overflow-x: clip;
        background: #fff;
        color: var(--ink);
        font-size: 16px;
        line-height: 1.7;
        -webkit-text-size-adjust: 100%;
    }

    .layout-mobile *,
    .layout-mobile *::before,
    .layout-mobile *::after { box-sizing: border-box; }

    .layout-mobile img { max-width: 100%; display: block; }

    /* ---------------------------------------------------------- 页头 */
    .m-header {
        position: sticky;
        top: 0;
        z-index: 90;
        background: rgba(255, 255, 255, .96);
        backdrop-filter: saturate(180%) blur(8px);
        border-bottom: 1px solid var(--line);
    }

    .m-top {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 16px 6px;
    }

    .m-logo img { height: 34px; width: auto; }
    .m-logo { flex: 0 0 auto; }

    .m-lang {
        position: relative;
        margin-left: auto;
        flex: 0 0 auto;
        z-index: 120;
    }
    .m-lang-toggle {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        height: 32px;
        padding: 0 10px;
        border: 1px solid var(--line);
        border-radius: 999px;
        background: #fff;
        color: var(--ink);
        font-family: inherit;
        font-size: 12px;
        line-height: 1;
        white-space: nowrap;
    }
    .m-lang-toggle img { width: 16px; height: 16px; border-radius: 50%; }
    .m-lang-caret {
        width: 0; height: 0;
        border-left: 4px solid transparent;
        border-right: 4px solid transparent;
        border-top: 5px solid currentColor;
        opacity: .6;
    }
    .m-lang-menu {
        position: absolute;
        right: 0;
        top: calc(100% + 6px);
        min-width: 150px;
        padding: 6px;
        background: #fff;
        border: 1px solid var(--line);
        border-radius: 10px;
        box-shadow: 0 14px 30px rgba(15, 23, 42, .16);
        display: none;
        z-index: 130;
    }
    .m-lang.open .m-lang-menu { display: block; }
    .m-lang-menu a {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 8px 10px;
        border-radius: 7px;
        color: var(--ink-2);
        font-size: 13px;
        white-space: nowrap;
    }
    .m-lang-menu a.is-active {
        color: var(--brand);
        background: var(--brand-soft);
        font-weight: 600;
    }
    .m-lang-menu img { width: 16px; height: 16px; border-radius: 50%; }

    /* 板块标题 + 右上 MORE */
    .m-sec-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding-right: 16px;
    }
    .m-more {
        color: var(--brand);
        font-size: 12px;
        font-weight: 600;
        letter-spacing: .04em;
        text-decoration: none;
    }

    /* 汉堡 */
    .m-burger {
        flex: 0 0 38px;
        width: 38px; height: 38px;
        display: inline-flex; flex-direction: column;
        align-items: center; justify-content: center; gap: 4px;
        border: 1px solid var(--line);
        border-radius: 10px;
        background: #fff;
        cursor: pointer;
    }
    .m-burger span {
        display: block; width: 17px; height: 2px;
        background: var(--ink); border-radius: 2px;
        transition: transform .2s ease, opacity .2s ease;
    }
    body.m-nav-open .m-burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
    body.m-nav-open .m-burger span:nth-child(2) { opacity: 0; }
    body.m-nav-open .m-burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

    .m-brand { padding: 0 16px 10px; }
    .m-brand-title {
        display: block;
        font-size: 17px;
        font-weight: 700;
        line-height: 1.38;
        letter-spacing: -.01em;
        color: #1b2027;
    }
    .m-brand-sub {
        display: block;
        margin-top: 3px;
        font-size: 11px;
        line-height: 1.45;
        color: var(--ink-3);
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* ---------------------------------------------------------- 抽屉菜单 */
    .m-drawer {
        position: fixed;
        inset: 0 0 0 auto;
        width: min(86vw, 340px);
        background: #fff;
        z-index: 120;
        transform: translateX(100%);
        visibility: hidden;
        transition: transform .26s cubic-bezier(.32, .72, 0, 1), visibility .26s;
        display: flex;
        flex-direction: column;
        box-shadow: -24px 0 60px rgba(15, 23, 42, .16);
        overflow-y: auto;
    }
    body.m-nav-open .m-drawer { transform: translateX(0); visibility: visible; }

    body.m-nav-open::after {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, .38);
        z-index: 110;
    }

    .m-drawer-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px 18px 12px;
        font-size: 13px;
        color: var(--ink-3);
        letter-spacing: .12em;
    }
    .m-close {
        width: 34px; height: 34px;
        border: 0; background: var(--surface-2);
        border-radius: 50%;
        font-size: 20px; line-height: 1;
        color: var(--ink-2);
        cursor: pointer;
    }

    .m-menu { list-style: none; margin: 0; padding: 0 8px; }
    .m-menu > li > a {
        display: block;
        padding: 14px 12px;
        font-size: 16px;
        font-weight: 600;
        color: var(--ink);
        border-radius: 10px;
    }
    .m-menu > li > a:active { background: var(--brand-soft); color: var(--brand); }
    .m-sub { list-style: none; margin: 0 0 6px; padding: 0 0 0 12px; }
    .m-sub a {
        display: block;
        padding: 9px 12px;
        font-size: 14px;
        color: var(--ink-2);
        border-left: 2px solid var(--line);
    }

    .m-drawer-contact {
        margin-top: auto;
        padding: 18px;
        border-top: 1px solid var(--line);
        display: grid;
        gap: 6px;
    }
    .m-drawer-contact a { color: var(--brand); font-size: 14px; }

    /* ---------------------------------------------------------- 内容 */
    .m-main { padding: 14px 0 8px; }

    .m-page-title {
        margin: 0 16px 12px;
        font-size: 22px;
        line-height: 1.35;
        font-weight: 700;
        letter-spacing: -.01em;
        color: #1b2027;
    }

    .m-block { margin: 0 16px 16px; }

    /* 轮播：整屏宽的横向滑动 */
    .m-hero { margin: 0 0 18px; }
    .m-hero-track {
        display: flex;
        gap: 10px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 0 16px;
    }
    .m-hero-track::-webkit-scrollbar { display: none; }
    .m-hero-track img {
        flex: 0 0 88%;
        width: 88%;
        aspect-ratio: 4 / 3;
        height: auto;
        border-radius: 12px;
        scroll-snap-align: center;
        object-fit: cover;
        background: var(--surface-2);
    }
    .m-hero-dots {
        display: flex;
        justify-content: center;
        gap: 6px;
        padding: 10px 0 0;
    }
    .m-hero-dots button {
        width: 6px; height: 6px;
        padding: 0; border: 0;
        border-radius: 50%;
        background: #d6dbe3;
        transition: width .2s ease, background-color .2s ease;
    }
    .m-hero-dots button.is-active {
        width: 18px;
        border-radius: 3px;
        background: var(--brand);
    }

    /* 新闻列表 */
    .m-list { border-top: 1px solid var(--line); }
    .m-list-title {
        margin: 0;
        padding: 14px 0 8px;
        font-size: 15px;
        font-weight: 700;
        color: var(--ink);
        display: flex;
        align-items: center;
        gap: 8px;
    }
    .m-list-title::before {
        content: "";
        width: 3px; height: 14px;
        background: var(--brand);
        border-radius: 2px;
    }

    .m-row {
        display: block;
        padding: 11px 0;
        border-bottom: 1px solid var(--line);
    }
    .m-row:active { background: var(--surface-2); }
    .m-row-title {
        display: block;
        font-size: 15px;
        line-height: 1.55;
        color: var(--ink);
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .m-row-date {
        display: block;
        margin-top: 5px;
        font-size: 12px;
        color: var(--ink-3);
        font-variant-numeric: tabular-nums;
    }

    /* 带缩略图与摘要的列表（专家 / 企业 / 院校） */
    .m-row-media {
        display: flex;
        gap: 12px;
        align-items: flex-start;
    }
    .m-row-pic {
        flex: 0 0 76px;
        width: 76px;
        height: 76px;
        border-radius: 10px;
        overflow: hidden;
        background: var(--surface-2);
    }
    .m-row-pic img { width: 100%; height: 100%; object-fit: cover; }
    .m-row-body { flex: 1 1 auto; min-width: 0; }
    .m-row-desc {
        display: block;
        margin-top: 4px;
        font-size: 13px;
        line-height: 1.6;
        color: var(--ink-2);
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* 产品卡片 */
    /* 产品 / 合作单位：横向滚动，不再一次全铺出来 */
    .m-cards {
        display: flex;
        gap: 12px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        padding: 0 0 4px;
        margin: 0 16px 16px;
        scrollbar-width: none;
    }
    .m-cards::-webkit-scrollbar { display: none; }
    .m-card {
        flex: 0 0 46%;
        scroll-snap-align: start;
    }
    .m-card {
        display: flex;
        flex-direction: column;
        border-radius: 12px;
        overflow: hidden;
        background: #fff;
        border: 1px solid var(--line);
    }
    .m-card-pic {
        display: flex;
        align-items: center;
        justify-content: center;
        aspect-ratio: 1 / 1;
        background: #fff;
        padding: 14px;
    }
    .m-card-pic img { max-width: 100%; max-height: 100%; object-fit: contain; }
    .m-card-title {
        display: block;
        padding: 8px 10px 10px;
        font-size: 12.5px;
        line-height: 1.45;
        color: var(--ink-2);
        border-top: 1px solid var(--line);
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* 分类胶囊 */
    .m-chips {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        scrollbar-width: none;
        padding: 0 0 4px;
        margin: 0 16px 16px;
    }
    .m-chips::-webkit-scrollbar { display: none; }
    .m-chips a {
        flex: 0 0 auto;
        padding: 7px 14px;
        border: 1px solid var(--line);
        border-radius: 999px;
        font-size: 13.5px;
        color: var(--ink-2);
        white-space: nowrap;
    }
    .m-chips a:active,
    .m-chips a.is-active {
        border-color: var(--brand);
        color: var(--brand);
        background: var(--brand-soft);
    }

    /* 富文本 */
    .m-rich { font-size: 16px; line-height: 1.8; color: var(--ink); }
    .m-rich p { margin: 0 0 12px; }
    .m-rich strong { font-weight: 600; }
    .m-rich a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
    .m-rich img { border-radius: 10px; margin: 10px 0; height: auto; }
    .m-rich table {
        display: block;
        width: 100%;
        overflow-x: auto;
        border-collapse: collapse;
        font-size: 14px;
    }
    .m-rich table td, .m-rich table th { padding: 6px 8px; border: 1px solid var(--line); white-space: nowrap; }
    .m-rich h1, .m-rich h2, .m-rich h3 { font-size: 18px; margin: 20px 0 10px; }
    .m-rich ul, .m-rich ol { padding-left: 20px; }
    .m-rich li { margin-bottom: 6px; }

    /* 详情页标题 */
    .m-article-title { font-size: 20px; font-weight: 700; line-height: 1.45; }

    /* 面包屑 */
    .m-crumb {
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: 12.5px;
        color: var(--ink-3);
        margin-bottom: 4px;
    }
    .m-crumb a { color: var(--ink-2); }

    /* 联系方式 */
    .m-contact {
        background: var(--surface-2);
        border-radius: 12px;
        padding: 6px 14px;
    }
    .m-contact-row {
        padding: 10px 0;
        font-size: 14px;
        color: var(--ink-2);
        border-bottom: 1px solid rgba(0, 0, 0, .05);
    }
    .m-contact-row:last-child { border-bottom: 0; }
    .m-contact-row a { color: var(--ink-2); }

    .m-figure { margin: 0 16px 16px; }
    .m-figure img { width: 100%; border-radius: 12px; }

    /* 原站分类组件的空状态占位（数据已由服务端直出，不再需要） */
    .m-nodata { display: none !important; }

    /* 产品筛选（机械类型 / 作业类型）：手机端两行横向滑动 */
    .prod-filters { margin: 0 0 12px; }
    .prod-filter-row {
        display: flex; gap: 8px; overflow-x: auto; padding: 6px 16px;
        margin: 0 -16px; -webkit-overflow-scrolling: touch;
    }
    .prod-filter-row::-webkit-scrollbar { display: none; }
    .prod-filter-row .lbl { flex: 0 0 auto; font-size: 13px; color: var(--ink-3); align-self: center; }
    .prod-filter-row .opt {
        flex: 0 0 auto; padding: 5px 12px; border: 1px solid var(--line);
        border-radius: 999px; background: #fff; color: var(--ink-2);
        font-size: 13px; text-decoration: none;
    }
    .prod-filter-row .opt.cur { background: var(--brand); border-color: var(--brand); color: #fff; }



    /* 地图：整行铺满，按 4:3 保持比例 */
    .m-map iframe {
        display: block;
        width: 100%;
        height: auto;
        aspect-ratio: 4 / 3;
        border: 0;
        border-radius: 12px;
        background: #eef2f6;
    }

    /* 页脚 */
    .m-footer {
        margin-top: 24px;
        padding: 24px 16px 28px;
        background: var(--surface-2);
        border-top: 1px solid var(--line);
    }
    .m-footer-qr {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 12px;
        margin: 0 0 16px;
    }
    .m-footer-qr img {
        width: 92px;
        height: 92px;
        object-fit: contain;
        background: #fff;
        padding: 4px;
        border-radius: 6px;
    }
    .m-footer-name {
        font-size: 15px;
        font-weight: 700;
        color: var(--ink);
        line-height: 1.6;
        margin-bottom: 10px;
        padding-left: 10px;
        border-left: 3px solid var(--brand);
    }
    .m-footer-meta {
        display: flex;
        flex-wrap: wrap;
        gap: 6px 16px;
        font-size: 13px;
        color: var(--ink-2);
        margin-bottom: 14px;
    }
    .m-footer-meta a { color: var(--ink-2); text-decoration: none; }
    .m-footer-copy {
        display: flex;
        flex-wrap: wrap;
        gap: 6px 14px;
        font-size: 12px;
        color: var(--ink-3);
        padding-top: 12px;
        border-top: 1px solid var(--line);
    }
}

@media (min-width: 700px) {
    .m-cards { gap: 16px; }
    .m-card { flex: 0 0 30%; }
    .m-chips { padding: 0 24px 4px; margin: 0 -24px 20px; }
    .m-row-title { font-size: 16px; }
    .m-footer { padding: 28px 24px 32px; }
}

    /* 产品列表（农业机械等）手机卡片：图片铺满图片区域 */
    body:not(.is-home) .layout-mobile .m-card-pic img {
        width: 100% !important;
        height: 100% !important;
        max-width: none !important;
        max-height: none !important;
        object-fit: cover !important;
        object-position: center center !important;
    }

    /* 产品卡片图片区去掉内边距，图片铺满整张卡片 */
    body:not(.is-home) .layout-mobile .m-card-pic { padding: 0 !important; }

/* ---------------- 手机端：3 列网格（不横向滚动）+ 筛选边距 ---------------- */
.layout-mobile .m-cards.m-cards-3 {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    overflow: visible !important;
    scroll-snap-type: none;
    padding: 0 !important;
}
.layout-mobile .m-cards.m-cards-3 .m-card {
    flex: none !important;
    width: auto !important;
    min-width: 0;
    border-radius: 8px;
}
.layout-mobile .m-cards.m-cards-3 .m-card-pic {
    aspect-ratio: 1 / 1;
    padding: 4px;
}
.layout-mobile .m-cards.m-cards-3 .m-card-pic img {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: contain !important;
    background: #fff;
}
.layout-mobile .m-cards.m-cards-3 .m-card-title {
    font-size: 11px;
    line-height: 1.35;
    padding: 5px 6px 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 机械类型 / 作业类型：左右留出与内容一致的边距，标签可换行不溢出 */
.layout-mobile .m-filters {
    margin: 0 16px 14px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid #eef1f5;
    border-radius: 10px;
}
.layout-mobile .m-filters .prod-filters { display: block; }
.layout-mobile .m-filters .prod-filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0 0 8px;
}
.layout-mobile .m-filters .prod-filter-row:last-child { margin-bottom: 0; }
.layout-mobile .m-filters .lbl { font-size: 12px; color: #6b7280; margin-right: 2px; }
.layout-mobile .m-filters .opt {
    font-size: 12px;
    line-height: 1.2;
    padding: 4px 9px;
    border-radius: 12px;
    background: #f4f6f8;
    color: #444;
    text-decoration: none;
    white-space: nowrap;
}
.layout-mobile .m-filters .opt.cur { background: var(--brand, #f68634); color: #fff; }

/* 图文列表里没有封面时的占位块（专家/企业） */
.layout-mobile .m-row-pic .m-row-ph {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: #f4f6f8;
    color: #b6bfc9;
    font-size: 20px;
    font-weight: bold;
}

/* 表单页（专家咨询表单）：字段在窄屏下改为整行 */
.layout-mobile .m-form { padding: 4px 2px 8px; }
.layout-mobile .m-form .formpanel,
.layout-mobile .m-form form { width: 100% !important; }
.layout-mobile .m-form .fg_group,
.layout-mobile .m-form .fg_item { width: 100% !important; float: none !important; }
.layout-mobile .m-form input[type="text"],
.layout-mobile .m-form input[type="tel"],
.layout-mobile .m-form input[type="email"],
.layout-mobile .m-form input[type="number"],
.layout-mobile .m-form textarea,
.layout-mobile .m-form select { width: 100% !important; box-sizing: border-box; }
.layout-mobile .m-form textarea { min-height: 90px; }
.layout-mobile .m-form .w-formtitle-title { font-size: 18px; }
.layout-mobile .m-form .w-submit,
.layout-mobile .m-form button[type="submit"] { width: 100% !important; }

/* 表单页：去掉原站的绝对定位与 1120px 固定宽，字段按屏幕宽度排 */
.layout-mobile .m-form * { max-width: 100% !important; box-sizing: border-box; }
.layout-mobile .m-form .smartAbs {
    position: static !important;
    width: 100% !important;
    height: auto !important;
    left: 0 !important;
    top: 0 !important;
}
.layout-mobile .m-form .yibuFrameContent { overflow: visible !important; }
.layout-mobile .m-form .formpanel { width: 100% !important; }
.layout-mobile .m-form .fg_group,
.layout-mobile .m-form .fg_item,
.layout-mobile .m-form .w-formitem,
.layout-mobile .m-form .w-formitem-inner { width: 100% !important; float: none !important; }
.layout-mobile .m-form .w-submit { width: 100% !important; }

/* 表单字段：整行排列，标签不拆字 */
.layout-mobile .m-form .w-input {
    width: 100% !important;
    float: none !important;
    display: block;
    margin: 0 0 10px !important;
}
.layout-mobile .m-form .w-input-title-box { margin-bottom: 4px; }
.layout-mobile .m-form .w-input-txt,
.layout-mobile .m-form .w-input-txt-inner { white-space: nowrap; font-size: 13px; }
.layout-mobile .m-form .w-input input,
.layout-mobile .m-form .w-input textarea,
.layout-mobile .m-form .w-input select { width: 100% !important; }
.layout-mobile .m-form .w-input-weight-box { width: 100% !important; }

/* 表单字段容器（原站按 34% 分栏）：手机上每项占满一行 */
.layout-mobile .m-form .smAreaC,
.layout-mobile .m-form [id^="smc_item"] {
    width: 100% !important;
    float: none !important;
}

/* 手机端搜索页 */
.layout-mobile .m-search { padding: 4px 0 8px; }
.layout-mobile .m-sr-form { display: flex; gap: 8px; }
.layout-mobile .m-sr-input {
    flex: 1 1 auto;
    min-width: 0;
    height: 42px;
    border: 1px solid #dfe3e8;
    border-radius: 21px;
    padding: 0 16px;
    font-size: 14px;
    background: #fff;
}
.layout-mobile .m-sr-btn {
    height: 42px;
    padding: 0 20px;
    border: 0;
    border-radius: 21px;
    background: var(--brand, #f68634);
    color: #fff;
    font-size: 14px;
}
.layout-mobile .m-sr-count { margin: 10px 0 0; font-size: 12.5px; color: #6b7280; }
.layout-mobile .m-row-desc .sr-tag {
    display: inline-block;
    font-size: 11.5px;
    color: var(--brand, #f68634);
    background: rgba(0, 0, 0, .04);
    padding: 0 6px;
    border-radius: 8px;
    margin-right: 6px;
}

@media (max-width: 767px) {
    /* 首页底部合作方 logo：手机上一行只显示 3 个，横向滚动（由 responsive.js 自动轮播） */
@media (max-width: 767px) {
    body.is-home .m-cards.m-cards-3 {
        display: flex !important;
        flex-wrap: nowrap !important;
        grid-template-columns: none !important;
        gap: 10px;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }
    body.is-home .m-cards.m-cards-3::-webkit-scrollbar { display: none; }
    body.is-home .m-cards.m-cards-3 .m-card {
        flex: 0 0 calc((100% - 20px) / 3) !important;
        width: auto !important;
        min-width: 0;
        scroll-snap-align: start;
        border-radius: 8px;
    }
    body.is-home .m-cards.m-cards-3 .m-card-pic { aspect-ratio: 1 / 1; padding: 8px; }
    body.is-home .m-cards.m-cards-3 .m-card-pic img {
        width: 100% !important; height: 100% !important;
        object-fit: contain !important; background: #fff;
    }
    body.is-home .m-cards.m-cards-3 .m-card-title {
        font-size: 11px; line-height: 1.35; padding: 6px 6px 8px; text-align: center;
        display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    }
}

/* 手机端文本模块：保住原快照里的居中排版（CleanRich 会删掉 style，这里用 class 还原） */
.layout-mobile p.ta-c, .layout-mobile .ta-c { text-align: center !important; }
