/* 可折叠树形菜单（docs/reference/10 §2.3.4）：用户页左侧部门树；顶部搜索，行高 36（--row-h），每层缩进 14（与部门选择器一致）。
   ≤760 时树不占位，由页头「部门」按钮以左侧抽屉打开。 */
.split { display: grid; grid-template-columns: var(--tree-w) minmax(0, 1fr); gap: var(--sp-4); align-items: start; }
.split.no-tree { grid-template-columns: minmax(0, 1fr); }
.split > .main-col { display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; }

.tree { background: var(--surface); box-shadow: var(--sh-2); border-radius: var(--r-card); display: flex; flex-direction: column; position: sticky; top: calc(var(--topbar-h) + var(--sp-4)); max-height: calc(100vh - var(--topbar-h) - var(--sp-8)); overflow: hidden; min-width: 0; }
.tree-head { flex: none; padding: var(--sp-3); border-bottom: 1px solid var(--border-soft); display: flex; flex-direction: column; gap: var(--sp-2); }
.tree-head input { width: 100%; }
.tree-head .tree-title { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; padding: 0 2px; }
.tree-head .tree-title .meta { font-weight: 400; color: var(--muted); font-size: var(--fs-xs); }
.tree-list { overflow: auto; flex: 1; padding: var(--sp-1) 0; }
.tree-list:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.tree-row { display: flex; align-items: center; gap: var(--sp-1); height: var(--row-h); padding-right: var(--sp-3); cursor: pointer; color: var(--ink-2); white-space: nowrap; position: relative; user-select: none; }
.tree-row:hover { background: var(--hover); color: var(--ink); }
.tree-row.act { background: var(--hover); }
.tree-row.sel { background: var(--row-sel); color: var(--ink); font-weight: 600; }
.tree-row.sel::before { content: ''; position: absolute; left: 0; top: var(--sp-1); bottom: var(--sp-1); width: 3px; border-radius: 0 2px 2px 0; background: var(--brand); }
.tree-row.zero:not(.sel) .tree-name { color: var(--faint); }
.tree-row.all { padding-left: var(--sp-2); }
.tree-row.all .tree-name { font-weight: 600; color: var(--ink); }
.tree-tw { width: 16px; height: var(--row-h); flex: none; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); font-size: var(--fs-axis); }
.tree-tw.has:hover { color: var(--ink); }
.tree-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tree-name mark { background: var(--hl); color: inherit; padding: 0; border-radius: 2px; }
.tree-n { color: var(--muted); font-size: var(--fs-xs); font-weight: 400; font-variant-numeric: tabular-nums; }
.tree-empty { padding: var(--sp-5); text-align: center; color: var(--muted); font-size: var(--fs-sub); }
.tree-foot { flex: none; padding: var(--sp-2) var(--sp-3); border-top: 1px solid var(--border-soft); color: var(--muted); font-size: var(--fs-xs); }
/* 抽屉里的树：去掉外框与粘性定位 */
.drawer .tree { position: static; box-shadow: none; border-radius: 0; max-height: none; height: 100%; }
.tree-toggle { display: none; }

@media (max-width: 760px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .split > .tree { display: none; }
  .tree-toggle { display: inline-flex; }
}
/* ≤1200 侧栏变图标栏后仍有部门树占位：用户表保持可读列宽，放不下时横向滚动，而不是把部门名挤成一字一行。 */
@media (max-width: 1200px) { .split .table-wrap > table { min-width: 760px; } }
