/* 样式重置与变量 */
:root {
  --ds-background: #f6f8fa;
  --ds-surface: #ffffff;
  --ds-primary: #1e63e0;
  --ds-primary-hover: #1455c9;
  --ds-text-primary: #1a202c;
  --ds-text-secondary: #4a5568;
  --ds-border: #e2e8f0;
  --ds-border-light: #edf2f7;
  --ds-code-bg: #f7fafc;
  --ds-code-text: #2d3748;
  --ds-radius-sm: 6px;
  --ds-radius-md: 12px;
  --ds-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --ds-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --ds-logo-blue: #1e63e0;
  --ds-sidebar-width: 280px;
  --toolbar-icon-color: #333;
  --primary-color: #1e63e0;
  --primary-color-rgb: 30, 99, 224;
  --primary-lighter-color: #f0f9ff;
  --primary-lighter-border: #e0f2fe;
  --success-lighter-color: #f0fff4;
  --success-color: #38a169;
  --success-lighter-border: #dcfce7;
  --info-lighter-color: #ebf8ff;
  --info-color: #3182ce;
  --info-lighter-border: #bee3f8;
  --ds-border-subtle: #e2e8f0;
  --ds-chat-color: #333;
  --ds-message-border-color: #666;
  --ds-hover-color: #1e63e0;
  --ds-bg-tertiary: #f8fafc;
  --ds-bg-secondary: #edf2f7;
  --ds-bg-primary: #fff;
  --success-color: #48bb78;
  --error-color: #f56565;
  --warning-color: #ed8936;
  --info-light-bg: #ebf8ff;
  --info-lighter-border: #bee3f8;
}

/* 强制颜色模式适配 */
@media (forced-colors: active) {
  :root {
    --ds-background: Canvas;
    --ds-surface: Canvas;
    --ds-primary: Highlight;
    --ds-primary-hover: Highlight;
    --ds-text-primary: CanvasText;
    --ds-text-secondary: GrayText;
    --ds-border: ButtonBorder;
    --ds-border-light: ButtonBorder;
    --ds-code-bg: Canvas;
    --ds-code-text: CanvasText;
    --toolbar-icon-color: ButtonText;
    --primary-color: Highlight;
    --primary-color-rgb: Highlight;
  }

  .aitoutou-chat button,
  .aitoutou-chat .toolbar-btn,
  .aitoutou-chat .send-btn,
  .aitoutou-chat .sidebar-btn {
    forced-color-adjust: none;
    border: 1px solid ButtonBorder;
  }

  .aitoutou-chat .message {
    border: 1px solid ButtonBorder;
  }

  .aitoutou-chat pre {
    border: 1px solid ButtonBorder !important;
  }

  .aitoutou-chat .code-header,
  .aitoutou-chat .code-footer {
    border-color: ButtonBorder !important;
  }

  .aitoutou-chat .collapse-btn::before,
  .aitoutou-chat .collapse-btn::after {
    border-color: ButtonText !important;
  }

  .aitoutou-chat .copy-btn::before {
    background-color: ButtonText !important;
  }

  .aitoutou-chat .avatar {
    forced-color-adjust: none;
    border: 1px solid ButtonBorder !important;
  }

  /* 确保代码高亮在高对比度模式下正常显示 */
  .aitoutou-chat pre code {
    forced-color-adjust: none;
  }

  .aitoutou-chat .hljs {
    color: CanvasText;
    background-color: Canvas;
  }

  .aitoutou-chat .hljs-keyword,
  .aitoutou-chat .hljs-selector-tag,
  .aitoutou-chat .hljs-subst {
    color: CanvasText;
    font-weight: bold;
  }

  .aitoutou-chat .hljs-number,
  .aitoutou-chat .hljs-literal,
  .aitoutou-chat .hljs-string,
  .aitoutou-chat .hljs-doctag {
    color: Highlight;
  }

  .aitoutou-chat .hljs-comment,
  .aitoutou-chat .hljs-quote {
    color: GrayText;
  }
}

/* 禁用父网站滚动条 */
body.has-aitoutou-chat {
  overflow: hidden;
  height: 100vh;
  margin: 0;
  padding: 0;
}

/* 隐藏页面头部和底部 */
body.has-aitoutou-chat .entry-head,
body.has-aitoutou-chat .footer,
body.has-aitoutou-chat .site-header,
body.has-aitoutou-chat .site-footer {
  display: none;
}

body.has-aitoutou-chat .site-content {
  margin: 0;
  padding: 0;
}

/* 容器样式 */
.aitoutou-chat-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  width: 100%;
  height: 100vh;
  background: var(--ds-background);
  z-index: 9999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* 侧边栏样式 */
.aitoutou-sidebar {
  width: var(--ds-sidebar-width);
  background: var(--ds-surface);
  color: var(--ds-text-primary);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--ds-border);
  overflow-y: auto;
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.sidebar-header {
  padding: 18px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--ds-border-light);
}

.sidebar-logo-container {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
}

.sidebar-logo {
  display: none;
  /* 隐藏原始logo元素 */
}

.sidebar-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--ds-text-primary);
}

.version-link {
  font-size: 0.9rem;
  color: var(--ds-text-secondary);
  text-decoration: none;
  vertical-align: super;
  margin-left: 2px;
  transition: color 0.2s ease;
}

.version-link:hover {
  color: var(--info-color);
}

.sidebar-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--ds-text-primary);
  background: transparent;
  border: 1px solid var(--ds-border);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  text-decoration: none;
  font-size: 14px;
}

.sidebar-btn:hover {
  background: rgba(0, 0, 0, 0.04);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.sidebar-btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.new-chat-btn {
  background: var(--ds-primary);
  color: white;
  border: none;
}

.new-chat-btn:hover {
  background: var(--ds-primary-hover);
}

.chat-history {
  padding: 12px 14px;
  flex: 1;
}

.chat-history h3 {
  margin: 0 0 12px 0;
  font-size: 13px;
  color: var(--ds-text-secondary);
  font-weight: 500;
  padding-left: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.clear-history-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--ds-text-secondary);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.clear-history-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--ds-text-primary);
}

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

.history-item {
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.2s ease;
  color: var(--ds-text-primary);
}

.history-item:hover {
  background-color: rgba(30, 99, 224, 0.1);
  transform: translateX(4px);
}

/* 主聊天区域样式 */
.aitoutou-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: var(--ds-background);
  position: relative;
  height: 100%;
  overflow: hidden;
}

/* 确保所有元素使用相同的盒模型 */
.aitoutou-chat *,
.aitoutou-chat *::before,
.aitoutou-chat *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* 聊天消息区域 */
.aitoutou-chat .chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 0 0 0;
  scrollbar-width: thin;
  scroll-behavior: smooth;
}

/* 消息样式 - 气泡形式 */
.aitoutou-chat .message {
  display: flex;
  padding: 12px max(16px, calc(calc(100% - 800px) / 2));
  animation: fadeInMessage 0.4s ease-out;
  transform-origin: top;
}

.aitoutou-chat .user-message {
  background-color: transparent;
  justify-content: flex-end;
}

.aitoutou-chat .ai-message {
  background-color: transparent;
  justify-content: flex-start;
}

.aitoutou-chat .avatar {
  width: 32px !important;
  height: 32px !important;
  border-radius: 50% !important;
  margin-right: 12px !important;
  flex-shrink: 0 !important;
  object-fit: cover !important;
  border: none !important;
  display: block !important;
}

.aitoutou-chat .user-message .avatar {
  order: 2;
  margin-right: 0 !important;
  margin-left: 12px !important;
}

.aitoutou-chat .content {
  font-size: 15px;
  line-height: 1.8;
  max-width: 80%;
  color: var(--ds-text-primary);
  overflow-wrap: break-word;
  word-break: break-word;
  padding: 12px 16px;
  border-radius: 18px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  position: relative;
}

.aitoutou-chat .user-message .content {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border-bottom-right-radius: 4px;
  order: 1;
}

.aitoutou-chat .ai-message .content {
  background-color: var(--ds-surface);
  border: 1px solid var(--ds-border-light);
  border-bottom-left-radius: 4px;
}

/* 消息内容中的代码块样式调整 */
.aitoutou-chat .content pre {
  margin: 8px 0;
  max-width: 100%;
}

.aitoutou-chat .content code {
  font-size: 13px;
}

.aitoutou-chat img[alt="生成的图像"] {
  max-width: 100%;
  border-radius: 8px;
  margin: 12px 0;
}

/* 文件列表样式 */
.aitoutou-chat .file-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 16px;
  width: 100%;
  min-height: 40px;
  background: var(--ds-surface);
  border-bottom: 1px solid var(--ds-border);
}

.file-list:not(:empty) {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 16px;
  width: 100%;
  min-height: 40px;
  background: var(--ds-surface);
  border-bottom: 1px solid var(--ds-border);
}

.aitoutou-chat .file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--ds-surface);
  border: 1px solid var(--ds-border);
  font-size: 13px;
  box-shadow: var(--ds-shadow-sm);
  transition: all 0.2s;
}

