/* ============================================================
   iOS 风格全局变量 & 重置
   ============================================================ */
:root {
    --ios-purple:     #9b59b6;
    --ios-pink:       #d66bc0;
    --ios-grad:       linear-gradient(135deg, #d66bc0 0%, #9b59b6 100%);
    --ios-grad-soft:  linear-gradient(135deg, #f9eeff 0%, #eef3ff 100%);
    --ios-radius-xl:  22px;
    --ios-radius-lg:  16px;
    --ios-radius-md:  12px;
    --ios-radius-sm:  9px;
    --ios-shadow:     0 8px 32px rgba(180, 120, 210, 0.13);
    --ios-shadow-sm:  0 2px 12px rgba(180, 120, 210, 0.09);
    --ios-separator:  rgba(220, 190, 240, 0.35);
    --ios-bg-glass:   rgba(255,255,255,0.78);
    --ios-text-main:  #1c1c1e;
    --ios-text-sub:   #6c6c70;
    --ios-text-tip:   #8e8e93;
}

/* ============================================================
   公告卡片 — iOS 通知横幅风格
   ============================================================ */
.acg-notice-bar {
    background: var(--ios-bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1.5px solid rgba(214, 107, 192, 0.22);
    border-radius: var(--ios-radius-xl);
    padding: 16px 18px;
    margin-bottom: 14px;
    display: flex;
    align-items: flex-start;
    gap: 0;
    box-shadow: var(--ios-shadow);
    position: relative;
    overflow: hidden;
}
.acg-notice-bar::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--ios-grad);
    border-radius: 4px 0 0 4px;
}

.acg-notice-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--ios-grad);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    box-shadow: 0 4px 14px rgba(214, 107, 192, 0.38);
}

.acg-notice-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.acg-notice-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--ios-purple);
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.2px;
}
.acg-notice-title-dot {
    font-size: 6px;
    color: #d66bc0;
}

.acg-notice-text {
    font-size: 13px;
    color: var(--ios-text-main);
    line-height: 1.68;
    word-break: break-word;
    white-space: pre-line;
}

.acg-notice-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    margin-top: 4px;
}
.acg-notice-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 10px;
    border-radius: 10px;
    border: 1px solid rgba(155, 89, 182, 0.2);
    background: rgba(155, 89, 182, 0.08);
    color: var(--ios-purple);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}
.acg-notice-btn:hover {
    text-decoration: none;
    background: rgba(155, 89, 182, 0.14);
}

/* 查单提示胶囊 */
.acg-query-tip {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    width: 100%;
    margin-top: 2px;
    padding: 10px 12px;
    border-radius: 15px;
    background: rgba(255,255,255,0.7);
    border: 1px solid rgba(155, 89, 182, 0.16);
    font-size: 12px;
    color: var(--ios-text-sub);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
    transition: box-shadow 0.2s, border-color 0.2s;
}
.acg-query-tip:hover {
    box-shadow: 0 4px 14px rgba(155, 89, 182, 0.12);
    border-color: rgba(155, 89, 182, 0.22);
}
.acg-query-tip-icon {
    flex-shrink: 0;
    color: #9b59b6;
    font-size: 13px;
}
.acg-query-tip-text {
    flex: 1;
    min-width: 150px;
}
.acg-query-tip-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(155, 89, 182, 0.08);
    color: var(--ios-purple);
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}
.acg-query-tip-link:hover {
    text-decoration: none;
    background: rgba(155, 89, 182, 0.12);
}

/* 无公告时独立查单条 */
.acg-query-tip-standalone {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    padding: 12px 16px;
    border-radius: var(--ios-radius-lg);
    background: var(--ios-bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1.5px solid rgba(155, 89, 182, 0.18);
    box-shadow: var(--ios-shadow-sm);
    font-size: 13px;
    color: var(--ios-text-sub);
    margin-bottom: 14px;
}
.acg-query-tip-standalone .acg-query-tip-text { min-width: 0; }
.acg-query-tip-standalone .acg-query-tip-link { margin-left: auto; }

/* ============================================================
   主商品卡片外壳 — iOS 卡片风格
   ============================================================ */
.index-shop-card {
    background: var(--ios-bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--ios-radius-xl);
    border: 1.5px solid rgba(214, 107, 192, 0.18);
    box-shadow: var(--ios-shadow);
    overflow: hidden;
    padding: 0;
}

.ios-shop-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--ios-separator);
    background: rgba(255,255,255,0.6);
}

