Compare commits

..

9 Commits

Author SHA1 Message Date
zhanxi a8ef8222c8 feat(ui): 发布H5选择抽屉与桌面风格卡片
已完成代码检查、构建和浏览器交互验收,沿用原有前台部署链路。
2026-10-27 04:14:11 +00:00
湛兮 374ab1c606 feat(ui): H5风格与世界书使用底部选择抽屉
- H5入口:设定页只显示当前风格和已选世界书,单选与多选均从底部抽屉完成

- 交互:独立草稿、确认回填、取消还原、恢复默认、清空选择和焦点返回

- 响应式:桌面保留展开式选择,主设定页和抽屉的提交按钮固定可见

- 验证:类型检查与构建通过,90项浏览器断言覆盖小屏、双主题、键盘和真实保存
2026-10-27 12:11:32 +08:00
湛兮 5adb6eaec3 feat(ui): 将叙事风格下拉框改为主题化选择卡片
- 对话设定:显示风格说明、整卡选择和选中标识,保留键盘单选语义及历史风格

- 响应式样式:手机纵向排列、桌面双列布局,跟随经典金和现代粉两套主题

- 验证:ESLint、类型检查、Next 构建及42项真实浏览器交互断言通过
2026-10-27 11:57:31 +08:00
zhanxi 0f0aebe3a4 feat(experiments): 发布实验类型与用户管理拆分
已完成双轮review与测试环境验证,沿用现有部署链路。
2026-10-27 03:47:09 +00:00
湛兮 b1c5610f23 feat(experiments): 开放本人通用类型决策读取接口
- BFF:允许已登录用户按类型读取决策,拒绝对决策入口写操作

- README:补充类型消费者接入路径与后台验收边界
2026-10-27 11:40:22 +08:00
zhanxi 1d045b7770 fix(ui): 发布星港图标更新
已完成双轮review与测试环境验证,沿用现有部署链路。
2026-10-27 02:46:46 +00:00
湛兮 a07ba77c5a fix(ui): 统一星港浏览器和主屏幕图标
更新对话气泡星芒标识,提供SVG、ICO与多尺寸PNG,修复标签页旧图标缓存并同步PWA元数据。
2026-10-27 10:44:45 +08:00
zhanxi c4ea05ee0b feat: 发布星港数字人项目
已完成双轮review与测试环境验证,沿用现有部署链路。
2026-10-27 02:28:19 +00:00
湛兮 781a735559 fix(ci): 补齐pnpm工作区根包声明 2026-10-27 10:26:43 +08:00
13 changed files with 685 additions and 93 deletions
+4
View File
@@ -128,3 +128,7 @@ pnpm start:prod
- `src/app/api/digital/[...path]/route.ts`:白名单 BFF,只转发前台接口,禁止访问后台实验管理,写入校验同源。
- 实验控制仅在 role-admin。前台没有切换实验或分组入口。
- `DEEPSEEK_API_KEY` 仅在业务后端配置,前端不读取、不保存。
标签页图标采用 `public/stellar-icon-v2.svg`,同时提供多尺寸 `favicon.ico`、180/192/512 PNG,覆盖浏览器、Apple 主屏幕和 PWA。版本化资源路径用于刷新旧图标缓存。
通用实验消费者可经 `GET /api/digital/decisions/:key` 读取本人类型决策的 `data.value`,沿用 HttpOnly 会话与不缓存策略。类型、测试方案和用户分组全部在后台管理;新类型需要应用真实使用返回值并完成后台接入验收后才可启动。
+6
View File
@@ -0,0 +1,6 @@
packages:
- '.'
allowBuilds:
sharp: true
unrs-resolver: true
Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

