import type { Metadata } from "next";
import "./globals.css";

import { CommandPaletteMount } from "@/components/command/CommandPaletteMount";
import { ThemeScript } from "@/components/ThemeScript";
import { ToastProvider } from "@/components/Toast";

export const metadata: Metadata = {
  title: "网文创作工作流",
  description: "把写小说当软件工程：架构→生成→质检→单一真相源",
};

export default function RootLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  // suppressHydrationWarning：浏览器扩展（如 Dark Reader/翻译插件）常在 html/body
  // 注入 class/attr，水合前改 DOM → 仅这一层属性的水合告警，非本应用 bug。
  return (
    <html lang="zh-CN" suppressHydrationWarning>
      <body className="font-sans antialiased" suppressHydrationWarning>
        <ThemeScript />
        <ToastProvider>
          {children}
          <CommandPaletteMount />
        </ToastProvider>
      </body>
    </html>
  );
}
