.container {
  padding: 16px;
  background: #f8fafc;
  min-height: 100vh;
  padding-bottom: 100px;
  box-sizing: border-box;
  width: 100%;
  overflow-x: hidden; // 防止水平滚动

  @media (max-width: 375px) {
    padding: 12px; // 小屏幕时减小padding
  }
}

.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 16px;
  margin-bottom: 16px;
  box-sizing: border-box; // 确保padding不会导致超出
  width: 100%;
  overflow: hidden; // 防止内容溢出

  @media (max-width: 375px) {
    padding: 12px; // 小屏幕时减小padding
  }
}

.label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 8px;
}

.labelRequired {
  color: #ef4444;
  margin-left: 2px;
}

.infoIcon {
  color: #94a3b8;
  font-size: 14px;
  margin-left: 4px;
  cursor: help;
}

.radioGroup {
  display: flex;
  gap: 24px;
}

.input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
  box-sizing: border-box;

  &:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
  }

  &::placeholder {
    color: #cbd5e1;
  }
}

// 执行智能体选择区域
.executorSelector {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.2s;

  &:hover {
    border-color: #3b82f6;
  }
}

.executorContent {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  overflow: hidden;
}

.executorAvatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;

  img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

.executorInfo {
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  flex: 1;
}

.executorName {
  font-size: 14px;
  font-weight: 500;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.executorId {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

.executorExpand {
  color: #64748b;
  font-size: 20px;
  flex-shrink: 0;
}

.statusDot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  background: #10b981;
  border: 2px solid #fff;
  border-radius: 50%;
}

// 固定微信号
.wechatSelect {
  position: relative;
  margin-bottom: 12px;
}

.wechatSelectInput {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 12px;

  &:hover {
    border-color: #3b82f6;
  }

  &:active {
    background: #f1f5f9;
  }

  &.disabled {
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
    opacity: 0.6;

    &:hover {
      border-color: #e2e8f0;
    }
  }
}

.selectInputWrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.selectInputPlaceholder {
  font-size: 14px;
  color: #1e293b;
  flex: 1;

  .wechatSelectInput.disabled & {
    color: #94a3b8;
  }
}

.selectInputArrow {
  color: #94a3b8;
  font-size: 14px;
  flex-shrink: 0;
  margin-left: 8px;
}

.selectedList {
  margin-top: 12px;
}

.selectedItem {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  margin-bottom: 8px;
}

.selectedItemContent {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.selectedItemAvatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e2e8f0;
  flex-shrink: 0;
  overflow: hidden;

  img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

.selectedItemInfo {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.selectedItemName {
  font-size: 14px;
  font-weight: 500;
  color: #1e293b;
}

.selectedItemId {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

.deleteButton {
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s;

  &:hover {
    color: #ef4444;
  }
}

// 手动添加
.manualAdd {
  border-top: 1px solid #f1f5f9;
  padding-top: 12px;
  margin-top: 12px;
}

.manualAddLabel {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 8px;
}

.manualAddInput {
  display: flex;
  gap: 8px;
  height: 50px;
  align-items: center;
}

.manualAddInputWrapper {
  position: relative;
  flex: 1;
  height: 100%;
  display: flex;
  align-items: center;
}

.manualAddIcon {
  position: absolute;
  left: 12px;
  color: #94a3b8;
  font-size: 18px;
  pointer-events: none;
  z-index: 1;
}

.manualAddInputField {
  width: 100%;
  height: 100%;
  padding-left: 40px;
  padding-right: 12px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  font-size: 14px;
  outline: none;
  transition: all 0.2s;

  &:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.1);
  }

  &::placeholder {
    color: #cbd5e1;
  }
}

.manualAddButton {
  width: 60px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: #3b82f6;
  border: 1px solid #3b82f6;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
  line-height: 1.2;

  &:hover {
    background: #2563eb;
  }

  &:active {
    transform: scale(0.98);
  }

  span {
    line-height: 1;
  }

  .buttonText2 {
    margin-top: 2px;
  }
}

// 已添加的微信号（带编号）
.addedList {
  margin-top: 12px;
}

.addedItem {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.addedItemContent {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.addedItemNumber {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #bfdbfe;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1e40af;
  font-size: 12px;
  font-weight: bold;
  flex-shrink: 0;
}

.addedItemInfo {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.addedItemName {
  font-size: 14px;
  font-weight: 500;
  color: #1e293b;
}

.addedItemId {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

.addedItemStatus {
  font-size: 12px;
  color: #3b82f6;
  margin-top: 2px;
}

.addedCount {
  font-size: 12px;
  color: #64748b;
  margin-top: 8px;
  text-align: right;
}

// 群管理员
.groupAdminHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.groupAdminLabelWrapper {
  display: flex;
  align-items: center;
  gap: 4px;
}

.switchWrapper {
  position: relative;
  display: inline-block;
}

.groupAdminHint {
  font-size: 12px;
  color: #64748b;
  margin-top: 8px;
}

// 分组方式
.groupMethod {
  display: flex;
  flex-direction: column;
  gap: 12px;

  // 覆盖antd Radio的默认样式
  :global(.ant-radio-group) {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
}

.groupMethodItem {
  display: flex;
  align-items: flex-start;
  cursor: pointer;
}

.groupMethodRadio {
  margin-top: 2px;
}

.groupMethodContent {
  margin-left: 12px;
  flex: 1;
}

.groupMethodTitle {
  font-size: 14px;
  font-weight: 500;
  color: #1e293b;
  margin-bottom: 4px;
}

.groupMethodDesc {
  font-size: 12px;
  color: #64748b;
  line-height: 1.5;
}

// 群配置信息卡片
.groupConfigCard {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  padding: 16px;
  margin-top: 16px;
}

.groupConfigHeader {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.groupConfigIcon {
  color: #3b82f6;
  font-size: 18px;
}

.groupConfigTitle {
  font-size: 14px;
  font-weight: 600;
  color: #3b82f6;
}

.groupConfigRow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;

  &:last-child {
    margin-bottom: 0;
    align-items: flex-start;
  }
}

.groupConfigLabel {
  font-size: 14px;
  color: #1e293b;
}

.groupConfigValue {
  font-size: 14px;
  font-weight: bold;
  color: #3b82f6;
  text-align: right;
}

// 错误提示
.errorTip {
  background: #fff;
  border: 1px solid #fca5a5;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.errorIcon {
  color: #ef4444;
  font-size: 16px;
}

.errorText {
  font-size: 14px;
  color: #ef4444;
}

// 群人数配置
.groupSizeConfig {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.groupSizeRow {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap; // 小屏幕时允许换行

  @media (max-width: 375px) {
    flex-direction: column; // 小屏幕时垂直排列
    gap: 16px;
  }
}

.groupSizeItem {
  flex: 1;
  min-width: 0; // 防止flex item超出容器

  @media (max-width: 375px) {
    flex: none; // 小屏幕时取消flex，占满宽度
    width: 100%;
  }
}

.groupSizeLabel {
  font-size: 14px;
  font-weight: normal;
  color: #1e293b;
  margin-bottom: 8px;
  display: block;
  word-wrap: break-word; // 允许长文本换行
  overflow-wrap: break-word;

  @media (max-width: 375px) {
    font-size: 13px; // 小屏幕时稍微减小字体
  }
}

// 执行时间
.timeRangeContainer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap; // 小屏幕时允许换行

  @media (max-width: 375px) {
    flex-direction: column; // 小屏幕时垂直排列
    align-items: stretch;
    gap: 12px;
  }
}

.timeInputWrapper {
  flex: 1;
  position: relative;
  min-width: 0; // 防止flex item超出容器

  @media (max-width: 375px) {
    flex: none; // 小屏幕时取消flex，占满宽度
    width: 100%;
  }
}

.timeSeparator {
  color: #64748b;
  font-size: 14px;
  flex-shrink: 0;
  margin: 0 4px;

  @media (max-width: 375px) {
    display: none; // 小屏幕时隐藏分隔符
  }
}

.timeInput {
  width: 100%;
  padding: 10px 12px 10px 36px; // 左边留出图标空间
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
  box-sizing: border-box; // 确保padding不会导致超出

  &:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
  }
}

.timeIcon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 16px;
  pointer-events: none;
  z-index: 1;
}

.statusSwitchContainer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
