<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>操作提示</title>
    <style>
        body {
            margin: 0;
            padding: 0;
            height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            background: #f5f5f5;
            font-family: Arial, sans-serif;
        }

        .alert-box {
            background: white;
            padding: 2rem 3rem;
            border-radius: 8px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
            position: relative;
            text-align: center;
            min-width: 300px;
        }

        .success { color: #4CAF50; }
        .error { color: #f44336; }

        .close-btn {
            position: absolute;
            top: 10px;
            right: 15px;
            background: none;
            border: none;
            font-size: 1.2rem;
            cursor: pointer;
            color: #a8a8a8;
        }

        .icon {
            font-size: 2.5rem;
            margin-bottom: 1rem;
        }

        .message {
            font-size: 1.8rem;
            margin: 0.8rem 0;
        }
        .countdown {
            color: #a8a8a8;
        }
    </style>
</head>
<body>
<div class="alert-box">
    <button class="close-btn" onclick="closeAlert()">×</button>
{{--    <div class="icon"></div>--}}
    <div class="message"> </div>
    <div class="countdown">5 seconds later, it will close automatically.</div>
</div>

<script>
    // 获取URL参数
    const params = new URLSearchParams(window.location.search);
    const status = '{{$status}}';
    const message = '{{$message}}';

    // 设置内容
    document.querySelector('.message').classList.add(status);
   // document.querySelector('.icon').textContent = status === 'success' ? '✓' : '✕';
    document.querySelector('.message').textContent = message;

    // 倒计时显示
    let seconds = 8;
    const countdownElement = document.querySelector('.countdown');
    const timer = setInterval(() => {
        seconds--;
        countdownElement.textContent = `${seconds} seconds later, it will close automatically.`;
        if (seconds <= 0) clearInterval(timer);
    }, 1000);

    // 关闭函数
    function closeAlert() {
        //window.history.length > 1 ? window.history.back() : window.close();
        window.close();
    }

    // 5秒自动关闭
    setTimeout(closeAlert, 8000);
</script>
</body>
</html>