.aitoutou-chat .file-item:hover {
  border-color: var(--ds-primary);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.aitoutou-chat .file-item .file-info {
  display: flex;
  align-items: center;
  overflow: hidden;
}

.aitoutou-chat .file-item .file-name {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.aitoutou-chat .file-item .remove-file {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.05);
  color: var(--ds-text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
  margin-left: 8px;
  border: none;
  outline: none;
}

.aitoutou-chat .file-item .remove-file:hover {
  background: rgba(220, 53, 69, 0.1);
  color: #dc3545;
}

.aitoutou-chat .file-item .remove-file svg {
  width: 14px;
  height: 14px;
}

/* 聊天输入区域 */
.aitoutou-chat .chat-input {
  background: var(--ds-surface);
  border-top: 1px solid var(--ds-border);
  padding: 16px max(16px, calc(calc(100% - 800px) / 2));
  position: relative;
}

.aitoutou-chat .input-area {
  max-width: 800px;
  margin: 0 auto;
  border: 1px solid var(--ds-border);
  border-radius: 12px;
  background: var(--ds-surface);
  overflow: hidden;
  box-shadow: var(--ds-shadow-sm);
}

.aitoutou-chat .chat-input textarea {
  width: 100%;
  min-height: 48px;
  max-height: 200px;
  padding: 14px 16px;
  border: none;
  outline: none;
  resize: none;
  font-family: inherit;
  font-size: 15px;
  line-height: 2.0;
  background: transparent;
  color: var(--ds-text-primary);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.aitoutou-chat .chat-input textarea:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(30, 99, 224, 0.3);
}

.input-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-top: 1px solid var(--ds-border-light);
}

.left-buttons,
.right-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toolbar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border: none;
  background: none;
  color: var(--toolbar-icon-color);
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 4px;
  margin-right: 4px;
  height: 32px;
  min-width: 32px;
  box-sizing: border-box;
}

.toolbar-btn span {
  margin-left: 4px;
  font-size: 14px;
}

.toolbar-btn:hover {
  background: rgba(0, 0, 0, 0.04);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.toolbar-btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* 代码格式化按钮样式 */
.code-format-btn {
  margin-right: 8px;
  opacity: 0.7;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.code-format-btn:hover {
  opacity: 1;
}

.code-format-btn.active {
  color: var(--ds-primary);
  opacity: 1;
  transform: scale(1.05);
}

.code-format-btn svg {
  display: block;
  width: 18px;
  height: 18px;
}

.toolbar-btn.active {
  background: rgba(0, 0, 0, 0.08);
  color: var(--ds-primary);
}

.send-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 6px;
  background: var(--ds-primary);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 14px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.send-btn:hover {
  background: var(--ds-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.send-btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.send-btn.stop-btn {
  background: #e53e3e;
}

.send-btn.stop-btn:hover {
  background: #c53030;
}

.hidden-file-input {
  display: none;
}

/* 代码块样式 */
.aitoutou-chat pre {
  line-height: 0 !important;
  background: var(--ds-surface) !important;
  border-radius: 8px !important;
  margin: 12px 0 !important;
  overflow: hidden !important;
  position: relative !important;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace !important;
  font-size: 0px !important;
  border: 1px solid var(--ds-border) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

/* 特殊代码块样式 */
.aitoutou-chat pre.temp-code-block,
.aitoutou-chat pre.partial-code-block {
  border: 1px dashed var(--ds-border) !important;
  background: rgba(0, 0, 0, 0.01) !important;
}

.aitoutou-chat pre code {
  display: block !important;
  padding: 16px !important;
  color: var(--ds-code-text) !important;
  overflow-x: auto !important;
  line-height: 1.6 !important;
  tab-size: 2 !important;
  -moz-tab-size: 2 !important;
  background: rgba(0, 0, 0, 0.02) !important;
  border: none !important;
  white-space: pre !important;
  font-size: 14px !important;
}

/* 确保临时代码块内容有良好显示 */
.aitoutou-chat pre.temp-code-block code,
.aitoutou-chat pre.partial-code-block code {
  background: rgba(0, 0, 0, 0.03) !important;
  color: var(--ds-text-secondary) !important;
  font-style: italic !important;
}

.aitoutou-chat pre.hljs-processing code {
  opacity: 0.7;
}

.aitoutou-chat pre.hljs-processed code {
  opacity: 1;
}

.aitoutou-chat .code-header {
  line-height: 0 !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  padding: 0 !important;
  background: var(--ds-surface) !important;
  border-bottom: 1px solid var(--ds-border) !important;
  font-size: 0 !important;
}

.code-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.aitoutou-chat .code-header .collapse-btn {
  position: relative !important;
  width: 30px !important;
  height: 30px !important;
  background: transparent !important;
  border: none !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  border-radius: 4px !important;
  z-index: 5 !important;
  transition: background-color 0.2s ease, transform 0.2s ease !important;
}

.aitoutou-chat .code-header .collapse-btn:hover {
  background-color: rgba(0, 0, 0, 0.1) !important;
}

.aitoutou-chat .code-header .collapse-btn:active {
  background-color: rgba(0, 0, 0, 0.15) !important;
  transform: scale(0.95) !important;
}

.aitoutou-chat .code-header .collapse-btn::before {
  content: "" !important;
  display: block !important;
  width: 10px !important;
  height: 10px !important;
  border-right: 2px solid var(--ds-text-secondary) !important;
  border-bottom: 2px solid var(--ds-text-secondary) !important;
  transform: rotate(45deg) !important;
  transition: transform 0.3s ease !important;
}

.aitoutou-chat .code-header .collapse-btn.collapsed::before {
  transform: rotate(-45deg) !important;
}

.code-content {
  overflow-x: auto !important;
  overflow-y: hidden !important;
  max-height: none !important;
  transition: max-height 0.5s ease;
  position: relative !important;
  opacity: 1 !important;
}

.aitoutou-chat pre .code-content.collapsed {
  max-height: 150px !important;
  overflow-y: hidden !important;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 80%, rgba(0, 0, 0, 0)) !important;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 80%, rgba(0, 0, 0, 0)) !important;
}

.aitoutou-chat .lang-label {
  margin-left: 8px !important;
  font-size: 13px !important;
  color: var(--ds-text-secondary) !important;
  font-family: monospace !important;
}

.aitoutou-chat .copy-btn {
  position: relative !important;
  width: 30px !important;
  height: 30px !important;
  background: transparent !important;
  border: none !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  border-radius: 4px !important;
  z-index: 5 !important;
  transition: background-color 0.2s ease, transform 0.2s ease !important;
}

.aitoutou-chat .copy-btn::before {
  content: "" !important;
  display: inline-block !important;
  width: 14px !important;
  height: 14px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='14' height='14' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='13' height='13' rx='2' ry='2'%3E%3C/rect%3E%3Cpath d='M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1'%3E%3C/path%3E%3C/svg%3E") !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  transition: all 0.3s ease !important;
}

.aitoutou-chat .copy-btn.copied::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='14' height='14' fill='none' stroke='%234CAF50' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E") !important;
}

.aitoutou-chat .copy-btn:hover {
  background: rgba(0, 0, 0, 0.05) !important;
  color: var(--ds-text-primary) !important;
}

.code-footer {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  padding: 8px 0 !important;
  background: var(--ds-surface) !important;
  border-top: 1px solid var(--ds-border) !important;
  position: relative !important;
}

.code-footer .collapse-btn {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 13px !important;
  color: var(--ds-text-secondary) !important;
  background: rgba(0, 0, 0, 0.03) !important;
  border: 1px solid var(--ds-border) !important;
  border-radius: 4px !important;
  padding: 0 !important;
  cursor: pointer !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  min-width: 35px !important;
  width: 35px !important;
  height: 20px !important;
  font-weight: 500 !important;
}

.code-footer .collapse-btn:hover {
  background: rgba(0, 0, 0, 0.08) !important;
  color: var(--ds-text-primary) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.code-footer .collapse-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.code-footer .collapse-btn::before {
  content: "" !important;
  display: inline-block !important;
  width: 8px !important;
  height: 8px !important;
  border-right: 2px solid currentColor !important;
  border-bottom: 2px solid currentColor !important;
  margin-right: 4px !important;
  transform: rotate(-135deg) !important;
  transition: transform 0.3s ease !important;
}

.code-footer .collapse-btn.collapsed::before {
  transform: rotate(45deg) !important;
}

.r1-reasoning-container {
  margin: 12px 0;
  border: 1px solid var(--ds-border-subtle);
  border-radius: 8px;
  background-color: rgba(0, 0, 0, 0.02);
  overflow: hidden;
  font-size: 14px;
  color: var(--ds-text-secondary);
}

.r1-reasoning-container .reasoning-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background-color: rgba(0, 0, 0, 0.02);
  border-bottom: 1px solid var(--ds-border-subtle);
  cursor: pointer;
}

.r1-reasoning-container .reasoning-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--ds-text-secondary);
  user-select: none;
  display: flex;
  align-items: center;
}

