/* 悬浮在线咨询 */
#floating-kf {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 9999;
  font-family: "Microsoft YaHei","PingFang SC",sans-serif;
}
#floating-kf .kf-item {
  position: relative;
  width: 72px;
  height: 72px;
  background: #00a8e8;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  transition: background .3s;
}
#floating-kf .kf-item:last-child { border-bottom: none; }
#floating-kf .kf-item:hover { background: #008ec4; }
#floating-kf .kf-item i { font-size: 22px; margin-bottom: 3px; }
#floating-kf .kf-item span { font-size: 12px; line-height: 1; }
#floating-kf .kf-popover {
  position: absolute;
  right: 82px;
  top: 50%;
  transform: translateY(-50%) scale(0.95);
  opacity: 0;
  visibility: hidden;
  transition: all .25s ease;
  pointer-events: none;
}
#floating-kf .kf-popover-box {
  position: relative;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.18);
  padding: 16px 20px;
  text-align: center;
  color: #333;
}
#floating-kf .kf-popover-box::after {
  content: '';
  position: absolute;
  right: -10px;
  top: 50%;
  transform: translateY(-50%);
  border-width: 10px 0 10px 10px;
  border-style: solid;
  border-color: transparent transparent transparent #fff;
}
#floating-kf .kf-item:hover .kf-popover,
#floating-kf .kf-item.active .kf-popover {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) scale(1);
  pointer-events: auto;
}
#floating-kf .kf-popover img {
  display: block;
  margin: 0 auto 8px;
  border-radius: 4px;
  max-width: 150px;
}
#floating-kf .kf-tip { margin: 0; font-size: 13px; color: #666; }
#floating-kf .kf-num { margin: 0; font-size: 16px; color: #00a8e8; font-weight: 700; letter-spacing: 1px; white-space: nowrap; }
/* ===== 移动端适配 ===== */
@media (max-width: 768px) {
  #floating-kf {
    right: 4px;
    top: auto;
    bottom: 120px;
    transform: none;
  }
  #floating-kf .kf-item {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    margin-bottom: 3px;
    border-bottom: none;
  }
  #floating-kf .kf-item i {
    font-size: 16px;
    margin-bottom: 1px;
  }
  #floating-kf .kf-item span {
    font-size: 9px;
    line-height: 1.1;
  }

  /* 弹出卡片居中浮层 */
  #floating-kf .kf-popover {
    position: fixed;
    right: auto;
    left: 50%;
    top: 50%;
    bottom: auto;
    transform: translate(-50%, -50%) scale(0.9);
    z-index: 10001;
    width: auto;
    min-width: 220px;
    max-width: calc(100vw - 32px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .25s, visibility .25s, transform .25s;
  }
  #floating-kf .kf-item.active .kf-popover {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
  }
  #floating-kf .kf-popover-box {
    border-radius: 10px;
    padding: 18px 20px;
    max-width: 100%;
    min-width: 200px;
    box-sizing: border-box;
    text-align: center;
  }
  #floating-kf .kf-popover-box::after {
    display: none;
  }
  #floating-kf .kf-popover img {
    max-width: 130px;
    width: auto;
    height: auto;
    display: block;
    margin: 0 auto 8px;
  }
  #floating-kf .kf-num {
    font-size: 18px;
    font-weight: 700;
    white-space: nowrap;
  }
  #floating-kf .kf-call-btn {
    display: block;
    margin: 12px auto 0;
    padding: 8px 28px;
    background: #00a8e8;
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    transition: background .2s;
  }
  #floating-kf .kf-call-btn:hover {
    background: #008ec4;
    color: #fff;
    text-decoration: none;
  }

  /* 背景遮罩 */
  #floating-kf .kf-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 10000;
  }
  #floating-kf .kf-overlay.show {
    display: block;
  }

  /* 移动端禁用 hover 弹窗，仅靠 .active 控制 */
  #floating-kf .kf-item:hover .kf-popover {
    opacity: 0;
    visibility: hidden;
  }
  #floating-kf .kf-item.active:hover .kf-popover {
    opacity: 1;
    visibility: visible;
  }
}
