<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
    <title>网站维护中 · 即将归来</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Helvetica, sans-serif;
            background: linear-gradient(145deg, #f6f9fc 0%, #eef2f5 100%);
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 1.5rem;
        }

        .maintenance-card {
            max-width: 620px;
            width: 100%;
            background: rgba(255, 255, 255, 0.96);
            backdrop-filter: blur(2px);
            border-radius: 3rem;
            box-shadow: 0 25px 45px -12px rgba(0, 0, 0, 0.25), 0 4px 12px rgba(0, 0, 0, 0.05);
            padding: 2.5rem 2rem;
            text-align: center;
            transition: all 0.3s ease;
            border: 1px solid rgba(255, 255, 255, 0.5);
        }

        .icon-tools {
            display: flex;
            justify-content: center;
            gap: 1.2rem;
            margin-bottom: 1.8rem;
            color: #2c7da0;
        }

        .icon-tools svg {
            width: 48px;
            height: 48px;
            stroke-width: 1.5;
            stroke: currentColor;
            fill: none;
            animation: gentleSpin 4s infinite ease-in-out;
        }

        .icon-tools svg:first-child {
            animation-delay: 0s;
        }
        .icon-tools svg:last-child {
            animation-delay: 1.2s;
        }

        @keyframes gentleSpin {
            0% { transform: rotate(0deg) scale(1); opacity: 0.7; }
            50% { transform: rotate(12deg) scale(1.08); opacity: 1; }
            100% { transform: rotate(0deg) scale(1); opacity: 0.7; }
        }

        h1 {
            font-size: 2.2rem;
            font-weight: 600;
            background: linear-gradient(135deg, #1e4668, #2c7da0);
            background-clip: text;
            -webkit-background-clip: text;
            color: transparent;
            margin-bottom: 0.75rem;
            letter-spacing: -0.3px;
        }

        .badge {
            display: inline-block;
            background: #ffedd5;
            color: #b45309;
            font-size: 0.8rem;
            font-weight: 500;
            padding: 0.25rem 1rem;
            border-radius: 40px;
            margin-bottom: 1.5rem;
            border: 1px solid #fed7aa;
        }

        .message {
            font-size: 1.05rem;
            line-height: 1.5;
            color: #2c3e4e;
            margin: 1.2rem 0 1rem;
        }

        .progress-container {
            background: #e2e8f0;
            border-radius: 40px;
            height: 8px;
            width: 80%;
            margin: 1.8rem auto;
            overflow: hidden;
        }

        .progress-bar {
            background: linear-gradient(90deg, #2c7da0, #61a5c2);
            width: 68%;
            height: 100%;
            border-radius: 40px;
            animation: shimmer 1.8s infinite ease;
        }

        @keyframes shimmer {
            0% { opacity: 0.6; width: 68%; }
            50% { opacity: 1; width: 74%; }
            100% { opacity: 0.6; width: 68%; }
        }

        .status-single {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 0.5rem;
            margin-top: 2rem;
            font-size: 0.9rem;
            color: #4a627a;
            border-top: 1px solid #e9edf2;
            padding-top: 1.8rem;
        }
        .status-single svg {
            width: 18px;
            height: 18px;
            stroke: #5f8baf;
            stroke-width: 1.8;
            fill: none;
        }

        .contact {
            background: #f1f5f9;
            border-radius: 60px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            padding: 0.5rem 1.2rem;
            margin-top: 1.5rem;
            font-size: 0.85rem;
            color: #1e4668;
            text-decoration: none;
            transition: all 0.2s;
            border: 1px solid #cbdde9;
            white-space: nowrap;
            cursor: pointer;
        }
        .contact svg {
            width: 18px;
            height: 18px;
            stroke: currentColor;
            stroke-width: 1.5;
            fill: none;
            flex-shrink: 0;
            display: inline-block;
        }
        .contact:hover {
            background: #e6edf4;
            border-color: #8fb3cc;
        }

        @media (max-width: 400px) {
            .contact {
                font-size: 0.75rem;
                padding: 0.4rem 0.9rem;
            }
            .contact svg {
                width: 16px;
                height: 16px;
            }
            .status-single {
                font-size: 0.8rem;
            }
        }

        .detect-status {
            margin-top: 1.2rem;
            font-size: 0.75rem;
            color: #8aa0b5;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
        }
        .detect-status .dot {
            width: 8px;
            height: 8px;
            background-color: #f59e0b;
            border-radius: 50%;
            display: inline-block;
            animation: pulse 1.5s infinite;
        }
        @keyframes pulse {
            0% { opacity: 0.4; transform: scale(0.8);}
            100% { opacity: 1; transform: scale(1.2);}
        }

        footer {
            font-size: 0.7rem;
            color: #8aa0b5;
            margin-top: 1.2rem;
            letter-spacing: 0.3px;
        }
    </style>
</head>
<body>

<div class="maintenance-card">
    <div class="icon-tools">
        <svg viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round">
            <path d="M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z" />
            <path d="M18.37 7.29l.87-.87a1.5 1.5 0 0 0 0-2.12l-1.23-1.23a1.5 1.5 0 0 0-2.12 0l-.87.87" />
            <path d="M5.63 16.71l-.87.87a1.5 1.5 0 0 0 0 2.12l1.23 1.23a1.5 1.5 0 0 0 2.12 0l.87-.87" />
            <path d="M7.29 5.63L6.42 4.76a1.5 1.5 0 0 0-2.12 0L3.07 5.99a1.5 1.5 0 0 0 0 2.12l.87.87" />
            <path d="M16.71 18.37l.87.87a1.5 1.5 0 0 0 2.12 0l1.23-1.23a1.5 1.5 0 0 0 0-2.12l-.87-.87" />
        </svg>
        <svg viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round">
            <path d="M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z" />
            <path d="M18.37 7.29l.87-.87a1.5 1.5 0 0 0 0-2.12l-1.23-1.23a1.5 1.5 0 0 0-2.12 0l-.87.87" />
            <path d="M5.63 16.71l-.87.87a1.5 1.5 0 0 0 0 2.12l1.23 1.23a1.5 1.5 0 0 0 2.12 0l.87-.87" />
            <path d="M7.29 5.63L6.42 4.76a1.5 1.5 0 0 0-2.12 0L3.07 5.99a1.5 1.5 0 0 0 0 2.12l.87.87" />
            <path d="M16.71 18.37l.87.87a1.5 1.5 0 0 0 2.12 0l1.23-1.23a1.5 1.5 0 0 0 0-2.12l-.87-.87" />
        </svg>
    </div>

    <h1>系统维护升级</h1>
    <div class="badge">⏳ 预计很快恢复</div>

    <div class="message">
        为了提供更稳定、快速的访问体验，我们正在对后端服务进行例行维护。<br>
        网站暂时无法访问，请稍后再试。感谢你的理解与支持。
    </div>

    <div class="progress-container">
        <div class="progress-bar"></div>
    </div>

    <div class="status-single">
        <svg viewBox="0 0 24 24" fill="none">
            <path d="M3 9h18M9 21V9M15 21V9" stroke="currentColor" stroke-width="1.5"/>
            <rect x="5" y="3" width="14" height="18" rx="2" stroke="currentColor" stroke-width="1.5"/>
        </svg>
        <span>技术团队正在处理</span>
    </div>

    <a href="mailto:384214001@qq.com" class="contact">
        <svg viewBox="0 0 24 24" fill="none">
            <path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z" stroke="currentColor" stroke-width="1.5"/>
            <polyline points="22,6 12,13 2,6" stroke="currentColor" stroke-width="1.5"/>
        </svg>
        联系技术支持
    </a>

    <div class="detect-status" id="detectStatus">
        <span class="dot"></span>
        <span id="statusText">正在检测服务状态，恢复后将自动刷新</span>
    </div>

    <footer>
        * 无需手动刷新，服务恢复后页面将自动重新加载。
    </footer>
</div>

<script>
    (function() {
        const CHECK_INTERVAL_MS = 8000;
        const REQUEST_TIMEOUT_MS = 5000;
        
        let checkTimer = null;
        let isRefreshing = false;
        const statusTextEl = document.getElementById('statusText');
        const dotEl = document.querySelector('.detect-status .dot');
        
        function checkHealth() {
            if (isRefreshing) return;
            
            const controller = new AbortController();
            const timeoutId = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS);
            
            fetch(window.location.href, {
                method: 'HEAD',
                signal: controller.signal,
                cache: 'no-cache',
                headers: { 'Cache-Control': 'no-cache' }
            })
            .then(response => {
                clearTimeout(timeoutId);
                if (response.ok && response.status !== 502 && response.status !== 503) {
                    if (!isRefreshing) {
                        isRefreshing = true;
                        if (statusTextEl) statusTextEl.innerText = '✅ 服务已恢复，正在刷新页面...';
                        if (dotEl) dotEl.style.backgroundColor = '#10b981';
                        setTimeout(() => {
                            window.location.reload(true);
                        }, 300);
                    }
                } else {
                    if (statusTextEl && statusTextEl.innerText.indexOf('恢复') === -1) {
                        statusTextEl.innerText = '⏳ 服务尚未恢复，继续检测中...';
                    }
                }
            })
            .catch(() => {
                clearTimeout(timeoutId);
                if (statusTextEl && statusTextEl.innerText.indexOf('检测') !== -1) {
                    statusTextEl.innerText = '⏳ 服务尚未恢复，继续检测中...';
                }
            });
        }
        
        if (window.location.protocol !== 'file:') {
            setTimeout(() => {
                checkHealth();
                checkTimer = setInterval(checkHealth, CHECK_INTERVAL_MS);
            }, 3000);
        } else {
            if (statusTextEl) statusTextEl.innerText = '预览模式，自动刷新已禁用';
        }
        
        window.addEventListener('beforeunload', function() {
            if (checkTimer) clearInterval(checkTimer);
        });
    })();
</script>
</body>
</html>
