/* =====================================================================
   宏宇客服浮条 case=0 —— 玻璃拟态 · 5 图标竖排 · 白底圆形按钮 + 样式一原生多色 SVG 图标
   ---------------------------------------------------------------------
   - 每按钮 48px 白色缎面圆 + 品牌色细环，承载样式一原生多色 SVG 图标
   - hover 抬升 + 品牌色光晕
   - 文字提示卡（首页/电话/QQ）带品牌色左边框
   - 二维码弹层（微信/公众号，自带占位 QR SVG，永不破图）
   - 移动端精简，桌面键盘 focus 同样可触发
   - 路径全部随插件走（__WEAPP_TEMPLATE__/skin/images/qr_ph.svg）
   ===================================================================== */

.hy-kefu {
  position: fixed;
  right: 16px;
  top: 300px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  animation: hy-kf-bar-in .55s cubic-bezier(.22, 1, .36, 1) both;
}

/* 浮条入场：仅 X 平移 + 透明度（Y 由静态 top 控制，兼容 inline style 覆盖） */
@keyframes hy-kf-bar-in {
  from { opacity: 0; transform: translateX(26px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ---------- 单按钮基础：圆形彩色 + PNG 透明部分穿透 ---------- */
.hy-kf-item {
  position: relative;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  outline: none;
  border: none;
  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.22),
    0 0 0 1px rgba(0, 0, 0, 0.04);
  transition:
    transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.28s ease,
    filter 0.28s ease;
}

/* 玻璃高光层（顶部淡白弧） */
.hy-kf-item::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent 55%);
  pointer-events: none;
}

