/* 群组列表容器 - 支持平板模式和迷你模式 */
.group-list {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: transparent;
  /* 继承父级的灰色背景 */
  min-height: 0;
  /* 防止flex子项溢出 */
  transition: all 0.3s ease;
}

/* 平板模式优化 */
.group-list.tablet-mode {
  background: rgba(255, 255, 255, 0.95);
}

/* 迷你模式优化 */
.group-list.mini-mode {
  overflow: hidden;
}

.group-list.mini-mode .group-list-header {
  padding: 12px 8px 8px;
}

.group-list.mini-mode .group-list-content {
  padding: 0 4px 16px;
}

/* 群组列表头部 - 平板模式优化 */
.group-list-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 16px 16px;
  border-bottom: 1px solid #E8EAED;
  /* 使用一致的灰色分隔线 */
  background: transparent;
  /* 继承父级的灰色背景 */
  flex-shrink: 0;
  /* 防止头部被压缩 */
}

.group-list.tablet-mode .group-list-header {
  padding: 16px 20px 12px;
  gap: 10px;
}

.group-list.mini-mode .group-list-header {
  padding: 8px 4px;
  gap: 4px;
  text-align: center;
}

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

.header-title h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #202124;
  /* 使用与ChatInterface.css一致的深灰色 */
}

.header-actions {
  display: flex;
  align-items: center;
}

.header-actions .ant-btn {
  border-radius: 6px;
  /* 使用更小的圆角 */
  border: 1px solid #E8EAED;
  background: transparent;
  color: #5F6368;
  transition: all 0.2s ease;
}

.header-actions .ant-btn:hover {
  background: #F8F9FA;
  border-color: #BDC1C6;
  color: #202124;
}

.header-actions .ant-btn.ant-btn-primary {
  background: #1890FF;
  border: none;
  color: white;
}

.header-actions .ant-btn.ant-btn-primary:hover {
  background: #40A9FF;
}

/* 确保图标大小适中 */
.header-actions .ant-btn .anticon {
  font-size: 14px;
}

/* 搜索框 */
.group-search {
  /* 搜索框已包含在header中，这里不需要额外样式 */
}

.group-search .ant-input-search {
  border-radius: 6px;
  overflow: hidden;
}

.group-search .ant-input-search .ant-input {
  background: #FFFFFF;
  border: 1px solid #E8EAED;
  transition: all 0.2s ease;
}

.group-search .ant-input-search .ant-input:focus {
  background: #FFFFFF;
  border-color: #1890FF;
  box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.1);
}

.group-search .ant-input-search .ant-input-search-button {
  background: #1890FF;
  border: none;
  transition: all 0.2s ease;
}

.group-search .ant-input-search .ant-input-search-button:hover {
  background: #40A9FF;
}

/* 群组统计 */
.group-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  margin: 0;
  background: #FFFFFF;
  border-radius: 6px;
  border: 1px solid #E8EAED;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  gap: 4px;
}

.stat-label {
  font-size: 11px;
  color: #5F6368;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 18px;
  font-weight: 600;
  color: #202124;
}

.stat-value.active {
  color: #52c41a;
}

.stat-value.inactive {
  color: #ff4d4f;
}

/* 群组列表内容 */
.group-list-content {
  flex: 1;
  overflow-y: auto;
  padding: 0 8px 16px;
}

/* 加载状态 */
.loading-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px;
}

/* 空状态 */
.empty-groups {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 300px;
  color: #8c8c8c;
  text-align: center;
  padding: 40px 20px;
}

.empty-groups .anticon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.6;
  color: #d9d9d9;
}

.empty-groups p {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 24px;
  color: #595959;
}

.empty-groups .ant-btn {
  border-radius: 6px;
  /* 使用更小的圆角 */
  margin: 4px;
}

/* 确保空状态按钮中的图标大小适中 */
.empty-groups .ant-btn .anticon {
  font-size: 14px;
  /* 覆盖上面的48px设置 */
  margin-bottom: 0;
  opacity: 1;
}