.r1-reasoning-container .reasoning-title::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 8px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='16' height='16' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z'%3E%3C/path%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
}

.r1-reasoning-container .collapse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  background: none;
  cursor: pointer;
  opacity: 0.7;
  padding: 0;
  outline: none;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.r1-reasoning-container .collapse-btn svg {
  transition: transform 0.2s ease;
}

.r1-reasoning-container .collapse-btn.expanded svg {
  transform: rotate(180deg);
}

.r1-reasoning-container .reasoning-content {
  padding: 10px 12px;
  font-size: 14px;
  line-height: 2.0;
  background: var(--ds-background-secondary);
  border-radius: 6px;
  white-space: pre-wrap;
  overflow-x: auto;
}

.r1-reasoning-container .reasoning-content pre {
  margin: 10px 0;
  padding: 12px;
  border-radius: 6px;
  background-color: rgba(0, 0, 0, 0.04);
  overflow-x: auto;
}

.r1-reasoning-container .reasoning-content code {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
  font-size: 13px;
  color: var(--ds-text-primary);
}

@media (max-width: 768px) {
  .r1-reasoning-container {
    margin: 10px 0;
    font-size: 13px;
  }

  .r1-reasoning-container .reasoning-header {
    padding: 6px 10px;
  }

  .r1-reasoning-container .reasoning-content {
    padding: 10px;
  }
}

/* 移除深度思考容器中折叠按钮的额外箭头 */
.r1-reasoning-container .collapse-btn::after {
  display: none !important;
}

/* 确保临时消息的折叠按钮可点击 */
.ai-message.temp .r1-reasoning-container .collapse-btn {
  pointer-events: auto !important;
  opacity: 0.7 !important;
}

/* 修复临时消息中的按钮动画 */
.ai-message.temp .r1-reasoning-container .collapse-btn svg {
  transition: transform 0.2s ease !important;
  animation: none !important;
}

/* 错误信息样式 */
.error-message {
  padding: 12px 16px;
  background: #FEE;
  color: #C41E3A;
  border-radius: 6px;
  margin: 8px 0;
  font-size: 14px;
  border-left: 3px solid #C41E3A;
}

/* 加载动画 */
.loading-dots {
  display: inline-block;
  position: relative;
}

.loading-dots:after {
  content: '.';
  animation: dots 1.5s steps(6, end) infinite;
}

@keyframes dots {

  0%,
  16% {
    content: '.';
  }

  16%,
  33% {
    content: '..';
  }

  33%,
  50% {
    content: '...';
  }

  50%,
  66% {
    content: '....';
  }

  66%,
  83% {
    content: '.....';
  }

  83%,
  100% {
    content: '......';
  }
}

@keyframes ds-fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* 移动设备适配 */
@media (max-width: 768px) {
  .aitoutou-sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    height: 100%;
    width: 280px;
    background: var(--ds-surface);
    transition: left 0.3s ease;
    z-index: 999;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
  }

  .aitoutou-sidebar.active {
    left: 0;
  }

  .sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: var(--ds-text-primary);
    padding: 10px;
    min-width: 42px;
    min-height: 42px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
  }

  .sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  }

  .sidebar-toggle:active {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(1px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  }

  .sidebar-toggle svg {
    width: 22px;
    height: 22px;
    stroke-width: 2.2;
    stroke: var(--ds-text-primary);
  }

  .toolbar-btn span {
    display: none;
  }

  .send-btn span {
    display: none;
  }

  .web-search-btn span {
    display: none;
  }

  .aitoutou-chat .chat-input {
    padding: 12px;
  }

  .aitoutou-chat .input-area {
    margin: 0;
  }

  .aitoutou-chat .chat-messages {
    padding-bottom: 16px;
  }

  .input-toolbar {
    padding: 6px 8px;
  }

  .toolbar-btn {
    padding: 6px;
  }

  .aitoutou-chat pre {
    margin: 12px 0;
    max-width: calc(100vw - 80px);
  }

  .model-btn .btn-text {
    display: none;
  }

  .avatar {
    width: 28px !important;
    height: 28px !important;
    margin-right: 12px !important;
  }

  .content {
    font-size: 14px;
  }

  pre code {
    font-size: 13px;
  }

  .aitoutou-chat .message {
    padding: 8px 12px;
  }

  .aitoutou-chat .content {
    max-width: 85%;
    font-size: 14px;
    padding: 10px 12px;
  }

  .aitoutou-chat .avatar {
    width: 28px !important;
    height: 28px !important;
  }
}

/* 深色模式样式 */

/* 针对特定元素的样式覆盖 - 文件上传 */
.aitoutou-chat-container .file-upload-container {
  position: relative;
}

/* 隐藏元素的通用类 */
.hidden {
  display: none !important;
}

.aitoutou-chat-container .hidden-file-input {
  position: absolute !important;
  width: 0.1px !important;
  height: 0.1px !important;
  opacity: 0 !important;
  overflow: hidden !important;
  z-index: -1 !important;
}

/* SVG图标修复 */
.aitoutou-chat-container .toolbar-btn svg {
  min-width: 18px !important;
  min-height: 18px !important;
  max-width: 18px !important;
  max-height: 18px !important;
  flex-shrink: 0 !important;
}

/* 文件上传按钮样式覆盖 */
.file-upload-container label.toolbar-btn {
  font-weight: 420;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 8px !important;
  border: none !important;
  background: none !important;
  color: var(--toolbar-icon-color) !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  border-radius: 4px !important;
  margin-right: 4px !important;
  height: 32px !important;
  min-width: 32px !important;
  box-sizing: border-box !important;
}

.file-upload-container label.toolbar-btn:hover {
  background: rgba(0, 0, 0, 0.04) !important;
  color: var(--ds-text-primary) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.file-upload-container label.toolbar-btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* 禁用状态的上传按钮样式 */
.file-upload-container label.toolbar-btn.disabled,
.toolbar-btn.disabled {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
}

.file-upload-container label.toolbar-btn.disabled:hover,
.toolbar-btn.disabled:hover {
  background: transparent !important;
  color: var(--ds-text-secondary) !important;
}

/* 绘图功能样式 */
.generated-image-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin: 15px 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
  background: #f9f9f9;
  transition: all 0.3s ease;
}

.generated-image {
  position: relative;
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  background: #f8f9fa;
  transition: opacity 0.3s ease-in-out;
}

.generated-image img {
  display: block;
  width: 100%;
  height: auto;
  transition: opacity 0.3s ease-in-out;
}

.generated-image.loading::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 1;
}

/* 修复图像生成结果样式 */
.drawing-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin: 15px 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
  background: #f9f9f9;
  transition: all 0.3s ease;
}

.ai-drawing-image {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 8px 8px 0 0;
}

.drawing-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 0;
  width: 100%;
  padding: 12px;
  background-color: #fff;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.drawing-download-btn,
.drawing-proxy-download-btn,
.drawing-open-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  color: #fff !important;
  background-color: #1a90ff !important;
  padding: 8px 18px !important;
  border-radius: 8px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  text-decoration: none !important;
  transition: all 0.3s ease;
  border: none !important;
  cursor: pointer !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15) !important;
}

.drawing-download-btn:hover,
.drawing-proxy-download-btn:hover,
.drawing-open-btn:hover {
  background-color: #0d80e0 !important;
  text-decoration: none !important;
  color: white !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
  transform: translateY(-2px);
}

.drawing-download-btn:active,
.drawing-proxy-download-btn:active,
.drawing-open-btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.drawing-download-btn svg,
.drawing-proxy-download-btn svg,
.drawing-open-btn svg {
  width: 16px;
  height: 16px;
  stroke: white;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.image-error-message {
  padding: 20px;
  background: #fff8f8;
  border: 1px solid #ffdddd;
  border-radius: 8px;
  margin: 15px 0;
  color: #d32f2f;
  text-align: center;
}

.image-error-message p {
  margin: 5px 0;
  font-size: 14px;
}

.loading-spinner {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* 图片控制按钮样式 */
.image-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 0;
  width: 100%;
  padding: 12px;
  background-color: #fff;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.image-control-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  color: #fff !important;
  background-color: #1a90ff !important;
  padding: 8px 18px !important;
  border-radius: 8px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  text-decoration: none !important;
  transition: all 0.3s ease;
  border: none !important;
  cursor: pointer !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15) !important;
}

.image-control-btn:hover {
  background-color: #0d80e0 !important;
  text-decoration: none !important;
  color: white !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
  transform: translateY(-2px);
}

.image-control-btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.image-control-btn.download-btn::before {
  content: "" !important;
  display: inline-block !important;
  width: 16px !important;
  height: 16px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='16' height='16' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4'%3E%3C/path%3E%3Cpolyline points='7 10 12 15 17 10'%3E%3C/polyline%3E%3Cline x1='12' y1='15' x2='12' y2='3'%3E%3C/line%3E%3C/svg%3E") !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
}

