/* CMDB 资产分组 / 资产树管理 页面布局收敛
 * 问题：.asset-tree-workspace 用 min-height，树节点变多时整页被拉到 2900px，
 *       左侧树没有独立滚动区，右侧详情被顶到顶部、下方一大片空白。
 * 处理：页面高度锁定为一屏，树区域内部滚动，右栏独立滚动。
 * 作用域仅限 .asset-tree-workspace，该类名只有本页面使用。
 */
.asset-tree-workspace {
  height: calc(100vh - 130px) !important;
  min-height: 320px !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

.asset-tree-workspace > .page-head {
  flex: 0 0 auto !important;
  margin-bottom: 16px !important;
}

.asset-tree-workspace > .tree-shell {
  flex: 1 1 auto !important;
  height: auto !important;
  min-height: 0 !important;
  grid-template-rows: minmax(0, 1fr) !important;
}

.asset-tree-workspace > .tree-shell > .tree-pane {
  min-height: 0 !important;
  overflow: hidden !important;
}

.asset-tree-workspace > .tree-shell > .tree-pane > .asset-tree {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
}

.asset-tree-workspace > .tree-shell > .detail-pane {
  min-height: 0 !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
}

/* 树区域滚动条细化，避免遮挡节点操作按钮 */
.asset-tree-workspace > .tree-shell > .tree-pane > .asset-tree::-webkit-scrollbar,
.asset-tree-workspace > .tree-shell > .detail-pane::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.asset-tree-workspace > .tree-shell > .tree-pane > .asset-tree::-webkit-scrollbar-thumb,
.asset-tree-workspace > .tree-shell > .detail-pane::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.asset-tree-workspace > .tree-shell > .tree-pane > .asset-tree::-webkit-scrollbar-thumb:hover,
.asset-tree-workspace > .tree-shell > .detail-pane::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* 视口过矮时，退化为按内容滚动，避免树区域被压到不可用 */
@media (max-height: 620px) {
  .asset-tree-workspace {
    height: auto !important;
    overflow: visible !important;
  }
}
