<?php
// art_1.html 文章内容页·样式1：居中窄栏经典排版
// 可用变量：$art 文章行(title/content/add_time/views)；$col 所属栏目(id/name，可为 null)
//          $prev $next 上一篇/下一篇(id/title 或 null)；$art['content'] 为管理员富文本，原样输出
$ar1       = isset($art) && is_array($art) ? $art : array();
$ar1_title = isset($ar1['title']) ? $ar1['title'] : '';
$ar1_cont  = isset($ar1['content']) ? $ar1['content'] : '';
$ar1_time  = isset($ar1['add_time']) ? (int)$ar1['add_time'] : 0;
$ar1_views = isset($ar1['views']) ? (int)$ar1['views'] : 0;
$ar1_col   = isset($col) && is_array($col) ? $col : null;
$ar1_prev  = isset($prev) && is_array($prev) ? $prev : null;
$ar1_next  = isset($next) && is_array($next) ? $next : null;
?>
<style>
.yk-art1{width:calc(100% - 30px);max-width:1200px;margin:20px auto 44px;background:#fff;border-radius:10px;box-shadow:0 1px 4px rgba(0,0,0,.05);padding:38px 44px;}
.yk-art1 .yk-art1-crumb{font-size:13px;color:#999;margin-bottom:16px;}
.yk-art1 .yk-art1-crumb a{color:#999;}
.yk-art1 .yk-art1-crumb a:hover{color:var(--yk-accent,#e63946);}
.yk-art1 .yk-art1-title{font-size:26px;line-height:1.4;margin:0 0 12px;text-align:center;}
.yk-art1 .yk-art1-meta{text-align:center;font-size:13px;color:#999;padding-bottom:16px;border-bottom:1px solid #eee;margin-bottom:24px;}
.yk-art1 .yk-art1-meta span{margin:0 10px;}
.yk-art1 .yk-art1-body{font-size:16px;line-height:1.9;color:#333;word-wrap:break-word;}
.yk-art1 .yk-art1-body img{max-width:100%;height:auto;}
.yk-art1 .yk-art1-body p{margin:0 0 1em;}
.yk-art1 .yk-art1-pn{margin-top:34px;padding-top:16px;border-top:1px solid #eee;font-size:14px;}
.yk-art1 .yk-art1-pn p{margin:8px 0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.yk-art1 .yk-art1-pn a{color:#333;}
.yk-art1 .yk-art1-pn a:hover{color:var(--yk-accent,#e63946);}
.yk-art1 .yk-art1-pn .yk-art1-none{color:#bbb;}
@media (max-width:767px){
  .yk-art1{padding:24px 20px 28px;}
  .yk-art1 .yk-art1-title{font-size:20px;}
  .yk-art1 .yk-art1-body{font-size:15px;line-height:1.8;}
  .yk-art1 .yk-art1-meta span{margin:0 6px;}
}
</style>
<div class="yk-art1">
  <div class="yk-art1-crumb">
    <a href="<?php echo e(url_home()); ?>">首页</a>
    <?php if ($ar1_col && isset($ar1_col['id'])) { ?> &gt; <a href="<?php echo e(url_col($ar1_col['id'])); ?>"><?php echo e(isset($ar1_col['name']) ? $ar1_col['name'] : ''); ?></a><?php } ?>
    &gt; <span>正文</span>
  </div>
  <h1 class="yk-art1-title"><?php echo e($ar1_title); ?></h1>
  <div class="yk-art1-meta">
    <?php if ($ar1_col && isset($ar1_col['name'])) { ?><span>栏目：<?php echo e($ar1_col['name']); ?></span><?php } ?>
    <span>时间：<?php echo e(fdate($ar1_time, 'Y-m-d')); ?></span>
    <span>阅读：<?php echo $ar1_views; ?></span>
  </div>
  <div class="yk-art1-body"><?php echo $ar1_cont; /* 管理员富文本，原样输出 */ ?></div>
  <div class="yk-art1-pn">
    <p>上一篇：<?php if ($ar1_prev) { ?><a href="<?php echo e(url_art($ar1_prev['id'])); ?>"><?php echo e($ar1_prev['title']); ?></a><?php } else { ?><span class="yk-art1-none">没有了</span><?php } ?></p>
    <p>下一篇：<?php if ($ar1_next) { ?><a href="<?php echo e(url_art($ar1_next['id'])); ?>"><?php echo e($ar1_next['title']); ?></a><?php } else { ?><span class="yk-art1-none">没有了</span><?php } ?></p>
  </div>
</div>