.image-control-btn.open-btn::before {
  content: "" !important;
  display: inline-block !important;
  width: 16px !important;
  height: 16px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='16' height='16' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6'%3E%3C/path%3E%3Cpolyline points='15 3 21 3 21 9'%3E%3C/polyline%3E%3Cline x1='10' y1='14' x2='21' y2='3'%3E%3C/line%3E%3C/svg%3E") !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
}

/* 样式智能绘图按钮的活动状态 */
#draw-mode-input.active {
  background-color: #e6f7ff !important;
  color: #1890ff !important;
  border-color: #91d5ff !important;
}

/* 正在思考的状态显示 */
.ai-thinking {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  color: #666;
}

.ai-thinking p {
  margin: 0;
  line-height: 1.5;
}

.loading-dots {
  display: inline-block;
}

.loading-dots:after {
  content: '.';
  animation: dots 1.5s steps(6, end) infinite;
}

@keyframes dots {

  0%,
  16% {
    content: '.';
  }

  16%,
  33% {
    content: '..';
  }

  33%,
  50% {
    content: '...';
  }

  50%,
  66% {
    content: '....';
  }

  66%,
  83% {
    content: '.....';
  }

  83%,
  100% {
    content: '......';
  }
}

.aitoutou-chat .uploaded-files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.aitoutou-chat .file-badge {
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 13px;
  color: var(--ds-text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.aitoutou-chat .file-badge::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='14' height='14' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z'%3E%3C/path%3E%3Cpolyline points='13 2 13 9 20 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
}

.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 998;
  display: none;
}

.error-detailed {
  background-color: #fff8f8;
  border: 1px solid #ffebeb;
  border-radius: 8px;
  padding: 16px;
  margin: 12px 0;
  color: #d03050;
  font-size: 14px;
  max-width: 100%;
  overflow-wrap: break-word;
}

.error-detailed p {
  margin: 8px 0;
  font-weight: 500;
}

.error-detailed ul {
  margin: 8px 0;
  padding-left: 24px;
}

.error-detailed li {
  line-height: 2.0;
  margin-bottom: 8px;
}

.ai-error-container {
  padding: 12px;
  border-radius: 8px;
  background-color: #fff8f8;
  border: 1px solid #ffebeb;
  margin: 10px 0;
  color: #d03050;
  font-size: 15px;
  font-weight: 500;
}

.ai-error-container>p {
  margin: 0 0 10px 0;
}

@media (max-width: 768px) {
  .sidebar-overlay.active {
    display: block;
  }
}

/* 引擎和模型选择下拉框样式 */
.engines-dropdown-container,
.models-dropdown-container {
  margin: 10px 15px;
  background-color: var(--aitoutou-sidebar-button-bg);
  border-radius: 6px;
  padding: 8px 10px;
}

.engine-model-dropdown-container {
  margin: 12px;
  background-color: var(--ds-surface);
  border-radius: 12px;
  padding: 12px;
  box-shadow: var(--ds-shadow-sm);
  border: 1px solid var(--ds-border);
}

.engine-model-dropdown-container label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ds-text-secondary);
  margin-bottom: 6px;
}

.dropdown-select-wrapper {
  margin-bottom: 10px;
}

.dropdown-select-wrapper:last-child {
  margin-bottom: 0;
}

.engine-model-dropdown-container .dropdown-selects {
  display: flex;
  gap: 6px;
}

.engine-model-dropdown-container .engine-select,
.engine-model-dropdown-container .model-select {
  flex: 1;
  min-width: 0;
}

.engines-dropdown-container label,
.models-dropdown-container label {
  display: block;
  font-size: 12px;
  color: var(--aitoutou-text-secondary);
  margin-bottom: 5px;
}

.engine-select,
.model-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--ds-border);
  border-radius: 6px;
  background-color: var(--ds-surface);
  color: var(--ds-text-primary);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;
}

.engine-select:focus,
.model-select:focus {
  outline: none;
  border-color: var(--ds-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.engine-select:hover,
.model-select:hover {
  border-color: var(--ds-primary);
}

/* 新增动画与过渡特效 */
/* 1. 消息淡入动画 */
.aitoutou-chat .message {
  animation: fadeInMessage 0.4s ease-out;
  transform-origin: top;
}

@keyframes fadeInMessage {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* 2. 按钮悬停缩放效果 */
.sidebar-btn,
.toolbar-btn,
.send-btn,
.image-control-btn,
.engine-select {
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.sidebar-btn:hover,
.toolbar-btn:hover,
.send-btn:hover,
.image-control-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.sidebar-btn:active,
.toolbar-btn:active,
.send-btn:active,
.image-control-btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* 3. 输入框焦点动画 */
.aitoutou-chat .chat-input textarea {
  transition: border-color 0.3s, box-shadow 0.3s;
}

.aitoutou-chat .chat-input textarea:focus {
  box-shadow: 0 0 0 2px rgba(30, 99, 224, 0.3);
}

/* 4. 扩展的加载动画 */
.fancy-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px 0;
}

.fancy-loading .dot {
  width: 8px;
  height: 8px;
  margin: 0 4px;
  border-radius: 50%;
  background-color: var(--ds-primary);
  animation: pulse 1.5s infinite ease-in-out;
}

.fancy-loading .dot:nth-child(2) {
  animation-delay: 0.2s;
}

.fancy-loading .dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(0.8);
    opacity: 0.6;
  }

  50% {
    transform: scale(1.2);
    opacity: 1;
  }
}

/* 5. 侧边栏过渡效果 */
.aitoutou-sidebar {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* 6. 历史项目高亮特效 */
.history-item {
  transition: all 0.2s ease;
}

.history-item:hover {
  background-color: rgba(30, 99, 224, 0.1);
  transform: translateX(4px);
}

/* 7. 代码块展开/折叠特效 */
.code-content {
  transition: max-height 0.5s ease;
  overflow: hidden;
}

/* 8. 文件上传区域反馈动画 */
.file-upload-feedback {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 20px;
  z-index: 1000;
  min-width: 300px;
  max-width: 90%;
  text-align: center;
  transition: all 0.3s ease;
}

/* 反馈框关闭按钮样式 */
.file-upload-feedback .close-feedback {
  position: absolute;
  top: 8px;
  right: 8px;
  cursor: pointer;
  width: 24px;
  height: 24px;
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.file-upload-feedback .close-feedback:hover {
  background-color: rgba(0, 0, 0, 0.1);
  transform: scale(1.1);
}

.file-upload-feedback .close-feedback:active {
  transform: scale(0.95);
}

.drawing-mode-feedback .close-feedback {
  background-color: rgba(229, 62, 62, 0.1);
}

.drawing-mode-feedback .close-feedback:hover {
  background-color: rgba(229, 62, 62, 0.2);
}

/* 绘图模式下的反馈框样式 */
.file-upload-feedback.drawing-mode-feedback {
  background-color: rgba(255, 235, 235, 0.95);
  border: 1px solid #ffcccc;
}

.file-upload-feedback h3 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 16px;
  font-weight: 500;
}

.file-upload-feedback small {
  color: rgba(0, 0, 0, 0.6);
  font-size: 12px;
}

.drawing-mode-feedback small {
  color: rgba(229, 62, 62, 0.8);
}

/* 拖放上传高亮样式 */
.drag-highlight {
  position: relative;
  outline: 2px dashed var(--ds-primary) !important;
  outline-offset: -8px;
  background-color: rgba(30, 99, 224, 0.05) !important;
}

.allow-drop {
  position: relative;
}

/* 在整个聊天区域显示拖放提示 */
.allow-drop.drag-highlight::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(30, 99, 224, 0.05);
  z-index: 2;
  pointer-events: none;
}

/* 9. 设置页面表单元素特效 */
.engine-item,
.model-item {
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.engine-item:hover,
.model-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

/* 10. 设置页面组件展开折叠效果 */
.engine-content,
.model-content {
  transition: height 0.3s ease, opacity 0.3s ease;
  overflow: hidden;
}

/* 11. 模态框淡入淡出动画 */
.aitoutou-modal {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.aitoutou-modal.active {
  opacity: 1;
}

.aitoutou-modal-content {
  transform: translateY(-20px);
  transition: transform 0.3s ease;
}

.aitoutou-modal.active .aitoutou-modal-content {
  transform: translateY(0);
}

/* 12. 深度思考区域展开/折叠过渡 */
.r1-reasoning-container .reasoning-content {
  transition: max-height 0.5s ease, opacity 0.3s ease;
}

/* 13. 提示消息动画 */
.status-message {
  padding: 10px 15px;
  background-color: var(--ds-primary);
  color: white;
  border-radius: var(--ds-radius-sm);
  margin: 10px 0;
  opacity: 0;
  transform: translateY(-10px);
  animation: slideInFadeOut 3s forwards;
}

@keyframes slideInFadeOut {
  0% {
    opacity: 0;
    transform: translateY(-10px);
  }

  15% {
    opacity: 1;
    transform: translateY(0);
  }

  85% {
    opacity: 1;
    transform: translateY(0);
  }

  100% {
    opacity: 0;
    transform: translateY(-10px);
  }
}

/* 14. 页面初始加载动画 */
.page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeOut 0.5s 1s forwards;
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
    visibility: hidden;
  }
}

.loader-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(30, 99, 224, 0.2);
  border-radius: 50%;
  border-top-color: var(--ds-primary);
  animation: spin 1s infinite linear;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* 深色模式适配 */

/* 欢迎动画样式 */
.welcome-animation {
  text-align: center;
  padding: 40px 0;
  opacity: 0;
  transform: translateY(-20px);
  animation: welcomeFadeIn 0.8s forwards;
}

.welcome-title {
  font-size: 32px;
  font-weight: bold;
  color: var(--ds-primary);
  margin-bottom: 10px;
  letter-spacing: 1px;
}

.welcome-subtitle {
  font-size: 18px;
  color: var(--ds-text-secondary);
  opacity: 0;
  transform: translateY(10px);
  animation: welcomeSubtitleIn 0.6s 0.4s forwards;
}

@keyframes welcomeFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes welcomeSubtitleIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 在流式输出过程中稳定按钮外观，防止闪烁 - 移除pointer-events限制 */
.ai-message.temp .r1-reasoning-container .collapse-btn {
  transition: none !important;
}

/* 在流式输出过程中稳定箭头动画，防止闪烁 */
.ai-message.temp .r1-reasoning-container .collapse-btn::after {
  display: none !important;
}

/* 在流式输出过程中稳定代码框按钮，防止闪烁 - 移除pointer-events限制 */
.ai-message.temp .code-header .collapse-btn,
.ai-message.temp .code-footer .collapse-btn {
  transition: none !important;
}

.aitoutou-chat .code-header .collapse-btn::before {
  content: "" !important;
  display: block !important;
  width: 10px !important;
  height: 10px !important;
  border-right: 2px solid var(--ds-text-secondary) !important;
  border-bottom: 2px solid var(--ds-text-secondary) !important;
  transform: rotate(45deg) !important;
  transition: transform 0.3s ease !important;
}

/* 在流式输出过程中稳定代码框按钮箭头动画，防止闪烁 */
.ai-message.temp .code-header .collapse-btn::before,
.ai-message.temp .code-footer .collapse-btn::before {
  transition: none !important;
}

/* 流式输出时仅禁用动画和过渡效果，但允许交互 */
[data-streaming="true"],
[data-streaming="true"] *,
.ai-message.temp [data-streaming="true"],
.ai-message.temp [data-streaming="true"] * {
  transition: none !important;
  animation: none !important;
}

/* 流式输出时固定按钮样式，但允许交互 */
.ai-message.temp .r1-reasoning-container .collapse-btn,
.ai-message.temp .code-header .collapse-btn,
.ai-message.temp .code-footer .collapse-btn,
.ai-message.temp .code-header .copy-btn {
  transition: background-color 0.2s ease !important;
  animation: none !important;
  opacity: 1 !important;
  cursor: pointer !important;
  pointer-events: auto !important;
  /* 防止闪烁，固定位置和背景 */
  transform: none !important;
  background-color: rgba(0, 0, 0, 0.05) !important;
  position: relative !important;
  z-index: 2 !important;
  user-select: none !important;
  touch-action: manipulation !important;
}

.ai-message.temp .code-header .copy-btn {
  width: 30px !important;
  height: 30px !important;
}

/* 更强制的选择器，保留流式输出过程中样式，启用悬停效果 */
.ai-message.temp .r1-reasoning-container .collapse-btn:hover,
.ai-message.temp .r1-reasoning-container .collapse-btn:active,
.ai-message.temp .r1-reasoning-container .collapse-btn:focus,
.ai-message.temp .code-header .collapse-btn:hover,
.ai-message.temp .code-header .collapse-btn:active,
.ai-message.temp .code-header .collapse-btn:focus,
.ai-message.temp .code-footer .collapse-btn:hover,
.ai-message.temp .code-footer .collapse-btn:active,
.ai-message.temp .code-footer .collapse-btn:focus,
.ai-message.temp .code-header .copy-btn:hover,
.ai-message.temp .code-header .copy-btn:active,
.ai-message.temp .code-header .copy-btn:focus {
  background-color: rgba(0, 0, 0, 0.1) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1) !important;
}