+1 -1
View File
@@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><rect width="64" height="64" rx="17" fill="#171219"/><defs><linearGradient id="a" x2="1" y2="1"><stop stop-color="#e0b888"/><stop offset="1" stop-color="#fcaee4"/></linearGradient></defs><path d="M32 8C35 24 40 29 56 32 40 35 35 40 32 56 29 40 24 35 8 32 24 29 29 24 32 8Z" fill="url(#a)"/><circle cx="50" cy="13" r="3" fill="#fcaee4"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><defs><linearGradient id="stellar" x1="12" y1="13" x2="49" y2="49" gradientUnits="userSpaceOnUse"><stop stop-color="#F4D5A3"/><stop offset="1" stop-color="#F5A8D9"/></linearGradient></defs><rect x="2" y="2" width="60" height="60" rx="18" fill="#211628"/><path d="M24 14h16c9 0 15 6 15 15v4c0 9-6 15-15 15H27L14 54l3-13c-4-3-6-7-6-12 0-9 5-15 13-15Z" fill="url(#stellar)"/><path d="M33 20c2.2 6.5 4.5 8.8 11 11-6.5 2.2-8.8 4.5-11 11-2.2-6.5-4.5-8.8-11-11 6.5-2.2 8.8-4.5 11-11Z" fill="#211628"/><circle cx="51" cy="13" r="5" fill="#F7B7DD" stroke="#211628" stroke-width="3"/></svg>

Before

Width:  |  Height:  |  Size: 402 B

After

Width:  |  Height:  |  Size: 640 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><defs><linearGradient id="stellar" x1="12" y1="13" x2="49" y2="49" gradientUnits="userSpaceOnUse"><stop stop-color="#F4D5A3"/><stop offset="1" stop-color="#F5A8D9"/></linearGradient></defs><rect x="2" y="2" width="60" height="60" rx="18" fill="#211628"/><path d="M24 14h16c9 0 15 6 15 15v4c0 9-6 15-15 15H27L14 54l3-13c-4-3-6-7-6-12 0-9 5-15 13-15Z" fill="url(#stellar)"/><path d="M33 20c2.2 6.5 4.5 8.8 11 11-6.5 2.2-8.8 4.5-11 11-2.2-6.5-4.5-8.8-11-11 6.5-2.2 8.8-4.5 11-11Z" fill="#211628"/><circle cx="51" cy="13" r="5" fill="#F7B7DD" stroke="#211628" stroke-width="3"/></svg>

After

Width:  |  Height:  |  Size: 640 B

