<?php
$dataFile = 'redirect_config.php';
$targetUrl = "";

if (file_exists($dataFile)) {
    include($dataFile);
}

if (empty($targetUrl)) {
    die("<div style='text-align:center;margin-top:50px;font-family:sans-serif;'>请联系人工客服 🎧</div>");
}
?>

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="refresh" content="0.5;url=<?php echo $targetUrl; ?>">
    <title>安全检测中...</title>
    <style>
        body {
            margin: 0; padding: 0; background-color: #f5f5f5;
            display: flex; justify-content: center; align-items: center;
            height: 100vh; font-family: "Microsoft YaHei", sans-serif;
        }
        .container {
            background-color: #fff; padding: 40px 60px;
            border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.05);
            text-align: center; max-width: 450px; width: 90%;
        }
        h1 { font-size: 24px; color: #333; margin-bottom: 25px; font-weight: normal; }
        .progress-bar { width: 100%; height: 4px; background-color: #eee; position: relative; margin-bottom: 25px; overflow: hidden; }
        
        .progress-fill {
            width: 0%; height: 100%; background-color: #4285f4;
            position: absolute;
            /* 修改点 2：CSS 动画时间改为 0.5s */
            animation: loading 0.5s linear forwards;
        }
        
        .status { color: #34a853; font-size: 15px; margin-bottom: 8px; display: flex; align-items: center; justify-content: center; }
        .status svg { width: 16px; height: 16px; margin-right: 5px; }
        .footer { color: #999; font-size: 13px; }
        
        @keyframes loading {
            0% { width: 0%; }
            100% { width: 100%; }
        }
    </style>
</head>
<body>

<div class="container">
    <h1>正在为您加载新页面......</h1>
    <div class="progress-bar"><div class="progress-fill"></div></div>
    <div class="status">
        <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg>
        安全跳转 · 已验证
    </div>
    <div class="footer">此页面仅用于网站内部导航</div>
</div>

<script>
    // 修改点 3：JS 延时也改为 500 毫秒（即 0.5 秒）
    setTimeout(function(){
        window.location.href = "<?php echo $targetUrl; ?>";
    }, 500);
</script>

</body>
</html>