/* 群组项目 */
.group-item {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  margin: 4px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 置顶群组特殊样式 */
.group-item.pinned {
  background: linear-gradient(135deg, rgba(24, 144, 255, 0.1) 0%, rgba(24, 144, 255, 0.05) 100%);
  border-color: rgba(24, 144, 255, 0.2);
  box-shadow: 0 2px 8px rgba(24, 144, 255, 0.15);
}

.group-item.pinned::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(135deg, #1890ff 0%, #40a9ff 100%);
  border-radius: 12px 0 0 12px;
}

.group-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(135deg, #1890ff 0%, #40a9ff 100%);
  border-radius: 12px 0 0 12px;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.group-item:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.group-item:hover::before {
  width: 4px;
}

.group-item.selected {
  background: linear-gradient(135deg, rgba(24, 144, 255, 0.2) 0%, rgba(24, 144, 255, 0.1) 100%);
  transform: translateX(4px);
  box-shadow: 0 8px 25px rgba(24, 144, 255, 0.3);
  border-color: rgba(24, 144, 255, 0.3);
}

.group-item.selected::before {
  width: 4px;
}

.group-item.selected:hover {
  background: linear-gradient(135deg, rgba(24, 144, 255, 0.25) 0%, rgba(24, 144, 255, 0.15) 100%);
}

/* 群组头像 */
.group-avatar {
  position: relative;
  margin-right: 16px;
  flex-shrink: 0;
}

/* 群组信息 */
.group-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* 群组项特定的布局 - 使用更高优先级选择器 */
.group-item .group-info .group-main-info {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  width: 100% !important;
  flex-wrap: nowrap !important;
}

.group-item .group-info .group-name {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  flex: 1 !important;
  min-width: 0 !important;
  max-width: none !important;
}

.name-section {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.group-name .name-text {
  font-weight: 600;
  color: #262626;
  font-size: 15px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 选中状态下的文本颜色优化 */
.group-item.selected .group-name .name-text {
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.group-item.selected .group-username {
  color: rgba(255, 255, 255, 0.8);
}

.group-item.selected .group-description {
  color: rgba(255, 255, 255, 0.7);
}

.group-item.selected .member-count {
  color: rgba(255, 255, 255, 0.8);
}

.group-item .group-info .stats-section {
  flex-shrink: 0 !important;
  display: flex !important;
  align-items: center !important;
  margin-left: 0 !important;
  white-space: nowrap !important;
}

/* 统计信息样式 - 精简版本 */
.stats-summary {
  font-size: 10px;
  color: #555;
  font-weight: 500;
  white-space: nowrap;
  background: rgba(24, 144, 255, 0.08);
  border: 1px solid rgba(24, 144, 255, 0.15);
  padding: 2px 6px;
  border-radius: 8px;
  line-height: 1.2;
  transition: all 0.2s ease;
}

.stats-summary.loading {
  background: transparent;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  color: #999;
}

.group-item.selected .stats-summary {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.4);
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.group-item:hover .stats-summary {
  color: #333;
  background: rgba(24, 144, 255, 0.12);
  border: 1px solid rgba(24, 144, 255, 0.2);
  transform: translateY(-1px);
}

.group-item.selected:hover .stats-summary {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.5);
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

.group-username {
  font-size: 12px;
  color: #8c8c8c;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.group-description {
  font-size: 12px;
  color: #666;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}

.group-metadata {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.metadata-item {
  display: flex;
  align-items: center;
  font-size: 11px;
  color: #8c8c8c;
}

.last-message-time {
  font-size: 11px;
  color: #bfbfbf;
}

/* 群组状态 */
.group-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.member-count {
  color: #8c8c8c;
  font-size: 11px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

.member-count::before {
  content: '👥';
  font-size: 10px;
}

.status {
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-width: 50px;
  text-align: center;
}

.status.active {
  background: linear-gradient(135deg, #52c41a 0%, #73d13d 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(82, 196, 26, 0.3);
}

.status.inactive {
  background: linear-gradient(135deg, #ff4d4f 0%, #ff7875 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(255, 77, 79, 0.3);
}

/* 移动端适配 */
@media (max-width: 768px) {
  .group-list-header {
    padding: 16px 20px 12px;
  }
  
  .header-title h4 {
    font-size: 16px;
  }
  
  .header-actions .ant-btn {
    border-radius: 16px;
  }
  
  .group-stats {
    margin: 8px 16px 12px;
    padding: 8px 12px;
  }
  
  .group-stats .stat-value {
    font-size: 16px;
  }
  
  .group-stats .stat-label {
    font-size: 10px;
  }
  
  .group-item {
    padding: 12px 16px;
    margin: 2px 4px;
    border-radius: 8px;
  }
  
  .group-avatar {
    margin-right: 12px;
  }
  
  .name-text {
    font-size: 14px;
  }
  
  .group-username {
    font-size: 11px;
  }
  
  .group-description {
    font-size: 11px;
  }
  
  /* 移动端统计信息优化 */
  .stats-summary {
    font-size: 9px;
    padding: 1px 4px;
    border-radius: 6px;
    background: rgba(24, 144, 255, 0.1);
    border: 1px solid rgba(24, 144, 255, 0.2);
  }
  
  .group-item.selected .stats-summary {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.45);
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  }
  
  .metadata-item {
    font-size: 10px;
  }
  
  .member-count {
    font-size: 10px;
  }
  
  .status {
    font-size: 9px;
    padding: 2px 6px;
  }
  
  .empty-groups {
    height: 250px;
    padding: 30px 15px;
  }
  
  .empty-groups .anticon {
    font-size: 40px;
  }
  
  .empty-groups p {
    font-size: 14px;
  }
}

/* 滚动条样式 */
.group-list-content::-webkit-scrollbar {
  width: 6px;
}

.group-list-content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.group-list-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
  transition: background 0.3s ease;
}

.group-list-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* 动画效果 */
.group-item-enter {
  opacity: 0;
  transform: translateX(-20px);
}

.group-item-enter-active {
  opacity: 1;
  transform: translateX(0);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.group-item-exit {
  opacity: 1;
  transform: translateX(0);
}

.group-item-exit-active {
  opacity: 0;
  transform: translateX(-20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 同步按钮特殊样式 */
.header-actions .ant-btn[title="同步群组"] {
  position: relative;
  overflow: hidden;
}

.header-actions .ant-btn[title="同步群组"]::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transition: left 0.5s;
}

.header-actions .ant-btn[title="同步群组"]:hover::before {
  left: 100%;
}

.header-actions .ant-btn.ant-btn-loading {
  animation: syncPulse 2s infinite;
}

@keyframes syncPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(24, 144, 255, 0.4);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(24, 144, 255, 0);
  }
}

/* Badge 样式优化 */
.header-title .ant-badge {
  margin-left: 8px;
}

.header-title .ant-badge .ant-badge-count {
  background: linear-gradient(135deg, #52c41a 0%, #73d13d 100%);
  box-shadow: 0 2px 8px rgba(82, 196, 26, 0.3);
}