/* 产品列表 / 分类页 / 搜索结果页共用样式 */

/* 白底产品图与浅灰卡片背景融合，避免出现明显白框 */
.card img {
  mix-blend-mode: multiply;
}

/* 长分类名换行时保持编号列不被挤压 */
.tree-link {
  align-items: flex-start;
}

.tree-link > span:first-child {
  flex: 0 0 auto;
  padding-top: 1px;
}

.tree-link > span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* 移动端分类树展开后限制高度，避免页面过长 */
@media (max-width: 1023px) {
  aside ul[id^='tree-sub-'] {
    max-height: 320px;
    overflow-y: auto;
  }
}

/* 锚点定位到产品卡片时留出固定头部的高度 */
article[id^='p-'] {
  scroll-margin-top: 120px;
}

/* 搜索页结果分隔线最后一次不显示 */
.divide-ink-100 > article:last-child {
  border-bottom: 0;
}

/* ---------------------------------------------------------------
   左侧产品分类：支持二级菜单展开
   --------------------------------------------------------------- */
.tree-toggle {
  text-align: left;
}

.tree-arrow {
  transition: transform 0.2s ease;
}

.tree-toggle[aria-expanded="true"] .tree-arrow {
  transform: rotate(180deg);
}

.tree-sub {
  background-color: #f6f8fa;
  padding: 0.25rem 0 0.5rem;
}

.tree-sub a {
  display: block;
  padding: 0.4rem 1rem 0.4rem 2.75rem;
  font-size: 12px;
  line-height: 1.4;
  color: #5b7184;
  transition: color 0.2s ease;
}

.tree-sub a:hover {
  color: #c8102e;
}

/* 当前所在产品：二级菜单内高亮 */
.tree-sub a.is-active {
  color: #c8102e;
  font-weight: 600;
  background-color: #fdf3f4;
}

/* 收起状态：二级分类默认不可见（同时兼容 hidden 属性与 class） */
.tree-sub[hidden],
.tree-sub.hidden {
  display: none;
}
