﻿.cluster-item-label {
    display: flex; /* Flex布局实现垂直居中 */
    align-items: center; /* 子元素垂直居中 */
    cursor: pointer;
    padding: 4px 10px; /* 增加内边距，提升点击体验 */
    padding-right: 60px; /* 给num预留空间 */
    transition: background-color 0.2s ease;
    border-radius: 3px;
    position: relative; /* num定位基准 */
    line-height: 24px; /* 统一行高，辅助居中 */
}

/* 取消float，改用flex布局排列 */
.check-box-span {
    margin-right: 8px;
    flex-shrink: 0; /* 防止复选框区域被压缩 */
}

/* 文本区域自适应，垂直居中 */
.cluster-item-label .text {
    flex: 1; /* 占满剩余空间（除了复选框和数字） */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    align-self: center; /* 强制垂直居中 */
}

/* 数字垂直居中 */
.cluster-item-label .num {
    position: absolute;
    right: 10px; /* 与label内边距对齐 */
    top: 50%; /* 垂直居中核心 */
    transform: translateY(-50%); /* 精准垂直居中 */
    color: #999;
    font-size: 12px;
    align-self: center; /* 辅助Flex居中 */
}

/* ========== 取消li高亮 ========== */
.cluster-part-content li {
    cursor: default;
    margin: 2px 0; /* 仅保留间距，无其他样式 */
}

/* ========== label高亮 ========== */
.cluster-item-label:hover {
    background-color: #f0f5ff; /* 浅蓝高亮，可自定义 */
}

/* ========== 列表行与树行视觉对齐(行高/内边距同 .tree-node-content) ========== */
.cluster-part-list .cluster-part-content .cluster-item-label {
    padding: 2px 8px;
    padding-right: 44px;
    line-height: 20px;
    border-radius: 4px;
}

.cluster-part-list .cluster-item-label .check-box-span {
    margin-left: 0;
}

.cluster-part-list .cluster-item-label .num {
    right: 8px;
}

/* ========== 聚类“展开更多”服务端分页 ========== */
.cluster-part .cluster-part-content.cluster-part-paged {
    max-height: 480px; /* 超出出现滚动条,“展开更多”按钮固定在列表框下方;需压过 global.css 的 overflow:hidden */
    overflow: hidden;
    overflow-y: auto !important;
}

.cluster-more-box {
    text-align: center;
    padding: 6px 0 4px;
    line-height: 1;
}

.cluster-more {
    display: inline-block;
    color: #5b79a3;
    font-size: 12px;
    letter-spacing: 1px;
    cursor: pointer;
    user-select: none;
    padding: 4px 16px;
    border-radius: 12px;
    transition: color 0.2s ease, background-color 0.2s ease;
}

    .cluster-more:hover {
        color: #2b6cb0;
        background-color: #f2f6fb;
    }

/* ========== 原有样式保留 ========== */
.cluster-part-div {
    z-index: 9999;
    margin: 10px 0;
    padding: 12px 15px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    position: fixed;
    width: 250px;
    background-color: #fff;
    bottom: 55px;
}

.check-box-span {
    margin-top: 5px;
}

.cluster-part-div .btnClear {
    padding: 6px 20px;
    color: #dc3545;
    border: 1px solid #dc3545;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.cluster-part-div .confirm {
    padding: 6px 20px;
    color: #0d6efd;
    border: 1px solid #0d6efd;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.cluster-part-div .selected-count {
    font-size: 14px;
    color: #666;
    text-align: center;
}

.cluster-part-div .btn-group {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}


/* tree*/

.check-box-span {
    float: left;
    margin-right: 6px;
    margin-left: -10px;
}

.cluster-part-content .text {
    cursor: pointer;
}

