// 通用选择器样式
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
}

.modal-content {
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  
  &.large {
    width: 900px;
  }
}

.modal-header {
  padding: 16px 24px;
  border-bottom: 1px solid #e8e8e8;
  display: flex;
  justify-content: space-between;
  align-items: center;
  
  .modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 500;
    color: #333;
  }
  
  .modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    line-height: 24px;
    
    &:hover {
      color: #666;
    }
  }
}

.modal-body {
  flex: 1;
  overflow: hidden;
  padding: 16px 24px;
}

.modal-footer {
  padding: 12px 24px;
  border-top: 1px solid #e8e8e8;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.generic-selector {
  display: flex;
  gap: 16px;
  height: 500px;
}

.selector-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  border: 1px solid #e8e8e8;
  border-radius: 4px;
  background: #fafafa;
  
  .panel-header {
    padding: 12px 16px;
    background: #f0f0f0;
    border-bottom: 1px solid #e8e8e8;
    display: flex;
    justify-content: space-between;
    align-items: center;
    
    .panel-title {
      margin: 0;
      font-size: 14px;
      font-weight: 500;
      color: #333;
    }
    
    .panel-count {
      font-size: 12px;
      color: #999;
    }
  }
  
  .panel-search {
    padding: 12px 16px;
    border-bottom: 1px solid #e8e8e8;
    background: white;
    
    .search-input-small {
      width: 100%;
      padding: 6px 12px;
      border: 1px solid #d9d9d9;
      border-radius: 4px;
      font-size: 14px;
      outline: none;
      
      &:focus {
        border-color: #409EFF;
      }
    }
  }
  
  .panel-body {
    flex: 1;
    overflow-y: auto;
    background: white;
    
    &::-webkit-scrollbar {
      width: 8px;
    }
    
    &::-webkit-scrollbar-track {
      background: #f1f1f1;
    }
    
    &::-webkit-scrollbar-thumb {
      background: #c1c1c1;
      border-radius: 4px;
      
      &:hover {
        background: #a8a8a8;
      }
    }
  }
}

.item-list,
.tree-list {
  padding: 8px;
}

.tree-notice {
  padding: 40px 20px;
  text-align: center;
  color: #909399;
  font-size: 14px;
}

.list-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.2s;
  
  &:hover {
    background-color: #f5f7fa;
  }
  
  &.selected {
    background-color: #e6f7ff;
  }
  
  input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
  }
  
  .item-label {
    flex: 1;
    font-size: 14px;
    color: #333;
  }
  
  .item-sublabel {
    font-size: 12px;
    color: #999;
    margin-left: 8px;
  }
}

.selector-actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  
  .action-btn {
    padding: 8px 16px;
    background: white;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
    min-width: 60px;
    
    &:hover:not(:disabled) {
      border-color: #409EFF;
      color: #409EFF;
    }
    
    &:disabled {
      cursor: not-allowed;
      opacity: 0.5;
    }
    
    .arrow {
      font-size: 16px;
      font-weight: bold;
    }
    
    .btn-text {
      font-size: 12px;
    }
  }
}

.loading-more,
.no-more {
  text-align: center;
  padding: 12px;
  color: #999;
  font-size: 12px;
}

.loading-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.loading-spinner-small {
  width: 16px;
  height: 16px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #409EFF;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.btn-primary {
  padding: 8px 20px;
  background-color: #409EFF;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s;
  
  &:hover:not(:disabled) {
    background-color: #66b1ff;
  }
  
  &:disabled {
    cursor: not-allowed;
    opacity: 0.6;
  }
}

.btn-default {
  padding: 8px 20px;
  background-color: white;
  color: #606266;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
  
  &:hover {
    border-color: #409EFF;
    color: #409EFF;
  }
}

