/* 智能客服悬浮按钮 */
.customer-service-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
  transition: all 0.3s ease;
  z-index: 9999;
}
.customer-service-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 25px rgba(102, 126, 234, 0.6);
}
.customer-service-btn .icon {
  font-size: 28px;
  color: #fff;
}
.customer-service-btn .badge {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 20px;
  height: 20px;
  background: #f56c6c;
  border-radius: 50%;
  color: #fff;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chat-window {
  position: fixed;
  bottom: 100px;
  right: 30px;
  width: 380px;
  height: 520px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9998;
  animation: slideUp 0.3s ease-out;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.chat-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.chat-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.chat-header-title .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.chat-header-info h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}
.chat-header-info p {
  margin: 2px 0 0;
  font-size: 12px;
  opacity: 0.8;
}
.chat-close {
  cursor: pointer;
  font-size: 20px;
  padding: 5px;
  transition: transform 0.3s;
}
.chat-close:hover {
  transform: rotate(90deg);
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #f8f9fb;
}
.chat-messages::-webkit-scrollbar {
  width: 6px;
}
.chat-messages::-webkit-scrollbar-thumb {
  background: #ddd;
  border-radius: 3px;
}
.chat-message {
  display: flex;
  margin-bottom: 16px;
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.chat-message.user {
  flex-direction: row-reverse;
}
.chat-message .msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
}
.chat-message.bot .msg-avatar {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
}
.chat-message.user .msg-avatar {
  background: #e8e8e8;
  color: #666;
}
.chat-message .msg-content {
  max-width: 75%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.6;
}
.chat-message.bot .msg-content {
  background: #fff;
  margin-left: 10px;
  border-top-left-radius: 4px;
  color: #333;
}
.chat-message.user .msg-content {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  margin-right: 10px;
  border-top-right-radius: 4px;
  color: #fff;
}
.chat-quick-replies {
  padding: 10px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-top: 1px solid #eee;
  background: #fff;
}
.quick-reply-btn {
  padding: 6px 14px;
  border: 1px solid #667eea;
  border-radius: 20px;
  background: #fff;
  color: #667eea;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s;
}
.quick-reply-btn:hover {
  background: #667eea;
  color: #fff;
}
.chat-input {
  display: flex;
  padding: 12px 16px;
  background: #fff;
  border-top: 1px solid #eee;
  gap: 10px;
}
.chat-input input {
  flex: 1;
  height: 40px;
  border: 2px solid #e8e8e8;
  border-radius: 20px;
  padding: 0 16px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.3s;
}
.chat-input input:focus {
  border-color: #667eea;
}
.chat-input button {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}
.chat-input button:hover {
  transform: scale(1.05);
}
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 8px 0;
}
.typing-indicator span {
  width: 8px;
  height: 8px;
  background: #999;
  border-radius: 50%;
  animation: typing 1.4s infinite;
}
.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}
.typing-indicator 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; }
}
