/* ==========================================================================
   移动端 App 外框：底部五栏导航 + 移动端头部精简
   仅在手机/窄屏生效，桌面端保持原样
   ========================================================================== */

.app-tabbar {
    display: none;
}

@media (max-width: 900px) {
    body.has-app-tabbar {
        padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px)) !important;
    }

    .app-tabbar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 9999;
        display: flex;
        align-items: stretch;
        height: 56px;
        padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0px));
        background: rgba(255, 255, 255, .97);
        border-top: 1px solid #eef0f4;
        box-shadow: 0 -8px 24px rgba(15, 23, 42, .07);
        -webkit-backdrop-filter: blur(12px);
        backdrop-filter: blur(12px);
    }

    .app-tabbar .app-tab {
        color: var(--app-tab-color, #9aa3af);
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        min-width: 0;
        text-decoration: none;
        font-size: 10.5px;
        line-height: 1.2;
        -webkit-tap-highlight-color: transparent;
        transition: color .18s ease;
    }

    .app-tabbar .app-tab-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 24px;
        height: 24px;
    }

    .app-tabbar .app-tab-icon svg {
        width: 22px;
        height: 22px;
        display: block;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.7;
        stroke-linecap: round;
        stroke-linejoin: round;
        transition: transform .18s ease;
    }

    .app-tabbar .app-tab.is-active {
        color: var(--app-accent, #e4393c);
        font-weight: 600;
    }

    .app-tabbar .app-tab.is-active .app-tab-icon svg {
        transform: translateY(-1px) scale(1.04);
    }

    /* ---------- 商城页面：移动端精简头部 ---------- */
    body.has-app-tabbar .nm-top,
    body.has-app-tabbar .nm-nav,
    body.has-app-tabbar .nm-crumb,
    body.has-app-tabbar .nm-footer {
        display: none !important;
    }

    body.has-app-tabbar .nm-header {
        position: sticky;
        top: 0;
        z-index: 200;
        box-shadow: 0 1px 0 #eef0f4;
    }

    body.has-app-tabbar .nm-header-inner {
        width: 100%;
        height: auto;
        min-height: 0;
        padding: 10px 12px 9px;
        flex-wrap: wrap;
        gap: 8px;
    }

    body.has-app-tabbar .nm-logo {
        flex: 1 1 auto;
        gap: 9px;
        min-width: 0;
    }

    body.has-app-tabbar .nm-logo-mark {
        width: 38px;
        height: 38px;
        flex: 0 0 38px;
    }

    body.has-app-tabbar .nm-logo-text h1 {
        font-size: 18px;
        line-height: 1.2;
    }

    body.has-app-tabbar .nm-logo-text p {
        display: block;
        font-size: 11px;
        line-height: 1.2;
        letter-spacing: 1.1px;
        margin-top: 1px;
    }

    body.has-app-tabbar .nm-searchbox {
        flex: 1 1 100%;
        width: 100%;
        margin: 0;
    }

    body.has-app-tabbar .nm-search-form {
        height: 38px;
    }

    body.has-app-tabbar .nm-hotwords,
    body.has-app-tabbar .nm-head-ad {
        display: none !important;
    }

    body.has-app-tabbar .nm-backtop {
        bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    }

    body.has-app-tabbar .nm-cart-bar {
        bottom: calc(58px + env(safe-area-inset-bottom, 0px));
        z-index: 300;
    }

    /* ---------- 社区圈页面：隐藏桌面顶栏/页脚 ---------- */
    body.has-app-tabbar .topbar,
    body.has-app-tabbar .site-footer {
        display: none !important;
    }

    body.has-app-tabbar .site-header {
        position: sticky;
        top: 0;
        z-index: 200;
    }

    body.has-app-tabbar .main-wrap {
        padding-bottom: 18px;
    }
}

/* 移动端购物车入口（五栏底部导航之外的二级入口） */
.nm-mobile-cart {
    display: none;
}

