/* 用户选择组件样式 */

.user-select-container {
  position: relative;
  width: 100%;
}

.user-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;
}

.user-select-input:focus {
  border-color: transparent;
  box-shadow: none;
}

/* 下拉列表容器 - 独立于输入框宽度 */
.user-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;
  /* 如果设置了width则使用width，否则跟随输入框 */
}

/* 用户列表项 */
.user-select-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.user-select-item:hover {
  background-color: #EBF8FF;
}

/* 多选模式下已选中的项 */
.user-select-item.active {
  background-color: #D6DEEB;
}

/* 多选模式复选框 */
.user-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;
}

.user-select-checkbox.checked {
  background: #3966A2;
  border-color: #3966A2;
}

.user-select-checkbox.checked::after {
  content: '✓';
  color: white;
  font-size: 11px;
  font-weight: bold;
}

/* 头像 */
.user-select-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 10px;
  flex-shrink: 0;
  border: 1px solid #D6DEEB;
}

/* 头像占位符（无头像时显示首字） */
.user-select-avatar-placeholder {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  margin-right: 10px;
  flex-shrink: 0;
}

/* 用户信息区域 */
.user-select-info {
  flex: 1;
  min-width: 0;
}

.user-select-name {
  font-size: 13px;
  font-weight: 500;
  color: #132843;
  margin-bottom: 2px;
}

/* 高亮搜索关键字 */
.user-select-highlight {
  background-color: #FFD700;
  color: #132843;
  padding: 0 2px;
  border-radius: 2px;
}

/* 空状态提示 */
.user-select-empty {
  padding: 16px;
  text-align: center;
  color: #999;
  font-size: 12px;
}

/* 加载状态提示 */
.user-select-loading {
  padding: 16px;
  text-align: center;
  color: #999;
  font-size: 12px;
}

/* 多选模式底部操作栏 */
.user-select-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-top: 1px solid #D6DEEB;
  background: #F8F6F6;
  font-size: 12px;
}

.user-select-clear-btn {
  color: #3966A2;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 3px;
  transition: background-color 0.2s;
}

.user-select-clear-btn:hover {
  background: #EBF8FF;
}

.user-select-count {
  color: #666;
}

/* 隐藏的值存储字段 */
.user-select-value {
  display: none;
}
