/* Page styles extracted from list.html. Keep after common.css and ui.css. */

        * { box-sizing: border-box; margin: 0; padding: 0; }

        body {
            font-family:var(--font-sans,-apple-system,BlinkMacSystemFont,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Arial,sans-serif);
            background: linear-gradient(180deg,#ffffff,#ffffff);
            color: #333;
        }

        .page {
            max-width: 480px;
            margin: 0 auto;
            background-color: #ffffff;
            border-radius: 24px 24px 0 0;
            /* overflow: hidden;  保持打开，sticky 才能工作 */
            padding-bottom: 16px;
        }

        /* 顶部搜索条 */
        .search-wrap {
            padding: 8px 10px 6px;
            background-color: #ffffff;
            position: sticky;
            top: 0;
            z-index: 20;
        }
        .search-row {
            display: flex;
            align-items: center;
        }
        .search-input-wrap {
            flex: 1;
            height: 36px;
            border-radius: 999px;
            background-color: #f5f5f5;
            display: flex;
            align-items: center;
            padding: 0 12px;
            position: relative;
        }
        /* 右侧放大镜：兼作搜索触发按钮 */
        .search-icon {
            position: absolute;
            right: 12px;
            top: 50%;
            transform: translateY(-50%);
            width: 17px;
            height: 17px;
            border-radius: 50%;
            border: 2px solid #bbb;
            cursor: pointer;
            z-index: 3;
        }
        .search-icon::after {
            content: '';
            position: absolute;
            width: 8px;
            height: 2px;
            border-radius: 999px;
            background-color: #bbb;
            right: -5px;
            bottom: -1px;
            transform: rotate(45deg);
        }
        .search-icon:active {
            transform: translateY(-50%) scale(.94);
        }

        .search-input-wrap input {
            border: none;
            background: transparent;
            outline: none;
            flex: 1;
            font-size: 14px;
            padding-left: 2px;
            padding-right: 30px;  /* 给右侧放大镜腾位置 */
        }

        /* 关键词胶囊：半透明灰底 + X，可点击清除 */
        .search-chip {
            position: absolute;
            left: 12px;
            top: 50%;
            transform: translateY(-50%);
            padding: 4px 10px;
            border-radius: 999px;
            background: rgba(0,0,0,.45);
            color: #fff;
            font-size: 13px;
            display: none;            /* 默认隐藏 */
            max-width: calc(100% - 54px);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            z-index: 1;
        }
        .search-chip-text {
            vertical-align: middle;
        }
        .search-chip-clear {
            margin-left: 4px;
            font-size: 15px;
            line-height: 1;
            cursor: pointer;
        }

        /* V12.27: list 顶部搜索不再使用文字按钮，点击右侧放大镜执行搜索。 */

        /* V12.27: list 页把搜索框迁移到公共顶部标题区，原搜索条只作为 DOM 容器兜底。 */
        body.list-header-search .search-wrap {
            display: none !important;
        }
        body.list-header-search #m-app-header .m-app-h-left {
            min-width: 44px;
        }
        body.list-header-search #m-app-header .m-app-h-right {
            min-width: 78px;
            gap: 5px;
        }
        body.list-header-search #m-app-header .m-app-h-title {
            display: flex;
            align-items: center;
            justify-content: center;
            min-width: 0;
            padding: 0 4px;
            overflow: visible;
            text-align: left;
        }
        body.list-header-search #m-app-header .m-app-h-title .search-row {
            width: 100%;
            min-width: 0;
            display: flex;
            align-items: center;
        }
        body.list-header-search #m-app-header .m-app-h-title .search-input-wrap {
            height: 34px;
            min-width: 0;
            background: #f6f6f8;
            box-shadow: inset 0 0 0 1px rgba(0,0,0,.04);
        }
        body.list-header-search #m-app-header .m-app-h-title .search-input-wrap input {
            font-size: 13px;
        }
        body.list-header-search #m-app-header .m-app-h-title .search-icon {
            right: 11px;
        }
        body.list-header-search #m-app-header .m-app-btn[data-act="search"] {
            display: none !important;
        }
        @media (max-width: 360px) {
            body.list-header-search #m-app-header .m-app-h-right {
                min-width: 72px;
            }
            body.list-header-search #m-app-header .m-app-h-title .search-input-wrap input {
                font-size: 12px;
            }
        }

        /* 顶部滑动大分类：只吸顶 */
        .top-cat-bar {
            background-color: #ffffff;
            padding: 8px 8px 10px;
            position: sticky;
            top: 50px;          /* 紧贴在搜索条下面，按实际高度微调 */
            z-index: 18;
        }
        .top-cat-scroll {
            display: flex;
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
            padding: 12px 10px;
            background-color: #ffffff;
            border-radius: 22px;
            box-shadow: 0 4px 10px rgba(0,0,0,0.06);
        }
        .top-cat-scroll::-webkit-scrollbar { display: none; }

        .top-cat-item {
            width: 60px;
            flex: 0 0 68px;
            margin-right: 8px;
            border-radius: 9px;
            text-align: center;
            padding: 5px 4px 0px;
            cursor: pointer;
        }
        .top-cat-item-active {
            border: 1px solid #ff6b81;
        }
        .top-cat-img {
            width: 52px;
            height: 52px;
            overflow: hidden;
            margin: 0 auto 3px;
            border-radius: 12px;
            background: #f7f7f7;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .top-cat-img img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        /* “全部商品” 的特殊底图 */
        .top-cat-all-img {
            background: linear-gradient(135deg,#ffe8f0,#ffd9e3);
            color: #ff4d7a;

            letter-spacing: 2px;
        }
        .top-cat-alltext {
            transform: scale(.8);

            width: 80%;
            padding-left: 2px;

        }

        /* 优化文本溢出规则，确保宽度100%继承父容器 */
        .top-cat-name {
            font-size: 11px;
            color: #333;
            white-space: nowrap; /* 强制不换行 */
            overflow: hidden; /* 溢出隐藏 */
            width: 100%; /* 宽度继承父容器的52px，必加！ */
            box-sizing: border-box; /* 防止padding撑开宽度 */
            display: inline-block; /* 确保宽度生效（行内元素默认不识别width） */
            text-align: center;
        }

        /* 红色“年度特卖大会” Banner（暂时隐藏） */
        .event-banner {
            height: 40px;
            background: #ff1f2c;
            display: flex;
            align-items: center;
            padding: 0 12px;
            color: #fff;
            font-size: 16px;
            font-weight: 700;
        }
        .event-banner-sub {
            margin-left: auto;
            font-size: 11px;
            font-weight: 400;
            opacity: .9;
        }

        /* 主体布局：左侧类目 + 右侧列表 */
        .list-layout {
            display: flex;
            align-items: flex-start;
            background-color: #f5f5f5;
        }

        /* 左侧竖向类目 */
        .sub-cat-bar {
            width: 54px;
            background-color: #f5f5f5;
            position: sticky;
            top: 172px;      /* 距离屏幕顶部的距离 */
            z-index: 5;
        }

        .sub-cat-scroll {
            display: flex;
            flex-direction: column;
            padding: 0 0 40px;              /* 底部加厚一点，最后一项不被裁掉 */
            overflow-y: auto;
            max-height: calc(100vh - 120px);
        }
        .sub-cat-scroll::-webkit-scrollbar { display: none; }

        .sub-cat-item {
            flex: 0 0 auto;
            padding: 10px 2px;
            font-size: 13px;
            text-align: center;
            color: #666;
            background-color: #f5f5f5;
            position: relative;
            cursor: pointer;
            line-height: 1.2;
        }
        .sub-cat-item + .sub-cat-item {
            margin-top: 4px;
        }
        .sub-cat-item-active {
            background-color: #ffffff;
            color: #00b47c;

        }
        .sub-cat-item-active::before {
            content: '';
            position: absolute;
            left: 0;
            top: 8px;
            bottom: 8px;
            width: 1.5px;
            background-color: #00b47c;
        }

        /* 右侧主体区域 */
        .list-main {
            flex: 1;
            background-color: #ffffff;
            padding: 6px 6px 12px;
        }

        /* 排序条 */
        .sort-bar {
            background-color: #ffffff;
            padding: 8px 2px 10px;
            display: flex;
            align-items: center;
            font-size: 14px;
            position: sticky;
            top: 172px;
            z-index: 6;
        }

        .sort-item {
            margin-right: 22px;
            cursor: pointer;
            color: #666;
            width: 33%;
            margin-left: 10px;
        }
        .sort-item-active {
            color: #ff4d4f;
        }
        .sort-item span.arrow {
            font-size: 10px;
            margin-left: 2px;
        }
        .sort-bar-right {
            margin-left: auto;
            display: flex;
            align-items: center;
            font-size: 14px;
            color: #999;
        }

        /* V12.21: 当顶部横向分类栏隐藏时，左侧分类栏和排序栏要同步上移。
           否则 list.html?cat_id=137 这类分类页会因为仍使用 172px top 而空出一截。 */
        body.list-no-topcat .sub-cat-bar,
        body.list-no-topcat .sort-bar {
            top: 50px;
        }
        body.list-no-topcat .sub-cat-scroll {
            max-height: calc(100vh - 50px);
        }
        .sort-filter {
            display: flex;
            align-items: center;
            margin-right: 6px;
            cursor: pointer;
        }
        .sort-filter-icon {
            width: 14px;
            height: 14px;
            border-radius: 3px;
            border: 1px solid #ccc;
            margin-left: 4px;
            position: relative;
        }
        .sort-filter-icon::before,
        .sort-filter-icon::after {
            content: '';
            position: absolute;
            left: 2px;
            right: 2px;
            height: 2px;
            background-color: #ccc;
            border-radius: 2px;
        }
        .sort-filter-icon::before { top: 3px; }
        .sort-filter-icon::after { bottom: 3px; }

        .sort-view-toggle { cursor: pointer; }
        .view-icon-grid {
            display: inline-block;
            width: 16px;
            height: 16px;
            position: relative;
        }
        .view-icon-grid::before,
        .view-icon-grid::after {
            content: '';
            position: absolute;
            left: 0;
            right: 0;
            border-top: 1px solid #ccc;
        }
        .view-icon-grid::before {
            top: 4px;
            box-shadow: 0 4px 0 #ccc, 0 8px 0 #ccc;
        }
        .view-icon-grid::after {
            top: 0;
            bottom: 0;
            left: auto;
            right: 1px;
            border-left: 2px solid #ccc;
            border-top: none;
        }

        /* 中间运营胶囊（暂隐藏） */
        .mid-tag-row {
            display: flex;
            gap: 10px;
            margin: 4px 0 6px;
        }
        .mid-tag {
            flex: 1;
            height: 36px;
            border-radius: 999px;
            background-color: #f5f5f5;
            font-size: 14px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #ff40a5;
            font-weight: 600;
        }
        .mid-tag-active {
            background-color: #fef0f6;
        }

        /* 商品列表 */
        .goods-list {
            padding: 6px 0px 16px;
            display: flex;
            flex-wrap: wrap;
            justify-content: space-between;
        }
        .goods-card {
            width: calc(50% - 3px);
            margin-top: 5px;
            margin-bottom: 10px;
            background-color: #ffffff;
            border-radius: 16px;
            box-shadow: none;
            overflow: hidden;
        }

        .goods-img-wrap {
            width: 100%;
            height: 0;
            padding-bottom: 100%;
            overflow: hidden;
            position: relative;
            border-radius: 12px;
        }
        .goods-img-wrap img {
            position: absolute;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .goods-title {
            padding: 8px 10px 0;
            font-size: 13px;
            line-height: 1.4;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 2;
            overflow: hidden;
            text-overflow: ellipsis;
            color: #1b1b1b;
        }

        .goods-tags-row {
            padding: 4px 10px 0;
            display: flex;
            align-items: center;
            gap: 6px;
            min-height: 26px;
        }
        .goods-tags-main {
            flex: 1;
            min-width: 0;
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            gap: 4px;
        }
        .goods-tag {
            border: 0;
            background: transparent;
            padding: 0 1px;
            font-weight: 400;
            font-size: 11px;
            color: #ff0777;
        }
        .goods-tags-row .sales{
            color: #00bfbf;
            border: 0;
        }

        .goods-price-row {
            padding: 6px 10px 0;
            display: flex;
            align-items: baseline;
            flex-wrap: wrap;
            gap: 3px;
        }
        .goods-price {
            font-size: 18px;
            color: #ff2244;
            font-weight: 700;
        }
        .goods-price span{
            font-size: 11px;
            color: #ff2244;
            line-height: 11px;font-family:var(--font-sans,-apple-system,BlinkMacSystemFont,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Arial,sans-serif);
        }
        .goods-price-label {
            font-size: 10px;
            color: #ff2244;
            line-height: 12px;
        }
        .goods-origin-price {
            font-size: 11px;
            color: #999;
            text-decoration: line-through;
        }
        .goods-discount {
            font-size: 11px;
            color: #ff2244;
        }

        .goods-sub-row {
            padding: 4px 10px 0;
        }
        .goods-sub-tip {
            font-size: 12px;
            color: #00b0a0;
        }

        .goods-bottom-row {
            padding: 6px 10px 10px;
            display: flex;
            align-items: center;
        }

        .goods-top-tag {
            font-size: 11px;
            padding: 2px 4px;
            border-radius: 4px;
            background-color: #ff0777;
            color: #FFFFFF;
            max-width: calc(100% - 40px);  /* 右边预留按钮宽度 */
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            line-height: 16px;
            height: 16px;
            margin-right: 5px;
        }

        /* 左侧标签，给右边按钮留点空间，避免挤在一起 */
        .goods-bottom-tag {
            font-size: 11px;
            padding: 0px 4px;
            border-radius: 999px;
            background-color: #ffe6c4;
            color: #8a3c00;
            max-width: calc(100% - 40px);  /* 右边预留按钮宽度 */
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        /* 右侧加购按钮：小圆、渐变、阴影 */
        .goods-cart-btn {
            margin-left: auto;              /* 顶到最右边 */
            width: 24px;
            height: 24px;
            border-radius: 999px;
            background: #FEEFF3;

            display: flex;                  /* 一定要是 flex，不要再是 none */
            align-items: center;
            justify-content: center;
            position: relative;
            cursor: pointer;
        }

        /* 中间用 + 号，干净一点，比 emoji 有质感 */
        .goods-cart-btn::before {
            content: '+';
            color: #ff0777;
            font-size: 18px;
            font-weight: 700;
            line-height: 1;


        }

        /* 点击有轻微缩放，手感好一点 */
        .goods-cart-btn:active {
            transform: scale(0.9);
            box-shadow: 0 2px 6px rgba(255,77,79,0.25);
        }

        /* V12.35 列表页底部购物车凑单提示条 */
        .cart-promo-bar {
            position: fixed;
            left: 0;
            right: 0;
            bottom: 0;
            z-index: 900;
            display: none;
            justify-content: center;
            padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
            background: rgba(255,255,255,.96);
            border-top: 1px solid rgba(245, 84, 132, .12);
            box-shadow: 0 -8px 26px rgba(18, 18, 18, .08);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            box-sizing: border-box;
        }
        body.has-cart-promo .cart-promo-bar {
            display: flex;
        }
        body.has-cart-promo #goodsList {
            padding-bottom: 92px;
        }
        .cart-promo-inner {
            width: 100%;
            max-width: 480px;
            display: flex;
            align-items: center;
            gap: 12px;
        }
        .cart-promo-info {
            flex: 1;
            min-width: 0;
        }
        .cart-promo-total {
            display: flex;
            align-items: baseline;
            gap: 3px;
            color: #222;
            font-size: 13px;
            line-height: 20px;
            white-space: nowrap;
        }
        .cart-promo-total em {
            color: #ff2f6d;
            font-style: normal;
            font-size: 20px;
            font-weight: 400;
            letter-spacing: 0;
        }
        .cart-promo-tip {
            margin-top: 1px;
            color: #8a8a8a;
            font-size: 12px;
            line-height: 17px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .cart-promo-tip strong {
            color: #ff2f6d;
            font-weight: 700;
        }
        .cart-promo-btn {
            border: 0;
            height: 48px;
            min-width: 142px;
            padding: 0 20px;
            border-radius: 8px;
            background: linear-gradient(135deg, #ff4b8a 0%, #ff1f64 100%);
            color: #fff;
            font-size: 16px;
            font-weight: 800;
            box-shadow: 0 8px 18px rgba(255, 47, 109, .24);
            cursor: pointer;
            flex: 0 0 auto;
        }
        .cart-promo-btn:active {
            transform: scale(.98);
            box-shadow: 0 4px 12px rgba(255, 47, 109, .2);
        }







        /* V12.33 列表页快速加购规格弹层 */
        .quick-spec-mask {
            position: fixed;
            left: 0;
            right: 0;
            top: 0;
            bottom: 0;
            z-index: 100000;
            background: rgba(0,0,0,.42);
            display: none;
            align-items: flex-end;
            justify-content: center;
        }
        body.quick-spec-open {
            overflow: hidden;
        }
        .quick-spec-sheet {
            width: 100%;
            max-width: 480px;
            max-height: 82vh;
            background: #fff;
            border-radius: 22px 22px 0 0;
            box-shadow: 0 -10px 30px rgba(0,0,0,.16);
            overflow: hidden;
            animation: quickSpecUp .18s ease-out;
        }
        @keyframes quickSpecUp {
            from { transform: translateY(24px); opacity: .5; }
            to { transform: translateY(0); opacity: 1; }
        }
        .quick-spec-head {
            display: flex;
            gap: 12px;
            padding: 16px 16px 12px;
            position: relative;
            border-bottom: 1px solid #f5f5f5;
        }
        .quick-spec-img {
            width: 76px;
            height: 76px;
            border-radius: 14px;
            background: #f7f7f7;
            object-fit: cover;
            flex: 0 0 76px;
        }
        .quick-spec-info {
            min-width: 0;
            flex: 1;
            padding-right: 22px;
        }
        .quick-spec-title {
            font-size: 14px;
            color: #222;
            line-height: 1.35;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
            min-height: 38px;
        }
        .quick-spec-price {
            margin-top: 8px;
            font-size: 19px;
            color: #ff2244;
            font-weight: 800;
        }
        .quick-spec-stock {
            margin-top: 2px;
            font-size: 12px;
            color: #999;
        }
        .quick-spec-close {
            position: absolute;
            right: 12px;
            top: 10px;
            width: 28px;
            height: 28px;
            border-radius: 999px;
            border: 0;
            background: #f6f6f6;
            color: #666;
            font-size: 20px;
            line-height: 28px;
            cursor: pointer;
        }
        .quick-spec-body {
            padding: 4px 16px 14px;
            max-height: calc(82vh - 214px);
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
        }
        .quick-spec-group {
            padding: 12px 0 4px;
        }
        .quick-spec-group-title {
            font-size: 13px;
            color: #333;
            font-weight: 700;
            margin-bottom: 9px;
        }
        .quick-spec-options {
            display: flex;
            flex-wrap: wrap;
            gap: 9px;
        }
        .quick-spec-option {
            border: 1px solid #eeeeee;
            background: #f8f8f8;
            color: #333;
            border-radius: 999px;
            padding: 7px 12px;
            font-size: 13px;
            line-height: 1;
            cursor: pointer;
        }
        .quick-spec-option-active {
            border-color: #ff4d7a;
            background: #fff1f5;
            color: #ff1f63;
            font-weight: 700;
        }
        .quick-spec-picked {
            padding: 6px 0 2px;
            font-size: 12px;
            color: #999;
            line-height: 1.5;
        }
        .quick-spec-foot {
            padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
            border-top: 1px solid #f2f2f2;
            background: #fff;
        }
        .quick-spec-qty-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 12px;
        }
        .quick-spec-qty-title {
            font-size: 14px;
            color: #333;
            font-weight: 700;
        }
        .quick-spec-qty-box {
            display: flex;
            align-items: center;
            background: #f6f6f6;
            border-radius: 999px;
            overflow: hidden;
        }
        .quick-spec-qty-btn {
            width: 34px;
            height: 30px;
            border: 0;
            background: transparent;
            font-size: 18px;
            color: #555;
            cursor: pointer;
        }
        .quick-spec-qty-num {
            min-width: 34px;
            text-align: center;
            font-size: 14px;
            color: #222;
        }
        .quick-spec-submit {
            width: 100%;
            height: 42px;
            border: 0;
            border-radius: 999px;
            background: linear-gradient(135deg,#ff4d7a,#ff1f63);
            color: #fff;
            font-size: 15px;
            font-weight: 800;
            cursor: pointer;
        }
        .quick-spec-submit-disabled {
            background: #ddd;
            color: #999;
        }

        .loading-tip,
        .nomore-tip {
            text-align: center;
            font-size: 12px;
            color: #999;
            padding: 8px 0 4px;
        }
        .empty-tip {
            padding: 40px 0;
            text-align: center;
            font-size: 13px;
            color: #999;
        }

        /* ===== 仅用于“视图切换”的补充样式：不改动原有网格样式 ===== */
        #goodsList.view-list{display:block !important;}
        #goodsList.view-list .goods-card{
            width:100% !important;
            display:flex !important;
            gap:10px;
            padding:10px !important;
            margin:0 0 10px 0 !important;
            border-radius:12px;
        }
        #goodsList.view-list .goods-img-wrap{
            width:96px !important;
            height:96px !important;
            padding-bottom:0 !important;
            flex:0 0 96px !important;
            border-radius:12px;
            overflow:hidden;
        }
        #goodsList.view-list .goods-img-wrap img{
            position:absolute !important;
            inset:0 !important;
            width:100% !important;
            height:100% !important;
            object-fit:cover !important;
        }
        #goodsList.view-list .goods-info{flex:1; padding:0 !important;}
        #goodsList.view-list .goods-cart-btn{right:12px !important; bottom:12px !important;}

/* ===== V12.111 列表页颜色保留，版式回到原始 mobile_2026-6-12 风格 =====
   说明：只处理颜色，不覆盖卡片圆角、间距、阴影、背景、布局宽度等整体样式。 */
:root{
    --list-brand:var(--color-brand,#f10180);
    --list-brand-2:var(--color-brand-2,#ff4fa3);
    --list-brand-soft:var(--color-brand-soft,#fff3f8);
}
.sub-cat-item-active{
    color:var(--list-brand)!important;
}
.sub-cat-item-active::before{
    background-color:var(--list-brand)!important;
}
.sort-item-active,
.sort-filter:active,
.sort-view-toggle:active{
    color:var(--list-brand)!important;
}
.goods-tag,
.goods-price,
.goods-price span,
.goods-price-label,
.goods-discount,
.goods-cart-btn::before,
.quick-spec-price{
    color:var(--list-brand)!important;
}
.goods-tags-row .sales,
.goods-sub-tip{
    color:#999!important;
}
.goods-top-tag{
    background-color:var(--list-brand)!important;
}
.quick-spec-option-active{
    border-color:rgba(241,1,128,.30)!important;
    background:var(--list-brand-soft)!important;
    color:var(--list-brand)!important;
}
.quick-spec-submit{
    background:linear-gradient(135deg,var(--list-brand),var(--list-brand-2))!important;
}

