/* ═══════════════════════════════════════════════════════════════════════════
   KING PLUS 官网侧边悬浮互动系统 (Floating Widget System)
   - 包含：右下角悬浮交互坞 (Dock)
   - 销售顾问专属名片弹窗 (Sales Specialist Directory Modal)
   - 智能在线客服会话抽屉 (Live Customer Support Chat Drawer)
   - 表情选择面板 (Emoji Panel) & 图片预览弹窗 (Image Modal) & 提示条 (Toast)
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --kp-blue: #0A1E3F;
  --kp-royal: #0066B3;
  --kp-orange: #F06739;
  --kp-orange-light: #FF703D;
  --kp-orange-glow: rgba(240, 103, 57, 0.25);
  --kp-gray-50: #F8FAFC;
  --kp-gray-100: #F1F5F9;
  --kp-gray-200: #E2E8F0;
  --kp-gray-400: #94A3B8;
  --kp-gray-600: #64748B;
  --kp-gray-800: #1E293B;
  --kp-shadow-sm: 0 4px 12px rgba(10, 30, 63, 0.08);
  --kp-shadow-md: 0 12px 32px rgba(10, 30, 63, 0.16);
  --kp-shadow-lg: 0 20px 48px rgba(10, 30, 63, 0.24);
  --kp-radius-sm: 8px;
  --kp-radius-md: 14px;
  --kp-radius-lg: 20px;
  --kp-radius-full: 9999px;
  --kp-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ═══════════════════════════════════════════════════════════════════════════
   1. 右下角悬浮交互坞 (Floating Dock)
   ═══════════════════════════════════════════════════════════════════════════ */
.kp-dock-container {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 990;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  user-select: none;
}

/* 悬浮主操作胶囊组 */
.kp-dock-pill-group {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: var(--kp-radius-full);
  padding: 6px;
  box-shadow: 0 8px 30px rgba(10, 30, 63, 0.12),
              0 2px 8px rgba(10, 30, 63, 0.04);
  gap: 6px;
  transition: all 0.3s var(--kp-ease);
}

.kp-dock-btn {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--kp-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
  transition: all 0.28s var(--kp-ease);
}

.kp-dock-btn svg {
  width: 24px;
  height: 24px;
  transition: transform 0.28s var(--kp-ease);
}

.kp-dock-btn:hover {
  background: var(--kp-gray-100);
  color: var(--kp-royal);
  transform: translateY(-2px);
}

.kp-dock-btn:hover svg {
  transform: scale(1.1);
}

/* 在线客服专属高亮与呼吸脉冲 */
.kp-dock-btn--chat {
  background: linear-gradient(135deg, var(--kp-orange-light) 0%, var(--kp-orange) 100%);
  color: #ffffff !important;
  box-shadow: 0 4px 18px var(--kp-orange-glow);
}

.kp-dock-btn--chat:hover {
  background: linear-gradient(135deg, #FF8254 0%, #F55B27 100%) !important;
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 24px rgba(240, 103, 57, 0.45);
}

/* 在线客服呼吸光环动画 */
.kp-dock-btn--chat::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid var(--kp-orange);
  opacity: 0.8;
  animation: kpPulseRing 2.4s infinite cubic-bezier(0.215, 0.61, 0.355, 1);
  pointer-events: none;
}

@keyframes kpPulseRing {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 0; }
  100% { transform: scale(1.3); opacity: 0; }
}

/* 销售名片按钮特殊悬停态 */
.kp-dock-btn--sales:hover {
  background: rgba(0, 102, 179, 0.1);
  color: var(--kp-royal);
}

/* 在线绿点指示器 */
.kp-dock-badge-online {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 10px;
  height: 10px;
  background: #10B981;
  border: 2px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

/* 返回顶部按钮 */
.kp-dock-btn--top {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border: 1px solid var(--kp-gray-200);
  color: var(--kp-gray-600);
  box-shadow: var(--kp-shadow-sm);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: all 0.3s var(--kp-ease);
}

.kp-dock-btn--top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.kp-dock-btn--top:hover {
  background: #ffffff;
  color: var(--kp-blue);
  border-color: var(--kp-royal);
  transform: translateY(-3px);
  box-shadow: var(--kp-shadow-md);
}

/* 悬浮 Tooltip 气泡 */
.kp-dock-tooltip {
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  background: var(--kp-blue);
  color: #ffffff;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s var(--kp-ease);
  box-shadow: 0 4px 16px rgba(10, 30, 63, 0.2);
}

.kp-dock-tooltip::after {
  content: '';
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  border-width: 5px 0 5px 5px;
  border-style: solid;
  border-color: transparent transparent transparent var(--kp-blue);
}

.kp-dock-btn:hover .kp-dock-tooltip {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* ═══════════════════════════════════════════════════════════════════════════
   2. 销售人员联系卡片弹窗 (Sales Specialist Directory Modal)
   ═══════════════════════════════════════════════════════════════════════════ */
.kp-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 30, 63, 0.48);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.32s var(--kp-ease);
}

