/* Aurora Chat 前端容器级样式（不改变样例内部DOM与样式） */
.aurora-chat-container, [data-aurora-chat] {
  display: block;
}

/* 短代码嵌入模式（仅短代码页面）：全宽、非悬浮、默认展开 */
.aurora-chat-embed #ai-chatbot-widget {
  position: static !important;
  width: 100% !important;
  max-width: 100% !important;
  right: auto !important; left: auto !important; top: auto !important; bottom: auto !important;
  float: none !important;
}
.aurora-chat-embed #ai-chatbot-container {
  display: flex !important;
  flex-direction: column;
  gap: 10px;
  background: #fff;
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  position: static !important;
  left: auto !important; right: auto !important; top: auto !important; bottom: auto !important;
  width: 100% !important; max-width: 100% !important;
  box-sizing: border-box !important;
  margin: 0 !important;
}
.aurora-chat-embed #ai-chatbot-toggle { display: none !important; }
.aurora-chat-embed #ai-chatbot-widget.pos-bottom-right,
.aurora-chat-embed #ai-chatbot-widget.pos-bottom-left,
.aurora-chat-embed #ai-chatbot-widget.pos-fixed-top { position: static !important; }

/* Header 样式与模型选择器（悬浮 / 侧栏 / 嵌入统一风格） */
#ai-chatbot-widget .ai-chatbot-header,
.aurora-chat-embed .ai-chatbot-header {
  background: #1e73be;
  color: #fff;
  border-radius: 6px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
#ai-chatbot-widget .ai-chatbot-header h3,
.aurora-chat-embed .ai-chatbot-header h3 { font-size: 16px; font-weight: 600; }
#ai-chatbot-widget .ai-chatbot-actions,
.aurora-chat-embed .ai-chatbot-actions { display: flex; align-items: center; gap: 8px; }
#ai-chatbot-widget .ai-chatbot-model-select,
.aurora-chat-embed .ai-chatbot-model-select {
  height: 32px; line-height: 32px; padding: 0 8px;
  border-radius: 4px; border: 1px solid #d0d7de; background: #fff; color: #222 !important;
  max-width: 170px;
}
#ai-chatbot-widget .ai-chatbot-clear,
.aurora-chat-embed .ai-chatbot-clear,
#ai-chatbot-widget .ai-chatbot-close,
.aurora-chat-embed .ai-chatbot-close {
  height: 32px; min-width: 32px; border: none; border-radius: 4px; background: #fff; color: #1e73be; cursor: pointer;
}

/* 消息区与输入区 */
#ai-chatbot-widget .ai-chatbot-messages,
.aurora-chat-embed .ai-chatbot-messages {
  background: #fff; border: 1px solid #e6e8eb; border-radius: 6px; padding: 10px;
  min-height: 160px; max-height: 50vh; overflow-y: auto;
}
#ai-chatbot-widget .ai-chatbot-input-area,
.aurora-chat-embed .ai-chatbot-input-area { display: flex; flex-direction: column; gap: 8px; }
#ai-chatbot-widget .ai-chatbot-input-area textarea,
.aurora-chat-embed .ai-chatbot-input-area textarea {
  width: 100%; border: 1px solid #d0d7de; border-radius: 6px; padding: 8px; resize: vertical; background: #fff; color: #222;
}
#ai-chatbot-widget .ai-chatbot-send,
.aurora-chat-embed .ai-chatbot-send {
  margin-top: 0; background: #1e73be; color: #fff; border: none; height: 36px; border-radius: 6px; cursor: pointer;
  align-self: flex-start; padding: 0 16px;
}

/* 欢迎区域下方的快捷问题按钮（仅样式，不改变结构） */
.aurora-chat-quick-questions {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.aurora-chat-quick-question {
  padding: 4px 8px;
  border-radius: 12px;
  border: 1px solid #d0d7de;
  background: #ffffff;
  color: #222;
  font-size: 12px;
  cursor: pointer;
  max-width: 100%;
}
.aurora-chat-quick-question:hover {
  background: #f0f4ff;
  border-color: #1e73be;
}

/* 气泡样式与对齐 */
#ai-chatbot-widget .ai-chatbot-message,
.aurora-chat-embed .ai-chatbot-message { display: inline-block; max-width: 90%; margin: 6px 0; padding: 8px 10px; border-radius: 10px; line-height: 1.5; }
#ai-chatbot-widget .ai-chatbot-assistant,
.aurora-chat-embed .ai-chatbot-assistant { background: #f0f6ff; color: #0b3d91; border: 1px solid #d6e6ff; align-self: flex-start; }
#ai-chatbot-widget .ai-chatbot-user,
.aurora-chat-embed .ai-chatbot-user { background: #e9f7ef; color: #0b5e3c; border: 1px solid #bfe8d1; align-self: flex-end; }
#ai-chatbot-widget #ai-chatbot-messages,
.aurora-chat-embed #ai-chatbot-messages { display: flex; flex-direction: column; }

/* 思考中打字指示器：气泡内三点跳动动画（通用于深色/浅色） */
#ai-chatbot-widget .ai-chatbot-typing {
  align-self: flex-start;
  margin: 6px 0;
}

#ai-chatbot-widget .ai-chatbot-typing-dots {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 14px;
  background: rgba(148,163,184,0.16);
}

#ai-chatbot-widget .ai-chatbot-typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(148,163,184,0.9);
  display: inline-block;
  animation: ac-typing-bounce 1.2s infinite ease-in-out;
}

#ai-chatbot-widget .ai-chatbot-typing-dots span:nth-child(2) { animation-delay: 0.15s; }
#ai-chatbot-widget .ai-chatbot-typing-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes ac-typing-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-4px); opacity: 1; }
}

