/* 智能体详情页 - 精确匹配截图设计 */

/* 容器 - 全屏布局 */
.agent-detail-container {
  --detail-header-height: 56px;
  min-height: 100vh;
  background: #f5f5f7;
  display: flex;
  flex-direction: column;
  height: auto;
  width: 100vw;
  max-width: 100vw;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* 访客视图样式 - 严格按照截图还原 */
.agent-detail-page.guest-view {
  min-height: 100vh;
  background: #f5f5f7;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* 移除所有背景层相关样式 */
.background-layer,
.background-image,
.default-background.fantasy-bg,
.background-overlay {
  display: none;
}

/* 顶部导航栏 - 完全按照截图 */
.back-navigation {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: white;
  border-bottom: 1px solid #e8e8e8;
  z-index: 100;
  display: flex;
  align-items: center;
  padding: 0 16px;
}

.back-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: #333;
  text-decoration: none;
}

.back-icon {
  width: 20px;
  height: 20px;
}

/* 顶部智能体信息 - 按截图布局 */
.agent-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: 16px;
  flex: 1;
}

.agent-header-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.agent-header-avatar .avatar-image-large {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.agent-header-avatar .avatar-placeholder-large {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 14px;
  font-weight: 600;
}

.agent-header-details h1 {
  font-size: 16px;
  font-weight: 500;
  color: #333;
  margin: 0;
}

.agent-publish-time {
  font-size: 12px;
  color: #999;
  margin: 2px 0 0 0;
}

/* 分享按钮 */
.share-button {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #666;
  text-decoration: none;
  font-size: 14px;
  margin-left: auto;
}

/* 主要内容区域 - 左右布局 */
.agent-detail-main {
  padding-top: 56px;
  padding-bottom: 140px; /* 为底部登录提示留出空间 */
  display: flex;
  background: #f5f5f7;
  width: 100%;
  min-height: calc(100vh - 56px);
}

/* 左侧聊天区域 - 按截图尺寸 */
.agent-chat-area {
  flex: 1;
  background: #f5f5f7;
  display: flex;
  flex-direction: column;
  min-width: 0; /* 防止flex项目溢出 */
  max-width: calc(100% - 450px); /* 为右侧面板预留空间 */
}

/* 智能体头像区域 - 居中 */
.agent-profile-center {
  background: #f5f5f7;
  padding: 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

.agent-avatar-large {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 12px;
  border: 3px solid white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.avatar-image-large {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-placeholder-large {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 48px;
  font-weight: 600;
}

.agent-name-large {
  font-size: 18px;
  font-weight: 500;
  color: #333;
  margin: 0;
}

/* 聊天消息区域 */
.chat-messages-area {
  background: white;
  padding: 16px 20px;
  flex: 1;
  min-height: 400px;
}

/* 开场白消息 */
.opening-message-section {
  margin-bottom: 20px;
}

.opening-bubble {
  background: #95ec69;
  border-radius: 8px;
  border-top-left-radius: 2px;
  padding: 10px 14px;
  color: #333;
  font-size: 14px;
  line-height: 1.4;
  text-align: left;
  position: relative;
  display: inline-block;
  margin-left: 50px;
  max-width: 300px;
}

/* 你可以这样问我 */
.conversation-examples.guest-preview {
  margin-top: 20px;
}

.example-input {
  background: transparent;
  padding: 0;
  margin-bottom: 12px;
}

.preview-hint {
  color: #999;
  font-size: 13px;
  margin-bottom: 12px;
  text-align: left;
  display: block;
}

.example-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.example-btn.preview-btn {
  background: #f0f0f0;
  border: none;
  border-radius: 20px;
  padding: 8px 16px;
  color: #333;
  font-size: 13px;
  text-align: left;
  transition: background 0.2s;
  cursor: pointer;
}

.example-btn.preview-btn:hover {
  background: #e8e8e8;
}

.lock-icon {
  display: none;
}

/* 移除功能预览区域 */
.feature-preview-section {
  display: none;
}

/* 右侧信息面板 - 按截图样式，靠右贴边 */
.agent-detail-sidebar {
  position: fixed;
  right: 0;
  top: 56px;
  width: 450px;
  height: calc(100vh - 56px - 140px); /* 减去顶部和底部高度 */
  background: white;
  border-left: 1px solid #e8e8e8;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  z-index: 50;
}

/* 智能体信息卡片 */
.agent-info-card {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.sidebar-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.sidebar-avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-avatar-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
  font-weight: 600;
}

.sidebar-agent-info {
  flex: 1;
}

.sidebar-agent-name {
  font-size: 16px;
  font-weight: 500;
  color: #333;
  margin: 0 0 4px 0;
}

.sidebar-agent-desc {
  font-size: 12px;
  color: #666;
  margin: 0;
  line-height: 1.4;
}

/* 配置信息 */
.info-section {
  background: transparent;
  padding: 0;
  border-bottom: none;
}

.section-title {
  font-size: 14px;
  font-weight: 500;
  color: #333;
  margin: 0 0 12px 0;
}

/* 移除登录提示卡片 */
.login-cta-section {
  display: none;
}

/* 模型信息 */
.model-info {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.model-label {
  font-size: 13px;
  color: #666;
}

.model-name {
  font-size: 13px;
  color: #333;
  font-weight: 500;
}

/* 发布渠道 */
.publish-channels {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}

.channel-tag {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 500;
}

.channel-tag.wechat {
  background: #07c160;
  color: white;
}

.channel-tag.qq {
  background: #12b7f5;
  color: white;
}

/* 试试这样问 */
.try-questions {
  background: transparent;
  padding: 0;
}

.try-questions .section-title {
  margin-bottom: 8px;
}

.question-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.question-item {
  background: #f8f9fa;
  border: none;
  border-radius: 16px;
  padding: 8px 14px;
  font-size: 12px;
  color: #333;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s;
}

.question-item:hover {
  background: #e9ecef;
}

/* 隐藏原有的复杂样式 */
.usage-stats,
.config-item,
.knowledge-bases,
.creator-section {
  display: none;
}

/* 底部登录提示 - 按截图样式 */
.login-prompt {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #f0f9ff 0%, #dbeafe 100%);
  padding: 20px;
  z-index: 100;
  text-align: center;
}

.login-prompt-content {
  max-width: 600px;
  margin: 0 auto;
}

.prompt-info {
  margin-bottom: 16px;
}

.prompt-text {
  font-size: 18px;
  color: #1f2937;
  font-weight: 600;
  margin-bottom: 8px;
}

.prompt-subtitle {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 16px;
}

.prompt-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.login-btn {
  background: #1d4ed8;
  color: white;
  padding: 12px 32px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  transition: background 0.2s;
  box-shadow: 0 2px 4px rgba(29, 78, 216, 0.2);
}

.login-btn:hover {
  background: #1e40af;
}

.register-link {
  display: none;
}

/* 登录模态框样式 */
.login-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
}

.modal-content {
  position: relative;
  background: white;
  border-radius: 20px;
  max-width: 480px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
  position: relative;
  padding: 32px 32px 0;
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
  color: #333;
  margin: 0;
}

.modal-close {
  position: absolute;
  top: -16px;
  right: -16px;
  width: 32px;
  height: 32px;
  border: none;
  background: #f0f0f0;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 1001;
}

.modal-close:hover {
  background: #e0e0e0;
}

.close-icon {
  width: 18px;
  height: 18px;
  color: #666;
}

.modal-body {
  padding: 24px 32px;
}

.selected-example {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}

.example-label {
  font-size: 12px;
  color: #666;
  margin-bottom: 4px;
  font-weight: 500;
}

.example-content {
  font-size: 16px;
  color: #333;
  font-weight: 500;
}

.login-hint {
  font-size: 16px;
  color: #333;
  margin: 0 0 20px 0;
  text-align: center;
  line-height: 1.5;
}

.login-benefits {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.benefit-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.benefit-icon {
  width: 20px;
  height: 20px;
  color: #10b981;
}

.modal-footer {
  padding: 0 32px 32px;
  display: flex;
  gap: 12px;
}

.modal-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s;
}

.modal-btn.primary {
  background: #007aff;
  color: white;
}

.modal-btn.primary:hover {
  background: #0051d5;
  transform: translateY(-1px);
}

.modal-btn.secondary {
  background: #f0f0f0;
  color: #333;
}

.modal-btn.secondary:hover {
  background: #e0e0e0;
  transform: translateY(-1px);
}

/* 简化模态框样式 */
.login-modal .modal-content {
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.login-modal .modal-header {
  padding: 20px 20px 0;
}

.login-modal .modal-title {
  font-size: 18px;
  font-weight: 600;
}

.login-modal .modal-body {
  padding: 20px;
}

.login-modal .modal-footer {
  padding: 0 20px 20px;
}

/* 全屏2:6:2比例布局 - 中间宽两边窄 */
.detail-body {
  display: grid !important;
  grid-template-columns: 2fr 8fr !important;
  grid-template-areas: "sidebar main info" !important;
  gap: 0 !important;
  height: calc(100vh - var(--detail-header-height));
  width: 100vw;
  max-width: 100vw;
  margin: 0;
  padding: 0;
}

/* 网格区域配置 */

.conversation-sidebar {
  grid-area: sidebar;
  position: relative;
  width: 100%;
  height: calc(100vh - var(--detail-header-height));
  margin: 0;
  padding: 0;
}

.chat-section {
  grid-area: main;
  min-width: 500px;
  height: calc(100vh - var(--detail-header-height));
  border-left: none;
  border-right: none;
  margin: 0 !important;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.info-sidebar {
  grid-area: info;
  width: 100%;
  height: calc(100vh - var(--detail-header-height));
  margin: 0;
  padding: 0;
}

/* 超大屏幕优化 (1400px+) - 2:6:2比例 */
@media (min-width: 1400px) {
  .detail-body {
    grid-template-columns: 2fr 6fr 2fr;
    width: 100vw;
    max-width: 100vw;
  }
}

/* 大屏幕优化 (1200px-1399px) - 2:6:2比例 */
@media (min-width: 1200px) and (max-width: 1399px) {
  .detail-body {
    grid-template-columns: 2fr 6fr 2fr;
    width: 100vw;
    max-width: 100vw;
  }
}

/* 中等屏幕 (768px - 1199px) - 2:6:2比例 */
@media (max-width: 1199px) and (min-width: 768px) {
  .detail-body {
    grid-template-columns: 2fr 6fr 2fr;
    width: 100vw;
    max-width: 100vw;
  }
  
  .chat-section {
    min-width: 0; /* 让聊天区域完全响应式 */
  }
}

/* 平板布局 (768px - 1023px) - 冲突的2列布局已移除，使用3:5:3网格布局 */

/* 手机布局 (< 768px) */
@media (max-width: 767px) {
  .detail-body {
    display: flex;
    flex-direction: column;
    height: auto;
    margin-left: 0;
    max-width: none;
  }
  
  .conversation-sidebar {
    position: fixed;
    left: -100%;
    top: 56px;
    width: 80%;
    max-width: 300px;
    height: calc(100vh - 56px);
    background: white;
    z-index: 200;
    transition: left 0.3s ease;
    box-shadow: 2px 0 15px rgba(0,0,0,0.2);
  }
  
  .conversation-sidebar.open {
    left: 0;
  }
  
  .chat-section {
    flex: 1;
    min-height: 60vh;
    border: none;
  }
  
  .info-sidebar {
    width: 100%;
    border-left: none;
    border-top: 1px solid #e0e0e0;
    order: 3;
  }
  
  .mobile-menu-toggle {
    display: block;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 201;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  }

  .back-navigation {
    height: 50px;
    padding: 0 50px 0 12px;
  }

  .agent-header-info {
    gap: 8px;
  }

  .agent-header-avatar {
    width: 28px;
    height: 28px;
  }

  .agent-header-details h1 {
    font-size: 14px;
  }

  .agent-publish-time {
    font-size: 10px;
  }

  .agent-profile-center {
    padding: 20px 16px;
  }

  .agent-avatar-large {
    width: 100px;
    height: 100px;
  }

  .avatar-placeholder-large {
    font-size: 36px;
  }

  .agent-name-large {
    font-size: 16px;
  }

  .chat-messages-area {
    padding: 12px 16px;
  }

  .opening-bubble {
    margin-left: 40px;
    padding: 8px 12px;
    font-size: 13px;
  }

  .agent-info-card {
    padding: 12px;
  }

  .sidebar-avatar {
    width: 48px;
    height: 48px;
  }

  .login-prompt {
    padding: 16px;
  }

  .prompt-text {
    font-size: 16px;
  }

  .prompt-subtitle {
    font-size: 12px;
  }

  .login-btn {
    padding: 10px 24px;
    font-size: 14px;
  }
}

/* 顶部栏 */
.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: white;
  border-bottom: 1px solid #e8e8e8;
  position: sticky;
  top: 0;
  z-index: 100;
}

.back-button {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: #666;
  transition: background 0.2s;
}

.back-button:hover {
  background: #f0f0f0;
}

.header-info {
  flex: 1;
  margin: 0 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.agent-handle {
  font-size: 15px;
  font-weight: 500;
  color: #1a1a1a;
  margin-left: 4px;
}

/* 顶部栏头像 */
.agent-header-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
  background: white;
  border: 1px solid #e0e0e0;
  flex-shrink: 0;
}

.agent-header-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.agent-header-avatar .avatar-placeholder-small {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 12px;
  font-weight: 600;
}

.publish-time {
  font-size: 13px;
  color: #999;
}

.header-actions {
  display: flex;
  gap: 8px;
}

.icon-button {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  background: white;
  color: #666;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.icon-button:hover {
  background: #f8f8f8;
}

.icon-button.active {
  background: #fff3e0;
  border-color: #ff9800;
  color: #ff9800;
}

.icon-button.active i[data-lucide="heart"] {
  fill: #ff4757;
  stroke: #ff4757;
  color: #ff4757;
}

.favorite-btn.active {
  background: #ffe8e8;
  border-color: #ff4757;
  color: #ff4757;
}

.favorite-btn.active i[data-lucide="heart"] {
  fill: #ff4757 !important;
  stroke: #ff4757 !important;
  color: #ff4757 !important;
}

.favorite-btn.active svg {
  fill: #ff4757 !important;
  color: #ff4757 !important;
}

.icon-button i {
  width: 16px;
  height: 16px;
}

/* 主内容区 */
/* 旧的flex布局定义已移除，现在使用统一的Grid 2:6:2布局 */

/* 左侧对话区 */
.chat-section {
  display: flex;
  flex-direction: column;
  background: white;
  border-radius: 0;
  padding: 0;
  margin: 0 !important;
  height: 100%;
  overflow: hidden;
  position: relative;
}

/* 智能体介绍 */
.agent-intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 24px;
}

.agent-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 12px;
  background: white;
  border: 3px solid #f0f0f0;
}

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

.avatar-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 32px;
  font-weight: 600;
}

.agent-title {
  font-size: 20px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0;
}

/* 智能体标题行 - 包含标题和状态 */
.agent-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* 状态提示样式 */
.agent-status-notice {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.draft-notice {
  background-color: #f3f4f6;
  color: #6b7280;
  border: 1px solid #d1d5db;
}

.published-notice {
  background-color: #e7f5e7;
  color: #2d7d30;
  border: 1px solid #a5d6a7;
}

.agent-status-notice i {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

/* 开场白 */
.opening-message {
  background: #f8f8fa;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  position: relative;
}

.message-content {
  font-size: 14px;
  line-height: 1.6;
  color: #333;
}

.sparkle {
  color: #ffa500;
  margin-right: 4px;
}

/* 对话区域 */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.chat-history {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chat-message {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  position: relative;
  padding-bottom: 56px;
}

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

.chat-message .message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #666;
  flex-shrink: 0;
}

.chat-message.user .message-avatar {
  background: #007aff;
  color: white;
}

.chat-message .message-content {
  background: #f8f8fa;
  padding: 12px 16px;
  border-radius: 18px;
  max-width: 100%;
  font-size: 14px;
  line-height: 1.5;
  position: relative;
  overflow: visible;
}

.chat-message .message-content ul {
  margin: 8px 0;
  padding-left: 24px;
  list-style-type: disc;
}

.chat-message .message-content ol {
  margin: 8px 0;
  padding-left: 24px;
  list-style-type: decimal;
  counter-reset: list-counter;
}

.chat-message .message-content li {
  margin: 4px 0;
  line-height: 1.6;
}

.chat-message .message-content li.has-checkbox {
  list-style: none;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

/* 确保p标签在消息中有合适的间距 */
.chat-message .message-content p {
  margin: 4px 0;
  line-height: 1.6;
}

.chat-message .message-content p:first-child {
  margin-top: 0;
}

.chat-message .message-content p:last-child {
  margin-bottom: 0;
}

.chat-message .message-content strong {
  font-weight: 600;
}

.chat-message .message-content em {
  font-style: italic;
}

.chat-message .message-content code {
  background: rgba(0, 0, 0, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: 13px;
}

.chat-message .message-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 13px;
  line-height: 1.5;
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.05);
}

.chat-message .message-content thead th {
  background: #f4f6fb;
  color: #1f2937;
  font-weight: 600;
}

.chat-message .message-content th,
.chat-message .message-content td {
  border: 1px solid #e5e7eb;
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.chat-message .message-content tbody tr:nth-child(even) {
  background: #f9fafb;
}

.chat-message .message-content table p {
  margin: 0;
}

.chat-message .message-content table strong {
  color: inherit;
}

.chat-message.user .message-content table {
  color: #0f172a;
}

.chat-message.user .message-content tbody tr:nth-child(even) {
  background: rgba(148, 163, 184, 0.15);
}

.chat-message .message-content .markdown-checkbox {
  width: 14px;
  height: 14px;
  margin-top: 4px;
  border-radius: 4px;
  border: 1px solid rgba(51, 65, 85, 0.35);
  background: transparent;
  position: relative;
  flex-shrink: 0;
}

.chat-message .message-content .markdown-checkbox::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 10px;
  line-height: 1;
}

.chat-message .message-content .markdown-checkbox.checked {
  background: #3b82f6;
  border-color: #3b82f6;
}

.chat-message .message-content .markdown-checkbox.checked::after {
  content: '\2713';
  color: #ffffff;
}

.chat-message.user .message-content .markdown-checkbox {
  border-color: rgba(255, 255, 255, 0.55);
}

.chat-message.user .message-content .markdown-checkbox.checked {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.85);
}

.chat-message.user .message-content .markdown-checkbox.checked::after {
  color: rgba(255, 255, 255, 0.9);
}

.chat-message.user .message-content {
  background: #007aff;
  color: white;
}

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

.typing-indicator {
  display: flex;
  gap: 4px;
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  background: #999;
  border-radius: 50%;
  animation: typing 1.5s ease-in-out infinite;
}

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

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

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

/* 打字机光标 */
.typewriter-cursor {
  display: inline-block;
  color: #007aff;
  font-weight: normal;
  animation: blink 1s infinite;
  margin-left: 2px;
}

/* 错误消息样式 */
.chat-message .message-content.error {
  background: #fff1f2; /* rose-50 */
  border: 1px solid #ef4444; /* red-500 */
  color: #991b1b; /* red-700 */
}

.chat-message .message-content.error .error-message {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-message .message-content.error .error-message i {
  width: 16px;
  height: 16px;
  color: #ef4444;
}

@keyframes blink {
  0%, 50% {
    opacity: 1;
  }
  51%, 100% {
    opacity: 0;
  }
}

/* 示例问题 */
.example-section {
  margin-bottom: auto;
}

.example-hint {
  font-size: 13px;
  color: #999;
  margin-bottom: 12px;
  text-align: center;
}

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

.example-item {
  padding: 10px 16px;
  background: white;
  border: 1px solid #e8e8e8;
  border-radius: 20px;
  font-size: 14px;
  color: #333;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.example-item:hover {
  background: #f5f5f5;
  border-color: #d0d0d0;
}

/* 输入区域 */
.input-section {
  margin: 0;
  padding: 16px;
  border-top: 1px solid #f0f0f0;
  background: white;
  position: sticky;
  bottom: 0;
  z-index: 10;
  flex-shrink: 0;
}

.input-box {
  display: flex;
  gap: 8px;
  align-items: center;
  background: #f5f5f7;
  border-radius: 24px;
  padding: 8px 8px 8px 20px;
  border: 1px solid #e0e0e0;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-box:focus-within {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.08);
}

.message-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 14px;
  color: #333;
  resize: none;
}

.message-input:focus {
  outline: none;
  border: none;
  box-shadow: none;
}

.message-input::placeholder {
  color: #999;
}

.send-button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #007aff;
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

.send-button:hover {
  background: #0051d5;
}

.send-button i {
  width: 18px;
  height: 18px;
}

.disclaimer {
  font-size: 12px;
  color: #999;
  text-align: center;
  margin-top: 12px;
  line-height: 1.4;
}

.disclaimer a {
  color: #007aff;
  text-decoration: none;
}

.disclaimer a:hover {
  text-decoration: underline;
}

/* 右侧信息栏 */
.info-sidebar {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 12px;
  box-sizing: border-box;
}

/* 信息卡片 - 紧凑布局 */
.info-card {
  background: white;
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.info-card h3 {
  font-size: 13px;
  font-weight: 600;
  color: #333;
  margin: 0 0 8px 0;
}

/* 使用情况 */
.usage-stat {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: #f5f5f7;
  border-radius: 8px;
}

.usage-stat i {
  width: 20px;
  height: 20px;
  color: #666;
}

.stat-number {
  font-size: 20px;
  font-weight: 600;
  color: #1a1a1a;
}

/* 功能简介 */
.description-text {
  font-size: 14px;
  line-height: 1.6;
  color: #666;
  margin: 0;
}

/* 配置详情 */
.config-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.config-label {
  font-size: 13px;
  color: #999;
}

.config-value {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #333;
  font-weight: 500;
}

.config-value i {
  width: 16px;
  height: 16px;
  color: #666;
}

.model-badge {
  background: #e3f2fd;
  color: #1976d2;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  margin-left: 4px;
}

/* 响应式 */
@media (max-width: 768px) {
  .detail-body {
    flex-direction: column;
    padding: 16px;
  }
  
  .info-sidebar {
    width: 100%;
  }
  
  .chat-section {
    min-height: 500px;
  }
  
  .header-info {
    flex-direction: column;
    gap: 4px;
  }
}

@media (max-width: 480px) {
  .detail-header {
    padding: 12px 16px;
  }
  
  .icon-button span {
    display: none;
  }
  
  .icon-button {
    padding: 8px;
  }
  
  .agent-avatar {
    width: 64px;
    height: 64px;
  }
  
  .agent-title {
    font-size: 18px;
  }
}

/* 消息操作按钮样式 */
.message-actions {
  position: absolute;
  bottom: -32px;
  display: flex;
  gap: 12px;
  opacity: 0.6;
  transition: opacity 0.2s ease;
  z-index: 5;
}

.chat-message.user .message-content .message-actions {
  right: 0;
  left: auto;
}

.chat-message:not(.user) .message-content .message-actions {
  left: 0;
  right: auto;
}

.chat-message:hover .message-actions {
  opacity: 1;
}

.message-action-btn {
  width: 24px;
  height: 24px;
  border: none;
  background: rgba(15, 23, 42, 0.06);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #6b7280;
  transition: all 0.15s ease;
  position: relative;
  padding: 0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.message-action-btn:hover {
  color: #1f2937;
  background: rgba(15, 23, 42, 0.12);
  transform: translateY(-1px) scale(1.05);
}

.message-action-btn i {
  width: 18px;
  height: 18px;
}


/* 消息编辑界面样式 */
.message-edit-container {
  width: 100%;
  max-width: 100%;
  background: #f8f8fa;
  border-radius: 18px;
  padding: 16px;
  border: 2px solid #007aff;
}

.chat-message.user .message-edit-container {
  background: rgba(0, 122, 255, 0.1);
  border-color: #007aff;
}

.message-edit-textarea {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  color: inherit;
  resize: none;
  padding: 0;
  margin-bottom: 12px;
}

.message-edit-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.edit-action-btn {
  padding: 6px 16px;
  border-radius: 16px;
  border: none;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.edit-action-btn.save-btn {
  background: #007aff;
  color: white;
}

.edit-action-btn.save-btn:hover {
  background: #0056b3;
}

.edit-action-btn.cancel-btn {
  background: #f0f0f0;
  color: #666;
}

.edit-action-btn.cancel-btn:hover {
  background: #e0e0e0;
  color: #333;
}

/* 对话侧边栏样式 - 与右侧信息栏风格一致 */
.conversation-sidebar {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 12px;
  box-sizing: border-box;
  height: 100%;
  position: relative;
  overflow: hidden;
  background: transparent; /* 与右侧一致 */
}

/* 新建对话按钮区域 - 卡片样式 */
.new-conversation-section {
  background: white;
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  flex-shrink: 0;
}

.new-conversation-btn {
  width: 100%;
  background: #1976d2;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.new-conversation-btn:hover {
  background: #1565c0;
  transform: translateY(-1px);
}

.new-conversation-btn:active {
  transform: translateY(0);
}

.new-conversation-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
}

.new-conversation-btn i {
  width: 16px;
  height: 16px;
}

/* 对话历史区域 - 卡片样式 */
.conversation-history {
  flex: 1;
  overflow-y: auto;
  background: white;
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.conversation-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  color: #666;
  font-size: 14px;
}

.loading-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #e0e0e0;
  border-top-color: #1976d2;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 对话分组 */
.conversation-group {
  margin-bottom: 4px;
}

.conversation-group-header {
  padding: 8px 4px 4px;
  font-size: 12px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* 对话项目 */
.conversation-item {
  padding: 10px 12px;
  margin: 0 0 4px 0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}


.conversation-item:hover,
.conversation-item.active {
  background: rgba(59, 130, 246, 0.1);
  box-shadow:
    inset 3px 0 0 0 rgba(59, 130, 246, 0.85),
    inset 0 0 0 1px rgba(59, 130, 246, 0.08);
}

.conversation-item.active:hover {
  background: #eaf2ff;
}

.conversation-title {
  font-size: 14px;
  font-weight: 500;
  color: #333;
  line-height: 1.4;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-item.active .conversation-title {
  color: #1976d2;
  font-weight: 600;
}

.conversation-item:hover .conversation-title {
  color: #1976d2;
  font-weight: 600;
}

.conversation-item:hover .conversation-meta,
.conversation-item.active .conversation-meta {
  color: rgba(59, 130, 246, 0.65);
}

.conversation-meta {
  font-size: 11px;
  color: #888;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.message-count {
  opacity: 0.8;
}

/* 空状态和错误状态 */
.no-conversations,
.load-error {
  text-align: center;
  padding: 40px 20px;
  color: #999;
  font-size: 14px;
}

.load-error {
  color: #d32f2f;
}

/* 旧的布局定义已移除，现在使用统一的Grid布局 */

/* 菜单切换按钮默认隐藏 */
.mobile-menu-toggle {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  color: #666;
  transition: all 0.2s ease;
}

.mobile-menu-toggle:hover {
  background: #f5f5f5;
  color: #333;
}

.mobile-menu-toggle i {
  width: 20px;
  height: 20px;
}

/* 滚动条样式 */
.conversation-history::-webkit-scrollbar {
  width: 4px;
}

.conversation-history::-webkit-scrollbar-track {
  background: transparent;
}

.conversation-history::-webkit-scrollbar-thumb {
  background: #ddd;
  border-radius: 2px;
}

.conversation-history::-webkit-scrollbar-thumb:hover {
  background: #ccc;
}