.kp-modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.kp-sales-modal {
  background: #ffffff;
  width: 100%;
  max-width: 1000px;
  max-height: 90vh;
  border-radius: var(--kp-radius-lg);
  box-shadow: 0 24px 64px rgba(10, 30, 63, 0.18),
              0 4px 20px rgba(10, 30, 63, 0.05);
  border: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.92) translateY(20px);
  transition: all 0.35s var(--kp-ease);
}

.kp-modal-backdrop.is-open .kp-sales-modal {
  transform: scale(1) translateY(0);
}

/* 弹窗头部 (无下边框，纯净自然衔接) */
.kp-sales-header {
  padding: 34px 36px 14px;
  border-bottom: none;
  background: #ffffff;
  position: relative;
}

.kp-sales-header h2 {
  font-family: var(--f-head, "Barlow", sans-serif);
  font-size: 26px;
  font-weight: 800;
  color: var(--kp-blue);
  margin: 0 0 6px 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.kp-sales-header p {
  color: var(--kp-gray-600);
  font-size: 14.5px;
  margin: 0;
}

.kp-modal-close-btn {
  position: absolute;
  top: 24px;
  right: 28px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--kp-gray-100);
  color: var(--kp-gray-600);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s var(--kp-ease);
}

.kp-modal-close-btn:hover {
  background: var(--kp-gray-200);
  color: var(--kp-blue);
  transform: rotate(90deg);
}

/* 顾问卡片网格列表 */
.kp-sales-body {
  padding: 16px 36px 36px;
  overflow-y: auto;
  max-height: calc(90vh - 120px);
}

.kp-sales-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.kp-sales-card {
  background: #F8FAFC;
  border: none;
  border-radius: 18px;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 2px 10px rgba(10, 30, 63, 0.02);
  transition: all 0.3s var(--kp-ease);
  position: relative;
}

.kp-sales-card:hover {
  transform: translateY(-3px);
  background: #ffffff;
  box-shadow: 0 16px 38px rgba(10, 30, 63, 0.09);
}

/* 顶部：头像与核心专长 */
.kp-sales-card-top {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.kp-sales-avatar-wrap {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  padding: 2.5px;
  background: linear-gradient(135deg, var(--kp-royal) 0%, var(--kp-orange) 100%);
  box-shadow: 0 4px 12px rgba(0, 102, 179, 0.14);
  flex-shrink: 0;
}

.kp-sales-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: var(--kp-gray-100);
  display: block;
}

.kp-sales-header-info {
  flex: 1;
  min-width: 0;
}

.kp-sales-name-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 2px;
}

.kp-sales-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--kp-blue);
  margin: 0;
  line-height: 1.25;
}

.kp-sales-title {
  font-size: 12.5px;
  color: var(--kp-royal);
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}

.kp-sales-desc {
  font-size: 12px;
  color: var(--kp-gray-600);
  line-height: 1.45;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 底部：直联方式（左侧）与直接常驻呈现的微信名片二维码（右侧，纯净无边框悬浮岛） */
.kp-sales-card-bottom {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 4px;
  border-top: none;
}

.kp-sales-contacts-left {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kp-sales-contact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border: none;
  padding: 7px 8px 7px 12px;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(10, 30, 63, 0.03);
  transition: all 0.2s ease;
}

.kp-sales-contact-row:hover {
  background: #ffffff;
  box-shadow: 0 3px 10px rgba(10, 30, 63, 0.07);
}

.kp-sales-contact-val {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--kp-gray-800);
  font-size: 12.5px;
  min-width: 0;
  flex: 1;
}

.kp-contact-icon {
  font-size: 13px;
  flex-shrink: 0;
  line-height: 1;
}