/* 悬浮模式下：用户发送气泡使用白底深色文字，避免与顶部按钮同色，提升可读性（不影响侧栏/嵌入样式） */
#ai-chatbot-widget:not(.mode-sidebar) .ai-chatbot-user {
  background: #ffffff !important;
  color: #222222 !important;
  border: 1px solid #d0d7de !important;
}

/* 若样例未定义输出区滚动，可提供最小滚动能力（选择器尽量宽松但不覆盖样例定义） */
#aurora-chat-output, .aurora-chat-output, .aurora-chat pre.output {
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 480px;
  overflow: auto;
}

/* 更醒目的悬浮开关按钮（非侧栏模式显示） */
#ai-chatbot-widget .ai-chatbot-toggle {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  /* 仅提供基础底色，具体图标由前端 JS 通过 background-image 注入 */
  background-color: #1e73be;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  outline: none;
  z-index: 9999;
}
#ai-chatbot-widget .ai-chatbot-toggle span { font-size: 22px; line-height: 1; }
#ai-chatbot-widget .ai-chatbot-toggle:hover { transform: translateY(-1px) scale(1.03); }
#ai-chatbot-widget .ai-chatbot-toggle:active { transform: translateY(0); }

/* 展开时隐藏悬浮按钮，避免图标压在对话框上方 */
#ai-chatbot-widget.open .ai-chatbot-toggle {
  display: none !important;
}

/* 侧栏模式依旧隐藏开关按钮 */
#ai-chatbot-widget.mode-sidebar #ai-chatbot-toggle { display: none !important; }

/* 位置修饰类：为避免被样例内联样式覆盖，使用更高优先级与 !important */
#ai-chatbot-widget {
  z-index: 99999 !important; /* 提高层级，避免被主题悬浮按钮遮挡 */
}
/* 悬浮模式下对话框固定宽度，避免过窄导致头部元素拥挤 */
/* 悬浮根容器仅用于定位；展开(open)时再由内部容器控制宽度，避免关闭时按钮看起来离右下角很远 */
#ai-chatbot-widget.pos-bottom-left,
#ai-chatbot-widget.pos-bottom-right,
#ai-chatbot-widget.pos-fixed-top {
  max-width: 90vw !important;
}
#ai-chatbot-widget.pos-bottom-left { position: fixed !important; left: 20px !important; right: auto !important; bottom: 20px !important; top: auto !important; }
#ai-chatbot-widget.pos-bottom-right { position: fixed !important; right: 20px !important; left: auto !important; bottom: 20px !important; top: auto !important; }
#ai-chatbot-widget.pos-fixed-top { position: fixed !important; right: 20px !important; left: auto !important; top: 20px !important; bottom: auto !important; }

