/* 部门选择组件样式 */

.department-select-container {
  position: relative;
  width: 100%;
}

.department-select-input {
  width: 100%;
  padding: 4px 6px;
  border: none;
  border-radius: 0;
  font-size: 12px;
  font-family: 'Microsoft YaHei', Arial, sans-serif;
  background: transparent;
  cursor: text;
  outline: none;
  box-sizing: border-box;
  min-width: 80px;
}

.department-select-input:focus {
  border-color: transparent;
  box-shadow: none;
}

.department-select-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 100%;
  max-width: 400px;
  max-height: 300px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #D6DEEB;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  margin-top: 2px;
}

.department-select-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.department-select-item:hover {
  background-color: #EBF8FF;
}

.department-select-item.active {
  background-color: #D6DEEB;
}

.department-select-checkbox {
  width: 16px;
  height: 16px;
  border: 1px solid #ccc;
  border-radius: 3px;
  margin-right: 10px;
  flex-shrink: 0;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.department-select-checkbox.checked {
  background: #3966A2;
  border-color: #3966A2;
}

.department-select-checkbox.checked::after {
  content: '✓';
  color: white;
  font-size: 11px;
  font-weight: bold;
}

.department-select-icon {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: linear-gradient(135deg, #4A90E2 0%, #3966A2 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  margin-right: 10px;
  flex-shrink: 0;
}

.department-select-info {
  flex: 1;
  min-width: 0;
}

.department-select-name {
  font-size: 13px;
  font-weight: 500;
  color: #132843;
  margin-bottom: 2px;
}

.department-select-highlight {
  background-color: #FFD700;
  color: #132843;
  padding: 0 2px;
  border-radius: 2px;
}

.department-select-empty {
  padding: 16px;
  text-align: center;
  color: #999;
  font-size: 12px;
}

.department-select-loading {
  padding: 16px;
  text-align: center;
  color: #999;
  font-size: 12px;
}

.department-select-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-top: 1px solid #D6DEEB;
  background: #F8F6F6;
  font-size: 12px;
}

.department-select-clear-btn {
  color: #3966A2;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 3px;
  transition: background-color 0.2s;
}

.department-select-clear-btn:hover {
  background: #EBF8FF;
}

.department-select-count {
  color: #666;
}

.department-select-value {
  display: none;
}

/* ========== 树形结构样式 ========== */

/* 树节点容器 */
.department-select-tree {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* 树节点项 */
.department-select-tree-node {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* 树节点行（可点击选择） */
.department-select-tree-row {
  display: flex;
  align-items: center;
  padding: 6px 12px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.department-select-tree-row:hover {
  background-color: #EBF8FF;
}

.department-select-tree-row.active {
  background-color: #D6DEEB;
}

/* 展开/折叠按钮 */
.department-select-toggle {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  margin-right: 4px;
  color: #3966A2;
  font-size: 12px;
  user-select: none;
  transition: transform 0.2s;
}

.department-select-toggle.collapsed {
  transform: rotate(-90deg);
}

.department-select-toggle-placeholder {
  width: 16px;
  flex-shrink: 0;
  margin-right: 4px;
}

/* 子节点容器 */
.department-select-tree-children {
  list-style: none;
  margin: 0;
  padding: 0 0 0 20px;
  overflow: hidden;
}

.department-select-tree-children.collapsed {
  display: none;
}