/**
 * 灵犀云 - 极简主题 (Minimal Theme)
 * 参考 ChatGPT 设计风格
 * 白色 + 灰色 + 绿色强调
 */

/* ===== 基础重置 ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #f7f7f8;
  color: #202123;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

html {
  overflow-x: hidden;
}

/* ===== 侧边栏 ===== */
.sidebar {
  top: 56px;
  height: calc(100vh - 56px);
  position: fixed;
  left: 0;
  width: 260px;
  background: #ffffff;
  border-right: 1px solid #e5e5e5;
  display: flex;
  flex-direction: column;
  z-index: 1001;
  transition: transform 0.3s ease, width 0.1s ease;
}

.sidebar.collapsed {
  transform: translateX(-100%);
}

/* 侧边栏品牌区域 */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e5e5;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s;
}

.sidebar-brand:hover {
  background: #f4f4f4;
}

.sidebar-brand-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #10a37f 0%, #0d8a6a 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 2px 8px rgba(16, 163, 127, 0.3);
}

.sidebar-brand-icon svg {
  width: 24px;
  height: 24px;
}

.sidebar-brand-name {
  font-size: 20px;
  font-weight: 700;
  color: #10a37f;
  letter-spacing: 0.5px;
}

.sidebar-header {
  padding: 12px;
  border-bottom: 1px solid #e5e5e5;
  display: flex;
  gap: 8px;
}

.sidebar-new-chat {
  flex: 1;
  padding: 12px 16px;
  background: #10a37f;
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.2s;
}

.sidebar-new-chat:hover {
  background: #0d8a6a;
}

.sidebar-close {
  display: none;
  width: 40px;
  height: 40px;
  background: #f4f4f4;
  border: none;
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
  color: #6e6e80;
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.sidebar-section {
  margin-bottom: 20px;
}

.sidebar-section-title {
  font-size: 12px;
  color: #6e6e80;
  font-weight: 500;
  padding: 8px 12px;
  text-transform: uppercase;
}

.sidebar-session {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  margin-bottom: 2px;
}

.sidebar-session:hover {
  background: #f4f4f4;
}

.sidebar-session.active {
  background: #e6f7f1;
}

.sidebar-session i {
  flex-shrink: 0;
}

.sidebar-session-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-session-title {
  font-size: 14px;
  color: #202123;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-session-time {
  font-size: 11px;
  color: #6e6e80;
}

.sidebar-session-delete {
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  background: none;
  border: none;
  color: #6e6e80;
  cursor: pointer;
  transition: opacity 0.2s, color 0.2s;
}

.sidebar-session:hover .sidebar-session-delete {
  opacity: 1;
}

.sidebar-session-delete:hover {
  color: #ef4444;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid #e5e5e5;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.sidebar-user:hover {
  background: #f4f4f4;
}

.sidebar-user-avatar-wrapper {
  position: relative;
  flex-shrink: 0;
}

.sidebar-user-avatar{
  width: 32px;
  height: 32px;
  background: #10a37f;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 14px;
  font-weight: 500;
}

.sidebar-user-badge{
  position: absolute;
  bottom: -4px;
  right: -4px;
  padding: 2px 6px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  z-index: 1;
}

.sidebar-user-badge.free{
  background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
  color: white;
}

.sidebar-user-badge.lite{
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
  color: white;
}

.sidebar-user-badge.pro{
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  animation: badge-glow 2s ease-in-out infinite;
}

@keyframes badge-glow{
  0%, 100%{
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
  }
  50%{
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.6);
  }
}

/* 用户头像徽章 */
.sidebar-user-avatar-wrapper {
  position: relative;
  display: inline-block;
}

.sidebar-user-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 2px solid white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.sidebar-user-badge.free {
  background: #9ca3af;
  color: white;
}

.sidebar-user-badge.lite {
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
  color: white;
}

.sidebar-user-badge.pro {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: white;
  animation: badge-glow 2s ease-in-out infinite;
}

@keyframes badge-glow {
  0%, 100% {
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
  }
  50% {
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.6);
  }
}

.sidebar-user-name {
  font-size: 14px;
  color: #202123;
  font-weight: 500;
}

/* 侧边栏功能区（中间） */
.sidebar-tools {
  padding: 12px;
  border-top: 1px solid #e5e5e5;
  border-bottom: 1px solid #e5e5e5;
}

.sidebar-tool-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 14px;
  color: #202123;
}

.sidebar-tool-item:hover {
  background: #f4f4f4;
}

.sidebar-tool-item .tool-icon {
  font-size: 16px;
  width: 24px;
  text-align: center;
}

