/* ===== 智能客服组件 ===== */
.chat-bubble {
  position: fixed; right: 22px; bottom: 22px; z-index: 120;
  width: 60px; height: 60px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--grad); color: #fff; box-shadow: 0 12px 30px rgba(236,72,153,0.45);
  display: flex; align-items: center; justify-content: center; font-size: 26px;
  transition: transform .25s ease;
}
.chat-bubble:hover { transform: scale(1.08); }
.chat-bubble .badge {
  position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 999px; background: #ef4444; color: #fff; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; border: 2px solid #fff;
}
.chat-bubble .badge.hide { display: none; }

.chat-panel {
  position: fixed; right: 22px; bottom: 94px; z-index: 120;
  width: 360px; max-width: calc(100vw - 32px); height: 520px; max-height: calc(100vh - 120px);
  background: #fff; border-radius: 18px; box-shadow: 0 24px 60px rgba(15,23,42,0.28);
  display: flex; flex-direction: column; overflow: hidden;
  transform: translateY(20px) scale(.98); opacity: 0; pointer-events: none;
  transition: transform .28s cubic-bezier(0.22,1,0.36,1), opacity .28s ease;
}
.chat-panel.open { transform: none; opacity: 1; pointer-events: auto; }

.chat-head {
  background: var(--grad); color: #fff; padding: 16px 18px; display: flex; align-items: center; gap: 12px;
}
.chat-head .avatar { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,0.22); display: flex; align-items: center; justify-content: center; font-size: 20px; }
.chat-head .title { font-weight: 800; font-size: 16px; line-height: 1.2; }
.chat-head .status { font-size: 12px; opacity: .85; }
.chat-head .close { margin-left: auto; background: none; border: 0; color: #fff; font-size: 22px; cursor: pointer; line-height: 1; }

.chat-body { flex: 1; overflow-y: auto; padding: 16px; background: #f7f8fc; display: flex; flex-direction: column; gap: 12px; }
.chat-msg { max-width: 82%; padding: 10px 14px; border-radius: 14px; font-size: 14px; line-height: 1.6; word-break: break-word; }
.chat-msg.bot { background: #fff; border: 1px solid var(--line); color: var(--ink); border-bottom-left-radius: 4px; align-self: flex-start; }
.chat-msg.user { background: var(--grad); color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }
.chat-msg.typing { display: flex; gap: 4px; }
.chat-msg.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.chat-msg.typing span:nth-child(2) { animation-delay: .2s; }
.chat-msg.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,60%,100% { opacity: .3; } 30% { opacity: 1; } }

.chat-quick { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 10px; background: #f7f8fc; }
.chat-quick button {
  border: 1px solid var(--brand); background: #fff; color: var(--brand);
  padding: 6px 12px; border-radius: 999px; font-size: 13px; cursor: pointer; font-weight: 600;
}
.chat-quick button:hover { background: var(--brand); color: #fff; }

.chat-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: #fff; }
.chat-input input { flex: 1; border: 1px solid var(--line); border-radius: 999px; padding: 10px 14px; font-size: 14px; font-family: inherit; }
.chat-input input:focus { outline: none; border-color: var(--brand); }
.chat-input button { border: 0; background: var(--grad); color: #fff; border-radius: 999px; padding: 0 18px; font-weight: 700; cursor: pointer; }
.chat-input button:disabled { opacity: .6; cursor: default; }

@media (max-width: 480px) {
  .chat-panel { right: 12px; left: 12px; width: auto; bottom: 88px; }
  .chat-bubble { right: 14px; bottom: 14px; }
}
