diff --git a/frontend-web/src/pages/NotebookAIWritingPage.tsx b/frontend-web/src/pages/NotebookAIWritingPage.tsx
index 8c818d68..e23e5f24 100644
--- a/frontend-web/src/pages/NotebookAIWritingPage.tsx
+++ b/frontend-web/src/pages/NotebookAIWritingPage.tsx
@@ -2,6 +2,9 @@ import { useEffect, useState } from 'react';
import { useSearchParams } from 'react-router-dom';
import AIWritingPage from '@/open-canvas/pages/AIWritingPage';
import { getNotebookApiBaseURL } from '@/core/config';
+import { useTheme, type ThemeType } from '@/contexts/ThemeContext';
+
+const VALID_THEMES: ThemeType[] = ['dark', 'light', 'lightblue'];
interface NotebookTokenData {
doc_ids: number[];
@@ -13,6 +16,17 @@ interface NotebookTokenData {
export default function NotebookAIWritingPage() {
const [searchParams] = useSearchParams();
const token = searchParams.get('token');
+ const themekey = searchParams.get('themekey');
+ const { setTheme } = useTheme();
+
+ // 跟随调用方传入的 themekey 切换主题;缺省或非法值兜底为 light
+ useEffect(() => {
+ const next = themekey && VALID_THEMES.includes(themekey as ThemeType)
+ ? (themekey as ThemeType)
+ : 'light';
+ setTheme(next);
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [themekey]);
const [data, setData] = useState(null);
const [spaceName, setSpaceName] = useState(null);
diff --git a/frontend-web/src/pages/StudioNotebookDetailPage.tsx b/frontend-web/src/pages/StudioNotebookDetailPage.tsx
index b0747e85..83d367f4 100644
--- a/frontend-web/src/pages/StudioNotebookDetailPage.tsx
+++ b/frontend-web/src/pages/StudioNotebookDetailPage.tsx
@@ -27,6 +27,7 @@ import { fetchDocumentByChunk } from "@/core/studio/api";
import type { DocumentWithChunks } from "@/core/studio/api";
import type { SourceItem } from "@/core/studio/types";
import { getStoredAuth } from "@/core/auth";
+import { useTheme } from "@/contexts/ThemeContext";
import { useModels } from "@/core/models/hooks";
import {
Select,
@@ -218,6 +219,7 @@ export default function StudioNotebookDetailPage({
const params = useParams<{ notebookId: string }>();
const notebookId =
notebookIdProp != null ? String(notebookIdProp) : params.notebookId;
+ const { theme } = useTheme(); // 跳转「我的空间」时带上当前主题 key
const { notebooks, isLoading, token: studioToken } = useStudioNotebooks(); // token 用于跳转 callback
const { models } = useModels();
const queryClient = useQueryClient();
@@ -508,7 +510,7 @@ export default function StudioNotebookDetailPage({
-
+
{nb.name}
- {nb.source_count} 个来源
+ {nb.source_count} 个来源
>
);
return (
-
+
{onOpen ? (