/* 底部用户区 */
.sidebar-footer {
  padding: 12px;
  position: relative;
}

.sidebar-user-trigger {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.sidebar-user-trigger:hover {
  background: #f4f4f4;
}

.sidebar-user-arrow {
  margin-left: auto;
  font-size: 10px;
  color: #6e6e80;
  transition: transform 0.2s;
}

.sidebar-user-trigger.active .sidebar-user-arrow {
  transform: rotate(180deg);
}

/* 用户下拉菜单 */
.sidebar-user-menu {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 12px;
  right: 12px;
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.15);
  padding: 8px;
  z-index: 100;
}

.sidebar-user-menu.show {
  display: block;
}

/* 侧边栏菜单项 */
.sidebar-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 14px;
  color: #202123;
}

.sidebar-menu-item:hover {
  background: #f4f4f4;
}

.sidebar-menu-item.danger {
  color: #ef4444;
}

.sidebar-menu-item.danger:hover {
  background: #fef2f2;
}

.sidebar-menu-item .menu-icon {
  font-size: 16px;
  width: 24px;
  text-align: center;
}

.sidebar-divider {
  height: 1px;
  background: #e5e5e5;
  margin: 8px 0;
}

/* 侧边栏遮罩 */
.sidebar-overlay {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s;
}

.sidebar-overlay.show {
  display: block;
  opacity: 1;
}

/* 侧边栏拖拽调整器 */
.sidebar-resizer {
  position: fixed;
  left: 260px;
  width: 5px;
  background: transparent;
  cursor: col-resize;
  z-index: 1002;
  transition: left 0.1s ease;
}

.sidebar-resizer:hover,
.sidebar-resizer.dragging {
  background: #10a37f;
}

.sidebar.collapsed + .sidebar-resizer {
  display: none;
}

/* 主内容区 */
.main-content {
  margin-left: 260px;
  min-height: 100vh;
  transition: margin-left 0.3s ease;
}

.main-content.expanded {
  margin-left: 0;
}

/* 侧边栏切换按钮 */
.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  border-radius: 8px;
  font-size: 20px;
  cursor: pointer;
  color: #202123;
  transition: background 0.2s;
}

.sidebar-toggle:hover {
  background: #f4f4f4;
}

/* ===== 导航栏 ===== */
.navbar {
  background: #ffffff;
  border-bottom: 1px solid #e5e5e5;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: fixed;
  left: 0;
  right: 0;
  z-index: 100;
  height: 56px;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo {
  color: #10a37f;
  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: none;
}

/* 连接状态 - 只显示圆点 */
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ef4444;
  transition: background 0.3s;
}

.status-dot.connected {
  background: #10a37f;
}

.status-indicator {
  display: flex;
  align-items: center;
  padding: 6px;
  border-radius: 50%;
  background: transparent;
  transition: background 0.3s;
}

.status-indicator:hover {
  background: rgba(0,0,0,0.05);
}

.status-indicator .status-dot {
  width: 10px;
  height: 10px;
  background: #10a37f;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Agent 切换器 - 只显示图标和箭头 */
.agent-switcher {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  background: #ffffff;
  border: 1px solid #d9d9e3;
  border-radius: 24px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.agent-switcher:hover {
  background: #f9f9f9;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.agent-avatar-mini {
  font-size: 1.2rem;
}

.agent-switcher-arrow {
  font-size: 0.5rem;
  color: #6e6e80;
}

.agent-avatar-mini {
  font-size: 1.3rem;
}

/* Agent 下拉菜单 */
.agent-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: -8px;
  min-width: 240px;
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.12);
  padding: 8px;
  display: none;
  z-index: 1000;
}

.agent-dropdown.show {
  display: block;
}

.agent-dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.agent-dropdown-item:hover {
  background: #f4f4f4;
}

.agent-dropdown-item.active {
  background: #e6f7f1;
}

.agent-dropdown-item .emoji {
  font-size: 1.3rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f4f4f4;
  border-radius: 50%;
}

.agent-dropdown-item .info h4 {
  font-size: 0.9rem;
  font-weight: 500;
  color: #202123 !important;
}

.agent-dropdown-item .info p {
  font-size: 0.75rem;
  color: #6e6e80 !important;
}

/* 用户头像圆圈 */
.user-avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #10a37f;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.2s;
}

.user-avatar-circle:hover {
  transform: scale(1.05);
}

/* 下拉菜单 */
.dropdown {
  position: relative;
}

.dropdown-content {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.12);
  padding: 8px;
  display: none;
}

.dropdown-content.show {
  display: block;
}

