@charset "utf-8";
/* ==========================================================================
   mobile-pc.css  手机版整站在 PC 上的显示统一
   --------------------------------------------------------------------------
   手机端模板里有很多 position:fixed 的顶部栏 / 底部导航，它们的定位基准是
   浏览器窗口而不是页面容器，所以在 PC 上会被拉满整个屏幕宽度，加上部分页面
   没有 640px 的宽度限制，就会出现"内容在中间、底栏跑到两边、顶部错位"。

   这里的做法：
   1) PC 下（>640px）把 body 限宽 640px 并居中 —— 页面里所有普通元素都会跟着
      收进这条 640px 的列里；
   2) 再把 fixed 的顶栏 / 底栏也限宽 640px 并居中（left/right:0 + max-width +
      margin:auto 可以让 fixed 元素居中）；
   3) 页面外的区域给一层浅灰底 + 中间加淡投影，看起来像个手机屏。

   注意：只在 >=641px 生效，手机端完全不受影响。
   ========================================================================== */

@media screen and (min-width: 641px) {

    html {
        background: #eceff3 !important;
    }

    /* ---- 1. 页面主体：最宽 640px 居中 ---- */
    body {
        max-width: 640px;
        margin-left: auto !important;
        margin-right: auto !important;
        box-shadow: 0 0 30px rgba(0, 0, 0, 0.06);
        /* public 头部给 body 加的 flex 居中在 PC 下会把内容顶偏，改回普通块级 */
        display: block !important;
    }

    /* ---- 2. fixed 的顶部栏 / 底部栏一起居中 ---- */
    #header,
    #bottom,
    .navbar,
    .nav-header,
    .bottom-nav,
    .bottom-action-bar,
    .mtabbar {
        max-width: 640px;
        left: 0;
        right: 0;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    /* sticky 的顶栏：只限宽，不去动 left/right，避免影响吸顶逻辑 */
    .header,
    .cart-header,
    .lx-search-bar {
        max-width: 640px;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    /* ---- 3. 内容容器也统一 640px ---- */
    .container22,
    .container,
    .main-container,
    #app,
    .lx-page,
    .shopBody,
    .nctouch-home-block,
    .goods-search-list-nav {
        max-width: 640px;
        margin-left: auto;
        margin-right: auto;
    }

    /* ---- 4. 返回顶部按钮：贴住 640 列的右边缘 ---- */
    .back-to-top {
        right: calc(50% - 320px + 14px) !important;
    }

    /* ---- 5. 底部导航给页面留出的高度（和手机端一致） ---- */
    .mtab-spacer {
        width: 100%;
        height: 62px;
    }
}