/* ---------- 5 按钮：白底缎面圆 + 品牌色细环（呼应图标主色） ---------- */
.hy-kf-home,
.hy-kf-tel,
.hy-kf-qq,
.hy-kf-wx,
.hy-kf-qr {
  background: radial-gradient(135% 135% at 50% 0%, #ffffff 0%, #eef1f6 100%);
  border: 1.5px solid rgba(17, 24, 39, 0.08);
  box-shadow:
    0 6px 16px rgba(17, 24, 39, 0.14),
    0 2px 4px rgba(17, 24, 39, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
/* 品牌色细环（静止态，淡） */
.hy-kf-home { border-color: rgba(183, 28, 28, 0.38); }
.hy-kf-tel  { border-color: rgba(244, 87, 122, 0.45); }
.hy-kf-qq   { border-color: rgba(250, 173, 8, 0.50); }
.hy-kf-wx   { border-color: rgba(54, 171, 96, 0.45); }
.hy-kf-qr   { border-color: rgba(60, 130, 255, 0.42); }

/* hover 抬升 + 放大 */
.hy-kf-item:hover,
.hy-kf-item:focus-visible {
  transform: translateY(-4px) scale(1.08);
  filter: brightness(1.06);
}

/* 按下回弹 */
.hy-kf-item:active {
  transform: translateY(-1px) scale(1.02);
  transition-duration: 0.08s;
}

/* ---------- 悬浮抬升：品牌色光晕（图标为样式一原生多色 SVG） ---------- */
.hy-kf-home:hover, .hy-kf-home:focus-visible { border-color: #B71C1C; box-shadow: 0 14px 26px rgba(17,24,39,0.18), 0 0 0 4px rgba(183,28,28,0.16), inset 0 1px 0 rgba(255,255,255,0.9); }
.hy-kf-tel:hover,  .hy-kf-tel:focus-visible  { border-color: #F4577A; box-shadow: 0 14px 26px rgba(17,24,39,0.18), 0 0 0 4px rgba(244,87,122,0.16), inset 0 1px 0 rgba(255,255,255,0.9); }
.hy-kf-qq:hover,   .hy-kf-qq:focus-visible   { border-color: #FAAD08; box-shadow: 0 14px 26px rgba(17,24,39,0.18), 0 0 0 4px rgba(250,173,8,0.16), inset 0 1px 0 rgba(255,255,255,0.9); }
.hy-kf-wx:hover,   .hy-kf-wx:focus-visible   { border-color: #36AB60; box-shadow: 0 14px 26px rgba(17,24,39,0.18), 0 0 0 4px rgba(54,171,96,0.16), inset 0 1px 0 rgba(255,255,255,0.9); }
.hy-kf-qr:hover,   .hy-kf-qr:focus-visible   { border-color: #3C82FF; box-shadow: 0 14px 26px rgba(17,24,39,0.18), 0 0 0 4px rgba(60,130,255,0.16), inset 0 1px 0 rgba(255,255,255,0.9); }

/* ---------- 图标容器（PNG 透明背景 + 正圆 + 居中） ---------- */
.hy-kf-ico {
  width: 32px;
  height: 32px;
  display: block;
  position: relative;
  z-index: 1;
  border-radius: 50%;
  overflow: hidden;
  background: transparent;
}
.hy-kf-ico img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  filter: none; /* 图标为样式一原生 SVG，保持纯净无阴影 */
}

/* ---------- 文字提示卡（首页/电话/QQ） ---------- */
.hy-kf-tip {
  position: absolute;
  right: calc(100% + 14px);
  top: 50%;
  transform: translateY(-50%) translateX(8px);
  background: rgba(15, 20, 36, 0.92);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  padding: 8px 13px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.22s ease,
    transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
    visibility 0.22s;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(6px);
  letter-spacing: 0.02em;
}

/* 左侧小箭头 */
.hy-kf-tip::after {
  content: "";
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 9px;
  height: 9px;
  background: rgba(15, 20, 36, 0.92);
}

.hy-kf-item:hover .hy-kf-tip,
.hy-kf-item:focus-visible .hy-kf-tip {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
}

/* 每个按钮的提示卡带品牌色左边框，强化"官方"识别 */
/* 提示卡左边框色对齐样式一原生图标主色，强化"官方"识别 */
.hy-kf-home .hy-kf-tip { border-left: 3px solid #B71C1C; }
.hy-kf-tel  .hy-kf-tip { border-left: 3px solid #FF6E83; }
.hy-kf-qq   .hy-kf-tip { border-left: 3px solid #FAAD08; }
.hy-kf-wx   .hy-kf-tip { border-left: 3px solid #36AB60; }
.hy-kf-qr   .hy-kf-tip { border-left: 3px solid #3C82FF; }

/* ---------- 二维码弹层（微信/公众号） ---------- */
.hy-kf-pop {
  position: absolute;
  right: calc(100% + 14px);
  top: 50%;
  transform: translateY(-50%) translateX(12px) scale(0.92);
  width: 144px;
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.22),
    0 0 0 1px rgba(0, 0, 0, 0.04);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.24s ease,
    transform 0.24s cubic-bezier(0.34, 1.56, 0.64, 1),
    visibility 0.24s;
  text-align: center;
  z-index: 1;
}

/* 右箭头 */
.hy-kf-pop::after {
  content: "";
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: #fff;
  box-shadow: 1px -1px 0 0 rgba(0, 0, 0, 0.04);
  border-radius: 2px;
}

.hy-kf-item:hover .hy-kf-pop,
.hy-kf-item:focus-visible .hy-kf-pop {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0) scale(1);
  pointer-events: auto;
  z-index: 5;
}

/* 占位 QR 占位：图挂掉时显示内置 SVG，永不破图 */
.hy-kf-pop .hy-kf-qrwrap {
  display: block;
  width: 120px;
  height: 120px;
  margin: 0 auto;
  border-radius: 6px;
  background-color: #f7f8fa;
  background-image: url("../images/qr_ph.svg");
  background-position: center;
  background-size: 120px 120px;
  background-repeat: no-repeat;
  overflow: hidden;
  position: relative;
}

.hy-kf-pop .hy-kf-qrwrap img {
  display: block;
  width: 120px;
  height: 120px;
  border-radius: 6px;
  background: #fff;
  object-fit: contain;
  position: relative;
  z-index: 1;
}

.hy-kf-pop .hy-kf-cap {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: #444;
  line-height: 1.4;
  letter-spacing: 0.02em;
}

/* 二维码弹层标题按品牌色区分 */
.hy-kf-wx .hy-kf-cap { color: #0fae62; font-weight: 600; }
.hy-kf-qr .hy-kf-cap { color: #5b2dff; font-weight: 600; }

/* ---------- 脉冲提示点（首屏可见时浮条"呼吸") ---------- */
@keyframes hy-kf-pulse {
  0%, 100% {
    box-shadow: 0 4px 10px rgba(183, 28, 28, 0.30),
                0 0 0 1px rgba(0, 0, 0, 0.04),
                0 0 0 0 rgba(183, 28, 28, 0.45);
  }
  50% {
    box-shadow: 0 4px 10px rgba(183, 28, 28, 0.30),
                0 0 0 1px rgba(0, 0, 0, 0.04),
                0 0 0 10px rgba(183, 28, 28, 0);
  }
}
.hy-kf-home {
  animation: hy-kf-pulse 2.4s ease-in-out 1; /* 仅首页入场脉冲一次 */
}

/* ---------- 减弱动画偏好支持 ---------- */
@media (prefers-reduced-motion: reduce) {
  .hy-kf-item,
  .hy-kf-tip,
  .hy-kf-pop { transition: none; }
  .hy-kf-home { animation: none; }
  .hy-kefu    { animation: none; }
}

/* ---------- 触屏设备禁用 hover 效果（避免 iOS 粘性 hover 误展示） ---------- */
@media (hover: none) {
  .hy-kefu.hk-no-hover .hy-kf-item:hover,
  .hy-kefu.hk-no-hover .hy-kf-item:focus-visible {
    transform: none;
    filter: none;
    box-shadow: none;
  }
  .hy-kefu.hk-no-hover .hy-kf-item:hover .hy-kf-tip,
  .hy-kefu.hk-no-hover .hy-kf-item:hover .hy-kf-pop {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translateY(-50%) translateX(8px) scale(0.92);
  }
}

/* ---------- 移动端精简 ---------- */
@media (max-width: 768px) {
  .hy-kefu    { right: 10px; gap: 10px; }
  .hy-kf-item { width: 44px; height: 44px; }
  .hy-kf-ico  { width: 30px; height: 30px; }
  /* 移动端：默认隐藏提示卡与二维码（hover 不可靠），单击激活后才展示 */
  .hy-kf-tip  { opacity: 0; visibility: hidden; transform: translateY(-50%) translateX(8px);
                transition: opacity .2s ease, transform .2s ease, visibility .2s;
                font-size: 12px; padding: 6px 10px; }
  .hy-kf-tip::after { display: none; }
  .hy-kf-pop  { opacity: 0; visibility: hidden; transform: translateY(-50%) translateX(12px) scale(.92);
                pointer-events: none; transition: opacity .24s ease, transform .24s ease, visibility .24s; }
  /* 点击激活态：展开当前项的提示卡/二维码 */
  .hy-kf-item.is-active .hy-kf-tip { opacity: 1; visibility: visible; transform: translateY(-50%) translateX(0); }
  .hy-kf-item.is-active .hy-kf-pop { opacity: 1; visibility: visible; transform: translateY(-50%) translateX(0) scale(1);
                                       pointer-events: auto; z-index: 5; }
  /* 移动端按下轻微抬升，提供触摸反馈 */
  .hy-kf-item:active { transform: translateY(-2px) scale(1.05); transition-duration: .08s; }
  /* 移动端首屏脉冲可能干扰，关闭 */
  .hy-kf-home { animation: none; }
}

/* ---------- 超大屏 ---------- */
@media (min-width: 1600px) {
  .hy-kefu { right: 24px; gap: 14px; }
  .hy-kf-item { width: 56px; height: 56px; }
  .hy-kf-ico  { width: 40px; height: 40px; }
}
