@charset "utf-8";
/* CSS Document */

.tree, .tree ul {
    list-style-type: none; /* 移除默认的列表符号 */
}

.tree ul {
    margin-left: 50px; /* 缩进50像素 */
    display: none; /* 默认隐藏子列表 */
    padding-left: 0; /* 移除默认padding */
}

.tree li {
    margin: 5px 0; /* 添加一些间距 */
    cursor: pointer; /* 鼠标悬停时显示手形图标，表示可点击 */
    position: relative; /* 为图标定位做准备 */
    padding-left: 20px; /* 为图标留出空间 */
}

.tree li.active > ul {
    display: block; /* 展开时显示子列表 */
}

/* 控制按钮和搜索框的样式 */
.controls {
    margin-bottom: 20px;
}

.controls button {
    margin-right: 10px;
    padding: 5px 10px;
    cursor: pointer;
}

.controls input[type="text"] {
    padding: 5px;
    width: 200px;
    margin-bottom: 10px;
}

/* 开关样式 */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
    margin-left: 15px;
    vertical-align: middle;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #2196F3;
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* 图标容器 */
.icon-container {
    position: absolute;
    left: 0;
    top: 0;
    width: 16px;
    height: 16px;
    margin-top: calc((1em - 16px) / 2); /* 垂直居中对齐文本 */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 三角形图标（用于有子项目的节点） */
.icon-container.triangle::before {
    content: "";
    display: block;
    width: 0;
    height: 0;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-left: 8px solid #000;
    transition: none; /* 移除过渡效果避免动画过程中的位置计算问题 */
}

/* 打开状态的三角形图标 */
.icon-container.triangle.open::before {
    transform: rotate(90deg);
    /* 确保旋转中心点正确 */
    transform-origin: 50% 50%;
}

/* 圆圈图标（用于没有子项目的节点） */
.icon-container.circle::before {
    content: "";
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #000;
}