#root-selected-stats {
    z-index: 9999;
    margin: 10px 0;
    padding: 12px 15px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

    #root-selected-stats .clear {
        padding: 6px 20px;
        color: #dc3545;
        border: 1px solid #dc3545;
        border-radius: 4px;
        cursor: pointer;
        transition: background-color 0.2s ease;
    }

    #root-selected-stats .confirm {
        padding: 6px 20px;
        color: #0d6efd;
        border: 1px solid #0d6efd;
        border-radius: 4px;
        cursor: pointer;
        transition: background-color 0.2s ease;
    }

    #root-selected-stats .selected-count {
        font-size: 14px;
        color: #666;
        text-align: center;
    }

    #root-selected-stats .btn-group {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 15px;
    }

#tree-container,
#tree-container .tree-children {
    list-style: none;
    padding-left: 0;
    margin: 0;
    background: transparent !important;
}

.tree-node-row {
    list-style: none;
    margin: 2px 0;
    padding: 0 0 0 20px; /* 子节点缩进，不影响勾选 */
    background: transparent !important;
    display: block;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

.tree-node-content {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    background: transparent !important;
    width: 100%;
    box-sizing: border-box;
}

.node-label {
    display: flex;
    align-items: center;
    flex: 1;
    background: transparent !important;
    cursor: pointer;
    margin: 0;
    user-select: none;
    padding: 2px 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

    .node-label:hover {
        background-color: #f0f5ff !important;
        color: inherit !important;
    }

.node-checkbox {
    cursor: pointer;
    margin: 0;
    position: relative;
    z-index: 10;
}

.node-label input[type="checkbox"] {
    position: relative;
}

/* 展开按钮样式 */
.node-expand {
    display: inline-block;
    width: 16px;
    height: 16px;
    cursor: pointer;
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0; /* 关键：不压缩宽度 */
    background-color: transparent !important;
}

    .node-expand.expanded {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='4 14 10 8 16 14'%3E%3C/polyline%3E%3C/svg%3E");
    }

    .node-expand.collapsed {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='8 10 14 16 20 10'%3E%3C/polyline%3E%3C/svg%3E");
    }

    .node-expand.loading {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12a9 9 0 0 1-9 9m9-9a9 9 0 0 0-9-9m9 9H3m9 9a9 9 0 0 1-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9'%3E%3C/path%3E%3C/svg%3E");
        animation: spin 1s linear infinite;
    }

/* 核心新增：最后一层占位符样式（与展开按钮同尺寸，无背景图） */
.node-expand-placeholder {
    display: inline-block;
    width: 16px; /* 与展开按钮同宽 */
    height: 16px; /* 与展开按钮同高 */
    flex-shrink: 0; /* 关键：不压缩宽度，保证缩进一致 */
    background-color: transparent !important;
    cursor: default; /* 无点击效果 */
}

.tree-node-content .num {
    margin-left: auto;
    color: #999;
    font-size: 12px;
}

.tree-root-container {
    width: 100%;
    position: relative;
}
/* ========== 左侧聚类整体加载遮罩 ========== */
.facet-loading-mask {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.6);
    z-index: 99;
    border-radius: 6px;
}

.facet-loading-inner {
    position: absolute;
    top: 90px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #fff;
    padding: 12px;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(31, 56, 85, 0.15);
    display: flex;
}

.facet-loading-spinner {
    width: 18px;
    height: 18px;
    border: 2.5px solid #d9e6f5;
    border-top-color: #2b6cb0;
    border-radius: 50%;
    animation: facetSpin 0.8s linear infinite;
}

keyframes facetSpin {
    to {
        transform: rotate(360deg);
    }
}

/* 单框局部加载:框内半透明 + 居中旋转圈 */
.cluster-part.cluster-loading { position: relative; }
.cluster-part.cluster-loading::after {
    content: "";
    position: absolute;
    left: 0; top: 0; right: 0; bottom: 0;
    background-color: rgba(255, 255, 255, 0.55);
    border-radius: 6px;
    z-index: 9;
}
.cluster-part.cluster-loading::before {
    content: "";
    position: absolute;
    top: 50%; left: 50%;
    margin: -12px 0 0 -12px;
    width: 24px; height: 24px;
    border: 2.5px solid #d9e6f5;
    border-top-color: #2b6cb0;
    border-radius: 50%;
    animation: facetSpin 0.8s linear infinite;
    z-index: 10;
}
