"use client";

import { Sparkles } from "lucide-react";

export function ModeWorkspace({
  children,
  aiPanel,
  aiTitle = "AI 解读",
}: {
  children: React.ReactNode;
  aiPanel: React.ReactNode;
  aiTitle?: string;
}) {
  return (
    <div className="mx-auto w-full max-w-6xl px-4 py-6 lg:py-8">
      <div className="grid gap-6 lg:grid-cols-[minmax(0,1fr)_minmax(280px,380px)] lg:items-start lg:gap-8">
        <div className="space-y-5">{children}</div>
        <aside className="lg:sticky lg:top-6">
          <div className="zen-card flex min-h-[320px] flex-col rounded-2xl border border-border/60 bg-card/90 shadow-md backdrop-blur-sm lg:min-h-[calc(100vh-8rem)]">
            <div className="flex items-center gap-2 border-b border-border/50 px-5 py-4">
              <Sparkles size={18} className="text-primary/80" />
              <h2 className="text-sm font-medium tracking-widest text-muted-foreground">
                {aiTitle}
              </h2>
            </div>
            <div className="flex flex-1 flex-col p-4 sm:p-5">{aiPanel}</div>
          </div>
        </aside>
      </div>
    </div>
  );
}