.dropdown-header {
  padding: 12px 14px;
  font-weight: 600;
  color: #202123;
  border-bottom: 1px solid #e5e5e5;
  margin-bottom: 8px;
}

.dropdown-item {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  color: #202123;
  cursor: pointer;
  transition: background 0.2s;
}

.dropdown-item:hover {
  background: #f4f4f4;
}

.dropdown-item.danger {
  color: #ef4444;
}

.dropdown-item.danger:hover {
  background: #fef2f2;
}

.dropdown-divider {
  height: 1px;
  background: #e5e5e5;
  margin: 8px 0;
}

/* 旧样式保留兼容 */
.nav-btn {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid #d9d9e3;
  border-radius: 8px;
  color: #6e6e80;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.nav-btn:hover {
  background: #f4f4f4;
  border-color: #c5c5d2;
}

/* Agent 下拉菜单 */
.agent-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 260px;
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.12);
  padding: 8px;
  display: none;
  z-index: 1000;
}

.agent-dropdown.show {
  display: block;
}

.agent-dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.agent-dropdown-item:hover {
  background: #f4f4f4;
}

.agent-dropdown-item.active {
  background: #e6f7f1;
}

.agent-dropdown-item .emoji {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f4f4f4;
  border-radius: 50%;
}

.agent-dropdown-item .emoji svg {
  width: 20px;
  height: 20px;
  color: #10a37f;
}

.agent-dropdown-item .info h4 {
  font-size: 0.95rem;
  font-weight: 500;
  color: #202123 !important;
}

.agent-dropdown-item .info p {
  font-size: 0.8rem;
  color: #6e6e80 !important;
}

/* ===== 用户下拉 ===== */
.dropdown {
  position: relative;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #ffffff;
  border: 1px solid #d9d9e3;
  border-radius: 24px;
  cursor: pointer;
  transition: all 0.2s;
}

.user-info:hover {
  background: #f9f9f9;
}

.user-avatar {
  width: 28px;
  height: 28px;
  background: #10a37f;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.8rem;
}

.user-name {
  font-size: 0.9rem;
  color: #202123;
}

.dropdown-content {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.12);
  padding: 8px;
  display: none;
}

.dropdown-content.show {
  display: block;
}

.dropdown-item {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  color: #202123;
  cursor: pointer;
  transition: background 0.2s;
}

.dropdown-item:hover {
  background: #f4f4f4;
}

.dropdown-item.danger {
  color: #ef4444;
}

.dropdown-item.danger:hover {
  background: #fef2f2;
}

.dropdown-divider {
  height: 1px;
  background: #e5e5e5;
  margin: 8px 0;
}

/* ===== 聊天容器 ===== */
.chat-container {
  max-width: 768px;
  margin: 0 auto;
  padding: 80px 24px 24px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ===== 消息列表 ===== */
.messages {
  flex: 1;
  padding-bottom: 20px;
}

/* ===== 欢迎界面 ===== */
.welcome {
  text-align: center;
  padding: 60px 20px;
}

/* 加载动画 */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.welcome-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, #10a37f 0%, #0d8a6a 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(16, 163, 127, 0.35);
}

.welcome-icon svg {
  width: 40px;
  height: 40px;
  color: white;
}

.welcome-emoji {
  font-size: 3rem;
  margin-bottom: 20px;
}

.welcome-title {
  font-size: 1.75rem;
  font-weight: 600;
  color: #202123;
  margin-bottom: 12px;
}

.welcome-desc {
  font-size: 1rem;
  color: #6e6e80;
  margin-bottom: 30px;
}