.kp-contact-text {
  font-family: var(--f-mono, monospace);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kp-sales-contact-val:hover .kp-contact-text {
  color: var(--kp-royal);
}

.kp-copy-action {
  background: rgba(0, 102, 179, 0.07);
  border: none;
  color: var(--kp-royal);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 3px 10px;
  border-radius: 6px;
  transition: all 0.2s ease;
  flex-shrink: 0;
  margin-left: 6px;
}

.kp-copy-action:hover {
  background: var(--kp-orange);
  color: #ffffff;
  box-shadow: 0 2px 8px var(--kp-orange-glow);
}

/* 常驻二维码卡片 (无边框极简白底小方砖) */
.kp-sales-qr-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.kp-sales-qr-box {
  width: 76px;
  height: 76px;
  background: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 5px;
  box-shadow: 0 3px 12px rgba(10, 30, 63, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kp-sales-qr-card:hover .kp-sales-qr-box {
  transform: scale(1.06);
  box-shadow: 0 8px 22px rgba(0, 102, 179, 0.15);
}

.kp-sales-qr-img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 6px;
}

.kp-sales-qr-caption {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--kp-gray-500);
  letter-spacing: 0.02em;
}

/* ═══════════════════════════════════════════════════════════════════════════
   3. 智能在线客服会话窗口 (Live Chat Drawer)
   ═══════════════════════════════════════════════════════════════════════════ */
.kp-chat-drawer {
  position: fixed;
  right: 28px;
  bottom: 28px;
  width: 390px;
  height: 600px;
  max-width: calc(100vw - 36px);
  max-height: calc(100vh - 48px);
  background: #ffffff;
  border-radius: var(--kp-radius-lg);
  box-shadow: 0 20px 50px rgba(10, 30, 63, 0.25),
              0 4px 16px rgba(10, 30, 63, 0.08);
  border: 1px solid rgba(226, 232, 240, 0.85);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(24px) scale(0.96);
  transform-origin: bottom right;
  transition: all 0.32s var(--kp-ease);
}

.kp-chat-drawer.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* 客服头部 */
.kp-chat-header {
  padding: 13px 18px;
  background: linear-gradient(135deg, #0A1E3F 0%, #102B54 50%, #163B70 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
  box-shadow: 0 4px 18px rgba(10, 30, 63, 0.16);
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  position: relative;
  overflow: hidden;
}

/* 顶部环境流光微光晕 */
.kp-chat-header::after {
  content: '';
  position: absolute;
  top: -40px;
  right: -20px;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(240, 103, 57, 0.22) 0%, rgba(240, 103, 57, 0) 70%);
  pointer-events: none;
}

.kp-chat-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.kp-chat-avatar-wrap {
  position: relative;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}

.kp-chat-avatar-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.08) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1.5px solid rgba(255, 255, 255, 0.32);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18), inset 0 1px 1px rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.kp-chat-avatar-icon {
  width: 20px;
  height: 20px;
  color: #ffffff;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.kp-chat-avatar-status {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  background: #10B981;
  border: 2px solid #0A1E3F;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.7);
}

.kp-chat-title-group {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.kp-chat-title-group h3 {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.kp-chat-status-text {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.78);
  margin: 2px 0 0 0;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.kp-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 6px #10B981;
  flex-shrink: 0;
  display: inline-block;
  animation: kpPulseGreen 2s infinite ease-in-out;
}

@keyframes kpPulseGreen {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: 0.7; }
}

/* 顶部操作区 (转人工、清空、关闭) */
.kp-chat-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

/* 转人工按钮：高质感活力橙胶囊，严格单行无折行 */
.kp-chat-transfer-top-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 11px;
  background: linear-gradient(135deg, #FF7640 0%, #F06739 100%);
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: var(--kp-radius-full);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  box-shadow: 0 2px 8px rgba(240, 103, 57, 0.35);
  transition: all 0.22s var(--kp-ease);
}

.kp-chat-transfer-top-btn:hover {
  background: linear-gradient(135deg, #FF895A 0%, #F55B27 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(240, 103, 57, 0.48);
  border-color: rgba(255, 255, 255, 0.55);
}

.kp-chat-transfer-top-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(240, 103, 57, 0.3);
}

.kp-transfer-icon {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

/* 顶部清空与关闭微交互按钮 */
.kp-chat-hdr-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.85);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-size: 13px;
  flex-shrink: 0;
  padding: 0;
}

