<?php
// float_3.html 客服浮动条·样式3：右侧卡片式（标题"联系客服" + 大号电话 + 二维码直接显示）
// 可用变量：$kefu 数组：phone 电话号码（tel: 外链）/ wechat 微信二维码图URL（可空，空则不显示二维码区）
$kf3       = isset($kefu) && is_array($kefu) ? $kefu : array();
$kf3_phone = isset($kf3['phone']) ? trim($kf3['phone']) : '';
$kf3_wx    = isset($kf3['wechat']) ? trim($kf3['wechat']) : '';
if ($kf3_phone === '' && $kf3_wx === '') { return; }
?>
<style>
.yk-kf3{position:fixed;right:16px;top:50%;transform:translateY(-50%);z-index:9999;width:172px;background:#fff;border-radius:12px;box-shadow:0 10px 34px rgba(0,0,0,.18);overflow:hidden;text-align:center;}
.yk-kf3 .yk-kf3-h{background:linear-gradient(120deg,var(--yk-accent,#e63946),#f0762f);color:#fff;font-size:14px;font-weight:700;letter-spacing:2px;padding:10px 8px;}
.yk-kf3 .yk-kf3-bd{padding:14px 14px 16px;}
.yk-kf3 .yk-kf3-tel{display:block;font-size:19px;font-weight:800;color:var(--yk-accent,#e63946);text-decoration:none;line-height:1.3;word-break:break-all;}
.yk-kf3 .yk-kf3-tel:hover{color:#c1121f;}
.yk-kf3 .yk-kf3-sub{font-size:11px;color:#999;margin-top:3px;}
.yk-kf3 .yk-kf3-qr{margin-top:12px;border-top:1px dashed #eee;padding-top:12px;}
.yk-kf3 .yk-kf3-qr img{width:120px;height:120px;aspect-ratio:1/1;margin:0 auto;border-radius:6px;border:1px solid #f0f0f0;object-fit:contain;background:#fff;}
.yk-kf3 .yk-kf3-qr small{display:block;font-size:11px;color:#999;margin-top:6px;}
@media (max-width:767px){
  .yk-kf3{right:8px;width:120px;border-radius:10px;}
  .yk-kf3 .yk-kf3-h{font-size:12px;padding:8px 6px;}
  .yk-kf3 .yk-kf3-bd{padding:10px 10px 12px;}
  .yk-kf3 .yk-kf3-tel{font-size:14px;}
  .yk-kf3 .yk-kf3-qr img{width:88px;height:88px;aspect-ratio:1/1;object-fit:contain;background:#fff;}
}
</style>
<div class="yk-kf3">
  <div class="yk-kf3-h">联系客服</div>
  <div class="yk-kf3-bd">
    <?php if ($kf3_phone !== '') { ?>
    <a class="yk-kf3-tel" href="tel:<?php echo e($kf3_phone); ?>">&#9742; <?php echo e($kf3_phone); ?></a>
    <div class="yk-kf3-sub">工作时间 9:00 - 18:00</div>
    <?php } ?>
    <?php if ($kf3_wx !== '') { ?>
    <div class="yk-kf3-qr">
      <img src="<?php echo e($kf3_wx); ?>" alt="微信二维码">
      <small>微信扫一扫咨询</small>
    </div>
    <?php } ?>
  </div>
</div>
