/* ============================
   刚刚好 · Mobile UI v2
   排版优先：字号层级 / 触控区 / 信息密度
   叠在 app.css 之上，不改业务逻辑
   ============================ */

:root {
    --ink: #14120f;
    --ink-soft: #3f3a34;
    --muted: #7a746c;
    --line: rgba(20, 18, 15, 0.08);
    --line-strong: rgba(20, 18, 15, 0.14);
    --paper: #f4f2ee;
    --paper-2: #ebe8e2;
    --surface: #ffffff;
    --accent: #c2410c;
    --accent-2: #ea580c;
    --ok: #0f766e;
    --danger: #be123c;
    --primary: #1c1917;
    --primary-light: #44403c;
    --primary-dark: #0c0a09;
    --primary-gradient: linear-gradient(135deg, #1c1917 0%, #292524 55%, #44403c 100%);
    --bg: var(--paper);
    --bg-elevated: var(--surface);
    --bg-card: var(--surface);
    --text-primary: var(--ink);
    --text-secondary: var(--ink-soft);
    --text-tertiary: var(--muted);
    --border: var(--line);
    --border-strong: var(--line-strong);
    --shadow-sm: 0 1px 0 rgba(20, 18, 15, 0.04);
    --shadow-md: 0 10px 28px rgba(20, 18, 15, 0.08);
    --shadow-lg: 0 20px 48px rgba(20, 18, 15, 0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --header-height: 56px;
    --tabbar-height: 64px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --space: 16px;
    --touch: 44px;
}

/* ---------- 页面氛围：纸感，非纯色平铺 ---------- */
body.app-body,
body.auth-page,
body.pay-page {
    color: var(--ink);
    background: var(--paper) !important;
}
body.app-body::before,
body.auth-page::before,
body.pay-page::before {
    background:
        radial-gradient(900px 480px at 0% -10%, rgba(234, 88, 12, 0.07), transparent 55%),
        radial-gradient(700px 420px at 100% 0%, rgba(28, 25, 23, 0.05), transparent 50%),
        linear-gradient(180deg, #f7f5f1 0%, #f1efe9 40%, #ebe8e2 100%) !important;
}
body.app-body::after,
body.auth-page::after,
body.pay-page::after {
    opacity: 0.35 !important;
    background-image:
        repeating-linear-gradient(
            -12deg,
            transparent,
            transparent 11px,
            rgba(20, 18, 15, 0.015) 11px,
            rgba(20, 18, 15, 0.015) 12px
        ) !important;
    background-size: auto !important;
}

.app-main {
    padding-bottom: calc(var(--tabbar-height) + env(safe-area-inset-bottom, 0px) + 12px);
}

/* ---------- 顶栏：左品牌 / 右操作，移动端更扁 ---------- */
.app-header {
    height: var(--header-height);
    background: rgba(244, 242, 238, 0.88) !important;
    border-bottom: 1px solid var(--line) !important;
    box-shadow: none !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.app-header-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 var(--space) !important;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.app-logo { gap: 8px !important; min-width: 0; }
.app-logo-text {
    font-size: 15px !important;
    font-weight: 750 !important;
    letter-spacing: -0.04em;
    color: var(--ink) !important;
    background: none !important;
    -webkit-text-fill-color: var(--ink) !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 42vw;
}
.app-logo-dot {
    width: 9px !important; height: 9px !important;
    background: var(--accent-2) !important;
    box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.18) !important;
}
.app-header-right { gap: 6px !important; flex-shrink: 0; }
.header-cart-btn {
    width: 40px !important;
    height: 40px !important;
    border-radius: 12px !important;
    background: var(--surface) !important;
    border: 1px solid var(--line) !important;
    font-size: 0 !important;
    color: var(--ink-soft);
    position: relative;
}
.header-cart-btn::before {
    content: '';
    width: 18px; height: 18px;
    display: block;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='21' r='1'/%3E%3Ccircle cx='20' cy='21' r='1'/%3E%3Cpath d='M1 1h4l2.7 12.4a2 2 0 0 0 2 1.6h9.7a2 2 0 0 0 2-1.6L23 6H6'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='21' r='1'/%3E%3Ccircle cx='20' cy='21' r='1'/%3E%3Cpath d='M1 1h4l2.7 12.4a2 2 0 0 0 2 1.6h9.7a2 2 0 0 0 2-1.6L23 6H6'/%3E%3C/svg%3E") center / contain no-repeat;
}
.header-cart-btn:hover { color: var(--ink); border-color: var(--line-strong) !important; }
.cart-badge {
    background: var(--accent) !important;
    border: 2px solid var(--paper) !important;
    font-weight: 700 !important;
}
.header-balance {
    border-radius: 12px !important;
    padding: 8px 12px !important;
    background: var(--surface) !important;
    border: 1px solid var(--line) !important;
}
.header-balance:hover { box-shadow: none !important; }
.balance-icon { display: none; }
.balance-text {
    color: var(--ink) !important;
    font-size: 13px !important;
    font-weight: 750 !important;
    font-variant-numeric: tabular-nums;
}
.header-avatar {
    width: 36px !important; height: 36px !important;
    border: 0 !important;
    box-shadow: inset 0 0 0 1px var(--line) !important;
    background: #ddd6ce !important;
    color: var(--ink) !important;
    font-weight: 700 !important;
}
.header-login-btn,
.header-logout-btn {
    border-radius: 12px !important;
    font-weight: 700 !important;
    min-height: 40px;
}
.header-login-btn {
    padding: 0 16px !important;
    background: var(--ink) !important;
    color: #fff !important;
    box-shadow: none !important;
}
.header-login-btn:hover { filter: brightness(1.08); box-shadow: none !important; }

/* ---------- 底栏：等高五栏，弱化悬浮中心 ---------- */
.app-tabbar {
    height: calc(var(--tabbar-height) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(255, 255, 255, 0.94) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--line) !important;
    box-shadow: 0 -1px 0 rgba(20, 18, 15, 0.03) !important;
}
.tab-item {
    gap: 3px !important;
    color: var(--muted) !important;
    padding-top: 8px !important;
}
.tab-item.active {
    color: var(--ink) !important;
}
.tab-item.active .tab-label {
    font-weight: 750 !important;
}
.tab-icon {
    font-size: 0 !important;
    width: 22px; height: 22px;
    filter: none !important;
    opacity: 0.7;
    background: currentColor;
    -webkit-mask-position: center; -webkit-mask-repeat: no-repeat; -webkit-mask-size: contain;
    mask-position: center; mask-repeat: no-repeat; mask-size: contain;
}
.tab-item.active .tab-icon { opacity: 1; color: var(--ink); transform: none !important; }
.tab-icon--home {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 10.5 12 3l9 7.5'/%3E%3Cpath d='M5 9.5V21h14V9.5'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 10.5 12 3l9 7.5'/%3E%3Cpath d='M5 9.5V21h14V9.5'/%3E%3C/svg%3E");
}
.tab-icon--orders {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01'/%3E%3C/svg%3E");
}
.tab-icon--cart {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='21' r='1'/%3E%3Ccircle cx='20' cy='21' r='1'/%3E%3Cpath d='M1 1h4l2.7 12.4a2 2 0 0 0 2 1.6h9.7a2 2 0 0 0 2-1.6L23 6H6'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='21' r='1'/%3E%3Ccircle cx='20' cy='21' r='1'/%3E%3Cpath d='M1 1h4l2.7 12.4a2 2 0 0 0 2 1.6h9.7a2 2 0 0 0 2-1.6L23 6H6'/%3E%3C/svg%3E");
}
.tab-icon--user {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21a8 8 0 0 0-16 0'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21a8 8 0 0 0-16 0'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E");
}
.tab-center { margin-top: 0 !important; }
.tab-center-btn {
    width: 40px !important; height: 40px !important;
    border-radius: 12px !important;
    border: 0 !important;
    background: var(--ink) !important;
    box-shadow: none !important;
}
.tab-center-icon {
    font-size: 0 !important;
    width: 18px; height: 18px;
    background: #fff;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='7' rx='1.5'/%3E%3Crect x='14' y='3' width='7' height='7' rx='1.5'/%3E%3Crect x='3' y='14' width='7' height='7' rx='1.5'/%3E%3Cpath d='M17.5 14v7M14 17.5h7'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='7' rx='1.5'/%3E%3Crect x='14' y='3' width='7' height='7' rx='1.5'/%3E%3Crect x='3' y='14' width='7' height='7' rx='1.5'/%3E%3Cpath d='M17.5 14v7M14 17.5h7'/%3E%3C/svg%3E") center / contain no-repeat;
}
.tab-label { font-size: 10px !important; font-weight: 600 !important; letter-spacing: 0.04em; }
.tab-center-label { margin-top: 2px; }

/* ---------- 按钮 ---------- */
.btn {
    border-radius: 12px !important;
    font-weight: 700 !important;
    transition: transform .18s var(--ease), background .18s, border-color .18s !important;
}
.btn-primary {
    background: var(--ink) !important;
    border-color: var(--ink) !important;
    color: #fff !important;
}
.btn-default {
    background: var(--surface) !important;
    border: 1px solid var(--line-strong) !important;
    color: var(--ink) !important;
}
.btn-xs {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0 12px; min-height: 32px; font-size: 12px;
    border-radius: 10px !important;
}
.btn-primary-gradient,
.btn-submit {
    display: inline-flex; align-items: center; justify-content: center;
    width: 100%; min-height: 50px; padding: 12px 20px;
    border: none; border-radius: 14px !important;
    background: var(--primary-gradient) !important; color: #fff !important;
    font-size: 15px; font-weight: 750; cursor: pointer;
    box-shadow: none;
    letter-spacing: 0.04em;
}
.btn-primary-gradient:hover,
.btn-submit:hover { filter: brightness(1.06); transform: none; }

.tag {
    display: inline-flex; align-items: center; padding: 2px 8px;
    border-radius: 6px; font-size: 11px; font-weight: 700; line-height: 1.5;
    letter-spacing: 0.02em;
}
.tag-orange, .badge-warning { background: #fff7ed; color: #c2410c; }
.tag-green, .badge-success { background: #ecfdf5; color: #047857; }
.tag-gray, .badge-muted { background: #f5f5f4; color: #57534e; }
.tag-red, .badge-danger { background: #fff1f2; color: #be123c; }

/* ---------- 商城：桌面侧栏 + 网格 ---------- */
.mall-layout {
    max-width: 1180px; margin: 0 auto; padding: 18px var(--space) 28px !important;
}
.mall-sidebar {
    background: var(--surface) !important;
    border: 1px solid var(--line) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: none !important;
    padding: 14px !important;
    position: sticky; top: calc(var(--header-height) + 12px);
}
.mall-sidebar h3 {
    font-size: 11px !important; font-weight: 750 !important;
    color: var(--muted) !important; letter-spacing: 0.12em;
    text-transform: uppercase; margin-bottom: 10px !important;
}
.cat-list a {
    border-radius: 10px !important; padding: 10px 12px !important;
    font-weight: 600 !important;
}
.cat-list a.active {
    background: #f5f5f4 !important; color: var(--ink) !important;
    box-shadow: inset 3px 0 0 var(--accent-2);
}
.mall-search-form {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
}
.mall-search-form .mall-search-input { flex: 1; min-width: 160px; }
.mall-search-input {
    min-height: 44px !important; border-radius: 12px !important;
    border: 1px solid var(--line-strong) !important;
    background: var(--surface) !important; padding: 0 14px !important;
    font-size: 15px !important;
}
.mall-search-input:focus {
    border-color: var(--ink) !important;
    box-shadow: 0 0 0 3px rgba(28, 25, 23, 0.08) !important;
    outline: none;
}
.filter-sort { gap: 6px !important; }
.filter-sort a {
    border-radius: 999px !important; padding: 8px 14px !important;
    font-weight: 650 !important; color: var(--ink-soft) !important;
    background: transparent; border: 1px solid transparent;
}
.filter-sort a.active {
    background: var(--ink) !important; color: #fff !important;
    border-color: var(--ink) !important;
}

.products-grid {
    gap: 14px !important;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)) !important;
}
.product-card {
    background: var(--surface) !important;
    border: 1px solid var(--line) !important;
    border-radius: 14px !important;
    box-shadow: none !important;
    overflow: hidden;
    transition: border-color .2s, transform .2s var(--ease) !important;
}
.product-card:hover {
    transform: translateY(-2px) !important;
    box-shadow: var(--shadow-md) !important;
    border-color: var(--line-strong) !important;
}
.product-card .cover {
    aspect-ratio: 1 / 1 !important;
    background: #e7e5e4;
}
.product-card .cover .tag-top {
    background: var(--ink) !important;
    color: #fff !important;
    border-radius: 6px !important;
    font-weight: 700 !important;
}
.product-card .cover-ph {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(145deg, #f5f5f4, #e7e5e4);
    color: var(--muted); font-family: var(--font-display);
    font-size: 12px; font-weight: 700; letter-spacing: 0.08em;
}
.product-card .info { padding: 12px 13px 14px !important; }
.product-card .info .title {
    min-height: 40px !important; font-size: 14px !important;
    font-weight: 700 !important; margin-bottom: 6px !important;
    color: var(--ink) !important; letter-spacing: -0.01em;
}
.product-card .info .meta {
    margin-bottom: 8px !important; font-size: 12px !important; color: var(--muted) !important;
}
.product-card .info .price {
    font-size: 20px !important; color: var(--accent) !important;
    font-family: var(--font-display); font-weight: 800;
    font-variant-numeric: tabular-nums;
}
.product-card .info .price .unit { font-size: 12px; color: var(--muted); font-weight: 600; }
.product-card .card-buy { margin-top: 10px !important; gap: 8px !important; }
.product-card .card-qty {
    height: 36px !important; border-radius: 10px !important;
    border-color: var(--line-strong) !important; background: #fafaf9 !important;
}
.product-card .card-qty-btn { height: 36px !important; }
.product-card .card-qty-val { height: 36px !important; }
.product-card .btn-card-cart {
    width: 40px !important; height: 40px !important;
    border-radius: 12px !important;
    background: #f5f5f4 !important;
    border: 1px solid var(--line) !important;
    color: var(--ink) !important;
}
.product-card .btn-card-pay {
    height: 40px !important; border-radius: 12px !important;
    background: var(--ink) !important; color: #fff !important;
    box-shadow: none !important; font-weight: 750 !important;
}

.mall-empty {
    background: var(--surface); border: 1px dashed var(--line-strong);
    border-radius: var(--radius-lg); padding: 56px 24px;
    text-align: center; color: var(--muted);
}
.mall-empty__title { font-size: 15px; font-weight: 700; color: var(--ink-soft); margin-bottom: 6px; }

/* ---------- 详情 ---------- */
.product-detail {
    max-width: 1100px; margin: 0 auto; padding: 14px var(--space) 32px;
}
.product-gallery, .product-info {
    background: var(--surface) !important;
    border: 1px solid var(--line) !important;
    border-radius: 16px !important;
    box-shadow: none !important;
}
.product-info .title {
    font-size: 22px !important; font-weight: 800 !important;
    letter-spacing: -0.03em; line-height: 1.3;
}
.product-info .price-box {
    border-radius: 12px !important;
    background: #fff7ed !important;
    border: 1px solid #ffedd5 !important;
}
.product-info .price-box .price { color: var(--accent) !important; }
.pay-mode-card, .tpl-src-card {
    display: block; padding: 14px;
    border-radius: 12px; border: 1.5px solid var(--line-strong);
    background: #fff; cursor: pointer; transition: border-color .18s, background .18s;
}
.pay-mode-card b, .tpl-src-card b { display: block; font-size: 14px; }
.pay-mode-card span, .tpl-src-card span {
    display: block; margin-top: 4px; font-size: 12px; color: var(--muted); line-height: 1.45;
}
.pay-mode-card.selected, .tpl-src-card.selected {
    border-color: var(--ink) !important;
    background: #fafaf9 !important;
    box-shadow: inset 0 0 0 1px var(--ink);
}
.pay-methods { gap: 10px !important; }
.pay-method {
    border-radius: 12px !important;
    border: 1.5px solid var(--line-strong) !important;
    min-height: 72px;
    background: #fff !important;
}
.pay-method.selected {
    border-color: var(--ink) !important;
    background: #fafaf9 !important;
    box-shadow: inset 0 0 0 1px var(--ink);
}
.product-info .action-btns {
    display: grid; grid-template-columns: 1.35fr 1fr; gap: 10px; margin-top: 18px;
}
.product-info .action-btns .btn { min-height: 48px; border-radius: 14px !important; }
.notice-soft {
    padding: 14px 16px; border-radius: 12px;
    background: #fff7ed; border: 1px solid #fed7aa;
    font-size: 13.5px; color: #9a3412; line-height: 1.7;
}

/* ---------- 购物车 ---------- */
.cart-page {
    max-width: 920px; margin: 0 auto; padding: 12px var(--space) 40px;
}
.cart-page .page-head {
    display: flex; justify-content: space-between; align-items: baseline;
    gap: 10px; margin-bottom: 16px;
}
.cart-page .page-head h1 {
    font-size: 26px; font-weight: 800; font-family: var(--font-display);
    letter-spacing: -0.04em; line-height: 1.1;
}
.cart-panel {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: 16px; overflow: hidden;
}
.cart-line {
    display: flex; gap: 12px; padding: 14px; align-items: center;
    border-bottom: 1px solid #f5f5f4;
}
.cart-line:last-child { border-bottom: 0; }
.cart-line__check { width: 20px; height: 20px; accent-color: var(--ink); flex-shrink: 0; }
.cart-line__thumb {
    width: 76px; height: 76px; border-radius: 12px; overflow: hidden;
    background: #f5f5f4; flex-shrink: 0; display: block; border: 1px solid var(--line);
}
.cart-line__thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-line__thumb-ph {
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    color: var(--muted); font-size: 12px; font-weight: 700;
}
.cart-line__body { flex: 1; min-width: 0; }
.cart-line__name {
    font-weight: 700; font-size: 14px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}
.cart-line__price { color: var(--accent); font-weight: 800; margin-top: 4px; font-family: var(--font-display); }
.cart-line__ops { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.cart-line__del { margin-left: auto !important; color: var(--danger) !important; }
.cart-section {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: 16px; padding: 16px; margin-top: 12px;
}
.cart-section__title {
    font-weight: 800; margin-bottom: 12px; font-size: 13px;
    letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
}
.cart-checkout-bar {
    position: sticky; bottom: calc(var(--tabbar-height) + env(safe-area-inset-bottom, 0px) + 8px);
    z-index: 20; margin-top: 14px;
    background: rgba(255,255,255,0.96); backdrop-filter: blur(12px);
    border: 1px solid var(--line); border-radius: 16px;
    box-shadow: var(--shadow-md); padding: 12px 14px;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
@media (min-width: 993px) {
    .cart-checkout-bar { bottom: 16px; }
}
.cart-checkout-bar .sum { font-size: 13px; color: var(--muted); }
.cart-checkout-bar .sum b {
    font-size: 24px; color: var(--accent); font-family: var(--font-display); font-weight: 800;
}
.cart-checkout-bar #btnCheckout {
    min-width: 120px; min-height: 46px; border-radius: 12px !important;
}
.cart-empty {
    text-align: center; padding: 64px 20px; color: var(--muted);
    background: var(--surface); border: 1px dashed var(--line-strong); border-radius: 16px;
}
.cart-empty p { margin: 8px 0 18px; font-size: 14px; }

/* ---------- 用户中心 ---------- */
.user-layout {
    max-width: 1180px; margin: 0 auto; padding: 18px var(--space) 28px;
}
.user-sidebar {
    background: var(--surface) !important; border: 1px solid var(--line) !important;
    border-radius: 16px !important; box-shadow: none !important; overflow: hidden;
}
.user-sidebar .profile-card {
    background: var(--ink) !important;
    border-radius: 0 !important; margin: 0 !important;
    padding: 22px 18px !important;
}
.user-sidebar .menu a {
    border-radius: 10px !important; margin: 2px 8px !important;
    font-weight: 600 !important;
}
.user-sidebar .menu a.active {
    background: #f5f5f4 !important; color: var(--ink) !important;
}
.user-content .page-title {
    font-size: 24px !important; font-weight: 800 !important;
    font-family: var(--font-display); letter-spacing: -0.04em;
    margin-bottom: 16px !important;
}
.stats-grid { gap: 10px !important; }
.stat-card {
    border-radius: 14px !important; border: 1px solid var(--line) !important;
    box-shadow: none !important; background: var(--surface) !important;
    padding: 16px !important;
}
.stat-card .stat-icon { display: none; }
.stat-card .stat-label {
    font-size: 12px !important; color: var(--muted) !important;
    letter-spacing: 0.04em; font-weight: 650 !important;
}
.stat-card .stat-value {
    font-size: 22px !important; font-weight: 800 !important;
    color: var(--ink) !important; margin-top: 6px;
}
.stat-card.blue, .stat-card.green, .stat-card.orange, .stat-card.purple, .stat-card.cyan {
    background: var(--surface) !important;
}
.quick-actions { gap: 8px !important; }
.qa-btn {
    border-radius: 12px !important; border: 1px solid var(--line) !important;
    background: var(--surface) !important; font-weight: 700 !important;
    box-shadow: none !important; min-height: 44px;
    display: inline-flex; align-items: center; justify-content: center;
}
.qa-btn:hover {
    transform: none; border-color: var(--ink) !important;
    color: var(--ink) !important;
}
.card {
    background: var(--surface) !important; border: 1px solid var(--line) !important;
    border-radius: 16px !important; box-shadow: none !important;
}
.card-title { font-weight: 800 !important; letter-spacing: -0.02em; }

/* ---------- 登录注册 ---------- */
.auth-page .auth-card {
    width: min(420px, calc(100% - 24px)) !important;
    border-radius: 20px !important;
    border: 1px solid var(--line) !important;
    box-shadow: var(--shadow-lg) !important;
    padding: 28px 24px !important;
    background: rgba(255,255,255,0.96) !important;
}
.auth-logo {
    font-size: 24px !important; font-weight: 800 !important;
    font-family: var(--font-display); letter-spacing: -0.04em;
    display: flex; align-items: center; gap: 10px;
    color: var(--ink) !important;
}
.auth-logo .dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--accent-2);
    box-shadow: 0 0 0 4px rgba(234, 88, 12, 0.16);
}
.auth-subtitle {
    color: var(--muted) !important; margin: 8px 0 24px !important;
    font-size: 14px !important; line-height: 1.55;
}
.auth-page .form-item label {
    font-size: 12px !important; font-weight: 750 !important; color: var(--muted);
    letter-spacing: 0.06em; text-transform: uppercase;
}
.auth-page .form-item input {
    min-height: 48px !important; border-radius: 12px !important;
    border: 1.5px solid var(--line-strong) !important; font-size: 16px !important;
    background: #fff !important; color: var(--ink) !important;
}
.auth-page .form-item input:focus {
    border-color: var(--ink) !important;
    box-shadow: 0 0 0 3px rgba(28, 25, 23, 0.08) !important;
}
.auth-links, .auth-switch {
    display: flex; flex-wrap: wrap; gap: 10px 16px;
    justify-content: space-between; margin-top: 16px;
    font-size: 13px; color: var(--muted);
}
.auth-links a, .auth-switch a { font-weight: 700; color: var(--ink); }

/* ---------- 支付页 ---------- */
.pay-page .pay-card {
    width: min(480px, calc(100% - 20px)) !important;
    border-radius: 20px !important; overflow: hidden;
    border: 1px solid var(--line) !important;
    box-shadow: var(--shadow-lg) !important;
    margin: 20px auto !important;
}
.pay-header {
    padding: 28px 22px 26px !important;
    background: var(--ink) !important;
}
.pay-header .order-no { opacity: 0.7; font-size: 12px !important; letter-spacing: 0.04em; }
.pay-header .amount {
    font-size: 42px !important; font-family: var(--font-display);
    letter-spacing: -0.04em; font-weight: 800;
}
.pay-header .title { opacity: 0.85; margin-top: 6px; }
.pay-pill {
    margin-top: 12px; display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 700;
    background: rgba(255,255,255,0.12); color: #fff;
}
.pay-pill.is-danger { background: rgba(251, 113, 133, 0.25); }
.pay-product {
    display: flex; gap: 12px; align-items: center;
    padding: 12px; background: #fafaf9; border-radius: 12px;
    border: 1px solid var(--line); margin-bottom: 18px;
}
.pay-product__img {
    width: 56px; height: 56px; border-radius: 10px; object-fit: cover; flex-shrink: 0;
}
.pay-product__ph {
    width: 56px; height: 56px; border-radius: 10px; flex-shrink: 0;
    background: var(--ink); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700;
}
.pay-product__main { flex: 1; min-width: 0; }
.pay-product__name { font-weight: 750; }
.pay-product__meta { color: var(--muted); font-size: 12px; margin-top: 4px; }
.pay-product__right { text-align: right; }
.pay-product__price { color: var(--accent); font-weight: 800; font-size: 18px; font-family: var(--font-display); }
.pay-hint {
    margin-top: 12px; padding: 10px 12px; border-radius: 10px;
    background: #fff7ed; border: 1px dashed #fdba74;
    font-size: 12px; color: #c2410c; line-height: 1.55;
}
.pay-foot {
    margin-top: 22px; padding-top: 14px; border-top: 1px solid #f5f5f4;
    text-align: center; color: var(--muted); font-size: 12px;
}
.btn-pay-cancel {
    width: 100%; min-height: 48px; border: none; border-radius: 14px;
    background: var(--danger); color: #fff;
    font-size: 15px; font-weight: 750; cursor: pointer;
}

/* ---------- 表单 ---------- */
.form-item input, .form-item select, .form-item textarea,
input[type="text"], input[type="password"], input[type="number"], select, textarea {
    border-radius: 12px !important;
}
select {
    min-height: 44px; padding: 10px 12px;
    border: 1.5px solid var(--line-strong); background: #fff;
}

.product-card .btn-card-cart__bag {
    font-size: 0 !important;
    width: 16px; height: 16px;
    display: block;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='21' r='1'/%3E%3Ccircle cx='20' cy='21' r='1'/%3E%3Cpath d='M1 1h4l2.7 12.4a2 2 0 0 0 2 1.6h9.7a2 2 0 0 0 2-1.6L23 6H6'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='21' r='1'/%3E%3Ccircle cx='20' cy='21' r='1'/%3E%3Cpath d='M1 1h4l2.7 12.4a2 2 0 0 0 2 1.6h9.7a2 2 0 0 0 2-1.6L23 6H6'/%3E%3C/svg%3E") center / contain no-repeat;
}
.app-footer {
    text-align: center;
    padding: 18px 12px 96px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.65;
}
.auth-status-card {
    margin: 8px 0 18px; padding: 16px; border-radius: 14px;
    background: #fafaf9; border: 1px solid var(--line);
}
.auth-status-card .acct { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.auth-status-card .ttl { font-size: 18px; font-weight: 800; font-family: var(--font-display); }
.auth-status-card .desc { font-size: 13.5px; color: var(--ink-soft); line-height: 1.6; margin-top: 4px; }
.auth-status-row { display: flex; gap: 12px; align-items: flex-start; }
.auth-status-row .ico { font-size: 22px; line-height: 1; opacity: 0.9; }

/* =========================================================
   手机端重排（核心：结构变化，不只换色）
   ========================================================= */
@media (max-width: 992px) {
    :root {
        --header-height: 52px;
        --tabbar-height: 62px;
        --space: 14px;
    }

    .mall-layout {
        display: flex !important;
        flex-direction: column !important;
        padding: 10px var(--space) 24px !important;
        gap: 0 !important;
    }

    /* 分类：横向滑动 chips，不再占竖栏 */
    .mall-sidebar {
        position: static !important;
        order: 1;
        margin: 0 0 10px !important;
        padding: 0 !important;
        background: transparent !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }
    .mall-sidebar h3 { display: none !important; }
    .mall-sidebar .cat-list {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 8px !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 2px 2px 8px !important;
        margin: 0 !important;
        list-style: none !important;
    }
    .mall-sidebar .cat-list::-webkit-scrollbar { display: none; }
    .mall-sidebar .cat-list li { flex: 0 0 auto; margin: 0 !important; }
    .mall-sidebar .cat-list a {
        display: inline-flex !important;
        align-items: center;
        gap: 6px;
        padding: 8px 14px !important;
        border-radius: 999px !important;
        background: var(--surface) !important;
        border: 1px solid var(--line) !important;
        color: var(--ink-soft) !important;
        font-size: 13px !important;
        font-weight: 650 !important;
        white-space: nowrap;
        box-shadow: none !important;
    }
    .mall-sidebar .cat-list a.active {
        background: var(--ink) !important;
        color: #fff !important;
        border-color: var(--ink) !important;
        box-shadow: none !important;
    }
    .mall-sidebar .cat-list .count {
        opacity: 0.55;
        font-size: 11px;
        font-weight: 700;
    }
    .mall-sidebar .cat-list a.active .count { opacity: 0.75; color: #fff; }

    .mall-main { order: 2; width: 100%; }

    /* 搜索 + 排序：吸顶工具条 */
    .mall-filter {
        position: sticky;
        top: var(--header-height);
        z-index: 15;
        background: rgba(244, 242, 238, 0.94) !important;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        margin: 0 calc(var(--space) * -1) 12px !important;
        padding: 8px var(--space) 10px !important;
        border-bottom: 1px solid var(--line) !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
    }
    .mall-search-form {
        display: flex !important;
        width: 100%;
        gap: 8px;
        align-items: center;
    }
    .mall-search-form .mall-search-input { flex: 1; width: 100% !important; min-width: 0; }
    .mall-search-form .btn { flex: 0 0 auto; min-height: 44px; padding: 0 16px; }
    .filter-sort {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 6px !important;
        padding-bottom: 2px;
        scrollbar-width: none;
    }
    .filter-sort::-webkit-scrollbar { display: none; }
    .filter-sort a { flex: 0 0 auto; font-size: 13px !important; }

    /* 商品：单列横排卡片（图左文右），可读可点 */
    .products-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
    }
    .product-card {
        display: grid !important;
        grid-template-columns: 108px minmax(0, 1fr) !important;
        align-items: stretch;
        border-radius: 14px !important;
    }
    .product-card:hover { transform: none !important; box-shadow: none !important; }
    .product-card .cover {
        aspect-ratio: auto !important;
        height: 100% !important;
        min-height: 108px;
        border-radius: 0 !important;
    }
    .product-card .cover img {
        width: 100%; height: 100%; object-fit: cover;
        transform: none !important;
    }
    .product-card .cover .tag-top {
        left: 6px !important; top: 6px !important;
        font-size: 10px !important; padding: 2px 6px !important;
    }
    .product-card .info {
        display: flex !important;
        flex-direction: column !important;
        padding: 10px 12px 10px 10px !important;
        min-width: 0;
    }
    .product-card .info .title {
        min-height: 0 !important;
        font-size: 14px !important;
        line-height: 1.35 !important;
        margin-bottom: 4px !important;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .product-card .info .meta {
        font-size: 11px !important;
        margin-bottom: 6px !important;
        display: flex; gap: 8px; flex-wrap: wrap;
    }
    .product-card .info .price {
        font-size: 18px !important;
        margin-top: auto;
    }
    .product-card .card-buy {
        margin-top: 8px !important;
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        gap: 8px !important;
        flex-wrap: nowrap !important;
    }
    .product-card .card-qty {
        height: 34px !important;
        flex: 0 0 auto;
    }
    .product-card .card-actions {
        display: flex !important;
        gap: 6px !important;
        margin-left: auto;
    }
    .product-card .btn-card-cart {
        width: 36px !important; height: 36px !important;
    }
    .product-card .btn-card-pay {
        height: 36px !important;
        min-width: 56px;
        padding: 0 12px !important;
        font-size: 13px !important;
    }

    /* 顶栏：手机隐藏「退出」，进「我的」再退 */
    .header-logout-btn { display: none !important; }
    .header-balance { padding: 6px 10px !important; }
    .app-logo-text { max-width: 36vw; font-size: 14px !important; }

    /* 详情：图顶通栏感 + 底栏吸底操作 */
    .product-detail { padding: 0 0 88px !important; }
    .product-gallery {
        border-radius: 0 !important;
        border-left: 0 !important;
        border-right: 0 !important;
        border-top: 0 !important;
        padding: 0 !important;
    }
    .product-gallery .main-img {
        border-radius: 0 !important;
        aspect-ratio: 1 / 1;
        max-height: 72vw;
    }
    .product-info {
        margin: 12px var(--space) 0 !important;
        padding: 16px !important;
        border-radius: 16px !important;
    }
    .product-info .title { font-size: 20px !important; }
    .product-info .action-btns {
        position: fixed;
        left: 0; right: 0;
        bottom: calc(var(--tabbar-height) + env(safe-area-inset-bottom, 0px));
        z-index: 30;
        display: grid !important;
        grid-template-columns: 1fr 1.2fr !important;
        gap: 8px;
        margin: 0 !important;
        padding: 10px var(--space) calc(10px + env(safe-area-inset-bottom, 0px));
        background: rgba(255,255,255,0.96);
        border-top: 1px solid var(--line);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }
    .product-info .action-btns .btn {
        min-height: 48px !important;
        order: 0;
    }
    .product-info .action-btns .btn-primary { order: 2; }
    .product-info .action-btns .btn-default { order: 1; }

    /* 用户中心：资料卡 + 横向菜单 */
    .user-layout {
        padding: 12px var(--space) 28px !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
    }
    .user-sidebar {
        border-radius: 16px !important;
    }
    .user-sidebar .profile-card {
        display: grid !important;
        grid-template-columns: auto 1fr auto;
        grid-template-areas: "av name bal";
        align-items: center;
        gap: 12px;
        padding: 16px !important;
        text-align: left !important;
    }
    .user-sidebar .profile-card .avatar {
        grid-area: av;
        width: 48px !important; height: 48px !important;
        margin: 0 !important;
    }
    .user-sidebar .profile-card .name {
        grid-area: name;
        margin: 0 !important;
        font-size: 16px !important;
        text-align: left !important;
    }
    .user-sidebar .profile-card .balance {
        grid-area: bal;
        margin: 0 !important;
        text-align: right !important;
        background: rgba(255,255,255,0.08);
        padding: 8px 10px;
        border-radius: 10px;
    }
    .user-sidebar .profile-card .balance .label { font-size: 10px; opacity: 0.7; }
    .user-sidebar .profile-card .balance .amount { font-size: 15px !important; }
    .user-sidebar .menu {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 8px;
        padding: 12px !important;
        scrollbar-width: none;
    }
    .user-sidebar .menu::-webkit-scrollbar { display: none; }
    .user-sidebar .menu .group-title { display: none !important; }
    .user-sidebar .menu a {
        flex: 0 0 auto !important;
        margin: 0 !important;
        padding: 8px 14px !important;
        border-radius: 999px !important;
        background: #f5f5f4 !important;
        white-space: nowrap;
        font-size: 13px !important;
    }
    .user-sidebar .menu a.active {
        background: var(--ink) !important;
        color: #fff !important;
    }
    .user-sidebar .menu .menu-logout {
        background: #fff1f2 !important;
        color: var(--danger) !important;
    }
    .user-content .page-title { font-size: 20px !important; }
    .stats-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }
    .stats-grid .stat-card:first-child {
        grid-column: 1 / -1;
        background: var(--ink) !important;
        color: #fff !important;
        border-color: var(--ink) !important;
    }
    .stats-grid .stat-card:first-child .stat-label { color: rgba(255,255,255,0.65) !important; }
    .stats-grid .stat-card:first-child .stat-value { color: #fff !important; font-size: 28px !important; }
    .quick-actions {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }
    .qa-btn { width: 100%; padding: 12px 10px !important; font-size: 13px !important; }

    /* 表格改卡片感：横向滚动 */
    .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; }
    .data-table { min-width: 560px; }

    /* 购物车 */
    .cart-page { padding-top: 8px; }
    .cart-page .page-head h1 { font-size: 22px; }
    .cart-line { padding: 12px; align-items: flex-start; }
    .cart-line__thumb { width: 72px; height: 72px; }
    .cart-checkout-bar {
        margin-left: calc(var(--space) * -1);
        margin-right: calc(var(--space) * -1);
        border-radius: 16px 16px 0 0;
        border-left: 0; border-right: 0; border-bottom: 0;
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
        bottom: calc(var(--tabbar-height) + env(safe-area-inset-bottom, 0px));
    }

    /* 登录：更贴边 */
    .auth-page .auth-card {
        width: calc(100% - 20px) !important;
        padding: 28px 20px !important;
        border-radius: 18px !important;
    }
    .auth-logo { font-size: 22px !important; }

    /* 支付：几乎全宽 */
    .pay-page .pay-card {
        width: calc(100% - 16px) !important;
        margin: 12px auto !important;
        border-radius: 16px !important;
    }
    .pay-header { padding: 24px 18px 22px !important; }
    .pay-header .amount { font-size: 36px !important; }
    .pay-card .pay-body { padding: 18px 16px 16px !important; }
    .pay-methods { grid-template-columns: repeat(2, 1fr) !important; }
}

@media (max-width: 480px) {
    :root { --space: 12px; }
    .product-card { grid-template-columns: 96px minmax(0, 1fr) !important; }
    .product-card .cover { min-height: 96px; }
    .product-card .info .price { font-size: 17px !important; }
    .product-card .btn-card-order { min-width: 52px; font-size: 12px !important; padding: 0 10px !important; }
    .header-avatar { width: 32px !important; height: 32px !important; }
}

/* =========================================================
   v2.2 交互与信息架构
   ========================================================= */

/* 顶栏不再放购物车 */
.header-cart-btn { display: none !important; }

/* 四栏底栏 */
.app-tabbar--4 {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
}
.app-tabbar--4 .tab-center,
.app-tabbar--4 .tab-center-btn { display: none !important; }
.tab-icon-wrap {
    position: relative;
    width: 22px; height: 22px;
    display: flex; align-items: center; justify-content: center;
}
.tab-cart-badge {
    position: absolute;
    top: -7px; right: -10px;
    min-width: 16px; height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    line-height: 16px;
    text-align: center;
    border: 2px solid #fff;
    box-sizing: content-box;
}

/* 商品卡片操作区：数量 + 加购文案 + 下单 */
.product-card .card-buy {
    display: grid !important;
    grid-template-columns: auto auto 1fr !important;
    align-items: center !important;
    gap: 8px !important;
    margin-top: 10px !important;
}
.product-card .card-buy__qty {
    display: inline-flex !important;
    align-items: center;
    height: 36px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    overflow: hidden;
    background: #fafaf9;
}
.product-card .card-buy__qty .card-qty-btn {
    width: 32px; height: 36px;
    border: 0; background: transparent;
    color: var(--ink); font-size: 16px; font-weight: 700;
    cursor: pointer;
}
.product-card .card-buy__qty .card-qty-btn:active { background: #f5f5f4; }
.product-card .card-buy__qty .card-qty-val {
    width: 36px; height: 36px;
    border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line);
    text-align: center; font-size: 14px; font-weight: 750;
    font-variant-numeric: tabular-nums;
    background: #fff; color: var(--ink);
    -moz-appearance: textfield;
}
.product-card .card-buy__qty .card-qty-val::-webkit-outer-spin-button,
.product-card .card-buy__qty .card-qty-val::-webkit-inner-spin-button {
    -webkit-appearance: none; margin: 0;
}
.product-card .btn-card-add {
    height: 36px; padding: 0 12px;
    border-radius: 10px;
    border: 1px solid var(--line-strong);
    background: #fff; color: var(--ink);
    font-size: 13px; font-weight: 750; cursor: pointer;
    white-space: nowrap;
}
.product-card .btn-card-add:active { background: #f5f5f4; }
.product-card .btn-card-order {
    height: 36px; padding: 0 14px;
    border-radius: 10px; border: 0;
    background: var(--ink); color: #fff;
    font-size: 13px; font-weight: 750; cursor: pointer;
    white-space: nowrap; justify-self: stretch;
}
.product-card .btn-card-order:active { filter: brightness(1.08); }
.product-card .btn-card-cart,
.product-card .btn-card-pay,
.product-card .card-actions { display: none !important; }

/* 个人中心：宫格菜单，不再左右滑 */
.user-sidebar .profile-card {
    display: grid !important;
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
        "av main gear"
        "bal bal bal";
    gap: 10px 12px;
    align-items: center;
    padding: 16px !important;
    text-align: left !important;
}
.user-sidebar .profile-card .avatar { grid-area: av; margin: 0 !important; width: 48px !important; height: 48px !important; }
.user-sidebar .profile-main { grid-area: main; min-width: 0; }
.user-sidebar .profile-card .name {
    margin: 0 !important; font-size: 16px !important; text-align: left !important;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-sidebar .profile-meta {
    font-size: 12px; opacity: 0.65; margin-top: 2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-sidebar .profile-gear {
    grid-area: gear;
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 32px; padding: 0 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
    color: #fff !important; font-size: 12px; font-weight: 700;
    border: 1px solid rgba(255,255,255,0.16);
}
.user-sidebar .profile-gear.active,
.user-sidebar .profile-gear:hover { background: rgba(255,255,255,0.2); }
.user-sidebar .profile-card .balance {
    grid-area: bal;
    margin: 0 !important;
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255,255,255,0.08);
    text-align: left !important;
}
.user-sidebar .profile-card .balance .label { font-size: 12px; opacity: 0.7; }
.user-sidebar .profile-card .balance .amount { font-size: 18px !important; font-weight: 800; }

.user-sidebar .menu-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    padding: 12px !important;
    overflow: visible !important;
    flex-wrap: unset !important;
}
.user-sidebar .menu-grid .group-title { display: none !important; }
.user-sidebar .menu-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: center;
    gap: 2px;
    margin: 0 !important;
    padding: 12px !important;
    min-height: 64px;
    border-radius: 12px !important;
    background: #f5f5f4 !important;
    border: 1px solid transparent;
    color: var(--ink) !important;
    text-decoration: none !important;
    white-space: normal !important;
}
.user-sidebar .menu-item__t {
    font-size: 13.5px; font-weight: 750; line-height: 1.25; color: var(--ink);
}
.user-sidebar .menu-item__d {
    font-size: 11px; color: var(--muted); line-height: 1.3;
}
.user-sidebar .menu-item.active,
.user-sidebar .menu-item--products.active {
    background: #fff !important;
    border-color: var(--ink) !important;
    box-shadow: inset 0 0 0 1px var(--ink);
}
.user-sidebar .menu-item--products {
    grid-column: 1 / -1;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px;
    padding: 10px 10px 10px 12px !important;
}
.user-sidebar .menu-item__main {
    display: flex; flex-direction: column; gap: 2px;
    color: inherit; text-decoration: none; min-width: 0; flex: 1;
}
.user-sidebar .menu-item__act {
    flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 34px; padding: 0 14px;
    border-radius: 10px;
    background: var(--ink); color: #fff !important;
    font-size: 12.5px; font-weight: 750; text-decoration: none;
}
.user-sidebar .sidebar-foot {
    display: flex;
    gap: 8px;
    padding: 0 12px 14px;
}
.user-sidebar .sidebar-foot a {
    flex: 1;
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 40px;
    border-radius: 12px;
    background: #f5f5f4;
    color: var(--ink);
    font-size: 13px; font-weight: 700;
    text-decoration: none;
    margin: 0 !important;
}
.user-sidebar .sidebar-foot a.active {
    background: #fff;
    box-shadow: inset 0 0 0 1px var(--ink);
}
.user-sidebar .sidebar-foot .menu-logout {
    background: #fff1f2 !important;
    color: var(--danger) !important;
}

@media (min-width: 993px) {
    .user-sidebar .menu-grid { grid-template-columns: 1fr !important; }
    .user-sidebar .menu-item--products { grid-column: auto; }
    .user-sidebar .profile-card {
        grid-template-columns: auto 1fr;
        grid-template-areas:
            "av main"
            "av gear"
            "bal bal";
    }
}

@media (max-width: 992px) {
    /* 分类：多排换行，一眼看全，不再左右滑 */
    .mall-sidebar .cat-list {
        display: flex !important;
        flex-wrap: wrap !important;
        overflow: visible !important;
        gap: 8px !important;
        padding: 0 0 10px !important;
    }
    .mall-sidebar .cat-list a {
        flex: 0 0 auto !important;
    }

    .product-card .card-buy {
        grid-template-columns: auto 1fr auto !important;
    }
    .product-card .btn-card-add { justify-self: start; }
    .product-card .btn-card-order { min-width: 56px; }

    /* 覆盖旧的横向菜单规则 */
    .user-sidebar .menu {
        display: grid !important;
        flex-wrap: unset !important;
        overflow: visible !important;
    }
    .user-sidebar .menu a.menu-item {
        flex: unset !important;
        white-space: normal !important;
        border-radius: 12px !important;
        padding: 12px !important;
        background: #f5f5f4 !important;
        color: var(--ink) !important;
    }
    .user-sidebar .menu a.menu-item.active {
        background: #fff !important;
        color: var(--ink) !important;
    }
}

/* =========================================================
   v2.3 分类横滑 / 电商加购 / 个人中心重做
   ========================================================= */

/* 分类：单行横滑 chips（比两列换行更干净） */
@media (max-width: 992px) {
    .mall-sidebar {
        margin-bottom: 6px !important;
    }
    .mall-sidebar .cat-list {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        gap: 8px !important;
        padding: 4px 2px 12px !important;
        scrollbar-width: none;
    }
    .mall-sidebar .cat-list::-webkit-scrollbar { display: none; }
    .mall-sidebar .cat-list li { flex: 0 0 auto !important; }
    .mall-sidebar .cat-list a {
        padding: 7px 12px !important;
        font-size: 12.5px !important;
        border-radius: 999px !important;
        background: #fff !important;
        border: 1px solid var(--line) !important;
        color: var(--ink-soft) !important;
        box-shadow: none !important;
    }
    .mall-sidebar .cat-list a.active {
        background: var(--ink) !important;
        color: #fff !important;
        border-color: var(--ink) !important;
    }
    .mall-sidebar .cat-list .count {
        margin-left: 4px;
        font-size: 11px;
        opacity: .55;
        font-weight: 700;
    }
}

/* 加购：默认按钮，点后变成 − qty + */
.product-card .card-buy {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    grid-template-columns: unset !important;
    margin-top: 10px !important;
}
.product-card .btn-card-cart-entry,
.product-card .btn-card-order {
    height: 34px;
    padding: 0 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 750;
    cursor: pointer;
    white-space: nowrap;
}
.product-card .btn-card-cart-entry {
    border: 1px solid var(--line-strong);
    background: #fff;
    color: var(--ink);
}
.product-card .btn-card-cart-entry[hidden] { display: none !important; }
.product-card .btn-card-order {
    border: 0;
    background: var(--ink);
    color: #fff;
    margin-left: auto;
}
.product-card .card-stepper {
    display: inline-flex;
    align-items: center;
    height: 34px;
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    background: #fff;
}
.product-card .card-stepper[hidden] { display: none !important; }
.product-card .card-stepper__btn {
    width: 34px; height: 34px;
    border: 0; background: #f5f5f4;
    color: var(--ink); font-size: 16px; font-weight: 700;
    cursor: pointer;
}
.product-card .card-stepper__num {
    min-width: 28px;
    text-align: center;
    font-size: 13px; font-weight: 800;
    font-variant-numeric: tabular-nums;
}
.product-card .btn-card-add,
.product-card .card-buy__qty,
.product-card .btn-card-cart,
.product-card .btn-card-pay,
.product-card .card-actions { display: none !important; }

/* ---------- 个人中心 v3 ---------- */
.user-sidebar {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
}
.user-sidebar .profile-card,
.user-sidebar .menu-grid,
.user-sidebar .sidebar-foot,
.user-sidebar .menu-item--products { display: none !important; }

.uc-hero {
    background: var(--ink);
    color: #fff;
    border-radius: 18px;
    padding: 16px;
    margin-bottom: 12px;
}
.uc-hero__row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.uc-hero__avatar {
    width: 52px; height: 52px; border-radius: 50%;
    overflow: hidden; flex-shrink: 0;
    background: #44403c;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 18px;
}
.uc-hero__avatar img { width: 100%; height: 100%; object-fit: cover; }
.uc-hero__info { flex: 1; min-width: 0; }
.uc-hero__name {
    font-size: 17px; font-weight: 800; letter-spacing: -.02em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.uc-hero__acc { font-size: 12px; opacity: .65; margin-top: 2px; }
.uc-hero__actions {
    display: flex; flex-direction: column; gap: 6px; flex-shrink: 0;
}
.uc-btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 30px; padding: 0 12px;
    border-radius: 999px;
    background: #fff; color: var(--ink) !important;
    font-size: 12px; font-weight: 750; text-decoration: none !important;
    position: relative; z-index: 2;
}
.uc-btn--ghost {
    background: transparent; color: #fff !important;
    border: 1px solid rgba(255,255,255,.35);
}
.uc-hero__bal {
    margin-top: 14px;
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(255,255,255,.1);
    color: #fff !important;
    text-decoration: none !important;
}
.uc-hero__bal span { font-size: 12px; opacity: .75; }
.uc-hero__bal b { font-size: 20px; font-family: var(--font-display); font-weight: 800; }

.uc-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.uc-nav__item {
    display: flex; flex-direction: column; gap: 4px;
    padding: 14px 12px;
    min-height: 72px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid var(--line);
    color: var(--ink) !important;
    text-decoration: none !important;
}
.uc-nav__t { font-size: 14px; font-weight: 800; }
.uc-nav__d { font-size: 11.5px; color: var(--muted); line-height: 1.35; }
.uc-nav__item:active { background: #fafaf9; }

.uc-subbar {
    display: none;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding: 4px 2px;
}
.uc-subbar__back {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 34px; padding: 0 12px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid var(--line);
    color: var(--ink) !important;
    font-size: 13px; font-weight: 700;
    text-decoration: none !important;
}
.uc-subbar__back::before { content: "← "; }
.uc-subbar__title {
    flex: 1; font-size: 16px; font-weight: 800; letter-spacing: -.02em;
}

.uc-side-desk { display: none; }

.page-title--with-action {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
}

@media (max-width: 992px) {
    .user-layout {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
    }
    .user-sidebar.is-home {
        order: 0;
    }
    .user-sidebar.is-sub {
        order: 0;
        margin: 0 !important;
        padding: 0 !important;
    }
    .user-sidebar.is-sub .uc-subbar { display: flex; }
    .user-sidebar.is-sub .uc-side-desk { display: none !important; }
    .user-layout:has(.user-sidebar.is-sub) .user-content > .page-title:first-child:not(.page-title--with-action) {
        display: none !important;
    }
    .user-layout:has(.user-sidebar.is-sub) .page-title--with-action {
        display: flex !important;
        margin-top: 0;
    }
    .user-layout:has(.user-sidebar.is-home) .user-content {
        order: 1;
    }
}

@media (min-width: 993px) {
    .user-sidebar {
        background: #fff !important;
        border: 1px solid var(--line) !important;
        border-radius: 16px !important;
        padding: 12px !important;
    }
    .user-sidebar.is-home .uc-hero { margin-bottom: 12px; }
    .user-sidebar.is-sub .uc-subbar { display: none; }
    .user-sidebar.is-sub .uc-side-desk {
        display: flex;
        flex-direction: column;
        gap: 4px;
        padding: 6px;
    }
    .user-sidebar.is-sub .uc-side-desk a {
        padding: 10px 12px;
        border-radius: 10px;
        color: var(--ink-soft);
        font-weight: 650;
        text-decoration: none;
    }
    .user-sidebar.is-sub .uc-side-desk a.active {
        background: #f5f5f4;
        color: var(--ink);
        box-shadow: inset 3px 0 0 var(--accent-2);
    }
    .user-sidebar.is-sub .uc-side-desk .desk-logout { color: var(--danger); }
    .uc-nav { grid-template-columns: 1fr; }
    .uc-hero__actions { flex-direction: row; }
}
/* =========================================================
   v2.4 商品卡方图 + 按钮并排 / 个人中心统计并入头卡
   ========================================================= */
@media (max-width: 992px) {
    .product-card {
        display: grid !important;
        grid-template-columns: 96px minmax(0, 1fr) !important;
        gap: 0 !important;
        align-items: stretch !important;
        max-width: 100%;
    }
    .product-card .cover {
        width: 96px !important;
        height: 96px !important;
        min-height: 96px !important;
        max-height: 96px !important;
        aspect-ratio: 1 / 1 !important;
        overflow: hidden !important;
    }
    .product-card .cover img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        object-position: center !important;
        display: block;
        transform: none !important;
    }
    .product-card .info {
        padding: 8px 10px 8px 10px !important;
        display: flex !important;
        flex-direction: column !important;
        min-width: 0;
    }
    .product-card .info .title {
        font-size: 13.5px !important;
        line-height: 1.35 !important;
        margin-bottom: 2px !important;
        -webkit-line-clamp: 2;
    }
    .product-card .info .meta {
        margin-bottom: 4px !important;
        font-size: 11px !important;
    }
    .product-card .info .price {
        font-size: 16px !important;
        margin-top: 0 !important;
    }
    .product-card .card-buy {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 6px !important;
        margin-top: 8px !important;
        margin-left: 0 !important;
    }
    .product-card .btn-card-order {
        margin-left: 0 !important;
    }
    .product-card .btn-card-cart-entry,
    .product-card .btn-card-order,
    .product-card .card-stepper {
        height: 32px;
        flex: 0 0 auto;
    }
    .product-card .btn-card-cart-entry,
    .product-card .btn-card-order {
        padding: 0 12px;
        font-size: 12.5px;
    }
}

.uc-hero__stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 12px;
}
.uc-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 10px 4px;
    border-radius: 12px;
    background: rgba(255,255,255,.1);
    color: #fff !important;
    text-decoration: none !important;
    text-align: center;
}
.uc-stat b {
    font-size: 15px;
    font-weight: 800;
    font-family: var(--font-display);
    line-height: 1.2;
}
.uc-stat span {
    font-size: 10.5px;
    opacity: .7;
}
/* =========================================================
   v2.6 商品卡收紧横排 + 商务金流动渐变
   ========================================================= */
@keyframes gold-flow {
    0% { background-position: 0% 40%; }
    50% { background-position: 100% 60%; }
    100% { background-position: 0% 40%; }
}

.uc-hero {
    background: linear-gradient(125deg, #2a241c 0%, #5a4630 28%, #3a3126 52%, #8b6b3d 78%, #2f291f 100%) !important;
    background-size: 280% 280% !important;
    animation: gold-flow 14s ease-in-out infinite !important;
}

.product-card--row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 10px !important;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    grid-template-columns: unset !important;
}
.product-card--row .cover {
    flex: 0 0 84px !important;
    width: 84px !important;
    height: 84px !important;
    min-width: 84px !important;
    min-height: 84px !important;
    max-width: 84px !important;
    max-height: 84px !important;
    aspect-ratio: 1 / 1 !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    align-self: center !important;
    display: block !important;
    position: relative;
    background: #e7e5e4;
}
.product-card--row .cover img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    transform: none !important;
}
.product-card--row .cover-ph {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px;
}
.product-card--row .info {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    gap: 4px !important;
}
.product-card--row .title {
    display: -webkit-box !important;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: inherit;
    text-decoration: none;
    font-size: 14px !important;
    font-weight: 750 !important;
    line-height: 1.3 !important;
    min-height: 0 !important;
    margin: 0 !important;
}
.product-card--row .meta {
    display: flex !important;
    gap: 8px !important;
    margin: 0 !important;
    font-size: 11px !important;
    color: var(--muted) !important;
}
.product-card--row .price-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    margin-top: 2px !important;
}
.product-card--row .price {
    font-size: 16px !important;
    margin: 0 !important;
    flex: 1;
    min-width: 0;
}
.product-card--row .card-buy {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 6px !important;
    margin: 0 !important;
    flex: 0 0 auto !important;
}
.product-card--row .btn-card-cart-entry {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    padding: 0 !important;
    border-radius: 10px !important;
    border: 1px solid var(--line-strong) !important;
    background: #fff !important;
    color: var(--ink) !important;
    font-size: 0 !important;
    line-height: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    position: relative;
}
.product-card--row .btn-card-cart-entry::before {
    content: '';
    width: 16px; height: 16px;
    display: block;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='21' r='1'/%3E%3Ccircle cx='20' cy='21' r='1'/%3E%3Cpath d='M1 1h4l2.7 12.4a2 2 0 0 0 2 1.6h9.7a2 2 0 0 0 2-1.6L23 6H6'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='21' r='1'/%3E%3Ccircle cx='20' cy='21' r='1'/%3E%3Cpath d='M1 1h4l2.7 12.4a2 2 0 0 0 2 1.6h9.7a2 2 0 0 0 2-1.6L23 6H6'/%3E%3C/svg%3E") center / contain no-repeat;
}
.product-card--row .btn-card-order {
    height: 34px !important;
    min-width: 52px !important;
    padding: 0 12px !important;
    margin: 0 !important;
    border-radius: 10px !important;
    font-size: 12.5px !important;
    font-weight: 750 !important;
}
.product-card--row .card-stepper {
    height: 34px !important;
}

@media (max-width: 992px) {
    .products-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
        max-width: 100%;
    }
    .mall-layout,
    .mall-main {
        max-width: 100% !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
    .product-card--row {
        padding: 8px !important;
        gap: 8px !important;
    }
    .product-card--row .cover {
        flex-basis: 76px !important;
        width: 76px !important;
        height: 76px !important;
        min-width: 76px !important;
        min-height: 76px !important;
        max-width: 76px !important;
        max-height: 76px !important;
    }
}

@media (min-width: 993px) {
    .products-grid {
        display: grid !important;
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
        gap: 12px !important;
    }
    .product-card--row {
        max-width: 100%;
    }
}