/* Duohao-like index layout (首页: 分类侧栏 + 商品列表)
   目标：做出截图那种半透明玻璃面板 + 左侧分类 + 右侧表格列表。
   仅依赖现有 Bootstrap，不强制改动其它页面。
*/

.duohao-page{ min-height: calc(100vh - 72px); }

.duohao-shell{
  display:flex;
  gap:20px;
  border-radius: 18px;
  border: 0;
  padding: 14px;
  background: rgba(255,255,255,.10);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 18px 55px rgba(0,0,0,.25);
}

/* Left */
.duohao-side{
  width: 320px;
  max-width: 42vw;
  border-radius: 16px;
  background: rgba(255,255,255,.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 10px 25px rgba(0,0,0,.12);
  padding: 14px;
  overflow: hidden;
}

.duohao-side-title{
  display:flex;
  align-items:center;
  gap:8px;
  font-weight: 700;
  font-size: 14px;
  color: rgba(0,0,0,.70);
  padding: 10px 10px 12px 10px;
  border-bottom: 1px solid rgba(0,0,0,.08);
  margin-bottom: 10px;
}

.duohao-cat-list{
  display:flex;
  flex-direction:column;
  gap:10px;
  max-height: 72vh;
  overflow: auto;
  padding-right: 4px;
}

.duohao-cat{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 12px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,.75);
  border: 1px solid rgba(0,0,0,.06);
  text-decoration: none;
  color: rgba(0,0,0,.72);
  transition: .15s ease;
}

.duohao-cat:hover{ transform: translateY(-1px); box-shadow: 0 8px 18px rgba(0,0,0,.10); }

.duohao-cat.is-active{
  border-color: rgba(22, 117, 255, .35);
  box-shadow: 0 10px 22px rgba(22, 117, 255, .18);
}

.duohao-cat-icon{
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #f2f2f2;
  flex: 0 0 auto;
}

.duohao-cat-icon-star{
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(255, 180, 0, .16);
  color: rgba(255, 140, 0, .95);
}

.duohao-cat-name{ font-weight: 700; font-size: 14px; flex: 1 1 auto; }

/* 右侧数量徽章 + 下拉箭头 */
.duohao-cat-count{
  flex: 0 0 auto;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(22,117,255,.14);
  color: rgba(22,117,255,.95);
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 10px 18px rgba(22,117,255,.18);
}

.duohao-cat-arrow{
  flex: 0 0 auto;
  margin-left: -6px;
  width: 22px;
  height: 22px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius: 999px;
  color: rgba(0,0,0,.55);
  transition: transform .15s ease;
}

.duohao-cat.is-leaf .duohao-cat-arrow{ display:none; }
.duohao-cat.is-open .duohao-cat-arrow{ transform: rotate(180deg); }

/* 二级分类容器 */
.duohao-cat-group{ display:flex; flex-direction:column; gap:8px; }
.duohao-sublist{ display:flex; flex-direction:column; gap:8px; padding-left: 44px; }

/* 二级分类：更“瘦”一点 */
.duohao-cat.is-child{
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,.70);
}
.duohao-cat.is-child .duohao-cat-icon{
  width: 34px;
  height: 34px;
  border-radius: 11px;
}

/* Right */
.duohao-main{
  flex: 1 1 auto;
  min-width: 0;
  border-radius: 16px;
  background: rgba(255,255,255,.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 10px 25px rgba(0,0,0,.12);
  padding: 14px;
}

.duohao-main-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  padding: 10px 10px 12px 10px;
  border-bottom: 1px solid rgba(0,0,0,.08);
  margin-bottom: 12px;
}

.duohao-main-title{
  display:flex;
  align-items:center;
  gap:8px;
  font-weight: 800;
  font-size: 14px;
  color: rgba(0,0,0,.72);
}

.duohao-search{
  display:flex;
  align-items:center;
  gap:10px;
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 999px;
  padding: 6px 12px;
  min-width: 280px;
}

.duohao-search input{
  border: none;
  outline: none;
  background: transparent;
  width: 100%;
  font-size: 13px;
}

.duohao-table-head{
  display:flex;
  gap: 10px;
  align-items:center;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(0,0,0,.04);
  color: rgba(0,0,0,.55);
  font-weight: 700;
  font-size: 12px;
  margin-bottom: 10px;
}

