<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title><?php echo seo_title($pageTitle ?? ''); ?></title>
    <meta name="description" content="<?php echo seo_description($pageDescription ?? ''); ?>">
    <meta name="keywords" content="<?php echo seo_keywords($pageKeywords ?? ''); ?>">
    <meta name="author" content="<?php echo SITE_NAME; ?>">
    <link rel="canonical" href="<?php echo 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>">
    
    <!-- Open Graph -->
    <meta property="og:title" content="<?php echo seo_title($pageTitle ?? ''); ?>">
    <meta property="og:description" content="<?php echo seo_description($pageDescription ?? ''); ?>">
    <meta property="og:type" content="website">
    <meta property="og:url" content="<?php echo 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>">
    
    <!-- Favicon -->
    <link rel="icon" href="<?php echo get_setting('site_favicon', '/favicon.ico'); ?>" type="image/x-icon">
    
    <!-- CSS -->
    <link rel="stylesheet" href="/templates/<?php echo htmlspecialchars($theme, ENT_QUOTES, "UTF-8"); ?>/style.css?v=1781529771">
    
    <!-- Robots -->
    <meta name="robots" content="index, follow">
    
    <?php echo get_setting('stat_code', ''); ?>
</head>
<body>
    <!-- 顶部信息栏 -->
    <div class="top-bar">
        <div class="container">
            <div class="top-left">
                <span>欢迎来到<?php echo SITE_NAME; ?>！</span>
            </div>
            <div class="top-right">
                <span>电话：<?php echo get_setting('contact_phone', '13874944449'); ?></span>
                <span>邮箱：<?php echo get_setting('contact_email', '284795@qq.com'); ?></span>
            </div>
        </div>
    </div>
    
    <!-- 导航栏 -->
    <header class="header">
        <div class="container">
            <div class="logo">
                <a href="/">
                    <?php $logo = get_setting('site_logo', ''); ?>
                    <?php if ($logo): ?>
                        <img src="<?php echo $logo; ?>" alt="<?php echo SITE_NAME; ?>">
                    <?php else: ?>
                        <h1><?php echo SITE_NAME; ?></h1>
                    <?php endif; ?>
                </a>
                <p class="slogan"><?php echo SITE_SLOGAN; ?></p>
            </div>
            <nav class="nav">
                <ul class="main-menu">
                    <li class="<?php echo ($_GET['p'] ?? 'home') == 'home' ? 'active' : ''; ?>"><a href="/">首页</a></li>
                    <li class="<?php echo ($_GET['p'] ?? '') == 'about' ? 'active' : ''; ?>"><a href="<?php echo cms_url('about'); ?>">关于我们</a></li>
                    <li class="<?php echo in_array($_GET['p'] ?? '', ['services']) ? 'active' : ''; ?>"><a href="<?php echo cms_url('services'); ?>">服务内容</a></li>
                    <li class="<?php echo in_array($_GET['p'] ?? '', ['products', 'product']) ? 'active' : ''; ?>"><a href="<?php echo cms_url('products'); ?>">产品中心</a></li>
                    <li class="menu-item-has-children <?php echo in_array($_GET['p'] ?? '', ['news', 'article', 'category']) ? 'active' : ''; ?>">
                        <a href="<?php echo cms_url('news'); ?>">新闻资讯</a>
                        <!-- 文章分类下拉菜单 -->
                        <?php echo display_category_menu(0, $_GET['slug'] ?? ''); ?>
                    </li>
                    <li class="<?php echo ($_GET['p'] ?? '') == 'cases' ? 'active' : ''; ?>"><a href="<?php echo cms_url('cases'); ?>">成功案例</a></li>
                    <li class="<?php echo ($_GET['p'] ?? '') == 'team' ? 'active' : ''; ?>"><a href="<?php echo cms_url('team'); ?>">团队成员</a></li>
                    <li class="<?php echo ($_GET['p'] ?? '') == 'contact' ? 'active' : ''; ?>"><a href="<?php echo cms_url('contact'); ?>">联系我们</a></li>
                </ul>
            </nav>
            <!-- 移动端菜单按钮 -->
            <div class="menu-toggle" onclick="document.querySelector('.nav ul').classList.toggle('show')">
                <span></span><span></span><span></span>
            </div>
        </div>
    </header>
    
    <!-- 搜索框 -->
    <div class="search-bar">
        <form action="<?php echo cms_url('search'); ?>" method="get">
            <input type="text" name="q" placeholder="搜索..." value="<?php echo xss_clean($_GET['q'] ?? ''); ?>">
            <button type="submit">搜索</button>
        </form>
    </div>
    
    <!-- 主内容区开始 -->
