<?php include __DIR__ . '/_bootstrap.php'; ?>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title><?php echo $seo_title ? $seo_title . ' - ' . $tplSiteName : $tplSiteName; ?></title>
    <meta name="keywords" content="<?php echo htmlspecialchars($seo_keywords); ?>">
    <meta name="description" content="<?php echo htmlspecialchars($seo_description); ?>">
    <link rel="stylesheet" href="<?php echo htmlspecialchars($tplTemplateDir); ?>css/style.css">
    <link rel="stylesheet" href="<?php echo htmlspecialchars($tplTemplateDir); ?>css/theme.css">
</head>
<body class="site-body <?php echo isset($page_class) ? $page_class : 'page-generic'; ?>">
<div class="site-shell">
    <header class="site-header">
        <div class="topbar">
            <div class="container topbar-inner">
                <p>欢迎访问 <?php echo htmlspecialchars($tplSiteName); ?></p>
                <div class="topbar-meta">
                    <span><?php echo htmlspecialchars(tplv(isset($siteConfig) ? $siteConfig : array(), 'site_phone', '')); ?></span>
                    <span><?php echo htmlspecialchars(tplv(isset($siteConfig) ? $siteConfig : array(), 'site_email', '')); ?></span>
                </div>
            </div>
        </div>
        <div class="container nav-wrap">
            <a class="brand" href="<?php echo getUrl('home'); ?>">
                <?php if ($tplSiteLogo !== '') { ?>
                <span class="brand-logo"><img src="<?php echo htmlspecialchars($tplSiteLogo); ?>" alt="<?php echo htmlspecialchars($tplSiteName); ?>"></span>
                <?php } else { ?>
                <span class="brand-mark">YT</span>
                <?php } ?>
                <span class="brand-text">
                    <strong><?php echo htmlspecialchars($tplSiteName); ?></strong>
                    <em><?php echo htmlspecialchars(tplv(isset($siteConfig) ? $siteConfig : array(), 'site_title', '企业CMS系统')); ?></em>
                </span>
            </a>
            <button class="menu-toggle" type="button" aria-label="切换菜单">☰</button>
            <nav class="main-nav">
                <a href="<?php echo getUrl('home'); ?>">首页</a>
                <?php foreach ((isset($channels) && is_array($channels) ? $channels : array()) as $nav) { ?>
                <a href="<?php echo tpl_url('channel', $nav); ?>"><?php echo htmlspecialchars(tplv($nav, 'channel_name')); ?></a>
                <?php } ?>
                <a href="<?php echo getUrl('guestbook'); ?>">联系我们</a>
            </nav>
        </div>
    </header>
    <main class="page-main">