.ios-shop-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--ios-text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}
.ios-shop-title-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--ios-grad);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 13px;
    flex-shrink: 0;
}

.product-result-tips {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(214, 107, 192, 0.08);
    color: var(--ios-text-sub);
    font-size: 10.5px;
    font-weight: 600;
    margin-left: 4px;
    line-height: 1.2;
}
.product-result-tips:empty { display: none; }

/* 搜索区 */
.ios-search-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}
.ios-search-input {
    height: 32px;
    border-radius: 999px;
    border: 1.5px solid rgba(214, 107, 192, 0.25);
    background: rgba(255,255,255,0.85);
    padding: 0 13px;
    font-size: 13px;
    width: 155px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    color: var(--ios-text-main);
}
.ios-search-input:focus {
    border-color: rgba(155, 89, 182, 0.6);
    box-shadow: 0 0 0 3px rgba(155, 89, 182, 0.1);
}
.ios-search-input::placeholder { color: var(--ios-text-tip); }
.ios-search-btn {
    height: 32px;
    padding: 0 13px;
    border-radius: 999px;
    border: none;
    background: var(--ios-grad);
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(155, 89, 182, 0.28);
    transition: opacity 0.15s, transform 0.12s;
}
.ios-search-btn i {
    width: 14px;
    font-size: 14px;
    line-height: 1;
    text-align: center;
}
.ios-search-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.ios-search-reset {
    height: 32px;
    padding: 0 11px;
    border-radius: 999px;
    border: 1.5px solid rgba(214, 107, 192, 0.25);
    background: rgba(255,255,255,0.85);
    color: var(--ios-text-tip);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}
.ios-search-reset i {
    width: 13px;
    font-size: 13px;
    line-height: 1;
    text-align: center;
}
.ios-search-reset:hover { color: var(--ios-pink); border-color: var(--ios-pink); }

/* ============================================================
   布局 — 分类 + 商品
   ============================================================ */
.ios-shop-body {
    display: flex;
    gap: 0;
    min-height: 320px;
}

/* ---- 分类侧栏 ---- */
.ios-category-col {
    width: 200px;
    flex-shrink: 0;
    border-right: 1px solid var(--ios-separator);
    padding: 10px 0;
    background: rgba(250,246,255,0.5);
    overflow-y: auto;
    max-height: calc(100vh - 96px);
    position: sticky;
    top: 72px;
    align-self: flex-start;
}

