/* AI 客服浮层 - 贴近站点风格 #fb6c00，支持移动端 */
#ai-chatbot-tab {
  position: fixed;
  right: 20px;
  bottom: 72px;
  z-index: 9998;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #fb6c00;
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(251, 108, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  transition: transform 0.2s, box-shadow 0.2s;
}
#ai-chatbot-tab:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(251, 108, 0, 0.5);
}
#ai-chatbot-tab:focus {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
/* 低频闪动：约 2.5 秒一次，仅作暗示 */
@keyframes ai-chatbot-blink {
  0%, 92%, 100% { opacity: 1; }
  96% { opacity: 0.75; }
}
#ai-chatbot-tab {
  animation: ai-chatbot-blink 2.5s ease-in-out infinite;
}

#ai-chatbot-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.35);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}
#ai-chatbot-overlay.is-open {
  display: flex;
}
@media (max-width: 576px) {
  #ai-chatbot-overlay {
    align-items: flex-end;
    padding: 0;
  }
}

#ai-chatbot-panel {
  width: 100%;
  max-width: 420px;
  max-height: 85vh;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
@media (max-width: 576px) {
  #ai-chatbot-panel {
    max-height: 90vh;
    border-radius: 12px 12px 0 0;
  }
}

#ai-chatbot-header {
  padding: 14px 16px;
  background: #fb6c00;
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
#ai-chatbot-close {
  background: transparent;
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}
#ai-chatbot-close:hover {
  background: rgba(255,255,255,0.2);
}

#ai-chatbot-messages {
  flex: 1;
  min-height: 240px;
  max-height: 360px;
  overflow-y: auto;
  padding: 12px;
  background: #f8f9fa;
}
@media (max-width: 576px) {
  #ai-chatbot-messages {
    min-height: 200px;
    max-height: 50vh;
  }
}

.ai-chatbot-msg {
  margin-bottom: 10px;
  max-width: 88%;
}
.ai-chatbot-msg.user {
  margin-left: auto;
  background: #fb6c00;
  color: #fff;
  border-radius: 12px 12px 4px 12px;
  padding: 8px 12px;
}
.ai-chatbot-msg.assistant {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 12px 12px 12px 4px;
  padding: 8px 12px;
}
.ai-chatbot-msg.msg-loading {
  font-style: italic;
  opacity: 0.9;
}
.ai-chatbot-msg .role {
  font-size: 0.7rem;
  color: #6c757d;
  margin-bottom: 2px;
}
.ai-chatbot-msg.user .role {
  color: rgba(255,255,255,0.85);
}
.ai-chatbot-error {
  color: #dc3545;
  font-size: 0.875rem;
  padding: 4px 0;
}

#ai-chatbot-input-row {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #dee2e6;
  background: #fff;
}
#ai-chatbot-input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  font-size: 1rem;
}
#ai-chatbot-input:focus {
  border-color: #fb6c00;
  outline: none;
}
#ai-chatbot-send {
  padding: 10px 16px;
  background: #fb6c00;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
}
#ai-chatbot-send:hover:not(:disabled) {
  background: #FF8930;
}
#ai-chatbot-send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

#ai-chatbot-disclaimer {
  padding: 8px 12px;
  font-size: 0.75rem;
  color: #6c757d;
  background: #f8f9fa;
  border-top: 1px solid #eee;
}
