/* ═══════════════════════════════════════════════════════════
   左侧竖向分类导航（V1 / V2 共用）
   —— 单独成文件的原因：Cloudflare 默认缓存静态资源时**忽略查询字符串**，
      给 style.css 加 ?v=hash 并不能穿透边缘缓存。新增文件名必然回源，
      样式改动才能立即生效。改这个文件不用改两个 style*.css。
   ═══════════════════════════════════════════════════════════ */

.side-cats {
  position: fixed;
  left: 14px;
  top: 50%;
  transform: translateY(-50%) translateX(-14px);
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  box-sizing: border-box;
  width: 124px;
  max-height: 84vh;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 8px;
  border-radius: var(--r-lg, 18px);
  /* 浅色皮肤（V1 默认） */
  background: rgba(255, 255, 255, .72);
  border: 1px solid rgba(255, 255, 255, .7);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .85),
    0 8px 32px rgba(0, 0, 0, .1);
  opacity: 0;
  visibility: hidden;
  transition: opacity .35s var(--ease, cubic-bezier(.4, 0, .2, 1)),
              visibility .35s var(--ease, cubic-bezier(.4, 0, .2, 1)),
              transform .35s var(--spring, cubic-bezier(.34, 1.56, .64, 1)),
              width .22s var(--ease, cubic-bezier(.4, 0, .2, 1));
}
.side-cats.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
}

.side-cats .cat-chip {
  width: 100%;
  box-sizing: border-box;
  font-size: 11.5px;
  padding: 6px 8px;
  gap: 5px;
}
.side-cats .cat-icon { font-size: 12px; flex: none; }
.side-cats .cat-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 竖排空间紧张，数量不占位置，改由 title 提示 */
.side-cats .cat-count { display: none; }

/* ── 展开 / 收起开关：任何宽度下都能手动固定展开看完整分类名 ── */
.side-cats-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-bottom: 2px;
  padding: 4px 0;
  font-size: 11px;
  color: var(--text-3);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line-2, rgba(0, 0, 0, .08));
  border-radius: 0;
  cursor: pointer;
  font-family: inherit;
}
.side-cats-toggle:hover { color: var(--text); }
.side-cats-toggle .tw {
  display: inline-block;
  transition: transform .22s var(--ease, cubic-bezier(.4, 0, .2, 1));
  font-size: 9px;
}
.side-cats.pinned .side-cats-toggle .tw { transform: rotate(180deg); }
.side-cats-toggle .tl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.side-cats::-webkit-scrollbar { width: 4px; }
.side-cats::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, .14); border-radius: 2px; }
.side-cats::-webkit-scrollbar-track { background: transparent; }

/* ── 中等宽度（1100~1339）：默认收起只留图标，鼠标移入 / 键盘聚焦 / 手动固定时展开 ──
   收起态仅 40px，几乎不遮内容；展开是临时浮层，移开即收回。 */
@media (min-width: 1100px) and (max-width: 1339px) {
  .side-cats { width: 40px; }
  .side-cats .cat-chip { width: 24px; padding: 6px 0; justify-content: center; }
  .side-cats .cat-name { display: none; }
  .side-cats .side-cats-toggle .tl { display: none; }
  .side-cats:hover, .side-cats:focus-within, .side-cats.pinned { width: 124px; }
  .side-cats:hover .cat-chip, .side-cats:focus-within .cat-chip, .side-cats.pinned .cat-chip {
    width: 100%; padding: 6px 8px; justify-content: flex-start;
  }
  .side-cats:hover .cat-name, .side-cats:focus-within .cat-name, .side-cats.pinned .cat-name { display: block; }
  .side-cats:hover .side-cats-toggle .tl, .side-cats:focus-within .side-cats-toggle .tl,
  .side-cats.pinned .side-cats-toggle .tl { display: inline; }
}

/* ≤1439 时侧栏会压住卡片左缘：闲置压低不透明度，鼠标移入再完全显现 */
@media (min-width: 1100px) and (max-width: 1439px) {
  .side-cats.show { opacity: .74; }
  .side-cats.show:hover, .side-cats.show:focus-within, .side-cats.show.pinned { opacity: 1; }
}

@media (max-width: 1099px) {
  .side-cats { display: none; }
}

/* ── 过渡期兼容 ──
   Cloudflare 边缘缓存里的旧版 style.css 仍带有一条
   「1320~1535 宽度时隐藏分类名」的规则，在缓存过期前会和本文件同时生效。
   这里强制夺回宽屏下的显示权；等边缘缓存全部刷新后本块可安全删除。 */
@media (min-width: 1340px) {
  .side-cats { width: 124px !important; }
  .side-cats .cat-chip {
    width: 100% !important;
    padding: 6px 8px !important;
    justify-content: flex-start !important;
  }
  .side-cats .cat-name { display: block !important; }
  .side-cats .side-cats-toggle .tl { display: inline !important; }
}

/* ═══════════ 皮肤：V1 暗色模式 ═══════════ */
:root[data-theme="dark"] .side-cats {
  background: rgba(10, 13, 28, .72);
  border-color: rgba(255, 255, 255, .12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .08),
    0 8px 32px rgba(0, 0, 0, .5);
}
:root[data-theme="dark"] .side-cats::-webkit-scrollbar-thumb { background: rgba(148, 163, 255, .2); }

/* ═══════════ 皮肤：V2（NEO 深空） ═══════════ */
[data-skin="neo"] .side-cats {
  background: rgba(10, 13, 28, .74);
  border: 1px solid rgba(148, 163, 255, .16);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .06),
    0 8px 34px rgba(0, 0, 0, .5), 0 0 40px rgba(34, 211, 238, .08);
}
[data-skin="neo"] .side-cats::-webkit-scrollbar-thumb { background: rgba(148, 163, 255, .2); }
[data-skin="neo"] .side-cats-toggle { letter-spacing: .04em; border-bottom-color: rgba(148, 163, 255, .14); }
[data-skin="neo"] .side-cats-toggle:hover { color: var(--accent, #22d3ee); }