/* ---- 平板/手机（≤ 767px）：美团风格左分类右商品 ---- */
@media (max-width: 767px) {
    /* ====== 核心：上下堆疊（學 chuhaitg 移動端） ====== */
    .ios-shop-body { flex-direction: column; }

    /* --- 分類區：全寬，不再是側欄 --- */
    .ios-category-col {
        width: 100%;
        flex-shrink: 0;
        border-right: none;
        border-bottom: 1px solid var(--ios-separator);
        padding: 4px 0 0;
        overflow-y: visible;
        overflow-x: hidden;
        background: #fff;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        position: static;
        max-height: none;
        align-self: auto;
        border-radius: 0;
        border-top-left-radius: var(--ios-radius-lg);
        border-top-right-radius: var(--ios-radius-lg);
    }
    .ios-category-col::-webkit-scrollbar { display: none; }

    .ios-cat-section-label {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 8px 14px 6px;
        margin: 0;
        font-size: 12px;
        font-weight: 700;
        letter-spacing: 0.2px;
        text-transform: none;
        color: var(--ios-text-sub);
        border-bottom: 1px solid rgba(220, 190, 240, 0.3);
    }
    .ios-cat-section-label::before {
        content: '';
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: var(--ios-pink);
        flex-shrink: 0;
        box-shadow: none;
    }

    /* --- 分類列表：縱向，每行圖標+文字橫排 --- */
    .ios-cat-list {
        display: flex !important;
        flex-direction: column !important;
        overflow-x: hidden !important;
        overflow-y: visible !important;
        padding: 0 !important;
        gap: 0;
    }

    .ios-cat-row {
        display: flex !important;
        flex-direction: row !important;
        flex-shrink: 0 !important;
        align-items: center;
        padding: 6px 12px !important;
        border-radius: 0 !important;
        border: none;
        border-bottom: 1px solid rgba(220, 190, 240, 0.18);
        background: transparent;
        white-space: normal;
        gap: 7px;
        min-width: unset;
        min-height: auto;
        text-align: left;
    }
    .ios-cat-row:last-child { border-bottom: none; }
    .ios-cat-row.checked {
        background: rgba(214, 107, 192, 0.08) !important;
        border-color: rgba(220, 190, 240, 0.18) !important;
        box-shadow: none;
    }
    .ios-cat-row.checked::after {
        display: block;
        left: 0; top: 6px; bottom: 6px; width: 3px;
        border-radius: 0 3px 3px 0;
    }
    .ios-cat-row.level-1.expanded:not(.checked) {
        background: rgba(245, 240, 255, 0.5) !important;
        border-color: rgba(220, 190, 240, 0.18) !important;
    }

    /* 二級分類 */
    .ios-cat-row.level-2 {
        display: none !important;
        padding: 5px 12px 5px 28px !important;
        min-height: auto;
        background: rgba(245, 240, 255, 0.4) !important;
        border-color: rgba(220, 190, 240, 0.12) !important;
    }
    .ios-cat-row.level-2.is-visible { display: flex !important; }
    .ios-cat-row.level-2 .ios-cat-name { font-size: 11.5px !important; color: var(--ios-purple); }
    .ios-cat-row.level-2::before { left: 16px; width: 6px; }

    /* 箭頭 */
    .ios-cat-chevron { font-size: 10px !important; margin-left: auto !important; }

    /* 圖標：保留，小尺寸橫排 */
    .ios-cat-icon-wrap {
        width: 22px !important;
        height: 22px !important;
        border-radius: 6px !important;
        margin: 0;
        flex-shrink: 0;
    }
    .ios-cat-icon-wrap i { font-size: 11px !important; }

    /* 分類名：左對齊，自然換行 */
    .ios-cat-name {
        font-size: 12px !important;
        white-space: normal !important;
        word-break: break-word;
        display: block;
        overflow: visible;
        text-overflow: unset;
        line-height: 1.35;
        text-align: left;
        width: auto;
        flex: 1;
        min-width: 0;
    }

    /* 隱藏徽章 */
    .ios-cat-badge { display: none !important; }

    /* --- 商品區：全寬，乾淨表格 --- */
    .ios-product-col {
        background: #fff;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border-radius: 0;
        border-bottom-left-radius: var(--ios-radius-lg);
        border-bottom-right-radius: var(--ios-radius-lg);
        min-width: 0;
    }

    .ios-product-header {
        padding: 8px 14px 6px;
        font-size: 13px;
        background: #fff;
    }
    .ios-product-header > i { display: none; }
    .ios-product-header > .view-label { display: none; }

    .ios-product-table-head {
        display: flex;
        align-items: center;
        padding: 5px 12px;
        font-size: 11.5px;
        font-weight: 600;
        color: var(--ios-text-sub);
        border-bottom: 1px solid var(--ios-separator);
        background: #fafafa;
    }
    .ios-product-table-head .th-name { flex: 1; min-width: 0; }
    .ios-product-table-head .th-price { width: 55px; text-align: right; }
    .ios-product-table-head .th-stock { width: 45px; text-align: center; }
    .ios-product-table-head .th-buy { width: 52px; text-align: center; }

    .ios-product-list { padding: 0; background: none; }
    .ios-product-row {
        border-radius: 0 !important;
        margin: 0 !important;
        padding: 6px 12px !important;
        gap: 6px !important;
        border: none !important;
        border-bottom: 1px solid rgba(220, 190, 240, 0.2) !important;
        box-shadow: none !important;
        background: #fff !important;
    }
    .ios-product-row:last-child { border-bottom: none !important; }
    .ios-product-icon { display: none !important; }
    .ios-product-info { flex: 1; min-width: 0; }
    .ios-product-name {
        font-size: 12px;
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: unset;
        word-break: break-word;
        line-height: 1.4;
    }
    .ios-product-meta { display: none !important; }
    .ios-product-right {
        flex-direction: row !important;
        align-items: center;
        gap: 8px;
        min-width: auto !important;
        flex-shrink: 0;
    }
    .ios-product-price {
        width: 55px;
        text-align: right;
        font-size: 12px;
        font-weight: 700;
        color: var(--ios-pink);
        flex-shrink: 0;
        /* 去掉漸變文字，用普通顏色 */
        background: none;
        -webkit-background-clip: unset;
        -webkit-text-fill-color: var(--ios-pink);
        background-clip: unset;
    }
    .ios-product-stock-cell {
        display: inline-block !important;
        width: 45px;
        text-align: center;
        font-size: 11px;
        font-weight: 600;
        flex-shrink: 0;
    }
    .ios-product-stock-cell.stock-ok { color: #15803d; }
    .ios-product-stock-cell.low { color: #c62828; }
    .ios-product-stock-cell.out { color: #888; font-weight: 500; }
    .ios-buy-btn {
        min-width: 48px !important;
        height: 26px !important;
        padding: 0 8px !important;
        font-size: 12px !important;
        gap: 3px;
        border-radius: 6px !important;
        box-shadow: none;
    }
    .ios-buy-dash {
        min-width: 52px !important;
        width: 56px;
        height: 30px !important;
        font-size: 15px;
    }
    .product-result-tips { min-height: 18px; font-size: 10px; }
    .product-empty-tip { padding: 2px 0 8px; }

    /* --- 搜索區：全寬獨立一行 --- */
    .ios-shop-header {
        align-items: stretch;
        padding: 10px 14px;
        gap: 8px;
        background: #fff;
    }
    .ios-shop-title { width: 100%; }
    .ios-search-wrap {
        width: 100%;
        gap: 6px;
    }
    .ios-search-input {
        flex: 1 1 auto;
        min-width: 0;
        width: auto !important;
        font-size: 13px !important;
    }
    .ios-search-btn,
    .ios-search-reset { flex-shrink: 0; }

    /* --- 外殼簡化 --- */
    .index-shop-card {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: #fff;
        box-shadow: 0 1px 4px rgba(0,0,0,0.06);
        border-color: rgba(220, 190, 240, 0.25);
    }
    .acg-notice-bar {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: #fff;
        box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    }

    /* --- 購買彈窗 --- */
    .pay_type {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 8px;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    .pay_type .button-click {
        min-width: 80px;
        flex: 0 0 auto;
    }
    .target-order-shell { padding: 0 6px; }
    .target-order-shell fieldset .captcha { width: min(160px, 50%) !important; }
    .target-order-shell fieldset .captchaImage { display: block; margin-top: 6px; margin-left: 0 !important; }
}

/* ---- 手机小屏（≤ 480px）---- */
@media (max-width: 480px) {
    /* 分類圖標再縮小 */
    .ios-cat-icon-wrap {
        width: 18px !important;
        height: 18px !important;
        border-radius: 5px !important;
    }
    .ios-cat-icon-wrap i { font-size: 9px !important; }
    .ios-cat-row { padding: 8px 10px !important; gap: 6px; }
    .ios-cat-name { font-size: 12px !important; }

    /* 商品區微調 */
    .ios-product-row { padding: 8px 10px !important; }
    .ios-product-name { font-size: 12px; }
    .ios-buy-btn { min-width: 48px; height: 28px; padding: 0 8px; font-size: 11px; }
    .ios-product-price { font-size: 12px; width: 54px; }
    .ios-product-stock-cell { width: 42px; font-size: 11px; }
    .ios-product-table-head .th-price { width: 54px; }
    .ios-product-table-head .th-stock { width: 42px; }
    .ios-product-table-head .th-buy { width: 50px; }
    .ios-product-table-head { font-size: 11px; padding: 7px 10px; }

    /* 搜索區 */
    .ios-search-reset {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 32px;
        padding: 0 9px;
    }
    .ios-search-wrap { gap: 6px; }
    .ios-search-input { width: auto !important; }
    .ios-search-btn { padding: 0 12px; }

    /* 標題縮小 */
    .ios-shop-title { font-size: 13px; }
    .ios-shop-title-icon { width: 24px; height: 24px; border-radius: 6px; font-size: 11px; }
}

/* ---- 超小屏（≤ 375px）---- */
@media (max-width: 375px) {
    .ios-cat-row { padding: 5px 8px !important; }
    .ios-cat-name { font-size: 11px !important; }
    .ios-cat-chevron { display: none !important; }

    .ios-product-row { padding: 5px 8px !important; }
    .ios-product-name { font-size: 11px; }
    .ios-product-price { font-size: 11px; width: 44px; }
    /* 超小屏隱藏庫存列 */
    .ios-product-stock-cell { display: none !important; }
    .ios-product-table-head .th-stock { display: none !important; }
    .ios-buy-btn { min-width: 40px !important; height: 24px !important; padding: 0 6px !important; font-size: 10px !important; }
    .ios-product-table-head { font-size: 10px; padding: 4px 8px; }
    .ios-product-table-head .th-price { width: 44px; }
    .ios-product-table-head .th-buy { width: 46px; }
    .ios-search-input { width: auto !important; font-size: 11.5px !important; }
    .ios-search-btn { padding: 0 11px; }
}

@media (max-width: 768px) {
    .acg-query-tip,
    .acg-query-tip-standalone {
        border-radius: 14px;
        padding: 9px 12px;
        gap: 8px;
    }
    .acg-query-tip-link {
        width: 100%;
        padding: 8px 12px;
    }
    .acg-notice-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* iOS grouped-list 分组标签 */
.ios-cat-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 6px 6px;
}
.ios-cat-section-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--ios-text-tip);
    letter-spacing: 0.8px;
    text-transform: uppercase;
    padding: 4px 12px 2px;
}

/* 分类行 */
.ios-cat-row {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.12s;
    position: relative;
    border-radius: 10px;
    border: 1px solid transparent;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.ios-cat-row:active { background: rgba(214, 107, 192, 0.08); }
.ios-cat-row:hover:not(.checked) {
    background: rgba(214, 107, 192, 0.06);
    border-color: rgba(214, 107, 192, 0.14);
}
.ios-cat-row.level-1 {
    min-height: 34px;
}
.ios-cat-row.level-1.has-children .ios-cat-name {
    font-weight: 600;
}

/* 选中态 */
.ios-cat-row.checked {
    background: linear-gradient(90deg, rgba(214, 107, 192, 0.16) 0%, rgba(155, 89, 182, 0.1) 100%);
}
.ios-cat-row.checked .ios-cat-name { color: var(--ios-purple); font-weight: 700; }
.ios-cat-row.checked .ios-cat-icon-wrap { background: var(--ios-grad); }
.ios-cat-row.checked .ios-cat-icon-wrap i { color: #fff; }

/* 热门推荐特殊分类 */
.ios-cat-row.ios-cat-recommend .ios-cat-name { color: #ef783b; font-weight: 700; }
.ios-cat-row.ios-cat-recommend .ios-cat-icon-wrap { background: linear-gradient(135deg, #f9a825 0%, #ef783b 100%); }
.ios-cat-row.ios-cat-recommend .ios-cat-icon-wrap i,
.ios-cat-row.ios-cat-recommend .ios-cat-icon-wrap img { filter: brightness(0) invert(1); }
.ios-cat-row.level-1.expanded:not(.checked) {
    background: rgba(214, 107, 192, 0.07);
    border-color: rgba(155, 89, 182, 0.18);
    box-shadow: inset 0 0 0 1px rgba(155, 89, 182, 0.05);
}
.ios-cat-row.level-1.expanded:not(.checked) .ios-cat-name {
    color: var(--ios-purple);
    font-weight: 600;
}
.ios-cat-row.checked::after {
    content: '';
    position: absolute;
    left: 0; top: 4px; bottom: 4px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--ios-grad);
}

/* 图标容器 */
.ios-cat-icon-wrap {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 7px;
    background: rgba(214, 107, 192, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.ios-cat-icon-wrap i { font-size: 11px; color: var(--ios-pink); transition: color 0.15s; }
.ios-cat-icon-wrap img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }

.ios-cat-name {
    flex: 1;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--ios-text-sub);
    overflow: visible;
    text-overflow: unset;
    white-space: normal;
    word-break: break-word;
    line-height: 1.4;
    transition: color 0.15s;
}

.ios-cat-badge {
    font-size: 10px;
    color: var(--ios-text-tip);
    background: rgba(180, 130, 210, 0.12);
    border-radius: 999px;
    padding: 1px 7px;
    font-weight: 600;
    flex-shrink: 0;
}
.ios-cat-badge.parent-badge {
    color: var(--ios-purple);
    background: rgba(155, 89, 182, 0.12);
    padding: 2px 7px;
}
.ios-cat-badge.count-badge {
    color: #8e8e93;
}

/* 展开箭头 */
.ios-cat-chevron {
    flex-shrink: 0;
    font-size: 10px;
    color: #c0b0d0;
    transition: transform 0.22s cubic-bezier(.4,0,.2,1);
    margin-left: -2px;
}
.ios-cat-row.expanded .ios-cat-chevron { transform: rotate(90deg); }

/* 二级分类缩进 */
.ios-cat-row.level-2 {
    display: none;
    padding-left: 22px;
    padding-top: 3px;
    padding-bottom: 3px;
    margin: 1px 8px 1px 8px;
    border-radius: 8px;
    background: rgba(245, 240, 255, 0.48);
    border-color: rgba(214, 107, 192, 0.12);
}
.ios-cat-row.level-2.is-visible { display: flex; }
.ios-cat-row.level-2::before {
    content: '';
    position: absolute;
    left: 13px;
    top: 50%;
    width: 8px;
    height: 1.5px;
    border-radius: 999px;
    background: rgba(155, 89, 182, 0.28);
    transform: translateY(-50%);
}
.ios-cat-row.level-2 .ios-cat-icon-wrap {
    width: 20px;
    height: 20px;
    border-radius: 6px;
}
.ios-cat-row.level-2 .ios-cat-icon-wrap i { font-size: 10px; }
.ios-cat-row.level-2 .ios-cat-name {
    font-size: 12px;
    font-weight: 600;
}
.ios-cat-row.level-2.is-visible {
    animation: iosCatChildReveal 0.18s ease-out;
}

/* 分隔线 */
.ios-cat-separator {
    height: 1px;
    background: var(--ios-separator);
    margin: 2px 10px;
    border-radius: 999px;
}

/* ---- 商品区 ---- */
.ios-product-col {
    flex: 1;
    min-width: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.ios-product-header {
    padding: 5px 12px 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ios-text-tip);
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--ios-separator);
    background: rgba(250,246,255,0.4);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 表格表头 — 桌面端隐藏，移动端显示 */
.ios-product-table-head { display: none; }
/* 移动端库存单元格 — 桌面端隐藏 */
.ios-product-stock-cell { display: none; }
.view-label { color: var(--ios-text-tip); }

.ios-product-list {
    flex: 1;
    padding: 4px 6px 6px;
    background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, rgba(248,242,255,0.28) 100%);
}

/* 商品行 — iOS 列表单元格 */
.ios-product-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
    border: 1px solid rgba(220, 190, 240, 0.24);
    border-bottom: none;
    border-radius: 10px;
    margin: 0 4px 3px;
    background: rgba(255,255,255,0.6);
    box-shadow: 0 1px 6px rgba(180, 120, 210, 0.04);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    flex-wrap: nowrap;
}
.ios-product-row:last-child { margin-bottom: 0; }
.ios-product-row:hover:not(.empty-commodity) { background: rgba(214, 107, 192, 0.05); }
.ios-product-row:active:not(.empty-commodity) { background: rgba(214, 107, 192, 0.1); }
.ios-product-row.checked {
    background: rgba(214, 107, 192, 0.07);
    border-color: rgba(155, 89, 182, 0.2);
    box-shadow: inset 0 0 0 1px rgba(155, 89, 182, 0.12), 0 6px 16px rgba(155, 89, 182, 0.08);
}
.ios-product-row.empty-commodity {
    cursor: default;
    opacity: 0.78;
}

/* 商品图标 */
.ios-product-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--ios-grad-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 5px rgba(180, 120, 210, 0.1);
}
.ios-product-icon img { width: 100%; height: 100%; object-fit: cover; }
.ios-product-icon i { font-size: 14px; color: var(--ios-purple); opacity: 0.7; }

/* 商品信息 */
.ios-product-info {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}
.ios-product-name {
    flex: 1;
    min-width: 0;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ios-text-main);
    overflow: visible;
    text-overflow: unset;
    white-space: normal;
    word-break: break-word;
    margin-bottom: 0;
    line-height: 1.4;
}
.ios-product-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
    flex-shrink: 0;
}
.ios-product-stock {
    display: inline-flex;
    align-items: center;
    font-size: 10.5px;
    color: var(--ios-text-tip);
    background: rgba(220, 200, 240, 0.2);
    border-radius: 999px;
    padding: 1px 6px;
    font-weight: 500;
    white-space: nowrap;
}
.ios-product-stock.low { color: #e05560; background: rgba(224, 85, 96, 0.1); }
.ios-product-stock.out { color: #999; background: rgba(150,150,150,0.1); }

/* 右侧价格 + 按钮区 */
.ios-product-right {
    flex-shrink: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    min-width: auto;
    margin-left: auto;
}
.ios-product-price {
    font-size: 14px;
    font-weight: 800;
    background: var(--ios-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    white-space: nowrap;
    flex-shrink: 0;
}
.ios-buy-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    justify-content: center;
    min-width: 60px;
    height: 22px;
    padding: 0 9px;
    border-radius: 999px;
    border: none;
    background: var(--ios-grad);
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(155, 89, 182, 0.28);
    transition: opacity 0.15s, transform 0.12s, box-shadow 0.15s;
    white-space: nowrap;
    appearance: none;
    -webkit-appearance: none;
    font-family: inherit;
    line-height: 1;
    flex-shrink: 0;
}
.ios-buy-btn:hover { opacity: 0.92; transform: translateY(-1px); box-shadow: 0 5px 14px rgba(155, 89, 182, 0.36); }
.ios-buy-btn:active { transform: scale(0.96); }
.ios-buy-btn.disabled {
    background: rgba(200,190,210,0.35);
    color: #b0a0c0;
    box-shadow: none;
    cursor: default;
    pointer-events: none;
}

/* 无库存时占位（与参考图「-」一致，仅移动端表格式布局使用） */
.ios-buy-dash {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    width: 56px;
    height: 30px;
    color: #aeb0b5;
    font-weight: 600;
    font-size: 16px;
    line-height: 1;
    user-select: none;
}

/* 加载更多 */
.product-load-more {
    text-align: center;
    padding: 12px 0 8px;
}
.ios-load-more-btn {
    display: inline-block;
    padding: 8px 36px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    background: #fff;
    color: #666;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}
.ios-load-more-btn:hover { background: #f5f5f5; border-color: #ccc; }
.ios-load-more-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* 空状态 & 加载中 */
.product-empty-tip {
    padding: 4px 0 10px;
}
.ios-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 42px 20px;
    text-align: center;
    gap: 10px;
    margin: 4px 10px 0;
    border-radius: 18px;
    border: 1px dashed rgba(214, 107, 192, 0.18);
    background: rgba(255,255,255,0.58);
}
.ios-empty-icon {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: var(--ios-grad-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}
.ios-empty-icon i { font-size: 28px; color: #c8aae0; }
.ios-empty-title { font-size: 15px; font-weight: 700; color: #8b6aa8; }
.ios-empty-sub { font-size: 12px; color: var(--ios-text-tip); line-height: 1.6; }

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

/* 分类空状态文字 */
.ios-cat-empty { padding: 24px 14px; text-align: center; font-size: 13px; color: var(--ios-text-tip); }

/* 滚动条美化 */
.ios-category-col::-webkit-scrollbar,
.ios-product-list::-webkit-scrollbar { width: 4px; }
.ios-category-col::-webkit-scrollbar-thumb,
.ios-product-list::-webkit-scrollbar-thumb {
    background: rgba(155, 89, 182, 0.2);
    border-radius: 999px;
}