/* 流式输出时禁用箭头动画 */
.ai-message.temp .r1-reasoning-container .collapse-btn::after,
.ai-message.temp .code-header .collapse-btn::before,
.ai-message.temp .code-footer .collapse-btn::before {
  transition: none !important;
  animation: none !important;
}

/* 添加按钮点击反馈效果 */
.aitoutou-chat .collapse-btn.clicked,
.aitoutou-chat .copy-btn.clicked {
  background-color: rgba(0, 0, 0, 0.25) !important;
  transform: scale(0.92) !important;
  transition: all 0.1s ease-out !important;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2) !important;
}

/* 重新定义在流式输出过程中的按钮交互样式 */
.ai-message.temp .collapse-btn,
.ai-message.temp .copy-btn {
  transition: transform 0.2s ease, background-color 0.2s ease !important;
  cursor: pointer !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* 流式输出中的按钮交互增强 */
.ai-message.temp .collapse-btn:hover,
.ai-message.temp .copy-btn:hover {
  background-color: rgba(0, 0, 0, 0.1) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1) !important;
}

.ai-message.temp .collapse-btn:active,
.ai-message.temp .copy-btn:active {
  background-color: rgba(0, 0, 0, 0.2) !important;
  transform: scale(0.95) !important;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2) !important;
}

/* 确保流式输出中的箭头正确显示 */
.ai-message.temp .code-header .collapse-btn::before,
.ai-message.temp .code-footer .collapse-btn::before {
  border-color: var(--ds-text-secondary) !important;
  opacity: 1 !important;
}

/* 增强响应性，提高点击反馈 */
.collapse-btn.clicked::before,
.code-footer .collapse-btn.clicked::before {
  border-color: white !important;
}

/* 处理按钮在过渡状态时的样式，防止闪烁和多次点击 */
.collapse-btn[data-transition="true"] {
  pointer-events: none !important;
  cursor: default !important;
  opacity: 0.8 !important;
  background-color: rgba(0, 0, 0, 0.15) !important;
  transform: scale(0.98) !important;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1) !important;
  transition: none !important;
}

/* 在流式输出过程中专门处理按钮闪烁问题 */
@keyframes none-important {
  0% {
    opacity: 1;
  }

  100% {
    opacity: 1;
  }
}

.ai-message.temp * {
  animation-name: none-important !important;
  transition-duration: 0s !important;
}

.ai-message.temp .collapse-btn,
.ai-message.temp .copy-btn {
  backface-visibility: hidden !important;
  transform: translateZ(0) !important;
  -webkit-font-smoothing: subpixel-antialiased !important;
  will-change: opacity, transform !important;
}

/* 更强力的闪烁修复 - 完全禁用代码块按钮的视觉变化 */
.ai-message.temp pre.code-block {
  contain: paint !important;
}

.ai-message.temp .code-header .collapse-btn,
.ai-message.temp .code-footer .collapse-btn {
  contain: paint !important;
  position: relative !important;
  z-index: 10 !important;
  transform: none !important;
  transition-property: none !important;
  backface-visibility: hidden !important;
  appearance: none !important;
  -webkit-font-smoothing: subpixel-antialiased !important;
  background-color: rgba(0, 0, 0, 0.05) !important;
  cursor: pointer !important;
  pointer-events: auto !important;
  /* 确保可点击 */
  width: 30px !important;
  height: 30px !important;
}

.ai-message.temp .code-footer .collapse-btn {
  width: 35px !important;
  height: 20px !important;
}

.ai-message.temp .code-header .copy-btn {
  width: 30px !important;
  height: 30px !important;
}

/* 使用更强的CSS选择器覆盖所有继承的动画和过渡 */
.ai-message.temp *,
.ai-message.temp *::before,
.ai-message.temp *::after {
  animation-play-state: paused !important;
  transition-duration: 0s !important;
  animation-duration: 0s !important;
  animation-delay: 0s !important;
  transition-delay: 0s !important;
}

/* 使用隐藏的覆盖层防止按钮闪烁 */
.ai-message.temp .code-header .collapse-btn::after {
  content: '' !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 2 !important;
  background-color: transparent !important;
  pointer-events: none !important;
}

/* 增强流式输出时按钮的点击反馈 */
.ai-message.temp .code-header .collapse-btn:active,
.ai-message.temp .code-footer .collapse-btn:active {
  transform: scale(0.95) !important;
  background-color: rgba(0, 0, 0, 0.15) !important;
  transition: none !important;
}

/* 提高事件处理的可靠性 */
.code-header,
.code-footer {
  position: relative !important;
  z-index: 5 !important;
}

.code-header .collapse-btn,
.code-footer .collapse-btn {
  position: relative !important;
  z-index: 10 !important;
  isolation: isolate !important;
  pointer-events: auto !important;
  /* 确保始终可交互 */
}