@media (max-width: 900px) {
    body.has-app-tabbar .nm-mobile-cart {
        display: flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 38px;
        width: 38px;
        height: 38px;
        margin-left: auto;
        border: 1px solid #ffe0dc;
        border-radius: 10px;
        background: #fff6f4;
        color: #e4393c;
        text-decoration: none;
    }

    body.has-app-tabbar .nm-mobile-cart svg {
        width: 21px;
        height: 21px;
        display: block;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.8;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    /* 首页楼层标题在窄屏下不挤压、不被截断 */
    body.has-app-tabbar .nm-floor,
    body.has-app-tabbar .nm-sec {
        padding-left: 12px;
        padding-right: 12px;
    }

    body.has-app-tabbar .nm-floor-hd {
        height: auto;
        min-height: 40px;
        flex-wrap: wrap;
        row-gap: 4px;
        padding-bottom: 8px;
    }

    body.has-app-tabbar .nm-floor-hd h2 {
        flex: 0 0 auto;
        padding-left: 10px;
        border-left-width: 4px;
        font-size: 20px;
        line-height: 1.3;
        white-space: nowrap;
    }

    body.has-app-tabbar .nm-floor-hd .nm-floor-sub {
        flex: 1 1 120px;
        min-width: 0;
        margin-left: 8px;
        font-size: 11px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    body.has-app-tabbar .nm-floor-hd .nm-floor-tabs {
        margin-left: auto;
        gap: 10px;
        font-size: 12px;
    }

    body.has-app-tabbar .nm-floor-hd .nm-more {
        margin-left: auto;
        font-size: 11px;
    }
}

@media (max-width: 900px) {
    /* 限时抢购标题行：窄屏下横向排布，避免标题被挤断 */
    body.has-app-tabbar .nm-flash {
        padding-left: 12px;
        padding-right: 12px;
    }

    body.has-app-tabbar .nm-flash-hd {
        height: auto;
        min-height: 48px;
        flex-wrap: wrap;
        row-gap: 6px;
        padding: 4px 0 8px;
    }

    body.has-app-tabbar .nm-flash-hd h2 {
        flex: 0 0 auto;
        font-size: 20px;
        white-space: nowrap;
    }

    body.has-app-tabbar .nm-flash-hd .nm-flash-sub {
        display: none;
    }

    body.has-app-tabbar .nm-flash-hd .nm-countdown {
        margin-left: auto;
        font-size: 12px;
    }

    body.has-app-tabbar .nm-flash-hd .nm-countdown .lb {
        display: none;
    }

    body.has-app-tabbar .nm-flash-hd .nm-more {
        margin-left: 6px;
        font-size: 11px;
        white-space: nowrap;
    }
}

/* ==========================================================================
   商品页移动端：左侧分类 + 右侧商品列表
   ========================================================================== */
@media (max-width: 900px) {
    body.has-app-tabbar .nm-list {
        display: grid;
        grid-template-columns: 94px minmax(0, 1fr);
        align-items: start;
        gap: 8px;
        padding: 0 8px;
    }

    body.has-app-tabbar .nm-list-side {
        position: sticky;
        top: calc(var(--app-header-h, 136px) + 6px);
        z-index: 10;
        max-height: calc(100vh - var(--app-header-h, 136px) - 76px);
        margin: 0;
        overflow-y: auto;
        border-radius: 10px;
        border-color: #eef0f4;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    body.has-app-tabbar .nm-list-side::-webkit-scrollbar {
        width: 0;
        height: 0;
    }

    body.has-app-tabbar .nm-list-side-hd {
        display: none;
    }

    body.has-app-tabbar .nm-tree {
        max-height: none;
        overflow: visible;
        padding: 5px 0;
    }

    body.has-app-tabbar .nm-tree-all,
    body.has-app-tabbar .nm-tree-row {
        height: 44px;
        padding: 0 8px;
        border-left-width: 3px;
        border-bottom: 1px solid #f7f8fa;
    }

    body.has-app-tabbar .nm-tree-all {
        margin-bottom: 0;
        border-bottom: 1px solid #f0f2f5;
    }

    body.has-app-tabbar .nm-tree-arrow,
    body.has-app-tabbar .nm-tree-cnt {
        display: none;
    }

    body.has-app-tabbar .nm-tree-children {
        display: none !important;
    }

    body.has-app-tabbar .nm-tree-name,
    body.has-app-tabbar .nm-tree-all .nm-tree-name {
        font-size: 12px;
        line-height: 1.3;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    body.has-app-tabbar .nm-tree-row.on {
        border-left-color: var(--nm-red);
        background: #fff1f1;
    }

    body.has-app-tabbar .nm-list-main {
        min-width: 0;
    }

    body.has-app-tabbar .nm-list-banner {
        display: none !important;
    }

    body.has-app-tabbar .nm-list-toolbar {
        height: auto;
        margin: 0 0 8px;
        padding: 4px;
        border: 1px solid #eef0f4;
        border-radius: 10px;
        background: #fff;
        position: static;
    }

    body.has-app-tabbar .nm-list-toolbar .nm-list-count,
    body.has-app-tabbar .nm-list-toolbar .nm-list-search {
        display: none !important;
    }

    body.has-app-tabbar .nm-list-toolbar .nm-sort {
        width: 100%;
        display: flex;
        gap: 0;
    }

    body.has-app-tabbar .nm-sort a {
        flex: 1;
        padding: 0 2px;
        font-size: 12px;
        text-align: center;
        white-space: nowrap;
    }

    body.has-app-tabbar .nm-list-grid {
        display: block;
        overflow: hidden;
        border-radius: 10px;
        background: #fff;
        border: 1px solid #eef0f4;
        padding: 0;
    }

    body.has-app-tabbar .nm-list-grid .nm-prod {
        display: flex;
        align-items: flex-start;
        gap: 10px;
        padding: 10px;
        border: 0;
        border-bottom: 1px solid #f3f4f7;
        background: #fff;
        border-radius: 0;
    }

    body.has-app-tabbar .nm-list-grid .nm-prod:last-child {
        border-bottom: 0;
    }

    body.has-app-tabbar .nm-list-grid .nm-prod .pic {
        flex: 0 0 86px;
        width: 86px;
        height: 86px;
        padding-top: 0;
        border-radius: 8px;
        position: relative;
    }

    body.has-app-tabbar .nm-list-grid .nm-prod .pic img {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    body.has-app-tabbar .nm-list-grid .nm-prod .nm-prod-body {
        flex: 1;
        min-width: 0;
        padding: 0 32px 0 0;
        position: relative;
    }

    body.has-app-tabbar .nm-list-grid .nm-prod .nm-prod-name {
        height: auto;
        max-height: 38px;
        font-size: 13px;
        line-height: 1.45;
        color: #333;
        -webkit-line-clamp: 2;
    }

    body.has-app-tabbar .nm-list-grid .nm-prod .nm-prod-price {
        margin-top: 6px;
        font-size: 17px;
    }

    body.has-app-tabbar .nm-list-grid .nm-prod .nm-prod-old {
        margin-left: 5px;
        font-size: 10.5px;
    }

    body.has-app-tabbar .nm-list-grid .nm-prod .nm-prod-sales {
        margin-top: 2px;
        font-size: 10.5px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    body.has-app-tabbar .nm-list-grid .nm-prod .nm-prod-cart {
        right: 10px;
        bottom: 12px;
        width: 28px;
        height: 28px;
        line-height: 26px;
        font-size: 17px;
    }

    body.has-app-tabbar .nm-list-grid .nm-prod .nm-prod-tag {
        font-size: 10px;
        line-height: 16px;
        padding: 0 4px;
    }

    body.has-app-tabbar .nm-list-pager {
        padding: 12px 0 4px;
    }
}

/* 只在小程序/手机外框显示的补位卡片 */
.nm-mobile-only {
    display: none;
}

@media (max-width: 900px) {
    body.has-app-tabbar .nm-mobile-only {
        display: block;
    }
}

@media (max-width: 900px) {
    /* 子分类选中时，左侧一级分类显示为当前分支 */
    body.has-app-tabbar .nm-tree-row.active-branch {
        border-left-color: #ffc7c7;
        background: #fff7f7;
    }

    body.has-app-tabbar .nm-tree-row.active-branch .nm-tree-name {
        color: var(--nm-red);
        font-weight: 600;
    }
}

/* ==========================================================================
   首页移动端：商品卡片每行 3 个，整体更紧凑精致
   ========================================================================== */
@media (max-width: 900px) {
    body.has-app-tabbar .nm-flash-list,
    body.has-app-tabbar .nm-f1-prods,
    body.has-app-tabbar .nm-f3-list,
    body.has-app-tabbar .nm-brandshop {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    /* 卡片刻度 */
    body.has-app-tabbar .nm-flash-item,
    body.has-app-tabbar .nm-f1-prods .nm-prod,
    body.has-app-tabbar .nm-f3-list .nm-prod,
    body.has-app-tabbar .nm-brandshop .nm-prod {
        padding: 6px;
        border: 1px solid #f0f2f5;
        border-radius: 10px;
        background: #fff;
        overflow: hidden;
        box-shadow: 0 2px 8px rgba(15, 23, 42, .035);
    }

    body.has-app-tabbar .nm-f1-prods .nm-prod,
    body.has-app-tabbar .nm-f3-list .nm-prod,
    body.has-app-tabbar .nm-brandshop .nm-prod {
        padding: 0;
    }

    body.has-app-tabbar .nm-flash-item .pic,
    body.has-app-tabbar .nm-f1-prods .nm-prod .pic,
    body.has-app-tabbar .nm-f3-list .nm-prod .pic,
    body.has-app-tabbar .nm-brandshop .nm-prod .pic {
        border-radius: 7px;
        overflow: hidden;
    }

    body.has-app-tabbar .nm-f1-prods .nm-prod .pic {
        height: 0;
        padding-top: 100%;
    }

    /* 商品图上的角标 */
    body.has-app-tabbar .nm-flash-item .st,
    body.has-app-tabbar .nm-f1-prods .nm-prod .nm-prod-tag,
    body.has-app-tabbar .nm-f3-list .nm-prod .nm-prod-tag,
    body.has-app-tabbar .nm-brandshop .nm-prod .nm-prod-tag {
        left: 5px;
        top: 5px;
        padding: 0 4px;
        border-radius: 4px;
        font-size: 9px;
        line-height: 15px;
    }

    /* 商品名 */
    body.has-app-tabbar .nm-flash-item .nm,
    body.has-app-tabbar .nm-f1-prods .nm-prod .nm-prod-name,
    body.has-app-tabbar .nm-f3-list .nm-prod .nm-prod-name,
    body.has-app-tabbar .nm-brandshop .nm-prod .nm-prod-name {
        height: 32px;
        margin-top: 5px;
        font-size: 11.5px;
        line-height: 16px;
        -webkit-line-clamp: 2;
    }

    body.has-app-tabbar .nm-f1-prods .nm-prod .nm-prod-body,
    body.has-app-tabbar .nm-f3-list .nm-prod .nm-prod-body,
    body.has-app-tabbar .nm-brandshop .nm-prod .nm-prod-body {
        padding: 6px 7px 8px;
    }

    /* 价格 */
    body.has-app-tabbar .nm-flash-item .pr,
    body.has-app-tabbar .nm-f1-prods .nm-prod .nm-prod-price,
    body.has-app-tabbar .nm-f3-list .nm-prod .nm-prod-price,
    body.has-app-tabbar .nm-brandshop .nm-prod .nm-prod-price {
        margin-top: 3px;
        font-size: 14px;
        line-height: 1.2;
    }

    body.has-app-tabbar .nm-flash-item .pr .op,
    body.has-app-tabbar .nm-f1-prods .nm-prod .nm-prod-old,
    body.has-app-tabbar .nm-f3-list .nm-prod .nm-prod-old,
    body.has-app-tabbar .nm-brandshop .nm-prod .nm-prod-old {
        margin-left: 3px;
        font-size: 9.5px;
    }

    /* 三列卡片不展示销量/进度，保持干净 */
    body.has-app-tabbar .nm-flash-item .bar,
    body.has-app-tabbar .nm-flash-item .txt,
    body.has-app-tabbar .nm-f1-prods .nm-prod .nm-prod-sales,
    body.has-app-tabbar .nm-f3-list .nm-prod .nm-prod-sales,
    body.has-app-tabbar .nm-brandshop .nm-prod .nm-prod-sales {
        display: none !important;
    }

    /* 限时抢购：紧凑圆角按钮 */
    body.has-app-tabbar .nm-flash-item .buy {
        height: 24px;
        line-height: 24px;
        margin-top: 6px;
        border-radius: 12px;
        font-size: 11px;
    }

    /* 商品卡加购按钮 */
    body.has-app-tabbar .nm-f1-prods .nm-prod .nm-prod-cart,
    body.has-app-tabbar .nm-f3-list .nm-prod .nm-prod-cart,
    body.has-app-tabbar .nm-brandshop .nm-prod .nm-prod-cart {
        right: 6px;
        bottom: 6px;
        width: 22px;
        height: 22px;
        line-height: 20px;
        font-size: 14px;
    }

    /* 楼层二分类图卡也收成三列 */
    body.has-app-tabbar .nm-f2-tiles {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    body.has-app-tabbar .nm-f2-tiles .nm-tile,
    body.has-app-tabbar .nm-f2-tiles .nm-ph {
        height: 150px;
        border-radius: 10px;
        overflow: hidden;
    }
}

@media (max-width: 900px) {
    /* 三列商品卡空间有限：隐藏划线价，避免与加购按钮重叠 */
    body.has-app-tabbar .nm-f1-prods .nm-prod .nm-prod-old,
    body.has-app-tabbar .nm-f3-list .nm-prod .nm-prod-old,
    body.has-app-tabbar .nm-brandshop .nm-prod .nm-prod-old {
        display: none !important;
    }

    /* 三列分类图卡：文字与按钮收紧，更精致 */
    body.has-app-tabbar .nm-f2-tiles .nm-tile .tx {
        left: 10px;
        right: 10px;
        bottom: 10px;
    }

    body.has-app-tabbar .nm-f2-tiles .nm-tile .tx b {
        font-size: 14px;
        letter-spacing: .5px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    body.has-app-tabbar .nm-f2-tiles .nm-tile .tx span {
        margin-top: 2px;
        font-size: 9.5px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    body.has-app-tabbar .nm-f2-tiles .nm-tile .tx em {
        margin-top: 6px;
        padding: 2px 8px;
        border-radius: 10px;
        font-size: 9px;
    }
}

@media (max-width: 900px) {
    /* 首页生鲜楼层：去掉大幅主图 + 分类/品牌框 + 大图卡，保留小图卡与三列商品 */
    body.has-app-tabbar #floor-1 .nm-f1-left,
    body.has-app-tabbar #floor-1 .nm-f1-big {
        display: none !important;
    }
}

@media (max-width: 900px) {
    /* 生鲜楼层的小图卡也统一为三列，并隐藏无商品的占位卡 */
    body.has-app-tabbar #floor-1 .nm-f1-small {
        /* 生鲜楼层小图卡固定 4 个，移动端用 2×2 铺满，避免最后一行只放一张 */
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: auto;
        gap: 8px;
    }

    body.has-app-tabbar #floor-1 .nm-f1-small .nm-tile {
        height: auto;
        aspect-ratio: 1 / 1;
        border-radius: 10px;
        overflow: hidden;
    }

    body.has-app-tabbar #floor-1 .nm-f1-small .nm-tile-empty {
        display: none !important;
    }

    body.has-app-tabbar #floor-1 .nm-f1-small .nm-tile .tx {
        left: 10px;
        right: 10px;
        bottom: 10px;
    }

    body.has-app-tabbar #floor-1 .nm-f1-small .nm-tile .tx b {
        font-size: 14px;
        letter-spacing: .5px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    body.has-app-tabbar #floor-1 .nm-f1-small .nm-tile .tx span {
        margin-top: 2px;
        font-size: 9.5px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    body.has-app-tabbar #floor-1 .nm-f1-small .nm-tile .tx em {
        margin-top: 6px;
        padding: 2px 8px;
        border-radius: 10px;
        font-size: 9px;
    }
}

@media (max-width: 900px) {
    /* 商品页：整页锁定，左侧分类与右侧商品列表各自独立滚动 */
    body.nm-products-page.has-app-tabbar {
        height: 100vh;
        height: 100dvh;
        overflow: hidden !important;
        padding-bottom: 0 !important;
    }

    body.nm-products-page.has-app-tabbar .nm-list {
        height: calc(100vh - var(--app-header-h, 136px) - 58px);
        height: calc(100dvh - var(--app-header-h, 136px) - 58px);
        padding: 0 8px 8px;
        align-items: stretch;
        overflow: hidden;
    }

    body.nm-products-page.has-app-tabbar .nm-list-side {
        position: static;
        top: auto;
        height: 100%;
        min-height: 0;
        max-height: none;
        margin: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    body.nm-products-page.has-app-tabbar .nm-list-main {
        height: 100%;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 12px;
        overscroll-behavior: contain;
    }

    body.nm-products-page.has-app-tabbar .nm-list-toolbar {
        position: sticky;
        top: 0;
        z-index: 20;
    }
}

@media (max-width: 900px) {
    /* 商品页独立滚动：固定上下边界，兼容移动端浏览器嵌套滚动 */
    body.nm-products-page.has-app-tabbar {
        overscroll-behavior: none;
    }

    body.nm-products-page.has-app-tabbar .nm-list {
        position: fixed;
        top: var(--app-header-h, 136px);
        right: 0;
        bottom: 58px;
        left: 0;
        height: auto;
        margin: 0;
        padding: 0 8px 8px;
        align-items: stretch;
        overflow: visible;
    }

    body.nm-products-page.has-app-tabbar .nm-list-side,
    body.nm-products-page.has-app-tabbar .nm-list-main {
        height: 100%;
        min-height: 0;
        touch-action: pan-y;
        overscroll-behavior-y: contain;
        -webkit-overflow-scrolling: touch;
    }

    body.nm-products-page.has-app-tabbar .nm-list-main {
        overflow-y: auto;
    }

    body.nm-products-page.has-app-tabbar .nm-list-side {
        overflow-y: auto;
    }

    body.nm-products-page.has-app-tabbar .nm-list-main img {
        -webkit-user-drag: none;
        -webkit-touch-callout: none;
        user-select: none;
    }
}

@media (max-width: 900px) {
    /* 头部包含层吸顶：避免 sticky 被短容器限制 */
    body.has-app-tabbar div[data-include="header-new"] {
        position: sticky;
        top: 0;
        z-index: 200;
    }

    body.has-app-tabbar .nm-header {
        position: relative;
        top: auto;
        z-index: auto;
        box-shadow: 0 1px 0 #eef0f4;
    }
}

/* ==========================================================================
   社区圈 / 社区服务：统一移动端顶部，仅搜索内容不同
   ========================================================================== */
.app-mhead {
    display: none;
}

.app-mhead-space {
    display: none;
}

@media (max-width: 900px) {
    body.svc-page .svc-top {
        display: none !important;
    }

    body.has-app-tabbar .site-header,
    body.has-app-tabbar .topbar,
    body.has-app-mhead .site-header,
    body.has-app-mhead .topbar {
        display: none !important;
    }

    .app-mhead {
        display: block;
        position: fixed;
        top: 0;
        right: 0;
        left: 0;
        z-index: 300;
        background: #fff;
        border-bottom: 1px solid #f0f2f5;
        box-shadow: 0 2px 10px rgba(15, 23, 42, .04);
    }

    .app-mhead-space {
        display: block;
        height: 106px;
    }

    .app-mhead-inner {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        padding: 10px 12px 9px;
    }

    .app-mhead-brand {
        display: flex;
        align-items: center;
        gap: 8px;
        flex: 1;
        min-width: 0;
        text-decoration: none;
    }

    .app-mhead-chick {
        display: block;
        flex: 0 0 40px;
        width: 40px;
        height: 40px;
        object-fit: contain;
        filter: drop-shadow(0 2px 4px rgba(228, 57, 60, .14));
    }

    .app-mhead-brandtext {
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-width: 0;
        line-height: 1.15;
    }
    .app-mhead-title {
        color: #c8161d;
        font-size: 18px;
        font-weight: 800;
        letter-spacing: .5px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-family: 'SiyuanRouhei','PingFang SC','Microsoft YaHei',sans-serif;
    }
    .app-mhead-domain {
        color: #c8161d;
        font-size: 9px;
        font-weight: 700;
        letter-spacing: .9px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-family: 'SiyuanRouhei','PingFang SC','Microsoft YaHei',sans-serif;
    }

    .app-mhead-actions {
        display: flex;
        align-items: center;
        gap: 6px;
        margin-left: auto;
    }

    .app-mhead-cart,
    .app-mhead-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
        border-radius: 10px;
        text-decoration: none;
    }

    .app-mhead-cart {
        border: 1px solid #ffe0dc;
        background: #fff6f4;
        color: #e4393c;
    }

    .app-mhead-menu-btn {
        padding: 0;
        border: 1px solid #eef0f4;
        background: #fff;
        color: #5b6472;
        cursor: pointer;
        transition: background .18s ease, color .18s ease, border-color .18s ease;
    }

    .app-mhead-cart svg {
        display: block;
        width: 21px;
        height: 21px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.8;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .app-mhead-menu-btn svg {
        display: block;
        width: 19px;
        height: 19px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
        transition: transform .2s ease;
    }

    .app-mhead-menu-btn.on {
        border-color: #ffd9d5;
        background: #fff5f4;
        color: #e4393c;
    }

    .app-mhead-menu-btn.on svg {
        transform: rotate(180deg);
    }

    .app-mhead-search {
        order: 5;
        display: flex;
        flex: 0 0 100%;
        height: 38px;
        overflow: hidden;
        border: 1.5px solid #e4393c;
        border-radius: 7px;
        background: #fff;
    }

    .app-mhead-search input {
        flex: 1;
        min-width: 0;
        border: 0;
        outline: none;
        padding: 0 12px;
        background: transparent;
        color: #333;
        font-size: 16px;
        line-height: 36px;
    }

    .app-mhead-search input::placeholder {
        color: #a3acb9;
        font-size: 13px;
    }

    .app-mhead-search button {
        flex: 0 0 74px;
        border: 0;
        background: #e4393c;
        color: #fff;
        font-size: 14px;
        font-weight: 600;
    }

    .app-mhead-drop {
        position: absolute;
        top: 100%;
        right: 12px;
        z-index: 600;
        display: none;
        width: 262px;
        max-width: calc(100vw - 24px);
        max-height: calc(100vh - 190px);
        overflow-y: auto;
        padding: 10px;
        border: 1px solid #eef0f4;
        border-radius: 14px;
        background: #fff;
        box-shadow: 0 18px 40px rgba(15, 23, 42, .16);
    }

    .app-mhead-drop::before {
        content: "";
        position: absolute;
        top: -6px;
        right: 17px;
        width: 11px;
        height: 11px;
        background: #fff;
        border-left: 1px solid #eef0f4;
        border-top: 1px solid #eef0f4;
        transform: rotate(45deg);
    }

    .app-mhead-drop.open {
        display: block;
        animation: appMheadDown .18s ease-out;
    }

    @keyframes appMheadDown {
        from { opacity: .5; transform: translateY(-4px); }
        to { opacity: 1; transform: translateY(0); }
    }

    .app-mhead-drop-hd {
        display: flex;
        align-items: baseline;
        gap: 6px;
        padding: 2px 8px 7px;
    }

    .app-mhead-drop-hd b {
        color: #1f2937;
        font-size: 13px;
        font-weight: 700;
    }

    .app-mhead-drop-hd span {
        color: #a3acb9;
        font-size: 10px;
    }

    .app-mhead-link {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 8px;
        border-radius: 10px;
        color: inherit;
        text-decoration: none;
    }

    .app-mhead-link:active {
        background: #fff7f6;
    }

    .app-mhead-link + .app-mhead-link {
        border-top: 1px solid #f7f8fa;
        border-radius: 0;
    }

    .app-mhead-ico {
        display: flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 32px;
        width: 32px;
        height: 32px;
        border-radius: 9px;
        font-size: 12px;
        font-weight: 700;
        line-height: 1;
    }

    .app-mhead-ico.blue { background: #eef4ff; color: #3b82f6; }
    .app-mhead-ico.purple { background: #f5f3ff; color: #7c3aed; }
    .app-mhead-ico.teal { background: #ecfdf5; color: #0f9f8f; }
    .app-mhead-ico.red { background: #fff1f2; color: #e4393c; }
    .app-mhead-ico.amber { background: #fffbeb; color: #d97706; }
    .app-mhead-ico.pink { background: #fdf2f8; color: #db2777; }

    .app-mhead-txt {
        flex: 1;
        min-width: 0;
    }

    .app-mhead-txt b {
        display: block;
        color: #1f2937;
        font-size: 13px;
        font-weight: 600;
        line-height: 1.3;
    }

    .app-mhead-txt small {
        display: block;
        margin-top: 2px;
        color: #a3acb9;
        font-size: 10px;
        line-height: 1.4;
    }

    .app-mhead-link > i {
        color: #cbd5e1;
        font-style: normal;
        font-size: 18px;
        line-height: 1;
    }

    .svc-search-empty {
        display: none;
        margin: 14px 0;
        padding: 22px 16px;
        border-radius: 12px;
        background: #fff;
        color: #9aa3af;
        font-size: 13px;
        text-align: center;
    }
}

@media (max-width: 900px) {
    .app-mhead-link.on {
        background: #fff7f6;
    }

    .app-mhead-link.on .app-mhead-txt b {
        color: #e4393c;
    }

    .app-mhead-drop-foot {
        display: flex;
        gap: 8px;
        padding: 10px 8px 2px;
        margin-top: 6px;
        border-top: 1px solid #f2f4f7;
    }

    .app-mhead-drop-foot a {
        flex: 1;
        padding: 6px 4px;
        border-radius: 8px;
        background: #f8fafc;
        color: #6b7280;
        font-size: 11px;
        text-align: center;
        text-decoration: none;
    }

    .app-mhead-drop-foot a:active {
        background: #fff1f1;
        color: #e4393c;
    }
}

/* 后台配置图标（图片） */
.app-tabbar .app-tab-icon img {
    width: 22px;
    height: 22px;
    display: block;
    object-fit: contain;
    transition: transform .18s ease;
}

.app-tabbar .app-tab.is-active .app-tab-icon img {
    transform: translateY(-1px) scale(1.04);
}

.app-tabbar .app-tab-icon-mask {
    display: block;
    width: 22px;
    height: 22px;
    background: currentColor;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
    transition: transform .18s ease;
}

.app-tabbar .app-tab.is-active .app-tab-icon-mask {
    transform: translateY(-1px) scale(1.04);
}

/* 服务页：移动端复用商品页的固定布局，左右各自滚动 */
@media (max-width: 900px) {
    body.nm-services-page.has-app-tabbar {
        height: 100vh;
        height: 100dvh;
        overflow: hidden !important;
        padding-bottom: 0 !important;
        overscroll-behavior: none;
    }
    body.nm-services-page.has-app-tabbar .nm-list {
        position: fixed;
        top: var(--app-header-h, 136px);
        right: 0;
        bottom: 58px;
        left: 0;
        height: auto;
        margin: 0;
        padding: 0 8px 8px;
        align-items: stretch;
        overflow: visible;
    }
    body.nm-services-page.has-app-tabbar .nm-list-side,
    body.nm-services-page.has-app-tabbar .nm-list-main {
        height: 100%;
        min-height: 0;
        max-height: none;
        margin: 0;
        touch-action: pan-y;
        overscroll-behavior-y: contain;
        -webkit-overflow-scrolling: touch;
        overflow-y: auto;
    }
    body.nm-services-page.has-app-tabbar .nm-list-toolbar {
        position: sticky;
        top: 0;
        z-index: 20;
    }
}
