        /* ========== 全局重置 ========== */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            -webkit-tap-highlight-color: transparent;
        }
        html, body {
            height: 100%;
            overflow: hidden;
        }
        body {
            font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
            background: #f3f4f6;
            color: #333;
            font-size: 14px;
            line-height: 1.5;
        }
        a { text-decoration: none; color: inherit; }
        ul, li { list-style: none; }
        img { display: block; max-width: 100%; }

        /* ========== 整体容器（PC 居中、移动端全宽） ========== */
        /* 占满一屏：顶栏下区域与底栏分离，避免整页滚动导致侧栏跟着走 */
        .app-wrap {
            position: relative;
            width: 100%;
            max-width: 480px;
            height: 100%;
            min-height: 100%;
            margin: 0 auto;
            background: #fff;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            box-sizing: border-box;
        }
        @media (min-width: 768px) {
            body { background: #e9eaee; }
            .app-wrap {
                box-shadow: 0 0 16px rgba(0, 0, 0, 0.08);
            }
            /* PC 端侧栏加宽，避免分类名竖排成单字 */
            .cat-side {
                width: 122px;
            }
            .cat-side .cat-item {
                padding: 14px 10px;
                font-size: 14px;
            }
        }

        /* 左分类固定高度内单独滚动（分类多时），右侧礼包列表独立滚动 */
        .shop-layout {
            flex: 1;
            display: flex;
            align-items: stretch;
            min-height: 0;
            overflow: hidden;
        }
        .cat-side {
            width: 90px;
            flex-shrink: 0;
            background: #f5f6f8;
            border-right: 1px solid #ececec;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
            min-height: 0;
            overscroll-behavior: contain;
        }
        .cat-side::-webkit-scrollbar { width: 0; }
        .cat-side .cat-item {
            display: block;
            text-align: center;
            padding: 18px 6px;
            font-size: 13px;
            color: #333;
            font-weight: 500;
            position: relative;
            cursor: pointer;
            transition: all .2s;
            line-height: 1.35;
            /* 避免窄栏下被 break-all 拆成「一字一行」 */
            word-break: keep-all;
            overflow-wrap: break-word;
            writing-mode: horizontal-tb;
        }
        .cat-side .cat-item.active {
            background: #fff;
            color: #ff4d4f;
            font-weight: 600;
        }
        .cat-side .cat-item.active::before {
            content: "";
            position: absolute;
            left: 0;
            top: 50%;
            transform: translateY(-50%);
            height: 24px;
            width: 3px;
            background: #ff4d4f;
            border-radius: 0 2px 2px 0;
        }

        /* ========== 右侧主区域（仅此处纵向滚动） ========== */
        .goods-main {
            flex: 1;
            min-width: 0;
            min-height: 0;
            overflow-x: hidden;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
            background: #fff;
            display: flex;
            flex-direction: column;
            overscroll-behavior: contain;
            /* 避让固定底栏 Tab */
            padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px) + 12px);
        }

        /* 商品列表：两列紧凑卡片 */
        .goods-list {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 10px;
            padding: 10px 10px;
            align-content: start;
        }
        .goods-list-msg {
            grid-column: 1 / -1;
            padding: 40px 0;
            text-align: center;
            font-size: 13px;
        }
        .goods-list-msg.err { color: #f5222d; }
        .goods-list-msg.muted { color: #bbb; }
        .goods-item {
            display: flex;
            flex-direction: column;
            align-items: stretch;
            background: #f5f6f8;
            border: 1px solid #f0f0f0;
            border-radius: 10px;
            overflow: hidden;
            box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
        }
        .goods-img {
            width: 100%;
            aspect-ratio: 1;
            max-height: 120px;
            border-radius: 0;
            flex-shrink: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #fff;
            font-size: 26px;
            font-weight: 700;
            background: var(--shop-btn-gradient, linear-gradient(135deg, #ff7875, #ff4d4f));
            box-shadow: none;
            overflow: hidden;
        }
        .goods-img.goods-img-photo {
            padding: 0;
            background: #f0f0f0;
        }
        .goods-img.goods-img-photo img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }
        .goods-meta {
            flex: 1;
            display: flex;
            flex-direction: column;
            min-height: 0;
            padding: 8px 8px 10px;
        }
        .goods-name {
            font-size: 13px;
            font-weight: 700;
            color: #222;
            line-height: 1.35;
            overflow: hidden;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 2;
            line-clamp: 2;
            word-break: break-word;
            flex-shrink: 0;
            margin-top: 0;
        }
        .goods-buy-limit {
            font-size: 11px;
            color: #ff4d4f;
            font-weight: 600;
            line-height: 1.3;
            margin-top: 2px;
            flex-shrink: 0;
        }
        .goods-buy-limit + .goods-desc {
            margin-top: 4px;
        }
        .goods-desc {
            font-size: 11px;
            color: #999;
            margin-top: 6px;
            line-height: 1.42;
            overflow: hidden;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 2;
            line-clamp: 2;
            word-break: break-word;
            flex: 1;
        }
        .goods-footer {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 6px;
            margin-top: 10px;
            flex-shrink: 0;
        }
        .goods-footer .price {
            font-size: 13px;
            color: #ff4d4f;
            font-weight: 700;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            min-width: 0;
        }
        .goods-footer .price .plat-suffix {
            font-size: 11px;
            font-weight: 600;
            margin-left: 1px;
        } /* 价格后缀「平台币」，与数字同一行 */
        .goods-footer .buy-btn {
            padding: 3px 10px;
            border: 1px solid #ff4d4f;
            background: #fff;
            color: #ff4d4f;
            border-radius: 12px;
            font-size: 11px;
            cursor: pointer;
            transition: all .15s;
            flex-shrink: 0;
        }
        .goods-footer .buy-btn:hover,
        .goods-footer .buy-btn:active {
            background: #ff4d4f;
            color: #fff;
        }

        /* ========== 购买详情弹窗 ========== */
        .layui-layer.buy-layer {
            border-radius: 14px !important;
            background: #fff !important;
            box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
        }
        .layui-layer.buy-layer .layui-layer-content {
            background: #fff;
            border-radius: 14px;
        }
        .buy-dialog {
            position: relative;
            padding: 0 0 16px;
            background: #fff;
            border-radius: 14px;
            overflow: hidden;
        }
        .buy-dialog .bd-close {
            position: absolute;
            top: 10px;
            right: 10px;
            width: 28px;
            height: 28px;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.85);
            color: #555;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all .2s;
            z-index: 3;
        }
        .buy-dialog .bd-close:hover {
            background: #fff;
            color: #222;
        }
        .buy-dialog .bd-cover {
            height: 120px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #fff;
            font-size: 36px;
            font-weight: 700;
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
            overflow: hidden;
        }
        .buy-dialog .bd-cover.bd-cover-photo {
            padding: 0;
            background: #f0f0f0;
        }
        .buy-dialog .bd-cover.bd-cover-photo img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }
        .buy-dialog .bd-body {
            padding: 14px 18px 0;
        }
        .buy-dialog .bd-body > .bd-section.bd-ship:first-child {
            margin-top: 0;
            padding-top: 0;
            border-top: none;
        }
        /* 发货说明：标题=商品名，正文=介绍；下方仍为发放角色 */
        .buy-dialog .bd-ship > .h {
            font-size: 18px;
            font-weight: 700;
            color: #222;
            margin-bottom: 10px;
        }
        .buy-dialog .bd-ship > .h + .goods-buy-limit {
            margin-top: -6px;
            margin-bottom: 8px;
            font-size: 13px;
        }
        .buy-dialog .bd-ship .bd-gift-intro {
            font-weight: 400;
            line-height: 1.65;
            color: #555;
            margin-bottom: 12px;
        }
        .buy-dialog .bd-ship-sub {
            font-size: 13px;
            font-weight: 600;
            color: #333;
            margin-bottom: 6px;
        }
        .buy-dialog .bd-ship .bd-ship-target-inner {
            font-weight: 600;
            line-height: 1.5;
            color: #555;
        }
        .buy-dialog .bd-ship .bd-ship-lab {
            color: #ff4d4f;
        }
        .buy-dialog .bd-ship .bd-ship-val {
            color: #1890ff;
        }
        .buy-dialog .bd-ship .bd-ship-warn {
            color: #ff4d4f;
            font-weight: 600;
        }
        /* 发放目标：两行展示 */
        .buy-dialog .bd-ship .bd-ship-line {
            font-size: 13px;
            line-height: 1.6;
        }
        .buy-dialog .bd-ship .bd-ship-line + .bd-ship-line {
            margin-top: 4px;
        }
        .buy-dialog .bd-section {
            margin-top: 14px;
            padding-top: 14px;
            border-top: 1px dashed #eee;
        }
        .buy-dialog .bd-section .h {
            font-size: 14px;
            font-weight: 600;
            color: #222;
            margin-bottom: 8px;
        }
        .buy-dialog .bd-desc {
            font-size: 13px;
            color: #555;
            line-height: 1.7;
            white-space: pre-wrap;
        }
        .buy-dialog .bd-include {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 8px;
        }
        .buy-dialog .bd-include .it {
            background: #fafafa;
            border: 1px solid #f0f0f0;
            border-radius: 8px;
            padding: 8px 4px;
            text-align: center;
            font-size: 12px;
            color: #555;
        }
        .buy-dialog .bd-include .it .n {
            display: block;
            font-size: 14px;
            font-weight: 700;
            color: #ff4d4f;
            margin-bottom: 2px;
        }
        .buy-dialog .bd-include .it .t {
            display: block;
            font-size: 12px;
            color: #888;
            line-height: 1.35;
        }

        .buy-dialog .bd-footer {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 14px 18px 0;
            margin-top: 14px;
            border-top: 1px solid #f0f0f0;
        }
        .buy-dialog .bd-price {
            display: flex;
            align-items: baseline;
        }
        .buy-dialog .bd-price .now {
            font-size: 22px;
            font-weight: 700;
            color: #ff4d4f;
        }
        .buy-dialog .bd-price .now .plat-suffix {
            font-size: 13px;
            font-weight: 700;
            margin-left: 2px;
        }
        .buy-dialog .bd-price .old {
            margin-left: 8px;
            font-size: 13px;
            color: #aaa;
            text-decoration: line-through;
        }
        .buy-dialog .bd-confirm {
            padding: 10px 28px;
            background: var(--shop-btn-gradient, linear-gradient(135deg, #ff7875, #ff4d4f));
            color: #fff;
            border: none;
            border-radius: 22px;
            font-size: 15px;
            font-weight: 600;
            cursor: pointer;
            box-shadow: var(--shop-btn-shadow, 0 4px 10px rgba(255, 77, 79, 0.3));
            transition: all .15s;
        }
        .buy-dialog .bd-confirm:active { transform: scale(0.97); }
        .buy-dialog .bd-confirm.is-loading { opacity: 0.7; pointer-events: none; }

        /* 小屏微调 */
        @media (max-width: 360px) {
            .cat-side { width: 86px; }
            .goods-list {
                gap: 8px;
                padding: 8px;
            }
            .goods-img { font-size: 22px; }
        }
