        </div>
    </main>

    <script>
        // Toast 提示函数
        function showToast(message, type = 'info', duration = 2000) {
            const toastWrap = document.getElementById('toastWrap') || (() => {
                const wrap = document.createElement('div');
                wrap.id = 'toastWrap';
                wrap.className = 'fixed top-6 left-1/2 -translate-x-1/2 z-[9999] flex flex-col items-center gap-2';
                document.body.appendChild(wrap);
                return wrap;
            })();
            
            const toast = document.createElement('div');
            
            let bgClass = 'bg-gray-800';
            if (type === 'success') bgClass = 'bg-green-600';
            if (type === 'error') bgClass = 'bg-red-600';
            if (type === 'warning') bgClass = 'bg-yellow-600';
            
            toast.className = `${bgClass} text-white px-4 py-2 rounded-lg shadow-lg flex items-center gap-2 transform transition-all duration-300 ease-in-out opacity-0 translate-y-[-10px]`;
            toast.innerHTML = `<i class="fas fa-${type === 'success' ? 'check' : type === 'error' ? 'exclamation' : type === 'warning' ? 'exclamation-triangle' : 'info'}"></i><span>${message}</span>`;
            
            toastWrap.appendChild(toast);
            
            // 触发动画
            setTimeout(() => {
                toast.classList.remove('opacity-0', 'translate-y-[-10px]');
            }, 10);
            
            // 自动移除
            setTimeout(() => {
                toast.classList.add('opacity-0', 'translate-y-[-10px]');
                setTimeout(() => {
                    toastWrap.removeChild(toast);
                }, 300);
            }, duration);
        }

        // 侧边栏切换
        var sidebarToggle = document.getElementById('sidebarToggle');
        var sidebar = document.getElementById('sidebar');
        
        if (sidebarToggle && sidebar) {
            sidebarToggle.addEventListener('click', function() {
                sidebar.classList.toggle('open');
            });

            // 点击外部关闭侧边栏（移动端）
            document.addEventListener('click', function(e) {
                if (e.target && window.innerWidth < 1024 && sidebar && sidebarToggle && !sidebar.contains(e.target) && !sidebarToggle.contains(e.target)) {
                    sidebar.classList.remove('open');
                }
            });
        }

        // 通用提示函数
        function showMsg(msg, icon) {
            const type = icon === 2 ? 'error' : icon === 3 ? 'warning' : 'success';
            showToast(msg, type);
        }

        
    </script>
</body>
</html>
