<?php
// article_2.html 文章模块·样式2：纯文字日期列表（标题左、日期右）
// 可用变量：$title_text $title_style $title_color（block_title_html 输出标题）
//          $data_list 文章数组(id/title/thumb/desc/add_time/views/url)
//          $show_thumb $show_desc $show_time 开关；$col_id >0 时输出"更多"链接
if (!isset($data_list) || !is_array($data_list)) { $data_list = array(); }
$at2_title  = isset($title_text) ? $title_text : '';
$at2_tstyle = isset($title_style) ? (int)$title_style : 2;
$at2_tcolor = isset($title_color) ? $title_color : '';
$at2_col    = isset($col_id) ? (int)$col_id : 0;
$at2_time   = !isset($show_time) || $show_time;
?>
<style>
.yk-at2{margin-bottom:20px;}
.yk-at2 .yk-at2-head{display:flex;align-items:center;justify-content:space-between;}
.yk-at2 .yk-at2-head .yk-tt{margin:25px 0 15px;}
.yk-at2 .yk-at2-more{font-size:13px;color:#999;flex:none;}
.yk-at2 .yk-at2-more:hover{color:#1a5fb4;}
.yk-at2 .yk-at2-empty{background:#fff;border-radius:6px;padding:40px 0;text-align:center;color:#999;font-size:14px;}
.yk-at2 .yk-at2-list{background:#fff;border-radius:8px;box-shadow:0 1px 4px rgba(0,0,0,.05);padding:4px 26px;}
.yk-at2 .yk-at2-row{display:flex;align-items:center;gap:18px;padding:15px 0;border-bottom:1px dashed #ececec;}
.yk-at2 .yk-at2-row:last-child{border-bottom:none;}
.yk-at2 .yk-at2-tt{flex:1;min-width:0;font-size:15px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;position:relative;padding-left:18px;transition:color .2s;}
.yk-at2 .yk-at2-tt::before{content:"";position:absolute;left:0;top:50%;margin-top:-4px;width:8px;height:8px;border-radius:50%;border:2px solid #1a5fb4;transition:background .2s;}
.yk-at2 .yk-at2-row:hover .yk-at2-tt{color:#1a5fb4;}
.yk-at2 .yk-at2-row:hover .yk-at2-tt::before{background:#1a5fb4;}
.yk-at2 .yk-at2-date{flex:none;color:#999;font-size:13px;font-variant-numeric:tabular-nums;}
@media (max-width:1199px){
  .yk-at2 .yk-at2-list{padding:4px 20px;}
}
@media (max-width:767px){
  .yk-at2 .yk-at2-list{padding:2px 14px;}
  .yk-at2 .yk-at2-row{padding:12px 0;gap:10px;}
  .yk-at2 .yk-at2-tt{font-size:14px;}
  .yk-at2 .yk-at2-date{font-size:12px;}
}
</style>
<div class="yk-at2">
<div class="yk-wrap">
  <div class="yk-at2-head">
    <?php echo block_title_html($at2_title, $at2_tstyle, $at2_tcolor); ?>
    <?php if ($at2_col > 0) { ?><a class="yk-at2-more" href="<?php echo e(url_col($at2_col)); ?>">更多 &gt;</a><?php } ?>
  </div>
  <?php if (empty($data_list)) { ?>
  <div class="yk-at2-empty">暂无内容</div>
  <?php } else { ?>
  <div class="yk-at2-list">
    <?php foreach ($data_list as $at2_row) {
      $at2_t  = isset($at2_row['title']) ? $at2_row['title'] : '';
      $at2_u  = isset($at2_row['url']) ? $at2_row['url'] : '#';
      $at2_ts = isset($at2_row['add_time']) ? (int)$at2_row['add_time'] : 0;
    ?>
    <div class="yk-at2-row">
      <a class="yk-at2-tt" href="<?php echo e($at2_u); ?>"><?php echo e($at2_t); ?></a>
      <?php if ($at2_time) { ?><span class="yk-at2-date"><?php echo e(fdate($at2_ts, 'Y-m-d')); ?></span><?php } ?>
    </div>
    <?php } ?>
  </div>
  <?php } ?>
</div>
</div>
