<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>404</title>
    <style>
        :root {
            --primary: #3a86ff;
            --dark: #2b2d42;
            --light: #edf2f4;
        }
        
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        body {
            font-family: 'Segoe UI', system-ui, sans-serif;
            background-color: #f8f9fa;
            color: var(--dark);
            line-height: 1.6;
            height: 100vh;
            overflow: hidden;
            position: relative;
        }
        
        .particles {
            position: absolute;
            width: 100%;
            height: 100%;
            z-index: -1;
        }
        
        .container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 2rem;
            height: 100%;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            text-align: center;
        }
        
        .astro-illustration {
            width: min(300px, 100%);
            margin-bottom: 2rem;
            animation: float 6s ease-in-out infinite;
        }
        
        h1 {
            font-size: clamp(2rem, 5vw, 4rem);
            margin-bottom: 1rem;
            background: linear-gradient(45deg, #3a86ff, #8338ec);
            -webkit-background-clip: text;
            background-clip: text;
            color: transparent;
        }
        
        .subtitle {
            font-size: 1.25rem;
            margin-bottom: 2rem;
            max-width: 600px;
            opacity: 0.9;
        }
        
        .action-buttons {
            display: flex;
            gap: 1rem;
            flex-wrap: wrap;
            justify-content: center;
            margin-bottom: 1rem;
        }
        
        .btn {
            padding: 0.75rem 2rem;
            border-radius: 50px;
            font-weight: 600;
            transition: all 0.3s ease;
            cursor: pointer;
            border: none;
        }
        
        .btn-primary {
            background: var(--primary);
            color: white;
            box-shadow: 0 4px 15px rgba(58, 134, 255, 0.3);
        }
        
        .btn-outline {
            background: transparent;
            color: var(--primary);
            border: 2px solid var(--primary);
        }
        
        .btn:hover {
            transform: translateY(-3px);
            box-shadow: 0 8px 25px rgba(58, 134, 255, 0.4);
        }
        
        .searchform {
            position: relative;
            width: min(100%, 500px);
            margin: 1rem auto 0;
        }
        
        .search-input {
            width: 100%;
            padding: 1rem 1.5rem;
            border-radius: 50px;
            border: 1px solid #ddd;
            font-size: 1rem;
            padding-right: 120px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.05);
            transition: all 0.3s ease;
        }
        
        .search-input:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 4px 20px rgba(58, 134, 255, 0.2);
        }
        
        .search-btn {
            position: absolute;
            right: 5px;
            top: 5px;
            padding: 0.65rem 1.5rem;
            background: var(--primary);
            color: white;
            border: none;
            border-radius: 50px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
        }
        
        .search-btn:hover {
            background: #2a75e6;
            transform: translateY(-1px);
        }
        
        @keyframes float {
            0%, 100% { transform: translateY(0); }
            50% { transform: translateY(-20px); }
        }
        
        @media (max-width: 768px) {
            .container {
                padding: 1rem;
            }
            
            .action-buttons {
                flex-direction: column;
                width: 100%;
            }
            
            .btn {
                width: 100%;
            }
            
            .searchform {
                width: 100%;
            }
        }
    </style>
</head>
<body>
    <div id="particles-js" class="particles"></div>
    
    <div class="container">
        <svg class="astro-illustration" viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
            <circle cx="100" cy="100" r="90" fill="#FFD166" opacity="0.2"/>
            <path d="M100 30v20m0 100v20M30 100h20m100 0h20" stroke="#3A86FF" stroke-width="2"/>
            <circle cx="100" cy="100" r="60" fill="none" stroke="#3A86FF" stroke-width="2" stroke-dasharray="5 5"/>
            <circle cx="100" cy="100" r="40" fill="none" stroke="#8338EC" stroke-width="2"/>
            <circle cx="70" cy="80" r="5" fill="#3A86FF"/>
            <circle cx="130" cy="120" r="7" fill="#8338EC"/>
        </svg>
        
        <h1>404</h1>
        <p class="subtitle">道友留步，此卷章节已渡劫飞升，或从未存于三界之内，不如换个书名寻找？</p>
        <div class="action-buttons">
            <button class="btn btn-primary" onclick="window.location.href='/'">返回首页</button>
            <button class="btn btn-outline" onclick="window.history.back()">返回上一页</button>
        </div>
        <div class="searchform">
            <input name="key" 
                   class="search-input" 
                   type="text" 
                   id="key" 
                   placeholder="搜索：书名/作者" 
                   onclick="this.select()" 
                   value="" />
            <button type="submit" 
                    class="search-btn" 
                    id="s_btn" 
                    onclick="handleSearch()">
                搜索
            </button>
        </div>
    </div>
    <script>
        function handleSearch() {
            const keyword = document.getElementById('key').value.trim();
            if(keyword) {
                const isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
                const searchPath = isMobile ? '/wap/so/' : '/so/';
                window.location.href = searchPath + encodeURIComponent(keyword) + '/';
            }
        }
        document.getElementById('key').addEventListener('keypress', function(e) {
            if(e.key === 'Enter') handleSearch();
        });
    </script>
</body>
</html>