/* 悬浮模式下，面板容器默认隐藏，由JS控制显示；避免被主题样式撑开 */
#ai-chatbot-widget.pos-bottom-left #ai-chatbot-container,
#ai-chatbot-widget.pos-bottom-right #ai-chatbot-container,
#ai-chatbot-widget.pos-fixed-top #ai-chatbot-container {
  display: none !important;
}

/* 悬浮 open：恢复为纵向 Flex 布局，保证输入区/发送按钮可以贴底 */
#ai-chatbot-widget.open #ai-chatbot-container {
  display: flex !important;
  flex-direction: column;
  width: 380px !important;
  max-width: 90vw !important;
}
#ai-chatbot-widget.open #ai-chatbot-messages {
  flex: 1 1 auto;
  overflow-y: auto;
}
#ai-chatbot-widget.open .ai-chatbot-input-area {
  margin-top: auto !important; /* 将输入区（含发送按钮）推到底部 */
}
#ai-chatbot-widget.mode-sidebar #ai-chatbot-container,
.aurora-chat-embed #ai-chatbot-container,
#ai-chatbot-widget.open #ai-chatbot-container {
  display: flex !important;
  flex-direction: column;
  gap: 12px;
  background: #fff;
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

/* 短代码嵌入模式：即使添加 open 类，也保持容器在主体内 100% 宽度，避免被悬浮样式收窄 */
.aurora-chat-embed #ai-chatbot-widget.open #ai-chatbot-container {
  width: 100% !important;
  max-width: 100% !important;
}

/* 对话主体区域与原样例一致的白底卡片效果 */
#ai-chatbot-widget .ai-chatbot-body,
.aurora-chat-embed .ai-chatbot-body {
  background: #fff;
  border-radius: 0 0 8px 8px;
}

/* 短代码嵌入模式：使用普通块级流，embed_min_height 仅作用于消息区本身 */
.aurora-chat-embed .ai-chatbot-body {
  display: block;          /* 不再用 flex 拉伸主体 */
}

.aurora-chat-embed #ai-chatbot-messages {
  display: block;          /* 由 JS 设置 min-height，高度变大时不会推开输入区 */
  overflow-y: auto;
  margin-top: 8px;         /* 与快捷问题之间保持适中间距 */
}

.aurora-chat-embed .ai-chatbot-input-area {
  margin-top: 8px;         /* 与消息区之间恒定小间距，与配置高度无关 */
}

/* 嵌入模式输入区：普通矩形输入框 + 右侧小蓝色按钮（方案 A） */
.aurora-chat-embed .ac-chat__input-wrap {
  border: none;          /* 去掉最外层边框 */
  background: #fff;
  border-radius: 0;      /* 去掉最外层圆角 */
  padding: 0;
}

.aurora-chat-embed .ac-chat__input {
  border: none;
  background: transparent;
  resize: none;
  color: #111827 !important;        /* 文本使用默认接近黑色，提升优先级 */
}

/* 嵌入模式下，统一输入框与占位符为深色文字，避免看起来禁用 */
.aurora-chat-embed #ai-chatbot-input,
.aurora-chat-embed .ai-chatbot-input,
.aurora-chat-embed .ac-chat__input {
  color: #111827 !important;
}

.aurora-chat-embed #ai-chatbot-input::placeholder,
.aurora-chat-embed .ai-chatbot-input::placeholder,
.aurora-chat-embed .ac-chat__input::placeholder {
  color: #6b7280 !important; /* 略浅一点的灰，但不是“禁用”那种淡灰 */
}

.aurora-chat-embed .ai-chatbot-send,
.aurora-chat-embed .ac-chat__send {
  box-shadow: none !important;  /* 无阴影，保持扁平 */
  width: 32px;
  height: 28px;
  border-radius: 4px;
  margin-right: 0;
}

#ai-chatbot-widget.pos-bottom-right {
  position: fixed !important;
  right: 20px !important;
  left: auto !important;
  bottom: 20px !important;
  top: auto !important;
}

#ai-chatbot-widget.pos-bottom-left {
  position: fixed !important;
  left: 20px !important;
  right: auto !important;
  bottom: 20px !important;
  top: auto !important;
}