/* 一键到底按钮 */
.scroll-to-bottom-btn {
  position: absolute;
  bottom: 80px;
  right: 20px;
  width: 32px;
  /* 缩小尺寸 */
  height: 32px;
  /* 缩小尺寸 */
  border-radius: 50%;
  background: var(--ds-primary);
  color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  /* 使用弹跳效果 */
  opacity: 0;
  transform: translateY(20px) scale(0.9);
  pointer-events: none;
  border: 2px solid white;
  /* 添加白色边框 */
}

.scroll-to-bottom-btn.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  animation: pulse-gentle 2s infinite alternate;
  /* 添加轻微脉动动画 */
}

.scroll-to-bottom-btn:hover {
  background: var(--ds-primary-hover);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transform: translateY(-2px) scale(1.1);
  /* 悬停时放大效果 */
}

.scroll-to-bottom-btn:active {
  transform: translateY(1px) scale(0.95);
  /* 点击时缩小效果 */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.scroll-to-bottom-btn svg {
  width: 16px;
  /* 缩小图标 */
  height: 16px;
  /* 缩小图标 */
  fill: currentColor;
}

.scroll-to-bottom-btn .message-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #e53e3e;
  color: white;
  border-radius: 50%;
  min-width: 18px;
  /* 缩小计数器 */
  height: 18px;
  /* 缩小计数器 */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  /* 缩小字体 */
  font-weight: bold;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  border: 1px solid white;
  /* 添加白色边框 */
  animation: bounce-in 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  /* 添加弹跳动画 */
}

/* 脉动动画 */
@keyframes pulse-gentle {
  0% {
    transform: scale(1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  }

  100% {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  }
}

/* 消息计数弹跳动画 */
@keyframes bounce-in {
  0% {
    transform: scale(0);
    opacity: 0;
  }

  50% {
    transform: scale(1.2);
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* 深色模式 */

@media (max-width: 768px) {
  .scroll-to-bottom-btn {
    bottom: 70px;
    right: 15px;
    width: 28px;
    /* 移动设备上更小 */
    height: 28px;
    /* 移动设备上更小 */
  }
}

/* 绘图加载动画 */
.drawing-loading-container {
  padding: 30px;
  text-align: center;
}

.drawing-loading-message {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  border-radius: 12px;
  background-color: #f7f7f7;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.drawing-loading-message p {
  margin: 10px 0 0;
  color: #666;
}

.drawing-loading-detail {
  font-size: 14px;
  color: #888;
}

.fancy-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.fancy-loading .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #4a89dc;
  opacity: 0.6;
  animation: dot-flashing 1.5s infinite linear alternate;
}

.fancy-loading .dot:nth-child(2) {
  animation-delay: 0.5s;
}

.fancy-loading .dot:nth-child(3) {
  animation-delay: 1s;
}

@keyframes dot-flashing {
  0% {
    opacity: 0.2;
    transform: scale(0.8);
  }

  50% {
    opacity: 0.5;
    transform: scale(1);
  }

  100% {
    opacity: 1;
    transform: scale(1.2);
  }
}

/* 错误详情样式 */
.error-detailed {
  margin-top: 10px;
  padding: 10px;
  border-radius: 5px;
  background-color: #f8f8f8;
  font-size: 14px;
}

.error-detailed p {
  margin: 0 0 8px;
  color: #666;
}

.response-debug {
  max-height: 200px;
  overflow: auto;
  padding: 10px;
  background-color: #f0f0f0;
  border-radius: 4px;
  font-family: monospace;
  font-size: 12px;
  white-space: pre-wrap;
  color: #444;
  border: 1px solid #ddd;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* 联网搜索按钮样式 */
.web-search-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.web-search-btn.active {
  color: var(--primary-color);
  background-color: rgba(var(--primary-color-rgb), 0.1);
}

.web-search-container {
  position: relative;
}

/* 搜索结果容器包装器样式 */
.search-results-container-wrapper {
  margin-bottom: 15px;
  order: 1;
  width: 100%;
  position: relative;
  z-index: 10;
}

/* 搜索结果容器样式 - 与深度思考容器样式保持一致 */
.search-results-container {
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  margin-bottom: 15px;
  background-color: #f9f9f9;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  width: 100%;
  position: relative;
  z-index: 10;
}

.search-results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background-color: #f5f5f5;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  cursor: pointer;
  user-select: none;
  position: relative;
  z-index: 2;
}

.search-results-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--ds-text-secondary, #666);
  user-select: none;
  display: flex;
  align-items: center;
}

.search-results-title::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 8px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
}

/* 折叠按钮样式 */
.search-results-container .collapse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  background: none;
  cursor: pointer;
  opacity: 0.7;
  padding: 0;
  outline: none;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.search-results-container .collapse-btn svg {
  transition: transform 0.2s ease;
}

.search-results-container .collapse-btn.expanded svg {
  transform: rotate(180deg);
}

.search-results-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 500px;
  overflow-y: auto;
  transition: max-height 0.3s ease;
  position: relative;
  z-index: 1;
}

.search-results-list.collapsed {
  display: none;
  max-height: 0;
}

.search-result-item {
  padding: 10px 15px;
  border-bottom: 1px solid #eaeaea;
}

.search-result-item:last-child {
  border-bottom: none;
}

.result-index {
  display: inline-block;
  min-width: 25px;
  color: #666;
  font-weight: 600;
}

.search-result-item a {
  color: #0066cc;
  font-weight: 500;
  text-decoration: none;
}

.search-result-item a:hover {
  text-decoration: underline;
}

.result-snippet {
  margin-top: 4px;
  font-size: 14px;
  line-height: 2.0;
  color: var(--ds-text-secondary);
}

/* 确保在流式输出过程中也能折叠搜索结果 */
.ai-message.temp .search-results-container {
  animation: none !important;
  transition: none !important;
  pointer-events: auto !important;
}

.ai-message.temp .search-results-list.collapsed {
  display: none !important;
}

/* 确保临时消息的折叠按钮可点击 */
.ai-message.temp .search-results-container .collapse-btn {
  pointer-events: auto !important;
  opacity: 0.7 !important;
  cursor: pointer !important;
  z-index: 999 !important;
}

/* 确保临时消息的标题区域可点击 */
.ai-message.temp .search-results-container .search-results-header {
  pointer-events: auto !important;
  cursor: pointer !important;
  user-select: none !important;
  z-index: 998 !important;
}

/* 解决可能的叠层问题，确保点击事件能正确触发 */
.ai-message.temp .search-results-container * {
  pointer-events: auto !important;
}

/* 修复临时消息中搜索结果列表的样式 */
.ai-message.temp .search-results-list {
  transition: max-height 0.1s ease !important;
  max-height: 500px !important;
  overflow-y: auto !important;
}

/* 百度云千帆搜索结果特殊样式加强 */
.search-results-container[data-search-api="baiduce"] .search-results-header,
.ai-message [data-search-api="baiduce"] .search-results-header {
  cursor: pointer !important;
  user-select: none !important;
  pointer-events: auto !important;
  z-index: 9999 !important;
  background-color: #f0f6ff !important;
}

.search-results-container[data-search-api="baiduce"] .collapse-btn,
.ai-message [data-search-api="baiduce"] .collapse-btn {
  pointer-events: auto !important;
  cursor: pointer !important;
  opacity: 1 !important;
  z-index: 9999 !important;
}

.search-results-container[data-search-api="baiduce"] .search-results-list,
.ai-message [data-search-api="baiduce"] .search-results-list {
  box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.1) !important;
  background-color: #fdfdfd !important;
}

.search-results-container[data-search-api="baiduce"] .search-results-title,
.ai-message [data-search-api="baiduce"] .search-results-title {
  font-weight: 600 !important;
  color: #4a6baf !important;
}

/* 腾讯云混元搜索结果特殊样式加强 */
/* 腾讯云混元API已整合到百度云千帆API，样式重定向 */
.search-results-container[data-search-api="tencenthx"] .search-results-header,
.ai-message [data-search-api="tencenthx"] .search-results-header,
.search-results-container[data-search-api="baiduce"] .search-results-header,
.ai-message [data-search-api="baiduce"] .search-results-header {
  cursor: pointer !important;
  user-select: none !important;
  pointer-events: auto !important;
  z-index: 9999 !important;
  background-color: #f0f8ff !important;
}

.search-results-container[data-search-api="tencenthx"] .collapse-btn,
.ai-message [data-search-api="tencenthx"] .collapse-btn,
.search-results-container[data-search-api="baiduce"] .collapse-btn,
.ai-message [data-search-api="baiduce"] .collapse-btn {
  pointer-events: auto !important;
  cursor: pointer !important;
  opacity: 1 !important;
  z-index: 9999 !important;
}

.search-results-container[data-search-api="tencenthx"] .search-results-list,
.ai-message [data-search-api="tencenthx"] .search-results-list,
.search-results-container[data-search-api="baiduce"] .search-results-list,
.ai-message [data-search-api="baiduce"] .search-results-list {
  box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.1) !important;
  background-color: #fdfdfd !important;
}

