/* 分站「全部分类」修复（0919b）：分类面板 + 手机端分类条
 * 兼容性：不用 inset / min() 这类新写法——老 iOS(≤14.4)、旧安卓 WebView、X5/UC 内核不认，
 * 面板会变成 0×0 看不见，而页面滚动已被锁住 = 整页卡死。 */
.bcf-lock { overflow: hidden; }
.bcf-mask { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 2147483000; background: rgba(15, 23, 42, .45); display: none; }
.bcf-mask.is-open { display: block; }
.bcf-panel { position: absolute; left: 50%; top: 8vh; transform: translateX(-50%); width: 92vw; max-width: 720px; max-height: 80vh;
    background: #fff; border-radius: 12px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); display: flex; flex-direction: column; overflow: hidden; }
.bcf-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid #eef0f3; font-size: 16px; color: #0f172a; }
.bcf-close { border: 0; background: none; font-size: 26px; line-height: 1; color: #64748b; cursor: pointer; padding: 0 4px; }
.bcf-body { padding: 12px; overflow: auto; -webkit-overflow-scrolling: touch; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.bcf-loading { padding: 24px; color: #94a3b8; text-align: center; grid-column: 1 / -1; }
.bcf-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; padding: 11px 12px; border: 1px solid #e5e7eb;
    border-radius: 8px; color: #0f172a !important; text-decoration: none !important; font-size: 14px; background: #fff; }
.bcf-item span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bcf-item em { font-style: normal; font-size: 12px; color: #94a3b8; flex: 0 0 auto; }
.bcf-item:hover, .bcf-item.is-cur { border-color: var(--bx-primary, var(--primary-blue, #0891b2)); color: var(--bx-primary, var(--primary-blue, #0891b2)) !important; }
.bcf-item.bcf-all { font-weight: 700; background: #f8fafc; }
.bcf-item.bcf-sub { padding-left: 22px; font-size: 13px; color: #475569 !important; }
/* 顶栏是 position:fixed，菜单不会跟着页面滚动：分类多时必须自己能滚，否则屏幕外的项永远点不到 */
.bcf-inline { display: grid; gap: 4px; padding: 6px; max-height: 70vh; max-height: calc(100vh - 160px); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.bcf-inline .bcf-item { border: 0; padding: 8px 10px; }
.bcf-all-inline { display: block; padding: 8px 14px; font-weight: 700; color: inherit; text-decoration: none; }

@media (max-width: 768px) {
    /* 面板改成底部抽屉 */
    .bcf-panel { left: 0; right: 0; top: auto; bottom: 0; transform: none; width: 100%; max-width: none; max-height: 82vh; border-radius: 14px 14px 0 0; }
    .bcf-body { grid-template-columns: 1fr 1fr; padding-bottom: 14px; padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
    /* 旧的分类条保持「单行横滑」。只修两点：
       ① 加载完成前 200px 的占位高度；
       ② 首页内联样式给每个分类写了 width:100%（原本给三列网格用的），横条里就变成「一格占满一屏、只露一个」。
       不能改成自动换行：每格 100% 宽时会变成一行一个的竖排长列表，把商品区顶到一屏半以外。 */
    #sidebar-categories-list { min-height: 0 !important; }
    #sidebar-categories-list .category-sidebar-group > .category-sidebar-item,
    #sidebar-categories-list > a.category-sidebar-item,
    #sidebar-categories-list .category-sidebar-item { width: auto !important; max-width: 100% !important; }
}
