<?php
// banner_7 多图网格：一大图+多小图拼版，hover 放大
if (!isset($banner) || !is_array($banner)) { $banner = array('images'=>array(), 'notice'=>''); }
$b7_images = isset($banner['images']) && is_array($banner['images']) ? $banner['images'] : array();
$b7_notice = isset($banner['notice']) ? $banner['notice'] : '';
$b7_list = array();
foreach ($b7_images as $b7_im) {
  $b7_img = isset($b7_im['img']) ? $b7_im['img'] : '';
  if ($b7_img === '') { continue; }
  $b7_list[] = array('img'=>$b7_img, 'url'=>(isset($b7_im['url']) ? $b7_im['url'] : ''));
  if (count($b7_list) >= 5) { break; }
}
?>
<style>
.yk-banner7{max-width:1200px;margin:0 auto;}
.yk-banner7 .yk-b7-grid{display:grid;grid-template-columns:repeat(4,1fr);grid-auto-rows:150px;gap:10px;}
.yk-banner7 .yk-b7-cell{position:relative;overflow:hidden;border-radius:6px;display:block;}
.yk-banner7 .yk-b7-cell img{width:100%;height:100%;object-fit:cover;display:block;transition:transform .5s ease;}
.yk-banner7 .yk-b7-cell:hover img{transform:scale(1.07);}
.yk-banner7 .yk-b7-big{grid-column:span 2;grid-row:span 2;}
.yk-banner7 .yk-b7-ph{grid-column:span 4;grid-row:span 2;background:linear-gradient(130deg,#5b2a86 0%,#8f3fbf 55%,#d06ad8 100%);display:flex;flex-direction:column;align-items:center;justify-content:center;color:#fff;text-align:center;padding:0 20px;border-radius:6px;}
.yk-banner7 .yk-b7-ph-name{font-size:30px;font-weight:700;letter-spacing:3px;margin-bottom:12px;}
.yk-banner7 .yk-b7-ph-slogan{font-size:14px;opacity:.88;letter-spacing:3px;}
.yk-banner7 .yk-b7-notice{margin-top:12px;background:#f7f3fb;border:1px solid #e5d9f2;border-radius:6px;padding:10px 16px;font-size:13px;color:#5a4a72;display:flex;align-items:center;gap:10px;}
.yk-banner7 .yk-b7-tag{flex:none;background:#8f3fbf;color:#fff;font-size:12px;font-weight:700;padding:2px 10px;border-radius:20px;}
.yk-banner7 .yk-b7-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
@media (max-width:1199px){
  .yk-banner7{margin:0 16px;}
  .yk-banner7 .yk-b7-grid{grid-auto-rows:120px;}
  .yk-banner7 .yk-b7-ph-name{font-size:24px;}
}
@media (max-width:767px){
  .yk-banner7{margin:0 10px;}
  .yk-banner7 .yk-b7-grid{grid-template-columns:repeat(2,1fr);grid-auto-rows:110px;gap:6px;}
  .yk-banner7 .yk-b7-big{grid-column:span 2;grid-row:span 1;}
  .yk-banner7 .yk-b7-ph{grid-column:span 2;grid-row:span 2;}
  .yk-banner7 .yk-b7-ph-name{font-size:18px;letter-spacing:1px;}
  .yk-banner7 .yk-b7-ph-slogan{font-size:12px;letter-spacing:2px;}
  .yk-banner7 .yk-b7-notice{font-size:12px;padding:8px 12px;}
}
</style>
<div class="yk-banner7">
  <div class="yk-b7-grid">
    <?php if (!empty($b7_list)) { ?>
      <?php foreach ($b7_list as $b7_k => $b7_it) { ?>
      <a class="yk-b7-cell<?php echo $b7_k === 0 ? ' yk-b7-big' : ''; ?>"<?php echo $b7_it['url'] !== '' ? ' href="'.e($b7_it['url']).'"' : ''; ?>>
        <img src="<?php echo e($b7_it['img']); ?>" alt="<?php echo e(site_config('company_name','')); ?>">
      </a>
      <?php } ?>
    <?php } else { ?>
    <div class="yk-b7-ph">
      <div class="yk-b7-ph-name"><?php echo e(site_config('company_name','炎酷CMS')); ?></div>
      <div class="yk-b7-ph-slogan"><?php echo e(site_config('slogan','专注品质 · 用心服务')); ?></div>
    </div>
    <?php } ?>
  </div>
  <?php if ($b7_notice !== '') { ?>
  <div class="yk-b7-notice"><span class="yk-b7-tag">公告</span><span class="yk-b7-text"><?php echo e($b7_notice); ?></span></div>
  <?php } ?>
</div>
