<style type="text/css">
@media screen and (min-width: 721px) {
.main{ padding: 1in }
.main .form{ width: 4in; margin: 0mm auto }
.main .form span{ width: 1in; border-right: var(--bd); background-color: var(--bg); line-height: 1cm; text-align: right; padding-right: 2mm }
.main .form p{ margin: 0mm 0mm 0mm 3cm; padding: 2mm }
}
@media screen and (max-width: 720px){
.main .bd{ border-left: none; border-right: none }
.form .fl{ padding: 1vw 2vw; border-right: var(--bd); background-color: #eee; width: 20vw; height: 6vw }
.form p{ border-left: var(--bd); padding: 1vw 2vw; margin: 0mm 0mm 0mm 24vw; height: 6vw }
.form p *{ border: none; width: 100%; vertical-align: middle; outline: none; font: 4vw/6vw arial }
.form p textarea{ height: 20vw }
.main .tc input{ font: 4vw/6vw arial; padding: 1vw 4vw }
}
</style>
<div class="pos mt bd"><a href="."><%= sys.name %></a> → 新用户注册</div>
<div class="mt bd">
	<div class="cap tc">请输入您的用户名、密码注册</div>
	<div class="main">
		<div class="form bd">
			<div>
				<span class="fl">用户名：</span>
				<p><input name="user" placeholder="您的昵称/用户名" /></p>
			</div>
			<div style="border-top: var(--bd)">
				<span class="fl">密码：</span>
				<p><input name="pass" type="password" placeholder="用于登录的密码" /></p>
			</div>
			<div style="border-top: var(--bd)">
				<span class="fl">确认密码：</span>
				<p><input name="pass2" type="password" placeholder="请再次输入密码" /></p>
			</div>
		</div>
		<p class="tc"><input type="button" value=" 注  册 " /></p>
	</div>
</div>
<script type="text/javascript">
var ipt = document.querySelectorAll(".main input");
ipt[3].onclick = function() {
	if(!ipt[0].value) return alert("请输入用户名");
	if(!ipt[1].value) return alert("请输入密码");
	if(ipt[1].value != ipt[2].value) return alert("两次密码不一致密码");
	post("?r=api/register", {
		user: ipt[0].value, pass: ipt[1].value
	}, function(res) {
		if(res.err) return alert(res.err);
		alert(res.msg);
		location.assign(".");
	});
};
</script>