.kp-chat-hdr-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.kp-chat-hdr-btn--close:hover {
  background: rgba(239, 68, 68, 0.85);
  border-color: rgba(239, 68, 68, 0.95);
  color: #ffffff;
}

/* 消息对话主体区域 */
.kp-chat-body {
  flex: 1;
  padding: 18px 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--kp-gray-50);
}

/* 消息时间戳与系统通知 */
.kp-chat-meta-time {
  align-self: center;
  font-size: 11.5px;
  color: var(--kp-gray-400);
  background: rgba(0, 0, 0, 0.04);
  padding: 2px 10px;
  border-radius: var(--kp-radius-full);
  margin: 4px 0;
}

.kp-chat-sys-notice {
  align-self: center;
  background: rgba(0, 102, 179, 0.08);
  border: 1px dashed rgba(0, 102, 179, 0.25);
  color: var(--kp-royal);
  padding: 8px 16px;
  border-radius: var(--kp-radius-md);
  font-size: 12px;
  text-align: center;
  line-height: 1.4;
  max-width: 90%;
}

/* 消息气泡容器 */
.kp-chat-msg-row {
  display: flex;
  gap: 10px;
  max-width: 86%;
}

.kp-chat-msg-row--ai {
  align-self: flex-start;
}

.kp-chat-msg-row--user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.kp-chat-msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #ffffff;
  border: 1px solid var(--kp-gray-200);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--kp-royal);
}

.kp-chat-msg-bubble {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.55;
  word-break: break-word;
  box-shadow: var(--kp-shadow-sm);
  position: relative;
}

/* AI / 客服气泡 */
.kp-chat-msg-row--ai .kp-chat-msg-bubble {
  background: #ffffff;
  color: var(--kp-gray-800);
  border: 1px solid var(--kp-gray-200);
  border-top-left-radius: 4px;
}

/* 用户气泡 */
.kp-chat-msg-row--user .kp-chat-msg-bubble {
  background: linear-gradient(135deg, var(--kp-orange-light) 0%, var(--kp-orange) 100%);
  color: #ffffff;
  border-top-right-radius: 4px;
}

/* 图片消息气泡 */
.kp-chat-msg-img {
  max-width: 220px;
  max-height: 180px;
  border-radius: 10px;
  cursor: pointer;
  display: block;
  transition: transform 0.2s ease;
}

.kp-chat-msg-img:hover {
  transform: scale(1.02);
}

/* 快捷提问推荐气泡标签 (Action Chips) */
.kp-chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.kp-chat-chip-btn {
  background: #ffffff;
  border: 1px solid rgba(0, 102, 179, 0.25);
  color: var(--kp-royal);
  padding: 6px 12px;
  border-radius: var(--kp-radius-full);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s var(--kp-ease);
}

.kp-chat-chip-btn:hover {
  background: rgba(0, 102, 179, 0.08);
  border-color: var(--kp-royal);
  transform: translateY(-1px);
}

/* 打字思考动效 (Typing Indicator) */
.kp-chat-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background: #ffffff;
  border-radius: 16px;
  border-top-left-radius: 4px;
  border: 1px solid var(--kp-gray-200);
  width: fit-content;
  box-shadow: var(--kp-shadow-sm);
}

.kp-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--kp-gray-400);
  animation: kpTypingBounce 1.4s infinite ease-in-out;
}

.kp-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.kp-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes kpTypingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* 底部输入交互栏 */
.kp-chat-footer {
  padding: 8px 14px 12px;
  background: #ffffff;
  border-top: 1px solid var(--kp-gray-200);
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

/* 常驻智能快捷问题胶囊栏 (Persistent Quick Chips Bar) */
.kp-chat-quick-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  white-space: nowrap;
  padding: 2px 2px 6px;
  border-bottom: 1px dashed rgba(226, 232, 240, 0.85);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.kp-chat-quick-bar::-webkit-scrollbar {
  display: none;
}

.kp-chat-quick-btn {
  background: #f8fafc;
  border: 1px solid rgba(0, 102, 179, 0.22);
  color: #0A1E3F;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s var(--kp-ease);
}

.kp-chat-quick-btn:hover {
  background: rgba(0, 102, 179, 0.08);
  border-color: #0066B3;
  color: #0066B3;
  transform: translateY(-1px);
}

/* 工具栏（表情、图片上传、转人工） */
.kp-chat-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.kp-chat-tool-btn {
  background: transparent;
  border: none;
  color: var(--kp-gray-600);
  padding: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.kp-chat-tool-btn:hover {
  background: var(--kp-gray-100);
  color: var(--kp-blue);
}

.kp-chat-tool-btn svg {
  width: 18px;
  height: 18px;
}

/* 输入区域 */
.kp-chat-input-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--kp-gray-50);
  border: 1px solid var(--kp-gray-200);
  border-radius: 12px;
  padding: 6px 10px;
  transition: all 0.2s ease;
}