+3 -1
View File
@@ -33,11 +33,13 @@ async function proxy(
const { path } = await context.params;
const joined = path.join("/");
if (
!/^(bootstrap|profile|exposure|conversations(?:\/[a-zA-Z0-9_-]+(?:\/(?:stream|stop|branch|messages\/[a-zA-Z0-9_-]+))?)?)$/.test(
!/^(bootstrap|profile|exposure|decisions\/[a-zA-Z0-9_-]+|conversations(?:\/[a-zA-Z0-9_-]+(?:\/(?:stream|stop|branch|messages\/[a-zA-Z0-9_-]+))?)?)$/.test(
joined,
)
)
return Response.json({ message: "接口不存在" }, { status: 404 });
if (joined.startsWith("decisions/") && request.method !== "GET")
return Response.json({ message: "仅支持读取决策" }, {status:405,headers:{Allow:"GET"}});
if (request.method !== "GET") {
const origin = request.headers.get("origin");
try {
+5 -2
View File
@@ -11,8 +11,11 @@ export const metadata: Metadata = {
description: "与有故事的人相遇,让每一段对话继续生长",
manifest: "/manifest.webmanifest",
icons: {
icon: "/icon.svg",
apple: "/icon.svg",
icon: [
{ url: "/stellar-icon-v2.svg", type: "image/svg+xml" },
{ url: "/favicon.ico?v=stellar-2", sizes: "any" },
],
apple: "/stellar-icon-180-v2.png",
},
appleWebApp: {
capable: true,
+3 -1
View File
@@ -12,8 +12,10 @@ export default function manifest(): MetadataRoute.Manifest {
background_color: "#141218",
theme_color: "#141218",
icons: [
{ src: "/stellar-icon-192-v2.png", sizes: "192x192", type: "image/png" },
{ src: "/stellar-icon-512-v2.png", sizes: "512x512", type: "image/png" },
{
src: "/icon.svg",
src: "/stellar-icon-v2.svg",
sizes: "any",
type: "image/svg+xml",
},
+331 -86
View File
@@ -35,6 +35,7 @@ import {
RefreshCw,
Download,
ChevronDown,
ChevronRight,
} from "lucide-react";
import {
digital,
@@ -130,6 +131,14 @@ export function DigitalHome({
const [profileDraft, setProfileDraft] = useState<Profile | null>(
initial.profile,
);
const [selectionSheet, setSelectionSheet] = useState<
"style" | "books" | null
>(null);
const [choiceDraft, setChoiceDraft] = useState<{
presetId?: string;
bookIds: string[];
}>({ bookIds: [] });
const selectionTrigger = useRef<HTMLElement | null>(null);
const favoritePending = useRef(false);
const [activeMessage, setActiveMessage] = useState<string | null>(null),
[showJump, setShowJump] = useState(false),
@@ -258,13 +267,20 @@ export function DigitalHome({
);
const controls = () =>
Array.from(
dialog?.querySelectorAll<HTMLElement>(
(
document.querySelector<HTMLElement>(".dh-selection-sheet") ?? dialog
)?.querySelectorAll<HTMLElement>(
'button:not([disabled]),input,textarea,select,[tabindex="0"]',
) ?? [],
);
const frame = requestAnimationFrame(() => controls()[0]?.focus());
const onKey = (event: globalThis.KeyboardEvent) => {
if (event.key === "Escape") {
event.preventDefault();
if (document.querySelector(".dh-selection-sheet")) {
setSelectionSheet(null);
return;
}
setDetail(null);
setShowSettings(false);
}
@@ -288,6 +304,35 @@ export function DigitalHome({
previous?.focus();
};
}, [detail, showSettings]);
/** 抽屉聚焦当前选项并限制滚动;取消、确认及切回桌面后恢复入口焦点。 */
useEffect(() => {
if (!selectionSheet) return;
const previous = selectionTrigger.current;
const media = window.matchMedia("(max-width: 600px)");
const resize = () => {
if (!media.matches) setSelectionSheet(null);
};
resize();
media.addEventListener("change", resize);
const frame = requestAnimationFrame(() => {
const panel = document.querySelector<HTMLElement>(".dh-selection-sheet");
(
panel?.querySelector<HTMLElement>("input:checked") ??
panel?.querySelector<HTMLElement>("input") ??
panel?.querySelector<HTMLElement>("button")
)?.focus();
});
return () => {
cancelAnimationFrame(frame);
media.removeEventListener("change", resize);
if (previous?.isConnected && previous.getClientRects().length)
previous.focus();
else
document
.querySelector<HTMLElement>(".dh-desktop-choices input:checked")
?.focus();
};
}, [selectionSheet]);
useEffect(() => {
const id = boot?.decision.decisionId;
if (!id || document.hidden) return;
@@ -586,6 +631,26 @@ export function DigitalHome({
reportError(e);
}
}
/** 抽屉仅编辑临时值;确认后回填设定,取消不改动已有选择。 */
function openSelection(kind: "style" | "books") {
if (!settings) return;
selectionTrigger.current = document.activeElement as HTMLElement;
setChoiceDraft({
presetId: settings.presetId,
bookIds: [...settings.bookIds],
});
setSelectionSheet(kind);
}
function confirmSelection() {
if (settings)
setSettings({
...settings,
...(selectionSheet === "style"
? { presetId: choiceDraft.presetId }
: { bookIds: choiceDraft.bookIds }),
});
setSelectionSheet(null);
}
async function saveSettings(event: FormEvent) {
event.preventDefault();
if (!conversation || !settings) return;
@@ -662,6 +727,97 @@ export function DigitalHome({
(tag === "全部" || c.tags.includes(tag)) &&
(!onlyFavorites || profile?.favorites.includes(c.id)),
);
const styleChoices = (
value: string | undefined,
onChange: (value: string | undefined) => void,
inSheet = false,
) => (
<fieldset className="dh-style-picker">
<legend className={inSheet ? "dh-visually-hidden" : undefined}>
叙事风格
</legend>
<p className="dh-style-help">为这段故事选一种氛围</p>
<div className="dh-style-options">
{[
{
id: "",
name: "角色默认风格",
description: "沿用角色原有的语气与叙事节奏。",
},
...presets,
...(value && !presets.some((p) => p.id === value)
? [
{
id: value,
name: "当前会话风格",
description:
"此风格暂不在可选列表中,可以保留或选择其他风格。",
},
]
: []),
].map((p) => (
<label className="dh-style-option" key={p.id}>
<input
type="radio"
name={
inSheet
? "conversation-preset-sheet"
: "conversation-preset-inline"
}
value={p.id}
checked={(value ?? "") === p.id}
onChange={() => onChange(p.id || undefined)}
/>
<span className="dh-style-card">
<span className="dh-style-symbol" aria-hidden="true">
{p.id ? <WandSparkles /> : <Sparkles />}
</span>
<span className="dh-style-copy">
<strong>{p.name}</strong>
<small>{p.description || "以这套风格继续你们的故事。"}</small>
</span>
<span className="dh-style-check" aria-hidden="true">
<Check />
</span>
</span>
</label>
))}
</div>
</fieldset>
);
const bookChoices = (
value: string[],
onChange: (value: string[]) => void,
inSheet = false,
) => (
<fieldset className="dh-book-picker">
<legend className={inSheet ? "dh-visually-hidden" : undefined}>
加入世界书
</legend>
{books.map((b) => (
<label
className={`dh-checkbox ${value.includes(b.id) ? "is-selected" : ""}`}
key={b.id}
>
<input
type="checkbox"
checked={value.includes(b.id)}
onChange={(e) =>
onChange(
e.target.checked
? [...value, b.id]
: value.filter((v) => v !== b.id),
)
}
/>
<span>
{b.name}
<small>{b.description}</small>
</span>
</label>
))}
</fieldset>
);
const modern = boot?.decision.variant === "B";
return (
<div
@@ -1384,12 +1540,14 @@ export function DigitalHome({
</div>
)}
{showSettings && settings && (
<div className="dh-overlay">
<div className={`dh-overlay ${selectionSheet ? "dh-sheet-open" : ""}`}>
<form
className="dh-settings"
role="dialog"
aria-modal="true"
aria-label="对话设定"
aria-hidden={selectionSheet ? true : undefined}
inert={selectionSheet ? true : undefined}
onSubmit={saveSettings}
>
<header>
@@ -1406,101 +1564,188 @@ export function DigitalHome({
<X />
</button>
</header>
<label>
你的称呼
<input
maxLength={60}
value={settings.userName}
onChange={(e) =>
setSettings({ ...settings, userName: e.target.value })
}
/>
</label>
<label>
本次身份
<textarea
rows={3}
maxLength={2000}
value={settings.persona}
onChange={(e) =>
setSettings({ ...settings, persona: e.target.value })
}
/>
</label>
<button
className="dh-text-button"
type="button"
onClick={() =>
setSettings({
...settings,
userName: profile?.userName ?? "旅人",
persona: profile?.persona ?? "",
})
}
>
使用我的身份资料
</button>
<label>
固定记忆
<textarea
rows={3}
maxLength={3000}
value={settings.memory}
placeholder="记录你们共同经历的重要事实…"
onChange={(e) =>
setSettings({ ...settings, memory: e.target.value })
}
/>
</label>
<label>
叙事风格
<select
value={settings.presetId ?? ""}
onChange={(e) =>
<div className="dh-settings-body">
<label>
你的称呼
<input
maxLength={60}
value={settings.userName}
onChange={(e) =>
setSettings({ ...settings, userName: e.target.value })
}
/>
</label>
<label>
本次身份
<textarea
rows={3}
maxLength={2000}
value={settings.persona}
onChange={(e) =>
setSettings({ ...settings, persona: e.target.value })
}
/>
</label>
<button
className="dh-text-button"
type="button"
onClick={() =>
setSettings({
...settings,
presetId: e.target.value || undefined,
userName: profile?.userName ?? "旅人",
persona: profile?.persona ?? "",
})
}
>
<option value="">角色默认风格</option>
{presets.map((p) => (
<option key={p.id} value={p.id}>
{p.name}
</option>
))}
</select>
</label>
<fieldset>
<legend>加入世界书</legend>
{books.map((b) => (
<label className="dh-checkbox" key={b.id}>
<input
type="checkbox"
checked={settings.bookIds.includes(b.id)}
onChange={(e) =>
setSettings({
...settings,
bookIds: e.target.checked
? [...settings.bookIds, b.id]
: settings.bookIds.filter((v) => v !== b.id),
})
}
/>
使用我的身份资料
</button>
<label>
固定记忆
<textarea
rows={3}
maxLength={3000}
value={settings.memory}
placeholder="记录你们共同经历的重要事实…"
onChange={(e) =>
setSettings({ ...settings, memory: e.target.value })
}
/>
</label>
<div className="dh-mobile-choices">
<button
type="button"
className="dh-choice-trigger"
aria-label="选择叙事风格"
onClick={() => openSelection("style")}
>
<WandSparkles aria-hidden="true" />
<span>
{b.name}
<small>{b.description}</small>
<strong>叙事风格</strong>
<small>
{presets.find((p) => p.id === settings.presetId)?.name ??
(settings.presetId ? "当前会话风格" : "角色默认风格")}
</small>
</span>
</label>
))}
</fieldset>
<p className="dh-form-note">
保存后从下一次回复生效。可以固定单条消息,将它加入对话记忆。
</p>
<ChevronRight aria-hidden="true" />
</button>
<button
type="button"
className="dh-choice-trigger"
aria-label="选择世界书"
onClick={() => openSelection("books")}
>
<BookOpen aria-hidden="true" />
<span>
<strong>加入世界书</strong>
<small>
{settings.bookIds.length
? `已选 ${settings.bookIds.length} 本 · ${books
.filter((b) => settings.bookIds.includes(b.id))
.map((b) => b.name)
.join("、")}`
: "未加入世界书"}
</small>
</span>
<ChevronRight aria-hidden="true" />
</button>
</div>
<div className="dh-desktop-choices">
{styleChoices(settings.presetId, (value) =>
setSettings({ ...settings, presetId: value }),
)}
{bookChoices(settings.bookIds, (value) =>
setSettings({ ...settings, bookIds: value }),
)}
</div>
<p className="dh-form-note">
保存后从下一次回复生效。可以固定单条消息,将它加入对话记忆。
</p>
</div>
<button className="dh-primary" type="submit">
保存设定
</button>
</form>
{selectionSheet && (
<div className="dh-selection-layer">
<button
type="button"
className="dh-selection-backdrop"
aria-label="取消选择"
tabIndex={-1}
onClick={() => setSelectionSheet(null)}
/>
<section
className="dh-selection-sheet"
role="dialog"
aria-modal="true"
aria-label={
selectionSheet === "style" ? "选择叙事风格" : "选择世界书"
}
>
<div className="dh-sheet-handle" aria-hidden="true" />
<header>
<div>
<h2>
{selectionSheet === "style" ? "叙事风格" : "加入世界书"}
</h2>
<p>
{selectionSheet === "style"
? "选择你喜欢的故事氛围"
: "可选择多本,丰富角色的故事背景"}
</p>
</div>
<button
type="button"
className="dh-icon"
aria-label="关闭选择抽屉"
onClick={() => setSelectionSheet(null)}
>
<X />
</button>
</header>
<div className="dh-selection-body">
{selectionSheet === "style"
? styleChoices(
choiceDraft.presetId,
(value) =>
setChoiceDraft({ ...choiceDraft, presetId: value }),
true,
)
: bookChoices(
choiceDraft.bookIds,
(value) =>
setChoiceDraft({ ...choiceDraft, bookIds: value }),
true,
)}
</div>
<footer>
<button
type="button"
className="dh-sheet-reset"
onClick={() =>
setChoiceDraft(
selectionSheet === "style"
? { ...choiceDraft, presetId: undefined }
: { ...choiceDraft, bookIds: [] },
)
}
>
{selectionSheet === "style" ? "恢复默认" : "清空选择"}
</button>
<button
type="button"
className="dh-primary"
onClick={confirmSelection}
>
确认选择
{selectionSheet === "books"
? `(${choiceDraft.bookIds.length})`
: ""}
</button>
</footer>
</section>
</div>
)}
</div>
)}
</div>
+331 -2
View File
@@ -699,7 +699,7 @@
margin-top: 6px;
}
.dh-profile-form > label,
.dh-settings > label {
.dh-settings-body > label {
display: flex;
flex-direction: column;
gap: 9px;
@@ -858,9 +858,11 @@
background: #ffffff0b;
}
.dh-settings {
display: flex;
flex-direction: column;
width: min(520px, 100%);
max-height: 90dvh;
overflow: auto;
overflow: hidden;
padding: 28px;
background: var(--dh-panel);
border: 1px solid #ffffff1a;
@@ -868,6 +870,7 @@
}
.dh-settings > header {
display: flex;
flex: none;
justify-content: space-between;
margin-bottom: 26px;
}
@@ -886,6 +889,323 @@
color: var(--dh-muted);
padding: 0 6px;
}
/* 保留原生单选的键盘与读屏语义,整张风格卡可点击且随双主题变色。 */
.dh-settings .dh-style-picker {
min-width: 0;
padding: 0;
margin: 0 0 22px;
border: 0;
}
.dh-style-picker legend {
padding: 0;
color: #d4cbd5;
}
.dh-style-help {
margin: 5px 0 12px !important;
color: var(--dh-muted);
font-size: 11px;
}
.dh-style-options {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 10px;
}
.dh-style-option {
position: relative;
min-width: 0;
cursor: pointer;
-webkit-tap-highlight-color: transparent;
}
.dh-style-option:first-child,
.dh-style-option:last-child:nth-child(even) {
grid-column: 1 / -1;
}
.dh-style-option > input {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: 0;
opacity: 0;
clip-path: inset(50%);
}
.dh-style-card {
display: flex;
align-items: flex-start;
gap: 10px;
height: 100%;
min-height: 88px;
padding: 15px 13px;
border: 1px solid #ffffff17;
border-radius: 13px;
background: color-mix(in srgb, var(--dh-soft) 60%, var(--dh-panel));
transition:
border-color 160ms,
background 160ms;
}
.dh-style-option:hover .dh-style-card {
border-color: color-mix(in srgb, var(--dh-accent) 55%, transparent);
}
.dh-style-option > input:checked + .dh-style-card {
border-color: var(--dh-accent);
background: color-mix(in srgb, var(--dh-accent) 9%, var(--dh-panel));
}
.dh-style-option > input:focus-visible + .dh-style-card {
outline: 2px solid var(--dh-accent);
outline-offset: 3px;
}
.dh-style-symbol {
display: grid;
flex: none;
place-items: center;
width: 29px;
height: 29px;
color: var(--dh-accent);
background: color-mix(in srgb, var(--dh-accent) 10%, transparent);
border-radius: 9px;
}
.dh-style-symbol svg {
width: 15px;
height: 15px;
}
.dh-style-copy {
flex: 1;
min-width: 0;
overflow-wrap: anywhere;
}
.dh-style-copy strong {
display: block;
font-size: 12px;
font-weight: 600;
line-height: 1.6;
}
.dh-style-copy small {
display: block;
margin-top: 5px;
color: var(--dh-muted);
font-size: 11px;
line-height: 1.7;
}
.dh-style-check {
display: grid;
flex: none;
place-items: center;
width: 17px;
height: 17px;
margin-top: 2px;
color: transparent;
border: 1px solid #ffffff30;
border-radius: 50%;
}
.dh-style-check svg {
width: 11px;
height: 11px;
stroke-width: 3;
}
.dh-style-option > input:checked + .dh-style-card .dh-style-check {
color: var(--dh-accent-ink);
background: var(--dh-accent);
border-color: var(--dh-accent);
}
@media (width <= 600px) {
.dh-style-options {
grid-template-columns: minmax(0, 1fr);
}
.dh-style-card {
min-height: 76px;
}
}
/* H5 选择项以底部抽屉编辑草稿,确认后才回填到对话设定。 */
.dh-mobile-choices {
display: none;
}
.dh-overlay.dh-sheet-open {
overflow: hidden;
}
.dh-app .dh-selection-backdrop {
touch-action: none;
}
.dh-selection-layer {
position: fixed;
inset: 0;
z-index: 2;
display: flex;
align-items: flex-end;
justify-content: center;
overscroll-behavior: contain;
}
.dh-selection-backdrop {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
background: #0009 !important;
}
.dh-selection-sheet {
position: relative;
display: flex;
flex-direction: column;
width: 100%;
max-height: 86dvh;
min-height: 0;
overflow: hidden;
background: var(--dh-panel);
border: 1px solid #ffffff1c;
border-bottom: 0;
border-radius: 24px 24px 0 0;
box-shadow: 0 -16px 60px #0005;
animation: dh-sheet-enter 180ms ease-out;
}
.dh-sheet-handle {
flex: none;
width: 34px;
height: 4px;
margin: 10px auto 7px;
background: #ffffff35;
border-radius: 4px;
}
.dh-selection-sheet > header {
display: flex;
flex: none;
align-items: center;
justify-content: space-between;
padding: 10px 20px 18px;
}
.dh-selection-sheet h2 {
font-size: 20px;
font-weight: 600;
}
.dh-selection-sheet header p {
margin-top: 4px;
color: var(--dh-muted);
font-size: 11px;
}
.dh-selection-body {
flex: 1;
min-height: 0;
padding: 0 20px 20px;
overflow-y: auto;
overscroll-behavior: contain;
}
.dh-selection-sheet .dh-style-picker,
.dh-selection-sheet .dh-book-picker {
min-width: 0;
padding: 0;
margin: 0;
border: 0;
}
.dh-selection-sheet .dh-checkbox {
min-height: 74px;
padding: 14px;
margin: 0 0 10px;
border: 1px solid #ffffff17;
border-radius: 13px;
cursor: pointer;
}
.dh-selection-sheet .dh-checkbox.is-selected {
background: color-mix(in srgb, var(--dh-accent) 9%, var(--dh-panel));
border-color: var(--dh-accent);
}
.dh-selection-sheet .dh-checkbox:focus-within {
outline: 2px solid var(--dh-accent);
outline-offset: 2px;
}
.dh-selection-sheet .dh-checkbox small {
font-size: 11px;
}
.dh-selection-sheet > footer {
display: flex;
flex: none;
gap: 12px;
padding: 14px 20px calc(18px + env(safe-area-inset-bottom));
border-top: 1px solid var(--dh-line);
}
.dh-selection-sheet footer > button {
min-height: 46px;
}
.dh-selection-sheet footer > .dh-primary {
flex: 1;
justify-content: center;
}
.dh-sheet-reset {
min-width: 84px;
color: var(--dh-muted) !important;
font-size: 12px !important;
}
.dh-visually-hidden {
position: absolute;
width: 1px;
height: 1px;
padding: 0 !important;
margin: -1px;
overflow: hidden;
white-space: nowrap;
clip-path: inset(50%);
}
@keyframes dh-sheet-enter {
from {
transform: translateY(100%);
}
to {
transform: translateY(0);
}
}
@media (width > 600px) {
.dh-selection-layer {
display: none;
}
}
@media (width <= 600px) {
.dh-desktop-choices {
display: none;
}
.dh-mobile-choices {
display: grid;
gap: 10px;
margin: 0 0 22px;
}
.dh-choice-trigger {
display: flex;
gap: 12px;
align-items: center;
width: 100%;
min-height: 78px;
padding: 15px 14px !important;
text-align: left;
border: 1px solid #ffffff17 !important;
border-radius: 13px;
background: var(--dh-soft) !important;
}
.dh-choice-trigger > svg {
flex: none;
width: 18px;
height: 18px;
color: var(--dh-accent);
}
.dh-choice-trigger > svg:last-child {
width: 16px;
color: var(--dh-muted);
}
.dh-choice-trigger > span {
flex: 1;
min-width: 0;
}
.dh-choice-trigger strong {
display: block;
font-size: 12px;
font-weight: 500;
}
.dh-choice-trigger small {
display: block;
margin-top: 5px;
overflow: hidden;
color: var(--dh-muted);
font-size: 11px;
text-overflow: ellipsis;
white-space: nowrap;
}
}
.dh-checkbox {
display: flex;
gap: 12px;
@@ -910,7 +1230,16 @@
padding: 0 !important;
margin: -6px 0 22px;
}
.dh-settings-body {
flex: 1;
min-height: 0;
padding: 4px;
overflow-y: auto;
overscroll-behavior: contain;
}
.dh-settings > .dh-primary {
flex: none;
margin-top: 16px;
width: 100%;
}
/* 聊天固定在动态视口内;消息区独立滚动,输入框不会盖住底部消息。 */