.search-results-container[data-search-api="tencenthx"] .search-results-title,
.ai-message [data-search-api="tencenthx"] .search-results-title,
.search-results-container[data-search-api="baiduce"] .search-results-title,
.ai-message [data-search-api="baiduce"] .search-results-title {
  font-weight: 600 !important;
  color: #2e7bd6 !important;
}

/* 无权限模型样式 */
.limited-permission {
  color: #888;
  font-style: italic;
}

/* 错误消息中的链接样式 */
.ai-error-container a {
  color: #1a73e8;
  text-decoration: none;
  font-weight: bold;
}

.ai-error-container a:hover {
  text-decoration: underline;
}

/* 购买按钮样式 */
.ai-error-container a.purchase-btn {
  display: inline-block;
  background-color: #4caf50;
  color: white;
  padding: 6px 12px;
  border-radius: 4px;
  margin: 0 4px;
  transition: background-color 0.3s;
  text-decoration: none;
  vertical-align: middle;
}

.ai-error-container a.purchase-btn:hover {
  background-color: #45a049;
  text-decoration: none;
}

/* 登录按钮样式 */
.ai-error-container a.login-btn {
  display: inline-block;
  background-color: #1a73e8;
  color: white;
  padding: 6px 12px;
  border-radius: 4px;
  margin: 0 4px;
  transition: background-color 0.3s;
  text-decoration: none;
  vertical-align: middle;
}

.ai-error-container a.login-btn:hover {
  background-color: #1565c0;
  text-decoration: none;
}

/* 注册按钮样式 */
.ai-error-container a.register-btn {
  display: inline-block;
  background-color: #ff9800;
  color: white;
  padding: 6px 12px;
  border-radius: 4px;
  margin: 0 4px;
  transition: background-color 0.3s;
  text-decoration: none;
  vertical-align: middle;
}

.ai-error-container a.register-btn:hover {
  background-color: #f57c00;
  text-decoration: none;
}

/* 权限操作按钮容器样式 */
.ai-error-container .action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

/* 文本中的按钮特殊样式 */
.ai-error-container p a.login-btn,
.ai-error-container p a.register-btn,
.ai-error-container p a.purchase-btn {
  margin: 0 4px;
  line-height: 1;
}

/* 代码格式化按钮样式 */

/* 增强用户消息中代码块的样式 */
.user-message pre.code-block {
  background-color: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.1);
  margin: 10px 0;
}

.user-message .code-header {
  background-color: rgba(0, 0, 0, 0.05);
  border-bottom-color: rgba(0, 0, 0, 0.1);
}

.user-message .code-content {
  background-color: rgba(0, 0, 0, 0.02);
}

.user-message .code-content code {
  color: #333;
}

/* 确保用户消息中的代码块按钮更明显 */
.user-message .copy-btn,
.user-message .collapse-btn {
  opacity: 0.8;
}

.user-message .copy-btn:hover,
.user-message .collapse-btn:hover {
  opacity: 1;
}

/* 代码块按钮样式优化 */
.code-block .collapse-btn,
.code-block .copy-btn {
  padding: 4px;
  margin: 0 2px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 24px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.code-block .collapse-btn:hover,
.code-block .copy-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: scale(1.1);
}

.code-block .collapse-btn:active,
.code-block .copy-btn:active {
  transform: scale(0.95);
  background-color: rgba(255, 255, 255, 0.2);
}

/* 折叠按钮箭头动画 */
.code-block .collapse-btn svg {
  transition: transform 0.2s ease;
  transform-origin: center;
}

.code-block .collapse-btn.collapsed svg {
  transform: rotate(-90deg);
}

/* 代码内容折叠动画 */
.code-block .code-content {
  transition: max-height 0.3s ease;
  overflow: hidden;
}

.code-block .code-content.collapsed {
  max-height: 0;
}

/* 确保按钮在各种状态下都可点击 */
.code-block .code-header,
.code-block .code-footer {
  pointer-events: auto !important;
}

.code-block .collapse-btn,
.code-block .copy-btn {
  pointer-events: auto !important;
  z-index: 2;
  position: relative;
}

/* 改进流式输出时的代码块按钮响应性 */
.ai-message.temp .code-header .copy-btn {
  pointer-events: auto !important;
  opacity: 1 !important;
  cursor: pointer !important;
  z-index: 10 !important;
  position: relative !important;
}

/* 添加复制按钮的视觉反馈 */
.code-block .copy-btn {
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.code-block .copy-btn:hover,
.code-block .copy-btn.hover-active {
  background-color: rgba(255, 255, 255, 0.1);
  transform: scale(1.1);
}

.code-block .copy-btn:active {
  transform: scale(0.95);
  background-color: rgba(255, 255, 255, 0.2);
}

/* 解决流式输出时的pointer-events问题 */
.ai-message.temp * {
  animation: none !important;
  transition: none !important;
  pointer-events: auto !important;
}

.ai-message.temp .code-header,
.ai-message.temp .code-header * {
  pointer-events: auto !important;
}

/* 确保流式输出时复制按钮的样式保持一致 */
.ai-message.temp .code-block .copy-btn:hover,
.ai-message.temp .code-block .copy-btn.hover-active {
  background-color: rgba(255, 255, 255, 0.1) !important;
  transform: scale(1.1) !important;
  transition: none !important;
}

.ai-message.temp .code-block .copy-btn:active {
  transform: scale(0.95) !important;
  background-color: rgba(255, 255, 255, 0.2) !important;
}

/* 语音输入样式已移至voice-input.js中的ModernVoiceInput类 */

@keyframes pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }

  100% {
    transform: scale(1);
  }
}

/* 自定义下拉框样式 - 从SEO生成器移植 */
.custom-select {
  position: relative;
  width: 100%;
  min-width: 150px;
  z-index: 10;
  margin-bottom: 0;
}

.custom-select.open {
  z-index: 99999 !important;
}

.custom-select-selected {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--ds-border);
  border-radius: 6px;
  background-color: var(--ds-surface);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  padding-right: 30px;
  min-height: 38px;
  box-sizing: border-box;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

#engine-select-container .custom-select-selected {
  border-color: #4299e1;
  background-color: #ebf8ff;
  font-weight: 500;
}

#model-select-container .custom-select-selected {
  border-color: #68d391;
  background-color: #f0fff4;
  font-weight: 500;
}

.custom-select-selected:after {
  content: '';
  position: absolute;
  right: 12px;
  top: 50%;
  width: 12px;
  height: 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  transform: translateY(-50%);
  transition: transform 0.2s ease;
}

.custom-select.open .custom-select-selected:after {
  transform: translateY(-50%) rotate(180deg);
}

.custom-select-selected:hover {
  border-color: var(--ds-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.custom-select-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  /* 确保下拉菜单宽度与下拉框一致 */
  max-height: 250px;
  overflow-y: auto;
  border: 1px solid var(--ds-border);
  border-radius: 6px;
  background-color: var(--ds-surface);
  margin-top: 4px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  z-index: 99999;
  display: none;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.2s, transform 0.2s;
}

.custom-select-dropdown.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* 改进选项样式 */
.custom-select-option {
  cursor: pointer;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-bottom: 1px solid #f0f0f0;
  position: relative;
  box-sizing: border-box;
  min-width: 100%;
  /* 确保选项宽度与下拉菜单一致 */
}

/* 选项悬停效果 */
.custom-select-option:hover {
  background-color: #f5f7fa !important;
}

/* 图标样式 */
.select-option-icon {
  width: 20px;
  height: 20px;
  margin-right: 10px;
  object-fit: contain;
  flex-shrink: 0;
  display: inline-block !important;
  vertical-align: middle !important;
}

/* 选项文本样式 */
.option-text {
  flex: 1;
  color: var(--ds-text-primary);
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  vertical-align: middle;
  max-width: calc(100% - 30px);
  /* 考虑图标宽度，减去图标和间距的宽度 */
}

/* 修改悬停提示效果 */
.custom-select-option {
  position: relative;
}

.custom-select-option:hover {
  background-color: #f5f7fa !important;
}

/* 添加tooltip效果 */
.custom-select-option[title]:hover:after,
.custom-select-option .option-text[data-full-text]:hover:after {
  content: attr(data-full-text);
  position: absolute;
  top: -30px;
  left: 0;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 10000;
  pointer-events: none;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media screen and (max-width: 782px) {
  .custom-select-option {
    padding: 10px 12px !important;
  }

  .engine-select-wrapper,
  .model-select-wrapper {
    min-width: 100%;
  }
}

/* 自定义助手相关样式 */
.custom-assistant-dropdown {
  position: relative;
  display: inline-flex;
}

.custom-assistant-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border: none !important;
  background: none !important;
  color: var(--toolbar-icon-color);
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 4px;
  margin-right: 4px;
  height: 32px;
  min-width: 32px;
  box-sizing: border-box;
}

.custom-assistant-btn:hover {
  background: rgba(0, 0, 0, 0.04) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.custom-assistant-btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.assistant-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  margin-right: 4px;
  flex-shrink: 0;
  /* 防止图标被挤压 */
  display: inline-block;
  /* 确保始终显示 */
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.custom-assistant-item .assistant-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  /* 防止图标被挤压 */
  display: inline-block;
  /* 确保始终显示 */
  min-width: 16px;
  /* 确保有最小宽度 */
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.custom-assistant-menu {
  position: fixed;
  /* 改为fixed定位避免被输入框界限截断 */
  bottom: auto;
  /* 移除底部定位 */
  top: auto;
  /* 自动计算顶部位置 */
  left: auto;
  /* 自动计算左侧位置 */
  transform: translateY(-100%);
  /* 向上移动100%高度 */
  z-index: 9999;
  /* 保持高z-index避免被遮挡 */
  width: auto;
  /* 自适应按钮宽度 */
  min-width: 0;
  /* 移除最小宽度限制 */
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 6px 0;
  /* 减小内边距 */
  margin-bottom: 4px;
  /* 底部边距 */
  font-size: 14px;
  /* 与按钮字体大小一致 */
}

.custom-assistant-item {
  display: flex;
  align-items: center;
  padding: 4px 10px;
  /* 进一步减小内边距 */
  cursor: pointer;
  transition: background-color 0.2s;
  white-space: nowrap;
  /* 防止文本换行 */
  font-size: 14px;
  /* 确保与按钮字体大小一致 */
}

.custom-assistant-item:hover {
  background-color: rgba(0, 0, 0, 0.04);
}

.custom-assistant-item span {
  margin-left: 8px;
}

.custom-assistant-menu hr {
  margin: 8px 0;
  border: none;
  border-top: 1px solid #eee;
}

/* 编辑提示词对话框 */
.prompt-editor-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  box-sizing: border-box;
  /* 确保padding包含在宽度内 */
  padding: 10px;
  /* 添加一些内边距，避免贴边 */
}

.prompt-editor-container {
  width: 90%;
  max-width: 600px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  /* 确保padding包含在宽度内 */
}

.prompt-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
  box-sizing: border-box;
  /* 确保padding包含在宽度内 */
}

