<!DOCTYPE html>
<html lang="ko">
<head>
    <meta charset="UTF-8">
    <title>Error</title>

    <!-- ===================== -->
    <!-- Inline CSS -->
    <!-- ===================== -->
    <style>
        body {
            background: #121212;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            margin: 0;
            color: #e0e0e0;
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
        }

        .error-container {
            background: #1e1e1e;
            padding: 40px 60px;
            border-radius: 12px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
            text-align: center;
            max-width: 600px;
        }

        h2 {
            font-size: 44px;
            color: #ff6b6b;
            margin-bottom: 10px;
        }

        p {
            font-size: 18px;
            color: #cccccc;
            margin-bottom: 30px;
        }

        .info-text {
            margin-top: 10px;
            color: #bbbbbb;
            font-size: 15px;
        }

        .token-section {
            margin-top: 40px;
            padding: 20px;
            background: #2a2a2a;
            border-radius: 8px;
            border-left: 4px solid #ff6b6b;
        }

        .token-label {
            font-size: 14px;
            color: #aaaaaa;
            margin-bottom: 12px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .token-container {
            display: flex;
            gap: 8px;
            align-items: center;
            background: #1e1e1e;
            padding: 12px 15px;
            border-radius: 6px;
            border: 1px solid #3a3a3a;
        }

        #tokenValue {
            flex: 1;
            background: transparent;
            border: none;
            color: #00d4ff;
            font-family: 'Courier New', monospace;
            font-size: 14px;
            outline: none;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        #tokenValue::selection {
            background: #00d4ff;
            color: #1e1e1e;
        }

        .copy-btn {
            background: #ff6b6b;
            color: white;
            border: none;
            padding: 8px 16px;
            border-radius: 6px;
            cursor: pointer;
            font-size: 14px;
            font-weight: 600;
            transition: all 0.3s ease;
            white-space: nowrap;
        }

        .copy-btn:hover {
            background: #ff5252;
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
        }

        .copy-btn:active {
            transform: translateY(0);
        }

        .copy-btn.copied {
            background: #4caf50;
        }

        .copy-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        .copy-feedback {
            margin-top: 10px;
            font-size: 13px;
            color: #4caf50;
            opacity: 0;
            transition: opacity 0.3s ease;
            height: 20px;
        }

        .copy-feedback.show {
            opacity: 1;
        }
    </style>
</head>
<body>

<div class="error-container">
    <h2>⚠ ERROR</h2>
    <p>No handler found for GET /sitemap.xml</p>
    <p></p>

    <div class="token-section">
        <div class="token-label">Token 값</div>

        <div class="token-container">
            <input
                    type="text"
                    id="tokenValue"
                    value=""
                    readonly
                    placeholder="Token not available"
            >
            <button class="copy-btn" onclick="copyToken(event)">복사</button>
        </div>

        <div class="copy-feedback" id="copyFeedback">✓ 복사되었습니다</div>
    </div>

    <div class="info-text" style="margin-top: 20px;">
        <div>주소창의 token 값을 복사하여 보내주십시오</div>
        <div>Please copy the token value from the address bar and send it</div>
        <div>アドレスバーのtoken値をコピーして送信してください</div>
    </div>
</div>

<!-- ===================== -->
<!-- Inline JavaScript -->
<!-- ===================== -->
<script>
    /**
     * Token 복사 함수
     */
    function copyToken(event) {
        const tokenInput = document.getElementById('tokenValue');
        const copyBtn = event.target;
        const feedback = document.getElementById('copyFeedback');

        // 토큰이 없으면 경고
        if (!tokenInput.value) {
            alert('복사할 토큰이 없습니다');
            return;
        }

        navigator.clipboard.writeText(tokenInput.value)
            .then(() => {
                copyBtn.textContent = '✓ 복사됨';
                copyBtn.classList.add('copied');
                feedback.classList.add('show');

                setTimeout(() => {
                    copyBtn.textContent = '복사';
                    copyBtn.classList.remove('copied');
                    feedback.classList.remove('show');
                }, 2000);
            })
            .catch(err => {
                console.error('클립보드 복사 실패:', err);
                alert('복사에 실패했습니다');
            });
    }

    /**
     * 페이지 로드 시 토큰 존재 여부 확인
     */
    document.addEventListener('DOMContentLoaded', () => {
        const tokenInput = document.getElementById('tokenValue');
        const copyBtn = document.querySelector('.copy-btn');

        if (!tokenInput.value) {
            copyBtn.disabled = true;
        }
    });
</script>

</body>
</html>