'use client';

import { useEffect } from 'react';
import { useRouter } from 'next/navigation';

export default function RootPage() {
    const router = useRouter();

    useEffect(() => {
        // 检查localStorage中保存的语言偏好
        const savedLanguage = localStorage.getItem('language');
        const defaultLocale = savedLanguage || 'zh-CN';
        
        // 重定向到对应的语言页面
        router.replace(`/${defaultLocale}`);
    }, [router]);

    return (
        <div className="min-h-screen flex items-center justify-center bg-gradient-to-br from-slate-50 to-blue-50">
            <div className="text-center">
                <div className="w-16 h-16 border-4 border-blue-500 border-t-transparent rounded-full animate-spin mx-auto mb-4"></div>
                <p className="text-gray-600">正在跳转...</p>
            </div>
        </div>
    );
} 