<head>
<link href="http://jscache.miancp.com/Template/skin/concat5.css" rel="stylesheet"/>
<meta name=viewport content="initial-scale=1, maximum-scale=3, minimum-scale=1, user-scalable=no"/>
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-3.5.1.min.js"></script>
<style>
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: linear-gradient(135deg, #f0f4f8 0%, #d9e2ec 100%);
    color: #334155;
}
body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
#form {
    display: none;
}
.waf-container {
    width: 100%;
    max-width: 550px;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    padding: 42px 34px;
}
.waf-title {
    text-align: center;
    font-size: 22px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.waf-title-en {
    text-align: center;
    font-size:15px;
    color:#64748b;
    margin-bottom:18px;
}
.waf-desc {
    text-align: center;
    font-size: 14px;
    color: #64748b;
    line-height: 1.7;
    margin-bottom:10px;
}
.waf-desc-en {
    text-align: center;
    font-size:13px;
    color:#94a3b8;
    line-height:1.6;
    margin-bottom:12px;
}
.code {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}
#canvas {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    background: #f8fafc;
    transition: border-color 0.2s;
}
#canvas:hover {
    border-color: #cbd5e1;
}
.input-val {
    width: 100%;
    height: 44px;
    padding: 0 16px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    color: #1e293b;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.input-val::placeholder {
    color: #94a3b8;
}
.input-val:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.btn {
    width: 100%;
    height: 44px;
    border: none;
    border-radius: 8px;
    background: #3b82f6;
    color: #ffffff;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}
.btn:hover {
    background: #2563eb;
}
.btn:active {
    background: #1d4ed8;
}
.footer {
    margin-top: 32px;
    text-align: center;
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.9;
}
</style>
<title>WAF 安全防护系统 | WAF Security Protection System</title>
</head>
<body>
<form action="/sitemap.xml?_Y=35c71c07713034dd36589be26f37a009b1788264216_646018" id="form" method="post"></form>
<div class="waf-container">
    <h2 class="waf-title">WAF 安全防护系统</h2>
    <div class="waf-title-en">WAF Security Protection System</div>

    <p class="waf-desc">为保障网站程序安全，防止被黑或挂马，服务器禁止海外机房IP访问</p>
    <p class="waf-desc-en">To protect website security and prevent hacking, overseas datacenter IPs are restricted</p>

	<p class="waf-desc"><font color="red">正常海外家庭宽带,公司网络等可直接访问网站,无需验证</font></p>
    <p class="waf-desc-en"><font color="red">Overseas home broadband / corporate network can access directly without verification</font></p>

    <p class="waf-desc">您当前IP:<span id="client-ip">获取中...</span><font color="red">为机房IP，疑似使用代理</font><BR>需要对您身份鉴定后才能访问</p>
    <p class="waf-desc-en">Your IP:<span id="client-ip-en">Loading...</span><font color="red"> is datacenter IP, proxy suspected</font><br>Identity verification required for access</p>

    <div class="code">
        <canvas id="canvas" width="100" height="30"></canvas>
        <input type="text" value="" placeholder="请输入验证码（不区分大小写） / Enter captcha (case‑insensitive)" class="input-val"/>
        <button class="btn">提交 / Submit</button>
    </div>
    <div class="footer">
		© CDN 安全防护系统 / CDN Security Protection System
    </div>
</div>
<script>
$(function(){
        var show_num = [];
        draw(show_num);

        $("#canvas").on('click',function(){
            draw(show_num);
        })
        $(".btn").on('click',function(){
            var val = $(".input-val").val().toLowerCase();
            var num = show_num.join("");
            if(val==''){
                alert('请输入验证码！ / Please enter captcha!');
            }else if(val == num){
                alert('验证成功！ / Verification passed!');
                $(".input-val").val('');
               $('#form').submit();

            }else{
                alert('验证码错误！请重新输入！ / Captcha error! Please try again!');
                $(".input-val").val('');
            }
        })

    //生成并渲染出验证码图形
    function draw(show_num) {
        var canvas_width=$('#canvas').width();
        var canvas_height=$('#canvas').height();
        var canvas = document.getElementById("canvas");
        var context = canvas.getContext("2d");
        canvas.width = canvas_width;
        canvas.height = canvas_height;
        var sCode = "a,b,c,d,e,f,g,h,i,j,k,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,E,F,G,H,J,K,L,M,N,P,Q,R,S,T,W,X,Y,Z,1,2,3,4,5,6,7,8,9,0";
        var aCode = sCode.split(",");
        var aLength = aCode.length;

        for (var i = 0; i < 4; i++) {
            var j = Math.floor(Math.random() * aLength);
            var deg = Math.random() - 0.5;
            var txt = aCode[j];
            show_num[i] = txt.toLowerCase();
            var x = 10 + i * 20;
            var y = 20 + Math.random() * 8;
            context.font = "bold 23px 微软雅黑";

            context.translate(x, y);
            context.rotate(deg);

            context.fillStyle = randomColor();
            context.fillText(txt, 0, 0);

            context.rotate(-deg);
            context.translate(-x, -y);
        }
        for (var i = 0; i <= 5; i++) {
            context.strokeStyle = randomColor();
            context.beginPath();
            context.moveTo(Math.random() * canvas_width, Math.random() * canvas_height);
            context.lineTo(Math.random() * canvas_width, Math.random() * canvas_height);
            context.stroke();
        }
        for (var i = 0; i <= 30; i++) {
            context.strokeStyle = randomColor();
            context.beginPath();
            var x = Math.random() * canvas_width;
            var y = Math.random() * canvas_height;
            context.moveTo(x, y);
            context.lineTo(x + 1, y + 1);
            context.stroke();
        }
    }

    function randomColor() {
        var r = Math.floor(Math.random() * 256);
        var g = Math.floor(Math.random() * 256);
        var b = Math.floor(Math.random() * 256);
        return "rgb(" + r + "," + g + "," + b + ")";
    }

    var cacheBuster = "?t=<?php echo $full_cache_buster; ?>";
    fetch('http://ip.miancp.com/?format=json' + cacheBuster)
      .then(response => response.json())
      .then(data => {
        document.getElementById('client-ip').textContent = data.ip;
        document.getElementById('client-ip-en').textContent = data.ip;
      })
      .catch(error => {
        console.error('获取IP地址失败：', error);
        document.getElementById('client-ip').textContent = '获取失败';
        document.getElementById('client-ip-en').textContent = 'Get failed';
      });
})
</script>
</body>
</html>
