/* AI智能接待助手 */
.ai-chat-widget {
  position: fixed;
  bottom:300px;
  right: 24px;
  z-index: 9990;
  font-family: inherit;
}
.ai-chat-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gradient-primary);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 20px rgba(30,111,255,0.4);
  transition: all 0.3s ease;
  position: relative;
}
.ai-chat-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(30,111,255,0.5);
}
.ai-chat-btn .pulse-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  background: #00ff88;
  border-radius: 50%;
  border: 2px solid var(--bg-dark);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.2); }
}
.ai-chat-panel {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 380px;
  max-width: calc(100vw - 40px);
  height: 520px;
  max-height: calc(100vh - 140px);
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(30,111,255,0.2);
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.3s ease;
}
.ai-chat-panel.active {
  display: flex !important;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.ai-chat-header {
  padding: 16px 20px;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ai-chat-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ai-chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.ai-chat-title {
  color: #fff;
  font-size: 16px;
  font-weight: 600;
}
.ai-chat-status {
  color: rgba(255,255,255,0.8);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.ai-chat-status::before {
  content: "";
  width: 8px;
  height: 8px;
  background: #00ff88;
  border-radius: 50%;
}
.ai-chat-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.ai-chat-close:hover { opacity: 1; }
.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ai-chat-messages::-webkit-scrollbar { width: 4px; }
.ai-chat-messages::-webkit-scrollbar-thumb { background: rgba(30,111,255,0.3); border-radius: 2px; }
.ai-msg {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
}
.ai-msg.bot {
  align-self: flex-start;
  background: rgba(30,111,255,0.15);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}
.ai-msg.user {
  align-self: flex-end;
  background: var(--gradient-primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.ai-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 12px;
}
.ai-quick-btn {
  padding: 6px 12px;
  background: rgba(30,111,255,0.1);
  border: 1px solid rgba(30,111,255,0.3);
  border-radius: 20px;
  color: var(--accent);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.ai-quick-btn:hover {
  background: rgba(30,111,255,0.2);
  border-color: var(--accent);
}
.ai-chat-input {
  padding: 12px 16px;
  border-top: 1px solid rgba(30,111,255,0.1);
  display: flex;
  gap: 8px;
}
.ai-chat-input input {
  flex: 1;
  padding: 10px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(30,111,255,0.2);
  border-radius: 24px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.ai-chat-input input:focus {
  border-color: var(--accent);
}
.ai-chat-input input::placeholder {
  color: rgba(255,255,255,0.4);
}
.ai-chat-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gradient-primary);
  border: none;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}
.ai-chat-send:hover { transform: scale(1.1); }
.ai-typing {
  display: inline-flex;
  gap: 4px;
  padding: 10px 14px;
}
.ai-typing span {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  animation: typing 1.4s infinite;
}
.ai-typing span:nth-child(2) { animation-delay: 0.2s; }
.ai-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-8px); opacity: 1; }
}
@media (max-width: 768px) {
  .ai-chat-widget { right: 16px; bottom: 150px; }
  .ai-chat-panel { width: calc(100vw - 32px); right: -8px; }
}