/* ---------- 在线客服组件 ---------- */
.chat-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 96;
  display: flex; align-items: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 13px 20px;
  background: linear-gradient(120deg, var(--primary), var(--primary-deep));
  color: #fff; font-size: 15px; font-weight: 800; letter-spacing: 1px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .25);
  transition: transform .15s;
}
.chat-fab:hover { transform: translateY(-3px); color: #fff; }
.chat-fab svg { width: 21px; height: 21px; fill: currentColor; }
.chat-fab::after {
  content: ""; position: absolute; top: 6px; right: 6px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--accent);
}
@media (max-width: 768px) {
  .chat-fab { right: 14px; bottom: 84px; padding: 11px 16px; }
}

.chat-panel {
  position: fixed; right: 22px; bottom: 86px; z-index: 97;
  width: 340px; max-height: 72vh;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
  display: none; flex-direction: column; overflow: hidden;
}
.chat-panel.is-open { display: flex; animation: chatIn .25s ease; }
@keyframes chatIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (max-width: 768px) {
  .chat-panel { right: 10px; left: 10px; width: auto; bottom: 148px; max-height: 62vh; }
}

.chat-head {
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(120deg, var(--primary), var(--primary-deep));
  color: #fff; padding: 13px 16px;
}
.chat-head-info { display: flex; align-items: center; gap: 10px; }
.chat-avatar {
  width: 38px; height: 38px; border-radius: 12px; background: rgba(255,255,255,.16);
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 15px; letter-spacing: 1px;
}
.chat-head-info b { font-size: 15px; display: block; line-height: 1.3; }
.chat-head-info span { font-size: 11.5px; opacity: .85; display: flex; align-items: center; gap: 5px; }
.chat-dot { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; display: inline-block; }
.chat-close { background: none; border: 0; color: #fff; font-size: 15px; cursor: pointer; padding: 4px 6px; }

/* 微信二维码展示区（客服面板内） */
.chat-wx {
  display: flex; gap: 12px; align-items: center;
  padding: 12px 14px; margin: 10px 14px 0;
  background: #f0faf4; border: 1.5px solid #b7e4c7; border-radius: 12px;
}
.chat-wx img { width: 84px; height: 84px; border-radius: 10px; object-fit: cover; flex: none; background: #fff; }
.chat-wx-tip { font-size: 12.5px; line-height: 1.7; color: #14532d; }
.chat-wx-tip b { font-size: 14px; color: #0f5132; }

.chat-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.chat-msg { max-width: 82%; padding: 10px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.65; white-space: pre-line; }
.chat-msg--bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.chat-msg--user { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg b { color: var(--primary); }
.chat-msg--user b { color: var(--accent); }
.chat-quick { display: flex; flex-wrap: wrap; gap: 7px; align-self: flex-start; max-width: 90%; }
.chat-quick button {
  border: 1.5px solid var(--primary); color: var(--primary); background: var(--surface);
  border-radius: 999px; padding: 5px 13px; font-size: 12.5px; font-weight: 700;
}
.chat-quick button:hover { background: var(--primary); color: #fff; }

.chat-lead {
  border-top: 1px dashed var(--line); padding: 12px 14px 6px; background: var(--surface);
}
.chat-lead-tip { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.chat-lead-tip b { color: var(--accent); }
.chat-lead input {
  flex: 1; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--bg); font-size: 14px;
}
.chat-lead input:focus { outline: none; border-color: var(--primary); }
.chat-lead-ok { display: none; margin-top: 8px; font-size: 12.5px; color: var(--primary); font-weight: 700; }
.chat-lead-ok.is-show { display: block; }

.chat-input-row { display: flex; gap: 8px; padding: 10px 14px 14px; background: var(--surface); }
.chat-input-row input {
  flex: 1; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--bg); font-size: 14px;
}
.chat-input-row input:focus { outline: none; border-color: var(--primary); }
.chat-send-btn {
  border: 0; border-radius: 10px; padding: 10px 16px; font-size: 14px; font-weight: 800;
  background: var(--accent); color: #1b2a3a; cursor: pointer; white-space: nowrap;
}
.chat-send-btn:hover { background: var(--accent-deep); }

/* 输入中动画 */
.chat-typing { display: flex; align-items: center; gap: 8px; }
.tdots { display: inline-flex; gap: 3px; }
.tdots i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--muted);
  animation: tblink 1.2s infinite ease-in-out;
}
.tdots i:nth-child(2) { animation-delay: .2s; }
.tdots i:nth-child(3) { animation-delay: .4s; }
@keyframes tblink { 0%, 60%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
