/* 侧栏分类树：一级材料默认折叠，点击箭头展开子项
 *
 * 背景：侧栏原本把所有二级分类（PLA+ / TPU 95A / …）全部平铺展开，
 * 二十几个链接把侧栏撑得很长，真正的筛选入口（Materials）被挤到视口外。
 * 现在改成手风琴：一级材料（PLA / PETG / ABS / TPU / ASA）默认收起，
 * 点右侧箭头展开它的子项；当前页所属的一级默认展开（服务器端已输出 is-open）。
 *
 * 无 JS 兜底：<noscript> 里展开全部，避免纯 HTML 客户端无法访问二级页。
 *
 * 注意：/_assets/* 是 immutable 一年缓存，改内容必须换文件名。
 *   cats.css（首版）→ cats2.css（修「当前分类」的橙色被展开态吃掉）。
 *
 * cats2.css 相对 cats.css 的唯一改动 —— 配色语义：
 *   1) 原来 .is-open（展开中）把文字设成主色橙，而 .is-active（当前分类）
 *      的规则是 index6.css 里的 a.is-active，特异性只有 (0,5,2)，
 *      而本文件的基础规则 li.nf-cat > a.nf-cat-link 是 (0,6,3) —— 直接压过它，
 *      于是「当前分类」显示成黑灰色，橙色全被「展开中」占用。
 *      结果就是：点完 PLA，大标题还写着 TPU、侧栏橙的也是 TPU，
 *      看上去 PLA 根本没打开。
 *   2) 现在拆成三条互不打架的规则：
 *      基础 (0,6,3)   → 深灰 #2c333a，普通一级分类
 *      展开 (0,7,3)   → 只给底色，不再改字色
 *      选中 (0,7,3)   → 品牌橙 + 底色，放在最后（与展开同权重，后写者胜）
 */

.rightint-goods-list .sidemenu.nf-sidebar ul.nf-cats li.nf-cat {
  position: relative;
}

/* ---------- 一级分类行 ---------- */
.rightint-goods-list .sidemenu.nf-sidebar ul.nf-cats li.nf-cat > a.nf-cat-link {
  padding-right: 44px;
  font-weight: 600;
  color: #2c333a;
}

/* 展开态：只给底色，主色留给「当前分类」 */
.rightint-goods-list .sidemenu.nf-sidebar ul.nf-cats li.nf-cat.is-open > a.nf-cat-link {
  background: #f7f8f9;
}

/* 当前分类：品牌橙 + 底色
   放在最后：与上面的 .is-open 同为 (0,7,3)，同权重时后写的生效。 */
.rightint-goods-list .sidemenu.nf-sidebar ul.nf-cats li.nf-cat > a.nf-cat-link.is-active {
  color: var(--color-primary, #e58722);
  font-weight: 700;
  background: #f7f8f9;
}

/* ---------- 展开/收起按钮 ---------- */
.rightint-goods-list .sidemenu.nf-sidebar ul.nf-cats li.nf-cat > button.nf-cat-toggle {
  position: absolute;
  top: 0;
  right: 0;
  width: 40px;
  height: 46px;              /* 与一行文字的高度对齐 */
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: #8b9299;
  line-height: 0;
  -webkit-appearance: none;
  appearance: none;
}

.rightint-goods-list .sidemenu.nf-sidebar ul.nf-cats li.nf-cat > button.nf-cat-toggle:hover {
  color: var(--color-primary, #038076);
}

.rightint-goods-list .sidemenu.nf-sidebar ul.nf-cats li.nf-cat > button.nf-cat-toggle:focus-visible {
  outline: 2px solid var(--color-primary, #038076);
  outline-offset: -2px;
}

/* 箭头：默认朝下（收起），展开时朝右 */
.rightint-goods-list .sidemenu.nf-sidebar ul.nf-cats li.nf-cat > button.nf-cat-toggle .nf-cat-arrow {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg) translate(-1px, 1px);
  transition: transform .22s ease;
}

.rightint-goods-list .sidemenu.nf-sidebar ul.nf-cats li.nf-cat.is-open > button.nf-cat-toggle .nf-cat-arrow {
  transform: rotate(45deg) translate(-1px, -1px);
}

/* ---------- 子项容器：默认收起 ---------- */
.rightint-goods-list .sidemenu.nf-sidebar ul.nf-cats ul.nf-cat-subs {
  display: none;
  list-style: none;
  margin: 0;
  padding: 0;
}

.rightint-goods-list .sidemenu.nf-sidebar ul.nf-cats li.nf-cat.is-open > ul.nf-cat-subs {
  display: block;
}

/* 子项 li 原本有 border-bottom，直接继承；容器最后一项去掉，避免双线 */
.rightint-goods-list .sidemenu.nf-sidebar ul.nf-cats ul.nf-cat-subs li {
  border-bottom: 1px solid #ededed;
}

.rightint-goods-list .sidemenu.nf-sidebar ul.nf-cats ul.nf-cat-subs li:last-child {
  border-bottom: 0;
}
