.tree-container {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: transparent;
  border: transparent;
  padding: 15px;
  max-width: 400px;
  margin: 20px auto;
  border-radius: 10px;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.tree-search {
  width: 100%;
  padding: 10px 12px;
  font-size: 16px;
  border: none;
  outline: none;
  background-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 6px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.tree-search::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.tree-search:focus {
  background-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.tree-view {
  margin-top: 10px;
  display: none;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 5px;
  background-color: transparent;
}

.tree-actions {
  margin-left: 30px;
  margin-top: 8px;
}

.tree-actions button {
  margin-left: 10px;
  padding: 4px 8px;
  font-size: 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tree-actions .view-btn {
  background-color: rgba(0, 150, 255, 0.7);
  color: white;
}

.tree-actions .view-btn:hover {
  background-color: rgba(0, 150, 255, 0.9);
}

.tree-actions .select-btn {
  background-color: rgba(76, 175, 80, 0.7);
  color: white;
}

.tree-actions .select-btn:hover {
  background-color: rgba(76, 175, 80, 0.9);
}

.tree-node {

  position: relative;
  display: list-item !important;
  visibility: visible !important;
  opacity: 1 !important;
  padding: 4px 8px;/* 减少内边距 */
  margin-left: 20px;
  margin-top: 2px;/* 减少上边距 */
  border-radius: 6px;
  transition: background-color 0.3s ease;
  border-left: 3px solid transparent;
  min-height: 24px;
  background-color: transparent !important;
}

.tree-node > .node-content > .tree-level {
  cursor: pointer;
}

.tree-node:hover {
  background-color: transparent !important;
  border-left-color: #007bff;
}

.tree-node .node-content {
  display: flex;
  align-items: center;
  gap: 2px; /* 确保这个值足够小 */

}

.tree-node input[type="checkbox"] {
  position: relative;
  top: 0;
  left: 0;
  margin-right: 6px; /* 减小默认值 */
  transform: translateY(-2px);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  height: 18px;
  width: 18px;
  border: 2px solid #ffffffcc;
  border-radius: 4px;
  background-color: transparent;
  transition: all 0.2s ease;
  opacity: 0.8;
}

.tree-node input[type="checkbox"]:checked {
  background-color: #007bff;
  border-color: #007bff;
}

.tree-node input[type="checkbox"]:checked::after {
  content: "\2713";
  position: absolute;
  top: 1px;
  left: 4px;
  color: white;
  font-size: 14px;
  font-weight: bold;
}

.tree-node span.node-label {
  margin-left: 2px; /* 确保这个值合理 */
  font-weight: 500;
  font-size: 14px;
  color: #ffffffe6;
  vertical-align: middle;
  line-height: 1.5;
  visibility: visible !important;
  opacity: 1 !important;
  white-space: nowrap;
   padding: 0; /* 确保没有额外内边距 */
}

/* 强制确保子节点可见 */
.tree-node ul.tree-level li.tree-node span.node-label {
  visibility: visible !important;
  opacity: 1 !important;
}

.tree-node input[type="checkbox"],
.tree-node span.node-label,
.tree-node button.display-btn {
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;

}

.tree-level {
  padding-left: 20px;
  list-style-type: none;
}

.view-selected {
  display: block;
  margin: 20px auto;
  padding: 10px 20px;
  background-color: rgba(76, 175, 80, 0.8);
  border: none;
  border-radius: 6px;
  color: white;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  text-align: center;
}

.view-selected:hover {
  background-color: rgba(76, 175, 80, 1);
}

/* Scrollbar styling */
.tree-view::-webkit-scrollbar {
  width: 6px;
}

.tree-view::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.tree-view::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.tree-node .node-content button.display-btn {
  font-size: 12px;
  padding: 2px 4px; /* 缩小按钮内边距 */
   margin-left: 2px; /* 尽量减小这个值 */
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
 
}


.tree-node.collapsed > ul.tree-level > li.tree-node {
  display: none !important;
}

.tree-node > ul.tree-level > li.tree-node {
  display: list-item !important;
}

.tree-node.collapsed > .node-content > .toggle-icon {
  transform: rotate(90deg);
  transition: transform 0.2s;
}

.tree-node.collapsed > ul {
    display: none;
}

.tree-buttons {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.tree-buttons button {
  padding: 6px 12px;
  background-color: #4CAF50;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.tree-buttons button:hover {
  background-color: #45a049;
}