<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
	<meta http-equiv="Cache-Control" content="no-transform" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover, shrink-to-fit=no" />
	<meta name="renderer" content="webkit">
	<meta name="format-detection" content="telephone=no" />
	<meta name="format-detection" content="email=no" />

	<meta name="description" itemprop="description" content="<?php echo LNG('common.copyright.desc');?>" />
	<meta name="keywords" content="<?php echo LNG('common.copyright.metaKeywords');?>" />
	<meta name="generator" content="<?php echo LNG('common.copyright.metaName').' '.KOD_VERSION;?>"/>
	<meta name="author" content="<?php echo LNG('common.copyright.name');?>" />
	<meta name="copyright" content="<?php echo LNG('common.copyright.name');?>" />
	<title><?php echo LNG('title').LNG('common.copyright.name')." - ".LNG('common.copyright.powerBy');?></title>
	
	<link href="<?php echo APP_HOST;?>index.php?user/view/manifest" rel="manifest" />
	<meta itemprop="image" content="<?php linkHref('images/icon/icon_512.png');?>" />
	<link head-type='kod' href="<?php linkHref('images/icon/icon_512.png');?>" rel="apple-touch-icon"/>
	<link head-type='kod' href="<?php linkHref('images/icon/fav.png');?>" rel="Shortcut Icon" type="image/x-icon" />
	<link head-type='kod' href="<?php linkHref('images/icon/fav.png');?>" rel="icon" type="image/x-icon" />
	
	<!-- <meta name="theme-color" content="#1b6de1" /> -->
	<meta name="apple-touch-fullscreen" content="yes" />
	<meta name="apple-mobile-web-app-capable" content="yes" />
	<meta name="apple-mobile-web-app-status-bar-style" content="default" />
	<meta name="apple-mobile-web-app-title" content="<?php echo LNG('common.copyright.metaName');?>" />
	<meta name="browsermode" content="application" />
	<meta name="full-screen" content="yes" />
	<meta name="x5-page-mode" content="app" />
	<meta name="x5-fullscreen" content="true" />
	<?php Hook::trigger('templateCommonHeader');?>
</head>

<body>
	<?php Hook::trigger('templateCommonContent');?>
	<div id="app"></div>
	
	<style>
		.bg-black{background:#333;}
		.loading-body div{
			position:fixed;margin:auto;left:0;top:0;right:0;bottom:0;max-width:64px;
			max-height:64px;width:64px;border-radius:4px;opacity:0.8;background-size: contain;
			background-image:url("<?php linkHref('images/common/loading-page.gif');?>");
		}
		.bg-black .loading-body div,.dark-mode .loading-body div{
			width:36px;height:36px;
			background-image:url("<?php linkHref('images/common/loading-pin3-dark.gif');?>");
		}
	</style>
	<div class="loading-body"><div></div></div>
	<script type="text/javascript">
		window.API_HOST = "<?php echo appHostGet();?>";
		window.STATIC_PATH = "<?php echo STATIC_PATH;?>";
        if(navigator.serviceWorker){
			navigator.serviceWorker.register('<?php echo APP_HOST;?>?user/view/manifestJS');
		}
		var isDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
		var theTheme = "<?php echo Model('userOption')->get('theme');?>";
		var darkMode = theTheme == 'dark-mode' ? true: (theTheme == 'auto' && isDark); 
		if(darkMode){document.getElementsByTagName('body')[0].setAttribute("class","bg-black");}
	</script>
	
	<link href="<?php linkHref('style/lib/main.css');?>" rel="stylesheet" />
	<link href="<?php linkHref('style/dist/main.css');?>" rel='stylesheet' />
	<script src="<?php linkHref('app/vender/es3-profill.js');?>"></script>
	<script src="<?php linkHref('app/dist/vendor.js');?>"></script>
	<script src="<?php linkHref('app/dist/main.js');?>"></script>
	<?php Hook::trigger('templateCommonFooter');?>
</body>
</html>