.team-tags {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.team-tag {
  padding: 8px 16px;
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 20px;
  font-size: 0.85rem;
  color: #202123;
}

/* ===== 消息气泡 ===== */
.message {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  padding: 0 8px;
  max-width: 100%;
  overflow: hidden;
}

.message .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #10a37f;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}

.message .avatar svg {
  width: 20px;
  height: 20px;
  color: white;
}

.message.user .avatar {
  background: #6e6e80;
}

.message .bubble {
  flex: 1;
  max-width: calc(100% - 52px);
  background: #ffffff;
  padding: 16px 20px;
  border-radius: 16px;
  border: 1px solid #e5e5e5;
  color: #202123;
  line-height: 1.7;
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: break-word;
  overflow-x: hidden;
}

.message.user {
  flex-direction: row-reverse;
}

.message.user .bubble {
  background: #f4f4f4;
  border: none;
}

/* 打字动画 */
.typing {
  display: flex;
  gap: 5px;
  padding: 4px;
}

.typing span {
  width: 8px;
  height: 8px;
  background: #10a37f;
  border-radius: 50%;
  animation: typing-bounce 1.4s ease-in-out infinite;
}

.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

/* ===== 输入区域 ===== */
.input-area {
  background: #ffffff;
  border: 1px solid #d9d9e3;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  margin-top: auto;
}

.quick-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.quick-btn {
  padding: 8px 16px;
  background: #f4f4f4;
  border: 1px solid #e5e5e5;
  border-radius: 20px;
  font-size: 0.85rem;
  color: #202123;
  cursor: pointer;
  transition: all 0.2s;
}

.quick-btn:hover {
  background: #e5e5e5;
}

.input-wrapper {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.input-field {
  flex: 1;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 1rem;
  color: #202123;
  background: #ffffff;
  resize: none;
  min-height: 52px;
  max-height: 200px;
  outline: none;
  transition: border-color 0.2s;
}

.input-field:focus {
  border-color: #10a37f;
}

.input-field::placeholder {
  color: #acacbe;
}

.send-btn {
  width: 48px;
  height: 48px;
  background: #10a37f;
  border: none;
  border-radius: 12px;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.send-btn:hover {
  background: #0d8a6a;
}

/* 语音输入按钮 */
.voice-btn,
.image-btn,
.camera-btn {
  width: 48px;
  height: 48px;
  background: transparent;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.voice-btn:hover,
.image-btn:hover,
.camera-btn:hover {
  background: #f9fafb;
  border-color: #10a37f;
  color: #10a37f;
}

.image-btn.has-image {
  border-color: #10a37f;
  color: #10a37f;
  background: rgba(16, 163, 127, 0.1);
}

/* 图片预览区域 */
.image-preview-container {
  position: relative;
  margin-bottom: 12px;
  display: none;
}

/* 图片预览动画 */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes zoomIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.image-preview-overlay {
  animation: fadeIn 0.2s ease;
}

.image-preview-container.show {
  display: block;
}

.image-preview-container.uploading::after {
  content: '上传中...';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 10;
}

.image-preview-wrapper {
  position: relative;
  display: inline-block;
  max-width: 200px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.image-preview {
  width: 100%;
  height: auto;
  display: block;
}

.image-preview-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.image-preview-remove:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.1);
}

/* 文档信息覆盖层 */
.file-info-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0));
  color: white;
  font-size: 11px;
  white-space: pre-line;
  text-align: center;
  pointer-events: none;
  border-radius: 0 0 12px 12px;
}

/* 文档预览卡片样式 */
.document-preview-card {
  position: relative;
  width: 120px;
  height: 120px;
  background: #f8f9fa;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px solid #e5e5e5;
  overflow: hidden;
}

.document-type-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: bold;
  color: white;
  text-transform: uppercase;
}

.document-type-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.document-filename {
  font-size: 11px;
  color: #666;
  text-align: center;
  padding: 0 8px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 上传进度条 */
.upload-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.upload-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4CAF50, #8BC34A);
  width: 0%;
  transition: width 0.3s ease;
}

.image-preview-container.uploading .upload-progress-bar {
  display: block;
}

.image-preview-remove:hover {
  background: rgba(239, 68, 68, 0.9);
  transform: scale(1.1);
}

/* 隐藏的文件输入框 */
.image-input {
  display: none;
  border-color: #10a37f;
  color: #10a37f;
}

.voice-btn.recording {
  background: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
  color: #ef4444;
  animation: pulse 1.5s ease-in-out infinite;
}

.voice-btn.recording:hover {
  background: rgba(239, 68, 68, 0.15);
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
  }
}

/* 深色主题适配 */
.dark .voice-btn {
  background: transparent;
  border-color: #404040;
  color: #9ca3af;
}

.dark .voice-btn:hover {
  background: #2d2d2d;
  border-color: #10a37f;
  color: #10a37f;
}

.dark .voice-btn.recording {
  background: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
  color: #ef4444;
}
}

.send-btn.stopping {
  background: #ef4444;
}

/* ===== 弹窗 ===== */
.modal-overlay {
  position: fixed;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1100;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.modal-overlay.show,
.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: #ffffff;
  border-radius: 16px;
  width: 90%;
  max-width: 480px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 8px 40px rgba(0,0,0,0.2);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #e5e5e5;
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #202123;
}

.close-btn {
  width: 32px;
  height: 32px;
  background: #f4f4f4;
  border: none;
  border-radius: 8px;
  font-size: 1.2rem;
  cursor: pointer;
  color: #6e6e80;
}

.modal-body {
  padding: 24px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  color: #202123;
  margin-bottom: 8px;
  font-weight: 500;
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #d9d9e3;
  border-radius: 10px;
  font-size: 0.95rem;
  color: #202123;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus {
  border-color: #10a37f;
}