.duohao-table-head .col-name{ flex: 1 1 auto; }
.duohao-table-head .col-stock{ width: 110px; text-align: center; }
.duohao-table-head .col-price{ width: 110px; text-align: center; }
.duohao-table-head .col-action{ width: 120px; text-align: right; }

/* Rows */
.duohao-item-list{ display:flex; flex-direction:column; gap:10px; }

.duohao-row{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 12px 10px;
  border-radius: 14px;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(0,0,0,.06);
  cursor: pointer;
}

.duohao-row.is-soldout{ opacity: .72; }

.duohao-row .cell-name{ flex: 1 1 auto; min-width: 0; display:flex; align-items:center; gap:12px; }
.duohao-row .cell-stock{ width: 110px; text-align:center; }
.duohao-row .cell-price{ width: 110px; text-align:center; }
.duohao-row .cell-action{ width: 120px; text-align:right; }

.duohao-icon{
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background-color: rgba(0,0,0,.06);
  background-position: center;
  background-size: cover;
  flex: 0 0 auto;
}

.duohao-text{ min-width: 0; }

.duohao-title{
  font-weight: 800;
  font-size: 13px;
  color: rgba(0,0,0,.75);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.duohao-desc{
  margin-top: 2px;
  font-size: 12px;
  color: rgba(0,0,0,.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.duohao-meta{ display:flex; align-items:center; gap:8px; margin-top: 6px; flex-wrap:wrap; }

.duohao-tag{
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(22,117,255,.12);
  color: rgba(22,117,255,.95);
}

.duohao-tag.is-recommend{
  background: rgba(255, 140, 0, .14);
  color: rgba(255, 120, 0, .95);
}

.duohao-num{
  font-weight: 900;
  color: rgba(120, 60, 255, .85);
}

.duohao-price{
  font-weight: 900;
  color: #ff6b88;
}

.duohao-buy{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width: 92px;
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,140,70,.95), rgba(245,110,30,.95));
  color: #fff;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 10px 18px rgba(245,110,30,.25);
}

.duohao-buy:hover{ filter: brightness(1.02); transform: translateY(-1px); }

.duohao-buy.is-disabled{
  pointer-events: none;
  background: rgba(150,150,150,.55);
  box-shadow: none;
}

.duohao-empty{
  padding: 14px;
  font-size: 14px;
  color: rgba(0,0,0,.6);
}

/* Notice */
.duohao-notice{
  border-radius: 16px;
  border: 1px solid rgba(0,0,0,.06);
  background: rgba(255,255,255,.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 10px 25px rgba(0,0,0,.12);
  padding: 14px;
}

.duohao-notice-title{ font-weight: 900; color: rgba(0,0,0,.72); margin-bottom: 8px; }
.duohao-notice-body{ color: rgba(0,0,0,.65); font-size: 13px; line-height: 1.6; }

/* Responsive */
@media (max-width: 992px){
  .duohao-shell{ flex-direction: column; }
  .duohao-side{ width: 100%; max-width: 100%; }
  .duohao-cat-list{ max-height: 320px; }
  .duohao-table-head .col-stock,
  .duohao-table-head .col-price,
  .duohao-table-head .col-action{ display:none; }
}









/* 手机端：隐藏你标出来的 库存/单价/操作 + 分类数量徽章 */
@media (max-width: 768px){
  .duohao-cat-count,
  .duohao-cat-arrow{ display:none !important; }

  .col-stock,
  .col-price,
  .col-action{ display:none !important; }

  .duohao-row .cell-stock,
  .duohao-row .cell-price,
  .duohao-row .cell-action{ display:none !important; }
  
}


/* 手机端：售罄角标（电脑端不显示） */
@media (max-width: 768px){
  .duohao-row{
    position: relative;
    overflow: hidden;
  }
  .duohao-row.is-soldout::after{
    content: "售罄";
    position: absolute;
    top: 10px;
    right: -34px;
    transform: rotate(45deg);
    padding: 4px 44px;
    font-size: 12px;
    line-height: 1;
    color: #fff;
    background: rgba(0,0,0,.38);
    border-radius: 2px;
    pointer-events: none;
  }
}

@media (max-width: 768px){
  .duohao-row{
    position: relative;
    overflow: hidden;
  }
  .duohao-tag.is-recommend::after{
    content: "推荐";
    position: absolute;
    top: 10px;
    left: -34px;        /* 改为左边 */
    transform: rotate(-45deg); /* 改为负45度，保持方向正确 */
    padding: 4px 44px;
    font-size: 12px;
    line-height: 1;
    color: rgba(255, 120, 0, .95);
    background: rgba(255, 140, 0, .14);
    border-radius: 2px;
    pointer-events: none;
  }
}




/* 手机端：保留“有二级”的展开箭头提示（覆盖之前的隐藏规则） */
@media (max-width: 768px) {

  /* 如果你之前隐藏了箭头，这里强制显示回来 */
  .duohao-cat-arrow{
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    margin-left: 6px;
    border-radius: 999px;
    background: rgba(73, 126, 255, .12);
    color: #2f6bff;
    font-size: 12px;
    line-height: 1;
  }

  /* 数量徽章你想保留的话也显示（如果你之前也隐藏了它） */
  .duohao-cat-count{
    display: inline-flex !important;
  }
  
}

@media (max-width: 768px) {
  /* 二级项不显示箭头：按你现在的结构，二级一般会带 .cat-child 或 .is-child（有其一就行） */
  .cat-child .duohao-cat-arrow,
  .is-child .duohao-cat-arrow{
    display: none !important;
  }
}


/* 规则：只有有二级分类的一级，才显示箭头 */
.duohao-cat-item .duohao-cat-arrow {
  display: none; /* 默认不显示 */
}

/* 只有被 JS 标记为“有子分类”的一级才显示箭头 */
.duohao-cat-item.has-child .duohao-cat-arrow {
  display: inline-flex;
}

/* 手机端同样适用（确保不被之前的隐藏规则覆盖） */
@media (max-width: 768px) {
  .duohao-cat-item .duohao-cat-arrow {
    display: none !important;
  }

  .duohao-cat-item.has-child .duohao-cat-arrow {
    display: inline-flex !important;
  }
}





/* ===== Mobile inline metrics (stock + price) in meta row ===== */
.duohao-m-metrics{ display:none; }

@media (max-width: 768px){
  /* 手机端：隐藏右侧三列，改为在标签行右侧展示库存/价格 */
  .duohao-row .cell-stock,
  .duohao-row .cell-price,
  .duohao-row .cell-action{ display:none !important; }

  .duohao-meta{
    display:flex !important;
    align-items:center;
    gap:8px;
    flex-wrap:nowrap;
  }

  .duohao-tag{ white-space:nowrap; }

  .duohao-m-metrics{
    display:inline-flex !important;
    align-items:center;
    gap:10px;
    margin-left:auto;           /* 推到右侧 */
    white-space:nowrap;
  }
  .duohao-m-stock{
    font-weight:900;
    color: rgba(120, 60, 255, .85);
    font-size:12px;
  }
  .duohao-m-price{
    font-weight:900;
    color: rgba(20, 160, 80, .95);
    font-size:13px;
  }
}





/* 手机端：让“库存/价格”变成规整的右侧信息块 */
@media (max-width: 768px) {


  .duohao-table-head{
      display: none !important;
      
      
  }
  .duohao-cat{
       padding: 8px 8px;
  }

  /* meta 行保持一行，不换行 */
  .duohao-meta{
    display: flex !important;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    min-width: 0;
  }

  /* ✅ 右侧信息块：固定宽度、右对齐、不会挤乱标签 */
  .duohao-m-metrics{
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: 110px;      /* 你觉得宽就调小，比如 96px */
    flex: 0 0 auto;
    white-space: nowrap;
  }

  /* “库存”小胶囊（数字） */
  .duohao-m-stock{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(123, 92, 255, .10);
    color: #7b5cff;
    font-weight: 800;
    font-size: 12px;
    line-height: 22px;
  }
  /* 给库存自动加个小标签（不需要你在 HTML 写“库存:”） */
  .duohao-m-stock::before{
    content: "库存";
    font-weight: 600;
    opacity: .65;
    margin-right: 6px;
  }

  /* “价格”小胶囊（金额） */
  .duohao-m-price{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 22px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(32, 178, 107, .10);
    color: #ff6b88;
    font-weight: 900;
    font-size: 12px;
    line-height: 22px;
  }
  .duohao-m-price::before{
    
    font-weight: 900;
    margin-right: 2px;
  }
  
  
  
}











