/* ===== 小虾客服组件（全站浮动） ===== */
.xia-launcher {
  position: fixed; right: 22px; bottom: 26px; z-index: 9999;
  width: 62px; height: 62px; border-radius: 50%;
  background: #fff; border: 3px solid var(--blue, #1f6feb);
  box-shadow: 0 6px 18px rgba(31,111,235,.28);
  cursor: pointer; padding: 0; overflow: visible;
  transition: transform .18s ease;
}
.xia-launcher:hover { transform: scale(1.08); }
.xia-launcher img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.xia-launcher .dot {
  position: absolute; top: -2px; right: -2px; width: 16px; height: 16px;
  background: #22c55e; border: 3px solid #fff; border-radius: 50%;
}
.xia-launcher .pulse {
  position: absolute; inset: -6px; border-radius: 50%;
  border: 3px solid var(--blue, #1f6feb); opacity: .35;
  animation: xiaPulse 2s ease-out infinite;
}
@keyframes xiaPulse {
  0% { transform: scale(.9); opacity: .4; }
  100% { transform: scale(1.35); opacity: 0; }
}
.xia-tip {
  position: fixed; right: 96px; bottom: 40px; z-index: 9999;
  background: #fff; color: #2c3e50; font-size: 13px;
  padding: 8px 14px; border-radius: 12px 12px 2px 12px;
  box-shadow: 0 4px 14px rgba(0,0,0,.12); border: 1px solid #e3e8ef;
  animation: xiaFade 0.3s ease;
}
@keyframes xiaFade { from { opacity: 0; transform: translateY(6px); } }

/* 聊天窗口 */
.xia-panel {
  position: fixed; right: 22px; bottom: 100px; z-index: 10000;
  width: 372px; max-width: calc(100vw - 32px); height: 540px;
  max-height: calc(100vh - 130px);
  background: #fff; border-radius: 16px;
  box-shadow: 0 12px 40px rgba(13,27,42,.22);
  display: none; flex-direction: column; overflow: hidden;
  border: 1px solid #e3e8ef;
}
.xia-panel.open { display: flex; animation: xiaUp .25s ease; }
@keyframes xiaUp { from { opacity: 0; transform: translateY(14px); } }

.xia-head {
  background: linear-gradient(135deg, #1f6feb, #0d3b8f);
  color: #fff; padding: 14px 16px; display: flex; align-items: center; gap: 10px;
}
.xia-head img { width: 42px; height: 42px; border-radius: 50%; background: #fff; padding: 2px; object-fit: cover; }
.xia-head .name { font-size: 16px; font-weight: 700; }
.xia-head .status { font-size: 12px; opacity: .85; display: flex; align-items: center; gap: 5px; }
.xia-head .status::before { content: ''; width: 7px; height: 7px; background: #4ade80; border-radius: 50%; display: inline-block; }
.xia-head .close {
  margin-left: auto; background: rgba(255,255,255,.15); border: none; color: #fff;
  width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: 16px; line-height: 1;
}
.xia-head .close:hover { background: rgba(255,255,255,.28); }

.xia-body { flex: 1; overflow-y: auto; padding: 14px 12px; background: #f4f8ff; }
.xia-msg { display: flex; margin-bottom: 12px; gap: 8px; }
.xia-msg .avatar { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; background: #fff; border: 1px solid #e3e8ef; padding: 1px; object-fit: cover; }
.xia-msg .bubble {
  max-width: 76%; padding: 9px 13px; border-radius: 12px; font-size: 14px; line-height: 1.6;
  word-break: break-word; white-space: pre-wrap;
}
.xia-msg.bot .bubble { background: #fff; border: 1px solid #e3e8ef; border-top-left-radius: 3px; color: #2c3e50; }
.xia-msg.user { flex-direction: row-reverse; }
.xia-msg.user .bubble { background: var(--blue, #1f6feb); color: #fff; border-top-right-radius: 3px; }
.xia-msg .typing span {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: #9fb3c8; margin-right: 4px; animation: xiaB 1.2s infinite;
}
.xia-msg .typing span:nth-child(2) { animation-delay: .2s; }
.xia-msg .typing span:nth-child(3) { animation-delay: .4s; }
@keyframes xiaB { 0%,60%,100% { opacity: .3; } 30% { opacity: 1; } }

.xia-quick { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 12px 10px; background: #f4f8ff; }
.xia-quick button {
  background: #fff; border: 1px solid #c9d8f0; color: var(--blue, #1f6feb);
  font-size: 12px; padding: 6px 12px; border-radius: 999px; cursor: pointer;
}
.xia-quick button:hover { background: var(--blue, #1f6feb); color: #fff; }

.xia-input {
  display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid #e3e8ef; background: #fff;
}
.xia-input textarea {
  flex: 1; border: 1px solid #e3e8ef; border-radius: 10px; padding: 9px 12px;
  font-size: 14px; font-family: inherit; resize: none; height: 40px; outline: none;
}
.xia-input textarea:focus { border-color: var(--blue, #1f6feb); }
.xia-input button {
  background: var(--blue, #1f6feb); color: #fff; border: none; border-radius: 10px;
  padding: 0 16px; cursor: pointer; font-size: 14px;
}
.xia-input button:disabled { background: #b8c6dd; cursor: not-allowed; }