.submit-btn {
  width: 100%;
  padding: 14px;
  background: #10a37f;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 500;
  color: white;
  cursor: pointer;
  transition: background 0.2s;
}

.submit-btn:hover {
  background: #0d8a6a;
}

/* ===== 团队成员 ===== */
.team-member {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: #f9f9f9;
  border-radius: 10px;
  margin-bottom: 8px;
}

.team-member-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.team-member-avatar {
  width: 40px;
  height: 40px;
  background: #e5e5e5;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.team-member-name {
  font-weight: 500;
  color: #202123;
}

.team-member-role {
  font-size: 0.8rem;
  color: #6e6e80;
}

.remove-btn {
  padding: 6px 12px;
  background: transparent;
  border: 1px solid #d9d9e3;
  border-radius: 6px;
  font-size: 0.8rem;
  color: #6e6e80;
  cursor: pointer;
}

.remove-btn:hover {
  background: #fef2f2;
  border-color: #fecaca;
  color: #ef4444;
}

.agent-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #ffffff;
  border: 1px solid #d9d9e3;
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.agent-chip:hover {
  background: #f4f4f4;
  border-color: #10a37f;
}

/* ===== 会话列表 ===== */
.session-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
}

.session-item:hover {
  background: #f4f4f4;
}

.session-item.active {
  background: #e6f7f1;
}

.session-avatar {
  width: 40px;
  height: 40px;
  background: #e5e5e5;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.session-name {
  font-weight: 500;
  color: #202123;
}

.session-preview {
  font-size: 0.8rem;
  color: #6e6e80;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.session-delete {
  margin-left: auto;
  padding: 4px 8px;
  background: transparent;
  border: none;
  color: #6e6e80;
  cursor: pointer;
  font-size: 1.2rem;
}

.session-delete:hover {
  color: #ef4444;
}

