<?php
// banner_1 全宽大图轮播
if (!isset($banner) || !is_array($banner)) { $banner = array('images'=>array(), 'notice'=>''); }
$b1_images = isset($banner['images']) && is_array($banner['images']) ? $banner['images'] : array();
$b1_notice = isset($banner['notice']) ? $banner['notice'] : '';
?>
<style>
.yk-banner1{position:relative;width:100%;overflow:hidden;background:#0f1c33;}
.yk-banner1 .yk-b1-slider{position:relative;width:100%;height:420px;}
.yk-banner1 .yk-b1-slide{position:absolute;inset:0;opacity:0;transition:opacity .8s ease;display:block;}
.yk-banner1 .yk-b1-slide.on{opacity:1;z-index:1;}
.yk-banner1 .yk-b1-slide img{width:100%;height:100%;object-fit:cover;display:block;}
.yk-banner1 .yk-b1-ph{width:100%;height:100%;background:linear-gradient(120deg,#123a6d 0%,#1f6fb2 55%,#2fa3c7 100%);display:flex;flex-direction:column;align-items:center;justify-content:center;color:#fff;text-align:center;padding:0 20px;}
.yk-banner1 .yk-b1-ph-name{font-size:34px;font-weight:700;letter-spacing:2px;margin-bottom:12px;}
.yk-banner1 .yk-b1-ph-slogan{font-size:15px;opacity:.85;letter-spacing:4px;}
.yk-banner1 .yk-b1-caption{position:absolute;left:0;right:0;bottom:0;z-index:2;background:linear-gradient(transparent,rgba(0,0,0,.55));padding:40px 24px 16px;color:#fff;}
.yk-banner1 .yk-b1-notice{max-width:1200px;margin:0 auto;font-size:14px;display:flex;align-items:center;gap:10px;}
.yk-banner1 .yk-b1-tag{flex:none;background:#e8b33c;color:#1a1a1a;font-size:12px;font-weight:700;padding:2px 10px;border-radius:3px;}
.yk-banner1 .yk-b1-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
@media (max-width:1199px){
  .yk-banner1 .yk-b1-slider{height:320px;}
  .yk-banner1 .yk-b1-ph-name{font-size:26px;}
}
@media (max-width:767px){
  .yk-banner1 .yk-b1-slider{height:210px;}
  .yk-banner1 .yk-b1-ph-name{font-size:20px;letter-spacing:1px;}
  .yk-banner1 .yk-b1-ph-slogan{font-size:12px;letter-spacing:2px;}
  .yk-banner1 .yk-b1-caption{padding:26px 14px 10px;}
  .yk-banner1 .yk-b1-notice{font-size:12px;}
}
</style>
<div class="yk-banner1">
  <div class="yk-b1-slider yk-slider">
    <?php if (!empty($b1_images)) { ?>
      <?php $b1_i = 0; foreach ($b1_images as $b1_im) { $b1_img = isset($b1_im['img']) ? $b1_im['img'] : ''; $b1_url = isset($b1_im['url']) ? $b1_im['url'] : ''; ?>
        <?php if ($b1_img !== '') { ?>
        <a class="yk-b1-slide yk-slide<?php echo $b1_i === 0 ? ' on' : ''; ?>"<?php echo $b1_url !== '' ? ' href="'.e($b1_url).'"' : ''; ?>>
          <img src="<?php echo e($b1_img); ?>" alt="<?php echo e(site_config('company_name','')); ?>">
        </a>
        <?php $b1_i++; } ?>
      <?php } ?>
      <?php if ($b1_i === 0) { ?>
      <div class="yk-b1-slide yk-slide on"><div class="yk-b1-ph">
        <div class="yk-b1-ph-name"><?php echo e(site_config('company_name','炎酷CMS')); ?></div>
        <div class="yk-b1-ph-slogan"><?php echo e(site_config('slogan','专注品质 · 用心服务')); ?></div>
      </div></div>
      <?php } ?>
    <?php } else { ?>
    <div class="yk-b1-slide yk-slide on"><div class="yk-b1-ph">
      <div class="yk-b1-ph-name"><?php echo e(site_config('company_name','炎酷CMS')); ?></div>
      <div class="yk-b1-ph-slogan"><?php echo e(site_config('slogan','专注品质 · 用心服务')); ?></div>
    </div></div>
    <?php } ?>
  </div>
  <?php if ($b1_notice !== '') { ?>
  <div class="yk-b1-caption">
    <div class="yk-b1-notice"><span class="yk-b1-tag">公告</span><span class="yk-b1-text"><?php echo e($b1_notice); ?></span></div>
  </div>
  <?php } ?>
</div>
