/* 前台客服悬浮窗 */
.kefu-float { position: fixed; right: 18px; bottom: 22px; z-index: 9990; font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; }
.kefu-float.hidden { display: none; }
.kefu-float-btn { position: relative; display: flex; align-items: center; justify-content: center; width: 54px; height: 54px; padding: 0; border: 0; border-radius: 50%; background: #1aa06d; box-shadow: 0 8px 22px #16352a44; cursor: pointer; transition: transform .15s ease; }
.kefu-float-btn:hover { transform: translateY(-2px); }
.kefu-float-btn svg { width: 26px; height: 26px; }
.kefu-float.open .kefu-float-btn { display: none; }
.kefu-float-badge { position: absolute; top: -3px; right: -3px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: #eb0a1e; color: #fff; font-size: 11px; line-height: 19px; text-align: center; box-sizing: border-box; }
.kefu-float-btn.has-unread { animation: kefu-float-pulse 1.6s infinite; }
@keyframes kefu-float-pulse { 0%, 100% { box-shadow: 0 8px 22px #16352a44; } 50% { box-shadow: 0 0 0 10px #1aa06d33; } }
.kefu-float-panel { display: none; flex-direction: column; width: min(340px, calc(100vw - 32px)); height: min(470px, calc(100vh - 90px)); border-radius: 12px; background: #f5f6fa; box-shadow: 0 18px 46px #16241d33; overflow: hidden; }
.kefu-float.open .kefu-float-panel { display: flex; }
.kefu-float-head { display: flex; align-items: center; gap: 9px; flex: none; padding: 11px 12px; background: #fff; border-bottom: 1px solid #eef0f4; }
.kefu-float-avatar { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: #e8f3ef; color: #1aa06d; font-size: 14px; overflow: hidden; flex: none; }
.kefu-float-avatar img { width: 100%; height: 100%; object-fit: cover; }
.kefu-float-title { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.kefu-float-title strong { font-size: 14px; color: #1f2937; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kefu-float-state { color: #8b9a94; font-size: 11px; }
.kefu-float-close { width: 26px; height: 26px; border: 0; border-radius: 50%; background: #f1f3f5; color: #6b7280; font-size: 17px; line-height: 1; cursor: pointer; }
.kefu-float-list { flex: 1; overflow-y: auto; padding: 12px; }
.kefu-float-msg { display: flex; flex-direction: column; align-items: flex-start; margin-bottom: 12px; }
.kefu-float-msg.mine { align-items: flex-end; }
.kefu-float-bubble { max-width: 84%; padding: 8px 11px; border-radius: 10px; background: #fff; color: #1f2937; font-size: 13px; line-height: 1.55; word-break: break-word; white-space: pre-wrap; }
.kefu-float-msg.mine .kefu-float-bubble { background: #d9ecff; }
.kefu-float-msg img { max-width: 78%; border-radius: 8px; cursor: zoom-in; }
.kefu-float-link { max-width: 84%; padding: 9px 13px; border: 0; border-radius: 10px; background: #2b76f6; color: #fff; font-size: 13px; line-height: 1.45; text-align: left; overflow-wrap: anywhere; cursor: pointer; }
.kefu-float-link::after { content: " ›"; font-weight: 600; }
.kefu-float-lightbox { position: fixed; inset: 0; z-index: 9995; display: none; align-items: center; justify-content: center; padding: 24px; background: #000000e0; }
.kefu-float-lightbox.open { display: flex; }
.kefu-float-lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; box-shadow: 0 18px 60px #00000066; cursor: zoom-out; }
.kefu-float-time { margin-top: 4px; color: #a8b3ae; font-size: 11px; }
.kefu-float-composer { display: flex; align-items: flex-end; gap: 7px; flex: none; padding: 9px 10px; background: #fff; border-top: 1px solid #eef0f4; }
.kefu-float-input { flex: 1; min-height: 34px; max-height: 92px; padding: 7px 10px; border: 1px solid #dfe4e8; border-radius: 8px; font-family: inherit; font-size: 13px; resize: none; box-sizing: border-box; }
.kefu-float-input:focus { outline: none; border-color: #1aa06d; }
.kefu-float-image { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 7px; background: #f1f3f5; cursor: pointer; }
.kefu-float-image svg { width: 19px; height: 19px; }
.kefu-float-send { height: 34px; padding: 0 14px; border: 0; border-radius: 8px; background: #1aa06d; color: #fff; font-size: 13px; cursor: pointer; }
.kefu-float-send:disabled { opacity: .6; }
@media (max-width: 520px) {
  .kefu-float { right: 12px; bottom: 14px; }
  .kefu-float-panel { height: min(430px, calc(100vh - 80px)); }
}