/* 左下模式：面板从按钮左侧会溢出，改为向右展开 */
#ai-chatbot-widget.pos-bottom-left .ai-chatbot-container {
  left: 0 !important;
  right: auto !important;
  bottom: 70px !important; /* 与样例保持同等间距 */
}

#ai-chatbot-widget.pos-fixed-top {
  position: fixed !important;
  top: 20px !important;
  bottom: auto !important;
  right: 20px !important;
  left: auto !important;
}

/* 可选：侧边栏定位（因主题布局差异较大，仅提供最小化支持） */
#ai-chatbot-widget.pos-sidebar {
  position: fixed !important;
  right: 20px !important;
  bottom: 20px !important;
}

/* 侧栏嵌入模式：不使用悬浮定位，作为侧栏块级挂件 */
#ai-chatbot-widget.mode-sidebar {
  position: static !important;
  right: auto !important;
  left: auto !important;
  top: auto !important;
  bottom: auto !important;
  width: 100% !important;
  z-index: auto !important;
}
#ai-chatbot-widget.mode-sidebar #ai-chatbot-container {
  display: flex !important; /* 默认展开 */
  position: static !important;
  width: 100% !important;
  max-width: 100% !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  box-shadow: none !important;
  border: 0 !important;
}
#ai-chatbot-widget.mode-sidebar #ai-chatbot-toggle {
  display: none !important; /* 隐藏悬浮按钮 */
}

/* 内部块也跟随自适应宽度（必要时覆盖模板固定宽度） */
#ai-chatbot-widget.mode-sidebar .ai-chatbot-header,
#ai-chatbot-widget.mode-sidebar .ai-chatbot-body,
#ai-chatbot-widget.mode-sidebar .ai-chatbot-footer,
#ai-chatbot-widget.mode-sidebar .ai-chatbot-messages,
#ai-chatbot-widget.mode-sidebar .ai-chatbot-input,
#ai-chatbot-widget.mode-sidebar .ai-chatbot-actions,
#ai-chatbot-widget.mode-sidebar .ai-chatbot-panel {
  width: 100% !important;
  max-width: 100% !important;
  box-shadow: none !important;
  border: 0 !important;
}

/* 聊天信息区背景调为白色，其它保持不变 */
#ai-chatbot-widget .ai-chatbot-messages {
  background: #fff !important;
}

/* 模型选择下拉可读性（修复鼠标经过才可见的问题） */
#ai-chatbot-widget .ai-chatbot-model-select {
  color: #222 !important;
  background-color: #fff !important;
}
#ai-chatbot-widget .ai-chatbot-model-select option {
  color: #222 !important;
  background: #fff !important;
}
#ai-chatbot-widget .ai-chatbot-model-select:focus {
  outline: none !important;
}

/* 小屏幕下限制面板宽度，避免超出视口 */
@media (max-width: 480px) {
  #ai-chatbot-widget .ai-chatbot-container {
    width: calc(100vw - 40px) !important;
    left: 0 !important;
    right: 0 !important;
    margin: 0 20px !important;
  }
}

/* =============================
 * 主题风格：浅色抽屉模式（随位置贴左/贴右）
 * 通过在根容器上添加 .theme-drawer 类启用
 * ============================= */

/* 抽屉整体撑满可视高度，左右贴边由位置类决定（pos-bottom-left/pos-bottom-right） */
#ai-chatbot-widget.theme-drawer {
  position: fixed !important;
  top: 0 !important;
  bottom: 0 !important;
  width: 360px !important;
  max-width: 100vw !important;
  z-index: 99999 !important;
}

/* 右侧抽屉：默认（右下角悬浮） */
#ai-chatbot-widget.theme-drawer.pos-bottom-right {
  right: 0 !important;
  left: auto !important;
}

/* 左侧抽屉：当对话位置选择左下角悬浮时，抽屉与开关一并移动到左侧 */
#ai-chatbot-widget.theme-drawer.pos-bottom-left {
  left: 0 !important;
  right: auto !important;
}

#ai-chatbot-widget.theme-drawer #ai-chatbot-container {
  height: 100% !important;
  max-height: 100vh !important;
  border-radius: 12px 0 0 12px;
  /* 阴影稍微减弱，避免覆盖面积过大 */
  box-shadow: -10px 0 26px rgba(15, 23, 42, 0.16);
  border: 1px solid rgba(148, 163, 184, 0.35);
  padding: 14px 14px 12px 14px;
  background: linear-gradient(145deg, #f9fafb, #ffffff);
}

