/* ===== 首页分类导航（1.37.0）=====
   左栏大类（图标 + 名称 + 细分数量），右侧浮层面板：二级标题 + 三级标签。
   沿用站点色板：--orange #ff6a00 / --pale #fff3e9。 */

.home-category-layout{--category-rail:236px;position:relative;display:grid;grid-template-columns:var(--category-rail) minmax(0,1fr);gap:18px;align-items:stretch;margin-bottom:24px}

/* ---------- 左栏 ---------- */
.home-category-layout .category-mega{display:block;position:static;background:#fff;border:1px solid #e8ebee;border-radius:10px;margin:0;min-width:0}
.mega-rail-head{padding:14px 16px 8px;font-size:11px;letter-spacing:2px;color:#9aa5ad;text-transform:uppercase}
.home-category-layout .mega-groups{display:flex;flex-direction:column;padding:0 8px 6px;min-width:0}
.home-category-layout .mega-group{padding:0;margin:0;min-height:0}
.home-category-layout .mega-group-title{position:relative;display:grid;grid-template-columns:20px minmax(0,1fr) auto 12px;align-items:center;gap:9px;width:100%;height:52px;padding:0 10px;border:0;border-radius:7px;background:transparent;font-size:13.5px;font-weight:400;color:#3d4a52;text-align:left;cursor:pointer;transition:background .14s,color .14s}
.home-category-layout .mega-group-title:hover{background:#fafbfc;color:#2e3435}
.home-category-layout .mega-group.is-active .mega-group-title{background:#fff3e9;color:#b15e1e;font-weight:600}
.home-category-layout .mega-group.is-active .mega-group-title:before{content:"";position:absolute;left:0;top:10px;bottom:10px;width:3px;border-radius:0 3px 3px 0;background:#ff6a00}
.mega-group-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mega-group-count{font-size:11px;font-weight:500;color:#a0a7ad;font-variant-numeric:tabular-nums;letter-spacing:.2px}
.home-category-layout .mega-group.is-active .mega-group-count{color:#b15e1e;font-weight:600}
.mega-icon{display:inline-block;width:19px;height:19px;vertical-align:middle;object-fit:contain;filter:grayscale(1);opacity:.62}
.home-category-layout .mega-group.is-active .mega-icon{filter:brightness(0) saturate(100%) invert(49%) sepia(91%) saturate(1930%) hue-rotate(352deg) brightness(97%) contrast(88%);opacity:1}
.mega-arrow{width:12px;height:12px;color:#c9d0d5;transition:transform .14s,color .14s}
.home-category-layout .mega-group-title:hover .mega-arrow{color:#ff6a00;transform:translateX(2px)}
.home-category-layout .mega-group.is-active .mega-arrow{color:#ff6a00}
.mega-rail-foot{display:flex;align-items:center;justify-content:space-between;padding:10px 16px 12px;border-top:1px solid #f0f2f4;font-size:11.5px;color:#9aa5ad}
.mega-rail-foot b{color:#3d4a52;font-variant-numeric:tabular-nums}

/* ---------- 右侧浮层面板 ---------- */
.home-category-layout .mega-panel{position:absolute;left:calc(var(--category-rail) - 1px);right:0;top:0;z-index:60;display:flex;flex-direction:column;max-height:min(792px,calc(100vh - 232px));background:#fff;border:1px solid #e8ebee;border-radius:0 10px 10px 0;box-shadow:10px 14px 30px rgba(24,39,50,.10);overflow:hidden}
.mega-panel[hidden]{display:none!important}
.mega-panel [hidden]{display:none!important}
.mega-panel-head{display:flex;justify-content:space-between;align-items:flex-start;gap:20px;padding:18px 24px 12px;border-bottom:1px solid #f0f2f4;flex:none}
.mega-panel-heading{min-width:0}
.mega-panel-heading h2{margin:0;display:flex;align-items:center;gap:10px;font-size:20px;font-weight:700;line-height:1.35;letter-spacing:-.2px;color:#2e3435}
.mega-panel-count{font-size:11px;font-weight:500;color:#7c858b;background:#f4f6f7;border-radius:999px;padding:3px 9px;letter-spacing:.2px;white-space:nowrap}
.mega-panel-heading p{margin:6px 0 0;font-size:12.5px;color:#7c858b;line-height:1.6}
.mega-panel-tools{display:flex;align-items:center;gap:12px;flex:none;padding-top:3px}
.mega-filter{display:flex;align-items:center;gap:7px;width:180px;height:34px;padding:0 10px;border:1px solid #e6e9ec;border-radius:8px;background:#fbfcfd;transition:border-color .14s,background .14s,box-shadow .14s}
.mega-filter:focus-within{border-color:#ff6a00;background:#fff;box-shadow:0 0 0 3px rgba(255,106,0,.1)}
.mega-search-ico{width:14px;height:14px;color:#a0a7ad;flex:none}
.mega-filter input{width:100%;border:0;outline:0;background:transparent;font-size:12.5px;color:#2e3435}
.mega-filter input::placeholder{color:#aeb7bd}
.mega-filter input::-webkit-search-cancel-button{-webkit-appearance:none}
.mega-viewall{border:0;background:none;padding:0;font-size:12.5px;color:#b15e1e;white-space:nowrap;cursor:pointer}
.mega-viewall:hover{text-decoration:underline;text-underline-offset:3px}

.mega-rows{flex:1 1 auto;overflow-y:auto;overscroll-behavior:contain;padding:2px 0;scrollbar-width:thin;scrollbar-color:#dfe4e8 transparent}
.mega-row{display:grid;grid-template-columns:112px minmax(0,1fr);gap:12px;align-items:start;padding:11px 24px;border-bottom:1px dashed #f0f2f4}
.mega-row:last-child{border-bottom:0}
.mega-row.is-highlighted{background:#fffdfa}
.mega-row-title{border:0;background:none;padding:5px 0;font-size:13px;font-weight:600;line-height:1.45;color:#3d4a52;text-align:left;cursor:pointer;letter-spacing:.2px}
.mega-row-title:hover{color:#b15e1e}
.mega-links{display:flex;flex-wrap:wrap;gap:4px 2px;min-width:0}
.mega-link{display:inline-flex;align-items:center;height:28px;padding:0 9px;border:1px solid transparent;border-radius:6px;background:none;font-size:12.5px;color:#4a555b;white-space:nowrap;cursor:pointer;transition:background .13s,color .13s,border-color .13s}
.mega-link:hover{background:#fff3e9;border-color:#f2d6be;color:#b15e1e}
.mega-link.is-hot:before{content:"";width:4px;height:4px;border-radius:50%;background:#f0a46b;margin-right:5px;flex:none}
.mega-link.is-hot:hover:before{background:#ff6a00}

.mega-empty{padding:44px 20px;text-align:center;color:#7c858b;font-size:12.5px}
.mega-empty b{display:block;font-size:14px;color:#3d4a52;margin-bottom:6px}
.mega-empty p{margin:0 0 10px}
.mega-empty button{border:0;background:none;padding:0;color:#b15e1e;font-size:12.5px;cursor:pointer}

.mega-panel-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 24px;border-top:1px solid #f0f2f4;background:#fff;flex:none}
.mega-panel-footer span{font-size:11.5px;color:#9aa5ad}
.mega-panel-footer button{display:inline-flex;align-items:center;gap:3px;border:0;background:none;padding:0;font-size:12px;color:#b15e1e;cursor:pointer}
.mega-panel-footer .mega-arrow{width:11px;height:11px;color:currentColor}

.mega-mobile-heading{display:none}

/* ---------- 首页 Hero 保持原比例 ---------- */
.home-category-layout .home-promotions{grid-template-columns:minmax(0,1fr) 220px;gap:18px;margin:0}
.home-category-layout .hero{min-height:330px}
.home-category-layout .hero-copy{padding:26px 24px}
.home-category-layout .account-card{padding:19px 16px}

/* ---------- 焦点可见 ---------- */
.category-mega button:focus-visible,.mega-panel button:focus-visible{outline:2px solid #ff6a00;outline-offset:2px;border-radius:6px}

/* ---------- 响应式 ---------- */
@media (min-width:1500px){
  .home-category-layout{--category-rail:252px}
  .home-category-layout .mega-group-title{height:56px;font-size:14px}
  .mega-panel-heading h2{font-size:21px}
}
@media (max-width:1180px){
  .home-category-layout{--category-rail:210px;gap:14px}
  .home-category-layout .home-promotions{grid-template-columns:1fr}
  .home-category-layout .mega-group-title{height:50px;font-size:13px}
  .mega-row{grid-template-columns:100px minmax(0,1fr);padding:12px 18px}
  .mega-panel-head{padding:18px 18px 12px;gap:14px}
  .mega-panel-heading p{display:none}
  .mega-filter{width:150px}
  .mega-panel-footer{padding:10px 18px}
}
@media (max-width:760px){
  .nav .all-categories{display:block;width:auto;padding:0 12px}
  .home-category-layout{display:block;margin-bottom:20px}
  .home-category-layout .category-mega{display:block;border-radius:8px}
  .mega-rail-head{display:none}
  .home-category-layout .mega-groups{display:grid;grid-template-columns:1fr 1fr;padding:6px}
  .home-category-layout .mega-group-title{height:48px;grid-template-columns:18px minmax(0,1fr) auto;gap:7px;padding:0 10px;font-size:12.5px}
  .home-category-layout .mega-group-title .mega-group-arrow{display:none}
  .mega-icon{width:17px;height:17px}
  .mega-rail-foot{display:none}
  .home-category-layout .mega-panel{position:static;max-height:66vh;border-radius:8px;margin-top:10px;box-shadow:none}
  .mega-mobile-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 14px;border-bottom:1px solid #f0f2f4;font-size:13px;color:#3d4a52}
  .mega-mobile-heading div{display:flex;gap:14px;align-items:center}
  .mega-mobile-heading button{border:0;background:none;padding:0;font-size:12px;color:#b15e1e;cursor:pointer}
  .mega-mobile-heading [data-mega-close]{color:#8a939a}
  .mega-panel-head{flex-direction:column;gap:10px;padding:14px}
  .mega-panel-heading h2{font-size:17px}
  .mega-panel-tools{width:100%;padding-top:0}
  .mega-filter{flex:1;width:auto}
  .mega-row{display:block;padding:12px 14px}
  .mega-row-title{font-size:12.5px;padding:0 0 6px}
  .mega-links{gap:3px 2px}
  .mega-link{font-size:12px;height:27px;padding:0 8px}
  .mega-panel-footer{padding:10px 14px}
  .mega-panel-footer span{display:none}
  .home-category-layout .home-promotions{display:block}
  .home-category-layout .hero{min-height:270px}
  .home-category-layout .account-card{margin-top:14px}
}

@media (prefers-reduced-motion:reduce){
  .home-category-layout .mega-group-title,.mega-arrow,.mega-link{transition:none}
}
