/* ===== AI 智能客服面板 ===== */
.chat-panel {
  position: fixed;
  right: 96px;
  bottom: 24px;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: calc(100dvh - 32px);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(10, 42, 107, 0.22);
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9999;
  transform: translateY(16px) scale(0.98);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.22s ease, opacity 0.22s ease;
}
.chat-panel.show {
  transform: none;
  opacity: 1;
  pointer-events: auto;
}
.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(120deg, #0A2A6B, #1E5EFF);
  color: #fff;
  flex-shrink: 0;
}
.chat-head-info { display: flex; align-items: center; gap: 10px; }
.chat-bot-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.chat-head-info strong { display: block; font-size: 15px; line-height: 1.3; }
.chat-online-dot { display: block; font-size: 11px; opacity: 0.85; line-height: 1.4; }
.chat-close {
  background: none; border: 0; color: #fff; font-size: 16px;
  cursor: pointer; padding: 6px 8px; border-radius: 6px;
}
.chat-close:hover { background: rgba(255, 255, 255, 0.18); }
.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 6px;
  background: #f5f7fb;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-msg { display: flex; }
.chat-msg-user { justify-content: flex-end; }
.chat-msg-bot { justify-content: flex-start; }
.chat-bubble {
  max-width: 84%;
  padding: 9px 13px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.chat-msg-user .chat-bubble {
  background: #1E5EFF;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-msg-bot .chat-bubble {
  background: #fff;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  border-bottom-left-radius: 4px;
}
.chat-bubble-typing { color: #64748b; font-style: italic; }
.chat-quick {
  padding: 8px 12px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  border-top: 1px solid #eef2f7;
  background: #fff;
  flex-shrink: 0;
}
.chat-quick button {
  border: 1px solid #dbe4f5;
  background: #f4f7ff;
  color: #1E5EFF;
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s;
}
.chat-quick button:hover { background: #e7eeff; }
.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 10px 12px 12px;
  background: #fff;
  border-top: 1px solid #eef2f7;
  flex-shrink: 0;
}
.chat-input-row textarea {
  flex: 1;
  resize: none;
  border: 1px solid #dbe4f5;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 14px;
  line-height: 1.5;
  font-family: inherit;
  outline: none;
  min-height: 38px;
  max-height: 96px;
}
.chat-input-row textarea:focus { border-color: #1E5EFF; }
.chat-input-row .btn { flex-shrink: 0; padding: 0 18px; border-radius: 10px; }
@media (max-width: 480px) {
  .chat-panel {
    right: 8px;
    bottom: 8px;
    left: 8px;
    width: auto;
    height: min(78dvh, 560px);
  }
}