/* 标题区域更接近抽屉示例：浅色背景 + 深色文字 */
#ai-chatbot-widget.theme-drawer .ai-chatbot-header {
    background: radial-gradient(circle at 0 0, rgb(59 130 246 / 53%), transparent 95%) !important;
    color: #0f172a !important;
    padding: 8px 10px 8px 12px;
}

#ai-chatbot-widget.theme-drawer .ai-chatbot-header h3 {
  font-size: 16px;
  font-weight: 600;
}

#ai-chatbot-widget.theme-drawer .ai-chatbot-actions .ai-chatbot-model-select {
  font-size: 13px;
}

/* 浅色抽屉主题头部头像圆标（不改 DOM，仅通过伪元素绘制） */
#ai-chatbot-widget.theme-drawer .ac-chat__header .ac-chat__meta {
  position: relative;
  padding-left: 36px;
}

#ai-chatbot-widget.theme-drawer .ac-chat__header .ac-chat__meta::before {
  content: "AI";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 999px;
  /* 科技感渐变圆标 + 细描边 */
  background: radial-gradient(circle at 30% 0, #ffffff, #dbeafe 35%, #bfdbfe 60%, #93c5fd 100%);
  border: 1px solid rgba(59,130,246,0.9);
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 深色卡片头部也使用相同布局的 AI 圆形徽标，配色调整为深色背景下的高对比方案 */
#ai-chatbot-widget.theme-dark .ac-chat__header .ac-chat__meta {
  position: relative;
  padding-left: 36px;
}

#ai-chatbot-widget.theme-dark .ac-chat__header .ac-chat__meta::before {
  content: "AI";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 0, #1e293b, #0f172a 55%, #020617 100%);
  border: 1px solid rgba(129,140,248,0.9);
  color: #e5e7eb;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 欢迎区与消息区风格调整 */
#ai-chatbot-widget.theme-drawer .ai-chatbot-body {
  background: transparent !important;
}

#ai-chatbot-widget.theme-drawer .ai-chatbot-welcome p {
  font-size: 14px;
  line-height: 1.7;
  color: #6b7280;
}

#ai-chatbot-widget.theme-drawer .aurora-chat-quick-questions {
  margin-top: 6px;
}

#ai-chatbot-widget.theme-drawer .aurora-chat-quick-question {
  background: #f9fafb;
  border-radius: 999px;
  border-color: #e5e7eb;
  font-size: 14px;
  padding: 4px 10px;
}

#ai-chatbot-widget.theme-drawer .aurora-chat-quick-question:hover {
  background: #eef2ff;
  border-color: rgba(129, 140, 248, 0.9);
}

/* 消息列表更高、内边距略小，模拟抽屉纵向滚动区 */
#ai-chatbot-widget.theme-drawer #ai-chatbot-messages {
  min-height: 180px;
  max-height: calc(100vh - 260px);
}

#ai-chatbot-widget.theme-drawer .ai-chatbot-message {
  font-size: 14px;
  line-height: 1.7;
}

/* 抽屉模式下，悬浮按钮改为细长竖条，贴在对应侧边缘中部 */
#ai-chatbot-widget.theme-drawer .ai-chatbot-toggle {
  position: fixed !important;
  top: 50% !important;
  transform: translateY(-50%);
  width: 40px !important;
  height: 120px !important;
  background: linear-gradient(135deg, #4f46e5, #6366f1);
}

/* 右侧抽屉时，按钮贴右侧，向左圆角 */
#ai-chatbot-widget.theme-drawer.pos-bottom-right .ai-chatbot-toggle {
  right: 0 !important;
  left: auto !important;
  border-radius: 999px 0 0 999px;
}

/* 左侧抽屉时，按钮贴左侧，向右圆角 */
#ai-chatbot-widget.theme-drawer.pos-bottom-left .ai-chatbot-toggle {
  left: 0 !important;
  right: auto !important;
  border-radius: 0 999px 999px 0;
}

