<?php
// banner_8 居中卡片式：大圆角卡片轮播，公告在卡片下方居中
if (!isset($banner) || !is_array($banner)) { $banner = array('images'=>array(), 'notice'=>''); }
$b8_images = isset($banner['images']) && is_array($banner['images']) ? $banner['images'] : array();
$b8_notice = isset($banner['notice']) ? $banner['notice'] : '';
?>
<style>
.yk-banner8{padding:36px 0 30px;background:#f4f6fa;}
.yk-banner8 .yk-b8-card{position:relative;max-width:1000px;margin:0 auto;height:360px;border-radius:18px;overflow:hidden;box-shadow:0 14px 40px rgba(30,45,80,.18);}
.yk-banner8 .yk-b8-slide{position:absolute;inset:0;opacity:0;transition:opacity .8s ease;display:block;}
.yk-banner8 .yk-b8-slide.on{opacity:1;z-index:1;}
.yk-banner8 .yk-b8-slide img{width:100%;height:100%;object-fit:cover;display:block;}
.yk-banner8 .yk-b8-ph{width:100%;height:100%;background:linear-gradient(125deg,#c2571f 0%,#e88b2f 55%,#f4bd5e 100%);display:flex;flex-direction:column;align-items:center;justify-content:center;color:#fff;text-align:center;padding:0 24px;}
.yk-banner8 .yk-b8-ph-name{font-size:32px;font-weight:700;letter-spacing:3px;margin-bottom:12px;}
.yk-banner8 .yk-b8-ph-slogan{font-size:14px;opacity:.9;letter-spacing:4px;}
.yk-banner8 .yk-b8-notice{max-width:1000px;margin:16px auto 0;text-align:center;font-size:13px;color:#66708a;}
.yk-banner8 .yk-b8-notice b{display:inline-block;background:#e88b2f;color:#fff;font-size:12px;font-weight:700;padding:2px 12px;border-radius:20px;margin-right:8px;}
@media (max-width:1199px){
  .yk-banner8{padding:26px 0 22px;}
  .yk-banner8 .yk-b8-card{margin:0 16px;height:280px;}
  .yk-banner8 .yk-b8-ph-name{font-size:25px;}
  .yk-banner8 .yk-b8-notice{margin:14px 16px 0;}
}
@media (max-width:767px){
  .yk-banner8{padding:16px 0 14px;}
  .yk-banner8 .yk-b8-card{margin:0 10px;height:190px;border-radius:12px;box-shadow:0 8px 22px rgba(30,45,80,.15);}
  .yk-banner8 .yk-b8-ph-name{font-size:19px;letter-spacing:1px;}
  .yk-banner8 .yk-b8-ph-slogan{font-size:12px;letter-spacing:2px;}
  .yk-banner8 .yk-b8-notice{margin:10px 10px 0;font-size:12px;}
}
</style>
<div class="yk-banner8">
  <div class="yk-b8-card yk-slider">
    <?php $b8_i = 0; foreach ($b8_images as $b8_im) { $b8_img = isset($b8_im['img']) ? $b8_im['img'] : ''; $b8_url = isset($b8_im['url']) ? $b8_im['url'] : ''; ?>
      <?php if ($b8_img !== '') { ?>
      <a class="yk-b8-slide yk-slide<?php echo $b8_i === 0 ? ' on' : ''; ?>"<?php echo $b8_url !== '' ? ' href="'.e($b8_url).'"' : ''; ?>>
        <img src="<?php echo e($b8_img); ?>" alt="<?php echo e(site_config('company_name','')); ?>">
      </a>
      <?php $b8_i++; } ?>
    <?php } ?>
    <?php if ($b8_i === 0) { ?>
    <div class="yk-b8-slide yk-slide on"><div class="yk-b8-ph">
      <div class="yk-b8-ph-name"><?php echo e(site_config('company_name','炎酷CMS')); ?></div>
      <div class="yk-b8-ph-slogan"><?php echo e(site_config('slogan','专注品质 · 用心服务')); ?></div>
    </div></div>
    <?php } ?>
  </div>
  <?php if ($b8_notice !== '') { ?>
  <div class="yk-b8-notice"><b>公告</b><?php echo e($b8_notice); ?></div>
  <?php } ?>
</div>
