<?php
// list_5 新闻列表（日期方块 + 标题摘要 + 阅读量）
if (!isset($col) || !is_array($col)) { $col = array(); }
if (!isset($list) || !is_array($list)) { $list = array(); }
$lt5_name  = isset($col['name']) ? $col['name'] : '';
$lt5_intro = isset($col['intro']) ? $col['intro'] : '';
$lt5_cover = isset($col['cover']) ? $col['cover'] : '';
?>
<style>
.yk-list5{padding:20px 15px 40px;}
.yk-list5 .yk-l5-banner{position:relative;border-radius:6px;overflow:hidden;background:#3d1f1f center/cover no-repeat;margin-bottom:25px;padding:56px 30px;color:#fff;text-align:center;}
.yk-list5 .yk-l5-banner::before{content:"";position:absolute;inset:0;background:rgba(45,15,15,.55);}
.yk-list5 .yk-l5-banner-in{position:relative;z-index:1;}
.yk-list5 .yk-l5-crumb{font-size:13px;color:#999;margin-bottom:12px;}
.yk-list5 .yk-l5-banner .yk-l5-crumb{color:rgba(255,255,255,.8);}
.yk-list5 .yk-l5-crumb a{color:inherit;}
.yk-list5 .yk-l5-crumb a:hover{color:var(--yk-accent,#e63946);}
.yk-list5 .yk-l5-title{font-size:28px;font-weight:700;margin-bottom:10px;}
.yk-list5 .yk-l5-intro{font-size:14px;color:#777;max-width:760px;}
.yk-list5 .yk-l5-banner .yk-l5-intro{color:rgba(255,255,255,.85);margin:0 auto;}
.yk-list5 .yk-l5-head{background:#fff;border-radius:6px;padding:25px 30px;margin-bottom:25px;box-shadow:0 1px 4px rgba(0,0,0,.05);}
.yk-list5 .yk-l5-item{display:flex;gap:24px;background:#fff;border-radius:6px;box-shadow:0 1px 4px rgba(0,0,0,.05);padding:24px 28px;margin-bottom:16px;align-items:center;transition:box-shadow .2s;}
.yk-list5 .yk-l5-item:hover{box-shadow:0 5px 16px rgba(0,0,0,.1);}
.yk-list5 .yk-l5-date{flex:none;width:78px;height:78px;border-radius:8px;background:#f6f7f9;border:1px solid #eee;display:flex;flex-direction:column;align-items:center;justify-content:center;transition:all .2s;}
.yk-list5 .yk-l5-item:hover .yk-l5-date{background:var(--yk-accent,#e63946);border-color:var(--yk-accent,#e63946);}
.yk-list5 .yk-l5-day{font-size:28px;font-weight:700;line-height:1.1;color:#333;}
.yk-list5 .yk-l5-ym{font-size:12px;color:#999;margin-top:4px;}
.yk-list5 .yk-l5-item:hover .yk-l5-day,.yk-list5 .yk-l5-item:hover .yk-l5-ym{color:#fff;}
.yk-list5 .yk-l5-body{flex:1;min-width:0;}
.yk-list5 .yk-l5-tt{font-size:17px;font-weight:700;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.yk-list5 .yk-l5-tt:hover{color:var(--yk-accent,#e63946);}
.yk-list5 .yk-l5-top{display:inline-block;background:var(--yk-accent,#e63946);color:#fff;font-size:12px;padding:1px 8px;border-radius:3px;margin-right:8px;vertical-align:2px;}
.yk-list5 .yk-l5-desc{color:#777;font-size:13px;margin-top:8px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
.yk-list5 .yk-l5-views{flex:none;text-align:center;color:#999;font-size:12px;width:70px;border-left:1px dashed #e5e5e5;padding-left:18px;}
.yk-list5 .yk-l5-vnum{display:block;font-size:20px;font-weight:700;color:#555;}
.yk-list5 .yk-l5-empty{background:#fff;border-radius:6px;text-align:center;color:#999;padding:70px 0;font-size:14px;}
@media (max-width:1199px){
  .yk-list5 .yk-l5-title{font-size:24px;}
  .yk-list5 .yk-l5-date{width:70px;height:70px;}
}
@media (max-width:767px){
  .yk-list5 .yk-l5-item{gap:14px;padding:16px;}
  .yk-list5 .yk-l5-date{width:58px;height:58px;}
  .yk-list5 .yk-l5-day{font-size:20px;}
  .yk-list5 .yk-l5-views{display:none;}
  .yk-list5 .yk-l5-tt{font-size:15px;white-space:normal;}
  .yk-list5 .yk-l5-banner{padding:38px 18px;}
  .yk-list5 .yk-l5-title{font-size:20px;}
}
</style>
<div class="yk-wrap yk-list5">
  <?php if ($lt5_cover !== '') { ?>
  <div class="yk-l5-banner" style="background-image:url('<?php echo e($lt5_cover); ?>')">
    <div class="yk-l5-banner-in">
      <div class="yk-l5-crumb"><a href="<?php echo e(url_home()); ?>">首页</a> &gt; <span><?php echo e($lt5_name); ?></span></div>
      <div class="yk-l5-title"><?php echo e($lt5_name); ?></div>
      <?php if ($lt5_intro !== '') { ?><div class="yk-l5-intro"><?php echo e($lt5_intro); ?></div><?php } ?>
    </div>
  </div>
  <?php } else { ?>
  <div class="yk-l5-head">
    <div class="yk-l5-crumb"><a href="<?php echo e(url_home()); ?>">首页</a> &gt; <span><?php echo e($lt5_name); ?></span></div>
    <div class="yk-l5-title"><?php echo e($lt5_name); ?></div>
    <?php if ($lt5_intro !== '') { ?><div class="yk-l5-intro"><?php echo e($lt5_intro); ?></div><?php } ?>
  </div>
  <?php } ?>
  <?php if (!empty($list)) { ?>
    <?php foreach ($list as $lt5_it) {
      $lt5_t  = isset($lt5_it['title']) ? $lt5_it['title'] : '';
      $lt5_u  = isset($lt5_it['url']) ? $lt5_it['url'] : '#';
      $lt5_d  = isset($lt5_it['desc']) ? $lt5_it['desc'] : '';
      $lt5_dy = isset($lt5_it['add_time']) ? fdate($lt5_it['add_time'], 'd') : '';
      $lt5_ym = isset($lt5_it['add_time']) ? fdate($lt5_it['add_time'], 'Y-m') : '';
      $lt5_v  = isset($lt5_it['views']) ? (int)$lt5_it['views'] : 0;
    ?>
    <div class="yk-l5-item">
      <div class="yk-l5-date"><span class="yk-l5-day"><?php echo e($lt5_dy); ?></span><span class="yk-l5-ym"><?php echo e($lt5_ym); ?></span></div>
      <div class="yk-l5-body">
        <a class="yk-l5-tt" href="<?php echo e($lt5_u); ?>"><?php if (!empty($lt5_it['is_top'])) { ?><span class="yk-l5-top">置顶</span><?php } echo e($lt5_t); ?></a>
        <?php if ($lt5_d !== '') { ?><div class="yk-l5-desc"><?php echo e($lt5_d); ?></div><?php } ?>
      </div>
      <div class="yk-l5-views"><span class="yk-l5-vnum"><?php echo $lt5_v; ?></span>阅读量</div>
    </div>
    <?php } ?>
  <?php } else { ?>
    <div class="yk-l5-empty">暂无内容</div>
  <?php } ?>
  <?php echo isset($pager) ? $pager : ''; ?>
</div>