.kp-chat-input-row:focus-within {
  background: #ffffff;
  border-color: var(--kp-royal);
  box-shadow: 0 0 0 3px rgba(0, 102, 179, 0.1);
}

.kp-chat-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.45;
  resize: none;
  max-height: 80px;
  min-height: 24px;
  color: var(--kp-gray-800);
}

.kp-chat-input::placeholder {
  color: var(--kp-gray-400);
}

.kp-chat-send-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--kp-gray-200);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: not-allowed;
  transition: all 0.2s var(--kp-ease);
  flex-shrink: 0;
}

.kp-chat-send-btn.is-active {
  background: linear-gradient(135deg, var(--kp-orange-light) 0%, var(--kp-orange) 100%);
  cursor: pointer;
  box-shadow: 0 2px 8px var(--kp-orange-glow);
}

.kp-chat-send-btn.is-active:hover {
  transform: scale(1.05);
}

.kp-chat-send-btn svg {
  width: 15px;
  height: 15px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   4. Emoji 表情选择面板 (Emoji Panel)
   ═══════════════════════════════════════════════════════════════════════════ */
.kp-emoji-panel {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 12px;
  box-sizing: border-box;
  width: auto;
  min-width: 282px;
  background: #ffffff;
  border: 1px solid var(--kp-gray-200);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(10, 30, 63, 0.14), 0 2px 8px rgba(10, 30, 63, 0.06);
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(6, 38px);
  gap: 6px;
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) scale(0.98);
  transform-origin: bottom left;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.kp-emoji-panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.kp-emoji-item {
  box-sizing: border-box;
  width: 38px;
  height: 38px;
  padding: 0;
  margin: 0;
  font-size: 20px;
  line-height: 1;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.15s ease;
  user-select: none;
}

.kp-emoji-item:hover {
  background: var(--kp-gray-100);
  transform: scale(1.18);
}

.kp-emoji-item:active {
  transform: scale(0.95);
  background: var(--kp-gray-200);
}

/* ═══════════════════════════════════════════════════════════════════════════
   5. 全局轻提示 (Toast) & 图片大图预览 Modal
   ═══════════════════════════════════════════════════════════════════════════ */
.kp-dock-toast,
#kp-widget-toast {
  position: fixed;
  top: 32px;
  bottom: auto !important;
  left: 50%;
  width: max-content;
  max-width: min(420px, calc(100vw - 40px));
  height: auto !important;
  min-height: unset !important;
  max-height: unset !important;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(10, 30, 63, 0.92);
  color: #ffffff;
  padding: 10px 22px;
  border-radius: var(--kp-radius-full);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(10, 30, 63, 0.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
}

.kp-dock-toast.is-show,
#kp-widget-toast.is-show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* 图片查看大图弹窗 */
.kp-img-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.28s ease;
  cursor: zoom-out;
}

.kp-img-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.kp-img-modal img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  transform: scale(0.95);
  transition: transform 0.28s var(--kp-ease);
}

.kp-img-modal.is-open img {
  transform: scale(1);
}

/* ═══════════════════════════════════════════════════════════════════════════
   6. 移动端自适应 (Responsive Adjustments)
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .kp-dock-container {
    right: 18px;
    bottom: 20px;
    gap: 10px;
  }

  .kp-dock-btn {
    width: 48px;
    height: 48px;
  }

  .kp-dock-tooltip {
    display: none; /* 移动端隐藏悬停提示 */
  }

  .kp-sales-modal {
    max-height: 94vh;
  }

  .kp-sales-header {
    padding: 20px;
  }

  .kp-sales-header h2 {
    font-size: 20px;
  }

  .kp-sales-tabs {
    padding: 12px 20px;
  }

  .kp-sales-body {
    padding: 20px;
  }

  .kp-sales-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .kp-chat-drawer {
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
    height: calc(100vh - 80px);
  }
}
