// RootLayout：字体 + 全局样式 + Providers
// 依据：02-architecture-design.md §9 设计令牌三层、project_rules §3.10 设计令牌规范
// - 字体：Inter（sans）/ Fraunces（serif）/ JetBrains Mono（mono），经 next/font 加载
// - 全局样式：globals.css（设计令牌 + 基础样式 + a11y）
// - Providers：QueryClient + Urql + MSW

import "./globals.css";
import type { Metadata, Viewport } from "next";
import { Inter, Fraunces, JetBrains_Mono } from "next/font/google";
import { Providers } from "./providers";

const inter = Inter({ subsets: ["latin"], variable: "--font-inter" });
const fraunces = Fraunces({ subsets: ["latin"], variable: "--font-fraunces" });
const mono = JetBrains_Mono({
  subsets: ["latin"],
  variable: "--font-jetbrains-mono",
});

export const metadata: Metadata = {
  title: "Edu 家长端",
  description: "K12 智慧教务平台 - 家长端",
  manifest: "/manifest.json",
};

export const viewport: Viewport = {
  width: "device-width",
  initialScale: 1,
  themeColor: "hsl(40, 20%, 98%)",
};

export default function RootLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  return (
    <html
      lang="zh-CN"
      className={`${inter.variable} ${fraunces.variable} ${mono.variable}`}
    >
      <body>
        <a href="#main-content" className="skip-link">
          跳转到主内容
        </a>
        <Providers>{children}</Providers>
      </body>
    </html>
  );
}
