<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="default">
    <meta name="theme-color" content="<?php echo $themeConfig['primary_color']; ?>">
    <title><?php echo Setting::getTitle($title ?? ''); ?></title>
    
    <!-- 主题颜色变量 -->
    <style>
        :root {
            --primary-color: <?php echo $themeConfig['primary_color']; ?>;
            --primary-light: <?php echo $themeConfig['primary_light']; ?>;
            --secondary-color: <?php echo $themeConfig['secondary_color']; ?>;
            --accent-color: <?php echo $themeConfig['accent_color']; ?>;
            --background-color: <?php echo $themeConfig['background_color']; ?>;
            --card-color: <?php echo $themeConfig['card_color']; ?>;
            --text-color: <?php echo $themeConfig['text_color']; ?>;
            --text-secondary-color: <?php echo $themeConfig['text_secondary_color']; ?>;
            --border-color: <?php echo $themeConfig['border_color']; ?>;
            --success-color: <?php echo $themeConfig['success_color']; ?>;
            --danger-color: <?php echo $themeConfig['danger_color']; ?>;
            --warning-color: <?php echo $themeConfig['warning_color']; ?>;
        }
    </style>
    
    <!-- 样式文件 -->
    <link rel="stylesheet" href="/static/css/mobile-app.css">
    <link rel="stylesheet" href="<?php echo $this->themeUrl(); ?>/css/video-player.css">
    <link rel="stylesheet" href="<?php echo $this->themeUrl(); ?>/css/app-layout.css">
    <link rel="stylesheet" href="<?php echo $this->themeUrl(); ?>/css/app-auth.css">
    <link rel="stylesheet" href="<?php echo $this->themeUrl(); ?>/css/app-selector.css">
    <link rel="stylesheet" href="<?php echo $this->themeUrl(); ?>/css/dialog.css">
    
    <!-- JavaScript 文件 -->
    <script src="https://code.iconify.design/3/3.1.0/iconify.min.js"></script>
    <script src="<?php echo $this->themeUrl(); ?>/app/js/utils.js"></script>
    <script src="<?php echo $this->themeUrl(); ?>/app/js/post-actions.js"></script>
    <script src="<?php echo $this->themeUrl(); ?>/app/js/post-card.js"></script>
    
    <!-- 全局登录状态变量 -->
    <script>
        window.LOGGED_IN = <?php echo $isLoggedIn ? 'true' : 'false'; ?>;
        window.USER_ID = <?php echo isset($userId) ? intval($userId) : 'null'; ?>;
        
        // 全局登录检查函数
        function checkLogin() {
            return window.LOGGED_IN === true;
        }
        
        // 自动打开登录弹窗
        <?php if (!empty($showLoginModal)): ?>
        document.addEventListener('DOMContentLoaded', function() {
            openModal('loginModal');
        });
        <?php endif; ?>
    </script>
</head>