<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <title>VPN 认证与提示系统</title>
    <meta charset='UTF-8'>
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <link rel="stylesheet" type="text/css" href="https://rucfd.ruc.edu.cn/css/bootstrap.css">
    <!-- 引入基础依赖 -->
    <script src="/public/static/js/jquery-3.5.1.min.js"></script>
    <script src="/public/static/layui/layui.js"></script>
    <script src="/public/static/dingding/ddLogin.js"></script>
    <script src="/public/static/weixin/wwLogin-1.2.5.js"></script>
    <link rel="stylesheet" type="text/css" href="/public/static/layui/css/layui.css">
    
    <style type="text/css">
        * {
            box-sizing: border-box;
        }
        body {
            background-color: #fafbfc;
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
            color: #333;
        }
        header {
            background-image: url(https://rucfd.ruc.edu.cn/imgs/line-bg.png);
            background-repeat: repeat;
            border-bottom: 1px solid #DFDFDF;
            background-color: #fff;
			padding:5px 0px;
        }
        header img {
            padding-top: 25px;
            padding-bottom: 25px;
        }
        main {
            text-align: center;
        }
        main img.hero-img {
			margin-top: 100px;
			max-width: 100%;
            transition: transform 0.3s ease;
        }
        main img.hero-img:hover {
            transform: scale(1.02);
        }
        .main-title {
            font-size: 24px;
            font-weight: 600;
            color: #2c3e50;
            margin-bottom: 35px;
        }
        .main-title span {
            font-weight: normal;
            font-size: 16px;
            color: #8c98a4;
            margin-left: 6px;
        }

        /* 统一卡片与布局 */
        .vpn-card-left, .vpn-card-right {
            padding: 10px 20px;
        }
        .card-header-title {
            font-size: 22px;
            font-weight: 700;
            color: #1f2937;
            margin-top: 0;
            margin-bottom: 8px;
        }
        .card-desc {
            color: #6b7280;
            font-size: 13px;
            line-height: 1.6;
            margin-bottom: 18px;
        }

        /* ========== WebVPN 登录卡片美化 ========== */
        .login-panel {
            <!-- background: #ffffff; -->
            <!-- border: 1px solid #eaedf1; -->
            <!-- border-radius: 14px; -->
            padding: 20px;
            <!-- box-shadow: 0 8px 24px rgba(149, 157, 165, 0.1); -->
            max-width: 330px;
            margin: 0 auto;
            position: relative;
        }

        /* Tab 胶囊切换栏 */
        .nav-tabs-pill {
            display: flex;
            background: #f1f5f9;
            border-radius: 10px;
            padding: 4px;
            margin-bottom: 18px;
            position: relative;
            flex-wrap: wrap;
            gap: 2px;
        }
        .tab-btn {
            flex: 1 1 auto;
            background: transparent;
            border: none;
            outline: none;
            padding: 7px 4px;
            font-size: 12px;
            font-weight: 500;
            color: #64748b;
            border-radius: 7px;
            cursor: pointer;
            transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
            user-select: none;
            position: relative;
            z-index: 2;
            white-space: nowrap;
        }
        .tab-btn:hover {
            color: #1e293b;
        }
        .tab-btn.active {
            background: #ffffff;
            color: #d75757;
            font-weight: 600;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
        }

        /* 表单输入控件美化 */
        .form-area {
            text-align: left;
            transition: opacity 0.2s ease;
        }
        .input-block {
            margin-bottom: 12px;
            position: relative;
        }
        .input-block input {
            width: 100%;
            height: 38px;
            padding: 8px 12px;
            background-color: #f8fafc;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            font-size: 13px;
            color: #334155;
            outline: none;
            transition: all 0.2s ease;
        }
        .input-block input:focus {
            background-color: #ffffff;
            border-color: #d75757;
            box-shadow: 0 0 0 3px rgba(215, 87, 87, 0.12);
        }

        /* 验证码组合行 */
        .captcha-row {
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .captcha-row input {
            flex: 1;
        }
        .captcha-img-holder {
            width: 92px;
            height: 38px;
            border-radius: 8px;
            overflow: hidden;
            border: 1px solid #e2e8f0;
            cursor: pointer;
            flex-shrink: 0;
            background: #fff;
        }
        .captcha-img-holder img {
            width: 100%;
            height: 100%;
            margin: 0 !important;
            display: block;
        }

        /* 操作按钮 */
        .btn-theme {
            background: linear-gradient(135deg, #e06060 0%, #d75757 100%);
            color: #ffffff;
            font-size: 14px;
            font-weight: 600;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.25s ease;
            box-shadow: 0 4px 12px rgba(215, 87, 87, 0.25);
        }
        .btn-theme:hover {
            background: linear-gradient(135deg, #d34a4a 0%, #c44040 100%);
            box-shadow: 0 6px 16px rgba(215, 87, 87, 0.35);
            color: #fff;
            transform: translateY(-1px);
        }
        .btn-theme:active {
            transform: translateY(0);
        }
        .btn-block-action {
            width: 55%;
            height: 40px;
            line-height: 40px;
            padding: 0;
            margin-top: 4px;
        }

        /* CAS 视图区 */
        .cas-view {
            display: none;
            padding: 10px 5px;
            text-align: center;
            animation: fadeIn 0.25s ease;
        }
        .cas-icon {
            width: 50px;
            height: 50px;
            line-height: 50px;
            border-radius: 50%;
            background: #fef2f2;
            color: #d75757;
            font-size: 22px;
            margin: 5px auto 14px auto;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .cas-desc {
            font-size: 13px;
            color: #64748b;
            line-height: 1.5;
            margin-bottom: 20px;
        }

        /* 扫码区域样式 */
        .qr-view {
            display: none;
            padding: 10px 0;
            text-align: center;
            align-items: center;
            justify-content: center;
            min-height: 220px;
            animation: fadeIn 0.25s ease;
            overflow: hidden;
        }
        /* 避免第三方扫码组件尺寸过大撑破卡片 */
        #wx_reg iframe, #dingding iframe {
            max-width: 100% !important;
            margin: 0 auto;
            border: none;
        }

        /* 右侧 RVPN 保留并轻量精致化 */
        .rvpn-panel {
            padding: 0 20px 25px 20px;
            height: 100%;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
        }
		h4{
			padding: 0px 0px 25px 0px;
		}
        .cas-desc{
            padding: 27px 0px;
            color: #666;
            font-size: 14px;
            line-height: 1.7;
            margin-bottom: 26px;
        }
        .rvpn-panel p {
			padding: 14px 0px;
			color: #666;
			font-size: 14px;
			line-height: 1.7;
			margin-bottom: 24px;
        }
        .rvpn-panel p i {
            <!-- color: #d75757; -->
            font-size: 15px;
            font-style: normal;
            font-weight: 600;
        }
        .btn-rvpn {
            padding: 10px 28px;
            display: inline-block;
            text-decoration: none;
        }
        .btn-rvpn a {
            color: #fff;
            text-decoration: none;
        }

        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(4px); }
            to { opacity: 1; transform: translateY(0); }
        }
		
		/* 卡片头部 */
        .card-header-bar {
            display: flex;
            align-items: center;
            justify-content: space-around;
            margin-bottom: 15px;
        }
        .card-header-title {
            font-size: 20px;
            font-weight: 700;
            color: #111827;
            margin: 0;
        }
        .mode-badge {
            font-size: 11px;
            font-weight: 600;
            padding: 3px 8px;
            border-radius: 20px;
            background: #fee2e2;
            color: #d75757;
        }
        .mode-badge.gray {
            background: #f3f4f6;
            color: #4b5563;
        }
		
		.wx_reg iframe{
			height: 260px !important;
		}
		.impowerBox .qrcode {
			width: 80% !important;
		}
    </style>
</head>
<body>

<header>
    <div class="container">
        <div class="row">
            <div class="col-sm-12 text-left">
                <img src="https://rucfd.ruc.edu.cn/imgs/10001_252302_logo.png" alt="学校 Logo">
            </div>
        </div>
    </div>
</header>

<main>
    <div class="container">
        <div class="row" style="padding: 60px 0 80px 0;">
            <!-- 左侧插画 -->
            <div class="col-sm-6 text-center" style="display: flex; align-items: center; justify-content: center;">
                <img src="https://rucfd.ruc.edu.cn/imgs/img.png" class="hero-img" alt="VPN 图解">
            </div>

            <!-- 右侧整体入口 -->
            <div class="col-sm-6">
                <div class="main-title">
                    请先登录VPN系统 <span>( 根据需要任选一种 )</span>
                </div>
                
                <div class="row">
                    <!-- WebVPN 卡片 -->
                    <div class="col-sm-6 vpn-card-left" style="border-right: 1px solid #e5e7eb;">
                        
						<div class="rvpn-panel">
                            <h4 class="card-header-title">VPN</h4>
                            <p><b style="color: #d75757;font-weight: 1000;">更安全、更全面</b><br>数智人大、公文系统、<br>教务选课系统、移动校园等，<br>须安装VPN<i>客户端</i>访问</p>
                            <a href="https://rvpn.ruc.edu.cn/" class="btn-theme btn-rvpn">访问VPN</a>
                        </div>
                    </div>

                    <!-- RVPN 卡片 (原有内容与样式保留优化) -->
                    <div class="col-sm-6 vpn-card-right">
                        <!-- 登录外层卡片 -->
                        <div class="login-panel">
							 <div class="card-header-bar">
                                <h4 class="card-header-title">WebVPN</h4>
                                <!-- <span class="mode-badge">免客户端</span> -->
                            </div>
                            <!-- Tab 切换按钮由 TP 参数动态生成 -->
                            <!-- <div class="nav-tabs-pill" id="tabWrapper"></div> -->

                            <!-- 表单容器：本地登录 / Radius 等账号密码方式共用 -->
                            <!-- <form id="loginForm" class="form-area" onsubmit="handleLogin(event)">
                                <input type="hidden" id="login_type" name="login_type" value="user" />
                                
                                <div class="input-block">
                                    <input type="text" name="huau_username" id="huau_username" required placeholder="请输入学工号" value="">
                                </div>

                                <div class="input-block">
                                    <input type="password" name="huau_password" id="huau_password" required placeholder="请输入密码" value="">
                                </div>

                                <div class="input-block captcha-row">
                                    <input type="text" name="huau_vertify" id="huau_vertify" required placeholder="验证码" maxlength="6">
                                    <div class="captcha-img-holder" onclick="fleshVerify()" title="点击刷新验证码">
                                        <img src="/login/vertify.html" id="imgVerify" alt="验证码">
                                    </div>
                                </div>

                                <button type="submit" id="btnSubmit" class="btn-theme btn-block-action">立即登录</button>
                            </form> -->

                            <!-- CAS 登录展示区 -->
                            <div id="casBox">
                                <!-- <div class="cas-icon">
                                    <svg style="width:24px;height:24px" viewBox="0 0 24 24" fill="currentColor">
                                        <path d="M12 1L3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4zm-1 16l-4-4 1.41-1.41L11 14.17l6.59-6.59L19 9l-8 8z"/>
                                    </svg>
                                </div> -->
                                <div class="cas-desc">
                                    无需安装客户端，<br>但访问某些资源会受限
                                </div>
                                <button type="button" class="btn-theme btn-block-action" onclick="handleCasRedirect()">访问WebVPN</button>
                            </div>
							
                            <!-- 企业微信扫码区域 -->
							<div id="wechat-field" class="qr-view">
								<div id="wx_reg"></div>
							</div>

                            <!-- 钉钉扫码区域 -->
							<div id="dingding-field" class="qr-view">
								<div id="dingding"></div>
							</div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</main>

<script>
    

    // 验证码刷新
    function fleshVerify() {
        var verifyImg = document.getElementById('imgVerify');
        if (verifyImg) {
            verifyImg.src = '/login/vertify?r=' + Math.random();
        }
    }
    
    // CAS 跳转处理
    function handleCasRedirect() {
        if (window.layer) {
            layer.msg("正在跳转至 CAS 认证...", { icon: 16, shade: 0.1, time: 2000 });
        }
        setTimeout(function () {
            window.location.href = "/huauauth/caslogin";
        }, 500);
    }

   
</script>

</body>
</html>
