<?php
if (!defined('ROOT_PATH')) {
    define('ROOT_PATH', dirname(dirname(__DIR__)) . '/');
}

$premiumFile = ROOT_PATH . 'modules-premium/pro/order/public/pay.php';
if (!is_file($premiumFile)) {
    require_once ROOT_PATH . 'core/lib/license.php';
    require_once ROOT_PATH . 'core/lib/license_guard.php';
    require_once ROOT_PATH . 'core/lib/module_loader.php';
    $license = new \Core\Lib\License();
    if ($license->getLevel() > \Core\Lib\License::LEVEL_FREE) {
        $loader = new \Core\Lib\ModuleLoader($license);
        $loader->syncAuthorizedModules();
    }
}

if (is_file($premiumFile)) {
    require $premiumFile;
    return;
}
?>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>功能未开通</title>
<style>
body{margin:0;font-family:"Microsoft YaHei","PingFang SC",sans-serif;background:#f8fafc;color:#334155;}
.wrap{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:24px;}
.card{max-width:620px;width:100%;background:#fff;border:1px solid #fed7aa;border-radius:20px;box-shadow:0 20px 60px rgba(249,115,22,0.12);padding:40px 32px;text-align:center;}
.tag{display:inline-flex;align-items:center;padding:6px 12px;border-radius:999px;background:#fff7ed;color:#c2410c;border:1px solid #fdba74;font-size:12px;font-weight:700;}
.title{font-size:30px;color:#0f172a;margin:18px 0 10px;}
.desc{font-size:15px;line-height:1.9;color:#64748b;margin:0;}
.actions{margin-top:24px;display:flex;justify-content:center;gap:12px;flex-wrap:wrap;}
.btn{display:inline-flex;align-items:center;justify-content:center;padding:14px 24px;border-radius:12px;text-decoration:none;font-weight:700;}
.btn-primary{background:linear-gradient(135deg,#ea580c 0%,#dc2626 100%);color:#fff;box-shadow:0 14px 30px rgba(220,38,38,0.22);}
.btn-secondary{background:#fff;color:#374151;border:1px solid #e5e7eb;}
</style>
</head>
<body>
<div class="wrap">
    <div class="card">
        <div class="tag">需升级授权</div>
        <h1 class="title">支付功能未开通</h1>
        <p class="desc">当前站点未安装订单支付模块，免费版不包含支付能力。请升级授权后同步商业模块。</p>
        <div class="actions">
            <a class="btn btn-primary" href="http://www.yutoucms.cn/license-center/user.php?act=buy" target="_blank">立即升级</a>
            <a class="btn btn-secondary" href="/public/index.php?m=index">返回首页</a>
        </div>
    </div>
</div>
</body>
</html>
