<?php
// float_1.html 客服浮动条·样式1：右侧细长竖条（电话/微信图标按钮，hover 展开）
// 可用变量：$kefu 数组：phone 电话号码（tel: 外链）/ wechat 微信二维码图URL（可空，空则不显示微信项）
$kf1       = isset($kefu) && is_array($kefu) ? $kefu : array();
$kf1_phone = isset($kf1['phone']) ? trim($kf1['phone']) : '';
$kf1_wx    = isset($kf1['wechat']) ? trim($kf1['wechat']) : '';
if ($kf1_phone === '' && $kf1_wx === '') { return; }
?>
<style>
.yk-kf1{position:fixed;right:0;top:50%;transform:translateY(-50%);z-index:9999;}
.yk-kf1 .yk-kf1-item{position:relative;display:flex;align-items:center;justify-content:center;width:44px;height:44px;margin-bottom:2px;background:#1a5fb4;color:#fff;cursor:pointer;transition:background .2s;border-radius:6px 0 0 6px;}
.yk-kf1 .yk-kf1-item:first-child{border-radius:8px 0 0 0;}
.yk-kf1 .yk-kf1-item:last-child{margin-bottom:0;border-radius:0 0 0 8px;}
.yk-kf1 .yk-kf1-item:hover{background:var(--yk-accent,#e63946);}
.yk-kf1 .yk-kf1-ico{font-size:19px;line-height:1;}
.yk-kf1 .yk-kf1-pop{position:absolute;right:52px;top:50%;transform:translateY(-50%);background:#fff;border-radius:8px;box-shadow:0 6px 24px rgba(0,0,0,.18);padding:12px 16px;white-space:nowrap;opacity:0;visibility:hidden;transition:all .25s;}
.yk-kf1 .yk-kf1-item:hover .yk-kf1-pop{opacity:1;visibility:visible;right:56px;}
.yk-kf1 .yk-kf1-pop::after{content:"";position:absolute;right:-6px;top:50%;margin-top:-6px;border:6px solid transparent;border-right:none;border-left-color:#fff;}
.yk-kf1 .yk-kf1-tel{font-size:16px;font-weight:700;color:#1a5fb4;text-decoration:none;}
.yk-kf1 .yk-kf1-pop small{display:block;font-size:11px;color:#999;font-weight:400;text-align:center;margin-top:2px;}
.yk-kf1 .yk-kf1-qr img{width:156px;height:156px;aspect-ratio:1/1;display:block;border-radius:4px;object-fit:contain;background:#fff;}
.yk-kf1 .yk-kf1-qr small{margin-top:6px;}
@media (max-width:767px){
  .yk-kf1 .yk-kf1-item{width:36px;height:36px;}
  .yk-kf1 .yk-kf1-ico{font-size:16px;}
  .yk-kf1 .yk-kf1-pop{padding:8px 10px;}
  .yk-kf1 .yk-kf1-qr img{width:125px;height:125px;aspect-ratio:1/1;object-fit:contain;background:#fff;}
}
</style>
<div class="yk-kf1">
  <?php if ($kf1_phone !== '') { ?>
  <div class="yk-kf1-item">
    <span class="yk-kf1-ico">&#9742;</span>
    <span class="yk-kf1-pop"><a class="yk-kf1-tel" href="tel:<?php echo e($kf1_phone); ?>"><?php echo e($kf1_phone); ?></a><small>咨询热线</small></span>
  </div>
  <?php } ?>
  <?php if ($kf1_wx !== '') { ?>
  <div class="yk-kf1-item">
    <span class="yk-kf1-ico">&#9993;</span>
    <span class="yk-kf1-pop yk-kf1-qr"><img src="<?php echo e($kf1_wx); ?>" alt="微信二维码"><small>扫码加微信</small></span>
  </div>
  <?php } ?>
</div>