.prompt-editor-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
}

.close-editor {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #666;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  transition: background-color 0.2s;
}

.close-editor:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.prompt-editor-body {
  padding: 16px;
  flex: 1;
  overflow: hidden;
  /* 避免内容溢出 */
  box-sizing: border-box;
  /* 确保padding包含在宽度内 */
}

.prompt-editor-textarea {
  width: 100%;
  height: 250px;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  resize: none;
  font-family: inherit;
  line-height: 1.5;
  font-size: 14px;
  box-sizing: border-box;
  /* 确保padding包含在宽度内 */
}

.prompt-editor-textarea:focus {
  outline: none;
  border-color: var(--ds-primary);
  box-shadow: 0 0 0 2px rgba(30, 99, 224, 0.2);
}

.prompt-editor-footer {
  padding: 12px 16px;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  box-sizing: border-box;
  /* 确保padding包含在宽度内 */
}

.prompt-editor-cancel,
.prompt-editor-save {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.prompt-editor-cancel {
  background: none;
  border: 1px solid #ddd;
  color: var(--ds-text-secondary);
}

.prompt-editor-cancel:hover {
  background: rgba(0, 0, 0, 0.04);
}

.prompt-editor-save {
  background: var(--ds-primary);
  border: none;
  color: white;
}

.prompt-editor-save:hover {
  background: var(--ds-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.prompt-editor-save:active {
  transform: translateY(1px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

@media screen and (max-width: 768px) {
  .prompt-editor-container {
    width: 95%;
    max-width: 100%;
    margin: 10px;
  }

  .prompt-editor-textarea {
    height: 200px;
  }

  .prompt-editor-footer {
    flex-wrap: wrap;
  }
}

/* 绘图参数对话框样式 */
.drawing-params-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0,0,0,0.2);
    width: 400px;
    max-width: 90%;
    z-index: 10001; /* 确保高于其他元素 */
}

/* 绘图参数对话框遮罩 */
.drawing-params-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10000; /* 确保在对话框下方，但高于其他元素 */
}

.drawing-params-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eaeaea;
}

.drawing-params-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.drawing-params-dialog .close-dialog {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.drawing-params-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.params-row {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.params-row label {
    width: 100px;
    flex-shrink: 0;
    font-weight: 500;
}

.params-select, .params-input {
    flex-grow: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.drawing-params-footer {
    padding: 15px 20px;
    border-top: 1px solid #eaeaea;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.save-params-btn, .reset-params-btn {
    padding: 8px 16px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.save-params-btn {
    background-color: #4a90e2;
    color: white;
}

.reset-params-btn {
    background-color: #f0f0f0;
    color: #333;
}

/* 绘图参数按钮样式 */
.drawing-params-btn {
    display: none; /* 默认隐藏，只在绘图模式下显示 */
    position: relative;
    vertical-align: middle;
    margin: 0;
    padding: 0.375rem 0.75rem;
    line-height: 1;
}

.drawing-params-btn svg {
    margin-right: 5px;
    vertical-align: text-bottom;
    display: inline-block;
}

/* 自定义API引擎模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
    background-color: var(--aitoutou-bg-color);
    margin: 5% auto;
    padding: 20px;
    border: 1px solid var(--aitoutou-border-color);
    border-radius: 8px;
    width: 80%;
    max-width: 900px;
    max-height: 80vh;
    overflow: auto;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--aitoutou-border-color);
}

.modal-header h2 {
    margin: 0;
    color: var(--aitoutou-text-color);
    font-size: 1.8rem;
}

.modal-body {
    padding: 20px 0;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    border-top: 1px solid var(--aitoutou-border-color);
    padding-top: 15px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.close {
    color: var(--aitoutou-muted-color);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: var(--aitoutou-text-color);
    text-decoration: none;
    cursor: pointer;
}

/* 自定义API引擎相关样式 */
.custom-api-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001;
}

.custom-api-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 10px 20px;
    border-radius: 4px;
    color: white;
    font-weight: bold;
    z-index: 10002;
    animation: fadeInOut 3s ease-in-out;
}

.custom-api-message.success {
    background-color: #4CAF50;
}

.custom-api-message.error {
    background-color: #F44336;
}

@keyframes fadeInOut {
    0% { opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { opacity: 0; }
}

.custom-engines-list {
    margin-bottom: 20px;
}

.engine-item {
    background-color: var(--aitoutou-card-bg);
    border: 1px solid var(--aitoutou-border-color);
    border-radius: 4px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.engine-item.expanded {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.engine-header {
    display: flex;
    padding: 12px 15px;
    cursor: pointer;
    align-items: center;
}

.engine-header h3 {
    flex-grow: 1;
    margin: 0;
    font-size: 1.1rem;
}

.drag-handle {
    cursor: move;
    padding-right: 10px;
    color: var(--aitoutou-muted-color);
}

.engine-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.show-in-dropdown {
    display: flex;
    align-items: center;
    margin-right: 10px;
    font-size: 0.9rem;
}

.engine-content {
    padding: 15px;
    border-top: 1px solid var(--aitoutou-border-color);
}

.engine-item.dragging {
    opacity: 0.5;
}

.icon-upload-container {
    margin-bottom: 10px;
}

.icon-preview {
    width: 100px;
    height: 100px;
    border: 1px dashed var(--aitoutou-border-color);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
    background-color: var(--aitoutou-card-bg);
}

.no-icon {
    color: var(--aitoutou-muted-color);
    font-style: italic;
}

.password-input-wrapper {
    position: relative;
}

.models-management {
    margin-top: 15px;
}

.models-list {
    margin-bottom: 15px;
}

.model-item {
    background-color: var(--aitoutou-bg-color);
    border: 1px solid var(--aitoutou-border-color);
    border-radius: 4px;
    margin-bottom: 8px;
}

.model-header {
    display: flex;
    padding: 10px 15px;
    cursor: pointer;
    align-items: center;
}

.model-title {
    flex-grow: 1;
    margin: 0;
    font-size: 1rem;
}

.model-controls {
    display: flex;
    gap: 8px;
}

.model-content {
    padding: 15px;
    border-top: 1px solid var(--aitoutou-border-color);
}

.test-result {
    margin-top: 10px;
}

.test-result .success {
    color: #4CAF50;
}

.test-result .error {
    color: #F44336;
}

.test-result .testing {
    color: var(--aitoutou-muted-color);
}

.loading-dots:after {
    content: '';
    animation: dots 1.5s steps(5, end) infinite;
}

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

/* 调整边栏按钮 */
.custom-api-btn {
    margin-bottom: 10px;
}

/* 适配移动设备 */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .engine-header, .model-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .engine-controls, .model-controls {
        margin-top: 10px;
        width: 100%;
        justify-content: space-between;
    }
    
    .show-in-dropdown {
        margin-right: 0;
        margin-bottom: 10px;
        width: 100%;
    }
}