#ai-chatbot-widget.theme-drawer .ai-chatbot-toggle span {
  font-size: 18px;
}

/* 抽屉 open 时，按钮仍然隐藏，靠容器本身关闭 */
#ai-chatbot-widget.theme-drawer.open .ai-chatbot-toggle {
  display: none !important;
}

/* 抽屉样式在小屏幕下占满宽度，自上而下展开 */
@media (max-width: 768px) {
  #ai-chatbot-widget.theme-drawer {
    width: 100vw !important;
  }
  #ai-chatbot-widget.theme-drawer #ai-chatbot-container {
    border-radius: 0;
  }
  #ai-chatbot-widget.theme-drawer .ai-chatbot-toggle {
    top: auto !important;
    bottom: 24px !important;
    transform: none;
    height: 56px !important;
  }
}

/* =============================
 * 主题风格：深色悬浮卡片模式
 * 通过在根容器上添加 .theme-dark 启用
 * 布局仍使用默认悬浮定位，仅调整配色与阴影
 * ============================= */

#ai-chatbot-widget.theme-dark {
  /* 背景上加一点渐变光晕，接近 Demo 氛围；阴影略减弱以避免覆盖过大 */
  filter: drop-shadow(0 10px 26px rgba(15,23,42,0.5));
}

#ai-chatbot-widget.theme-dark #ai-chatbot-container {
  background: radial-gradient(circle at top left, rgba(37,99,235,0.12), transparent 55%),
              radial-gradient(circle at bottom right, rgba(129,140,248,0.14), transparent 55%),
              #020617;
  border-radius: 18px;
  border: 1px solid rgba(148,163,184,0.4);
}

#ai-chatbot-widget.theme-dark .ai-chatbot-header {
  background: transparent !important;
  border-bottom: 1px solid rgba(51,65,85,0.9);
  padding: 10px 12px 8px;
}

/* 头部：标题与模型选择水平对齐、垂直居中 */
#ai-chatbot-widget .ac-chat__header {
  display: flex;
  align-items: center;
}

#ai-chatbot-widget .ac-chat__header .ac-chat__meta {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
}

#ai-chatbot-widget .ac-chat__header .ac-chat__title {
  margin: 0;
}

#ai-chatbot-widget.theme-dark .ai-chatbot-header h3 {
  color: #e5e7eb;
}

#ai-chatbot-widget.theme-dark .ai-chatbot-actions .ai-chatbot-model-select {
  background: rgba(15,23,42,0.9) !important;
  color: #e5e7eb !important;
  border-color: rgba(148,163,184,0.6);
}

#ai-chatbot-widget.theme-dark .ai-chatbot-actions .ai-chatbot-clear,
#ai-chatbot-widget.theme-dark .ai-chatbot-actions .ai-chatbot-close {
  background: rgba(15,23,42,0.9);
  color: #9ca3af;
  border: 1px solid rgba(148,163,184,0.5);
}

#ai-chatbot-widget.theme-dark .ai-chatbot-body {
  /* 由外层容器控制整体深色背景，这里保持透明，避免额外卡片叠加 */
  background: transparent !important;
}

#ai-chatbot-widget.theme-dark .ai-chatbot-welcome p {
  color: #9ca3af;
}

/* 欢迎语卡片：通用圆角与虚线边框，深浅主题仅颜色不同，内容垂直居中 */
#ai-chatbot-widget .ai-chatbot-welcome,
.aurora-chat-embed .ai-chatbot-welcome {
  border-radius: 12px;
  border-style: dashed;
  border-width: 1px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  min-height: 52px;
}

#ai-chatbot-widget .ai-chatbot-welcome p,
.aurora-chat-embed .ai-chatbot-welcome p {
  margin: 0;
}

/* 深色主题欢迎卡片配色 */
#ai-chatbot-widget.theme-dark .ai-chatbot-welcome {
  background: rgba(15,23,42,0.9);
  border-color: rgba(148,163,184,0.45);
}

#ai-chatbot-widget.theme-dark #ai-chatbot-messages {
  background: rgba(15,23,42,0.95) !important;
  border-color: rgba(51,65,85,0.9);
  margin-top: 4px;
  padding-right: 4px;
  /* 细滚动条 */
  scrollbar-width: thin;
  scrollbar-color: rgba(148,163,184,0.7) transparent;
}

