<?php
// banner_4 左图右公告组合
if (!isset($banner) || !is_array($banner)) { $banner = array('images'=>array(), 'notice'=>''); }
$b4_images = isset($banner['images']) && is_array($banner['images']) ? $banner['images'] : array();
$b4_img = ''; $b4_url = '';
foreach ($b4_images as $b4_im) { if (isset($b4_im['img']) && $b4_im['img'] !== '') { $b4_img = $b4_im['img']; $b4_url = isset($b4_im['url']) ? $b4_im['url'] : ''; break; } }
$b4_notice = isset($banner['notice']) ? $banner['notice'] : '';
?>
<style>
.yk-banner4{max-width:1200px;margin:0 auto;display:flex;gap:20px;align-items:stretch;}
.yk-banner4 .yk-b4-pic{flex:0 0 58%;height:280px;overflow:hidden;border-radius:4px;position:relative;display:block;}
.yk-banner4 .yk-b4-pic img{width:100%;height:100%;object-fit:cover;display:block;transition:transform .5s;}
.yk-banner4 .yk-b4-pic:hover img{transform:scale(1.04);}
.yk-banner4 .yk-b4-ph{width:100%;height:100%;background:linear-gradient(150deg,#0c5b4a 0%,#128a6b 55%,#3cc39a 100%);display:flex;align-items:center;justify-content:center;color:#fff;font-size:24px;font-weight:700;letter-spacing:3px;text-align:center;padding:0 16px;}
.yk-banner4 .yk-b4-side{flex:1;background:#f6faf8;border:1px solid #dcebe4;border-radius:4px;padding:22px 24px;display:flex;flex-direction:column;justify-content:center;}
.yk-banner4 .yk-b4-label{display:inline-block;background:#128a6b;color:#fff;font-size:12px;padding:3px 12px;border-radius:20px;margin-bottom:14px;align-self:flex-start;}
.yk-banner4 .yk-b4-title{font-size:20px;font-weight:700;color:#123c30;margin-bottom:10px;}
.yk-banner4 .yk-b4-notice{font-size:13px;color:#4c6a5f;line-height:1.9;}
@media (max-width:1199px){
  .yk-banner4{margin:0 16px;}
  .yk-banner4 .yk-b4-pic{height:220px;}
  .yk-banner4 .yk-b4-title{font-size:17px;}
}
@media (max-width:767px){
  .yk-banner4{margin:0 10px;flex-direction:column;gap:12px;}
  .yk-banner4 .yk-b4-pic{flex:none;height:160px;}
  .yk-banner4 .yk-b4-ph{font-size:17px;}
  .yk-banner4 .yk-b4-side{padding:14px;}
  .yk-banner4 .yk-b4-title{font-size:15px;}
  .yk-banner4 .yk-b4-notice{font-size:12px;}
}
</style>
<div class="yk-banner4">
  <?php if ($b4_img !== '') { ?>
    <?php if ($b4_url !== '') { ?><a class="yk-b4-pic" href="<?php echo e($b4_url); ?>"><?php } else { ?><div class="yk-b4-pic"><?php } ?>
      <img src="<?php echo e($b4_img); ?>" alt="<?php echo e(site_config('company_name','')); ?>">
    <?php if ($b4_url !== '') { ?></a><?php } else { ?></div><?php } ?>
  <?php } else { ?>
    <div class="yk-b4-pic"><div class="yk-b4-ph"><?php echo e(site_config('company_name','炎酷CMS')); ?></div></div>
  <?php } ?>
  <div class="yk-b4-side">
    <span class="yk-b4-label">站内公告</span>
    <div class="yk-b4-title"><?php echo e(site_config('slogan','以品质立足 · 以服务致远')); ?></div>
    <?php if ($b4_notice !== '') { ?><div class="yk-b4-notice"><?php echo e($b4_notice); ?></div><?php } ?>
  </div>
</div>
