/* AI客服聊天窗口样式 */

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

/* 自定义AI客服悬浮按钮 - 修复文字溢出+居中问题 */
#dify-chatbot-bubble-button {
  background-color: #1C64F2 !important;
  width: 68px !important;
  height: 68px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 13px !important; /* 微调字体大小避免溢出 */
  color: white !important;
  font-weight: 500 !important;
  border: none !important;
  box-shadow: 0 4px 12px rgba(28, 100, 242, 0.3) !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  padding: 0 8px !important; /* 增加内边距，限制文字范围 */
  line-height: 1.2 !important; /* 调整行高，优化多行/单行显示 */
  text-align: center !important; /* 兜底文字居中 */
}

/* 移除原有图标 */
#dify-chatbot-bubble-button svg {
  display: none !important;
}

/* AI客服文字内容 - 优化居中与溢出 */
#dify-chatbot-bubble-button::after {
  content: "AI客服" !important;
  white-space: nowrap !important;
  text-align: center !important;
  position: absolute !important; /* 使用绝对定位 */
  top: 50% !important; /* 垂直居中 */
  left: 50% !important; /* 水平居中 */
  transform: translate(-50%, -50%) !important; /* 精确居中 */
  width: auto !important; /* 自动宽度 */
  font-size: 13px !important; /* 确保字体大小一致 */
  font-weight: 500 !important; /* 确保字体粗细一致 */
}

/* 悬浮效果 */
#dify-chatbot-bubble-button:hover {
  background-color: #1557d0 !important;
  transform: scale(1.05) !important;
}

/* 聊天窗口样式 */
#dify-chatbot-bubble-window {
  width: 40vw !important;
  height: 80vh !important;
  max-width: 640px !important;
  max-height: 800px !important;
  min-width: 320px !important;
  min-height: 400px !important;
  border-radius: 12px !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15) !important;
  overflow: hidden !important;
}

/* 自定义关闭按钮 */
.dify-chatbot-header-close {
  width: 36px !important;
  height: 36px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 50% !important;
  transition: background-color 0.2s ease !important;
}

/* 关闭按钮hover效果 */
.dify-chatbot-header-close:hover {
  background-color: rgba(0, 0, 0, 0.05) !important;
}

/* 关闭按钮图标替换为文字 */
.dify-chatbot-header-close svg {
  display: none !important;
}

.dify-chatbot-header-close::after {
  content: "关闭" !important;
  font-size: 12px !important;
  color: #666 !important;
  display: block !important;
  width: 100% !important;
  text-align: center !important;
}

/* 响应式适配 */
@media (max-width: 768px) {
  #dify-chatbot-bubble-window {
    width: 100vw !important;
    height: 80vh !important;
    border-radius: 0 !important;
  }
  /* 移动端按钮文字适配 */
  #dify-chatbot-bubble-button {
    font-size: 12px !important;
    width: 64px !important;
    height: 64px !important;
  }
}