#ai-chatbot-widget.theme-dark #ai-chatbot-messages::-webkit-scrollbar {
  width: 6px;
}

#ai-chatbot-widget.theme-dark #ai-chatbot-messages::-webkit-scrollbar-thumb {
  background: rgba(148,163,184,0.7);
  border-radius: 999px;
}

#ai-chatbot-widget.theme-dark .ai-chatbot-assistant {
  background: rgba(15,23,42,0.95);
  border-color: rgba(37,99,235,0.4);
  color: #e5e7eb; /* AI 回复文字保持白色 */
}

#ai-chatbot-widget.theme-dark .ai-chatbot-user {
  background: rgba(37,99,235,0.18) !important;
  border-color: rgba(59,130,246,0.65) !important;
  color: #e5e7eb !important;
}

/* 短代码嵌入模式下，AI 回复文字统一使用深色，避免被深色主题 JS 注入的浅灰色 !important 覆盖 */
.aurora-chat-embed #ai-chatbot-widget .ai-chatbot-assistant,
.aurora-chat-embed #ai-chatbot-widget .ai-chatbot-message.ai-chatbot-assistant {
  color: #000000 !important;
}

#ai-chatbot-widget.theme-dark .aurora-chat-quick-question {
  background: rgba(15,23,42,0.9);
  color: #e5e7eb;
  border-color: rgba(75,85,99,0.9);
}

#ai-chatbot-widget.theme-dark .aurora-chat-quick-question:hover {
  background: rgba(37,99,235,0.22);
  border-color: rgba(59,130,246,0.8);
}

#ai-chatbot-widget.theme-dark .ai-chatbot-input-area textarea {
  background: rgba(15,23,42,0.95);
  color: #e5e7eb;
  border-color: rgba(55,65,81,0.9);
}

/* 输入区布局：通用胶囊输入框，深浅主题仅颜色不同 */
#ai-chatbot-widget .ai-chatbot-input-area {
  border-top: none;
  padding-top: 8px;
}

#ai-chatbot-widget .ac-chat__input-wrap {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 999px;
}

#ai-chatbot-widget .ac-chat__input {
  flex: 1 1 auto;
  border: none;
  background: transparent;
  resize: none;
  font-size: 13px;
  line-height: 1.5;
  max-height: 72px;
}

#ai-chatbot-widget .ac-chat__input::placeholder {
  color: #6b7280;
}

#ai-chatbot-widget .ac-chat__input:focus {
  outline: none;
}

#ai-chatbot-widget .ai-chatbot-send,
#ai-chatbot-widget .ac-chat__send {
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  box-shadow: 0 10px 30px rgba(37,99,235,0.55);
  border-radius: 999px;
  border: none;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

/* 底部品牌与提示文案：同一行左右分布，统一字号与灰色 */
#ai-chatbot-widget .ac-chat__footer-meta,
.aurora-chat-embed .ac-chat__footer-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}

#ai-chatbot-widget .ac-chat__brand,
.aurora-chat-embed .ac-chat__brand,
#ai-chatbot-widget .ac-chat__tips,
.aurora-chat-embed .ac-chat__tips {
  font-size: 11px;
  color: #6b7280;
}

#ai-chatbot-widget .ac-chat__brand a,
.aurora-chat-embed .ac-chat__brand a {
  color: inherit;
  text-decoration: none;
}

#ai-chatbot-widget .ac-chat__brand a:hover,
.aurora-chat-embed .ac-chat__brand a:hover {
  text-decoration: underline;
}

/* 深色主题下：品牌与提示使用浅灰色，保持可读性 */
#ai-chatbot-widget.theme-dark .ac-chat__brand,
#ai-chatbot-widget.theme-dark .ac-chat__tips {
  color: #e5e7eb;
}

#ai-chatbot-widget.theme-dark .ai-chatbot-toggle {
  background: radial-gradient(circle at 30% 0%, #4f46e5, #1d4ed8);
}

/* 短代码嵌入模式：覆盖通用深色主题输入文字颜色，统一使用黑色文字 */
.aurora-chat-embed #ai-chatbot-widget #ai-chatbot-input {
  color: #111827 !important;
}
