<?php
// header_1.html 经典企业：顶部细信息条（电话/邮箱）+ 白底 LOGO 左、导航右
$h1_nav = isset($nav) && is_array($nav) ? $nav : array();
$h1_active = isset($active) ? (string)$active : 'home';
$h1_logo = trim(site_config('logo', ''));
$h1_name = site_config('company_name', '炎酷CMS');
$h1_phone = site_config('phone', '');
$h1_email = site_config('email', '');
?>
<style>
.yk-header1{background:var(--yk-nav-bg,#fff);box-shadow:0 2px 8px rgba(0,0,0,.06);position:relative;z-index:50}
.yk-h1-topbar{background:#f5f6f8;border-bottom:1px solid #e8eaee;font-size:12px;color:#777}
.yk-h1-topbar-in{max-width:1200px;margin:0 auto;padding:6px 20px;display:flex;justify-content:space-between;align-items:center}
.yk-h1-topbar a{color:#777;text-decoration:none}
.yk-h1-topbar a:hover{color:#1a5fb4}
.yk-h1-main{max-width:1200px;margin:0 auto;padding:0 20px;height:78px;display:flex;align-items:center;justify-content:space-between}
.yk-h1-logo{display:flex;align-items:center;text-decoration:none;flex:none}
.yk-h1-logo img{max-height:48px;max-width:200px;display:block}
.yk-h1-logo .yk-h1-name{font-size:24px;font-weight:700;color:#1a5fb4;letter-spacing:1px}
.yk-h1-right{display:flex;align-items:center;gap:28px}
.yk-header1 .yk-nav{display:flex;align-items:center;list-style:none;margin:0;padding:0}
.yk-header1 .yk-nav li{margin:0}
.yk-header1 .yk-nav a{display:block;padding:0 18px;height:78px;line-height:78px;font-size:15px;color:var(--yk-nav-color,#333);text-decoration:none;transition:color .2s,background .2s}
.yk-header1 .yk-nav a:hover{color:var(--yk-nav-active,#1a5fb4)}
.yk-header1 .yk-nav a.on{color:var(--yk-nav-active,#fff);background:var(--yk-nav-active-bg,#1a5fb4)}
.yk-h1-phone{font-size:18px;font-weight:700;color:#1a5fb4;white-space:nowrap}
.yk-h1-phone small{display:block;font-size:11px;font-weight:400;color:#999;text-align:right}
.yk-header1 .yk-nav-toggle{display:none;background:none;border:1px solid #ddd;border-radius:4px;width:40px;height:36px;cursor:pointer;position:relative}
.yk-header1 .yk-nav-toggle span{display:block;width:20px;height:2px;background:var(--yk-nav-color,#333);margin:4px auto}
@media (max-width:1199px){
  .yk-h1-main{height:66px}
  .yk-header1 .yk-nav a{padding:0 12px;height:66px;line-height:66px;font-size:14px}
  .yk-h1-phone{display:none}
}
@media (max-width:767px){
  .yk-h1-topbar-in{padding:5px 14px;font-size:11px;flex-wrap:wrap;gap:2px 12px}
  .yk-h1-topbar-in span{min-width:0;word-break:break-all}
  .yk-h1-main{height:56px;padding:0 14px}
  .yk-h1-logo img{max-height:36px}
  .yk-h1-logo .yk-h1-name{font-size:19px}
  .yk-header1 .yk-nav-toggle{display:block}
  .yk-header1 .yk-nav{display:none;position:absolute;top:100%;left:0;right:0;background:var(--yk-nav-bg,#fff);flex-direction:column;align-items:stretch;border-top:1px solid #eee;box-shadow:0 6px 12px rgba(0,0,0,.08)}
  .yk-header1 .yk-nav.open{display:flex}
  .yk-header1 .yk-nav a{height:auto;line-height:1.5;padding:13px 20px;border-bottom:1px solid #f2f2f2}
  .yk-header1 .yk-nav a.on{background:var(--yk-nav-active-bg,#1a5fb4);color:#fff}
}
</style>
<header class="yk-header1">
  <div class="yk-h1-topbar">
    <div class="yk-h1-topbar-in">
      <span>欢迎访问<?php echo e($h1_name); ?>官方网站</span>
      <span>
        <?php if ($h1_phone !== '') { ?>电话：<a href="tel:<?php echo e($h1_phone); ?>"><?php echo e($h1_phone); ?></a><?php } ?>
        <?php if ($h1_email !== '') { ?>&nbsp;&nbsp;邮箱：<a href="mailto:<?php echo e($h1_email); ?>"><?php echo e($h1_email); ?></a><?php } ?>
      </span>
    </div>
  </div>
  <div class="yk-h1-main">
    <a class="yk-h1-logo" href="<?php echo e(url_home()); ?>">
      <?php if ($h1_logo !== '') { ?><img src="<?php echo e($h1_logo); ?>" alt="<?php echo e($h1_name); ?>"><?php } else { ?><span class="yk-h1-name"><?php echo e($h1_name); ?></span><?php } ?>
    </a>
    <div class="yk-h1-right">
      <ul class="yk-nav">
        <li><a href="<?php echo e(url_home()); ?>"<?php echo $h1_active === 'home' ? ' class="on"' : ''; ?>>首页</a></li>
        <?php foreach ($h1_nav as $h1_n) { ?>
        <li><a href="<?php echo e(isset($h1_n['url']) ? $h1_n['url'] : url_col(isset($h1_n['id']) ? $h1_n['id'] : 0)); ?>"<?php echo (isset($h1_n['key']) && $h1_n['key'] === $h1_active) ? ' class="on"' : ''; ?>><?php echo e(isset($h1_n['name']) ? $h1_n['name'] : ''); ?></a></li>
        <?php } ?>
      </ul>
      <button type="button" class="yk-nav-toggle" aria-label="菜单"><span></span><span></span><span></span></button>
    </div>
  </div>
</header>
