/* 全能鹰房车 - 客服悬浮组件样式 */

/* 悬浮按钮组（默认收起状态，展开后显示三个按钮） */
.cs-float-group {
  position: fixed;
  right: calc(50% - 210px + 16px);
  bottom: 100px;
  z-index: 9998;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.cs-float-item {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  transition: all 0.25s ease;
  opacity: 0;
  transform: translateY(10px) scale(0.8);
  pointer-events: none;
}

.cs-float-item svg {
  width: 18px;
  height: 18px;
}

.cs-float-group.open .cs-float-item {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* 展开时的动画延迟 */
.cs-float-group.open .cs-float-item:nth-child(1) { transition-delay: 0.05s; }
.cs-float-group.open .cs-float-item:nth-child(2) { transition-delay: 0.1s; }
.cs-float-group.open .cs-float-item:nth-child(3) { transition-delay: 0.15s; }

.cs-float-item:hover {
  transform: scale(1.1);
}

.cs-float-phone {
  background: #22c55e;
  color: #fff;
}

.cs-float-wechat {
  background: #07c160;
  color: #fff;
}

.cs-float-ai {
  background: #1d4ed8;
  color: #fff;
}

/* 收起状态的主按钮 */
.cs-float-main {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #8b5a3c;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  z-index: 1;
  transition: transform 0.25s ease, background 0.25s ease;
}

.cs-float-main:hover {
  transform: scale(1.08);
}

.cs-float-group.open .cs-float-main {
  transform: rotate(90deg);
  background: #6b4428;
}

.cs-float-main svg {
  width: 20px;
  height: 20px;
}

.cs-float-item svg {
  width: 22px;
  height: 22px;
}

/* 聊天窗口（居中浮动窗口，科技感UI） */
.cs-chat-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 380px;
  max-width: 90vw;
  height: 560px;
  max-height: 85vh;
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 16px;
  box-shadow: 0 0 40px rgba(59, 130, 246, 0.2), 0 20px 60px rgba(0,0,0,0.5);
  z-index: 9999;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.cs-chat-panel.open {
  display: flex;
}

/* 头部 */
.cs-chat-header {
  background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
  color: #fff;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(59, 130, 246, 0.3);
}

.cs-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cs-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #60a5fa);
  border: 2px solid rgba(255,255,255,0.3);
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.cs-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.cs-status {
  font-size: 12px;
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 5px;
}

.cs-status .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
}

.cs-status .dot.online {
  background: #4ade80;
  box-shadow: 0 0 8px #4ade80;
  animation: pulse 2s infinite;
}

.cs-status .dot.offline {
  background: #9ca3af;
  box-shadow: 0 0 4px #9ca3af;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.cs-header-actions {
  display: flex;
  gap: 8px;
}

.cs-btn-min,
.cs-btn-close {
  width: 30px;
  height: 30px;
  border: none;
  background: rgba(255,255,255,0.1);
  color: #fff;
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.cs-btn-min:hover,
.cs-btn-close:hover {
  background: rgba(255,255,255,0.2);
  transform: scale(1.05);
}

/* 消息区域 */
.cs-chat-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  background: rgba(15, 23, 42, 0.5);
  display: flex;
  flex-direction: column;
  /* 隐藏滚动条 */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.cs-chat-messages::-webkit-scrollbar {
  display: none;
}

.cs-msg {
  display: block;
  max-width: 100%;
  margin-bottom: 12px;
}
.cs-msg .cs-msg-bubble {
  display: inline-block;
  max-width: 85%;
  word-break: break-word;
}
.cs-msg .cs-bad-row {
  margin-top:4px;
  font-size:11px;
}

.cs-msg-user {
  text-align: right;
}
.cs-msg-user .cs-msg-bubble {
  text-align: left;
}

.cs-msg-ai {
  text-align: left;
}

.cs-msg-system {
  align-self: center;
  max-width: 90%;
  margin-bottom: 12px;
}

.cs-msg-bubble {
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.6;
  word-break: break-word;
}

.cs-msg-user .cs-msg-bubble {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 10px rgba(59, 130, 246, 0.3);
}

.cs-msg-ai .cs-msg-bubble {
  background: rgba(255,255,255,0.1);
  color: #e2e8f0;
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-bottom-left-radius: 4px;
  backdrop-filter: blur(10px);
}

.cs-bubble-system {
  background: rgba(255,255,255,0.08);
  color: #e2e8f0;
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 14px;
  backdrop-filter: blur(10px);
}

.cs-welcome {
  margin-bottom: 12px;
}

/* 快捷问题 */
.cs-quick-questions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cs-quick-item {
  padding: 7px 14px;
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  border: 1px solid rgba(59, 130, 246, 0.3);
  transition: all 0.2s;
}

.cs-quick-item:hover {
  background: rgba(59, 130, 246, 0.3);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.cs-quick-item:hover {
  background: #e0e7ff;
}

/* 输入区 */
.cs-chat-input {
  padding: 14px 16px;
  border-top: 1px solid rgba(59, 130, 246, 0.2);
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  background: rgba(30, 41, 59, 0.8);
}

.cs-chat-input input {
  flex: 1;
  height: 42px;
  padding: 0 16px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 21px;
  font-size: 14px;
  outline: none;
  color: #e2e8f0;
  transition: all 0.2s;
}

.cs-chat-input input::placeholder {
  color: #64748b;
}

.cs-chat-input input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
}

.cs-send-btn {
  width: 64px;
  height: 42px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  border: none;
  border-radius: 21px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 10px rgba(59, 130, 246, 0.4);
}

.cs-send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.5);
}

/* 打字中动画 */
.cs-typing {
  display: inline-flex;
  gap: 4px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  backdrop-filter: blur(10px);
}

.cs-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #999;
  animation: csBounce 1.4s infinite ease-in-out;
}

.cs-typing span:nth-child(2) {
  animation-delay: 0.2s;
}

.cs-typing span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes csBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

/* 窄屏（手机）铺满时，悬浮组贴视口边缘留 16px，避免被裁切 */
@media (max-width: 420px) {
  .cs-float-group { right: 16px !important; }
}
