/* ===== 悬浮客服组合（桌面前台，2026-11-25）=====
   右下角两枚按钮上下堆叠、互斥展开：
     上：联系方式（5 入口 + 微信二维码）
     下：在线聊天（iframe /service/）
   两者不重叠、各自面板定位独立 */
.kf-stack { position: fixed; right: 22px; bottom: 26px; z-index: 10050; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }

/* ---------- 通用按钮 ---------- */
.kf-contact__btn, .kf-chat__btn {
  border: 0; color: #fff; cursor: pointer;
  display: grid; place-items: center; position: relative;
  transition: transform .18s ease, box-shadow .18s ease;
}
.kf-contact__btn:active, .kf-chat__btn:active { transform: scale(.95); }
.kf-contact__btn:focus-visible, .kf-chat__btn:focus-visible { outline: 3px solid #f5a623; outline-offset: 3px; }
.kf-contact__btn svg, .kf-chat__btn svg { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.kf-contact__btn .kf-contact__x, .kf-chat__btn .kf-chat__x { display: none; }
.kf-contact.on .kf-contact__ic, .kf-chat.on .kf-chat__ic { display: none; }
.kf-contact.on .kf-contact__x, .kf-chat.on .kf-chat__x { display: block; }

/* ---------- ① 联系方式按钮（上方，琥珀色，48px）---------- */
.kf-contact { position: relative; }
.kf-contact__btn {
  width: 48px; height: 48px; border-radius: 14px;
  background: linear-gradient(120deg, #f5a623, #f7c05c);
  box-shadow: 0 8px 22px rgba(245,166,35,.36);
}
.kf-contact__btn:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(245,166,35,.46); }
.kf-contact__btn svg { width: 21px; height: 21px; }

.kf-contact__menu {
  position: fixed; right: 22px; bottom: 150px;
  display: flex; flex-direction: column; gap: 6px;
  background: #fff; border: 1px solid #e3e9ef; border-radius: 14px;
  padding: 10px; min-width: 168px;
  box-shadow: 0 18px 48px rgba(15,40,60,.24);
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
}
.kf-contact.on .kf-contact__menu { opacity: 1; visibility: visible; transform: none; }
.kf-contact__menu a {
  display: flex; align-items: center; gap: 10px;
  min-height: 44px; padding: 0 12px; border-radius: 9px;
  font-size: 14px; font-weight: 600; color: #16212c;
  text-decoration: none; white-space: nowrap;
  transition: background .15s ease;
}
.kf-contact__menu a:hover { background: #eef6fc; color: #0e67ab; }
.kf-contact__menu a span {
  flex: none; width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 800;
}
.kf-i-wa { background: #25d366; }
.kf-i-sk { background: #00aaf0; }
.kf-i-em { background: #f5a623; }
.kf-i-ph { background: #0e67ab; }
.kf-i-wc { background: #51c332; }
.kf-qr { display: none; text-align: center; padding: 10px 8px 6px; border-top: 1px solid #e3e9ef; margin-top: 4px; }
.kf-qr.on { display: block; }
.kf-qr img { display: block; max-width: 100%; height: auto; margin: 0 auto; border-radius: 6px; }
.kf-qr p { margin: 6px 0 0; font-size: 11px; color: #4a5a68; }

/* ---------- ② 在线聊天按钮（下方，蓝色，56px）---------- */
.kf-chat { position: relative; }
.kf-chat__btn {
  width: 56px; height: 56px; border-radius: 18px;
  background: linear-gradient(120deg, #0e67ab, #38a8d8);
  box-shadow: 0 10px 28px rgba(14,103,171,.34);
}
.kf-chat__btn:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(14,103,171,.44); }
.kf-chat__btn svg { width: 25px; height: 25px; }
.kf-chat__dot {
  position: absolute; top: -2px; right: -2px; width: 13px; height: 13px;
  border-radius: 50%; background: #22c55e; border: 2px solid #fff;
}

/* 聊天面板：贴着按钮上方，不遮挡联系按钮 */
.kf-chat__panel {
  position: fixed; right: 22px; bottom: 94px;
  width: 400px; height: min(600px, calc(100vh - 200px));
  background: #fff; border: 1px solid #e6eef3; border-radius: 18px;
  box-shadow: 0 24px 64px rgba(15,40,60,.28);
  overflow: hidden; display: none; flex-direction: column;
  transform: translateY(10px); opacity: 0;
  transition: transform .2s ease, opacity .2s ease;
}
.kf-chat.on .kf-chat__panel { display: flex; transform: none; opacity: 1; }
.kf-chat__panel iframe { flex: 1; width: 100%; height: 100%; border: 0; display: block; }

/* 老 wmkc 竖排组件隐藏 */
#wmkc { display: none !important; }

@media (max-width: 640px) {
  .kf-stack { right: 16px; bottom: 18px; gap: 10px; }
  /* 手机上聊天面板全屏（联系方式菜单保持小弹层） */
  .kf-chat__panel { position: fixed; right: 0; bottom: 0; width: 100%; height: 100dvh; border-radius: 0; border: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .kf-contact__btn, .kf-chat__btn,
  .kf-contact__menu, .kf-chat__panel { transition: none; }
}

/* ===== 首页海报遮挡修复（2026-11-26 修正）=====
   只提升 z-index，绝不加 transform/isolation/filter！
   原因：transform 会给 fixed 子元素创建"包含块"，导致手机全屏面板
   相对 56px 的 stack 定位（W:56、跑出屏幕），看起来像"点击没反应"。 */
.kf-stack {
  z-index: 10001 !important;   /* 压住首页海报和浮窗 */
}
.kf-chat__panel, .kf-contact__menu { z-index: 10002 !important; }

/* 按钮与蓝色海报同色系时易融合：加白色描边 + 深色柔光，确保任何背景上都清晰 */
.kf-contact__btn, .kf-chat__btn {
  border: 2px solid rgba(255,255,255,.95) !important;
  box-shadow: 0 6px 20px rgba(6,45,79,.28), 0 0 0 1px rgba(6,45,79,.14) !important;
}
.kf-contact__btn:hover, .kf-chat__btn:hover {
  box-shadow: 0 12px 30px rgba(6,45,79,.38), 0 0 0 1px rgba(6,45,79,.2) !important;
}