/* ===== 工具类 ===== */
.hidden {
  display: none !important;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  /* 移动端基础适配 */
  html, body {
    height: auto;
    overflow-x: hidden;
  }

  body {
    display: block;
  }

  /* 侧边栏移动端适配 */
  .sidebar {
    transform: translateX(-100%);
    width: 280px;
  }

  .sidebar.show {
    transform: translateX(0);
  }

  .sidebar-resizer {
    display: none;
  }

  .sidebar-close {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .main-content {
    margin-left: 0;
  }

  .sidebar-overlay.show + .sidebar-resizer,
  .sidebar.show + .sidebar-resizer {
    display: none;
  }
  
  .navbar {
    padding: 8px 12px;
    height: 56px;
    min-height: 56px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    flex-shrink: 0;
  }
  
  .chat-container {
    padding: 70px 12px 24px;
    margin-top: 56px;
    min-height: auto;
    height: calc(100vh - 56px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
  }
  
  .messages {
    flex: 1;
    padding-bottom: 20px;
    overflow-y: auto;
  }
  
  .input-area {
    padding: 12px;
    margin-top: auto;
    background: #fff;
    border-radius: 16px;
    position: sticky;
    bottom: 0;
    flex-shrink: 0;
  }
  
  /* 隐藏签到文字，只显示图标 */
  .checkin-text, .checkin-points {
    display: none;
  }
  
  .checkin-btn {
    padding: 8px;
    border-radius: 50%;
  }
  
  .nav-btn {
    padding: 6px 12px;
    font-size: 0.85rem;
  }
  
  .user-name {
    display: none;
  }
  
  /* 欢迎界面适配 */
  .welcome {
    padding: 40px 16px;
  }
  
  .welcome-emoji {
    font-size: 2.5rem;
  }
  
  .welcome-title {
    font-size: 1.5rem;
  }
  
  /* 下拉菜单适配 */
  .dropdown-content {
    right: 0;
    left: auto;
    min-width: 200px;
  }
  
  .agent-dropdown {
    right: -60px;
    min-width: 200px;
  }
}

/* ===== Agent 示例样式 ===== */
.agent-examples {
  width: 100%;
  margin-top: 12px;
  margin-left: 52px;
}

.examples-title {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 8px;
}

.examples-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.agent-example {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.agent-example:hover {
  background: rgba(16,163,127,0.15);
  border-color: #10a37f;
}

.agent-example .example-text {
  flex: 1;
  font-size: 13px;
  color: rgba(255,255,255,0.9);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-example .example-desc {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.1);
  padding: 3px 8px;
  border-radius: 4px;
  margin-left: 12px;
  flex-shrink: 0;
}

/* Agent 下拉增强 */
.agent-dropdown-item {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.agent-dropdown-item:hover {
  background: rgba(255,255,255,0.1);
}

.agent-dropdown-item.active {
  background: rgba(16,163,127,0.2);
}

.agent-dropdown-item .emoji {
  font-size: 24px;
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.agent-dropdown-item .info h4 {
  font-size: 14px;
  margin-bottom: 2px;
  color: #202123 !important;
}

.agent-dropdown-item .info p {
  font-size: 12px;
  color: #6e6e80 !important;
}

/* 可添加成员增强 */
.agent-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  margin: 4px;
}

.agent-chip:hover {
  background: rgba(16,163,127,0.15);
  border-color: #10a37f;
}

.agent-chip span:first-child {
  font-size: 20px;
}

/* Agent 下拉示例 */
.agent-list {
  max-height: 280px;
  overflow-y: auto;
}

.agent-examples-dropdown {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 12px;
  background: rgba(0,0,0,0.2);
}

.agent-examples-dropdown .examples-title {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 8px;
}

.agent-examples-dropdown .examples-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
}

.agent-example-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  gap: 8px;
}

.agent-example-item:hover {
  background: rgba(16,163,127,0.2);
}

.agent-example-item .example-text {
  flex: 1;
  font-size: 13px;
  color: rgba(255,255,255,0.9);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-example-item .example-tag {
  font-size: 10px;
  color: rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.1);
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}

/* 团队成员样式优化 */
.team-member {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.team-member:last-child {
  border-bottom: none;
}

.team-member-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.team-member-avatar {
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.1);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.team-member-name {
  font-weight: 500;
  margin-bottom: 2px;
}

.team-member-role {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
}

.team-badge {
  font-size: 11px;
  color: #4ade80;
  background: rgba(74,222,128,0.15);
  padding: 4px 10px;
  border-radius: 12px;
}

.remove-btn {
  background: rgba(239,68,68,0.1);
  color: #f87171;
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.remove-btn:hover {
  background: rgba(239,68,68,0.2);
}

/* ===== 欢迎界面示例增强 ===== */
.team-avatars {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
}

.team-avatar {
  width: 44px;
  height: 44px;
  background: rgba(16,163,127,0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  border: 2px solid rgba(16,163,127,0.2);
}

.welcome-examples {
  max-width: 500px;
  margin: 0 auto;
}

.welcome-examples-title {
  font-size: 14px;
  color: #6e6e80;
  margin-bottom: 12px;
}

.welcome-examples-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.welcome-example {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  gap: 12px;
}

.welcome-example:hover {
  border-color: #10a37f;
  box-shadow: 0 2px 8px rgba(16,163,127,0.15);
  transform: translateY(-1px);
}

.welcome-example .example-text {
  flex: 1;
  font-size: 14px;
  color: #202123;
  line-height: 1.4;
}

.welcome-example .example-tag {
  font-size: 11px;
  color: #10a37f;
  background: rgba(16,163,127,0.1);
  padding: 4px 10px;
  border-radius: 12px;
  flex-shrink: 0;
}

/* 使用量统计弹窗样式 */
.usage-stats-modal {
  max-width: 600px;
}

.usage-stats-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.usage-card {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

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

.usage-card-value {
  font-size: 20px;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 4px;
}

.usage-card-sub {
  font-size: 11px;
  color: #94a3b8;
}

.usage-section {
  margin-bottom: 20px;
}

.usage-section h4 {
  font-size: 14px;
  font-weight: 500;
  color: #334155;
  margin-bottom: 12px;
}

.usage-model-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.usage-model-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.usage-model-name {
  width: 100px;
  font-size: 13px;
  color: #475569;
}

.usage-model-bar {
  flex: 1;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}

.usage-model-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.usage-model-fill.qwen-plus { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.usage-model-fill.qwen-max { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.usage-model-fill.glm-4 { background: linear-gradient(90deg, #10b981, #34d399); }

.usage-model-stats {
  width: 120px;
  text-align: right;
  font-size: 12px;
  color: #64748b;
}

.usage-chart {
  height: 120px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  padding: 0 8px;
}

.usage-chart-bar {
  flex: 1;
  background: linear-gradient(180deg, #3b82f6 0%, #93c5fd 100%);
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  position: relative;
  transition: height 0.3s ease;
}

.usage-chart-bar:hover {
  background: linear-gradient(180deg, #2563eb 0%, #60a5fa 100%);
}

.usage-chart-label {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: #94a3b8;
  white-space: nowrap;
}

.usage-loading {
  text-align: center;
  padding: 20px;
  color: #94a3b8;
  font-size: 13px;
}

/* 用户菜单分隔线 */
.sidebar-menu-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 8px 12px;
}

/* 响应式 */
@media (max-width: 640px) {
  .usage-stats-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 配额进度条 */
.usage-quota-card {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 24px;
  border: 1px solid #bbf7d0;
}

.usage-quota-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.usage-quota-label {
  font-size: 14px;
  font-weight: 500;
  color: #166534;
}

.usage-quota-percent {
  font-size: 20px;
  font-weight: 700;
  color: #15803d;
}

.usage-quota-bar {
  height: 12px;
  background: #d1fae5;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 12px;
}

.usage-quota-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #34d399);
  border-radius: 6px;
  transition: width 0.3s ease, background 0.3s ease;
}

.usage-quota-stats {
  font-size: 12px;
  color: #166534;
  text-align: center;
}

.usage-quota-stats span {
  font-weight: 600;
}

/* 积分显示行 */
.usage-quota-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
}

.usage-quota-row:not(:last-child) {
  border-bottom: 1px solid #d1fae5;
  margin-bottom: 4px;
  padding-bottom: 8px;
}

.usage-quota-row span {
  font-size: 12px;
  color: #166534;
}

.usage-quota-row span span {
  font-weight: 600;
  color: #15803d;
}

/* ===== 团队管理弹窗（改造版） ===== */

/* 标签页导航 */
.team-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  padding: 0 16px;
  background: #f9fafb;
}

.team-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.team-tab:hover {
  color: #374151;
  background: rgba(0, 0, 0, 0.02);
}

.team-tab.active {
  color: #10a37f;
  border-bottom-color: #10a37f;
}

.team-tab i {
  width: 16px;
  height: 16px;
}

/* 标签页内容 */
.team-tab-content {
  padding: 16px;
}

/* 模板网格 */
.templates-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.template-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.template-card:hover {
  border-color: #10a37f;
  box-shadow: 0 4px 12px rgba(16, 163, 127, 0.1);
  transform: translateY(-2px);
}

.template-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.template-card-icon {
  font-size: 28px;
}

.template-card-title {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
}

.template-card-desc {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 12px;
  line-height: 1.5;
}

.template-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: #9ca3af;
}

.template-card-members {
  display: flex;
  align-items: center;
  gap: 4px;
}

.template-card-category {
  padding: 2px 8px;
  background: #f3f4f6;
  border-radius: 10px;
  font-size: 11px;
  color: #6b7280;
}

/* 模板详情弹窗 */
.template-detail-modal {
  max-width: 600px;
}

.template-detail-content {
  min-height: 200px;
}

.template-detail-desc {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e5e7eb;
}

.template-detail-members {
  margin-bottom: 20px;
}

.template-detail-members h4 {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 12px;
}

.template-member-list {
  display: grid;
  gap: 8px;
}

.template-member-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #f9fafb;
  border-radius: 8px;
}

.template-member-emoji {
  font-size: 24px;
}

.template-member-info {
  flex: 1;
}

.template-member-name {
  font-size: 14px;
  font-weight: 500;
  color: #111827;
  margin-bottom: 2px;
}

.template-member-role {
  font-size: 12px;
  color: #6b7280;
}

.template-member-triggers {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.template-trigger-tag {
  font-size: 10px;
  padding: 2px 6px;
  background: #e5e7eb;
  border-radius: 6px;
  color: #6b7280;
}

.template-member-badge {
  font-size: 10px;
  padding: 2px 8px;
  background: rgba(16, 163, 127, 0.1);
  color: #10a37f;
  border-radius: 6px;
}

/* 模态框底部按钮 */
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
}

.btn {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.btn-primary {
  background: #10a37f;
  color: white;
}

.btn-primary:hover {
  background: #0d8a6a;
}

.btn-secondary {
  background: #e5e7eb;
  color: #374151;
}

.btn-secondary:hover {
  background: #d1d5db;
}

/* 团队成员样式优化 */
.team-member {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: #f9fafb;
  border-radius: 8px;
  margin-bottom: 8px;
}

.team-member-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.team-member-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10a37f 0%, #059669 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.team-member-name {
  font-size: 14px;
  font-weight: 500;
  color: #111827;
}

.team-member-role {
  font-size: 12px;
  color: #6b7280;
  margin-top: 2px;
}

.team-badge {
  font-size: 11px;
  padding: 4px 10px;
  background: rgba(16, 163, 127, 0.1);
  color: #10a37f;
  border-radius: 12px;
  font-weight: 500;
}

.remove-btn {
  font-size: 12px;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid #ef4444;
  color: #ef4444;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.remove-btn:hover {
  background: #ef4444;
  color: white;
}

/* 添加成员区域 */
.add-team-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
}

.add-team-section h4 {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 12px;
}

.available-agents {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.agent-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.agent-chip:hover {
  border-color: #10a37f;
  background: rgba(16, 163, 127, 0.05);
}

/* 响应式 */
@media (max-width: 768px) {
  .templates-grid {
    grid-template-columns: 1fr;
  }
  
  .team-tabs {
    padding: 0 12px;
  }
  
  .team-tab {
    padding: 10px 12px;
    font-size: 13px;
  }
}

/* 模板卡片样式补充 */
.template-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.template-card-icon {
  font-size: 28px;
  line-height: 1;
}

.template-card-title {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
}

.template-detail-desc {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e5e7eb;
  line-height: 1.6;
}

.template-detail-members h4 {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 12px;
}

.template-member-emoji {
  font-size: 28px;
  width: 40px;
  text-align: center;
}

.template-member-name {
  font-size: 14px;
  font-weight: 500;
  color: #111827;
  margin-bottom: 2px;
}

.template-member-role {
  font-size: 12px;
  color: #6b7280;
}

.template-member-triggers {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.template-trigger-tag {
  font-size: 10px;
  padding: 2px 6px;
  background: #e5e7eb;
  border-radius: 6px;
  color: #6b7280;
}

.template-member-badge {
  font-size: 10px;
  padding: 2px 8px;
  background: rgba(16, 163, 127, 0.1);
  color: #10a37f;
  border-radius: 6px;
  font-weight: 500;
}

/* 动画 */
@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* 团队成员头像优化 */
.team-member-avatar {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, #10a37f 0%, #059669 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}

.team-member-avatar svg {
  width: 24px;
  height: 24px;
  color: white;
}

.team-member-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.team-member-name {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 2px;
}

.team-member-role {
  font-size: 12px;
  color: #6b7280;
}

.team-member {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  margin-bottom: 8px;
  transition: all 0.2s;
}

.team-member:hover {
  border-color: #d1d5db;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* 模板卡片优化 */
.template-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.3s;
}

.template-card:hover {
  border-color: #10a37f;
  box-shadow: 0 4px 16px rgba(16, 163, 127, 0.12);
  transform: translateY(-2px);
}

.template-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.template-card-header .icon-lg {
  width: 32px;
  height: 32px;
  color: #10a37f;
}

.template-card-title {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
}

.template-card-desc {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.6;
  margin-bottom: 12px;
}

.template-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: #9ca3af;
}

.template-card-members {
  display: flex;
  align-items: center;
  gap: 4px;
}

.template-card-members .icon-sm {
  width: 14px;
  height: 14px;
}

.template-card-category {
  padding: 2px 8px;
  background: #f3f4f6;
  border-radius: 10px;
  font-size: 11px;
  color: #6b7280;
  font-weight: 500;
}

/* 模板详情优化 */
.template-detail-members h4 {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 12px;
}

.template-member-list {
  display: grid;
  gap: 8px;
}

.template-member-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #f9fafb;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
}

.template-member-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, #10a37f 0%, #059669 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.template-member-icon svg {
  width: 22px;
  height: 22px;
  color: white;
}

.template-member-info {
  flex: 1;
}

.template-member-name {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 2px;
}

.template-member-role {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 4px;
}

.template-member-triggers {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.template-trigger-tag {
  font-size: 10px;
  padding: 2px 6px;
  background: #e5e7eb;
  border-radius: 6px;
  color: #6b7280;
}

.template-member-badge {
  font-size: 10px;
  padding: 2px 8px;
  background: rgba(16, 163, 127, 0.1);
  color: #10a37f;
  border-radius: 6px;
  font-weight: 600;
}

/* 团队徽章优化 */
.team-badge {
  font-size: 11px;
  padding: 4px 12px;
  background: rgba(16, 163, 127, 0.1);
  color: #10a37f;
  border-radius: 12px;
  font-weight: 600;
}

/* 移除按钮优化 */
.remove-btn {
  font-size: 12px;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid #ef4444;
  color: #ef4444;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.remove-btn:hover {
  background: #ef4444;
  color: white;
}

/* 响应式优化 */
@media (max-width: 768px) {
  .team-member-avatar {
    width: 40px;
    height: 40px;
  }
  
  .team-member-avatar svg {
    width: 20px;
    height: 20px;
  }
  
  .template-member-icon {
    width: 36px;
    height: 36px;
  }
  
  .template-member-icon svg {
    width: 18px;
    height: 18px;
  }
}
