Pārlūkot izejas kodu

feat(push): 极光推送完整接入 + 任务完成时机修复 + 移动端 UI 改进

## 极光推送(2026-11-20)

### 别名规则变更
别名 = Parse 的 User Object ID(如 xhVRjTMwQH),不再要求 fm_ + hash。
原设计是「后端签发的不可反推 ID」,但团队确认直接用 Object ID 更直接:
服务端推送时 audience.alias = [用户ObjectId],无需额外映射表。

校验同步放宽(前端 regex + 原生 matches):^[A-Za-z0-9]{6,64}$。

### 接上别名绑定(此前 bindAccount 定义了但从未调用)
jpush.lifecycle 重写:
  · 登录后自动 setAlias(用户ObjectID)
  · 换账号先解绑再绑新的
  · 仅换租户不解绑(推送按「人」而非「公司」)
  · 等 phase === 'started' 才绑(SDK 未就绪时会被原生拒绝)

### 隐私同意 UI
权限引导弹层点「开启通知」时:
  ① push.start({ privacyConsent: true })  启动 SDK
  ② notifySvc.request()                    申请系统权限
顺序有意为之:先 SDK 后系统权限(SDK 拿到 registrationId 才有意义)。

### 两级开关
Gradle fmodeJpushEnabled 决定 SDK 是否打进 APK
JPUSH_CONFIGURED 决定前端是否调用
两者都开才工作。

## 任务完成通知时机修复

用户反馈「任务还没结束就推送了完成通知」。

根因:task-pulse 原实现「running → 非 running 即报完成」,
但容器跑工具调用时状态会短暂抖动,一次心跳就被判成完成。

修复:加 20 秒确认期
  · 翻转时只挂「待确认」,不推送
  · 期间变回 running → 作废(是抖动)
  · 20 秒后仍非 running → 确认完成

20 秒依据:容器心跳约 30 秒,工具间隙通常十几秒内恢复。

## 实测结果(小米 M2102K1AC / Android 14)

✅ App 在前台收到推送:6 条通知,渠道 JPush_3_7,通知栏正常显示
✅ registrationId: 13065ffa4f50dfca587
✅ 别名绑定成功
✅ 云函数返回 {"code":200,"msgId":"..."}
❌ App 切后台收不到(极光长连接被系统限制,需厂商通道)

## 踩坑记录(详见文档)

1. 旧 AppKey 不是 Android 平台的:极光返回 code 1009
   "Your appKey is related to a non-Android App" → 换新 Key 解决
2. 推送请求体顶层不能有 title:返回 1009 Unknown: title
   → 标题必须放 notification.android.title
3. 通知权限被拒:推送成功但通知栏空白
   → adb shell cmd appops get 显示 ignore,授权后正常

## 安全

- AppKey 存 .env.jpush(gitignore)
- Master Secret 只存云函数常量(该文件 gitignore)
- 文档中的 AppKey 已脱敏
- 验证:git log -S 搜索凭据为空,从未进过历史

## 其他

- .gitignore 新增:jiguang-sdk.zip / fmode-deploy-kit.zip / 推送云函数 / .env.jpush
- 本次一并提交工作区中其他未提交的移动端 UI 改动

单测 1875/1875 通过。

Co-Authored-By: Claude Code <noreply@anthropic.com>
Huccct 1 dienu atpakaļ
vecāks
revīzija
58508997d3
83 mainītis faili ar 17737 papildinājumiem un 203 dzēšanām
  1. 9 0
      .gitignore
  2. 13 2
      android/app/src/main/java/cn/fmode/app/JPushPlugin.java
  3. 22 0
      docs/00-tracking/操作追踪.md
  4. 68 0
      docs/02-design/mobile-ui-review-20261120.md
  5. 33 0
      docs/02-design/plans/2026-11-20-mobile-ui-refinement.md
  6. 273 0
      docs/03-interface/极光推送-接入与实测记录-20261120.md
  7. 2 0
      package.json
  8. BIN
      prototypes/fmode-download-20261120/.menu-test.png
  9. 93 0
      prototypes/fmode-download-20261120/LICENSE-Geist.txt
  10. 17 0
      prototypes/fmode-download-20261120/README.md
  11. 12 0
      prototypes/fmode-download-20261120/build.mjs
  12. 12 0
      prototypes/fmode-download-20261120/index.html
  13. BIN
      prototypes/fmode-download-20261120/preview-desktop.png
  14. BIN
      prototypes/fmode-download-20261120/preview-footer.png
  15. BIN
      prototypes/fmode-download-20261120/preview-full.png
  16. BIN
      prototypes/fmode-download-20261120/preview-mobile.png
  17. 5 0
      prototypes/fmode-download-20261120/site.css
  18. 137 0
      prototypes/fmode-download-20261120/site.js
  19. 106 0
      prototypes/fmode-download-20261120/site.template.html
  20. 38 0
      prototypes/mobile-current-polish-20261116/README.md
  21. 983 0
      prototypes/mobile-current-polish-20261116/app.js
  22. 14 0
      prototypes/mobile-current-polish-20261116/build.mjs
  23. 3350 0
      prototypes/mobile-current-polish-20261116/index.html
  24. BIN
      prototypes/mobile-current-polish-20261116/preview-chat-comparison.png
  25. BIN
      prototypes/mobile-current-polish-20261116/preview-chat.png
  26. BIN
      prototypes/mobile-current-polish-20261116/preview-comparison.png
  27. BIN
      prototypes/mobile-current-polish-20261116/preview-contacts.png
  28. BIN
      prototypes/mobile-current-polish-20261116/preview-drawer.png
  29. BIN
      prototypes/mobile-current-polish-20261116/preview-home.png
  30. BIN
      prototypes/mobile-current-polish-20261116/preview-messages.png
  31. BIN
      prototypes/mobile-current-polish-20261116/preview-mine.png
  32. BIN
      prototypes/mobile-current-polish-20261116/preview-switcher.png
  33. BIN
      prototypes/mobile-current-polish-20261116/preview-workbench.png
  34. 65 0
      prototypes/mobile-current-polish-20261116/preview.template.html
  35. 2302 0
      prototypes/mobile-current-polish-20261116/styles.css
  36. 351 0
      prototypes/mobile-current-polish-20261116/verify.mjs
  37. 42 0
      prototypes/mobile-refresh-20261116/DESIGN.md
  38. 56 0
      prototypes/mobile-refresh-20261116/README.md
  39. 1395 0
      prototypes/mobile-refresh-20261116/app.js
  40. 9 0
      prototypes/mobile-refresh-20261116/build-single.mjs
  41. 97 0
      prototypes/mobile-refresh-20261116/index.html
  42. 4328 0
      prototypes/mobile-refresh-20261116/mobile-preview.html
  43. BIN
      prototypes/mobile-refresh-20261116/preview-chat.png
  44. BIN
      prototypes/mobile-refresh-20261116/preview-completion.png
  45. BIN
      prototypes/mobile-refresh-20261116/preview-desktop.png
  46. BIN
      prototypes/mobile-refresh-20261116/preview-drawer.png
  47. BIN
      prototypes/mobile-refresh-20261116/preview-home.png
  48. BIN
      prototypes/mobile-refresh-20261116/preview-switcher.png
  49. BIN
      prototypes/mobile-refresh-20261116/preview-title.png
  50. BIN
      prototypes/mobile-refresh-20261116/preview-workbench.png
  51. 38 0
      prototypes/mobile-refresh-20261116/preview.mjs
  52. 2832 0
      prototypes/mobile-refresh-20261116/styles.css
  53. 271 0
      prototypes/mobile-refresh-20261116/verify.mjs
  54. 182 0
      scripts/review-mobile-ui.mjs
  55. 2 2
      scripts/verify-mobile-composer.mjs
  56. 9 2
      src/app/app.ts
  57. 8 1
      src/app/components/domain/message-bubble/message-bubble.ts
  58. 34 10
      src/app/core/jpush.lifecycle.spec.ts
  59. 72 10
      src/app/core/jpush.lifecycle.ts
  60. 24 1
      src/app/core/jpush.plugin.ts
  61. 24 9
      src/app/core/jpush.service.spec.ts
  62. 23 1
      src/app/core/jpush.service.ts
  63. 1 1
      src/app/core/styles/_base.scss
  64. 30 7
      src/app/core/task-pulse.service.spec.ts
  65. 53 7
      src/app/core/task-pulse.service.ts
  66. 13 37
      src/app/mobile/components/m-app-bar/m-app-bar.ts
  67. 2 2
      src/app/mobile/components/m-badge/m-badge.ts
  68. 65 0
      src/app/mobile/components/m-dock/m-dock.spec.ts
  69. 29 13
      src/app/mobile/components/m-dock/m-dock.ts
  70. 4 1
      src/app/mobile/components/m-drawer/m-drawer.ts
  71. 12 12
      src/app/mobile/components/m-life-card/m-life-card.ts
  72. 6 3
      src/app/mobile/components/m-new-chat/m-new-chat.ts
  73. 12 3
      src/app/mobile/components/m-search/m-search.ts
  74. 5 4
      src/app/mobile/components/m-segmented/m-segmented.ts
  75. 30 1
      src/app/mobile/components/permission-guide/permission-guide.ts
  76. 4 2
      src/app/mobile/pages/chat/chat.ts
  77. 7 4
      src/app/mobile/pages/contacts/contacts.ts
  78. 32 8
      src/app/mobile/pages/messages/messages.ts
  79. 63 54
      src/app/mobile/pages/mine/mine.ts
  80. 8 4
      src/app/mobile/pages/workbench/workbench.ts
  81. 8 0
      src/app/mobile/presentation.ts
  82. 1 1
      src/app/mobile/shell/mobile-shell.ts
  83. 1 1
      src/styles.scss

+ 9 - 0
.gitignore

@@ -95,3 +95,12 @@ android/.kotlin/
 
 # 打包产物(本地分发给测试同事用,不入库)
 /release/
+
+# 🔴 推送云函数含 Master Secret 明文(2026-11-20 用户要求不外发)
+#    只在本地保存,部署时直接 PUT 到线上;需要版本管理时放 .local-backup/
+cloud/functions/fmodeagent-push.js
+.env.jpush
+
+# 第三方 SDK 与部署包(体积大,按需从源获取)
+jiguang-sdk.zip
+fmode-deploy-kit.zip

+ 13 - 2
android/app/src/main/java/cn/fmode/app/JPushPlugin.java

@@ -145,8 +145,19 @@ public class JPushPlugin extends Plugin {
     @PluginMethod
     public void setAlias(PluginCall call) {
         String alias = call.getString("alias", "");
-        if (!alias.matches("fm_[a-f0-9]{32,60}")) {
-            call.reject("A backend-issued opaque alias is required", "JPUSH_INVALID_ALIAS");
+        /*
+         * 🔴 别名 = Parse 的 User Object ID(2026-11-20 用户裁决)。
+         *
+         * 原来要求 `fm_[a-f0-9]{32,60}`(后端签发的不可反推 ID)。
+         * 现在直接用用户 Object ID,服务端推送时 `audience.alias = [ObjectId]`,
+         * 不需要额外的映射表。
+         *
+         * 校验放宽为「字母数字、6~64 位」:
+         *   · Parse Object ID 是 10 位字母数字
+         *   · 仍拒绝空值、空格、控制字符(极光对别名格式有要求,非法别名会被静默丢弃)
+         */
+        if (!alias.matches("[A-Za-z0-9]{6,64}")) {
+            call.reject("alias must be a Parse object id", "JPUSH_INVALID_ALIAS");
             return;
         }
         changeAlias(call, alias);

+ 22 - 0
docs/00-tracking/操作追踪.md

@@ -8492,3 +8492,25 @@ URL 不会重复显示:`chat.service.ts:2349` 的 `stripLinks` 会把已提取
 | **真机验证** | ✅ 对账提示正确显示「还有 1 个文件未收到」;✅ 切到会话 B 无任何 A 的内容;✅ 切回 A 内容完好;✅ 容器回复 9 个回合无丢失 |
 | **⚠️ 排障误判(重要)** | 曾误判「修复导致容器回复全丢」——实际是**统计口径错误**(容器回复渲染在 `app-assistant-turn`,不是 `app-m-msg`)。用同口径测原始版也得到 0,才发现问题在测量方法。教训:断言功能坏了之前,先对已知正常的版本跑同样的测量 |
 | **仍需容器侧解决** | 适配器漏发 `m.file` 事件;建议容器在消息里带「文件名数组 + 数量」的自描述清单供精确对账 |
+
+
+## 2026-11-20 · 移动端 UI 优化与本地审查入口
+
+| 项 | 内容 |
+|---|---|
+| 授权与原因 | 用户批准按移动端审查计划实施,并要求提供完成后的审查方式;优化小控件触达、标题偏移、卡片粘连、信息层级与离线配色 |
+| 实现 | 对称顶栏;60/64px 顶底栏与 16px 页边距;高频按钮至少 44px;工作台 12px 卡片间距;列表 16/14/12px 层级;离线中性色、异常保留危险色;设置顺序调整并保留 Token;Enter 换行与输入法保护 |
+| 补充修复 | 全屏聊天深链接未恢复外观偏好,根组件启动主题服务,并随用户身份恢复字号;加强回归断言以核验实际深色、20px、配色 |
+| 涉及文件 | app.ts、mobile 组件/页面、message-bubble、core/styles/_base.scss、styles.scss、package.json、scripts/review-mobile-ui.mjs、verify-mobile-composer.mjs;未修改 ui 底座和后端契约 |
+| 验证 | 生产构建通过;1875/1875 单元测试;41/41 浏览器检查;3/3 本地注入视觉状态;审查窗口启动验证通过;git diff --check 通过 |
+| 存量检查 | verify:ui 3/12 未通过,与改前 HEAD 归档相同:颜色扫描(含 HTML 实体误报)、字号字面量、底座组件计数;全局样式 299/300 行 |
+| 审查入口 | npm run review:mobile 打开隔离 Mock 手机窗口,远程请求阻断;npm run verify:mobile-ui 重跑浏览器验证;test-results/mobile-ui-20261120/index.html 为实际页面前后截图对照 |
+| 关联文档 | [设计计划](../02-design/plans/2026-11-20-mobile-ui-refinement.md)、[审查说明](../02-design/mobile-ui-review-20261120.md) |
+| 遗留/未验证 | 真机软键盘、安全区、系统大字体和触控/旋转待复验;未发布、未提交 Git、未更新 APK;保留两份原有未跟踪原型 |
+
+## 2026-11-20 · 按用户要求回退本轮组件与 PC UI 优化
+
+- 用户要求「回退你这次修改」;定向恢复全局提示、确认弹窗、PC界面及对应状态展示映射。
+- 移除本轮新增组件、测试、PC审查脚本和文档/图库;恢复原Toast及双端退出组件。
+- 保留上一轮移动端布局、触达、输入法和外观恢复优化,以及原有两份未跟踪原型;保留review:mobile与verify:mobile-ui入口。
+- 回退验证:生产构建通过;1875/1875 单测通过;桌面及本轮共享组件已无工作区diff,未遗留新增组件引用;git diff --check通过。

+ 68 - 0
docs/02-design/mobile-ui-review-20261120.md

@@ -0,0 +1,68 @@
+# 移动端 UI 优化审查说明(2026-11-20)
+
+本轮优化已落到当前 Angular 页面。范围覆盖会话、通讯录、工作台、我的、聊天页及共用移动组件;没有发布网站或更新手机安装包。
+
+## 打开可交互审查窗口
+
+在项目目录 `E:\work\fmode-app` 的终端运行:
+
+```powershell
+npm run review:mobile
+```
+
+命令会编译当前源码,选择空闲的本地端口,打开 390 × 844 的独立 Chrome/Edge 手机模拟窗口。首次打开需要等待编译。窗口内使用独立的 Mock 登录和演示会话,远程业务请求已阻断,不会向实际容器发消息,也不影响普通浏览器的登录和偏好。关闭审查浏览器,或在终端按 Ctrl+C 结束。
+
+底栏依次进入四个主页面。聊天页可点击演示会话进入;终端也会打印可直接粘贴到该窗口地址栏的聊天地址。不要在普通浏览器打开这个地址期待自动登录,演示数据只注入独立窗口。
+
+## 建议按这个顺序审查
+
+| 页面或状态 | 操作 | 通过标准 |
+|---|---|---|
+| 会话列表 | 浏览长标题、摘要和时间,滚到最后一条 | 标题层级清楚,长标题最多两行;文字不挤时间;最后一条能完整滚出底栏 |
+| 通讯录 | 切换同事/数字生命、搜索、展开同事 | 搜索和筛选容易点;没有手机号时不显示多余分隔符;状态有文字说明 |
+| 工作台 | 看离线/异常卡片,滚动到底 | 卡片间距 12px;离线用灰色,异常用红色;进入会话是明确主操作;末张卡片不被底栏遮挡 |
+| 聊天输入 | 连续输入三行、中文选字、点击发送 | Enter 换行;选字回车不发送;点击发送后消息出现、草稿清空、输入框收回;外接键盘 Ctrl/Cmd+Enter 可发送 |
+| 聊天操作 | 打开成果与状态,再关闭;打开抽屉 | 详情和抽屉正常开关;顶部按钮不遮挡标题;附件/发送/消息操作按钮容易点 |
+| 我的 | 切换四套配色、深色模式,将字号调到 20px | 选中态明确;深色开关显示已开启/已关闭;两列配色完整;大字号下仍能阅读和操作 |
+| 偏好恢复 | 设置深色和 20px 后直接进入聊天页,再刷新 | 仍保持已保存的配色、深色和字号,无需先进入「我的」 |
+| 账号 | 滚动到账号区域,显示/隐藏演示 Token | Token 与退出功能仍可用,按钮点击范围已扩大;退出确认可取消 |
+
+浏览器模拟下也建议用 320/360/390/430px 四种宽度看一遍,关注横向滚动、文字重叠与最后一项遮挡。最窄屏幕、大字号、聊天页多个顶栏按钮同时出现时,长标题会显示省略号,这是预期行为。
+
+## 截图与异常状态
+
+本机截图对照页:`test-results/mobile-ui-20261120/index.html`,用浏览器打开即可。包含优化前后五个主要页面、320px 深色大字号,以及加载、空白、错误状态。前后使用的数据不同,比较布局、字号、间距和层级即可。
+
+加载、空白、错误截图由本地 Mock 浏览器注入组件状态得到;3 项均已检查提示内容可见。这是视觉状态检查,不代表真实后端断网或故障链路已验证。错误截图中的重试入口仍使用既有逻辑。
+
+## 本轮变化
+
+- 布局:顶栏采用对称网格居中,长标题受限于中栏;移动顶栏 60px、底栏 64px、页边距 16px,继续叠加安全区;工作台卡片间距 12px。
+- 尺寸:列表标题 16px、摘要 14px、导航和状态文字 12px,随既有字号偏好缩放;发送、附件、筛选、清空搜索、Token 和消息操作等高频按钮扩大到至少 44px。
+- 配色:保留四套既有色板及铂金曜黑默认方案;减弱阴影和边框;离线/已停止改中性色,明确异常保留危险色,通道问题保留警告色;状态判据仍来自共享服务。
+- 层级:工作台突出「进入会话」;设置页按资料、通知(原生端)、外观、账号排列,保留 Token 能力。
+- 输入:普通 Enter 换行、组合态不发送,外接键盘保留 Ctrl/Cmd+Enter,提交期间锁定重复发送。
+- 外观恢复:应用启动即恢复明暗模式,并按当前用户加载字号,覆盖全屏聊天深链接和身份切换。
+
+## 验证结果与边界
+
+| 检查 | 结果 | 证据 |
+|---|---|---|
+| 生产构建 `npm run build` | 通过,仍有既有依赖优化警告 | `test-results/mobile-ui-20261120/build.log` |
+| 全量单元测试 | 1875/1875,通过 | `test-results/mobile-ui-20261120/unit.log` |
+| `npm run verify:mobile-ui` | 41/41,通过 | 同目录 `results.json`、`browser.log` 与页面截图 |
+| 加载/空白/错误视觉状态 | 3/3,通过,本地状态注入 | 同目录 `state-results.json`、`state-*.png` |
+| UI 静态规范 `npm run verify:ui` | 9/12,通过;3 项为存量失败,改前基线同样失败 | 硬编码颜色扫描、字号字面量、底座组件计数;本轮未改底座 |
+| 改动空白检查 | `git diff --check` 通过 | 本地 Git 检查 |
+
+静态检查存量明细:颜色扫描 7 项(其中 6 项为 HTML 实体 `&#126;` 被当作颜色,另 1 项在管理页);字号字面量 3 项;底座组件计数 23,检查阈值 30。全局样式预算 299/300 行。
+
+尚需真机复验:中文软键盘弹出和收起、手势区域/刘海安全区、系统字体放大、物理点击手感与横竖屏变化。本轮没有重新打包或安装 APK,手机上已安装的旧版不会自动变为本次 UI。
+
+自动回归可以重复运行:
+
+```powershell
+npm run verify:mobile-ui
+```
+
+反馈时写明「页面 + 操作 + 实际表现 + 希望的结果」,例如「我的 / 20px 字号 / 配色名称太挤 / 希望增加纵向留白」,方便逐项复核。

+ 33 - 0
docs/02-design/plans/2026-11-20-mobile-ui-refinement.md

@@ -0,0 +1,33 @@
+# 移动端 UI 精修与审查
+
+用户已授权按 2026-11-20 审查计划直接优化 UI。本轮基于当前 Angular 页面落地,保留四栏导航、既有有效路由、主题偏好与业务数据契约。
+
+## 实施范围
+
+1. 输入可靠性:Enter 换行;组合态不触发快捷发送;Ctrl/Cmd+Enter 作为外接键盘快捷键;提交期间防重复。
+2. 布局与触控:顶栏对称网格居中,长标题限制在中栏;高频操作至少 44px;卡片间距 12px;移动顶栏 60px、底栏 64px、页边距 16px,保留安全区。
+3. 视觉层级:列表标题 16px、摘要 14px、底栏及状态 12px;内缩分隔线;减弱容器阴影;离线用中性样式,异常保留危险色。状态判断逻辑保持共享真源,仅移动展示映射。
+4. 聊天与工作台:输入坞减重、工具行拇指可达;工作台突出当前任务和进入会话,弱化指标和次操作。
+5. 我的:保留 Token 能力,外观和通知在前、账号与退出在后;主题切换说明清晰;窄屏主题预览自适应。
+
+## 验收
+
+- 320/360/390/430px 下五个主要页面无横向溢出;标题居中且与按钮无重叠。
+- Enter 插入换行,输入法组合态不发送;点击发送和外接键盘快捷键可提交,多行发送后高度复位。
+- 搜索、筛选、输入、Token 与工作台高频控件满足 44px 点击区域。
+- 明暗主题、四套配色、最大应用字号下关键操作可见;底栏不遮挡最后一项;抽屉与详情面板可开关。
+- 运行针对输入行为的必要单元测试、移动端浏览器回归、现有 UI 静态检查及生产构建。截图使用隔离 Mock 数据,不向生产发送消息。
+- 真机软键盘、安全区和系统大字体在用户审查清单中单列,不以桌面模拟替代。
+
+## 审查入口
+
+实施后提供本地预览命令、逐页检查顺序、状态说明、前后截图与自动验证结果。最终状态在本文件末尾补充。
+
+## 实施结果(2026-11-20)
+
+- 上述五项范围已实现,未修改 `src/app/ui/**`,未变更后端契约;原有未跟踪原型目录保持原样。
+- 补充修复:根组件初始化明暗模式,并随当前身份加载已有字号偏好。此前直接打开全屏聊天页未实例化主题服务,刷新后可能丢失外观设置;已通过逐页完整导航检查覆盖。
+- 输入单测新增 6 项;全量单元测试 1875/1875;生产构建通过。浏览器 41/41,覆盖四种宽度、五个主页面、输入发送、面板/抽屉、卡片间距/遮挡、四套配色与深色最大字号持久化。加载/空白/错误视觉状态 3/3,仅为 Mock 状态注入。
+- 静态 UI 检查 9/12;对改前 `HEAD` 归档运行相同检查,3 项失败相同(颜色扫描、字号字面量、底座组件计数)。无新增失败,全局样式 299/300 行;未扩大范围处理存量规范问题。
+- 审查命令 `npm run review:mobile` 已验证可打开独立演示浏览器;自动回归使用 `npm run verify:mobile-ui`。详细清单见 [移动端 UI 优化审查说明](../mobile-ui-review-20261120.md)。截图对照与原始结果位于 `test-results/mobile-ui-20261120/`。
+- 待用户真机复验:软键盘、安全区、系统大字体、实际触控与旋转。本轮仅完成本地源码及构建,未发布、未提交 Git、未更新 APK。

+ 273 - 0
docs/03-interface/极光推送-接入与实测记录-20261120.md

@@ -0,0 +1,273 @@
+# 极光推送接入与实测记录(2026-11-20)
+
+> 记录从接入到真机验证的完整过程、遇到的问题与当前能力边界。
+
+---
+
+## 一、最终结论
+
+| 场景 | 能否收到 | 说明 |
+|---|---|---|
+| **App 在前台** | ✅ **已实测通过** | 6 条通知正常到达通知栏 |
+| App 切后台(进程活着) | ❌ **实测收不到** | 极光长连接被系统限制,切后台即断 |
+| App 被杀 | ❌ | 需要厂商通道 |
+
+**核心制约**:极光自身的长连接依赖 App 进程存活。要覆盖后台/被杀场景,**必须接入厂商通道**(华为/小米/OPPO/vivo)。
+
+---
+
+## 二、技术架构
+
+### 两级开关
+
+| 开关 | 位置 | 作用 |
+|---|---|---|
+| Gradle `fmodeJpushEnabled` | `android/app/build.gradle` | 决定 SDK 是否打进 APK |
+| `JPUSH_CONFIGURED` | `src/app/core/jpush.plugin.ts` | 决定前端是否调用 SDK |
+
+两者都为 false 时推送完全不工作。打开需同步改两处。
+
+### 别名规则(2026-11-20 用户裁决)
+
+**别名 = Parse 的 User Object ID**(如 `xhVRjTMwQH`)。
+
+原设计要求 `fm_` + 32 位 hash(后端签发的不可反推 ID),已放宽为
+`^[A-Za-z0-9]{6,64}$`。
+
+理由:
+- 服务端推送时 `audience.alias = [用户ObjectId]`,无需额外映射表
+- Object ID 本身是随机串,不含姓名/手机号,隐私风险与 hash 相当
+
+### 完整链路
+
+```
+① App 启动 → push.start({ privacyConsent: true })
+        ↓
+② 极光返回 registrationId(设备标识)
+        ↓
+③ 登录后 → setAlias(用户的 Object ID)
+        ↓
+④ 极光记录:这个 ID ↔ 这台设备
+        ↓
+⑤ 服务端调云函数 → POST 极光 API { audience: { alias: [用户ID] } }
+        ↓
+⑥ 推送到该用户的所有设备
+```
+
+---
+
+## 三、已完成的组件
+
+| 组件 | 文件 | 状态 |
+|---|---|---|
+| Capacitor 桥接插件 | `android/.../JPushPlugin.java` | ✅ |
+| SDK 适配层 | `android/.../JPushSdk.java` | ✅ |
+| 消息接收器 | `android/.../JPushReceiver.java` | ✅ |
+| 点击落地 | `android/.../JPushClickActivity.java` | ✅ |
+| 前台服务 | `android/.../JPushService.java` | ✅ |
+| 隔离 Manifest | `android/app/src/jpush/AndroidManifest.xml` | ✅ |
+| 前端状态机 | `src/app/core/jpush.service.ts` | ✅ |
+| **生命周期(含别名绑定)** | `src/app/core/jpush.lifecycle.ts` | ✅ **本次补全** |
+| **隐私同意 UI** | `mobile/components/permission-guide/` | ✅ **本次接入** |
+| **推送云函数** | `cloud/functions/fmodeagent-push.js` | ✅ **本次创建**(线上 id `oCRJCCdiAx`) |
+
+### 本次补全的三件事
+
+**1. 接上别名绑定**(此前 `bindAccount` 定义了但从未调用)
+
+```typescript
+// jpush.lifecycle.ts
+effect(() => {
+  const userId = this.currentUserId();
+  const phase = this.push.phase();
+  if (!userId || phase !== 'started') return;
+  if (this.boundUserId === userId) return;
+  // 换账号先解绑旧的
+  if (previous) await this.push.unbindAccount();
+  await this.push.bindAccount(userId);
+});
+```
+
+**2. 隐私同意 UI**
+
+复用现有的权限引导弹层,用户点「开启通知」时:
+```typescript
+await this.push.start(true);        // privacyConsent: true
+await this.notifySvc.request();     // 系统通知权限
+```
+
+**3. 推送云函数**
+
+Master Secret 只存在于云函数内部,绝不下发给 App。
+
+---
+
+## 四、踩坑记录
+
+### 坑 1:旧 AppKey 不是 Android 平台的 🔴
+
+**现象**:SDK 启动成功,但拿不到 `registrationId`,日志:
+
+```
+JIGUANG-JCore: Response error - code:1009
+"Your appKey is related to a non-Android App.
+ Please use your Android App's appKey, or add an Android app for this appKey."
+```
+
+**根因**:极光后台该 AppKey 对应的应用**没有创建 Android 平台**。
+
+**解决**:换用新 AppKey(已在极光后台配置了 Android 平台)。
+
+> ⚠️ **排查技巧**:极光 API 返回 `1011 cannot find user` = 认证通过、只是没设备;
+> 返回 `1009 non-Android App` = AppKey 平台不匹配。两者含义完全不同。
+
+### 坑 2:推送请求体顶层不能有 `title`
+
+**现象**:`{"error":{"code":1009,"message":"Unknown: title"}}`
+
+**根因**:极光 v3 API 的 `notification` 只接受 `alert` 这一个顶层字段。
+
+**解决**:标题必须放 `notification.android.title`。
+
+### 坑 3:通知权限被系统拒绝
+
+**现象**:推送发出成功(`code: 200`)但通知栏什么都没有,日志正常。
+
+**排查**:
+```bash
+adb shell cmd appops get cn.fmode.app POST_NOTIFICATION
+# POST_NOTIFICATION: ignore     ← 被拒
+adb shell dumpsys notification | grep -A5 "cn.fmode.app"
+# AppSettings: cn.fmode.app importance=NONE userSet=true   ← 用户手动关过
+```
+
+**解决**:授权后重测即正常。
+
+> 重装 App 会重置此权限,每次装机后要重新确认。
+
+### 坑 4:App 切后台后长连接断开 🔴
+
+**现象**:App 在前台时推送正常,切后台后推送发出但收不到,拉回前台立刻收到。
+
+**原因**:极光的长连接依赖 App 进程。Android 会限制后台网络访问,
+进程进入后台后连接被断。
+
+**结论**:这是极光自建通道的固有局限,**必须靠厂商通道解决**(见第六节)。
+
+---
+
+## 五、实测数据
+
+### 真机验证(小米 M2102K1AC / Android 14)
+
+| 项 | 值 |
+|---|---|
+| AppKey | 已配置(Android 平台),值见 `.env.jpush`(不入库) |
+| registrationId | `13065ffa4f50dfca587` |
+| 绑定别名 | `xhVRjTMwQH`(用户 Object ID) |
+| 云函数 | `oCRJCCdiAx` / `fmodeagent-push` v0.1.2 |
+| 推送返回 | `{"code":200,"msgId":"18103700310840030"}` |
+| **通知到达** | ✅ **6 条,渠道 `JPush_3_7`,通知栏正常显示** |
+
+### 凭据存放(按黄金规则 9)
+
+| 项 | 位置 | 是否入 git |
+|---|---|---|
+| AppKey | `.env.jpush` + 打进 APK | ❌ 已 gitignore |
+| Master Secret | `cloud/functions/fmodeagent-push.js` 常量 | ❌ 已 gitignore |
+
+> **验证**:`git log -S "3a46595a29dced446f620958"` 为空,凭据从未进入 git 历史。
+
+---
+
+## 六、当前能力边界与后续
+
+### 现在能做什么
+
+| 能力 | 状态 |
+|---|---|
+| App 在前台时收到推送 | ✅ |
+| 服务端主动推送(手动调云函数) | ✅ |
+| 别名按用户精准投递 | ✅ |
+| 换账号自动解绑 | ✅ |
+
+### 还缺什么
+
+| # | 缺口 | 责任方 | 说明 |
+|---|---|---|---|
+| 1 | **厂商通道** | **你** | 华为/小米/OPPO/vivo 申请,**App 后台/被杀后才能收到** |
+| 2 | **服务端触发链路** | **平台** | 监听 Matrix 新消息 → 调 `fmodeagent-push` 云函数 |
+| 3 | 厂商凭证填入极光 | 你 | 各厂商拿到 AppID/AppSecret 后填极光控制台 |
+
+### 厂商通道申请要点
+
+| 厂商 | 入口 | 需要 | 耗时 |
+|---|---|---|---|
+| **华为** | developer.huawei.com → Push Kit | **企业认证**(营业执照) | 1-2 周 |
+| **小米** | dev.mi.com → 消息推送 | 开发者账号 | 1-3 天 |
+| OPPO | open.oppomobile.com | 企业认证 | 3-5 天 |
+| vivo | dev.vivo.com.cn | 企业认证 | 3-5 天 |
+
+**包名必须填 `cn.fmode.app`**,一字不差。
+
+---
+
+## 七、任务完成通知的时机问题(已修复)
+
+### 问题
+
+用户反馈「任务还没结束就推送了完成通知」。
+
+### 根因
+
+`task-pulse.service.ts` 原实现:
+
+```typescript
+} else if (prev.running && !running) {
+  pulses.push({ kind: 'finished', ... });   // 状态一翻转就报完成
+}
+```
+
+但容器**跑工具调用的间隙**会短暂上报非 running —— 一次心跳抖动就被判成完成,
+推送发出时正文其实还在输出。
+
+### 修复:20 秒确认期
+
+```
+running → 非 running
+     ↓
+挂「待确认」(不推送)
+     ↓
+20 秒内又变回 running? → 作废(是抖动)
+     ↓
+20 秒后仍非 running → 确认完成 → 推送
+```
+
+**为什么是 20 秒**:容器心跳间隔约 30 秒,工具调用间隙通常十几秒内会恢复 running。
+
+---
+
+## 八、验收清单
+
+### 已完成 ✅
+
+- [x] AppKey 有效(极光 API 认证通过)
+- [x] SDK 打进 APK(14 个极光文件,含 `JPUSH_MESSAGE` 权限)
+- [x] SDK 初始化(`started: true`)
+- [x] 获取 registrationId
+- [x] 别名绑定(User Object ID)
+- [x] 云函数推送返回 200
+- [x] **App 前台收到通知**
+- [x] 凭据未进 git
+
+### 待验证 ⏸
+
+- [ ] App 切后台收到推送(**需要厂商通道**)
+- [ ] App 被杀收到推送(**需要厂商通道**)
+- [ ] 点击通知跳转到对应会话(需要服务端触发链路带上 sessionId)
+- [ ] 隐私同意 UI 完整流程(用户点「开启通知」→ SDK 启动 → 别名绑定)
+
+### 待开发 🔧
+
+- [ ] 服务端监听 Matrix → 调推送云函数(**平台**)
+- [ ] 厂商通道接入(**你申请 + 配置**)

+ 2 - 0
package.json

@@ -15,6 +15,8 @@
     "test": "ng test",
     "verify:docs": "node scripts/check-doc-structure.mjs docs",
     "verify:ui": "node scripts/verify-ui.mjs",
+    "review:mobile": "node scripts/review-mobile-ui.mjs",
+    "verify:mobile-ui": "node scripts/review-mobile-ui.mjs --verify",
     "smoke": "node scripts/smoke-imhub.mjs",
     "smoke:groups": "node scripts/smoke-groups.mjs",
     "deploy": "node scripts/deploy.mjs",

BIN
prototypes/fmode-download-20261120/.menu-test.png


+ 93 - 0
prototypes/fmode-download-20261120/LICENSE-Geist.txt

@@ -0,0 +1,93 @@
+Copyright 2024 The Geist Project Authors (https://github.com/vercel/geist-font) Geist-Italic[wght].ttf: Copyright 2024 The Geist Project Authors (https://github.com/vercel/geist-font)
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+This license is copied below, and is also available with a FAQ at:
+http://scripts.sil.org/OFL
+
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.

+ 17 - 0
prototypes/fmode-download-20261120/README.md

@@ -0,0 +1,17 @@
+# Fmode Android 宣传与下载官网
+
+独立、响应式 HTML 产品官网,桌面端优先,也适配窄屏查看。视觉采用黑曜石暗色界面、薄荷绿品牌色和大幅排版;参考 TRAE 等产品官网的开屏氛围、滚动节奏与页尾收束方式,再围绕 Fmode 的品牌和产品能力原创设计。内容按当前 App 已有的会话、通讯录、工作台与成果回看能力组织,不修改 Angular App、路由或 APK。
+
+## 预览
+
+直接打开 index.html 即可查看。字体、样式、插画和交互脚本都内嵌在最终 HTML 中,不请求外部资源。
+
+site.template.html、site.css 和 site.js 是便于维护的源文件。修改后运行 node prototypes/fmode-download-20261120/build.mjs,会将源码重新打包成可单独分发的 index.html。字体资源使用项目内的 Geist 字体,开源字体授权说明见 LICENSE-Geist.txt。
+
+## 接入 APK
+
+打开 site.js,将 FMODE_SITE.apkUrl 填为正式 HTTPS 地址即可启用 APK 下载。version、fileSize 和 updatedAt 可选,用于显示版本、安装包大小和更新日期。地址为空时,按钮会打开说明弹窗;地址仅允许 HTTPS 或安全的站内相对地址。
+
+产品展示区支持鼠标点击及键盘方向键切换「专注对话 / 全局工作台 / 成果回看」。人物及对话为示例文案;页面能力主题根据现有 App 页面组织。
+
+preview-desktop.png、preview-full.png、preview-mobile.png 和 preview-footer.png 是浏览器生成的页面预览截图。

+ 12 - 0
prototypes/fmode-download-20261120/build.mjs

@@ -0,0 +1,12 @@
+import fs from 'node:fs';
+import path from 'node:path';
+import { fileURLToPath } from 'node:url';
+
+const root = path.dirname(fileURLToPath(import.meta.url));
+const template = fs.readFileSync(path.join(root, 'site.template.html'), 'utf8');
+const font = fs.readFileSync(path.join(root, '../fmode-landing-20261027/assets/fonts/geist-latin-wght-normal.woff2')).toString('base64');
+const css = fs.readFileSync(path.join(root, 'site.css'), 'utf8').replace('__GEIST_FONT__', font);
+const js = fs.readFileSync(path.join(root, 'site.js'), 'utf8');
+const html = template.replace('/* INJECT_STYLES */', () => css).replace('/* INJECT_SCRIPT */', () => js);
+fs.writeFileSync(path.join(root, 'index.html'), html);
+console.log('Built standalone index.html: ' + Math.round(Buffer.byteLength(html) / 1024) + ' KB. No external requests.');

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 12 - 0
prototypes/fmode-download-20261120/index.html


BIN
prototypes/fmode-download-20261120/preview-desktop.png


BIN
prototypes/fmode-download-20261120/preview-footer.png


BIN
prototypes/fmode-download-20261120/preview-full.png


BIN
prototypes/fmode-download-20261120/preview-mobile.png


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 5 - 0
prototypes/fmode-download-20261120/site.css


+ 137 - 0
prototypes/fmode-download-20261120/site.js

@@ -0,0 +1,137 @@
+// 填入 apkUrl 即可开放下载;版本信息等字段按需提供。
+const FMODE_SITE = { apkUrl: '', version: '', fileSize: '', updatedAt: '' };
+const header = document.getElementById('header');
+const menuToggle = document.getElementById('menuToggle');
+const navLinks = document.getElementById('navLinks');
+const downloadDialog = document.getElementById('downloadDialog');
+const downloadStatus = document.getElementById('downloadStatus');
+const releaseMeta = document.getElementById('releaseMeta');
+const apkButton = document.getElementById('apkButton');
+
+const setMenuOpen = (open) => {
+  menuToggle.setAttribute('aria-expanded', String(open));
+  menuToggle.setAttribute('aria-label', open ? '收起导航' : '展开导航');
+  menuToggle.innerHTML = '<svg class="icon"><use href="#' + (open ? 'i-close' : 'i-menu') + '"/></svg>';
+  navLinks.classList.toggle('open', open);
+};
+menuToggle.addEventListener('click', () => setMenuOpen(menuToggle.getAttribute('aria-expanded') !== 'true'));
+navLinks.querySelectorAll('a').forEach((link) => link.addEventListener('click', () => setMenuOpen(false)));
+document.addEventListener('keydown', (event) => {
+  if (event.key === 'Escape' && navLinks.classList.contains('open')) { setMenuOpen(false); menuToggle.focus(); }
+});
+
+let scrollQueued = false;
+window.addEventListener('scroll', () => {
+  if (scrollQueued) return;
+  scrollQueued = true;
+  requestAnimationFrame(() => { header.classList.toggle('scrolled', window.scrollY > 8); scrollQueued = false; });
+}, { passive: true });
+
+const tabButtons = [...document.querySelectorAll('[role="tab"][data-scene]')];
+const scenes = [...document.querySelectorAll('[role="tabpanel"]')];
+const railItems = [...document.querySelectorAll('[data-rail]')];
+function activateScene(name, focusButton = false) {
+  tabButtons.forEach((tab) => {
+    const active = tab.dataset.scene === name;
+    tab.setAttribute('aria-selected', String(active));
+    tab.tabIndex = active ? 0 : -1;
+    if (active && focusButton) tab.focus();
+  });
+  scenes.forEach((scene) => { scene.hidden = scene.id !== 'scene-' + name; });
+  railItems.forEach((item) => item.classList.toggle('active', item.dataset.rail === name));
+}
+tabButtons.forEach((tab, index) => {
+  tab.addEventListener('click', () => activateScene(tab.dataset.scene));
+  tab.addEventListener('keydown', (event) => {
+    if (!['ArrowLeft', 'ArrowRight', 'Home', 'End'].includes(event.key)) return;
+    event.preventDefault();
+    let next = index;
+    if (event.key === 'ArrowRight') next = (index + 1) % tabButtons.length;
+    if (event.key === 'ArrowLeft') next = (index - 1 + tabButtons.length) % tabButtons.length;
+    if (event.key === 'Home') next = 0;
+    if (event.key === 'End') next = tabButtons.length - 1;
+    activateScene(tabButtons[next].dataset.scene, true);
+  });
+});
+
+const closeButton = document.getElementById('dialogClose');
+const confirmButton = document.getElementById('dialogConfirm');
+function closeDownloadDialog() { if (downloadDialog.open) downloadDialog.close(); apkButton.focus(); }
+closeButton.addEventListener('click', closeDownloadDialog);
+confirmButton.addEventListener('click', closeDownloadDialog);
+downloadDialog.addEventListener('click', (event) => { if (event.target === downloadDialog) closeDownloadDialog(); });
+
+function safeDownloadUrl(value) {
+  if (!value) return null;
+  try {
+    const url = new URL(value, window.location.href);
+    if (url.protocol === 'https:' || (url.protocol === 'file:' && value.startsWith('./'))) return url.href;
+  } catch { return null; }
+  return null;
+}
+const downloadUrl = safeDownloadUrl(FMODE_SITE.apkUrl);
+if (downloadUrl) {
+  apkButton.href = downloadUrl;
+  apkButton.removeAttribute('aria-describedby');
+  apkButton.setAttribute('download', 'Fmode.apk');
+  document.getElementById('downloadLabel').textContent = '下载 Android 安装包';
+  downloadStatus.classList.add('ready');
+  downloadStatus.innerHTML = '<i></i>官方 Android 安装包 · 下载已开放';
+  const metadata = [FMODE_SITE.version && '版本 ' + FMODE_SITE.version, FMODE_SITE.fileSize, FMODE_SITE.updatedAt && '更新于 ' + FMODE_SITE.updatedAt].filter(Boolean);
+  if (metadata.length) { releaseMeta.hidden = false; releaseMeta.textContent = metadata.join(' · '); }
+  const heroBadge = document.querySelector('.hero-badge');
+  heroBadge.replaceChildren(Object.assign(document.createElement('span'), { className: 'tiny-dot' }), document.createTextNode('Android 客户端现已开放下载'));
+  document.querySelector('.nav-platform').setAttribute('aria-label', 'Android 版现已开放下载');
+  document.getElementById('faqDownloadAnswer').textContent = 'Android 客户端现已开放下载。使用手机访问本页,点击下载按钮即可获取安装包;如在电脑访问,可将下载后的 APK 传至 Android 设备安装。';
+} else {
+  apkButton.addEventListener('click', (event) => { event.preventDefault(); downloadDialog.showModal(); closeButton.focus(); });
+}
+
+const reduceMotion = window.matchMedia('(prefers-reduced-motion: reduce)');
+if ('IntersectionObserver' in window && !reduceMotion.matches) {
+  const observer = new IntersectionObserver((entries) => {
+    entries.forEach((entry) => { if (!entry.isIntersecting) return; entry.target.classList.add('is-visible'); observer.unobserve(entry.target); });
+  }, { threshold: 0.12, rootMargin: '0px 0px -35px 0px' });
+  document.querySelectorAll('.feature-card, .start-grid article, .download-card, .faq-intro').forEach((item) => { item.classList.add('reveal'); observer.observe(item); });
+}
+
+const canvas = document.getElementById('atmosphere');
+const context = canvas.getContext('2d', { alpha: true });
+let particles = [];
+let animationFrame = 0;
+let canvasWidth = 0;
+let canvasHeight = 0;
+function resizeCanvas() {
+  if (!context) return;
+  const bounds = canvas.getBoundingClientRect();
+  const ratio = Math.min(window.devicePixelRatio || 1, 1.5);
+  canvasWidth = bounds.width;
+  canvasHeight = bounds.height;
+  canvas.width = Math.round(bounds.width * ratio);
+  canvas.height = Math.round(bounds.height * ratio);
+  context.setTransform(ratio, 0, 0, ratio, 0, 0);
+  const count = Math.min(66, Math.max(28, Math.round(bounds.width * bounds.height / 18000)));
+  particles = Array.from({ length: count }, () => ({ x: Math.random() * canvasWidth, y: Math.random() * canvasHeight, radius: Math.random() * 1.05 + .28, opacity: Math.random() * .38 + .09, speed: Math.random() * .13 + .035, phase: Math.random() * Math.PI * 2 }));
+}
+function drawAtmosphere() {
+  if (!context || document.hidden || reduceMotion.matches) { animationFrame = 0; return; }
+  context.clearRect(0, 0, canvasWidth, canvasHeight);
+  const time = performance.now() * .00045;
+  particles.forEach((particle) => {
+    const twinkle = (Math.sin(time + particle.phase) + 1) * .5;
+    context.beginPath();
+    context.fillStyle = 'rgba(199, 255, 211, ' + particle.opacity * (.55 + twinkle * .45) + ')';
+    context.arc(particle.x, particle.y, particle.radius, 0, Math.PI * 2);
+    context.fill();
+    particle.y -= particle.speed;
+    if (particle.y < -2) { particle.y = canvasHeight + 2; particle.x = Math.random() * canvasWidth; }
+  });
+  animationFrame = window.requestAnimationFrame(drawAtmosphere);
+}
+function startAtmosphere() { if (!context || reduceMotion.matches || document.hidden || animationFrame) return; animationFrame = window.requestAnimationFrame(drawAtmosphere); }
+function stopAtmosphere() { if (animationFrame) window.cancelAnimationFrame(animationFrame); animationFrame = 0; }
+resizeCanvas();
+startAtmosphere();
+window.addEventListener('resize', () => { resizeCanvas(); startAtmosphere(); }, { passive: true });
+document.addEventListener('visibilitychange', () => document.hidden ? stopAtmosphere() : startAtmosphere());
+reduceMotion.addEventListener?.('change', () => reduceMotion.matches ? stopAtmosphere() : startAtmosphere());

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 106 - 0
prototypes/fmode-download-20261120/site.template.html


+ 38 - 0
prototypes/mobile-current-polish-20261116/README.md

@@ -0,0 +1,38 @@
+# fmode 移动端 · 现有 UI 精修对照
+
+直接打开 `index.html` 即可使用,无须安装、启动服务或连接网络。该文件已经内嵌全部样式、图标和脚本,可单独发送或拷贝。未发布至公网,未修改 Angular 或 Android 业务代码。
+
+## 本次边界
+
+- 左侧是基于当前源码的 HTML 复刻,不是生产截图,也不是运行中的 Angular 页面。
+- 右侧在同一结构上精修;桌面前后对照,手机默认精修,可在顶部切换原版。
+- 保留铂金曜黑、圆形顶部按钮、字母头像、会话列表、回复卡片和四栏导航。
+- 通讯录保留「全部 / 数字生命 / 同事」,同事展开数字生命;工作台保留「全部 / 在线 / 离线」、运行指标、进入 / 通道 / 充值。
+- 容器设置只演示名称修改与进入会话,不增加真实配置能力。
+- 精修重点:边界减弱、分割线内缩、正文与辅助信息层级、状态可见、输入框减重、统一圆角与间距。
+- 输入行为建议仅在右侧演示:Enter 换行,点击箭头发送;左侧保留当前 Enter 发送行为。输入法组合态不会触发发送。
+
+## 可体验
+
+会话搜索、工作区展开/新建/重命名/删除、侧栏、会话切换、标题编辑及预设建议、每会话草稿、当前容器快速新建、附件名称展示、模拟回复、后台完成提醒、文件预览、归档恢复、通讯录、容器重命名、工作台筛选、四套配色、深色模式、正文字号。
+
+所有数据和响应均为演示;无 AI 请求、上传、支付、账户修改或系统通知权限调用。标题建议是本地预设;附件只读取名称,不读取和上传内容;PPT / Excel 是 HTML 预览,不是真实生成文件。Token 是明确标注的假数据。
+
+偏好及输入草稿保存在浏览器本地,存储键为 `fmode-current-polish-v1`。其他示例编辑在刷新后重置,新建会话的历史不跨刷新保留。需要完全重置时删除该存储键即可。
+
+## 源文件与验证
+
+- `preview.template.html`:评审外壳。
+- `styles.css`:原样样式与 `.polished` 增量样式。
+- `app.js`:本地演示交互。
+- `build.mjs`:打包为独立 `index.html`。
+- `verify.mjs`:Chrome / Playwright 自动检查与截图。
+
+在项目根目录执行:
+
+```powershell
+node prototypes/mobile-current-polish-20261116/build.mjs
+node prototypes/mobile-current-polish-20261116/verify.mjs
+```
+
+参照源码:`src/app/mobile/components/m-app-bar`、`m-avatar`、`m-segmented`、`m-dock`、`m-drawer`、`m-life-card`,以及 `mobile/pages/messages`、`contacts`、`workbench`、`mine`、`agent`、`home` 与 `components/domain/assistant-turn`。没有复活当前已停用的项目、任务中心等全局入口。

+ 983 - 0
prototypes/mobile-current-polish-20261116/app.js

@@ -0,0 +1,983 @@
+(() => {
+  'use strict';
+  const paths = {
+    menu: 'M4 6h16M4 12h12M4 18h16',
+    edit: 'M14 4l6 6M4 20l4-1L20 7a2.1 2.1 0 0 0-3-3L5 16zM13 4H5a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2h13a2 2 0 0 0 2-2v-7',
+    chat: 'M21 11.5a8.5 8.5 0 0 1-8.5 8.5H5l-3 2 1.5-5A8.5 8.5 0 1 1 21 11.5zM7 10h10M7 14h6',
+    people:
+      'M15 20H3v-2a5 5 0 0 1 10 0v2M21 20v-2a5 5 0 0 0-4-4M17 3a4 4 0 0 1 0 8M12 7a4 4 0 1 1-8 0 4 4 0 0 1 8 0',
+    grid: 'M4 4h6v6H4zM14 4h6v6h-6zM4 14h6v6H4zM14 14h6v6h-6z',
+    user: 'M16 7a4 4 0 1 1-8 0 4 4 0 0 1 8 0M4 21v-2a8 8 0 0 1 16 0v2',
+    search: 'M16.5 16.5L21 21M18 10.5a7.5 7.5 0 1 1-15 0 7.5 7.5 0 0 1 15 0',
+    plus: 'M12 5v14M5 12h14',
+    back: 'M15 5l-7 7 7 7',
+    chevron: 'M9 5l7 7-7 7',
+    down: 'M6 9l6 6 6-6',
+    close: 'M6 6l12 12M6 18L18 6',
+    folder: 'M3 7V5a2 2 0 0 1 2-2h5l2 3h7a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2zM3 9h18',
+    switch: 'M4 5h12M8 12h12M4 19h12M20 3v4M4 10v4M20 17v4',
+    arrow: 'M12 19V5M6 11l6-6 6 6',
+    attach: 'M8 13l7-7a3 3 0 0 1 4 4l-9 9a5 5 0 0 1-7-7l9-9M7 14l7-7',
+    target:
+      'M12 3v4M12 17v4M3 12h4M17 12h4M19 12a7 7 0 1 1-14 0 7 7 0 0 1 14 0M14 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0',
+    check: 'M5 12l4 4L19 6',
+    clock: 'M12 7v5l3 2M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0',
+    copy: 'M8 8h12v13H8zM16 8V3H3v13h5',
+    refresh: 'M20 7a9 9 0 1 0 1 8M20 3v5h-5',
+    eye: 'M2 12s4-7 10-7 10 7 10 7-4 7-10 7S2 12 2 12M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0',
+    bell: 'M18 8a6 6 0 0 0-12 0c0 9-3 9-3 10h18c0-1-3-1-3-10M9 21h6',
+    archive: 'M3 3h18v5H3zM5 8v13h14V8M9 12h6',
+    file: 'M14 2H5v20h14V7zM14 2v5h5M8 12h8M8 16h6',
+    signal: 'M4 18v-3M9 18v-6M14 18V9M19 18V5',
+    wifi: 'M3 8a15 15 0 0 1 18 0M6 12a10 10 0 0 1 12 0M9 16a5 5 0 0 1 6 0M12 20h.01',
+    battery: 'M2 6h17v12H2zM22 10v4M5 9h11v6H5z',
+    moon: 'M20 14a8 8 0 0 1-10-10 9 9 0 1 0 10 10',
+    logout: 'M10 3H3v18h7M8 12h13M17 8l4 4-4 4',
+    home: 'M3 10l9-7 9 7v11h-7v-7h-4v7H3z',
+    info: 'M12 11v6M12 7h.01M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0',
+  };
+  const icon = (name) =>
+    `<svg viewBox="0 0 24 24" aria-hidden="true"><path d="${paths[name] || paths.chat}"/></svg>`;
+  const escape = (value) =>
+    String(value ?? '').replace(
+      /[&<>"']/g,
+      (char) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[char],
+    );
+  const tabs = [
+    ['messages', '会话', 'chat'],
+    ['contacts', '通讯录', 'people'],
+    ['workbench', '工作台', 'grid'],
+    ['mine', '我的', 'user'],
+  ];
+  const scenes = [
+    ...tabs.slice(0, 1),
+    ['chat/c1', '会话详情', 'edit'],
+    ...tabs.slice(1),
+    ['home', '新建会话', 'plus'],
+  ];
+  const agents = [
+    { id: 'nova', name: 'Nova', job: '数据分析 · 商业洞察', state: '在线', cpu: 24, memory: 38 },
+    {
+      id: 'orbit',
+      name: 'Orbit',
+      job: '产品设计 · 前端开发',
+      state: '运行中',
+      cpu: 68,
+      memory: 52,
+    },
+    { id: 'atlas', name: 'Atlas', job: '项目管理 · 进度协同', state: '在线', cpu: 12, memory: 26 },
+    { id: 'echo', name: 'Echo', job: '内容创作 · 品牌文案', state: '在线', cpu: 8, memory: 21 },
+    {
+      id: 'pilot',
+      name: 'Pilot',
+      job: '工程开发 · 自动化',
+      state: '离线',
+      cpu: null,
+      memory: null,
+    },
+  ];
+  const sessions = [
+    {
+      id: 'c1',
+      title: '季度经营复盘报告',
+      agent: 'nova',
+      preview: '已生成 12 页 PPT 与数据附录',
+      time: '09:42',
+      unread: 3,
+      status: 'done',
+      workspace: 'w1',
+    },
+    {
+      id: 'c2',
+      title: '移动端首页改版',
+      agent: 'orbit',
+      preview: '首页骨架已完成,正在调整细节',
+      time: '09:15',
+      unread: 2,
+      status: 'running',
+      workspace: 'w2',
+    },
+    {
+      id: 'c3',
+      title: 'Q3 里程碑对齐',
+      agent: 'atlas',
+      preview: '本周 3 个阻塞项需要人工确认',
+      time: '昨天',
+      unread: 0,
+      status: 'waiting',
+      workspace: 'w1',
+    },
+    {
+      id: 'c4',
+      title: '产品发布会通稿润色',
+      agent: 'echo',
+      preview: '第二版已整理,等待你的反馈',
+      time: '昨天',
+      unread: 0,
+      status: 'idle',
+      workspace: null,
+    },
+    {
+      id: 'c5',
+      title: '构建流水线排障',
+      agent: 'pilot',
+      preview: '构建中断,需要检查环境配置',
+      time: '周五',
+      unread: 0,
+      status: 'error',
+      workspace: 'w2',
+    },
+    {
+      id: 'c6',
+      title: '上半年客户满意度分析',
+      agent: 'nova',
+      preview: '分析结果已保存至文件夹',
+      time: '周四',
+      unread: 0,
+      status: 'idle',
+      workspace: null,
+    },
+  ];
+  const workspaces = [
+    { id: 'w1', name: '经营与增长' },
+    { id: 'w2', name: '产品与研发' },
+  ];
+  const colleagues = [
+    { id: 'p1', name: '陈晓', mobile: '138****2608', agents: ['nova', 'atlas'] },
+    { id: 'p2', name: '林悦', mobile: '139****5316', agents: ['orbit', 'echo', 'pilot'] },
+  ];
+  const openPeople = new Set();
+  const storageKey = 'fmode-current-polish-v1';
+  let saved = {};
+  try {
+    saved = JSON.parse(localStorage.getItem(storageKey) || '{}');
+  } catch {}
+  const state = {
+    route: 'messages',
+    filter: 'all',
+    query: '',
+    contactFilter: 'all',
+    workFilter: 'all',
+    openGroups: new Set(),
+    overlay: null,
+    overlayData: null,
+    toast: null,
+    drafts: saved.drafts && typeof saved.drafts === 'object' ? saved.drafts : {},
+    palette: ['platinum', 'ice', 'clay', 'slate'].includes(saved.palette)
+      ? saved.palette
+      : 'platinum',
+    dark: !!saved.dark,
+    font: Math.max(12, Math.min(20, Number(saved.font) || 14)),
+    notify: saved.notify !== false,
+    tokenShown: false,
+    view: 'compare',
+    turns: {},
+    attachments: {},
+    returnRoute: 'messages',
+  };
+  let toastTimer;
+  let sourcePanel = 'polished';
+  let restoreAction = null;
+  const phones = [...document.querySelectorAll('.phone')];
+  const getAgent = (id) => agents.find((agent) => agent.id === id) || agents[0];
+  const current = () => sessions.find((session) => session.id === state.route.split('/')[1]);
+  const persist = () => {
+    try {
+      localStorage.setItem(
+        storageKey,
+        JSON.stringify({
+          drafts: state.drafts,
+          palette: state.palette,
+          dark: state.dark,
+          font: state.font,
+          notify: state.notify,
+        }),
+      );
+    } catch {}
+  };
+  const button = (name, label, action, extra = '') =>
+    `<button class="round-button" aria-label="${escape(label)}" title="${escape(label)}" data-action="${action}" ${extra}>${icon(name)}</button>`;
+  const avatar = (agent, online = true) =>
+    `<span class="avatar" aria-hidden="true">${escape(agent.name[0])}${online ? `<i class="presence ${agent.state === '离线' ? 'off' : ''}"></i>` : ''}</span>`;
+  const stateLabel = (session) =>
+    ({ running: '正在处理', done: '已完成', waiting: '待你确认', error: '需要处理' })[
+      session.status
+    ] || '';
+  const row = (session, activity = false) => {
+    const agent = getAgent(session.agent);
+    return `<button class="conversation" data-action="chat" data-id="${session.id}">${avatar(agent)}<span class="row-body"><span class="row-title">${escape(session.title)}</span><span class="row-preview">${escape(agent.name)} · ${escape(session.preview)}</span>${activity || ['running', 'waiting', 'error'].includes(session.status) ? `<span class="row-meta ${session.status}">${icon(session.status === 'done' ? 'check' : session.status === 'error' ? 'info' : 'clock')}${stateLabel(session) || '随时继续'}${activity && state.drafts[session.id] ? ' · 有草稿' : ''}</span>` : ''}</span><span class="row-tail"><time>${escape(session.time)}</time>${session.unread ? `<span class="unread">${session.unread}</span>` : ''}</span></button>`;
+  };
+  const statusbar = () =>
+    `<div class="statusbar" aria-hidden="true"><span>9:41</span><span class="status-icons">${icon('signal')}${icon('wifi')}${icon('battery')}</span></div>`;
+  function appbar() {
+    if (state.route.startsWith('agent/'))
+      return `<header class="appbar">${button('back', '返回通讯录', 'contacts')}<div class="appbar-title"><h2>容器设置</h2></div><span class="header-spacer"></span></header>`;
+    const session = current();
+    if (session)
+      return `<header class="appbar">${button('back', '返回会话', 'back')}<div class="appbar-title"><button data-action="title" aria-label="编辑会话标题"><h2>${escape(session.title)}</h2><p>${escape(getAgent(session.agent).name)} · ${session.status === 'running' ? '正在处理' : '会话可追踪'}</p></button></div><div class="appbar-right">${button('switch', '切换会话', 'activity')}${button('folder', '会话文件', 'files')}</div></header>`;
+    const title = tabs.find((tab) => tab[0] === state.route)?.[1] || '';
+    return `<header class="appbar">${button('menu', '打开导航', 'drawer')}<div class="appbar-title"><h2>${title}</h2></div>${state.route === 'messages' ? button('edit', '新建对话', 'new') : state.route === 'home' ? button('chat', '查看会话', 'messages') : '<span class="header-spacer"></span>'}</header>`;
+  }
+  const tabbar = () =>
+    `<nav class="tabbar" aria-label="主导航">${tabs.map(([route, label, name]) => `<button class="${state.route === route ? 'selected' : ''}" data-action="route" data-route="${route}" ${state.route === route ? 'aria-current="page"' : ''}><span class="tab-icon">${icon(name)}${route === 'messages' && sessions.some((session) => session.unread) ? `<span class="unread">${sessions.reduce((total, session) => total + session.unread, 0)}</span>` : ''}</span>${label}</button>`).join('')}</nav>`;
+  const segmented = (options, value, action) =>
+    `<div class="segmented" aria-label="筛选">${options.map(([key, label]) => `<button class="${value === key ? 'selected' : ''}" data-action="${action}" data-value="${key}" aria-pressed="${value === key}">${label}</button>`).join('')}</div>`;
+  const search = (placeholder) =>
+    `<label class="search">${icon('search')}<input data-field="search" aria-label="${placeholder}" type="search" value="${escape(state.query)}" placeholder="${placeholder}" autocomplete="off" /></label>`;
+  const empty = (title, description) =>
+    `<div class="empty">${icon('search')}<h3>${title}</h3><p>${description}</p></div>`;
+  function messages() {
+    const filtered = sessions.filter(
+      (session) =>
+        !session.archived &&
+        `${session.title} ${getAgent(session.agent).name} ${session.preview}`
+          .toLowerCase()
+          .includes(state.query.toLowerCase()),
+    );
+    let body;
+    if (state.filter === 'workspace') {
+      body =
+        `<div class="section-label"><span>工作区</span><button class="text-button" data-action="workspace-new">${icon('plus')}新建</button></div>` +
+        workspaces
+          .map((workspace) => {
+            const items = filtered.filter((session) => session.workspace === workspace.id);
+            return `<div class="list"><button class="group-toggle" data-action="group" data-id="${workspace.id}" aria-expanded="${state.openGroups.has(workspace.id)}">${icon('folder')}<strong>${escape(workspace.name)}</strong><span>${items.length} 个会话</span>${icon(state.openGroups.has(workspace.id) ? 'down' : 'chevron')}</button>${state.openGroups.has(workspace.id) ? items.map((session) => row(session)).join('') + `<div class="group-actions"><button data-action="workspace-rename" data-id="${workspace.id}">重命名</button><button data-action="workspace-delete" data-id="${workspace.id}">删除工作区</button></div>` : ''}</div>`;
+          })
+          .join('');
+      const daily = filtered.filter((session) => !session.workspace);
+      body += `<h3 class="section-label">日常会话</h3>${daily.length ? `<div class="list">${daily.map((session) => row(session)).join('')}</div>` : empty('暂无日常会话', '未归入工作区的会话将显示在这里')}`;
+    } else
+      body = filtered.length
+        ? `<div class="list">${filtered.map((session) => row(session)).join('')}</div><p class="list-footer">所有会话均已同步</p>`
+        : empty('没有找到相关会话', '试试会话标题或数字生命的名字');
+    return `<div class="filter-area">${segmented(
+      [
+        ['all', '全部'],
+        ['workspace', '工作区'],
+      ],
+      state.filter,
+      'filter',
+    )}${search('搜索会话')}</div><main class="page-content">${body}</main>`;
+  }
+  const fileCards = () =>
+    `<div class="files"><button class="file-card" data-action="preview" data-id="ppt"><span class="file-type">PPT</span><strong>季度经营复盘.pptx</strong><small>12 页 · 2.4 MB ${icon('chevron')}</small></button><button class="file-card" data-action="preview" data-id="xlsx"><span class="file-type sheet">XLS</span><strong>经营数据附录.xlsx</strong><small>3 个工作表 · 128 KB ${icon('chevron')}</small></button></div>`;
+  const process = () =>
+    `<details class="process"><summary>${icon('check')}运行了 3 步 · terminal · 4s<span>已完成</span>${icon('down')}</summary><ol><li>读取并核对季度经营数据</li><li>整理核心指标与趋势</li><li>生成报告与数据附录</li></ol></details>`;
+  function initialTurn(session) {
+    const agent = getAgent(session.agent);
+    if (session.fresh)
+      return `<div class="empty">${avatar(agent, false)}<h3>和 ${escape(agent.name)} 开始新对话</h3><p>告诉我你想完成什么。<br>这条会话的过程与结果都会留在这里。</p></div>`;
+    if (session.id !== 'c1')
+      return `<p class="chat-date">今天 · ${escape(session.time)}</p><div class="user-message">${escape(session.title)},请帮我继续推进。</div><div class="agent-line">${avatar(agent, false)}${escape(agent.name)}<span class="agent-status">${stateLabel(session)}</span></div><div class="assistant-card"><h3>${escape(session.title)}</h3><p>${escape(session.preview)}</p><p>这是用于预览当前移动端布局的演示内容。</p>${session.status === 'running' ? '<div class="skeleton"></div><div class="skeleton short"></div>' : ''}</div>`;
+    return `<p class="chat-date">今天 · 09:41</p><div class="user-message">帮我整理本季度的经营数据,做一份复盘报告,重点看收入增长和客户留存。</div><div class="agent-line">${avatar(agent, false)}${escape(agent.name)}<span class="agent-status">09:42</span></div>${process()}<section class="assistant-card"><h3>季度复盘,已经整理好了。</h3><p>我梳理了本季度的经营表现,三个值得关注的变化:</p><div class="insight"><p><b>收入稳步增长</b><br>环比增长 18.6%,核心产品持续拉动。</p><p><b>客户留存改善</b><br>续费率达到 92%,较上季度提升 4 个百分点。</p><p><b>下一步的重点</b><br>优化新客转化,持续跟进高价值客户。</p></div><p>完整结论和数据已放进报告,可以直接预览。</p>${fileCards()}</section><div class="response-actions"><button aria-label="复制回复" data-action="copy">${icon('copy')}</button><button aria-label="会话更多操作" data-action="chat-menu">${icon('switch')}</button></div>`;
+  }
+  function composer(session) {
+    const key = session?.id || 'home';
+    const attachment = state.attachments[key];
+    const busy = session?.sending;
+    const count = sessions.filter((item) => item.status === 'running').length;
+    return `<footer class="composer-wrap">${session ? `<button class="activity-entry" data-action="activity"><i class="activity-dot ${count ? '' : 'idle'}"></i><span>${count ? `${count} 个会话进行中` : '暂无运行中的会话'} · 随时切换,不丢草稿</span>${icon('chevron')}</button>` : ''}<div class="composer">${attachment ? `<div class="attachment-chip">${icon('file')}<span>${escape(attachment)}</span><button data-action="remove-attachment" aria-label="移除附件">${icon('close')}</button></div>` : ''}<textarea data-field="draft" aria-label="消息输入框" rows="2" placeholder="${session ? '发送消息,继续一起推进…' : '想做什么?从这里开始…'}">${escape(state.drafts[key] || '')}</textarea><div class="composer-tools"><button class="tool-button" data-action="attach" aria-label="添加附件">${icon('attach')}</button><button class="agent-tool" data-action="${session ? 'chat-menu' : 'new'}" aria-label="${session ? '当前数字生命操作' : '选择数字生命'}">${icon('target')}<span>${session ? escape(getAgent(session.agent).name) : '选择数字生命'}</span>${session ? icon('down') : ''}</button><button class="send-button" aria-label="发送消息" data-action="send" ${busy || (!state.drafts[key]?.trim() && !attachment) ? 'disabled' : ''}>${icon('arrow')}</button></div><input type="file" data-field="attachment" hidden /></div><p class="input-hint">Enter 换行 · 点击箭头发送</p></footer>`;
+  }
+  function chat() {
+    const session = current();
+    if (!session)
+      return `<main class="page-content">${empty('会话不存在', '请返回会话列表重新选择。')}<button class="primary-button" data-action="messages">返回会话</button></main>`;
+    const turns = state.turns[session.id] || [];
+    return `<main class="page-content chat-scroll">${initialTurn(session)}${turns.map((turn) => `<div class="user-message">${escape(turn.text)}${turn.attachment ? `<br>附件:${escape(turn.attachment)}` : ''}</div><div class="agent-line">${avatar(getAgent(session.agent), false)}${escape(getAgent(session.agent).name)}</div><div class="assistant-card">${turn.done ? '<p>收到,已记录这次补充。实际项目中会继续调用原有会话流程。</p><p>这是本地原型的演示回复,未请求 AI 或业务接口。</p>' : '<div class="loading-dots" aria-label="处理中"><i></i><i></i><i></i></div>'}</div>`).join('')}</main>${composer(session)}`;
+  }
+  function contacts() {
+    const filtered = agents.filter((agent) =>
+      `${agent.name} ${agent.job}`.toLowerCase().includes(state.query.toLowerCase()),
+    );
+    const people = colleagues.filter((person) =>
+      `${person.name} ${person.mobile} ${person.agents.map((id) => getAgent(id).name).join(' ')}`
+        .toLowerCase()
+        .includes(state.query.toLowerCase()),
+    );
+    const agentRow = (agent) =>
+      `<button class="conversation" data-action="agent" data-id="${agent.id}">${avatar(agent)}<span class="row-body"><strong class="row-title">${escape(agent.name)}</strong><span class="row-preview">${escape(agent.job)}</span></span><span class="row-tail">${icon('chevron')}</span></button>`;
+    let body = '';
+    if (state.contactFilter !== 'agents' && people.length)
+      body += `<h3 class="section-label">同事 · ${people.length}</h3><div class="list">${people.map((person) => `<button class="conversation" data-action="person" data-id="${person.id}" aria-expanded="${openPeople.has(person.id)}">${avatar(person, false)}<span class="row-body"><span class="row-title">${person.name}</span><span class="row-preview">${person.mobile} · ${person.agents.length} 个容器</span></span>${icon(openPeople.has(person.id) ? 'down' : 'chevron')}</button>${openPeople.has(person.id) ? `<div class="person-children">${person.agents.map((id) => agentRow(getAgent(id))).join('')}</div>` : ''}`).join('')}</div>`;
+    if (state.contactFilter !== 'people' && filtered.length)
+      body += `<h3 class="section-label">数字生命 · ${filtered.length}</h3><div class="list">${filtered.map(agentRow).join('')}</div>`;
+    return `<div class="filter-area">${segmented(
+      [
+        ['all', '全部'],
+        ['agents', '数字生命'],
+        ['people', '同事'],
+      ],
+      state.contactFilter,
+      'contact-filter',
+    )}${search('搜索名称或专长')}</div><main class="page-content">${body || empty('没有匹配的联系人', '试试名称或专长')}</main>`;
+  }
+  function agentPage() {
+    const agent = getAgent(state.route.split('/')[1]);
+    return `<main class="page-content"><section class="settings-card" style="margin-top:16px"><div class="setting-row"><span class="row-body">当前名称</span><strong>${escape(agent.name)}</strong></div><button class="setting-row" data-action="rename-agent" data-id="${agent.id}">${icon('edit')}<span class="row-body">重命名</span>${icon('chevron')}</button><button class="setting-row" data-action="create-chat" data-id="${agent.id}">${icon('chat')}<span class="row-body">进入会话</span>${icon('chevron')}</button></section><p class="list-footer">演示管理员操作 · 仅修改本地示例</p></main>`;
+  }
+  function lifeCard(agent) {
+    const session = sessions.find((item) => item.agent === agent.id);
+    return `<article class="life-card"><div class="life-head">${avatar(agent)}<div class="row-body"><strong>${escape(agent.name)}</strong><small>${escape(agent.job)}</small></div><span class="state-tag ${agent.state === '运行中' ? 'busy' : agent.state === '离线' ? 'offline' : ''}">${agent.state}</span></div><div class="task-line">${icon('chat')}<span>${session ? escape(session.title) : '暂无进行中的会话'}</span></div>${
+      agent.cpu === null
+        ? '<p class="task-line">指标未上报</p>'
+        : `<div class="metrics">${[
+            ['CPU', agent.cpu],
+            ['内存', agent.memory],
+          ]
+            .map(
+              ([label, value]) =>
+                `<div class="metric"><div><span>${label}</span><span>${value}%</span></div><div class="metric-track"><i style="width:${value}%"></i></div></div>`,
+            )
+            .join('')}</div>`
+    }<div class="life-actions"><button data-action="enter-agent" data-id="${agent.id}">进入</button><button data-action="channel" data-id="${agent.id}">通道</button><button data-action="recharge" data-id="${agent.id}">充值</button></div></article>`;
+  }
+  function workbench() {
+    const filtered = agents.filter(
+      (agent) =>
+        (state.workFilter === 'all' ||
+          (state.workFilter === 'online' ? agent.state !== '离线' : agent.state === '离线')) &&
+        `${agent.name} ${agent.job}`.toLowerCase().includes(state.query.toLowerCase()),
+    );
+    return `<div class="filter-area">${segmented(
+      [
+        ['all', '全部'],
+        ['online', '在线'],
+        ['offline', '离线'],
+      ],
+      state.workFilter,
+      'work-filter',
+    )}${search('搜索数字生命')}</div><main class="page-content"><div class="overview"><div><span>数字生命</span><strong>5</strong></div><div><span>在线</span><strong>4</strong></div><div><span>离线</span><strong>1</strong></div></div>${filtered.length ? filtered.map(lifeCard).join('') : empty('暂无匹配的数字生命', '切换筛选或试试其他关键词')}</main>`;
+  }
+  function mine() {
+    return `<main class="page-content"><section class="profile-card"><span class="avatar">F</span><div><h3>fmode 体验账号</h3><p>演示资料 · 人机共生中枢</p></div></section><h3 class="section-label">账号</h3><section class="settings-card"><div class="setting-row"><span class="row-body">访问 Token<small>${state.tokenShown ? 'DEMO-TOKEN-NOT-A-REAL-CREDENTIAL' : '•••• •••• •••• ••••'}</small></span><button class="tool-button" data-action="token" aria-label="${state.tokenShown ? '隐藏' : '显示'} Token">${icon('eye')}</button><button class="tool-button" data-action="copy-token" aria-label="复制 Token" ${state.tokenShown ? '' : 'disabled'}>${icon('copy')}</button></div><button class="setting-row" data-action="logout"><span class="row-body danger">退出登录</span>${icon('chevron')}</button></section><h3 class="section-label">通知</h3><section class="settings-card"><button class="setting-row" data-action="notifications">${icon('bell')}<span class="row-body">消息与任务通知<small>原生端入口 · 此处仅演示提醒</small></span>${icon('chevron')}</button></section><h3 class="section-label">外观</h3><section class="settings-card"><p class="palette-label">整体配色</p><div class="palette-grid">${[
+      ['platinum', '铂金曜黑', '#25272a'],
+      ['ice', '冰白靛蓝', '#4056c7'],
+      ['clay', '暖瓷陶橘', '#af482b'],
+      ['slate', '岩灰鸢紫', '#6952a3'],
+    ]
+      .map(
+        ([id, name, color]) =>
+          `<button data-action="palette" data-id="${id}" aria-pressed="${state.palette === id}" class="${state.palette === id ? 'selected' : ''}"><span class="palette-swatch" style="background:${color}"></span>${name}</button>`,
+      )
+      .join(
+        '',
+      )}</div><div class="setting-row"><span class="row-body">深色模式<small>跟随手动切换</small></span><button class="switch" role="switch" aria-checked="${state.dark}" aria-label="深色模式" data-action="dark"></button></div><div class="font-slider"><label>正文字号<span>${state.font}px</span></label><input data-field="font" type="range" min="12" max="20" value="${state.font}" aria-label="正文字号" /></div></section></main>`;
+  }
+  function home() {
+    return `<main class="page-content"><section class="home-hero"><div class="home-logo">fmode</div><h3>人机共生中枢</h3><p>和数字生命一起干活 · 每条会话都可追踪</p></section><div class="section-label"><span>最近会话</span><button class="text-button" data-action="messages">全部${icon('chevron')}</button></div><div class="list">${sessions
+      .filter((session) => !session.archived)
+      .slice(0, 2)
+      .map((session) => row(session))
+      .join('')}</div></main>${composer(null)}`;
+  }
+  function drawer() {
+    return `<div class="overlay drawer-overlay" data-action="dismiss"><aside class="drawer" role="dialog" aria-modal="true" aria-label="导航菜单"><div class="drawer-head"><strong>fmode</strong><button class="close-button" data-action="close" aria-label="关闭导航">${icon('close')}</button></div><button class="drawer-new" data-action="new">${icon('plus')}<span><strong>新建对话</strong><small>选择数字生命</small></span></button>${current() ? `<button class="drawer-quick" data-action="quick-new">${icon('edit')}在本容器新建 · ${escape(getAgent(current().agent).name)}</button>` : ''}<nav class="drawer-nav">${tabs.map(([route, label, name]) => `<button data-action="route" data-route="${route}" class="${state.route === route ? 'selected' : ''}">${icon(name)}${label}</button>`).join('')}</nav><div class="drawer-section">工作区<button data-action="workspace-new" aria-label="新建工作区">${icon('plus')}</button></div>${workspaces.map((workspace) => `<button class="drawer-item" data-action="workspace-open" data-id="${workspace.id}">${icon('folder')}<span>${escape(workspace.name)}</span></button>`).join('')}<div class="drawer-section">日常会话</div>${sessions
+      .filter((session) => !session.archived)
+      .slice(0, 4)
+      .map(
+        (session) =>
+          `<button class="drawer-item" data-action="chat" data-id="${session.id}">${icon('chat')}<span>${escape(session.title)}</span></button>`,
+      )
+      .join(
+        '',
+      )}<button class="drawer-item" data-action="archived">${icon('archive')}已归档会话</button><div class="drawer-footer"><span class="avatar">F</span><span>fmode 体验账号<small>独立预览 · 不影响真实数据</small></span></div></aside></div>`;
+  }
+  function sheet(title, content) {
+    return `<div class="overlay" data-action="dismiss"><section class="sheet" role="dialog" aria-modal="true" aria-label="${escape(title)}"><div class="sheet-handle"></div><header class="sheet-heading"><h3>${escape(title)}</h3><button class="close-button" data-action="close" aria-label="关闭弹层">${icon('close')}</button></header>${content}</section></div>`;
+  }
+  function overlay() {
+    const data = state.overlayData;
+    switch (state.overlay) {
+      case 'drawer':
+        return drawer();
+      case 'activity':
+        return sheet(
+          '切换会话',
+          `<p class="sheet-description">任务在后台继续,输入草稿留在各自会话。</p><div class="list">${sessions
+            .filter((session) => !session.archived)
+            .map((session) => row(session, true))
+            .join(
+              '',
+            )}</div><button class="text-button" data-action="demo-complete">${icon('bell')}演示:让后台任务完成</button>`,
+        );
+      case 'title':
+        return sheet(
+          '会话标题',
+          `<p class="sheet-description">一个清楚的标题,让下次继续更容易。</p><form data-form="title"><label class="field-label">标题</label><input class="form-field" data-field="title" aria-label="会话标题" maxlength="60" value="${escape(current()?.title)}" /><p class="form-error" aria-live="polite"></p><button type="button" class="text-button" data-action="suggest-title">${icon('refresh')}看看其他标题建议</button><div class="candidates"></div><button class="primary-button" type="submit">保存标题</button></form>`,
+        );
+      case 'new':
+        return sheet(
+          '选择数字生命',
+          `<p class="sheet-description">开启一条新会话,原有会话和草稿不受影响。</p><div class="list">${agents.map((agent) => `<button class="conversation" data-action="create-chat" data-id="${agent.id}">${avatar(agent)}<span class="row-body"><strong class="row-title">${escape(agent.name)}</strong><span class="row-preview">${escape(agent.job)}</span></span>${icon('chevron')}</button>`).join('')}</div>`,
+        );
+      case 'chat-menu':
+        return sheet(
+          getAgent(current()?.agent).name,
+          `<p class="sheet-description">当前数字生命 · ${escape(getAgent(current()?.agent).job)}</p><button class="setting-row" data-action="quick-new">${icon('plus')}<span class="row-body">在本容器新建会话</span>${icon('chevron')}</button><button class="setting-row" data-action="title">${icon('edit')}<span class="row-body">编辑会话标题</span>${icon('chevron')}</button><button class="setting-row" data-action="archive">${icon('archive')}<span class="row-body">归档当前会话</span>${icon('chevron')}</button>`,
+        );
+      case 'files':
+        return sheet(
+          '会话文件',
+          `<p class="sheet-description">${current()?.id === 'c1' ? '本次会话生成的 2 个文件' : '当前会话暂无文件'} · 演示预览</p>${current()?.id === 'c1' ? fileCards() : empty('还没有文件', '会话生成的文件会集中保存在这里')}`,
+        );
+      case 'preview':
+        return sheet(
+          data === 'ppt' ? '季度经营复盘.pptx' : '经营数据附录.xlsx',
+          `<p class="sheet-description">演示文件 · ${data === 'ppt' ? '第 1 / 12 页' : '工作表 1 / 3'}</p>${data === 'ppt' ? '<div class="preview-document"><span class="doc-brand">FMODE / QUARTERLY REVIEW</span><h2>每一份增长,<br>都有迹可循。</h2><p>季度经营复盘报告</p><footer>BUSINESS INSIGHTS &nbsp; / &nbsp; 01</footer></div>' : '<table class="preview-table"><thead><tr><th>核心指标</th><th>本季度</th><th>变化</th></tr></thead><tbody><tr><td>营收增长</td><td>18.6%</td><td>↑ 6.2%</td></tr><tr><td>客户续费率</td><td>92%</td><td>↑ 4%</td></tr><tr><td>满意度</td><td>4.8 / 5</td><td>↑ 0.3</td></tr></tbody></table>'}<p class="sheet-description">仅展示文件预览的视觉样式;未生成真实 PPT / Excel 文件。</p>`,
+        );
+      case 'workspace-new':
+      case 'workspace-rename':
+        return sheet(
+          state.overlay === 'workspace-new' ? '新建工作区' : '重命名工作区',
+          `<p class="sheet-description">将同一场景的会话整理在一起。</p><form data-form="workspace"><label class="field-label">工作区名称</label><input class="form-field" data-field="workspace" aria-label="工作区名称" maxlength="30" value="${escape(data?.name || '')}"/><p class="form-error" aria-live="polite"></p><button type="submit" class="primary-button">保存工作区</button></form>`,
+        );
+      case 'workspace-delete':
+        return sheet(
+          '删除工作区',
+          `<p class="sheet-description">删除「${escape(data.name)}」后,里面的会话会移至日常会话,不会被删除。</p><button class="primary-button" data-action="confirm-workspace-delete" data-id="${data.id}">删除工作区,保留会话</button>`,
+        );
+      case 'agent': {
+        const agent = getAgent(data);
+        return sheet(
+          agent.name,
+          `<div class="profile-card" style="margin:12px 0 20px">${avatar(agent)}<div><h3>${escape(agent.name)}</h3><p>${escape(agent.job)}</p></div></div><button class="setting-row" data-action="rename-agent" data-id="${agent.id}">${icon('edit')}<span class="row-body">修改名称</span>${icon('chevron')}</button><button class="primary-button" data-action="create-chat" data-id="${agent.id}">开始新会话</button>`,
+        );
+      }
+      case 'rename-agent':
+        return sheet(
+          '修改数字生命名称',
+          `<form data-form="agent"><label class="field-label">名称</label><input class="form-field" aria-label="数字生命名称" data-field="agent-name" maxlength="30" value="${escape(getAgent(data).name)}"/><p class="form-error" aria-live="polite"></p><button type="submit" class="primary-button">保存名称</button></form>`,
+        );
+      case 'channel':
+        return sheet(
+          '通道',
+          `<p class="sheet-description">${escape(getAgent(data).name)} 的通道入口</p><div class="setting-row">${icon('chat')}<span class="row-body">fmode 应用内会话<small>演示状态 · 已连接</small></span><span class="state-tag">在线</span></div><p class="sheet-description">此稿保留原入口,不修改通道配置或接入逻辑。</p>`,
+        );
+      case 'recharge':
+        return sheet(
+          '充值',
+          `<p class="sheet-description">${escape(getAgent(data).name)} 的充值入口</p><div class="empty">${icon('info')}<h3>这里仅预览界面</h3><p>未创建订单,也不会产生支付。<br>迁移时继续使用项目原有充值流程。</p></div>`,
+        );
+      case 'notifications':
+        return sheet(
+          '消息与任务通知',
+          `<p class="sheet-description">完成提醒不会打断当前输入。真实系统权限仍由原项目负责。</p><div class="setting-row"><span class="row-body">原型内完成提醒</span><button role="switch" class="switch" aria-checked="${state.notify}" aria-label="完成提醒" data-action="notify"></button></div><button class="primary-button" data-action="demo-complete">演示一次完成提醒</button>`,
+        );
+      case 'archived': {
+        const archived = sessions.filter((session) => session.archived);
+        return sheet(
+          '已归档会话',
+          archived.length
+            ? `<div class="list">${archived.map((session) => `<div class="setting-row"><span class="row-body">${escape(session.title)}</span><button class="text-button" data-action="restore" data-id="${session.id}">恢复</button></div>`).join('')}</div>`
+            : empty('没有已归档会话', '归档的会话会保留在这里,随时可以恢复'),
+        );
+      }
+      case 'logout':
+        return sheet(
+          '退出登录',
+          `<p class="sheet-description">这是一份独立的 HTML 原型。确认后只展示未登录状态,不会退出你的真实账号。</p><button class="primary-button" data-action="confirm-logout">确认退出(演示)</button>`,
+        );
+      case 'logged-out':
+        return sheet(
+          '已退出演示账号',
+          `<div class="empty">${icon('user')}<h3>随时回来,继续对话。</h3><p>没有改动真实项目的登录状态。</p></div><button class="primary-button" data-action="close">返回预览</button>`,
+        );
+      default:
+        return '';
+    }
+  }
+  function render(keepScroll = true) {
+    const focused = document.activeElement;
+    const activeField = focused?.dataset?.field;
+    const focusedPanel = focused?.closest('.phone')?.id;
+    const selection = activeField && focused.type !== 'range' ? focused.selectionStart : null;
+    const notes = {
+      messages: '更柔和的边界 · 内缩分割线 · 清晰的任务状态',
+      chat: '保留回复卡片 · 降低输入区重量 · 草稿随会话保留',
+      contacts: '沿用字母头像 · 更有层次的名称与能力描述',
+      workbench: '保留运行指标和三个操作 · 统一卡片节奏',
+      mine: '保留四套配色与设置项 · 更轻的设置分组',
+      home: '保留 fmode 品牌和文案 · 收紧首屏节奏',
+    };
+    document.querySelector('.scene-nav').innerHTML = scenes
+      .map(
+        ([route, label, name]) =>
+          `<button data-action="route" data-route="${route}" class="${state.route === route || (route === 'chat/c1' && state.route.startsWith('chat/')) ? 'selected' : ''}">${icon(name)}${label}</button>`,
+      )
+      .join('');
+    document.querySelector('#design-note').textContent = notes[state.route.split('/')[0]] || '';
+    phones.forEach((phone) => {
+      const scroll = keepScroll ? phone.querySelector('.page-content')?.scrollTop || 0 : 0;
+      const sheetScroll = keepScroll ? phone.querySelector('.sheet')?.scrollTop || 0 : 0;
+      phone.classList.toggle('dark', state.dark);
+      phone.dataset.palette = state.palette;
+      phone.style.setProperty('--chat-size', `${state.font}px`);
+      const content = state.route.startsWith('chat/')
+        ? chat()
+        : state.route.startsWith('agent/')
+          ? agentPage()
+          : ({ messages, contacts, workbench, mine, home }[state.route] || messages)();
+      phone.innerHTML = `${statusbar()}<div class="app-shell" ${state.overlay ? 'inert' : ''}>${appbar()}${content}${tabs.some((tab) => tab[0] === state.route) ? tabbar() : ''}<div class="home-indicator" aria-hidden="true"></div></div>${overlay()}${state.toast ? `<div class="toast" role="status">${icon('check')}<span>${escape(state.toast.text)}</span>${state.toast.session ? `<button data-action="chat" data-id="${state.toast.session}">查看</button>` : ''}</div>` : ''}`;
+      const contentElement = phone.querySelector('.page-content');
+      if (contentElement) contentElement.scrollTop = scroll;
+      const sheetElement = phone.querySelector('.sheet');
+      if (sheetElement) sheetElement.scrollTop = sheetScroll;
+      const textarea = phone.querySelector('textarea');
+      if (textarea) resizeTextarea(textarea);
+    });
+    if (activeField && focusedPanel) {
+      const field = document.querySelector(`#${focusedPanel} [data-field="${activeField}"]`);
+      if (field) {
+        field.focus({ preventScroll: true });
+        if (selection !== null && field.setSelectionRange)
+          field.setSelectionRange(selection, selection);
+      }
+    }
+  }
+  function resizeTextarea(textarea) {
+    textarea.style.height = 'auto';
+    textarea.style.height = `${Math.min(112, Math.max(textarea.closest('.polished') ? 42 : 48, textarea.scrollHeight))}px`;
+  }
+  function go(route) {
+    state.query = '';
+    state.overlay = null;
+    state.overlayData = null;
+    state.toast = null;
+    if (!route.startsWith('chat/')) state.returnRoute = route;
+    state.route = route;
+    const session = current();
+    if (session) session.unread = 0;
+    if (location.hash !== `#/${route}`) history.replaceState(null, '', `#/${route}`);
+    render(false);
+  }
+  function showOverlay(name, data = null) {
+    restoreAction = document.activeElement?.dataset?.action || restoreAction;
+    state.overlay = name;
+    state.overlayData = data;
+    render();
+    const panel = document.getElementById(sourcePanel);
+    const field = panel.querySelector('.overlay input:not([type=checkbox])');
+    (field || panel.querySelector('.overlay button'))?.focus({ preventScroll: true });
+    if (field?.select) field.select();
+  }
+  function closeOverlay() {
+    state.overlay = null;
+    state.overlayData = null;
+    render();
+    const panel = document.getElementById(sourcePanel);
+    panel.querySelector(`[data-action="${restoreAction}"]`)?.focus({ preventScroll: true });
+  }
+  function toast(text, session = null) {
+    state.toast = { text, session };
+    render();
+    clearTimeout(toastTimer);
+    toastTimer = setTimeout(() => {
+      state.toast = null;
+      phones.forEach((phone) => phone.querySelector('.toast')?.remove());
+    }, 4200);
+  }
+  function createChat(agentId) {
+    if (getAgent(agentId).state === '离线') {
+      toast('该数字生命当前离线,请恢复在线后再开始会话');
+      return;
+    }
+    const id = `c${Date.now()}${sessions.length}`;
+    sessions.unshift({
+      id,
+      title: '新对话',
+      agent: agentId,
+      preview: '从一个想法开始',
+      time: '刚刚',
+      unread: 0,
+      status: 'idle',
+      workspace: null,
+      fresh: true,
+    });
+    if (state.drafts.home) {
+      state.drafts[id] = state.drafts.home;
+      delete state.drafts.home;
+    }
+    if (state.attachments.home) {
+      state.attachments[id] = state.attachments.home;
+      delete state.attachments.home;
+    }
+    persist();
+    go(`chat/${id}`);
+  }
+  function send() {
+    const session = current();
+    if (!session) {
+      showOverlay('new');
+      return;
+    }
+    if (getAgent(session.agent).state === '离线') {
+      toast('该数字生命当前离线,草稿已保留');
+      return;
+    }
+    const text = (state.drafts[session.id] || '').trim();
+    const attachment = state.attachments[session.id];
+    if ((!text && !attachment) || session.sending) return;
+    const turn = { text, attachment, done: false };
+    (state.turns[session.id] ||= []).push(turn);
+    state.drafts[session.id] = '';
+    delete state.attachments[session.id];
+    session.status = 'running';
+    session.sending = true;
+    session.preview = text || attachment;
+    persist();
+    render();
+    phones.forEach((phone) => {
+      const scroll = phone.querySelector('.chat-scroll');
+      if (scroll) scroll.scrollTop = scroll.scrollHeight;
+    });
+    setTimeout(() => {
+      turn.done = true;
+      session.status = 'done';
+      session.sending = false;
+      session.preview = '已完成这次补充 · 原型演示';
+      session.time = '刚刚';
+      if (current()?.id !== session.id) {
+        session.unread += 1;
+        if (state.notify)
+          toast(`${getAgent(session.agent).name} 已完成「${session.title}」`, session.id);
+        else render();
+      } else {
+        render();
+        phones.forEach((phone) => {
+          const scroll = phone.querySelector('.chat-scroll');
+          if (scroll) scroll.scrollTop = scroll.scrollHeight;
+        });
+      }
+    }, 1200);
+  }
+  async function copy(text) {
+    try {
+      await navigator.clipboard.writeText(text);
+      toast('已复制');
+    } catch {
+      toast('浏览器未授权复制,可在实际项目中使用原有复制功能');
+    }
+  }
+  document.addEventListener('click', (event) => {
+    const view = event.target.closest('button[data-view]');
+    if (view) {
+      state.view = view.dataset.view;
+      document.body.dataset.view = state.view;
+      document
+        .querySelectorAll('button[data-view]')
+        .forEach((control) =>
+          control.classList.toggle('selected', control.dataset.view === state.view),
+        );
+      return;
+    }
+    const control = event.target.closest('[data-action]');
+    if (!control) return;
+    if (control.closest('.phone')) sourcePanel = control.closest('.phone').id;
+    const { action, id, value, route } = control.dataset;
+    if (action === 'dismiss') {
+      if (event.target === control) closeOverlay();
+      return;
+    }
+    switch (action) {
+      case 'route':
+        go(route);
+        break;
+      case 'messages':
+        go('messages');
+        break;
+      case 'contacts':
+        go('contacts');
+        break;
+      case 'back':
+        go(tabs.some((tab) => tab[0] === state.returnRoute) ? state.returnRoute : 'messages');
+        break;
+      case 'chat':
+        if (sessions.some((session) => session.id === id)) go(`chat/${id}`);
+        break;
+      case 'filter':
+        state.filter = value;
+        render(false);
+        break;
+      case 'contact-filter':
+        state.contactFilter = value;
+        render(false);
+        break;
+      case 'work-filter':
+        state.workFilter = value;
+        render(false);
+        break;
+      case 'group':
+        state.openGroups.has(id) ? state.openGroups.delete(id) : state.openGroups.add(id);
+        render();
+        break;
+      case 'workspace-open':
+        state.filter = 'workspace';
+        state.openGroups.add(id);
+        go('messages');
+        break;
+      case 'workspace-new':
+        showOverlay(action);
+        break;
+      case 'workspace-rename':
+      case 'workspace-delete':
+        showOverlay(
+          action,
+          workspaces.find((workspace) => workspace.id === id),
+        );
+        break;
+      case 'confirm-workspace-delete':
+        workspaces.splice(
+          workspaces.findIndex((workspace) => workspace.id === id),
+          1,
+        );
+        sessions.forEach((session) => {
+          if (session.workspace === id) session.workspace = null;
+        });
+        closeOverlay();
+        toast('工作区已删除,会话已保留至日常会话');
+        break;
+      case 'close':
+        closeOverlay();
+        break;
+      case 'drawer':
+      case 'title':
+      case 'activity':
+      case 'new':
+      case 'files':
+      case 'chat-menu':
+      case 'notifications':
+      case 'archived':
+      case 'logout':
+        showOverlay(action);
+        break;
+      case 'agent':
+        go(`agent/${id}`);
+        break;
+      case 'enter-agent': {
+        if (getAgent(id).state === '离线') {
+          toast('该数字生命当前离线,请恢复在线后再进入');
+          break;
+        }
+        const session = sessions.find((item) => item.agent === id && !item.archived);
+        if (session) go(`chat/${session.id}`);
+        else createChat(id);
+        break;
+      }
+      case 'person':
+        openPeople.has(id) ? openPeople.delete(id) : openPeople.add(id);
+        render();
+        break;
+      case 'rename-agent':
+      case 'channel':
+      case 'recharge':
+      case 'preview':
+        showOverlay(action, id);
+        break;
+      case 'create-chat':
+        createChat(id);
+        break;
+      case 'quick-new':
+        createChat(current()?.agent || 'nova');
+        break;
+      case 'send':
+        send();
+        break;
+      case 'attach':
+        document.getElementById(sourcePanel).querySelector('[data-field="attachment"]').click();
+        break;
+      case 'remove-attachment':
+        delete state.attachments[current()?.id || 'home'];
+        render();
+        break;
+      case 'copy':
+        copy(
+          '季度复盘,已经整理好了。收入环比增长 18.6%,客户续费率达到 92%。下一步优化新客转化,持续跟进高价值客户。',
+        );
+        break;
+      case 'token':
+        state.tokenShown = !state.tokenShown;
+        render();
+        break;
+      case 'copy-token':
+        copy('DEMO-TOKEN-NOT-A-REAL-CREDENTIAL');
+        break;
+      case 'palette':
+        state.palette = id;
+        persist();
+        render();
+        break;
+      case 'dark':
+        state.dark = !state.dark;
+        persist();
+        render();
+        break;
+      case 'notify':
+        state.notify = !state.notify;
+        persist();
+        render();
+        break;
+      case 'confirm-logout':
+        showOverlay('logged-out');
+        break;
+      case 'archive':
+        if (current()) current().archived = true;
+        go('messages');
+        toast('会话已归档,可在侧栏恢复');
+        break;
+      case 'restore': {
+        const session = sessions.find((item) => item.id === id);
+        if (session) session.archived = false;
+        render();
+        break;
+      }
+      case 'demo-complete': {
+        const session =
+          sessions.find((item) => item.status === 'running' && !item.sending) ||
+          sessions.find((item) => !item.sending && item.id !== current()?.id) ||
+          sessions[0];
+        session.status = 'done';
+        session.preview = '任务已完成,可以查看结果';
+        session.unread += current()?.id === session.id ? 0 : 1;
+        closeOverlay();
+        if (state.notify) toast(`${getAgent(session.agent).name} 的任务已完成(演示)`, session.id);
+        else toast('提醒已关闭,状态已更新');
+        break;
+      }
+      case 'suggest-title': {
+        const title = current()?.title || '新对话';
+        phones.forEach((phone) => {
+          const candidates = phone.querySelector('.candidates');
+          if (candidates)
+            candidates.innerHTML = `<p class="sheet-description">本地预设建议,不会调用 AI。</p>${[`${title.replace(/报告$/, '')} · 关键结论`, `${getAgent(current()?.agent).name} 的工作记录`].map((candidate) => `<button type="button" class="candidate" data-action="use-title" data-value="${escape(candidate)}">${escape(candidate)}</button>`).join('')}`;
+        });
+        break;
+      }
+      case 'use-title':
+        phones.forEach((phone) => {
+          const field = phone.querySelector('[data-field="title"]');
+          if (field) field.value = value;
+        });
+        break;
+    }
+  });
+  document.addEventListener('input', (event) => {
+    const field = event.target;
+    const type = field.dataset.field;
+    if (type === 'search') {
+      state.query = field.value;
+      render(false);
+    }
+    if (type === 'draft') {
+      const key = current()?.id || 'home';
+      state.drafts[key] = field.value;
+      persist();
+      phones.forEach((phone) => {
+        const textarea = phone.querySelector('[data-field="draft"]');
+        if (textarea) {
+          if (textarea !== field) textarea.value = field.value;
+          resizeTextarea(textarea);
+        }
+        const sendButton = phone.querySelector('[data-action="send"]');
+        if (sendButton)
+          sendButton.disabled =
+            !!current()?.sending || (!field.value.trim() && !state.attachments[key]);
+      });
+    }
+    if (type === 'font') {
+      state.font = Number(field.value);
+      persist();
+      phones.forEach((phone) => {
+        phone.style.setProperty('--chat-size', `${state.font}px`);
+        const range = phone.querySelector('[data-field="font"]');
+        if (range) range.value = state.font;
+        const label = phone.querySelector('.font-slider label span');
+        if (label) label.textContent = `${state.font}px`;
+      });
+    }
+  });
+  document.addEventListener('change', (event) => {
+    if (event.target.dataset.field === 'attachment' && event.target.files[0]) {
+      state.attachments[current()?.id || 'home'] = event.target.files[0].name;
+      render();
+      toast('附件已加入演示草稿,文件内容未上传');
+    }
+  });
+  document.addEventListener('submit', (event) => {
+    const form = event.target.closest('[data-form]');
+    if (!form) return;
+    event.preventDefault();
+    const field = form.querySelector('.form-field');
+    const value = field.value.trim();
+    if (!value) {
+      form.querySelector('.form-error').textContent = '名称不能为空';
+      field.focus();
+      return;
+    }
+    if (form.dataset.form === 'title' && current()) current().title = value;
+    if (form.dataset.form === 'workspace') {
+      if (
+        workspaces.some(
+          (workspace) => workspace.name === value && workspace.id !== state.overlayData?.id,
+        )
+      ) {
+        form.querySelector('.form-error').textContent = '已有同名工作区,请换一个名称';
+        return;
+      }
+      if (state.overlayData) state.overlayData.name = value;
+      else {
+        const workspace = { id: `w${Date.now()}`, name: value };
+        workspaces.push(workspace);
+        state.openGroups.add(workspace.id);
+        state.filter = 'workspace';
+        state.route = 'messages';
+        history.replaceState(null, '', '#/messages');
+      }
+    }
+    if (form.dataset.form === 'agent') getAgent(state.overlayData).name = value;
+    closeOverlay();
+    toast('已保存(仅此原型)');
+  });
+  document.addEventListener('keydown', (event) => {
+    if (event.key === 'Escape' && state.overlay) {
+      event.preventDefault();
+      closeOverlay();
+      return;
+    }
+    const dialog = event.target.closest('[role="dialog"]');
+    if (event.key === 'Tab' && dialog) {
+      const focusable = [
+        ...dialog.querySelectorAll('button:not(:disabled),input:not(:disabled),textarea,a[href]'),
+      ].filter((element) => element.getClientRects().length);
+      const first = focusable[0];
+      const last = focusable.at(-1);
+      if (event.shiftKey && document.activeElement === first) {
+        event.preventDefault();
+        last?.focus();
+      } else if (!event.shiftKey && document.activeElement === last) {
+        event.preventDefault();
+        first?.focus();
+      }
+    }
+    if (
+      event.target.dataset.field === 'draft' &&
+      event.key === 'Enter' &&
+      !event.shiftKey &&
+      !event.isComposing &&
+      event.target.closest('.baseline')
+    ) {
+      event.preventDefault();
+      send();
+    }
+  });
+  const readHash = () => {
+    let route = '';
+    try {
+      route = decodeURIComponent(location.hash.replace(/^#\/?/, ''));
+    } catch {}
+    return /^(messages|contacts|workbench|mine|home|chat\/[\w-]+|agent\/[\w-]+)$/.test(route)
+      ? route
+      : 'messages';
+  };
+  window.addEventListener('hashchange', () => go(readHash()));
+  go(readHash());
+})();

+ 14 - 0
prototypes/mobile-current-polish-20261116/build.mjs

@@ -0,0 +1,14 @@
+import { readFile, writeFile } from 'node:fs/promises';
+const directory = new URL('./', import.meta.url);
+const [template, styles, script] = await Promise.all(
+  ['preview.template.html', 'styles.css', 'app.js'].map((name) =>
+    readFile(new URL(name, directory), 'utf8'),
+  ),
+);
+await writeFile(
+  new URL('index.html', directory),
+  template
+    .replace('/* STYLES */', () => styles)
+    .replace('/* SCRIPT */', () => script.replaceAll('</script', '<\\/script')),
+);
+console.log('Built standalone index.html (no network dependencies)');

+ 3350 - 0
prototypes/mobile-current-polish-20261116/index.html

@@ -0,0 +1,3350 @@
+<!doctype html>
+<html lang="zh-CN">
+  <head>
+    <meta charset="UTF-8" />
+    <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
+    <meta name="color-scheme" content="light" />
+    <title>fmode · 现有移动端 UI 精修对照</title>
+    <style>
+      * {
+  box-sizing: border-box;
+}
+:root {
+  font-family:
+    Inter,
+    -apple-system,
+    BlinkMacSystemFont,
+    'Segoe UI',
+    'PingFang SC',
+    'Microsoft YaHei',
+    sans-serif;
+  color: #25272a;
+  background: #f1f1f0;
+  font-synthesis: none;
+}
+body {
+  margin: 0;
+}
+button,
+input,
+textarea {
+  font: inherit;
+}
+button {
+  cursor: pointer;
+  color: inherit;
+  border: 0;
+  background: none;
+  -webkit-tap-highlight-color: transparent;
+}
+button:disabled {
+  cursor: default;
+  opacity: 0.4;
+}
+button:focus-visible,
+input:focus-visible,
+textarea:focus-visible,
+summary:focus-visible {
+  outline: 2px solid #6386af;
+  outline-offset: 3px;
+}
+button,
+input,
+textarea {
+  touch-action: manipulation;
+}
+svg {
+  width: 21px;
+  height: 21px;
+  fill: none;
+  stroke: currentColor;
+  stroke-width: 1.65;
+  stroke-linecap: round;
+  stroke-linejoin: round;
+  flex: none;
+}
+h1,
+h2,
+h3,
+p {
+  margin: 0;
+}
+button {
+  transition:
+    background 0.15s,
+    transform 0.15s;
+}
+button:active {
+  transform: translateY(1px);
+}
+.studio-header {
+  height: 72px;
+  border-bottom: 1px solid #dededb;
+  margin: 0 48px;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+.brand {
+  display: flex;
+  align-items: center;
+  gap: 12px;
+  font-size: 12px;
+  color: #777873;
+}
+.brand strong {
+  font-size: 23px;
+  letter-spacing: -1.2px;
+  color: #25272a;
+}
+.brand-mark {
+  width: 27px;
+  height: 27px;
+  background: #292b2e;
+  border-radius: 9px;
+  color: white;
+  font-size: 25px;
+  line-height: 30px;
+  font-weight: 700;
+  text-align: center;
+  font-style: italic;
+}
+.brand-divider {
+  height: 17px;
+  width: 1px;
+  background: #cececa;
+  margin: 0 5px;
+}
+.prototype-label {
+  font-size: 11px;
+  color: #81817c;
+}
+.studio {
+  max-width: 1040px;
+  margin: 0 auto;
+  padding: 34px 28px 24px;
+}
+.studio-heading {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  gap: 24px;
+}
+.eyebrow {
+  font-size: 10px;
+  font-weight: 600;
+  color: #777872;
+  letter-spacing: 2px;
+  margin-bottom: 9px;
+}
+h1 {
+  font-size: 25px;
+  font-weight: 600;
+  letter-spacing: -0.6px;
+}
+.studio-heading p {
+  font-size: 12px;
+  color: #777872;
+  margin-top: 10px;
+  line-height: 1.8;
+}
+.view-control {
+  display: flex;
+  padding: 4px;
+  border: 1px solid #d9d9d5;
+  border-radius: 10px;
+  flex: none;
+}
+.view-control button {
+  font-size: 11px;
+  padding: 8px 12px;
+  border-radius: 7px;
+  color: #777872;
+}
+.view-control button.selected {
+  background: #fff;
+  color: #26272a;
+  box-shadow: 0 1px 4px #00000008;
+}
+.scene-nav {
+  display: flex;
+  gap: 6px;
+  margin: 27px 0 22px;
+  border-bottom: 1px solid #dededb;
+  overflow: auto;
+}
+.scene-nav button {
+  font-size: 12px;
+  white-space: nowrap;
+  padding: 13px 15px 14px;
+  color: #83847e;
+  border-bottom: 2px solid transparent;
+  display: flex;
+  align-items: center;
+  gap: 7px;
+}
+.scene-nav svg {
+  width: 15px;
+  height: 15px;
+}
+.scene-nav button.selected {
+  color: #25272a;
+  border-bottom-color: #25272a;
+}
+.comparison {
+  display: flex;
+  justify-content: center;
+  gap: 54px;
+  align-items: flex-start;
+}
+.specimen {
+  width: 390px;
+  min-width: 0;
+}
+.specimen-caption {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  margin-bottom: 14px;
+  gap: 8px;
+  font-size: 10px;
+  color: #82837c;
+}
+.specimen-caption > div {
+  display: flex;
+  align-items: center;
+  gap: 8px;
+}
+.specimen-caption strong {
+  font-size: 12px;
+  font-weight: 600;
+  color: #3a3b3c;
+}
+.version-number {
+  font-size: 10px;
+  border: 1px solid #cececa;
+  width: 22px;
+  height: 22px;
+  border-radius: 6px;
+  display: grid;
+  place-items: center;
+}
+.live-label {
+  display: flex;
+  gap: 5px;
+  align-items: center;
+}
+.live-label i {
+  width: 5px;
+  height: 5px;
+  background: #4e7461;
+  border-radius: 50%;
+}
+.phone {
+  --canvas: #f2f3f5;
+  --surface: #fff;
+  --surface-2: #f7f7f8;
+  --ink: #202124;
+  --ink-2: #45474b;
+  --muted: #62666d;
+  --edge: #dfe1e4;
+  --primary: #25272a;
+  --primary-content: #fff;
+  --subtle: #e8e9eb;
+  --avatar: #e9eaec;
+  --shadow: 0 1px 2px #17243c0a, 0 4px 12px #17243c0f;
+  --chat-size: 14px;
+  isolation: isolate;
+  position: relative;
+  background: var(--canvas);
+  color: var(--ink);
+  height: 792px;
+  border-radius: 38px;
+  overflow: hidden;
+  box-shadow:
+    0 0 0 1px #d5d5d1,
+    0 0 0 5px #fafaf8,
+    0 18px 38px -15px #24262622;
+  display: flex;
+  flex-direction: column;
+  font-size: 14px;
+}
+.phone.dark {
+  --canvas: #18191b;
+  --surface: #222426;
+  --surface-2: #292b2e;
+  --ink: #f2f3f4;
+  --ink-2: #d0d2d5;
+  --muted: #a7abb1;
+  --edge: #383b3f;
+  --primary: #f1f2f3;
+  --primary-content: #202124;
+  --subtle: #34373b;
+  --avatar: #34383c;
+}
+.phone[data-palette='ice']:not(.dark) {
+  --canvas: #f6f8fc;
+  --ink: #202a3c;
+  --primary: #4056c7;
+  --subtle: #e8ecfb;
+  --avatar: #e6ebf7;
+}
+.phone[data-palette='clay']:not(.dark) {
+  --canvas: #f3f0eb;
+  --surface: #fffdfa;
+  --ink: #2a2623;
+  --primary: #af482b;
+  --subtle: #f6e8e1;
+  --avatar: #f0e5dc;
+}
+.phone[data-palette='slate']:not(.dark) {
+  --canvas: #f1f0f5;
+  --ink: #282633;
+  --primary: #6952a3;
+  --subtle: #efebf8;
+  --avatar: #e7e2f0;
+}
+.specimen-note {
+  font-size: 11px;
+  color: #82837c;
+  margin-top: 20px;
+  line-height: 1.8;
+  text-align: center;
+}
+.studio-footer {
+  display: flex;
+  justify-content: space-between;
+  border-top: 1px solid #dededb;
+  margin-top: 28px;
+  padding-top: 18px;
+  color: #8b8c85;
+  font-size: 10px;
+}
+.mobile-review {
+  display: none;
+}
+body[data-view='polished'] .baseline-specimen,
+body[data-view='baseline'] .polished-specimen {
+  display: none;
+}
+.statusbar {
+  height: 40px;
+  flex: none;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  padding: 11px 27px 0;
+  font-size: 13px;
+  font-weight: 650;
+  letter-spacing: 0.2px;
+}
+.status-icons {
+  display: flex;
+  gap: 5px;
+  align-items: center;
+}
+.status-icons svg {
+  width: 15px;
+  height: 15px;
+  stroke-width: 1.9;
+}
+.status-icons svg:last-child {
+  width: 23px;
+}
+.appbar {
+  height: 68px;
+  flex: none;
+  display: flex;
+  align-items: center;
+  gap: 10px;
+  padding: 0 16px;
+}
+.round-button {
+  width: 44px;
+  height: 44px;
+  display: grid;
+  place-items: center;
+  border-radius: 50%;
+  background: var(--surface);
+  box-shadow: var(--shadow);
+  flex: none;
+}
+.appbar-title {
+  flex: 1;
+  min-width: 0;
+  text-align: center;
+}
+.appbar-title h2 {
+  font-size: 16px;
+  font-weight: 600;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+  line-height: 24px;
+}
+.appbar-title p {
+  font-size: 11px;
+  color: var(--muted);
+  line-height: 19px;
+}
+.appbar-title button {
+  max-width: 100%;
+  padding: 0;
+  display: block;
+  width: 100%;
+}
+.appbar-title button h2 {
+  padding: 0 3px;
+}
+.appbar-right {
+  display: flex;
+  gap: 8px;
+}
+.header-spacer {
+  width: 44px;
+  flex: none;
+}
+.page-content {
+  flex: 1;
+  min-height: 0;
+  overflow-y: auto;
+  overscroll-behavior: contain;
+  scrollbar-width: none;
+  padding-bottom: 20px;
+}
+.page-content::-webkit-scrollbar {
+  display: none;
+}
+.filter-area {
+  padding: 0 20px 0;
+  flex: none;
+}
+.segmented {
+  display: flex;
+  background: var(--surface-2);
+  border: 1px solid var(--edge);
+  border-radius: 99px;
+  padding: 4px;
+  max-width: 300px;
+  margin: 0 auto 14px;
+}
+.segmented button {
+  flex: 1;
+  min-height: 36px;
+  font-size: 13px;
+  border-radius: 99px;
+  color: var(--muted);
+}
+.segmented button.selected {
+  background: var(--surface);
+  box-shadow: var(--shadow);
+  color: var(--ink);
+  font-weight: 550;
+}
+.search {
+  display: flex;
+  align-items: center;
+  gap: 9px;
+  height: 44px;
+  background: var(--surface);
+  border: 1px solid var(--edge);
+  border-radius: 10px;
+  padding: 0 12px;
+  color: var(--muted);
+}
+.search svg {
+  width: 18px;
+  height: 18px;
+}
+.search input {
+  background: none;
+  border: 0;
+  outline: none;
+  min-width: 0;
+  width: 100%;
+  color: var(--ink);
+  font-size: 13px;
+  height: 100%;
+}
+.search input::placeholder {
+  color: var(--muted);
+  opacity: 0.8;
+}
+.list {
+  margin: 12px 20px 0;
+  background: var(--surface);
+  border: 1px solid var(--edge);
+  border-radius: 16px;
+  overflow: hidden;
+}
+.conversation {
+  position: relative;
+  display: flex;
+  align-items: center;
+  gap: 12px;
+  padding: 14px 16px;
+  min-height: 76px;
+  width: 100%;
+  text-align: left;
+}
+.conversation + .conversation {
+  border-top: 1px solid var(--edge);
+}
+.conversation:hover {
+  background: var(--surface-2);
+}
+.avatar {
+  width: 40px;
+  height: 40px;
+  border-radius: 50%;
+  flex: none;
+  display: grid;
+  place-items: center;
+  background: var(--avatar);
+  color: var(--muted);
+  font-size: 16px;
+  font-weight: 550;
+  position: relative;
+}
+.presence {
+  position: absolute;
+  right: 0;
+  bottom: 0;
+  width: 9px;
+  height: 9px;
+  border: 2px solid var(--surface);
+  border-radius: 50%;
+  background: #4d8c6b;
+}
+.presence.off {
+  background: #b4b7bb;
+}
+.row-body {
+  min-width: 0;
+  flex: 1;
+}
+.row-title {
+  display: block;
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  font-size: 14px;
+  font-weight: 550;
+  line-height: 22px;
+}
+.row-preview {
+  display: block;
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  font-size: 12px;
+  line-height: 20px;
+  color: var(--muted);
+}
+.row-tail {
+  align-self: stretch;
+  display: flex;
+  flex-direction: column;
+  align-items: flex-end;
+  justify-content: center;
+  gap: 8px;
+  flex: none;
+  font-size: 10px;
+  color: var(--muted);
+}
+.unread {
+  background: #c33f42;
+  color: #fff;
+  border-radius: 99px;
+  min-width: 17px;
+  height: 17px;
+  display: grid;
+  place-items: center;
+  font-size: 10px;
+  padding: 0 5px;
+}
+.row-meta {
+  display: none;
+}
+.list-footer {
+  text-align: center;
+  color: var(--muted);
+  opacity: 0.7;
+  font-size: 10px;
+  padding: 20px;
+}
+.tabbar {
+  height: 70px;
+  flex: none;
+  display: flex;
+  align-items: center;
+  background: color-mix(in srgb, var(--surface) 88%, transparent);
+  border-top: 1px solid var(--edge);
+  backdrop-filter: blur(16px);
+  padding: 5px 10px 2px;
+  position: relative;
+}
+.tabbar button {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  flex-direction: column;
+  gap: 4px;
+  flex: 1;
+  font-size: 10px;
+  color: var(--muted);
+  min-height: 48px;
+  position: relative;
+}
+.tab-icon {
+  display: grid;
+  place-items: center;
+  height: 28px;
+  width: 48px;
+  border-radius: 12px;
+  position: relative;
+}
+.tabbar button.selected {
+  color: var(--primary);
+  font-weight: 650;
+}
+.tabbar .unread {
+  position: absolute;
+  top: -3px;
+  right: 2px;
+  min-width: 15px;
+  height: 15px;
+  font-size: 9px;
+}
+.home-indicator {
+  height: 18px;
+  background: var(--surface);
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  flex: none;
+}
+.home-indicator:after {
+  content: '';
+  height: 4px;
+  width: 116px;
+  background: var(--ink);
+  border-radius: 9px;
+  opacity: 0.8;
+}
+.group-toggle {
+  display: flex;
+  align-items: center;
+  gap: 9px;
+  width: 100%;
+  min-height: 58px;
+  padding: 12px 16px;
+  text-align: left;
+}
+.group-toggle strong {
+  font-size: 13px;
+  flex: 1;
+  font-weight: 550;
+}
+.group-toggle span {
+  font-size: 11px;
+  color: var(--muted);
+}
+.group-toggle svg {
+  width: 18px;
+  height: 18px;
+}
+.group-actions {
+  display: flex;
+  padding: 0 12px 12px;
+  gap: 6px;
+}
+.group-actions button {
+  font-size: 11px;
+  color: var(--muted);
+  padding: 8px;
+  min-height: 36px;
+}
+.section-label {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  margin: 21px 22px 10px;
+  font-size: 12px;
+  color: var(--muted);
+  font-weight: 500;
+}
+.text-button {
+  color: var(--muted);
+  font-size: 12px;
+  padding: 10px 0;
+  min-height: 40px;
+  display: inline-flex;
+  align-items: center;
+  gap: 5px;
+}
+.text-button svg {
+  width: 15px;
+  height: 15px;
+}
+.empty {
+  padding: 50px 24px;
+  text-align: center;
+  color: var(--muted);
+}
+.empty svg {
+  width: 30px;
+  height: 30px;
+  margin-bottom: 14px;
+}
+.empty h3 {
+  font-size: 15px;
+  color: var(--ink);
+  margin-bottom: 8px;
+}
+.empty p {
+  font-size: 12px;
+  line-height: 1.8;
+}
+.empty button {
+  margin-top: 18px;
+}
+.primary-button {
+  background: var(--primary);
+  color: var(--primary-content);
+  border-radius: 10px;
+  min-height: 44px;
+  padding: 10px 17px;
+  font-size: 13px;
+  font-weight: 550;
+}
+.secondary-button {
+  background: var(--surface-2);
+  border: 1px solid var(--edge);
+  border-radius: 10px;
+  min-height: 44px;
+  padding: 10px 16px;
+  font-size: 13px;
+}
+.chat-scroll {
+  padding: 8px 16px 22px;
+  scroll-behavior: smooth;
+}
+.chat-date {
+  text-align: center;
+  color: var(--muted);
+  font-size: 10px;
+  margin: 8px 0 21px;
+}
+.user-message {
+  background: var(--subtle);
+  border-radius: 16px 16px 4px 16px;
+  margin-left: 35px;
+  padding: 12px 15px;
+  line-height: 1.75;
+  font-size: var(--chat-size);
+  white-space: pre-wrap;
+  overflow-wrap: anywhere;
+}
+.agent-line {
+  display: flex;
+  align-items: center;
+  gap: 8px;
+  margin: 20px 0 10px;
+  font-size: 12px;
+  font-weight: 600;
+}
+.agent-line .avatar {
+  width: 26px;
+  height: 26px;
+  font-size: 11px;
+}
+.agent-line .agent-status {
+  margin-left: auto;
+  color: var(--muted);
+  font-size: 10px;
+  font-weight: 400;
+}
+.process {
+  margin-bottom: 8px;
+}
+.process summary {
+  cursor: pointer;
+  list-style: none;
+  min-height: 32px;
+  padding: 6px 10px;
+  display: flex;
+  align-items: center;
+  gap: 6px;
+  font-size: 10px;
+  color: var(--muted);
+  background: var(--surface-2);
+  border: 1px solid var(--edge);
+  border-radius: 99px;
+  width: fit-content;
+  max-width: 100%;
+}
+.process summary::-webkit-details-marker {
+  display: none;
+}
+.process summary svg {
+  width: 13px;
+  height: 13px;
+}
+.process summary span {
+  margin-left: 4px;
+}
+.process[open] summary svg:last-child {
+  transform: rotate(180deg);
+}
+.process ol {
+  font-size: 11px;
+  color: var(--muted);
+  line-height: 2.1;
+  padding-left: 30px;
+  margin: 10px 0;
+}
+.assistant-card {
+  background: var(--surface);
+  border: 1px solid var(--edge);
+  border-radius: 16px;
+  padding: 16px;
+  font-size: var(--chat-size);
+  line-height: 1.85;
+  overflow-wrap: anywhere;
+}
+.assistant-card h3 {
+  font-size: 16px;
+  font-weight: 650;
+  margin-bottom: 7px;
+  line-height: 1.65;
+}
+.assistant-card p {
+  color: var(--ink-2);
+  margin: 0 0 12px;
+}
+.assistant-card p:last-child {
+  margin-bottom: 0;
+}
+.insight {
+  border-left: 2px solid var(--edge);
+  padding: 0 0 0 11px;
+  margin: 14px 0;
+}
+.insight p {
+  margin: 0 0 6px;
+  font-size: 13px;
+}
+.insight b {
+  color: var(--ink);
+  font-weight: 600;
+}
+.files {
+  display: grid;
+  grid-template-columns: 1fr 1fr;
+  gap: 8px;
+  margin-top: 15px;
+}
+.file-card {
+  background: var(--surface-2);
+  border: 1px solid var(--edge);
+  border-radius: 10px;
+  padding: 11px;
+  text-align: left;
+  min-width: 0;
+  display: flex;
+  flex-direction: column;
+  gap: 6px;
+}
+.file-type {
+  display: grid;
+  place-items: center;
+  width: 29px;
+  height: 34px;
+  border: 1px solid #e2c2b7;
+  background: #fff0e9;
+  color: #ae5737;
+  border-radius: 5px;
+  font-size: 8px;
+  font-weight: 700;
+  letter-spacing: 0.3px;
+}
+.file-type.sheet {
+  background: #eef5ee;
+  color: #487556;
+  border-color: #c8dccb;
+}
+.file-card strong {
+  font-size: 11px;
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  max-width: 100%;
+  font-weight: 550;
+}
+.file-card small {
+  font-size: 9px;
+  color: var(--muted);
+}
+.response-actions {
+  display: flex;
+  gap: 2px;
+  margin-top: 5px;
+}
+.response-actions button {
+  min-width: 38px;
+  min-height: 36px;
+  display: grid;
+  place-items: center;
+  color: var(--muted);
+}
+.response-actions svg {
+  width: 15px;
+  height: 15px;
+}
+.composer-wrap {
+  padding: 6px 16px 9px;
+  flex: none;
+  background: var(--canvas);
+}
+.activity-entry {
+  display: none;
+  align-items: center;
+  gap: 7px;
+  font-size: 11px;
+  min-height: 35px;
+  color: var(--muted);
+  padding: 0 5px;
+  margin-bottom: 3px;
+}
+.activity-entry span {
+  flex: 1;
+  text-align: left;
+}
+.activity-entry svg {
+  width: 15px;
+  height: 15px;
+}
+.activity-entry .activity-dot {
+  width: 6px;
+  height: 6px;
+  background: #b78332;
+  border-radius: 50%;
+}
+.composer {
+  background: var(--surface);
+  border: 1px solid var(--edge);
+  border-radius: 16px;
+  padding: 12px 14px;
+  box-shadow:
+    0 4px 8px #17243c14,
+    0 16px 32px #17243c1f;
+}
+.composer textarea {
+  resize: none;
+  border: 0;
+  outline: none !important;
+  background: none;
+  color: var(--ink);
+  font-size: 16px;
+  width: 100%;
+  height: 48px;
+  min-height: 48px;
+  max-height: 112px;
+  line-height: 1.6;
+  display: block;
+  padding: 0;
+}
+.composer textarea::placeholder {
+  color: var(--muted);
+  opacity: 0.75;
+}
+.composer-tools {
+  display: flex;
+  align-items: center;
+  gap: 2px;
+  min-height: 40px;
+}
+.tool-button {
+  width: 40px;
+  height: 40px;
+  display: grid;
+  place-items: center;
+  color: var(--muted);
+  border-radius: 50%;
+}
+.agent-tool {
+  display: flex;
+  align-items: center;
+  gap: 5px;
+  font-size: 11px;
+  color: var(--muted);
+  min-height: 40px;
+  padding: 0 8px;
+}
+.agent-tool svg {
+  width: 14px;
+  height: 14px;
+}
+.send-button {
+  margin-left: auto;
+  background: var(--primary);
+  color: var(--primary-content);
+  width: 36px;
+  height: 36px;
+  border-radius: 50%;
+  display: grid;
+  place-items: center;
+}
+.input-hint {
+  display: none;
+  text-align: center;
+  font-size: 9px;
+  color: var(--muted);
+  margin-top: 8px;
+  opacity: 0.85;
+}
+.attachment-chip {
+  background: var(--surface-2);
+  font-size: 11px;
+  display: flex;
+  align-items: center;
+  gap: 6px;
+  padding: 6px 9px;
+  border-radius: 7px;
+  margin-bottom: 8px;
+  overflow: hidden;
+}
+.attachment-chip span {
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}
+.attachment-chip button {
+  margin-left: auto;
+  flex: none;
+  min-width: 32px;
+  min-height: 32px;
+}
+.attachment-chip svg {
+  width: 15px;
+  height: 15px;
+}
+.home-hero {
+  text-align: center;
+  padding: 60px 20px 35px;
+}
+.home-logo {
+  font-size: 49px;
+  font-weight: 650;
+  letter-spacing: -3px;
+}
+.home-hero h3 {
+  font-weight: 500;
+  font-size: 18px;
+  margin: 15px 0 10px;
+}
+.home-hero p {
+  font-size: 11px;
+  color: var(--muted);
+}
+.overview {
+  display: flex;
+  margin: 8px 20px 18px;
+  background: var(--surface);
+  border: 1px solid var(--edge);
+  border-radius: 16px;
+  padding: 19px 8px;
+}
+.overview > div {
+  flex: 1;
+  text-align: center;
+  border-right: 1px solid var(--edge);
+}
+.overview > div:last-child {
+  border: 0;
+}
+.overview strong {
+  font-size: 25px;
+  font-weight: 600;
+  display: block;
+  line-height: 1.3;
+}
+.overview span {
+  font-size: 10px;
+  color: var(--muted);
+  display: block;
+  margin-top: 5px;
+}
+.life-card {
+  margin: 12px 20px 0;
+  background: var(--surface);
+  border: 1px solid var(--edge);
+  border-radius: 16px;
+  padding: 14px 16px;
+  box-shadow: var(--shadow);
+}
+.life-head {
+  display: flex;
+  align-items: center;
+  gap: 10px;
+}
+.life-head .row-body strong {
+  font-size: 14px;
+  display: block;
+}
+.life-head small {
+  font-size: 11px;
+  color: var(--muted);
+  display: block;
+  margin-top: 4px;
+}
+.state-tag {
+  font-size: 10px;
+  border-radius: 5px;
+  padding: 4px 6px;
+  background: #edf7f1;
+  color: #207550;
+  white-space: nowrap;
+}
+.state-tag.busy {
+  background: #fff7e8;
+  color: #91600e;
+}
+.state-tag.offline {
+  background: var(--surface-2);
+  color: var(--muted);
+}
+.task-line {
+  font-size: 11px;
+  background: var(--surface-2);
+  padding: 10px;
+  border-radius: 7px;
+  display: flex;
+  align-items: center;
+  gap: 7px;
+  margin: 13px 0;
+}
+.task-line svg {
+  width: 14px;
+  height: 14px;
+  color: var(--muted);
+}
+.task-line span {
+  overflow: hidden;
+  white-space: nowrap;
+  text-overflow: ellipsis;
+}
+.metrics {
+  display: flex;
+  gap: 18px;
+  margin: 13px 0 15px;
+}
+.metric {
+  flex: 1;
+  font-size: 10px;
+  color: var(--muted);
+}
+.metric > div {
+  display: flex;
+  justify-content: space-between;
+}
+.metric-track {
+  height: 5px;
+  border-radius: 5px;
+  background: var(--subtle);
+  margin-top: 7px;
+  overflow: hidden;
+}
+.metric-track i {
+  height: 100%;
+  display: block;
+  border-radius: 5px;
+  background: var(--primary);
+  opacity: 0.55;
+}
+.life-actions {
+  display: flex;
+  gap: 8px;
+  border-top: 1px solid var(--edge);
+  padding-top: 12px;
+}
+.life-actions button {
+  flex: 1;
+  min-height: 34px;
+  font-size: 11px;
+  border-radius: 7px;
+  background: var(--surface-2);
+}
+.life-actions button:first-child {
+  background: var(--primary);
+  color: var(--primary-content);
+}
+.profile-card {
+  margin: 8px 20px 0;
+  padding: 20px 16px;
+  border: 1px solid var(--edge);
+  border-radius: 16px;
+  background: var(--surface);
+  display: flex;
+  gap: 13px;
+  align-items: center;
+}
+.profile-card .avatar {
+  width: 54px;
+  height: 54px;
+  font-size: 21px;
+}
+.profile-card h3 {
+  font-size: 17px;
+  font-weight: 600;
+}
+.profile-card p {
+  font-size: 11px;
+  color: var(--muted);
+  margin-top: 7px;
+}
+.settings-card {
+  margin: 0 20px;
+  background: var(--surface);
+  border: 1px solid var(--edge);
+  border-radius: 16px;
+  overflow: hidden;
+}
+.setting-row {
+  display: flex;
+  align-items: center;
+  gap: 10px;
+  padding: 13px 16px;
+  min-height: 58px;
+  width: 100%;
+  text-align: left;
+  font-size: 13px;
+}
+.setting-row + .setting-row {
+  border-top: 1px solid var(--edge);
+}
+.setting-row > svg {
+  width: 17px;
+  height: 17px;
+  color: var(--muted);
+}
+.setting-row .row-body {
+  display: block;
+}
+.setting-row small {
+  display: block;
+  color: var(--muted);
+  font-size: 10px;
+  margin-top: 4px;
+}
+.setting-row > span:last-child {
+  font-size: 11px;
+  color: var(--muted);
+}
+.setting-row .tool-button {
+  width: 34px;
+  height: 34px;
+}
+.setting-row .tool-button svg {
+  width: 17px;
+  height: 17px;
+}
+.danger {
+  color: #c33f42;
+}
+.palette-label {
+  padding: 16px 16px 10px;
+  font-size: 12px;
+}
+.palette-grid {
+  display: grid;
+  grid-template-columns: 1fr 1fr;
+  gap: 8px;
+  padding: 0 16px 15px;
+}
+.palette-grid button {
+  border: 1px solid var(--edge);
+  border-radius: 9px;
+  text-align: left;
+  min-height: 45px;
+  padding: 8px;
+  display: flex;
+  gap: 7px;
+  align-items: center;
+  font-size: 10px;
+}
+.palette-grid button.selected {
+  border-color: var(--primary);
+  background: var(--surface-2);
+}
+.palette-swatch {
+  width: 17px;
+  height: 24px;
+  border-radius: 5px;
+  box-shadow: inset -6px 0 #ffffffaa;
+  flex: none;
+}
+.switch {
+  height: 25px;
+  width: 43px;
+  border-radius: 99px;
+  background: var(--edge);
+  position: relative;
+  flex: none;
+}
+.switch:after {
+  content: '';
+  position: absolute;
+  left: 3px;
+  top: 3px;
+  width: 19px;
+  height: 19px;
+  border-radius: 50%;
+  background: white;
+  box-shadow: 0 1px 3px #0002;
+}
+.switch[aria-checked='true'] {
+  background: var(--primary);
+}
+.switch[aria-checked='true']:after {
+  left: 21px;
+  background: var(--primary-content);
+}
+.font-slider {
+  padding: 15px 16px;
+  border-top: 1px solid var(--edge);
+  font-size: 12px;
+}
+.font-slider label {
+  display: flex;
+  justify-content: space-between;
+}
+.font-slider input {
+  width: 100%;
+  accent-color: var(--primary);
+  margin-top: 17px;
+}
+.overlay {
+  position: absolute;
+  inset: 40px 0 0;
+  background: #11121465;
+  z-index: 20;
+  display: flex;
+  align-items: flex-end;
+  backdrop-filter: blur(2px);
+}
+.sheet {
+  background: var(--surface);
+  border-radius: 24px 24px 0 0;
+  width: 100%;
+  max-height: 90%;
+  overflow: auto;
+  overscroll-behavior: contain;
+  padding: 9px 20px 26px;
+  box-shadow: 0 -5px 35px #0000000b;
+  animation: sheet-in 0.2s ease-out;
+}
+.sheet-handle {
+  width: 34px;
+  height: 4px;
+  background: var(--edge);
+  border-radius: 4px;
+  margin: 0 auto 14px;
+}
+.sheet-heading {
+  display: flex;
+  align-items: center;
+  gap: 10px;
+  margin-bottom: 8px;
+}
+.sheet-heading h3 {
+  flex: 1;
+  font-size: 17px;
+  font-weight: 600;
+}
+.close-button {
+  width: 36px;
+  height: 36px;
+  border-radius: 50%;
+  background: var(--surface-2);
+  display: grid;
+  place-items: center;
+  flex: none;
+}
+.close-button svg {
+  width: 18px;
+  height: 18px;
+}
+.sheet-description {
+  font-size: 12px;
+  color: var(--muted);
+  line-height: 1.8;
+  margin-bottom: 20px;
+}
+.sheet .list {
+  margin: 10px 0 0;
+}
+.sheet .conversation {
+  padding: 13px 12px;
+}
+.sheet .row-meta {
+  display: flex;
+  font-size: 10px;
+  gap: 4px;
+  color: var(--muted);
+}
+.sheet .row-meta.running {
+  color: #91600e;
+}
+.sheet .row-meta.done {
+  color: #207550;
+}
+.sheet .row-meta.error {
+  color: #c33f42;
+}
+.sheet .primary-button {
+  width: 100%;
+  margin-top: 20px;
+}
+.field-label {
+  display: block;
+  font-size: 12px;
+  color: var(--muted);
+  margin-bottom: 8px;
+}
+.form-field {
+  min-height: 46px;
+  border: 1px solid var(--edge);
+  border-radius: 10px;
+  padding: 12px;
+  background: var(--surface-2);
+  color: var(--ink);
+  width: 100%;
+  font-size: 14px;
+}
+.form-error {
+  min-height: 24px;
+  font-size: 11px;
+  color: #c33f42;
+  line-height: 24px;
+}
+.candidate {
+  border: 1px solid var(--edge);
+  border-radius: 9px;
+  padding: 12px;
+  text-align: left;
+  font-size: 12px;
+  display: block;
+  width: 100%;
+  margin-top: 8px;
+}
+.drawer-overlay {
+  align-items: stretch;
+}
+.drawer {
+  width: 84%;
+  max-width: 330px;
+  background: var(--surface);
+  padding: 22px 16px 20px;
+  overflow: auto;
+  display: flex;
+  flex-direction: column;
+  animation: drawer-in 0.2s ease-out;
+}
+.drawer-head {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  margin-bottom: 22px;
+  padding: 0 5px;
+}
+.drawer-head strong {
+  font-size: 25px;
+  letter-spacing: -1.5px;
+}
+.drawer-new {
+  display: flex;
+  align-items: center;
+  gap: 12px;
+  background: var(--primary);
+  color: var(--primary-content);
+  padding: 13px;
+  border-radius: 12px;
+  text-align: left;
+}
+.drawer-new strong {
+  display: block;
+  font-size: 13px;
+}
+.drawer-new small {
+  display: block;
+  opacity: 0.7;
+  font-size: 10px;
+  margin-top: 4px;
+}
+.drawer-quick {
+  margin: 8px 0;
+  padding: 12px 9px;
+  background: var(--surface-2);
+  border-radius: 10px;
+  text-align: left;
+  display: flex;
+  align-items: center;
+  gap: 10px;
+  font-size: 12px;
+}
+.drawer-nav {
+  padding: 15px 0;
+  border-bottom: 1px solid var(--edge);
+}
+.drawer-nav button {
+  display: flex;
+  align-items: center;
+  gap: 11px;
+  width: 100%;
+  text-align: left;
+  min-height: 44px;
+  padding: 9px 12px;
+  font-size: 13px;
+  border-radius: 9px;
+}
+.drawer-nav button.selected {
+  background: var(--subtle);
+}
+.drawer-section {
+  font-size: 10px;
+  color: var(--muted);
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  margin: 15px 9px 5px;
+}
+.drawer-section button {
+  min-width: 32px;
+  min-height: 32px;
+}
+.drawer-item {
+  display: flex;
+  align-items: center;
+  gap: 9px;
+  text-align: left;
+  width: 100%;
+  min-height: 42px;
+  font-size: 12px;
+  padding: 8px 11px;
+  border-radius: 8px;
+}
+.drawer-item svg {
+  width: 16px;
+  height: 16px;
+  color: var(--muted);
+}
+.drawer-item span {
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}
+.drawer-footer {
+  margin-top: auto;
+  border-top: 1px solid var(--edge);
+  padding-top: 15px;
+  display: flex;
+  align-items: center;
+  gap: 10px;
+  font-size: 12px;
+}
+.drawer-footer small {
+  display: block;
+  color: var(--muted);
+  font-size: 10px;
+  margin-top: 4px;
+}
+.toast {
+  position: absolute;
+  left: 16px;
+  right: 16px;
+  top: 110px;
+  z-index: 40;
+  background: var(--ink);
+  color: var(--surface);
+  border-radius: 12px;
+  padding: 13px 15px;
+  box-shadow: 0 8px 25px #0002;
+  font-size: 12px;
+  line-height: 1.6;
+  display: flex;
+  align-items: center;
+  gap: 8px;
+  animation: sheet-in 0.2s ease-out;
+}
+.toast span {
+  flex: 1;
+}
+.toast button {
+  font-size: 11px;
+  border: 1px solid currentColor;
+  border-radius: 7px;
+  padding: 5px 8px;
+}
+.preview-document {
+  aspect-ratio: 1.42;
+  background: #eeeee9;
+  color: #262926;
+  border-radius: 10px;
+  padding: 24px 22px;
+  margin: 18px 0;
+  display: flex;
+  flex-direction: column;
+  border: 1px solid #deded6;
+}
+.preview-document .doc-brand {
+  font-size: 9px;
+  letter-spacing: 2px;
+  color: #7b7d74;
+}
+.preview-document h2 {
+  font-size: 28px;
+  font-weight: 500;
+  line-height: 1.5;
+  margin: 22px 0 10px;
+  letter-spacing: -1px;
+}
+.preview-document p {
+  font-size: 11px;
+  color: #777a71;
+}
+.preview-document footer {
+  font-size: 8px;
+  border-top: 1px solid #cecec5;
+  padding-top: 10px;
+  margin-top: auto;
+}
+.preview-table {
+  border-collapse: collapse;
+  width: 100%;
+  font-size: 12px;
+  margin: 24px 0;
+}
+.preview-table td,
+.preview-table th {
+  text-align: left;
+  border-bottom: 1px solid var(--edge);
+  padding: 13px 8px;
+}
+.preview-table th {
+  background: var(--surface-2);
+  font-size: 11px;
+  color: var(--muted);
+}
+.loading-dots {
+  display: flex;
+  gap: 5px;
+  padding: 12px 0;
+}
+.loading-dots i {
+  width: 5px;
+  height: 5px;
+  border-radius: 50%;
+  background: var(--muted);
+  animation: pulse 1s infinite alternate;
+}
+.loading-dots i:nth-child(2) {
+  animation-delay: 0.2s;
+}
+.loading-dots i:nth-child(3) {
+  animation-delay: 0.4s;
+}
+.skeleton {
+  height: 10px;
+  border-radius: 5px;
+  background: var(--subtle);
+  margin: 13px 0;
+  animation: pulse 1s infinite alternate;
+}
+.skeleton.short {
+  width: 65%;
+}
+.notification-option {
+  display: flex;
+  align-items: center;
+  gap: 10px;
+  font-size: 12px;
+  min-height: 44px;
+  margin-top: 12px;
+}
+.notification-option input {
+  accent-color: var(--primary);
+  width: 16px;
+  height: 16px;
+}
+.polished {
+  --canvas: #f5f5f7;
+  --edge: #e8e9ec;
+  --shadow: 0 2px 5px #17243c04;
+  --muted: #7a7d84;
+}
+.polished .appbar {
+  height: 70px;
+  padding: 0 20px;
+}
+.polished .round-button {
+  border: 1px solid color-mix(in srgb, var(--edge) 65%, transparent);
+  box-shadow: 0 2px 3px #20212403;
+}
+.polished .appbar-title h2 {
+  font-size: 17px;
+  font-weight: 650;
+  letter-spacing: 0.2px;
+}
+.polished .appbar-title p {
+  font-size: 10px;
+}
+.polished .segmented {
+  background: var(--subtle);
+  border: 0;
+  padding: 3px;
+  max-width: none;
+  margin: 3px 0 14px;
+}
+.polished .segmented button {
+  min-height: 34px;
+  font-size: 12px;
+}
+.polished .segmented button.selected {
+  box-shadow: 0 1px 4px #17243c0c;
+  font-weight: 600;
+}
+.polished .search {
+  border: 1px solid var(--edge);
+  border-radius: 13px;
+  height: 44px;
+}
+.polished .list {
+  border-color: color-mix(in srgb, var(--edge) 65%, transparent);
+  border-radius: 19px;
+  margin-top: 16px;
+  box-shadow: 0 3px 10px #20212402;
+}
+.polished .conversation {
+  padding: 16px 14px;
+  gap: 12px;
+  min-height: 81px;
+}
+.polished .conversation + .conversation {
+  border-top: 0;
+}
+.polished .conversation + .conversation:before {
+  content: '';
+  position: absolute;
+  left: 68px;
+  right: 14px;
+  height: 1px;
+  top: 0;
+  background: var(--edge);
+  opacity: 0.75;
+}
+.polished .avatar {
+  background: linear-gradient(145deg, var(--surface-2), var(--avatar));
+  color: var(--ink-2);
+  border: 1px solid color-mix(in srgb, var(--edge) 80%, transparent);
+  font-size: 16px;
+  font-weight: 500;
+  width: 42px;
+  height: 42px;
+}
+.polished .presence {
+  width: 8px;
+  height: 8px;
+  right: 1px;
+  bottom: 1px;
+}
+.polished .row-title {
+  font-size: 14px;
+  font-weight: 600;
+  line-height: 23px;
+  letter-spacing: 0.05px;
+}
+.polished .row-preview {
+  font-size: 11px;
+  line-height: 20px;
+}
+.polished .row-tail {
+  font-size: 9px;
+  gap: 9px;
+}
+.polished .unread {
+  background: #bc555a;
+  min-width: 16px;
+  height: 16px;
+  font-size: 9px;
+}
+.polished .row-meta {
+  display: flex;
+  align-items: center;
+  gap: 4px;
+  font-size: 9px;
+  color: #987128;
+  margin-top: 3px;
+  line-height: 15px;
+}
+.polished .row-meta svg {
+  width: 11px;
+  height: 11px;
+}
+.polished .row-meta.done {
+  color: #487c5e;
+}
+.polished .row-meta.error {
+  color: #b35858;
+}
+.polished .tabbar {
+  height: 72px;
+  border-top-color: color-mix(in srgb, var(--edge) 85%, transparent);
+  padding-top: 7px;
+}
+.polished .tabbar .tab-icon {
+  height: 29px;
+  transition: background 0.2s;
+}
+.polished .tabbar .selected .tab-icon {
+  background: var(--subtle);
+}
+.polished .tabbar button {
+  font-size: 10px;
+  gap: 4px;
+}
+.polished .tabbar svg {
+  width: 21px;
+  height: 21px;
+}
+.polished .chat-scroll {
+  padding: 6px 20px 14px;
+}
+.polished .chat-date {
+  margin: 5px 0 20px;
+}
+.polished .user-message {
+  font-size: 13px;
+  padding: 11px 14px;
+  border-radius: 16px 16px 5px 16px;
+  background: var(--subtle);
+}
+.polished .agent-line {
+  margin: 18px 0 10px;
+  gap: 7px;
+  font-size: 11px;
+}
+.polished .agent-line .avatar {
+  height: 25px;
+  width: 25px;
+  font-size: 10px;
+}
+.polished .process summary {
+  font-size: 9px;
+  min-height: 30px;
+  background: transparent;
+  border-color: var(--edge);
+}
+.polished .assistant-card {
+  padding: 16px;
+  border-radius: 17px;
+  border-color: var(--edge);
+  box-shadow: 0 2px 5px #20212402;
+  font-size: 13px;
+  line-height: 1.9;
+}
+.polished .assistant-card h3 {
+  font-size: 16px;
+  letter-spacing: -0.1px;
+  margin-bottom: 8px;
+}
+.polished .assistant-card p {
+  margin-bottom: 11px;
+}
+.polished .insight {
+  margin: 14px 0;
+}
+.polished .insight p {
+  font-size: 12px;
+  margin-bottom: 7px;
+}
+.polished .file-card {
+  background: var(--surface-2);
+  border-color: var(--edge);
+  padding: 10px;
+  border-radius: 11px;
+}
+.polished .file-card strong {
+  font-size: 10px;
+}
+.polished .composer-wrap {
+  padding: 0 16px 7px;
+}
+.polished .activity-entry {
+  display: flex;
+  width: 100%;
+  padding: 0 6px;
+}
+.polished .composer {
+  border-radius: 20px;
+  padding: 12px 12px 8px;
+  box-shadow: 0 3px 12px #20212405;
+  border: 1px solid var(--edge);
+}
+.polished .composer textarea {
+  padding: 1px 3px;
+  min-height: 42px;
+  height: 42px;
+  font-size: 14px;
+}
+.polished .input-hint {
+  display: block;
+}
+.polished .send-button {
+  width: 36px;
+  height: 36px;
+}
+.polished .agent-tool {
+  border-radius: 99px;
+  background: var(--surface-2);
+  min-height: 29px;
+  padding: 0 9px;
+  font-size: 10px;
+}
+.polished .tool-button {
+  width: 36px;
+  height: 36px;
+}
+.polished .overview {
+  border-radius: 18px;
+  padding: 19px 8px;
+  margin-top: 10px;
+  border-color: var(--edge);
+}
+.polished .overview strong {
+  font-size: 26px;
+  letter-spacing: -0.5px;
+  font-weight: 550;
+}
+.polished .life-card {
+  box-shadow: none;
+  padding: 16px;
+  border-radius: 18px;
+}
+.polished .life-head .avatar {
+  width: 40px;
+  height: 40px;
+}
+.polished .life-actions button {
+  min-height: 38px;
+  border-radius: 9px;
+}
+.polished .task-line {
+  padding: 11px 10px;
+  border-radius: 9px;
+  margin-top: 16px;
+}
+.polished .profile-card {
+  border-radius: 20px;
+  padding: 22px 18px;
+}
+.polished .profile-card .avatar {
+  width: 54px;
+  height: 54px;
+  font-size: 21px;
+}
+.polished .settings-card {
+  border-radius: 18px;
+}
+.polished .setting-row {
+  min-height: 62px;
+}
+.polished .setting-row + .setting-row {
+  border-top-color: var(--edge);
+}
+.polished .home-hero {
+  padding-top: 54px;
+}
+.polished .home-logo {
+  font-size: 55px;
+}
+.polished .sheet .list {
+  margin: 10px 0 0;
+}
+.polished .sheet .conversation {
+  padding: 14px 11px;
+}
+.polished .sheet .row-meta {
+  display: flex;
+}
+.polished .chat-scroll .assistant-card {
+  font-size: var(--chat-size);
+}
+.baseline .row-meta {
+  display: none;
+}
+.baseline .sheet .row-meta {
+  display: flex;
+}
+.baseline .agent-tool {
+  padding-left: 4px;
+}
+.baseline .agent-tool span {
+  display: none;
+}
+.baseline .input-hint {
+  display: none;
+}
+.baseline .life-actions button {
+  min-height: 34px;
+}
+.baseline .chat-scroll .assistant-card {
+  font-size: var(--chat-size);
+}
+:root {
+  font-family:
+    -apple-system, BlinkMacSystemFont, 'Noto Sans SC', 'Segoe UI', 'Microsoft YaHei', sans-serif;
+}
+.app-shell {
+  display: flex;
+  flex-direction: column;
+  flex: 1;
+  min-height: 0;
+}
+.file-card small {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  gap: 3px;
+}
+.file-card small svg {
+  width: 10px;
+  height: 10px;
+}
+.empty > .avatar {
+  margin: 0 auto 17px;
+}
+.person-children {
+  background: var(--surface-2);
+  padding-left: 24px;
+}
+.person-children .conversation {
+  min-height: 65px;
+  padding-top: 10px;
+  padding-bottom: 10px;
+}
+.person-children .avatar {
+  width: 32px;
+  height: 32px;
+  font-size: 13px;
+}
+.sheet .profile-card p {
+  line-height: 1.8;
+}
+.polished .conversation {
+  padding-top: 11px;
+  padding-bottom: 11px;
+  min-height: 76px;
+}
+.polished .row-title {
+  font-size: 15px;
+  font-weight: 550;
+}
+.polished .row-preview {
+  font-size: 12px;
+}
+.overview strong {
+  margin-top: 5px;
+}
+.overview span {
+  margin-top: 0;
+}
+@keyframes sheet-in {
+  from {
+    transform: translateY(16px);
+    opacity: 0;
+  }
+  to {
+    transform: translateY(0);
+    opacity: 1;
+  }
+}
+.activity-entry .activity-dot.idle {
+  background: var(--muted);
+}
+.send-button,
+.close-button {
+  position: relative;
+}
+.send-button:before,
+.close-button:before {
+  content: '';
+  position: absolute;
+  inset: -4px;
+}
+@keyframes drawer-in {
+  from {
+    transform: translateX(-20px);
+    opacity: 0;
+  }
+  to {
+    transform: translateX(0);
+    opacity: 1;
+  }
+}
+@keyframes pulse {
+  from {
+    opacity: 0.35;
+  }
+  to {
+    opacity: 1;
+  }
+}
+@media (min-width: 1500px) {
+  .studio {
+    padding-top: 42px;
+  }
+  .comparison {
+    gap: 70px;
+  }
+  .phone {
+    height: 820px;
+  }
+}
+@media (max-width: 1000px) and (min-width: 701px) {
+  .studio {
+    padding: 25px 25px;
+  }
+  .comparison {
+    gap: 28px;
+  }
+  .specimen {
+    width: min(390px, calc((100vw - 78px) / 2));
+  }
+  .phone {
+    height: 780px;
+  }
+  .studio-header {
+    margin: 0 25px;
+  }
+  .studio-heading {
+    align-items: flex-start;
+  }
+  .studio-heading p {
+    max-width: 360px;
+  }
+  .view-control button {
+    padding: 8px;
+  }
+  .specimen-caption > span {
+    display: none;
+  }
+}
+@media (max-width: 700px) {
+  html,
+  body {
+    height: 100%;
+    overflow: hidden;
+    background: #f5f5f7;
+  }
+  .studio-header,
+  .studio-heading,
+  .scene-nav,
+  .studio-footer,
+  .specimen-caption,
+  .specimen-note {
+    display: none;
+  }
+  .studio {
+    padding: 0;
+    height: 100dvh;
+    width: 100%;
+    max-width: none;
+    display: flex;
+    flex-direction: column;
+  }
+  .mobile-review {
+    height: 35px;
+    flex: none;
+    display: flex;
+    align-items: center;
+    gap: 3px;
+    padding: 0 12px;
+    background: #e9eaed;
+    color: #777c83;
+    font-size: 10px;
+    border-bottom: 1px solid #dfe1e4;
+  }
+  .mobile-review > span {
+    margin-right: auto;
+    letter-spacing: 0.3px;
+  }
+  .mobile-review button {
+    padding: 4px 11px;
+    border-radius: 5px;
+    font-size: 10px;
+  }
+  .mobile-review button.selected {
+    background: white;
+    color: #25272a;
+    box-shadow: 0 1px 2px #00000008;
+  }
+  .comparison {
+    display: block;
+    min-height: 0;
+    flex: 1;
+  }
+  .specimen {
+    width: 100%;
+    height: 100%;
+  }
+  .baseline-specimen {
+    display: none;
+  }
+  .phone {
+    height: 100%;
+    border-radius: 0;
+    box-shadow: none;
+    padding-top: env(safe-area-inset-top);
+  }
+  .statusbar {
+    display: none;
+  }
+  .home-indicator {
+    height: env(safe-area-inset-bottom);
+    min-height: 8px;
+  }
+  .home-indicator:after {
+    display: none;
+  }
+  .overlay {
+    top: 0;
+  }
+  .sheet {
+    padding-bottom: max(24px, env(safe-area-inset-bottom));
+  }
+  .toast {
+    top: 74px;
+  }
+  body[data-view='baseline'] .baseline-specimen {
+    display: block;
+  }
+  body[data-view='compare'] .polished-specimen {
+    display: block;
+  }
+  .polished .appbar-title h2 {
+    font-size: 16px;
+  }
+  .studio .specimen {
+    margin: 0;
+  }
+  .polished .appbar {
+    padding: 0 16px;
+  }
+}
+@media (max-width: 350px) {
+  .filter-area {
+    padding: 0 14px;
+  }
+  .list,
+  .life-card,
+  .overview,
+  .settings-card,
+  .profile-card {
+    margin-left: 14px;
+    margin-right: 14px;
+  }
+  .appbar,
+  .polished .appbar {
+    padding: 0 12px;
+    gap: 6px;
+  }
+  .appbar-right {
+    gap: 5px;
+  }
+  .round-button {
+    width: 40px;
+    height: 40px;
+  }
+  .polished .conversation,
+  .conversation {
+    padding-left: 12px;
+    padding-right: 12px;
+    gap: 9px;
+  }
+  .row-title,
+  .polished .row-title {
+    font-size: 13px;
+  }
+  .row-preview,
+  .polished .row-preview {
+    font-size: 10px;
+  }
+  .chat-scroll,
+  .polished .chat-scroll {
+    padding-left: 14px;
+    padding-right: 14px;
+  }
+  .sheet {
+    padding-left: 16px;
+    padding-right: 16px;
+  }
+  .appbar-title h2,
+  .polished .appbar-title h2 {
+    font-size: 14px;
+  }
+  .polished .avatar {
+    width: 38px;
+    height: 38px;
+  }
+}
+@media (prefers-reduced-motion: reduce) {
+  *,
+  *:before,
+  *:after {
+    animation: none !important;
+    transition: none !important;
+    scroll-behavior: auto !important;
+  }
+}
+
+    </style>
+  </head>
+  <body>
+    <header class="studio-header">
+      <div class="brand">
+        <span class="brand-mark">f</span><strong>fmode</strong><span class="brand-divider"></span
+        ><span>Mobile UI refinement</span>
+      </div>
+      <span class="prototype-label">独立 HTML 原型 · 未接入业务</span>
+    </header>
+    <main class="studio">
+      <section class="studio-heading">
+        <div>
+          <div class="eyebrow">保留熟悉感,只打磨细节</div>
+          <h1>现有界面,轻一点。清楚一点。</h1>
+          <p>不换产品语言,不改业务流程。以项目现有移动端为底稿精修。</p>
+        </div>
+        <div class="view-control" aria-label="对照模式">
+          <button data-view="compare" class="selected">前后对照</button
+          ><button data-view="polished">只看精修</button
+          ><button data-view="baseline">只看原版</button>
+        </div>
+      </section>
+      <nav class="scene-nav" aria-label="预览页面"></nav>
+      <div class="mobile-review">
+        <span>fmode · UI 预览</span><button data-view="polished" class="selected">精修</button
+        ><button data-view="baseline">原版</button>
+      </div>
+      <section class="comparison" aria-label="移动端界面对照">
+        <article class="specimen baseline-specimen">
+          <header class="specimen-caption">
+            <div><span class="version-number">01</span><strong>现有 UI · HTML 复刻</strong></div>
+            <span>按当前源码还原</span>
+          </header>
+          <div class="phone baseline" id="baseline"></div>
+          <p class="specimen-note">保留当前配色、尺寸与布局;非生产页面截图。</p>
+        </article>
+        <article class="specimen polished-specimen">
+          <header class="specimen-caption">
+            <div><span class="version-number">02</span><strong>同一套 UI · 细节精修</strong></div>
+            <span class="live-label"><i></i> 可交互</span>
+          </header>
+          <div class="phone polished" id="polished"></div>
+          <p class="specimen-note" id="design-note"></p>
+        </article>
+      </section>
+      <footer class="studio-footer">
+        <span>同一份演示数据 · 页面切换同步对照</span
+        ><span>点击会话进入聊天,体验输入、切换与文件预览</span>
+      </footer>
+    </main>
+    <script>
+      (() => {
+  'use strict';
+  const paths = {
+    menu: 'M4 6h16M4 12h12M4 18h16',
+    edit: 'M14 4l6 6M4 20l4-1L20 7a2.1 2.1 0 0 0-3-3L5 16zM13 4H5a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2h13a2 2 0 0 0 2-2v-7',
+    chat: 'M21 11.5a8.5 8.5 0 0 1-8.5 8.5H5l-3 2 1.5-5A8.5 8.5 0 1 1 21 11.5zM7 10h10M7 14h6',
+    people:
+      'M15 20H3v-2a5 5 0 0 1 10 0v2M21 20v-2a5 5 0 0 0-4-4M17 3a4 4 0 0 1 0 8M12 7a4 4 0 1 1-8 0 4 4 0 0 1 8 0',
+    grid: 'M4 4h6v6H4zM14 4h6v6h-6zM4 14h6v6H4zM14 14h6v6h-6z',
+    user: 'M16 7a4 4 0 1 1-8 0 4 4 0 0 1 8 0M4 21v-2a8 8 0 0 1 16 0v2',
+    search: 'M16.5 16.5L21 21M18 10.5a7.5 7.5 0 1 1-15 0 7.5 7.5 0 0 1 15 0',
+    plus: 'M12 5v14M5 12h14',
+    back: 'M15 5l-7 7 7 7',
+    chevron: 'M9 5l7 7-7 7',
+    down: 'M6 9l6 6 6-6',
+    close: 'M6 6l12 12M6 18L18 6',
+    folder: 'M3 7V5a2 2 0 0 1 2-2h5l2 3h7a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2zM3 9h18',
+    switch: 'M4 5h12M8 12h12M4 19h12M20 3v4M4 10v4M20 17v4',
+    arrow: 'M12 19V5M6 11l6-6 6 6',
+    attach: 'M8 13l7-7a3 3 0 0 1 4 4l-9 9a5 5 0 0 1-7-7l9-9M7 14l7-7',
+    target:
+      'M12 3v4M12 17v4M3 12h4M17 12h4M19 12a7 7 0 1 1-14 0 7 7 0 0 1 14 0M14 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0',
+    check: 'M5 12l4 4L19 6',
+    clock: 'M12 7v5l3 2M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0',
+    copy: 'M8 8h12v13H8zM16 8V3H3v13h5',
+    refresh: 'M20 7a9 9 0 1 0 1 8M20 3v5h-5',
+    eye: 'M2 12s4-7 10-7 10 7 10 7-4 7-10 7S2 12 2 12M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0',
+    bell: 'M18 8a6 6 0 0 0-12 0c0 9-3 9-3 10h18c0-1-3-1-3-10M9 21h6',
+    archive: 'M3 3h18v5H3zM5 8v13h14V8M9 12h6',
+    file: 'M14 2H5v20h14V7zM14 2v5h5M8 12h8M8 16h6',
+    signal: 'M4 18v-3M9 18v-6M14 18V9M19 18V5',
+    wifi: 'M3 8a15 15 0 0 1 18 0M6 12a10 10 0 0 1 12 0M9 16a5 5 0 0 1 6 0M12 20h.01',
+    battery: 'M2 6h17v12H2zM22 10v4M5 9h11v6H5z',
+    moon: 'M20 14a8 8 0 0 1-10-10 9 9 0 1 0 10 10',
+    logout: 'M10 3H3v18h7M8 12h13M17 8l4 4-4 4',
+    home: 'M3 10l9-7 9 7v11h-7v-7h-4v7H3z',
+    info: 'M12 11v6M12 7h.01M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0',
+  };
+  const icon = (name) =>
+    `<svg viewBox="0 0 24 24" aria-hidden="true"><path d="${paths[name] || paths.chat}"/></svg>`;
+  const escape = (value) =>
+    String(value ?? '').replace(
+      /[&<>"']/g,
+      (char) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[char],
+    );
+  const tabs = [
+    ['messages', '会话', 'chat'],
+    ['contacts', '通讯录', 'people'],
+    ['workbench', '工作台', 'grid'],
+    ['mine', '我的', 'user'],
+  ];
+  const scenes = [
+    ...tabs.slice(0, 1),
+    ['chat/c1', '会话详情', 'edit'],
+    ...tabs.slice(1),
+    ['home', '新建会话', 'plus'],
+  ];
+  const agents = [
+    { id: 'nova', name: 'Nova', job: '数据分析 · 商业洞察', state: '在线', cpu: 24, memory: 38 },
+    {
+      id: 'orbit',
+      name: 'Orbit',
+      job: '产品设计 · 前端开发',
+      state: '运行中',
+      cpu: 68,
+      memory: 52,
+    },
+    { id: 'atlas', name: 'Atlas', job: '项目管理 · 进度协同', state: '在线', cpu: 12, memory: 26 },
+    { id: 'echo', name: 'Echo', job: '内容创作 · 品牌文案', state: '在线', cpu: 8, memory: 21 },
+    {
+      id: 'pilot',
+      name: 'Pilot',
+      job: '工程开发 · 自动化',
+      state: '离线',
+      cpu: null,
+      memory: null,
+    },
+  ];
+  const sessions = [
+    {
+      id: 'c1',
+      title: '季度经营复盘报告',
+      agent: 'nova',
+      preview: '已生成 12 页 PPT 与数据附录',
+      time: '09:42',
+      unread: 3,
+      status: 'done',
+      workspace: 'w1',
+    },
+    {
+      id: 'c2',
+      title: '移动端首页改版',
+      agent: 'orbit',
+      preview: '首页骨架已完成,正在调整细节',
+      time: '09:15',
+      unread: 2,
+      status: 'running',
+      workspace: 'w2',
+    },
+    {
+      id: 'c3',
+      title: 'Q3 里程碑对齐',
+      agent: 'atlas',
+      preview: '本周 3 个阻塞项需要人工确认',
+      time: '昨天',
+      unread: 0,
+      status: 'waiting',
+      workspace: 'w1',
+    },
+    {
+      id: 'c4',
+      title: '产品发布会通稿润色',
+      agent: 'echo',
+      preview: '第二版已整理,等待你的反馈',
+      time: '昨天',
+      unread: 0,
+      status: 'idle',
+      workspace: null,
+    },
+    {
+      id: 'c5',
+      title: '构建流水线排障',
+      agent: 'pilot',
+      preview: '构建中断,需要检查环境配置',
+      time: '周五',
+      unread: 0,
+      status: 'error',
+      workspace: 'w2',
+    },
+    {
+      id: 'c6',
+      title: '上半年客户满意度分析',
+      agent: 'nova',
+      preview: '分析结果已保存至文件夹',
+      time: '周四',
+      unread: 0,
+      status: 'idle',
+      workspace: null,
+    },
+  ];
+  const workspaces = [
+    { id: 'w1', name: '经营与增长' },
+    { id: 'w2', name: '产品与研发' },
+  ];
+  const colleagues = [
+    { id: 'p1', name: '陈晓', mobile: '138****2608', agents: ['nova', 'atlas'] },
+    { id: 'p2', name: '林悦', mobile: '139****5316', agents: ['orbit', 'echo', 'pilot'] },
+  ];
+  const openPeople = new Set();
+  const storageKey = 'fmode-current-polish-v1';
+  let saved = {};
+  try {
+    saved = JSON.parse(localStorage.getItem(storageKey) || '{}');
+  } catch {}
+  const state = {
+    route: 'messages',
+    filter: 'all',
+    query: '',
+    contactFilter: 'all',
+    workFilter: 'all',
+    openGroups: new Set(),
+    overlay: null,
+    overlayData: null,
+    toast: null,
+    drafts: saved.drafts && typeof saved.drafts === 'object' ? saved.drafts : {},
+    palette: ['platinum', 'ice', 'clay', 'slate'].includes(saved.palette)
+      ? saved.palette
+      : 'platinum',
+    dark: !!saved.dark,
+    font: Math.max(12, Math.min(20, Number(saved.font) || 14)),
+    notify: saved.notify !== false,
+    tokenShown: false,
+    view: 'compare',
+    turns: {},
+    attachments: {},
+    returnRoute: 'messages',
+  };
+  let toastTimer;
+  let sourcePanel = 'polished';
+  let restoreAction = null;
+  const phones = [...document.querySelectorAll('.phone')];
+  const getAgent = (id) => agents.find((agent) => agent.id === id) || agents[0];
+  const current = () => sessions.find((session) => session.id === state.route.split('/')[1]);
+  const persist = () => {
+    try {
+      localStorage.setItem(
+        storageKey,
+        JSON.stringify({
+          drafts: state.drafts,
+          palette: state.palette,
+          dark: state.dark,
+          font: state.font,
+          notify: state.notify,
+        }),
+      );
+    } catch {}
+  };
+  const button = (name, label, action, extra = '') =>
+    `<button class="round-button" aria-label="${escape(label)}" title="${escape(label)}" data-action="${action}" ${extra}>${icon(name)}</button>`;
+  const avatar = (agent, online = true) =>
+    `<span class="avatar" aria-hidden="true">${escape(agent.name[0])}${online ? `<i class="presence ${agent.state === '离线' ? 'off' : ''}"></i>` : ''}</span>`;
+  const stateLabel = (session) =>
+    ({ running: '正在处理', done: '已完成', waiting: '待你确认', error: '需要处理' })[
+      session.status
+    ] || '';
+  const row = (session, activity = false) => {
+    const agent = getAgent(session.agent);
+    return `<button class="conversation" data-action="chat" data-id="${session.id}">${avatar(agent)}<span class="row-body"><span class="row-title">${escape(session.title)}</span><span class="row-preview">${escape(agent.name)} · ${escape(session.preview)}</span>${activity || ['running', 'waiting', 'error'].includes(session.status) ? `<span class="row-meta ${session.status}">${icon(session.status === 'done' ? 'check' : session.status === 'error' ? 'info' : 'clock')}${stateLabel(session) || '随时继续'}${activity && state.drafts[session.id] ? ' · 有草稿' : ''}</span>` : ''}</span><span class="row-tail"><time>${escape(session.time)}</time>${session.unread ? `<span class="unread">${session.unread}</span>` : ''}</span></button>`;
+  };
+  const statusbar = () =>
+    `<div class="statusbar" aria-hidden="true"><span>9:41</span><span class="status-icons">${icon('signal')}${icon('wifi')}${icon('battery')}</span></div>`;
+  function appbar() {
+    if (state.route.startsWith('agent/'))
+      return `<header class="appbar">${button('back', '返回通讯录', 'contacts')}<div class="appbar-title"><h2>容器设置</h2></div><span class="header-spacer"></span></header>`;
+    const session = current();
+    if (session)
+      return `<header class="appbar">${button('back', '返回会话', 'back')}<div class="appbar-title"><button data-action="title" aria-label="编辑会话标题"><h2>${escape(session.title)}</h2><p>${escape(getAgent(session.agent).name)} · ${session.status === 'running' ? '正在处理' : '会话可追踪'}</p></button></div><div class="appbar-right">${button('switch', '切换会话', 'activity')}${button('folder', '会话文件', 'files')}</div></header>`;
+    const title = tabs.find((tab) => tab[0] === state.route)?.[1] || '';
+    return `<header class="appbar">${button('menu', '打开导航', 'drawer')}<div class="appbar-title"><h2>${title}</h2></div>${state.route === 'messages' ? button('edit', '新建对话', 'new') : state.route === 'home' ? button('chat', '查看会话', 'messages') : '<span class="header-spacer"></span>'}</header>`;
+  }
+  const tabbar = () =>
+    `<nav class="tabbar" aria-label="主导航">${tabs.map(([route, label, name]) => `<button class="${state.route === route ? 'selected' : ''}" data-action="route" data-route="${route}" ${state.route === route ? 'aria-current="page"' : ''}><span class="tab-icon">${icon(name)}${route === 'messages' && sessions.some((session) => session.unread) ? `<span class="unread">${sessions.reduce((total, session) => total + session.unread, 0)}</span>` : ''}</span>${label}</button>`).join('')}</nav>`;
+  const segmented = (options, value, action) =>
+    `<div class="segmented" aria-label="筛选">${options.map(([key, label]) => `<button class="${value === key ? 'selected' : ''}" data-action="${action}" data-value="${key}" aria-pressed="${value === key}">${label}</button>`).join('')}</div>`;
+  const search = (placeholder) =>
+    `<label class="search">${icon('search')}<input data-field="search" aria-label="${placeholder}" type="search" value="${escape(state.query)}" placeholder="${placeholder}" autocomplete="off" /></label>`;
+  const empty = (title, description) =>
+    `<div class="empty">${icon('search')}<h3>${title}</h3><p>${description}</p></div>`;
+  function messages() {
+    const filtered = sessions.filter(
+      (session) =>
+        !session.archived &&
+        `${session.title} ${getAgent(session.agent).name} ${session.preview}`
+          .toLowerCase()
+          .includes(state.query.toLowerCase()),
+    );
+    let body;
+    if (state.filter === 'workspace') {
+      body =
+        `<div class="section-label"><span>工作区</span><button class="text-button" data-action="workspace-new">${icon('plus')}新建</button></div>` +
+        workspaces
+          .map((workspace) => {
+            const items = filtered.filter((session) => session.workspace === workspace.id);
+            return `<div class="list"><button class="group-toggle" data-action="group" data-id="${workspace.id}" aria-expanded="${state.openGroups.has(workspace.id)}">${icon('folder')}<strong>${escape(workspace.name)}</strong><span>${items.length} 个会话</span>${icon(state.openGroups.has(workspace.id) ? 'down' : 'chevron')}</button>${state.openGroups.has(workspace.id) ? items.map((session) => row(session)).join('') + `<div class="group-actions"><button data-action="workspace-rename" data-id="${workspace.id}">重命名</button><button data-action="workspace-delete" data-id="${workspace.id}">删除工作区</button></div>` : ''}</div>`;
+          })
+          .join('');
+      const daily = filtered.filter((session) => !session.workspace);
+      body += `<h3 class="section-label">日常会话</h3>${daily.length ? `<div class="list">${daily.map((session) => row(session)).join('')}</div>` : empty('暂无日常会话', '未归入工作区的会话将显示在这里')}`;
+    } else
+      body = filtered.length
+        ? `<div class="list">${filtered.map((session) => row(session)).join('')}</div><p class="list-footer">所有会话均已同步</p>`
+        : empty('没有找到相关会话', '试试会话标题或数字生命的名字');
+    return `<div class="filter-area">${segmented(
+      [
+        ['all', '全部'],
+        ['workspace', '工作区'],
+      ],
+      state.filter,
+      'filter',
+    )}${search('搜索会话')}</div><main class="page-content">${body}</main>`;
+  }
+  const fileCards = () =>
+    `<div class="files"><button class="file-card" data-action="preview" data-id="ppt"><span class="file-type">PPT</span><strong>季度经营复盘.pptx</strong><small>12 页 · 2.4 MB ${icon('chevron')}</small></button><button class="file-card" data-action="preview" data-id="xlsx"><span class="file-type sheet">XLS</span><strong>经营数据附录.xlsx</strong><small>3 个工作表 · 128 KB ${icon('chevron')}</small></button></div>`;
+  const process = () =>
+    `<details class="process"><summary>${icon('check')}运行了 3 步 · terminal · 4s<span>已完成</span>${icon('down')}</summary><ol><li>读取并核对季度经营数据</li><li>整理核心指标与趋势</li><li>生成报告与数据附录</li></ol></details>`;
+  function initialTurn(session) {
+    const agent = getAgent(session.agent);
+    if (session.fresh)
+      return `<div class="empty">${avatar(agent, false)}<h3>和 ${escape(agent.name)} 开始新对话</h3><p>告诉我你想完成什么。<br>这条会话的过程与结果都会留在这里。</p></div>`;
+    if (session.id !== 'c1')
+      return `<p class="chat-date">今天 · ${escape(session.time)}</p><div class="user-message">${escape(session.title)},请帮我继续推进。</div><div class="agent-line">${avatar(agent, false)}${escape(agent.name)}<span class="agent-status">${stateLabel(session)}</span></div><div class="assistant-card"><h3>${escape(session.title)}</h3><p>${escape(session.preview)}</p><p>这是用于预览当前移动端布局的演示内容。</p>${session.status === 'running' ? '<div class="skeleton"></div><div class="skeleton short"></div>' : ''}</div>`;
+    return `<p class="chat-date">今天 · 09:41</p><div class="user-message">帮我整理本季度的经营数据,做一份复盘报告,重点看收入增长和客户留存。</div><div class="agent-line">${avatar(agent, false)}${escape(agent.name)}<span class="agent-status">09:42</span></div>${process()}<section class="assistant-card"><h3>季度复盘,已经整理好了。</h3><p>我梳理了本季度的经营表现,三个值得关注的变化:</p><div class="insight"><p><b>收入稳步增长</b><br>环比增长 18.6%,核心产品持续拉动。</p><p><b>客户留存改善</b><br>续费率达到 92%,较上季度提升 4 个百分点。</p><p><b>下一步的重点</b><br>优化新客转化,持续跟进高价值客户。</p></div><p>完整结论和数据已放进报告,可以直接预览。</p>${fileCards()}</section><div class="response-actions"><button aria-label="复制回复" data-action="copy">${icon('copy')}</button><button aria-label="会话更多操作" data-action="chat-menu">${icon('switch')}</button></div>`;
+  }
+  function composer(session) {
+    const key = session?.id || 'home';
+    const attachment = state.attachments[key];
+    const busy = session?.sending;
+    const count = sessions.filter((item) => item.status === 'running').length;
+    return `<footer class="composer-wrap">${session ? `<button class="activity-entry" data-action="activity"><i class="activity-dot ${count ? '' : 'idle'}"></i><span>${count ? `${count} 个会话进行中` : '暂无运行中的会话'} · 随时切换,不丢草稿</span>${icon('chevron')}</button>` : ''}<div class="composer">${attachment ? `<div class="attachment-chip">${icon('file')}<span>${escape(attachment)}</span><button data-action="remove-attachment" aria-label="移除附件">${icon('close')}</button></div>` : ''}<textarea data-field="draft" aria-label="消息输入框" rows="2" placeholder="${session ? '发送消息,继续一起推进…' : '想做什么?从这里开始…'}">${escape(state.drafts[key] || '')}</textarea><div class="composer-tools"><button class="tool-button" data-action="attach" aria-label="添加附件">${icon('attach')}</button><button class="agent-tool" data-action="${session ? 'chat-menu' : 'new'}" aria-label="${session ? '当前数字生命操作' : '选择数字生命'}">${icon('target')}<span>${session ? escape(getAgent(session.agent).name) : '选择数字生命'}</span>${session ? icon('down') : ''}</button><button class="send-button" aria-label="发送消息" data-action="send" ${busy || (!state.drafts[key]?.trim() && !attachment) ? 'disabled' : ''}>${icon('arrow')}</button></div><input type="file" data-field="attachment" hidden /></div><p class="input-hint">Enter 换行 · 点击箭头发送</p></footer>`;
+  }
+  function chat() {
+    const session = current();
+    if (!session)
+      return `<main class="page-content">${empty('会话不存在', '请返回会话列表重新选择。')}<button class="primary-button" data-action="messages">返回会话</button></main>`;
+    const turns = state.turns[session.id] || [];
+    return `<main class="page-content chat-scroll">${initialTurn(session)}${turns.map((turn) => `<div class="user-message">${escape(turn.text)}${turn.attachment ? `<br>附件:${escape(turn.attachment)}` : ''}</div><div class="agent-line">${avatar(getAgent(session.agent), false)}${escape(getAgent(session.agent).name)}</div><div class="assistant-card">${turn.done ? '<p>收到,已记录这次补充。实际项目中会继续调用原有会话流程。</p><p>这是本地原型的演示回复,未请求 AI 或业务接口。</p>' : '<div class="loading-dots" aria-label="处理中"><i></i><i></i><i></i></div>'}</div>`).join('')}</main>${composer(session)}`;
+  }
+  function contacts() {
+    const filtered = agents.filter((agent) =>
+      `${agent.name} ${agent.job}`.toLowerCase().includes(state.query.toLowerCase()),
+    );
+    const people = colleagues.filter((person) =>
+      `${person.name} ${person.mobile} ${person.agents.map((id) => getAgent(id).name).join(' ')}`
+        .toLowerCase()
+        .includes(state.query.toLowerCase()),
+    );
+    const agentRow = (agent) =>
+      `<button class="conversation" data-action="agent" data-id="${agent.id}">${avatar(agent)}<span class="row-body"><strong class="row-title">${escape(agent.name)}</strong><span class="row-preview">${escape(agent.job)}</span></span><span class="row-tail">${icon('chevron')}</span></button>`;
+    let body = '';
+    if (state.contactFilter !== 'agents' && people.length)
+      body += `<h3 class="section-label">同事 · ${people.length}</h3><div class="list">${people.map((person) => `<button class="conversation" data-action="person" data-id="${person.id}" aria-expanded="${openPeople.has(person.id)}">${avatar(person, false)}<span class="row-body"><span class="row-title">${person.name}</span><span class="row-preview">${person.mobile} · ${person.agents.length} 个容器</span></span>${icon(openPeople.has(person.id) ? 'down' : 'chevron')}</button>${openPeople.has(person.id) ? `<div class="person-children">${person.agents.map((id) => agentRow(getAgent(id))).join('')}</div>` : ''}`).join('')}</div>`;
+    if (state.contactFilter !== 'people' && filtered.length)
+      body += `<h3 class="section-label">数字生命 · ${filtered.length}</h3><div class="list">${filtered.map(agentRow).join('')}</div>`;
+    return `<div class="filter-area">${segmented(
+      [
+        ['all', '全部'],
+        ['agents', '数字生命'],
+        ['people', '同事'],
+      ],
+      state.contactFilter,
+      'contact-filter',
+    )}${search('搜索名称或专长')}</div><main class="page-content">${body || empty('没有匹配的联系人', '试试名称或专长')}</main>`;
+  }
+  function agentPage() {
+    const agent = getAgent(state.route.split('/')[1]);
+    return `<main class="page-content"><section class="settings-card" style="margin-top:16px"><div class="setting-row"><span class="row-body">当前名称</span><strong>${escape(agent.name)}</strong></div><button class="setting-row" data-action="rename-agent" data-id="${agent.id}">${icon('edit')}<span class="row-body">重命名</span>${icon('chevron')}</button><button class="setting-row" data-action="create-chat" data-id="${agent.id}">${icon('chat')}<span class="row-body">进入会话</span>${icon('chevron')}</button></section><p class="list-footer">演示管理员操作 · 仅修改本地示例</p></main>`;
+  }
+  function lifeCard(agent) {
+    const session = sessions.find((item) => item.agent === agent.id);
+    return `<article class="life-card"><div class="life-head">${avatar(agent)}<div class="row-body"><strong>${escape(agent.name)}</strong><small>${escape(agent.job)}</small></div><span class="state-tag ${agent.state === '运行中' ? 'busy' : agent.state === '离线' ? 'offline' : ''}">${agent.state}</span></div><div class="task-line">${icon('chat')}<span>${session ? escape(session.title) : '暂无进行中的会话'}</span></div>${
+      agent.cpu === null
+        ? '<p class="task-line">指标未上报</p>'
+        : `<div class="metrics">${[
+            ['CPU', agent.cpu],
+            ['内存', agent.memory],
+          ]
+            .map(
+              ([label, value]) =>
+                `<div class="metric"><div><span>${label}</span><span>${value}%</span></div><div class="metric-track"><i style="width:${value}%"></i></div></div>`,
+            )
+            .join('')}</div>`
+    }<div class="life-actions"><button data-action="enter-agent" data-id="${agent.id}">进入</button><button data-action="channel" data-id="${agent.id}">通道</button><button data-action="recharge" data-id="${agent.id}">充值</button></div></article>`;
+  }
+  function workbench() {
+    const filtered = agents.filter(
+      (agent) =>
+        (state.workFilter === 'all' ||
+          (state.workFilter === 'online' ? agent.state !== '离线' : agent.state === '离线')) &&
+        `${agent.name} ${agent.job}`.toLowerCase().includes(state.query.toLowerCase()),
+    );
+    return `<div class="filter-area">${segmented(
+      [
+        ['all', '全部'],
+        ['online', '在线'],
+        ['offline', '离线'],
+      ],
+      state.workFilter,
+      'work-filter',
+    )}${search('搜索数字生命')}</div><main class="page-content"><div class="overview"><div><span>数字生命</span><strong>5</strong></div><div><span>在线</span><strong>4</strong></div><div><span>离线</span><strong>1</strong></div></div>${filtered.length ? filtered.map(lifeCard).join('') : empty('暂无匹配的数字生命', '切换筛选或试试其他关键词')}</main>`;
+  }
+  function mine() {
+    return `<main class="page-content"><section class="profile-card"><span class="avatar">F</span><div><h3>fmode 体验账号</h3><p>演示资料 · 人机共生中枢</p></div></section><h3 class="section-label">账号</h3><section class="settings-card"><div class="setting-row"><span class="row-body">访问 Token<small>${state.tokenShown ? 'DEMO-TOKEN-NOT-A-REAL-CREDENTIAL' : '•••• •••• •••• ••••'}</small></span><button class="tool-button" data-action="token" aria-label="${state.tokenShown ? '隐藏' : '显示'} Token">${icon('eye')}</button><button class="tool-button" data-action="copy-token" aria-label="复制 Token" ${state.tokenShown ? '' : 'disabled'}>${icon('copy')}</button></div><button class="setting-row" data-action="logout"><span class="row-body danger">退出登录</span>${icon('chevron')}</button></section><h3 class="section-label">通知</h3><section class="settings-card"><button class="setting-row" data-action="notifications">${icon('bell')}<span class="row-body">消息与任务通知<small>原生端入口 · 此处仅演示提醒</small></span>${icon('chevron')}</button></section><h3 class="section-label">外观</h3><section class="settings-card"><p class="palette-label">整体配色</p><div class="palette-grid">${[
+      ['platinum', '铂金曜黑', '#25272a'],
+      ['ice', '冰白靛蓝', '#4056c7'],
+      ['clay', '暖瓷陶橘', '#af482b'],
+      ['slate', '岩灰鸢紫', '#6952a3'],
+    ]
+      .map(
+        ([id, name, color]) =>
+          `<button data-action="palette" data-id="${id}" aria-pressed="${state.palette === id}" class="${state.palette === id ? 'selected' : ''}"><span class="palette-swatch" style="background:${color}"></span>${name}</button>`,
+      )
+      .join(
+        '',
+      )}</div><div class="setting-row"><span class="row-body">深色模式<small>跟随手动切换</small></span><button class="switch" role="switch" aria-checked="${state.dark}" aria-label="深色模式" data-action="dark"></button></div><div class="font-slider"><label>正文字号<span>${state.font}px</span></label><input data-field="font" type="range" min="12" max="20" value="${state.font}" aria-label="正文字号" /></div></section></main>`;
+  }
+  function home() {
+    return `<main class="page-content"><section class="home-hero"><div class="home-logo">fmode</div><h3>人机共生中枢</h3><p>和数字生命一起干活 · 每条会话都可追踪</p></section><div class="section-label"><span>最近会话</span><button class="text-button" data-action="messages">全部${icon('chevron')}</button></div><div class="list">${sessions
+      .filter((session) => !session.archived)
+      .slice(0, 2)
+      .map((session) => row(session))
+      .join('')}</div></main>${composer(null)}`;
+  }
+  function drawer() {
+    return `<div class="overlay drawer-overlay" data-action="dismiss"><aside class="drawer" role="dialog" aria-modal="true" aria-label="导航菜单"><div class="drawer-head"><strong>fmode</strong><button class="close-button" data-action="close" aria-label="关闭导航">${icon('close')}</button></div><button class="drawer-new" data-action="new">${icon('plus')}<span><strong>新建对话</strong><small>选择数字生命</small></span></button>${current() ? `<button class="drawer-quick" data-action="quick-new">${icon('edit')}在本容器新建 · ${escape(getAgent(current().agent).name)}</button>` : ''}<nav class="drawer-nav">${tabs.map(([route, label, name]) => `<button data-action="route" data-route="${route}" class="${state.route === route ? 'selected' : ''}">${icon(name)}${label}</button>`).join('')}</nav><div class="drawer-section">工作区<button data-action="workspace-new" aria-label="新建工作区">${icon('plus')}</button></div>${workspaces.map((workspace) => `<button class="drawer-item" data-action="workspace-open" data-id="${workspace.id}">${icon('folder')}<span>${escape(workspace.name)}</span></button>`).join('')}<div class="drawer-section">日常会话</div>${sessions
+      .filter((session) => !session.archived)
+      .slice(0, 4)
+      .map(
+        (session) =>
+          `<button class="drawer-item" data-action="chat" data-id="${session.id}">${icon('chat')}<span>${escape(session.title)}</span></button>`,
+      )
+      .join(
+        '',
+      )}<button class="drawer-item" data-action="archived">${icon('archive')}已归档会话</button><div class="drawer-footer"><span class="avatar">F</span><span>fmode 体验账号<small>独立预览 · 不影响真实数据</small></span></div></aside></div>`;
+  }
+  function sheet(title, content) {
+    return `<div class="overlay" data-action="dismiss"><section class="sheet" role="dialog" aria-modal="true" aria-label="${escape(title)}"><div class="sheet-handle"></div><header class="sheet-heading"><h3>${escape(title)}</h3><button class="close-button" data-action="close" aria-label="关闭弹层">${icon('close')}</button></header>${content}</section></div>`;
+  }
+  function overlay() {
+    const data = state.overlayData;
+    switch (state.overlay) {
+      case 'drawer':
+        return drawer();
+      case 'activity':
+        return sheet(
+          '切换会话',
+          `<p class="sheet-description">任务在后台继续,输入草稿留在各自会话。</p><div class="list">${sessions
+            .filter((session) => !session.archived)
+            .map((session) => row(session, true))
+            .join(
+              '',
+            )}</div><button class="text-button" data-action="demo-complete">${icon('bell')}演示:让后台任务完成</button>`,
+        );
+      case 'title':
+        return sheet(
+          '会话标题',
+          `<p class="sheet-description">一个清楚的标题,让下次继续更容易。</p><form data-form="title"><label class="field-label">标题</label><input class="form-field" data-field="title" aria-label="会话标题" maxlength="60" value="${escape(current()?.title)}" /><p class="form-error" aria-live="polite"></p><button type="button" class="text-button" data-action="suggest-title">${icon('refresh')}看看其他标题建议</button><div class="candidates"></div><button class="primary-button" type="submit">保存标题</button></form>`,
+        );
+      case 'new':
+        return sheet(
+          '选择数字生命',
+          `<p class="sheet-description">开启一条新会话,原有会话和草稿不受影响。</p><div class="list">${agents.map((agent) => `<button class="conversation" data-action="create-chat" data-id="${agent.id}">${avatar(agent)}<span class="row-body"><strong class="row-title">${escape(agent.name)}</strong><span class="row-preview">${escape(agent.job)}</span></span>${icon('chevron')}</button>`).join('')}</div>`,
+        );
+      case 'chat-menu':
+        return sheet(
+          getAgent(current()?.agent).name,
+          `<p class="sheet-description">当前数字生命 · ${escape(getAgent(current()?.agent).job)}</p><button class="setting-row" data-action="quick-new">${icon('plus')}<span class="row-body">在本容器新建会话</span>${icon('chevron')}</button><button class="setting-row" data-action="title">${icon('edit')}<span class="row-body">编辑会话标题</span>${icon('chevron')}</button><button class="setting-row" data-action="archive">${icon('archive')}<span class="row-body">归档当前会话</span>${icon('chevron')}</button>`,
+        );
+      case 'files':
+        return sheet(
+          '会话文件',
+          `<p class="sheet-description">${current()?.id === 'c1' ? '本次会话生成的 2 个文件' : '当前会话暂无文件'} · 演示预览</p>${current()?.id === 'c1' ? fileCards() : empty('还没有文件', '会话生成的文件会集中保存在这里')}`,
+        );
+      case 'preview':
+        return sheet(
+          data === 'ppt' ? '季度经营复盘.pptx' : '经营数据附录.xlsx',
+          `<p class="sheet-description">演示文件 · ${data === 'ppt' ? '第 1 / 12 页' : '工作表 1 / 3'}</p>${data === 'ppt' ? '<div class="preview-document"><span class="doc-brand">FMODE / QUARTERLY REVIEW</span><h2>每一份增长,<br>都有迹可循。</h2><p>季度经营复盘报告</p><footer>BUSINESS INSIGHTS &nbsp; / &nbsp; 01</footer></div>' : '<table class="preview-table"><thead><tr><th>核心指标</th><th>本季度</th><th>变化</th></tr></thead><tbody><tr><td>营收增长</td><td>18.6%</td><td>↑ 6.2%</td></tr><tr><td>客户续费率</td><td>92%</td><td>↑ 4%</td></tr><tr><td>满意度</td><td>4.8 / 5</td><td>↑ 0.3</td></tr></tbody></table>'}<p class="sheet-description">仅展示文件预览的视觉样式;未生成真实 PPT / Excel 文件。</p>`,
+        );
+      case 'workspace-new':
+      case 'workspace-rename':
+        return sheet(
+          state.overlay === 'workspace-new' ? '新建工作区' : '重命名工作区',
+          `<p class="sheet-description">将同一场景的会话整理在一起。</p><form data-form="workspace"><label class="field-label">工作区名称</label><input class="form-field" data-field="workspace" aria-label="工作区名称" maxlength="30" value="${escape(data?.name || '')}"/><p class="form-error" aria-live="polite"></p><button type="submit" class="primary-button">保存工作区</button></form>`,
+        );
+      case 'workspace-delete':
+        return sheet(
+          '删除工作区',
+          `<p class="sheet-description">删除「${escape(data.name)}」后,里面的会话会移至日常会话,不会被删除。</p><button class="primary-button" data-action="confirm-workspace-delete" data-id="${data.id}">删除工作区,保留会话</button>`,
+        );
+      case 'agent': {
+        const agent = getAgent(data);
+        return sheet(
+          agent.name,
+          `<div class="profile-card" style="margin:12px 0 20px">${avatar(agent)}<div><h3>${escape(agent.name)}</h3><p>${escape(agent.job)}</p></div></div><button class="setting-row" data-action="rename-agent" data-id="${agent.id}">${icon('edit')}<span class="row-body">修改名称</span>${icon('chevron')}</button><button class="primary-button" data-action="create-chat" data-id="${agent.id}">开始新会话</button>`,
+        );
+      }
+      case 'rename-agent':
+        return sheet(
+          '修改数字生命名称',
+          `<form data-form="agent"><label class="field-label">名称</label><input class="form-field" aria-label="数字生命名称" data-field="agent-name" maxlength="30" value="${escape(getAgent(data).name)}"/><p class="form-error" aria-live="polite"></p><button type="submit" class="primary-button">保存名称</button></form>`,
+        );
+      case 'channel':
+        return sheet(
+          '通道',
+          `<p class="sheet-description">${escape(getAgent(data).name)} 的通道入口</p><div class="setting-row">${icon('chat')}<span class="row-body">fmode 应用内会话<small>演示状态 · 已连接</small></span><span class="state-tag">在线</span></div><p class="sheet-description">此稿保留原入口,不修改通道配置或接入逻辑。</p>`,
+        );
+      case 'recharge':
+        return sheet(
+          '充值',
+          `<p class="sheet-description">${escape(getAgent(data).name)} 的充值入口</p><div class="empty">${icon('info')}<h3>这里仅预览界面</h3><p>未创建订单,也不会产生支付。<br>迁移时继续使用项目原有充值流程。</p></div>`,
+        );
+      case 'notifications':
+        return sheet(
+          '消息与任务通知',
+          `<p class="sheet-description">完成提醒不会打断当前输入。真实系统权限仍由原项目负责。</p><div class="setting-row"><span class="row-body">原型内完成提醒</span><button role="switch" class="switch" aria-checked="${state.notify}" aria-label="完成提醒" data-action="notify"></button></div><button class="primary-button" data-action="demo-complete">演示一次完成提醒</button>`,
+        );
+      case 'archived': {
+        const archived = sessions.filter((session) => session.archived);
+        return sheet(
+          '已归档会话',
+          archived.length
+            ? `<div class="list">${archived.map((session) => `<div class="setting-row"><span class="row-body">${escape(session.title)}</span><button class="text-button" data-action="restore" data-id="${session.id}">恢复</button></div>`).join('')}</div>`
+            : empty('没有已归档会话', '归档的会话会保留在这里,随时可以恢复'),
+        );
+      }
+      case 'logout':
+        return sheet(
+          '退出登录',
+          `<p class="sheet-description">这是一份独立的 HTML 原型。确认后只展示未登录状态,不会退出你的真实账号。</p><button class="primary-button" data-action="confirm-logout">确认退出(演示)</button>`,
+        );
+      case 'logged-out':
+        return sheet(
+          '已退出演示账号',
+          `<div class="empty">${icon('user')}<h3>随时回来,继续对话。</h3><p>没有改动真实项目的登录状态。</p></div><button class="primary-button" data-action="close">返回预览</button>`,
+        );
+      default:
+        return '';
+    }
+  }
+  function render(keepScroll = true) {
+    const focused = document.activeElement;
+    const activeField = focused?.dataset?.field;
+    const focusedPanel = focused?.closest('.phone')?.id;
+    const selection = activeField && focused.type !== 'range' ? focused.selectionStart : null;
+    const notes = {
+      messages: '更柔和的边界 · 内缩分割线 · 清晰的任务状态',
+      chat: '保留回复卡片 · 降低输入区重量 · 草稿随会话保留',
+      contacts: '沿用字母头像 · 更有层次的名称与能力描述',
+      workbench: '保留运行指标和三个操作 · 统一卡片节奏',
+      mine: '保留四套配色与设置项 · 更轻的设置分组',
+      home: '保留 fmode 品牌和文案 · 收紧首屏节奏',
+    };
+    document.querySelector('.scene-nav').innerHTML = scenes
+      .map(
+        ([route, label, name]) =>
+          `<button data-action="route" data-route="${route}" class="${state.route === route || (route === 'chat/c1' && state.route.startsWith('chat/')) ? 'selected' : ''}">${icon(name)}${label}</button>`,
+      )
+      .join('');
+    document.querySelector('#design-note').textContent = notes[state.route.split('/')[0]] || '';
+    phones.forEach((phone) => {
+      const scroll = keepScroll ? phone.querySelector('.page-content')?.scrollTop || 0 : 0;
+      const sheetScroll = keepScroll ? phone.querySelector('.sheet')?.scrollTop || 0 : 0;
+      phone.classList.toggle('dark', state.dark);
+      phone.dataset.palette = state.palette;
+      phone.style.setProperty('--chat-size', `${state.font}px`);
+      const content = state.route.startsWith('chat/')
+        ? chat()
+        : state.route.startsWith('agent/')
+          ? agentPage()
+          : ({ messages, contacts, workbench, mine, home }[state.route] || messages)();
+      phone.innerHTML = `${statusbar()}<div class="app-shell" ${state.overlay ? 'inert' : ''}>${appbar()}${content}${tabs.some((tab) => tab[0] === state.route) ? tabbar() : ''}<div class="home-indicator" aria-hidden="true"></div></div>${overlay()}${state.toast ? `<div class="toast" role="status">${icon('check')}<span>${escape(state.toast.text)}</span>${state.toast.session ? `<button data-action="chat" data-id="${state.toast.session}">查看</button>` : ''}</div>` : ''}`;
+      const contentElement = phone.querySelector('.page-content');
+      if (contentElement) contentElement.scrollTop = scroll;
+      const sheetElement = phone.querySelector('.sheet');
+      if (sheetElement) sheetElement.scrollTop = sheetScroll;
+      const textarea = phone.querySelector('textarea');
+      if (textarea) resizeTextarea(textarea);
+    });
+    if (activeField && focusedPanel) {
+      const field = document.querySelector(`#${focusedPanel} [data-field="${activeField}"]`);
+      if (field) {
+        field.focus({ preventScroll: true });
+        if (selection !== null && field.setSelectionRange)
+          field.setSelectionRange(selection, selection);
+      }
+    }
+  }
+  function resizeTextarea(textarea) {
+    textarea.style.height = 'auto';
+    textarea.style.height = `${Math.min(112, Math.max(textarea.closest('.polished') ? 42 : 48, textarea.scrollHeight))}px`;
+  }
+  function go(route) {
+    state.query = '';
+    state.overlay = null;
+    state.overlayData = null;
+    state.toast = null;
+    if (!route.startsWith('chat/')) state.returnRoute = route;
+    state.route = route;
+    const session = current();
+    if (session) session.unread = 0;
+    if (location.hash !== `#/${route}`) history.replaceState(null, '', `#/${route}`);
+    render(false);
+  }
+  function showOverlay(name, data = null) {
+    restoreAction = document.activeElement?.dataset?.action || restoreAction;
+    state.overlay = name;
+    state.overlayData = data;
+    render();
+    const panel = document.getElementById(sourcePanel);
+    const field = panel.querySelector('.overlay input:not([type=checkbox])');
+    (field || panel.querySelector('.overlay button'))?.focus({ preventScroll: true });
+    if (field?.select) field.select();
+  }
+  function closeOverlay() {
+    state.overlay = null;
+    state.overlayData = null;
+    render();
+    const panel = document.getElementById(sourcePanel);
+    panel.querySelector(`[data-action="${restoreAction}"]`)?.focus({ preventScroll: true });
+  }
+  function toast(text, session = null) {
+    state.toast = { text, session };
+    render();
+    clearTimeout(toastTimer);
+    toastTimer = setTimeout(() => {
+      state.toast = null;
+      phones.forEach((phone) => phone.querySelector('.toast')?.remove());
+    }, 4200);
+  }
+  function createChat(agentId) {
+    if (getAgent(agentId).state === '离线') {
+      toast('该数字生命当前离线,请恢复在线后再开始会话');
+      return;
+    }
+    const id = `c${Date.now()}${sessions.length}`;
+    sessions.unshift({
+      id,
+      title: '新对话',
+      agent: agentId,
+      preview: '从一个想法开始',
+      time: '刚刚',
+      unread: 0,
+      status: 'idle',
+      workspace: null,
+      fresh: true,
+    });
+    if (state.drafts.home) {
+      state.drafts[id] = state.drafts.home;
+      delete state.drafts.home;
+    }
+    if (state.attachments.home) {
+      state.attachments[id] = state.attachments.home;
+      delete state.attachments.home;
+    }
+    persist();
+    go(`chat/${id}`);
+  }
+  function send() {
+    const session = current();
+    if (!session) {
+      showOverlay('new');
+      return;
+    }
+    if (getAgent(session.agent).state === '离线') {
+      toast('该数字生命当前离线,草稿已保留');
+      return;
+    }
+    const text = (state.drafts[session.id] || '').trim();
+    const attachment = state.attachments[session.id];
+    if ((!text && !attachment) || session.sending) return;
+    const turn = { text, attachment, done: false };
+    (state.turns[session.id] ||= []).push(turn);
+    state.drafts[session.id] = '';
+    delete state.attachments[session.id];
+    session.status = 'running';
+    session.sending = true;
+    session.preview = text || attachment;
+    persist();
+    render();
+    phones.forEach((phone) => {
+      const scroll = phone.querySelector('.chat-scroll');
+      if (scroll) scroll.scrollTop = scroll.scrollHeight;
+    });
+    setTimeout(() => {
+      turn.done = true;
+      session.status = 'done';
+      session.sending = false;
+      session.preview = '已完成这次补充 · 原型演示';
+      session.time = '刚刚';
+      if (current()?.id !== session.id) {
+        session.unread += 1;
+        if (state.notify)
+          toast(`${getAgent(session.agent).name} 已完成「${session.title}」`, session.id);
+        else render();
+      } else {
+        render();
+        phones.forEach((phone) => {
+          const scroll = phone.querySelector('.chat-scroll');
+          if (scroll) scroll.scrollTop = scroll.scrollHeight;
+        });
+      }
+    }, 1200);
+  }
+  async function copy(text) {
+    try {
+      await navigator.clipboard.writeText(text);
+      toast('已复制');
+    } catch {
+      toast('浏览器未授权复制,可在实际项目中使用原有复制功能');
+    }
+  }
+  document.addEventListener('click', (event) => {
+    const view = event.target.closest('button[data-view]');
+    if (view) {
+      state.view = view.dataset.view;
+      document.body.dataset.view = state.view;
+      document
+        .querySelectorAll('button[data-view]')
+        .forEach((control) =>
+          control.classList.toggle('selected', control.dataset.view === state.view),
+        );
+      return;
+    }
+    const control = event.target.closest('[data-action]');
+    if (!control) return;
+    if (control.closest('.phone')) sourcePanel = control.closest('.phone').id;
+    const { action, id, value, route } = control.dataset;
+    if (action === 'dismiss') {
+      if (event.target === control) closeOverlay();
+      return;
+    }
+    switch (action) {
+      case 'route':
+        go(route);
+        break;
+      case 'messages':
+        go('messages');
+        break;
+      case 'contacts':
+        go('contacts');
+        break;
+      case 'back':
+        go(tabs.some((tab) => tab[0] === state.returnRoute) ? state.returnRoute : 'messages');
+        break;
+      case 'chat':
+        if (sessions.some((session) => session.id === id)) go(`chat/${id}`);
+        break;
+      case 'filter':
+        state.filter = value;
+        render(false);
+        break;
+      case 'contact-filter':
+        state.contactFilter = value;
+        render(false);
+        break;
+      case 'work-filter':
+        state.workFilter = value;
+        render(false);
+        break;
+      case 'group':
+        state.openGroups.has(id) ? state.openGroups.delete(id) : state.openGroups.add(id);
+        render();
+        break;
+      case 'workspace-open':
+        state.filter = 'workspace';
+        state.openGroups.add(id);
+        go('messages');
+        break;
+      case 'workspace-new':
+        showOverlay(action);
+        break;
+      case 'workspace-rename':
+      case 'workspace-delete':
+        showOverlay(
+          action,
+          workspaces.find((workspace) => workspace.id === id),
+        );
+        break;
+      case 'confirm-workspace-delete':
+        workspaces.splice(
+          workspaces.findIndex((workspace) => workspace.id === id),
+          1,
+        );
+        sessions.forEach((session) => {
+          if (session.workspace === id) session.workspace = null;
+        });
+        closeOverlay();
+        toast('工作区已删除,会话已保留至日常会话');
+        break;
+      case 'close':
+        closeOverlay();
+        break;
+      case 'drawer':
+      case 'title':
+      case 'activity':
+      case 'new':
+      case 'files':
+      case 'chat-menu':
+      case 'notifications':
+      case 'archived':
+      case 'logout':
+        showOverlay(action);
+        break;
+      case 'agent':
+        go(`agent/${id}`);
+        break;
+      case 'enter-agent': {
+        if (getAgent(id).state === '离线') {
+          toast('该数字生命当前离线,请恢复在线后再进入');
+          break;
+        }
+        const session = sessions.find((item) => item.agent === id && !item.archived);
+        if (session) go(`chat/${session.id}`);
+        else createChat(id);
+        break;
+      }
+      case 'person':
+        openPeople.has(id) ? openPeople.delete(id) : openPeople.add(id);
+        render();
+        break;
+      case 'rename-agent':
+      case 'channel':
+      case 'recharge':
+      case 'preview':
+        showOverlay(action, id);
+        break;
+      case 'create-chat':
+        createChat(id);
+        break;
+      case 'quick-new':
+        createChat(current()?.agent || 'nova');
+        break;
+      case 'send':
+        send();
+        break;
+      case 'attach':
+        document.getElementById(sourcePanel).querySelector('[data-field="attachment"]').click();
+        break;
+      case 'remove-attachment':
+        delete state.attachments[current()?.id || 'home'];
+        render();
+        break;
+      case 'copy':
+        copy(
+          '季度复盘,已经整理好了。收入环比增长 18.6%,客户续费率达到 92%。下一步优化新客转化,持续跟进高价值客户。',
+        );
+        break;
+      case 'token':
+        state.tokenShown = !state.tokenShown;
+        render();
+        break;
+      case 'copy-token':
+        copy('DEMO-TOKEN-NOT-A-REAL-CREDENTIAL');
+        break;
+      case 'palette':
+        state.palette = id;
+        persist();
+        render();
+        break;
+      case 'dark':
+        state.dark = !state.dark;
+        persist();
+        render();
+        break;
+      case 'notify':
+        state.notify = !state.notify;
+        persist();
+        render();
+        break;
+      case 'confirm-logout':
+        showOverlay('logged-out');
+        break;
+      case 'archive':
+        if (current()) current().archived = true;
+        go('messages');
+        toast('会话已归档,可在侧栏恢复');
+        break;
+      case 'restore': {
+        const session = sessions.find((item) => item.id === id);
+        if (session) session.archived = false;
+        render();
+        break;
+      }
+      case 'demo-complete': {
+        const session =
+          sessions.find((item) => item.status === 'running' && !item.sending) ||
+          sessions.find((item) => !item.sending && item.id !== current()?.id) ||
+          sessions[0];
+        session.status = 'done';
+        session.preview = '任务已完成,可以查看结果';
+        session.unread += current()?.id === session.id ? 0 : 1;
+        closeOverlay();
+        if (state.notify) toast(`${getAgent(session.agent).name} 的任务已完成(演示)`, session.id);
+        else toast('提醒已关闭,状态已更新');
+        break;
+      }
+      case 'suggest-title': {
+        const title = current()?.title || '新对话';
+        phones.forEach((phone) => {
+          const candidates = phone.querySelector('.candidates');
+          if (candidates)
+            candidates.innerHTML = `<p class="sheet-description">本地预设建议,不会调用 AI。</p>${[`${title.replace(/报告$/, '')} · 关键结论`, `${getAgent(current()?.agent).name} 的工作记录`].map((candidate) => `<button type="button" class="candidate" data-action="use-title" data-value="${escape(candidate)}">${escape(candidate)}</button>`).join('')}`;
+        });
+        break;
+      }
+      case 'use-title':
+        phones.forEach((phone) => {
+          const field = phone.querySelector('[data-field="title"]');
+          if (field) field.value = value;
+        });
+        break;
+    }
+  });
+  document.addEventListener('input', (event) => {
+    const field = event.target;
+    const type = field.dataset.field;
+    if (type === 'search') {
+      state.query = field.value;
+      render(false);
+    }
+    if (type === 'draft') {
+      const key = current()?.id || 'home';
+      state.drafts[key] = field.value;
+      persist();
+      phones.forEach((phone) => {
+        const textarea = phone.querySelector('[data-field="draft"]');
+        if (textarea) {
+          if (textarea !== field) textarea.value = field.value;
+          resizeTextarea(textarea);
+        }
+        const sendButton = phone.querySelector('[data-action="send"]');
+        if (sendButton)
+          sendButton.disabled =
+            !!current()?.sending || (!field.value.trim() && !state.attachments[key]);
+      });
+    }
+    if (type === 'font') {
+      state.font = Number(field.value);
+      persist();
+      phones.forEach((phone) => {
+        phone.style.setProperty('--chat-size', `${state.font}px`);
+        const range = phone.querySelector('[data-field="font"]');
+        if (range) range.value = state.font;
+        const label = phone.querySelector('.font-slider label span');
+        if (label) label.textContent = `${state.font}px`;
+      });
+    }
+  });
+  document.addEventListener('change', (event) => {
+    if (event.target.dataset.field === 'attachment' && event.target.files[0]) {
+      state.attachments[current()?.id || 'home'] = event.target.files[0].name;
+      render();
+      toast('附件已加入演示草稿,文件内容未上传');
+    }
+  });
+  document.addEventListener('submit', (event) => {
+    const form = event.target.closest('[data-form]');
+    if (!form) return;
+    event.preventDefault();
+    const field = form.querySelector('.form-field');
+    const value = field.value.trim();
+    if (!value) {
+      form.querySelector('.form-error').textContent = '名称不能为空';
+      field.focus();
+      return;
+    }
+    if (form.dataset.form === 'title' && current()) current().title = value;
+    if (form.dataset.form === 'workspace') {
+      if (
+        workspaces.some(
+          (workspace) => workspace.name === value && workspace.id !== state.overlayData?.id,
+        )
+      ) {
+        form.querySelector('.form-error').textContent = '已有同名工作区,请换一个名称';
+        return;
+      }
+      if (state.overlayData) state.overlayData.name = value;
+      else {
+        const workspace = { id: `w${Date.now()}`, name: value };
+        workspaces.push(workspace);
+        state.openGroups.add(workspace.id);
+        state.filter = 'workspace';
+        state.route = 'messages';
+        history.replaceState(null, '', '#/messages');
+      }
+    }
+    if (form.dataset.form === 'agent') getAgent(state.overlayData).name = value;
+    closeOverlay();
+    toast('已保存(仅此原型)');
+  });
+  document.addEventListener('keydown', (event) => {
+    if (event.key === 'Escape' && state.overlay) {
+      event.preventDefault();
+      closeOverlay();
+      return;
+    }
+    const dialog = event.target.closest('[role="dialog"]');
+    if (event.key === 'Tab' && dialog) {
+      const focusable = [
+        ...dialog.querySelectorAll('button:not(:disabled),input:not(:disabled),textarea,a[href]'),
+      ].filter((element) => element.getClientRects().length);
+      const first = focusable[0];
+      const last = focusable.at(-1);
+      if (event.shiftKey && document.activeElement === first) {
+        event.preventDefault();
+        last?.focus();
+      } else if (!event.shiftKey && document.activeElement === last) {
+        event.preventDefault();
+        first?.focus();
+      }
+    }
+    if (
+      event.target.dataset.field === 'draft' &&
+      event.key === 'Enter' &&
+      !event.shiftKey &&
+      !event.isComposing &&
+      event.target.closest('.baseline')
+    ) {
+      event.preventDefault();
+      send();
+    }
+  });
+  const readHash = () => {
+    let route = '';
+    try {
+      route = decodeURIComponent(location.hash.replace(/^#\/?/, ''));
+    } catch {}
+    return /^(messages|contacts|workbench|mine|home|chat\/[\w-]+|agent\/[\w-]+)$/.test(route)
+      ? route
+      : 'messages';
+  };
+  window.addEventListener('hashchange', () => go(readHash()));
+  go(readHash());
+})();
+
+    </script>
+  </body>
+</html>

BIN
prototypes/mobile-current-polish-20261116/preview-chat-comparison.png


BIN
prototypes/mobile-current-polish-20261116/preview-chat.png


BIN
prototypes/mobile-current-polish-20261116/preview-comparison.png


BIN
prototypes/mobile-current-polish-20261116/preview-contacts.png


BIN
prototypes/mobile-current-polish-20261116/preview-drawer.png


BIN
prototypes/mobile-current-polish-20261116/preview-home.png


BIN
prototypes/mobile-current-polish-20261116/preview-messages.png


BIN
prototypes/mobile-current-polish-20261116/preview-mine.png


BIN
prototypes/mobile-current-polish-20261116/preview-switcher.png


BIN
prototypes/mobile-current-polish-20261116/preview-workbench.png


+ 65 - 0
prototypes/mobile-current-polish-20261116/preview.template.html

@@ -0,0 +1,65 @@
+<!doctype html>
+<html lang="zh-CN">
+  <head>
+    <meta charset="UTF-8" />
+    <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
+    <meta name="color-scheme" content="light" />
+    <title>fmode · 现有移动端 UI 精修对照</title>
+    <style>
+      /* STYLES */
+    </style>
+  </head>
+  <body>
+    <header class="studio-header">
+      <div class="brand">
+        <span class="brand-mark">f</span><strong>fmode</strong><span class="brand-divider"></span
+        ><span>Mobile UI refinement</span>
+      </div>
+      <span class="prototype-label">独立 HTML 原型 · 未接入业务</span>
+    </header>
+    <main class="studio">
+      <section class="studio-heading">
+        <div>
+          <div class="eyebrow">保留熟悉感,只打磨细节</div>
+          <h1>现有界面,轻一点。清楚一点。</h1>
+          <p>不换产品语言,不改业务流程。以项目现有移动端为底稿精修。</p>
+        </div>
+        <div class="view-control" aria-label="对照模式">
+          <button data-view="compare" class="selected">前后对照</button
+          ><button data-view="polished">只看精修</button
+          ><button data-view="baseline">只看原版</button>
+        </div>
+      </section>
+      <nav class="scene-nav" aria-label="预览页面"></nav>
+      <div class="mobile-review">
+        <span>fmode · UI 预览</span><button data-view="polished" class="selected">精修</button
+        ><button data-view="baseline">原版</button>
+      </div>
+      <section class="comparison" aria-label="移动端界面对照">
+        <article class="specimen baseline-specimen">
+          <header class="specimen-caption">
+            <div><span class="version-number">01</span><strong>现有 UI · HTML 复刻</strong></div>
+            <span>按当前源码还原</span>
+          </header>
+          <div class="phone baseline" id="baseline"></div>
+          <p class="specimen-note">保留当前配色、尺寸与布局;非生产页面截图。</p>
+        </article>
+        <article class="specimen polished-specimen">
+          <header class="specimen-caption">
+            <div><span class="version-number">02</span><strong>同一套 UI · 细节精修</strong></div>
+            <span class="live-label"><i></i> 可交互</span>
+          </header>
+          <div class="phone polished" id="polished"></div>
+          <p class="specimen-note" id="design-note"></p>
+        </article>
+      </section>
+      <footer class="studio-footer">
+        <span>同一份演示数据 · 页面切换同步对照</span
+        ><span>点击会话进入聊天,体验输入、切换与文件预览</span>
+      </footer>
+    </main>
+    <script>
+      /* SCRIPT */
+    </script>
+  </body>
+</html>

+ 2302 - 0
prototypes/mobile-current-polish-20261116/styles.css

@@ -0,0 +1,2302 @@
+* {
+  box-sizing: border-box;
+}
+:root {
+  font-family:
+    Inter,
+    -apple-system,
+    BlinkMacSystemFont,
+    'Segoe UI',
+    'PingFang SC',
+    'Microsoft YaHei',
+    sans-serif;
+  color: #25272a;
+  background: #f1f1f0;
+  font-synthesis: none;
+}
+body {
+  margin: 0;
+}
+button,
+input,
+textarea {
+  font: inherit;
+}
+button {
+  cursor: pointer;
+  color: inherit;
+  border: 0;
+  background: none;
+  -webkit-tap-highlight-color: transparent;
+}
+button:disabled {
+  cursor: default;
+  opacity: 0.4;
+}
+button:focus-visible,
+input:focus-visible,
+textarea:focus-visible,
+summary:focus-visible {
+  outline: 2px solid #6386af;
+  outline-offset: 3px;
+}
+button,
+input,
+textarea {
+  touch-action: manipulation;
+}
+svg {
+  width: 21px;
+  height: 21px;
+  fill: none;
+  stroke: currentColor;
+  stroke-width: 1.65;
+  stroke-linecap: round;
+  stroke-linejoin: round;
+  flex: none;
+}
+h1,
+h2,
+h3,
+p {
+  margin: 0;
+}
+button {
+  transition:
+    background 0.15s,
+    transform 0.15s;
+}
+button:active {
+  transform: translateY(1px);
+}
+.studio-header {
+  height: 72px;
+  border-bottom: 1px solid #dededb;
+  margin: 0 48px;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+.brand {
+  display: flex;
+  align-items: center;
+  gap: 12px;
+  font-size: 12px;
+  color: #777873;
+}
+.brand strong {
+  font-size: 23px;
+  letter-spacing: -1.2px;
+  color: #25272a;
+}
+.brand-mark {
+  width: 27px;
+  height: 27px;
+  background: #292b2e;
+  border-radius: 9px;
+  color: white;
+  font-size: 25px;
+  line-height: 30px;
+  font-weight: 700;
+  text-align: center;
+  font-style: italic;
+}
+.brand-divider {
+  height: 17px;
+  width: 1px;
+  background: #cececa;
+  margin: 0 5px;
+}
+.prototype-label {
+  font-size: 11px;
+  color: #81817c;
+}
+.studio {
+  max-width: 1040px;
+  margin: 0 auto;
+  padding: 34px 28px 24px;
+}
+.studio-heading {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  gap: 24px;
+}
+.eyebrow {
+  font-size: 10px;
+  font-weight: 600;
+  color: #777872;
+  letter-spacing: 2px;
+  margin-bottom: 9px;
+}
+h1 {
+  font-size: 25px;
+  font-weight: 600;
+  letter-spacing: -0.6px;
+}
+.studio-heading p {
+  font-size: 12px;
+  color: #777872;
+  margin-top: 10px;
+  line-height: 1.8;
+}
+.view-control {
+  display: flex;
+  padding: 4px;
+  border: 1px solid #d9d9d5;
+  border-radius: 10px;
+  flex: none;
+}
+.view-control button {
+  font-size: 11px;
+  padding: 8px 12px;
+  border-radius: 7px;
+  color: #777872;
+}
+.view-control button.selected {
+  background: #fff;
+  color: #26272a;
+  box-shadow: 0 1px 4px #00000008;
+}
+.scene-nav {
+  display: flex;
+  gap: 6px;
+  margin: 27px 0 22px;
+  border-bottom: 1px solid #dededb;
+  overflow: auto;
+}
+.scene-nav button {
+  font-size: 12px;
+  white-space: nowrap;
+  padding: 13px 15px 14px;
+  color: #83847e;
+  border-bottom: 2px solid transparent;
+  display: flex;
+  align-items: center;
+  gap: 7px;
+}
+.scene-nav svg {
+  width: 15px;
+  height: 15px;
+}
+.scene-nav button.selected {
+  color: #25272a;
+  border-bottom-color: #25272a;
+}
+.comparison {
+  display: flex;
+  justify-content: center;
+  gap: 54px;
+  align-items: flex-start;
+}
+.specimen {
+  width: 390px;
+  min-width: 0;
+}
+.specimen-caption {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  margin-bottom: 14px;
+  gap: 8px;
+  font-size: 10px;
+  color: #82837c;
+}
+.specimen-caption > div {
+  display: flex;
+  align-items: center;
+  gap: 8px;
+}
+.specimen-caption strong {
+  font-size: 12px;
+  font-weight: 600;
+  color: #3a3b3c;
+}
+.version-number {
+  font-size: 10px;
+  border: 1px solid #cececa;
+  width: 22px;
+  height: 22px;
+  border-radius: 6px;
+  display: grid;
+  place-items: center;
+}
+.live-label {
+  display: flex;
+  gap: 5px;
+  align-items: center;
+}
+.live-label i {
+  width: 5px;
+  height: 5px;
+  background: #4e7461;
+  border-radius: 50%;
+}
+.phone {
+  --canvas: #f2f3f5;
+  --surface: #fff;
+  --surface-2: #f7f7f8;
+  --ink: #202124;
+  --ink-2: #45474b;
+  --muted: #62666d;
+  --edge: #dfe1e4;
+  --primary: #25272a;
+  --primary-content: #fff;
+  --subtle: #e8e9eb;
+  --avatar: #e9eaec;
+  --shadow: 0 1px 2px #17243c0a, 0 4px 12px #17243c0f;
+  --chat-size: 14px;
+  isolation: isolate;
+  position: relative;
+  background: var(--canvas);
+  color: var(--ink);
+  height: 792px;
+  border-radius: 38px;
+  overflow: hidden;
+  box-shadow:
+    0 0 0 1px #d5d5d1,
+    0 0 0 5px #fafaf8,
+    0 18px 38px -15px #24262622;
+  display: flex;
+  flex-direction: column;
+  font-size: 14px;
+}
+.phone.dark {
+  --canvas: #18191b;
+  --surface: #222426;
+  --surface-2: #292b2e;
+  --ink: #f2f3f4;
+  --ink-2: #d0d2d5;
+  --muted: #a7abb1;
+  --edge: #383b3f;
+  --primary: #f1f2f3;
+  --primary-content: #202124;
+  --subtle: #34373b;
+  --avatar: #34383c;
+}
+.phone[data-palette='ice']:not(.dark) {
+  --canvas: #f6f8fc;
+  --ink: #202a3c;
+  --primary: #4056c7;
+  --subtle: #e8ecfb;
+  --avatar: #e6ebf7;
+}
+.phone[data-palette='clay']:not(.dark) {
+  --canvas: #f3f0eb;
+  --surface: #fffdfa;
+  --ink: #2a2623;
+  --primary: #af482b;
+  --subtle: #f6e8e1;
+  --avatar: #f0e5dc;
+}
+.phone[data-palette='slate']:not(.dark) {
+  --canvas: #f1f0f5;
+  --ink: #282633;
+  --primary: #6952a3;
+  --subtle: #efebf8;
+  --avatar: #e7e2f0;
+}
+.specimen-note {
+  font-size: 11px;
+  color: #82837c;
+  margin-top: 20px;
+  line-height: 1.8;
+  text-align: center;
+}
+.studio-footer {
+  display: flex;
+  justify-content: space-between;
+  border-top: 1px solid #dededb;
+  margin-top: 28px;
+  padding-top: 18px;
+  color: #8b8c85;
+  font-size: 10px;
+}
+.mobile-review {
+  display: none;
+}
+body[data-view='polished'] .baseline-specimen,
+body[data-view='baseline'] .polished-specimen {
+  display: none;
+}
+.statusbar {
+  height: 40px;
+  flex: none;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  padding: 11px 27px 0;
+  font-size: 13px;
+  font-weight: 650;
+  letter-spacing: 0.2px;
+}
+.status-icons {
+  display: flex;
+  gap: 5px;
+  align-items: center;
+}
+.status-icons svg {
+  width: 15px;
+  height: 15px;
+  stroke-width: 1.9;
+}
+.status-icons svg:last-child {
+  width: 23px;
+}
+.appbar {
+  height: 68px;
+  flex: none;
+  display: flex;
+  align-items: center;
+  gap: 10px;
+  padding: 0 16px;
+}
+.round-button {
+  width: 44px;
+  height: 44px;
+  display: grid;
+  place-items: center;
+  border-radius: 50%;
+  background: var(--surface);
+  box-shadow: var(--shadow);
+  flex: none;
+}
+.appbar-title {
+  flex: 1;
+  min-width: 0;
+  text-align: center;
+}
+.appbar-title h2 {
+  font-size: 16px;
+  font-weight: 600;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+  line-height: 24px;
+}
+.appbar-title p {
+  font-size: 11px;
+  color: var(--muted);
+  line-height: 19px;
+}
+.appbar-title button {
+  max-width: 100%;
+  padding: 0;
+  display: block;
+  width: 100%;
+}
+.appbar-title button h2 {
+  padding: 0 3px;
+}
+.appbar-right {
+  display: flex;
+  gap: 8px;
+}
+.header-spacer {
+  width: 44px;
+  flex: none;
+}
+.page-content {
+  flex: 1;
+  min-height: 0;
+  overflow-y: auto;
+  overscroll-behavior: contain;
+  scrollbar-width: none;
+  padding-bottom: 20px;
+}
+.page-content::-webkit-scrollbar {
+  display: none;
+}
+.filter-area {
+  padding: 0 20px 0;
+  flex: none;
+}
+.segmented {
+  display: flex;
+  background: var(--surface-2);
+  border: 1px solid var(--edge);
+  border-radius: 99px;
+  padding: 4px;
+  max-width: 300px;
+  margin: 0 auto 14px;
+}
+.segmented button {
+  flex: 1;
+  min-height: 36px;
+  font-size: 13px;
+  border-radius: 99px;
+  color: var(--muted);
+}
+.segmented button.selected {
+  background: var(--surface);
+  box-shadow: var(--shadow);
+  color: var(--ink);
+  font-weight: 550;
+}
+.search {
+  display: flex;
+  align-items: center;
+  gap: 9px;
+  height: 44px;
+  background: var(--surface);
+  border: 1px solid var(--edge);
+  border-radius: 10px;
+  padding: 0 12px;
+  color: var(--muted);
+}
+.search svg {
+  width: 18px;
+  height: 18px;
+}
+.search input {
+  background: none;
+  border: 0;
+  outline: none;
+  min-width: 0;
+  width: 100%;
+  color: var(--ink);
+  font-size: 13px;
+  height: 100%;
+}
+.search input::placeholder {
+  color: var(--muted);
+  opacity: 0.8;
+}
+.list {
+  margin: 12px 20px 0;
+  background: var(--surface);
+  border: 1px solid var(--edge);
+  border-radius: 16px;
+  overflow: hidden;
+}
+.conversation {
+  position: relative;
+  display: flex;
+  align-items: center;
+  gap: 12px;
+  padding: 14px 16px;
+  min-height: 76px;
+  width: 100%;
+  text-align: left;
+}
+.conversation + .conversation {
+  border-top: 1px solid var(--edge);
+}
+.conversation:hover {
+  background: var(--surface-2);
+}
+.avatar {
+  width: 40px;
+  height: 40px;
+  border-radius: 50%;
+  flex: none;
+  display: grid;
+  place-items: center;
+  background: var(--avatar);
+  color: var(--muted);
+  font-size: 16px;
+  font-weight: 550;
+  position: relative;
+}
+.presence {
+  position: absolute;
+  right: 0;
+  bottom: 0;
+  width: 9px;
+  height: 9px;
+  border: 2px solid var(--surface);
+  border-radius: 50%;
+  background: #4d8c6b;
+}
+.presence.off {
+  background: #b4b7bb;
+}
+.row-body {
+  min-width: 0;
+  flex: 1;
+}
+.row-title {
+  display: block;
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  font-size: 14px;
+  font-weight: 550;
+  line-height: 22px;
+}
+.row-preview {
+  display: block;
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  font-size: 12px;
+  line-height: 20px;
+  color: var(--muted);
+}
+.row-tail {
+  align-self: stretch;
+  display: flex;
+  flex-direction: column;
+  align-items: flex-end;
+  justify-content: center;
+  gap: 8px;
+  flex: none;
+  font-size: 10px;
+  color: var(--muted);
+}
+.unread {
+  background: #c33f42;
+  color: #fff;
+  border-radius: 99px;
+  min-width: 17px;
+  height: 17px;
+  display: grid;
+  place-items: center;
+  font-size: 10px;
+  padding: 0 5px;
+}
+.row-meta {
+  display: none;
+}
+.list-footer {
+  text-align: center;
+  color: var(--muted);
+  opacity: 0.7;
+  font-size: 10px;
+  padding: 20px;
+}
+.tabbar {
+  height: 70px;
+  flex: none;
+  display: flex;
+  align-items: center;
+  background: color-mix(in srgb, var(--surface) 88%, transparent);
+  border-top: 1px solid var(--edge);
+  backdrop-filter: blur(16px);
+  padding: 5px 10px 2px;
+  position: relative;
+}
+.tabbar button {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  flex-direction: column;
+  gap: 4px;
+  flex: 1;
+  font-size: 10px;
+  color: var(--muted);
+  min-height: 48px;
+  position: relative;
+}
+.tab-icon {
+  display: grid;
+  place-items: center;
+  height: 28px;
+  width: 48px;
+  border-radius: 12px;
+  position: relative;
+}
+.tabbar button.selected {
+  color: var(--primary);
+  font-weight: 650;
+}
+.tabbar .unread {
+  position: absolute;
+  top: -3px;
+  right: 2px;
+  min-width: 15px;
+  height: 15px;
+  font-size: 9px;
+}
+.home-indicator {
+  height: 18px;
+  background: var(--surface);
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  flex: none;
+}
+.home-indicator:after {
+  content: '';
+  height: 4px;
+  width: 116px;
+  background: var(--ink);
+  border-radius: 9px;
+  opacity: 0.8;
+}
+.group-toggle {
+  display: flex;
+  align-items: center;
+  gap: 9px;
+  width: 100%;
+  min-height: 58px;
+  padding: 12px 16px;
+  text-align: left;
+}
+.group-toggle strong {
+  font-size: 13px;
+  flex: 1;
+  font-weight: 550;
+}
+.group-toggle span {
+  font-size: 11px;
+  color: var(--muted);
+}
+.group-toggle svg {
+  width: 18px;
+  height: 18px;
+}
+.group-actions {
+  display: flex;
+  padding: 0 12px 12px;
+  gap: 6px;
+}
+.group-actions button {
+  font-size: 11px;
+  color: var(--muted);
+  padding: 8px;
+  min-height: 36px;
+}
+.section-label {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  margin: 21px 22px 10px;
+  font-size: 12px;
+  color: var(--muted);
+  font-weight: 500;
+}
+.text-button {
+  color: var(--muted);
+  font-size: 12px;
+  padding: 10px 0;
+  min-height: 40px;
+  display: inline-flex;
+  align-items: center;
+  gap: 5px;
+}
+.text-button svg {
+  width: 15px;
+  height: 15px;
+}
+.empty {
+  padding: 50px 24px;
+  text-align: center;
+  color: var(--muted);
+}
+.empty svg {
+  width: 30px;
+  height: 30px;
+  margin-bottom: 14px;
+}
+.empty h3 {
+  font-size: 15px;
+  color: var(--ink);
+  margin-bottom: 8px;
+}
+.empty p {
+  font-size: 12px;
+  line-height: 1.8;
+}
+.empty button {
+  margin-top: 18px;
+}
+.primary-button {
+  background: var(--primary);
+  color: var(--primary-content);
+  border-radius: 10px;
+  min-height: 44px;
+  padding: 10px 17px;
+  font-size: 13px;
+  font-weight: 550;
+}
+.secondary-button {
+  background: var(--surface-2);
+  border: 1px solid var(--edge);
+  border-radius: 10px;
+  min-height: 44px;
+  padding: 10px 16px;
+  font-size: 13px;
+}
+.chat-scroll {
+  padding: 8px 16px 22px;
+  scroll-behavior: smooth;
+}
+.chat-date {
+  text-align: center;
+  color: var(--muted);
+  font-size: 10px;
+  margin: 8px 0 21px;
+}
+.user-message {
+  background: var(--subtle);
+  border-radius: 16px 16px 4px 16px;
+  margin-left: 35px;
+  padding: 12px 15px;
+  line-height: 1.75;
+  font-size: var(--chat-size);
+  white-space: pre-wrap;
+  overflow-wrap: anywhere;
+}
+.agent-line {
+  display: flex;
+  align-items: center;
+  gap: 8px;
+  margin: 20px 0 10px;
+  font-size: 12px;
+  font-weight: 600;
+}
+.agent-line .avatar {
+  width: 26px;
+  height: 26px;
+  font-size: 11px;
+}
+.agent-line .agent-status {
+  margin-left: auto;
+  color: var(--muted);
+  font-size: 10px;
+  font-weight: 400;
+}
+.process {
+  margin-bottom: 8px;
+}
+.process summary {
+  cursor: pointer;
+  list-style: none;
+  min-height: 32px;
+  padding: 6px 10px;
+  display: flex;
+  align-items: center;
+  gap: 6px;
+  font-size: 10px;
+  color: var(--muted);
+  background: var(--surface-2);
+  border: 1px solid var(--edge);
+  border-radius: 99px;
+  width: fit-content;
+  max-width: 100%;
+}
+.process summary::-webkit-details-marker {
+  display: none;
+}
+.process summary svg {
+  width: 13px;
+  height: 13px;
+}
+.process summary span {
+  margin-left: 4px;
+}
+.process[open] summary svg:last-child {
+  transform: rotate(180deg);
+}
+.process ol {
+  font-size: 11px;
+  color: var(--muted);
+  line-height: 2.1;
+  padding-left: 30px;
+  margin: 10px 0;
+}
+.assistant-card {
+  background: var(--surface);
+  border: 1px solid var(--edge);
+  border-radius: 16px;
+  padding: 16px;
+  font-size: var(--chat-size);
+  line-height: 1.85;
+  overflow-wrap: anywhere;
+}
+.assistant-card h3 {
+  font-size: 16px;
+  font-weight: 650;
+  margin-bottom: 7px;
+  line-height: 1.65;
+}
+.assistant-card p {
+  color: var(--ink-2);
+  margin: 0 0 12px;
+}
+.assistant-card p:last-child {
+  margin-bottom: 0;
+}
+.insight {
+  border-left: 2px solid var(--edge);
+  padding: 0 0 0 11px;
+  margin: 14px 0;
+}
+.insight p {
+  margin: 0 0 6px;
+  font-size: 13px;
+}
+.insight b {
+  color: var(--ink);
+  font-weight: 600;
+}
+.files {
+  display: grid;
+  grid-template-columns: 1fr 1fr;
+  gap: 8px;
+  margin-top: 15px;
+}
+.file-card {
+  background: var(--surface-2);
+  border: 1px solid var(--edge);
+  border-radius: 10px;
+  padding: 11px;
+  text-align: left;
+  min-width: 0;
+  display: flex;
+  flex-direction: column;
+  gap: 6px;
+}
+.file-type {
+  display: grid;
+  place-items: center;
+  width: 29px;
+  height: 34px;
+  border: 1px solid #e2c2b7;
+  background: #fff0e9;
+  color: #ae5737;
+  border-radius: 5px;
+  font-size: 8px;
+  font-weight: 700;
+  letter-spacing: 0.3px;
+}
+.file-type.sheet {
+  background: #eef5ee;
+  color: #487556;
+  border-color: #c8dccb;
+}
+.file-card strong {
+  font-size: 11px;
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  max-width: 100%;
+  font-weight: 550;
+}
+.file-card small {
+  font-size: 9px;
+  color: var(--muted);
+}
+.response-actions {
+  display: flex;
+  gap: 2px;
+  margin-top: 5px;
+}
+.response-actions button {
+  min-width: 38px;
+  min-height: 36px;
+  display: grid;
+  place-items: center;
+  color: var(--muted);
+}
+.response-actions svg {
+  width: 15px;
+  height: 15px;
+}
+.composer-wrap {
+  padding: 6px 16px 9px;
+  flex: none;
+  background: var(--canvas);
+}
+.activity-entry {
+  display: none;
+  align-items: center;
+  gap: 7px;
+  font-size: 11px;
+  min-height: 35px;
+  color: var(--muted);
+  padding: 0 5px;
+  margin-bottom: 3px;
+}
+.activity-entry span {
+  flex: 1;
+  text-align: left;
+}
+.activity-entry svg {
+  width: 15px;
+  height: 15px;
+}
+.activity-entry .activity-dot {
+  width: 6px;
+  height: 6px;
+  background: #b78332;
+  border-radius: 50%;
+}
+.composer {
+  background: var(--surface);
+  border: 1px solid var(--edge);
+  border-radius: 16px;
+  padding: 12px 14px;
+  box-shadow:
+    0 4px 8px #17243c14,
+    0 16px 32px #17243c1f;
+}
+.composer textarea {
+  resize: none;
+  border: 0;
+  outline: none !important;
+  background: none;
+  color: var(--ink);
+  font-size: 16px;
+  width: 100%;
+  height: 48px;
+  min-height: 48px;
+  max-height: 112px;
+  line-height: 1.6;
+  display: block;
+  padding: 0;
+}
+.composer textarea::placeholder {
+  color: var(--muted);
+  opacity: 0.75;
+}
+.composer-tools {
+  display: flex;
+  align-items: center;
+  gap: 2px;
+  min-height: 40px;
+}
+.tool-button {
+  width: 40px;
+  height: 40px;
+  display: grid;
+  place-items: center;
+  color: var(--muted);
+  border-radius: 50%;
+}
+.agent-tool {
+  display: flex;
+  align-items: center;
+  gap: 5px;
+  font-size: 11px;
+  color: var(--muted);
+  min-height: 40px;
+  padding: 0 8px;
+}
+.agent-tool svg {
+  width: 14px;
+  height: 14px;
+}
+.send-button {
+  margin-left: auto;
+  background: var(--primary);
+  color: var(--primary-content);
+  width: 36px;
+  height: 36px;
+  border-radius: 50%;
+  display: grid;
+  place-items: center;
+}
+.input-hint {
+  display: none;
+  text-align: center;
+  font-size: 9px;
+  color: var(--muted);
+  margin-top: 8px;
+  opacity: 0.85;
+}
+.attachment-chip {
+  background: var(--surface-2);
+  font-size: 11px;
+  display: flex;
+  align-items: center;
+  gap: 6px;
+  padding: 6px 9px;
+  border-radius: 7px;
+  margin-bottom: 8px;
+  overflow: hidden;
+}
+.attachment-chip span {
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}
+.attachment-chip button {
+  margin-left: auto;
+  flex: none;
+  min-width: 32px;
+  min-height: 32px;
+}
+.attachment-chip svg {
+  width: 15px;
+  height: 15px;
+}
+.home-hero {
+  text-align: center;
+  padding: 60px 20px 35px;
+}
+.home-logo {
+  font-size: 49px;
+  font-weight: 650;
+  letter-spacing: -3px;
+}
+.home-hero h3 {
+  font-weight: 500;
+  font-size: 18px;
+  margin: 15px 0 10px;
+}
+.home-hero p {
+  font-size: 11px;
+  color: var(--muted);
+}
+.overview {
+  display: flex;
+  margin: 8px 20px 18px;
+  background: var(--surface);
+  border: 1px solid var(--edge);
+  border-radius: 16px;
+  padding: 19px 8px;
+}
+.overview > div {
+  flex: 1;
+  text-align: center;
+  border-right: 1px solid var(--edge);
+}
+.overview > div:last-child {
+  border: 0;
+}
+.overview strong {
+  font-size: 25px;
+  font-weight: 600;
+  display: block;
+  line-height: 1.3;
+}
+.overview span {
+  font-size: 10px;
+  color: var(--muted);
+  display: block;
+  margin-top: 5px;
+}
+.life-card {
+  margin: 12px 20px 0;
+  background: var(--surface);
+  border: 1px solid var(--edge);
+  border-radius: 16px;
+  padding: 14px 16px;
+  box-shadow: var(--shadow);
+}
+.life-head {
+  display: flex;
+  align-items: center;
+  gap: 10px;
+}
+.life-head .row-body strong {
+  font-size: 14px;
+  display: block;
+}
+.life-head small {
+  font-size: 11px;
+  color: var(--muted);
+  display: block;
+  margin-top: 4px;
+}
+.state-tag {
+  font-size: 10px;
+  border-radius: 5px;
+  padding: 4px 6px;
+  background: #edf7f1;
+  color: #207550;
+  white-space: nowrap;
+}
+.state-tag.busy {
+  background: #fff7e8;
+  color: #91600e;
+}
+.state-tag.offline {
+  background: var(--surface-2);
+  color: var(--muted);
+}
+.task-line {
+  font-size: 11px;
+  background: var(--surface-2);
+  padding: 10px;
+  border-radius: 7px;
+  display: flex;
+  align-items: center;
+  gap: 7px;
+  margin: 13px 0;
+}
+.task-line svg {
+  width: 14px;
+  height: 14px;
+  color: var(--muted);
+}
+.task-line span {
+  overflow: hidden;
+  white-space: nowrap;
+  text-overflow: ellipsis;
+}
+.metrics {
+  display: flex;
+  gap: 18px;
+  margin: 13px 0 15px;
+}
+.metric {
+  flex: 1;
+  font-size: 10px;
+  color: var(--muted);
+}
+.metric > div {
+  display: flex;
+  justify-content: space-between;
+}
+.metric-track {
+  height: 5px;
+  border-radius: 5px;
+  background: var(--subtle);
+  margin-top: 7px;
+  overflow: hidden;
+}
+.metric-track i {
+  height: 100%;
+  display: block;
+  border-radius: 5px;
+  background: var(--primary);
+  opacity: 0.55;
+}
+.life-actions {
+  display: flex;
+  gap: 8px;
+  border-top: 1px solid var(--edge);
+  padding-top: 12px;
+}
+.life-actions button {
+  flex: 1;
+  min-height: 34px;
+  font-size: 11px;
+  border-radius: 7px;
+  background: var(--surface-2);
+}
+.life-actions button:first-child {
+  background: var(--primary);
+  color: var(--primary-content);
+}
+.profile-card {
+  margin: 8px 20px 0;
+  padding: 20px 16px;
+  border: 1px solid var(--edge);
+  border-radius: 16px;
+  background: var(--surface);
+  display: flex;
+  gap: 13px;
+  align-items: center;
+}
+.profile-card .avatar {
+  width: 54px;
+  height: 54px;
+  font-size: 21px;
+}
+.profile-card h3 {
+  font-size: 17px;
+  font-weight: 600;
+}
+.profile-card p {
+  font-size: 11px;
+  color: var(--muted);
+  margin-top: 7px;
+}
+.settings-card {
+  margin: 0 20px;
+  background: var(--surface);
+  border: 1px solid var(--edge);
+  border-radius: 16px;
+  overflow: hidden;
+}
+.setting-row {
+  display: flex;
+  align-items: center;
+  gap: 10px;
+  padding: 13px 16px;
+  min-height: 58px;
+  width: 100%;
+  text-align: left;
+  font-size: 13px;
+}
+.setting-row + .setting-row {
+  border-top: 1px solid var(--edge);
+}
+.setting-row > svg {
+  width: 17px;
+  height: 17px;
+  color: var(--muted);
+}
+.setting-row .row-body {
+  display: block;
+}
+.setting-row small {
+  display: block;
+  color: var(--muted);
+  font-size: 10px;
+  margin-top: 4px;
+}
+.setting-row > span:last-child {
+  font-size: 11px;
+  color: var(--muted);
+}
+.setting-row .tool-button {
+  width: 34px;
+  height: 34px;
+}
+.setting-row .tool-button svg {
+  width: 17px;
+  height: 17px;
+}
+.danger {
+  color: #c33f42;
+}
+.palette-label {
+  padding: 16px 16px 10px;
+  font-size: 12px;
+}
+.palette-grid {
+  display: grid;
+  grid-template-columns: 1fr 1fr;
+  gap: 8px;
+  padding: 0 16px 15px;
+}
+.palette-grid button {
+  border: 1px solid var(--edge);
+  border-radius: 9px;
+  text-align: left;
+  min-height: 45px;
+  padding: 8px;
+  display: flex;
+  gap: 7px;
+  align-items: center;
+  font-size: 10px;
+}
+.palette-grid button.selected {
+  border-color: var(--primary);
+  background: var(--surface-2);
+}
+.palette-swatch {
+  width: 17px;
+  height: 24px;
+  border-radius: 5px;
+  box-shadow: inset -6px 0 #ffffffaa;
+  flex: none;
+}
+.switch {
+  height: 25px;
+  width: 43px;
+  border-radius: 99px;
+  background: var(--edge);
+  position: relative;
+  flex: none;
+}
+.switch:after {
+  content: '';
+  position: absolute;
+  left: 3px;
+  top: 3px;
+  width: 19px;
+  height: 19px;
+  border-radius: 50%;
+  background: white;
+  box-shadow: 0 1px 3px #0002;
+}
+.switch[aria-checked='true'] {
+  background: var(--primary);
+}
+.switch[aria-checked='true']:after {
+  left: 21px;
+  background: var(--primary-content);
+}
+.font-slider {
+  padding: 15px 16px;
+  border-top: 1px solid var(--edge);
+  font-size: 12px;
+}
+.font-slider label {
+  display: flex;
+  justify-content: space-between;
+}
+.font-slider input {
+  width: 100%;
+  accent-color: var(--primary);
+  margin-top: 17px;
+}
+.overlay {
+  position: absolute;
+  inset: 40px 0 0;
+  background: #11121465;
+  z-index: 20;
+  display: flex;
+  align-items: flex-end;
+  backdrop-filter: blur(2px);
+}
+.sheet {
+  background: var(--surface);
+  border-radius: 24px 24px 0 0;
+  width: 100%;
+  max-height: 90%;
+  overflow: auto;
+  overscroll-behavior: contain;
+  padding: 9px 20px 26px;
+  box-shadow: 0 -5px 35px #0000000b;
+  animation: sheet-in 0.2s ease-out;
+}
+.sheet-handle {
+  width: 34px;
+  height: 4px;
+  background: var(--edge);
+  border-radius: 4px;
+  margin: 0 auto 14px;
+}
+.sheet-heading {
+  display: flex;
+  align-items: center;
+  gap: 10px;
+  margin-bottom: 8px;
+}
+.sheet-heading h3 {
+  flex: 1;
+  font-size: 17px;
+  font-weight: 600;
+}
+.close-button {
+  width: 36px;
+  height: 36px;
+  border-radius: 50%;
+  background: var(--surface-2);
+  display: grid;
+  place-items: center;
+  flex: none;
+}
+.close-button svg {
+  width: 18px;
+  height: 18px;
+}
+.sheet-description {
+  font-size: 12px;
+  color: var(--muted);
+  line-height: 1.8;
+  margin-bottom: 20px;
+}
+.sheet .list {
+  margin: 10px 0 0;
+}
+.sheet .conversation {
+  padding: 13px 12px;
+}
+.sheet .row-meta {
+  display: flex;
+  font-size: 10px;
+  gap: 4px;
+  color: var(--muted);
+}
+.sheet .row-meta.running {
+  color: #91600e;
+}
+.sheet .row-meta.done {
+  color: #207550;
+}
+.sheet .row-meta.error {
+  color: #c33f42;
+}
+.sheet .primary-button {
+  width: 100%;
+  margin-top: 20px;
+}
+.field-label {
+  display: block;
+  font-size: 12px;
+  color: var(--muted);
+  margin-bottom: 8px;
+}
+.form-field {
+  min-height: 46px;
+  border: 1px solid var(--edge);
+  border-radius: 10px;
+  padding: 12px;
+  background: var(--surface-2);
+  color: var(--ink);
+  width: 100%;
+  font-size: 14px;
+}
+.form-error {
+  min-height: 24px;
+  font-size: 11px;
+  color: #c33f42;
+  line-height: 24px;
+}
+.candidate {
+  border: 1px solid var(--edge);
+  border-radius: 9px;
+  padding: 12px;
+  text-align: left;
+  font-size: 12px;
+  display: block;
+  width: 100%;
+  margin-top: 8px;
+}
+.drawer-overlay {
+  align-items: stretch;
+}
+.drawer {
+  width: 84%;
+  max-width: 330px;
+  background: var(--surface);
+  padding: 22px 16px 20px;
+  overflow: auto;
+  display: flex;
+  flex-direction: column;
+  animation: drawer-in 0.2s ease-out;
+}
+.drawer-head {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  margin-bottom: 22px;
+  padding: 0 5px;
+}
+.drawer-head strong {
+  font-size: 25px;
+  letter-spacing: -1.5px;
+}
+.drawer-new {
+  display: flex;
+  align-items: center;
+  gap: 12px;
+  background: var(--primary);
+  color: var(--primary-content);
+  padding: 13px;
+  border-radius: 12px;
+  text-align: left;
+}
+.drawer-new strong {
+  display: block;
+  font-size: 13px;
+}
+.drawer-new small {
+  display: block;
+  opacity: 0.7;
+  font-size: 10px;
+  margin-top: 4px;
+}
+.drawer-quick {
+  margin: 8px 0;
+  padding: 12px 9px;
+  background: var(--surface-2);
+  border-radius: 10px;
+  text-align: left;
+  display: flex;
+  align-items: center;
+  gap: 10px;
+  font-size: 12px;
+}
+.drawer-nav {
+  padding: 15px 0;
+  border-bottom: 1px solid var(--edge);
+}
+.drawer-nav button {
+  display: flex;
+  align-items: center;
+  gap: 11px;
+  width: 100%;
+  text-align: left;
+  min-height: 44px;
+  padding: 9px 12px;
+  font-size: 13px;
+  border-radius: 9px;
+}
+.drawer-nav button.selected {
+  background: var(--subtle);
+}
+.drawer-section {
+  font-size: 10px;
+  color: var(--muted);
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  margin: 15px 9px 5px;
+}
+.drawer-section button {
+  min-width: 32px;
+  min-height: 32px;
+}
+.drawer-item {
+  display: flex;
+  align-items: center;
+  gap: 9px;
+  text-align: left;
+  width: 100%;
+  min-height: 42px;
+  font-size: 12px;
+  padding: 8px 11px;
+  border-radius: 8px;
+}
+.drawer-item svg {
+  width: 16px;
+  height: 16px;
+  color: var(--muted);
+}
+.drawer-item span {
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}
+.drawer-footer {
+  margin-top: auto;
+  border-top: 1px solid var(--edge);
+  padding-top: 15px;
+  display: flex;
+  align-items: center;
+  gap: 10px;
+  font-size: 12px;
+}
+.drawer-footer small {
+  display: block;
+  color: var(--muted);
+  font-size: 10px;
+  margin-top: 4px;
+}
+.toast {
+  position: absolute;
+  left: 16px;
+  right: 16px;
+  top: 110px;
+  z-index: 40;
+  background: var(--ink);
+  color: var(--surface);
+  border-radius: 12px;
+  padding: 13px 15px;
+  box-shadow: 0 8px 25px #0002;
+  font-size: 12px;
+  line-height: 1.6;
+  display: flex;
+  align-items: center;
+  gap: 8px;
+  animation: sheet-in 0.2s ease-out;
+}
+.toast span {
+  flex: 1;
+}
+.toast button {
+  font-size: 11px;
+  border: 1px solid currentColor;
+  border-radius: 7px;
+  padding: 5px 8px;
+}
+.preview-document {
+  aspect-ratio: 1.42;
+  background: #eeeee9;
+  color: #262926;
+  border-radius: 10px;
+  padding: 24px 22px;
+  margin: 18px 0;
+  display: flex;
+  flex-direction: column;
+  border: 1px solid #deded6;
+}
+.preview-document .doc-brand {
+  font-size: 9px;
+  letter-spacing: 2px;
+  color: #7b7d74;
+}
+.preview-document h2 {
+  font-size: 28px;
+  font-weight: 500;
+  line-height: 1.5;
+  margin: 22px 0 10px;
+  letter-spacing: -1px;
+}
+.preview-document p {
+  font-size: 11px;
+  color: #777a71;
+}
+.preview-document footer {
+  font-size: 8px;
+  border-top: 1px solid #cecec5;
+  padding-top: 10px;
+  margin-top: auto;
+}
+.preview-table {
+  border-collapse: collapse;
+  width: 100%;
+  font-size: 12px;
+  margin: 24px 0;
+}
+.preview-table td,
+.preview-table th {
+  text-align: left;
+  border-bottom: 1px solid var(--edge);
+  padding: 13px 8px;
+}
+.preview-table th {
+  background: var(--surface-2);
+  font-size: 11px;
+  color: var(--muted);
+}
+.loading-dots {
+  display: flex;
+  gap: 5px;
+  padding: 12px 0;
+}
+.loading-dots i {
+  width: 5px;
+  height: 5px;
+  border-radius: 50%;
+  background: var(--muted);
+  animation: pulse 1s infinite alternate;
+}
+.loading-dots i:nth-child(2) {
+  animation-delay: 0.2s;
+}
+.loading-dots i:nth-child(3) {
+  animation-delay: 0.4s;
+}
+.skeleton {
+  height: 10px;
+  border-radius: 5px;
+  background: var(--subtle);
+  margin: 13px 0;
+  animation: pulse 1s infinite alternate;
+}
+.skeleton.short {
+  width: 65%;
+}
+.notification-option {
+  display: flex;
+  align-items: center;
+  gap: 10px;
+  font-size: 12px;
+  min-height: 44px;
+  margin-top: 12px;
+}
+.notification-option input {
+  accent-color: var(--primary);
+  width: 16px;
+  height: 16px;
+}
+.polished {
+  --canvas: #f5f5f7;
+  --edge: #e8e9ec;
+  --shadow: 0 2px 5px #17243c04;
+  --muted: #7a7d84;
+}
+.polished .appbar {
+  height: 70px;
+  padding: 0 20px;
+}
+.polished .round-button {
+  border: 1px solid color-mix(in srgb, var(--edge) 65%, transparent);
+  box-shadow: 0 2px 3px #20212403;
+}
+.polished .appbar-title h2 {
+  font-size: 17px;
+  font-weight: 650;
+  letter-spacing: 0.2px;
+}
+.polished .appbar-title p {
+  font-size: 10px;
+}
+.polished .segmented {
+  background: var(--subtle);
+  border: 0;
+  padding: 3px;
+  max-width: none;
+  margin: 3px 0 14px;
+}
+.polished .segmented button {
+  min-height: 34px;
+  font-size: 12px;
+}
+.polished .segmented button.selected {
+  box-shadow: 0 1px 4px #17243c0c;
+  font-weight: 600;
+}
+.polished .search {
+  border: 1px solid var(--edge);
+  border-radius: 13px;
+  height: 44px;
+}
+.polished .list {
+  border-color: color-mix(in srgb, var(--edge) 65%, transparent);
+  border-radius: 19px;
+  margin-top: 16px;
+  box-shadow: 0 3px 10px #20212402;
+}
+.polished .conversation {
+  padding: 16px 14px;
+  gap: 12px;
+  min-height: 81px;
+}
+.polished .conversation + .conversation {
+  border-top: 0;
+}
+.polished .conversation + .conversation:before {
+  content: '';
+  position: absolute;
+  left: 68px;
+  right: 14px;
+  height: 1px;
+  top: 0;
+  background: var(--edge);
+  opacity: 0.75;
+}
+.polished .avatar {
+  background: linear-gradient(145deg, var(--surface-2), var(--avatar));
+  color: var(--ink-2);
+  border: 1px solid color-mix(in srgb, var(--edge) 80%, transparent);
+  font-size: 16px;
+  font-weight: 500;
+  width: 42px;
+  height: 42px;
+}
+.polished .presence {
+  width: 8px;
+  height: 8px;
+  right: 1px;
+  bottom: 1px;
+}
+.polished .row-title {
+  font-size: 14px;
+  font-weight: 600;
+  line-height: 23px;
+  letter-spacing: 0.05px;
+}
+.polished .row-preview {
+  font-size: 11px;
+  line-height: 20px;
+}
+.polished .row-tail {
+  font-size: 9px;
+  gap: 9px;
+}
+.polished .unread {
+  background: #bc555a;
+  min-width: 16px;
+  height: 16px;
+  font-size: 9px;
+}
+.polished .row-meta {
+  display: flex;
+  align-items: center;
+  gap: 4px;
+  font-size: 9px;
+  color: #987128;
+  margin-top: 3px;
+  line-height: 15px;
+}
+.polished .row-meta svg {
+  width: 11px;
+  height: 11px;
+}
+.polished .row-meta.done {
+  color: #487c5e;
+}
+.polished .row-meta.error {
+  color: #b35858;
+}
+.polished .tabbar {
+  height: 72px;
+  border-top-color: color-mix(in srgb, var(--edge) 85%, transparent);
+  padding-top: 7px;
+}
+.polished .tabbar .tab-icon {
+  height: 29px;
+  transition: background 0.2s;
+}
+.polished .tabbar .selected .tab-icon {
+  background: var(--subtle);
+}
+.polished .tabbar button {
+  font-size: 10px;
+  gap: 4px;
+}
+.polished .tabbar svg {
+  width: 21px;
+  height: 21px;
+}
+.polished .chat-scroll {
+  padding: 6px 20px 14px;
+}
+.polished .chat-date {
+  margin: 5px 0 20px;
+}
+.polished .user-message {
+  font-size: 13px;
+  padding: 11px 14px;
+  border-radius: 16px 16px 5px 16px;
+  background: var(--subtle);
+}
+.polished .agent-line {
+  margin: 18px 0 10px;
+  gap: 7px;
+  font-size: 11px;
+}
+.polished .agent-line .avatar {
+  height: 25px;
+  width: 25px;
+  font-size: 10px;
+}
+.polished .process summary {
+  font-size: 9px;
+  min-height: 30px;
+  background: transparent;
+  border-color: var(--edge);
+}
+.polished .assistant-card {
+  padding: 16px;
+  border-radius: 17px;
+  border-color: var(--edge);
+  box-shadow: 0 2px 5px #20212402;
+  font-size: 13px;
+  line-height: 1.9;
+}
+.polished .assistant-card h3 {
+  font-size: 16px;
+  letter-spacing: -0.1px;
+  margin-bottom: 8px;
+}
+.polished .assistant-card p {
+  margin-bottom: 11px;
+}
+.polished .insight {
+  margin: 14px 0;
+}
+.polished .insight p {
+  font-size: 12px;
+  margin-bottom: 7px;
+}
+.polished .file-card {
+  background: var(--surface-2);
+  border-color: var(--edge);
+  padding: 10px;
+  border-radius: 11px;
+}
+.polished .file-card strong {
+  font-size: 10px;
+}
+.polished .composer-wrap {
+  padding: 0 16px 7px;
+}
+.polished .activity-entry {
+  display: flex;
+  width: 100%;
+  padding: 0 6px;
+}
+.polished .composer {
+  border-radius: 20px;
+  padding: 12px 12px 8px;
+  box-shadow: 0 3px 12px #20212405;
+  border: 1px solid var(--edge);
+}
+.polished .composer textarea {
+  padding: 1px 3px;
+  min-height: 42px;
+  height: 42px;
+  font-size: 14px;
+}
+.polished .input-hint {
+  display: block;
+}
+.polished .send-button {
+  width: 36px;
+  height: 36px;
+}
+.polished .agent-tool {
+  border-radius: 99px;
+  background: var(--surface-2);
+  min-height: 29px;
+  padding: 0 9px;
+  font-size: 10px;
+}
+.polished .tool-button {
+  width: 36px;
+  height: 36px;
+}
+.polished .overview {
+  border-radius: 18px;
+  padding: 19px 8px;
+  margin-top: 10px;
+  border-color: var(--edge);
+}
+.polished .overview strong {
+  font-size: 26px;
+  letter-spacing: -0.5px;
+  font-weight: 550;
+}
+.polished .life-card {
+  box-shadow: none;
+  padding: 16px;
+  border-radius: 18px;
+}
+.polished .life-head .avatar {
+  width: 40px;
+  height: 40px;
+}
+.polished .life-actions button {
+  min-height: 38px;
+  border-radius: 9px;
+}
+.polished .task-line {
+  padding: 11px 10px;
+  border-radius: 9px;
+  margin-top: 16px;
+}
+.polished .profile-card {
+  border-radius: 20px;
+  padding: 22px 18px;
+}
+.polished .profile-card .avatar {
+  width: 54px;
+  height: 54px;
+  font-size: 21px;
+}
+.polished .settings-card {
+  border-radius: 18px;
+}
+.polished .setting-row {
+  min-height: 62px;
+}
+.polished .setting-row + .setting-row {
+  border-top-color: var(--edge);
+}
+.polished .home-hero {
+  padding-top: 54px;
+}
+.polished .home-logo {
+  font-size: 55px;
+}
+.polished .sheet .list {
+  margin: 10px 0 0;
+}
+.polished .sheet .conversation {
+  padding: 14px 11px;
+}
+.polished .sheet .row-meta {
+  display: flex;
+}
+.polished .chat-scroll .assistant-card {
+  font-size: var(--chat-size);
+}
+.baseline .row-meta {
+  display: none;
+}
+.baseline .sheet .row-meta {
+  display: flex;
+}
+.baseline .agent-tool {
+  padding-left: 4px;
+}
+.baseline .agent-tool span {
+  display: none;
+}
+.baseline .input-hint {
+  display: none;
+}
+.baseline .life-actions button {
+  min-height: 34px;
+}
+.baseline .chat-scroll .assistant-card {
+  font-size: var(--chat-size);
+}
+:root {
+  font-family:
+    -apple-system, BlinkMacSystemFont, 'Noto Sans SC', 'Segoe UI', 'Microsoft YaHei', sans-serif;
+}
+.app-shell {
+  display: flex;
+  flex-direction: column;
+  flex: 1;
+  min-height: 0;
+}
+.file-card small {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  gap: 3px;
+}
+.file-card small svg {
+  width: 10px;
+  height: 10px;
+}
+.empty > .avatar {
+  margin: 0 auto 17px;
+}
+.person-children {
+  background: var(--surface-2);
+  padding-left: 24px;
+}
+.person-children .conversation {
+  min-height: 65px;
+  padding-top: 10px;
+  padding-bottom: 10px;
+}
+.person-children .avatar {
+  width: 32px;
+  height: 32px;
+  font-size: 13px;
+}
+.sheet .profile-card p {
+  line-height: 1.8;
+}
+.polished .conversation {
+  padding-top: 11px;
+  padding-bottom: 11px;
+  min-height: 76px;
+}
+.polished .row-title {
+  font-size: 15px;
+  font-weight: 550;
+}
+.polished .row-preview {
+  font-size: 12px;
+}
+.overview strong {
+  margin-top: 5px;
+}
+.overview span {
+  margin-top: 0;
+}
+@keyframes sheet-in {
+  from {
+    transform: translateY(16px);
+    opacity: 0;
+  }
+  to {
+    transform: translateY(0);
+    opacity: 1;
+  }
+}
+.activity-entry .activity-dot.idle {
+  background: var(--muted);
+}
+.send-button,
+.close-button {
+  position: relative;
+}
+.send-button:before,
+.close-button:before {
+  content: '';
+  position: absolute;
+  inset: -4px;
+}
+@keyframes drawer-in {
+  from {
+    transform: translateX(-20px);
+    opacity: 0;
+  }
+  to {
+    transform: translateX(0);
+    opacity: 1;
+  }
+}
+@keyframes pulse {
+  from {
+    opacity: 0.35;
+  }
+  to {
+    opacity: 1;
+  }
+}
+@media (min-width: 1500px) {
+  .studio {
+    padding-top: 42px;
+  }
+  .comparison {
+    gap: 70px;
+  }
+  .phone {
+    height: 820px;
+  }
+}
+@media (max-width: 1000px) and (min-width: 701px) {
+  .studio {
+    padding: 25px 25px;
+  }
+  .comparison {
+    gap: 28px;
+  }
+  .specimen {
+    width: min(390px, calc((100vw - 78px) / 2));
+  }
+  .phone {
+    height: 780px;
+  }
+  .studio-header {
+    margin: 0 25px;
+  }
+  .studio-heading {
+    align-items: flex-start;
+  }
+  .studio-heading p {
+    max-width: 360px;
+  }
+  .view-control button {
+    padding: 8px;
+  }
+  .specimen-caption > span {
+    display: none;
+  }
+}
+@media (max-width: 700px) {
+  html,
+  body {
+    height: 100%;
+    overflow: hidden;
+    background: #f5f5f7;
+  }
+  .studio-header,
+  .studio-heading,
+  .scene-nav,
+  .studio-footer,
+  .specimen-caption,
+  .specimen-note {
+    display: none;
+  }
+  .studio {
+    padding: 0;
+    height: 100dvh;
+    width: 100%;
+    max-width: none;
+    display: flex;
+    flex-direction: column;
+  }
+  .mobile-review {
+    height: 35px;
+    flex: none;
+    display: flex;
+    align-items: center;
+    gap: 3px;
+    padding: 0 12px;
+    background: #e9eaed;
+    color: #777c83;
+    font-size: 10px;
+    border-bottom: 1px solid #dfe1e4;
+  }
+  .mobile-review > span {
+    margin-right: auto;
+    letter-spacing: 0.3px;
+  }
+  .mobile-review button {
+    padding: 4px 11px;
+    border-radius: 5px;
+    font-size: 10px;
+  }
+  .mobile-review button.selected {
+    background: white;
+    color: #25272a;
+    box-shadow: 0 1px 2px #00000008;
+  }
+  .comparison {
+    display: block;
+    min-height: 0;
+    flex: 1;
+  }
+  .specimen {
+    width: 100%;
+    height: 100%;
+  }
+  .baseline-specimen {
+    display: none;
+  }
+  .phone {
+    height: 100%;
+    border-radius: 0;
+    box-shadow: none;
+    padding-top: env(safe-area-inset-top);
+  }
+  .statusbar {
+    display: none;
+  }
+  .home-indicator {
+    height: env(safe-area-inset-bottom);
+    min-height: 8px;
+  }
+  .home-indicator:after {
+    display: none;
+  }
+  .overlay {
+    top: 0;
+  }
+  .sheet {
+    padding-bottom: max(24px, env(safe-area-inset-bottom));
+  }
+  .toast {
+    top: 74px;
+  }
+  body[data-view='baseline'] .baseline-specimen {
+    display: block;
+  }
+  body[data-view='compare'] .polished-specimen {
+    display: block;
+  }
+  .polished .appbar-title h2 {
+    font-size: 16px;
+  }
+  .studio .specimen {
+    margin: 0;
+  }
+  .polished .appbar {
+    padding: 0 16px;
+  }
+}
+@media (max-width: 350px) {
+  .filter-area {
+    padding: 0 14px;
+  }
+  .list,
+  .life-card,
+  .overview,
+  .settings-card,
+  .profile-card {
+    margin-left: 14px;
+    margin-right: 14px;
+  }
+  .appbar,
+  .polished .appbar {
+    padding: 0 12px;
+    gap: 6px;
+  }
+  .appbar-right {
+    gap: 5px;
+  }
+  .round-button {
+    width: 40px;
+    height: 40px;
+  }
+  .polished .conversation,
+  .conversation {
+    padding-left: 12px;
+    padding-right: 12px;
+    gap: 9px;
+  }
+  .row-title,
+  .polished .row-title {
+    font-size: 13px;
+  }
+  .row-preview,
+  .polished .row-preview {
+    font-size: 10px;
+  }
+  .chat-scroll,
+  .polished .chat-scroll {
+    padding-left: 14px;
+    padding-right: 14px;
+  }
+  .sheet {
+    padding-left: 16px;
+    padding-right: 16px;
+  }
+  .appbar-title h2,
+  .polished .appbar-title h2 {
+    font-size: 14px;
+  }
+  .polished .avatar {
+    width: 38px;
+    height: 38px;
+  }
+}
+@media (prefers-reduced-motion: reduce) {
+  *,
+  *:before,
+  *:after {
+    animation: none !important;
+    transition: none !important;
+    scroll-behavior: auto !important;
+  }
+}

+ 351 - 0
prototypes/mobile-current-polish-20261116/verify.mjs

@@ -0,0 +1,351 @@
+import assert from 'node:assert/strict';
+import { chromium } from 'playwright';
+import { fileURLToPath, pathToFileURL } from 'node:url';
+import path from 'node:path';
+
+const directory = path.dirname(fileURLToPath(import.meta.url));
+const base = pathToFileURL(path.join(directory, 'index.html')).href;
+const browser = await chromium.launch({ channel: 'chrome', headless: true });
+const context = await browser.newContext({
+  viewport: { width: 390, height: 844 },
+  deviceScaleFactor: 1,
+  reducedMotion: 'reduce',
+});
+const page = await context.newPage();
+page.setDefaultTimeout(8000);
+const errors = [];
+const requests = [];
+page.on('pageerror', (error) => errors.push(error.message));
+page.on('request', (request) => {
+  if (/^https?:/.test(request.url())) requests.push(request.url());
+});
+const phone = page.locator('#polished');
+const click = async (action, selector = '') => {
+  const query = `[data-action="${action}"]${selector}`;
+  const overlay = phone.locator('.overlay').locator(query);
+  await ((await overlay.count()) ? overlay : phone.locator(query)).first().click();
+};
+const go = async (route) => {
+  await page.goto(`${base}#/${route}`);
+  await page.evaluate(() => document.fonts.ready);
+};
+let checks = 0;
+async function check(name, operation) {
+  await operation();
+  checks++;
+  console.log(`PASS ${checks}: ${name}`);
+}
+const shot = async (name) => {
+  await page.mouse.move(0, 0);
+  return page.screenshot({
+    path: path.join(directory, name),
+    fullPage: true,
+    style: '.toast{visibility:hidden!important}',
+  });
+};
+
+try {
+  await go('messages');
+  await check('当前会话结构、四栏导航和前后对照', async () => {
+    assert.equal(await phone.locator('.tabbar button').count(), 4);
+    assert.deepEqual(await phone.locator('.segmented button').allTextContents(), [
+      '全部',
+      '工作区',
+    ]);
+    assert.equal(await phone.locator('.conversation').count(), 6);
+    assert.equal(await page.locator('#baseline .conversation').count(), 6);
+    assert.equal(await page.locator('#baseline').isVisible(), false);
+    await page.locator('.mobile-review [data-view="baseline"]').click();
+    assert.equal(await page.locator('#baseline').isVisible(), true);
+    await page.locator('.mobile-review [data-view="polished"]').click();
+  });
+  await check('即时搜索与空状态', async () => {
+    await phone.locator('[data-field="search"]').fill('Nova');
+    assert.equal(await phone.locator('.conversation').count(), 2);
+    await phone.locator('[data-field="search"]').fill('不存在的关键词');
+    assert.equal(await phone.locator('.empty h3').textContent(), '没有找到相关会话');
+    await phone.locator('[data-field="search"]').fill('');
+  });
+  await shot('preview-messages.png');
+  await check('工作区折叠、新建、重命名、删除保留会话', async () => {
+    await click('filter', '[data-value="workspace"]');
+    assert.equal(await phone.locator('.group-toggle[aria-expanded="false"]').count(), 2);
+    await click('group', '[data-id="w1"]');
+    assert.equal(
+      await phone.locator('.group-toggle[data-id="w1"]').getAttribute('aria-expanded'),
+      'true',
+    );
+    await click('workspace-new');
+    await phone.locator('[data-field="workspace"]').fill('设计评审');
+    await phone.locator('[data-form="workspace"] button[type="submit"]').click();
+    assert.equal(await phone.locator('.group-toggle').count(), 3);
+    const group = phone
+      .locator('.list')
+      .filter({ has: page.locator('.group-toggle', { hasText: '设计评审' }) });
+    await group.locator('[data-action="workspace-rename"]').click();
+    await phone.locator('[data-field="workspace"]').fill('设计迭代');
+    await phone.locator('[data-form="workspace"] button[type="submit"]').click();
+    await phone
+      .locator('.list')
+      .filter({ has: page.locator('.group-toggle', { hasText: '设计迭代' }) })
+      .locator('[data-action="workspace-delete"]')
+      .click();
+    await click('confirm-workspace-delete');
+    assert.equal(await phone.locator('.group-toggle').count(), 2);
+    await phone
+      .locator('.list')
+      .filter({ has: page.locator('.group-toggle[data-id="w1"]') })
+      .locator('[data-action="workspace-delete"]')
+      .click();
+    await click('confirm-workspace-delete');
+    await click('filter', '[data-value="all"]');
+    assert.equal(await phone.locator('.conversation').count(), 6);
+  });
+  await go('chat/c1');
+  await check('保留回复卡片、过程折叠和两份文件', async () => {
+    assert.equal(await phone.locator('.tabbar').count(), 0);
+    assert.equal(await phone.locator('.assistant-card').count(), 1);
+    assert.equal(await phone.locator('.file-card').count(), 2);
+    assert.equal(await phone.locator('details[open]').count(), 0);
+    await phone.locator('.process summary').click();
+    assert.equal(await phone.locator('details[open]').count(), 1);
+    await phone.locator('.process summary').click();
+    await click('files');
+    await click('preview', '[data-id="ppt"]');
+    assert.equal(await phone.locator('.preview-document').count(), 1);
+    await page.keyboard.press('Escape');
+    assert.equal(await phone.locator('.overlay').count(), 0);
+  });
+  await shot('preview-chat.png');
+  await check('标题校验、预设建议与安全文本渲染', async () => {
+    await click('title');
+    await phone.locator('[data-field="title"]').fill('   ');
+    await phone.locator('[data-form="title"] button[type="submit"]').click();
+    assert.equal(await phone.locator('.form-error').textContent(), '名称不能为空');
+    await click('suggest-title');
+    assert.equal(await phone.locator('.candidate').count(), 2);
+    await click('use-title');
+    await phone.locator('[data-field="title"]').fill('<img src=x onerror=alert(1)>');
+    await phone.locator('[data-form="title"] button[type="submit"]').click();
+    assert.equal(await phone.locator('.appbar h2').textContent(), '<img src=x onerror=alert(1)>');
+    assert.equal(await phone.locator('img').count(), 0);
+    await click('title');
+    await phone.locator('[data-field="title"]').fill('季度经营复盘报告');
+    await phone.locator('[data-form="title"] button[type="submit"]').click();
+  });
+  await check('Enter 换行、IME 安全和同一数字生命不同会话草稿隔离', async () => {
+    const draft = phone.locator('[data-field="draft"]');
+    await draft.fill('第一行');
+    await draft.press('Enter');
+    await draft.pressSequentially('第二行');
+    assert.equal(await draft.inputValue(), '第一行\n第二行');
+    await draft.dispatchEvent('keydown', { key: 'Enter', isComposing: true });
+    assert.equal(await phone.locator('.user-message').count(), 1);
+    await click('activity');
+    await click('chat', '[data-id="c6"]');
+    assert.equal(await phone.locator('[data-field="draft"]').inputValue(), '');
+    await phone.locator('[data-field="draft"]').fill('另一条 Nova 草稿');
+    await click('activity');
+    await click('chat', '[data-id="c1"]');
+    assert.equal(await phone.locator('[data-field="draft"]').inputValue(), '第一行\n第二行');
+    await click('activity');
+    await shot('preview-switcher.png');
+    await click('close');
+  });
+  await check('附件、本地发送、后台完成提醒与返回结果', async () => {
+    await phone
+      .locator('[data-field="attachment"]')
+      .setInputFiles({ name: '季度资料.txt', mimeType: 'text/plain', buffer: Buffer.from('demo') });
+    assert.equal(await phone.locator('.attachment-chip').count(), 1);
+    await click('send');
+    assert.equal(await phone.locator('[data-field="draft"]').inputValue(), '');
+    assert.equal(await phone.locator('[data-action="send"]').isDisabled(), true);
+    await click('activity');
+    await click('chat', '[data-id="c6"]');
+    await page.waitForTimeout(1400);
+    assert.match(await phone.locator('.toast').textContent(), /已完成/);
+    await phone.locator('.toast [data-action="chat"]').click();
+    assert.equal(await phone.locator('.assistant-card').count(), 2);
+    assert.match(await phone.locator('.assistant-card').last().textContent(), /未请求 AI/);
+  });
+  await check('当前容器快速新建、归档与恢复', async () => {
+    await click('chat-menu');
+    await click('quick-new');
+    assert.equal(await phone.locator('.appbar h2').textContent(), '新对话');
+    assert.match(await phone.locator('.appbar p').textContent(), /Nova/);
+    await click('chat-menu');
+    await click('archive');
+    await click('drawer');
+    await click('archived');
+    assert.match(await phone.locator('.sheet').textContent(), /新对话/);
+    await click('restore');
+    assert.match(await phone.locator('.sheet').textContent(), /没有已归档会话/);
+    await click('close');
+  });
+  await go('contacts');
+  await check('通讯录原有三段筛选、同事展开和容器重命名', async () => {
+    assert.deepEqual(await phone.locator('.segmented button').allTextContents(), [
+      '全部',
+      '数字生命',
+      '同事',
+    ]);
+    await click('contact-filter', '[data-value="people"]');
+    await click('person', '[data-id="p1"]');
+    assert.equal(await phone.locator('.person-children .conversation').count(), 2);
+    await click('agent', '[data-id="nova"]');
+    assert.equal(await phone.locator('.appbar h2').textContent(), '容器设置');
+    assert.equal(await phone.locator('.tabbar').count(), 0);
+    await click('rename-agent');
+    await phone.locator('[data-field="agent-name"]').fill('Nova 分析助手');
+    await phone.locator('[data-form="agent"] button[type="submit"]').click();
+    assert.match(await phone.locator('.settings-card').textContent(), /Nova 分析助手/);
+  });
+  await go('workbench');
+  await check('工作台原有状态筛选、指标缺失与通道充值入口', async () => {
+    assert.deepEqual(await phone.locator('.segmented button').allTextContents(), [
+      '全部',
+      '在线',
+      '离线',
+    ]);
+    assert.equal(await phone.locator('.life-card').count(), 5);
+    await click('work-filter', '[data-value="offline"]');
+    assert.equal(await phone.locator('.life-card').count(), 1);
+    assert.match(await phone.locator('.life-card').textContent(), /指标未上报/);
+    await click('enter-agent');
+    assert.match(await phone.locator('.toast').textContent(), /当前离线/);
+    await click('channel');
+    assert.match(await phone.locator('.sheet').textContent(), /不修改通道配置/);
+    await click('close');
+    await click('recharge');
+    assert.match(await phone.locator('.sheet').textContent(), /不会产生支付/);
+    await click('close');
+    await click('work-filter', '[data-value="all"]');
+  });
+  await shot('preview-workbench.png');
+  await go('mine');
+  await check('保留四套配色、深色、字号和脱敏 Token', async () => {
+    assert.equal(await phone.locator('.palette-grid button').count(), 4);
+    assert.equal(await phone.locator('[data-action="copy-token"]').isDisabled(), true);
+    await click('token');
+    assert.match(await phone.locator('.settings-card').first().textContent(), /NOT-A-REAL/);
+    await click('palette', '[data-id="ice"]');
+    assert.equal(await phone.getAttribute('data-palette'), 'ice');
+    await click('dark');
+    assert.match(await phone.getAttribute('class'), /dark/);
+    await phone.locator('[data-field="font"]').fill('17');
+    assert.equal(
+      await phone.evaluate((element) => element.style.getPropertyValue('--chat-size')),
+      '17px',
+    );
+    await page.reload();
+    assert.match(await phone.getAttribute('class'), /dark/);
+    await click('dark');
+    await click('palette', '[data-id="platinum"]');
+    await phone.locator('[data-field="font"]').fill('14');
+  });
+  await go('messages');
+  await check('侧栏焦点约束、Escape 关闭与原型提醒', async () => {
+    await click('drawer');
+    assert.equal(await phone.locator('.app-shell').getAttribute('inert'), '');
+    await shot('preview-drawer.png');
+    const focusable = phone.locator('.drawer button');
+    await focusable.last().focus();
+    await page.keyboard.press('Tab');
+    assert.equal(
+      await focusable.first().evaluate((element) => element === document.activeElement),
+      true,
+    );
+    await page.keyboard.press('Escape');
+    assert.equal(await phone.locator('.overlay').count(), 0);
+    await click('chat', '[data-id="c1"]');
+    await click('activity');
+    await click('demo-complete');
+    assert.match(await phone.locator('.toast').textContent(), /演示/);
+  });
+  await check('新建入口保留品牌与起始输入', async () => {
+    await go('home');
+    assert.equal(await phone.locator('.home-logo').textContent(), 'fmode');
+    await phone.locator('[data-field="draft"]').fill('帮我做一份报告');
+    await click('send');
+    await click('create-chat', '[data-id="nova"]');
+    assert.equal(await phone.locator('[data-field="draft"]').inputValue(), '帮我做一份报告');
+  });
+  await check('响应式布局、横向溢出与固定输入区', async () => {
+    let screens = 0;
+    for (const [width, height] of [
+      [320, 640],
+      [375, 667],
+      [390, 844],
+      [430, 932],
+      [768, 1024],
+      [1440, 1130],
+    ]) {
+      await page.setViewportSize({ width, height });
+      for (const route of [
+        'messages',
+        'chat/c1',
+        'contacts',
+        'workbench',
+        'mine',
+        'home',
+        'agent/nova',
+      ]) {
+        await go(route);
+        assert.equal(
+          await page.evaluate(() => document.documentElement.scrollWidth > innerWidth),
+          false,
+          `document ${width} ${route}`,
+        );
+        const overflow = await phone.evaluate(
+          (element) => element.scrollWidth > element.clientWidth,
+        );
+        assert.equal(overflow, false, `phone ${width} ${route}`);
+        if (route === 'chat/c1') {
+          const geometry = await phone.evaluate((element) => ({
+            phone: element.getBoundingClientRect().bottom,
+            send: element.querySelector('.send-button').getBoundingClientRect().bottom,
+            scroll: element.querySelector('.page-content').clientHeight,
+          }));
+          assert.ok(geometry.send <= geometry.phone, `send ${width}`);
+          assert.ok(geometry.scroll > 150, `chat height ${width}`);
+        }
+        screens++;
+      }
+    }
+    console.log(`  ${screens} viewport/route combinations checked`);
+  });
+  await page.evaluate(() => localStorage.clear());
+  await page.reload();
+  await go('messages');
+  await shot('preview-comparison.png');
+  await go('chat/c1');
+  await shot('preview-chat-comparison.png');
+  await page.setViewportSize({ width: 390, height: 844 });
+  await go('messages');
+  await shot('preview-messages.png');
+  await go('chat/c1');
+  await shot('preview-chat.png');
+  await go('workbench');
+  await shot('preview-workbench.png');
+  await go('contacts');
+  await shot('preview-contacts.png');
+  await go('mine');
+  await shot('preview-mine.png');
+  await go('home');
+  await shot('preview-home.png');
+  await go('chat/c1');
+  await click('activity');
+  await shot('preview-switcher.png');
+  await click('close');
+  await click('back');
+  await click('drawer');
+  await shot('preview-drawer.png');
+  await click('close');
+  await check('无脚本错误、无外部网络请求', async () => {
+    assert.deepEqual(errors, []);
+    assert.deepEqual(requests, []);
+  });
+  console.log(`PASS: ${checks} interaction groups; standalone offline prototype verified.`);
+} finally {
+  await browser.close();
+}

+ 42 - 0
prototypes/mobile-refresh-20261116/DESIGN.md

@@ -0,0 +1,42 @@
+# fmode 移动协作体验提案
+
+本原型独立于 Angular;不调用真实接口,不迁移业务代码,不申请通知权限,不发起支付。
+
+## 设计基线
+
+以用户提供的《fmode-app 手机端操作体验优化方案》(2026-11-13)为需求参考,以当前仓库实现为事实依据。参考中的 `mobile/views/*` 等路径不是当前工程结构,不能照单施工。
+
+重点从「装饰性首页」转向「多条会话的移动协作」:知道谁在工作、切换正在处理的事情、带着草稿回来。
+
+## 设计取舍
+
+- 任务切换放在输入坞上沿的独立状态栏,而非挤在发送按钮旁。保持底部拇指可达,并减少误发送。
+- 命名为「协作动态」,是现有会话状态的聚合视图,不恢复已关闭的全局任务、项目、事件或成果入口。
+- 在线状态属于数字生命;进行中、待关注、已完成属于具体会话,不能混为同一个绿点。
+- 用状态图形、文字和颜色共同表达,异常不闪烁。进行中动效尊重减少动态效果偏好。
+- 列表保留现有全部、未读、工作区筛选;侧栏增加最近 / 按数字生命的查看维度,避免把数字生命和工作区堆成多级树。
+- 标题可以直接点开编辑。重新生成只预览候选标题,确认后才保存;人工标题不自动覆盖。真实自动总结涉及服务调用和成本,不能当成纯 UI 改动偷偷接入。
+- 输入区 Enter 换行,只有显式发送按钮提交;不按鼠标或触摸设备推测发送习惯。
+- 在当前数字生命中新建对话独立于附件按钮;沿用同一数字生命和所在工作区,不要求重复选择。
+- 草稿以会话 ID 为键,而非 agentId,避免同一数字生命下多条会话互相覆盖。
+- 完成提示只由明确完成事件触发,不因关闭面板、切换页面或超时而伪造完成。
+
+## 当前仓库对应关系
+
+| 需求                 | 当前代码与边界                                                                                                                       |
+| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
+| 回车换行、输入布局   | `src/app/mobile/components/m-dock/m-dock.ts`,当前已是 textarea,但 Enter 仍提交                                                     |
+| 多会话展示与导航     | `src/app/core/mobile-chat-view.service.ts`、`src/app/core/chat-session.service.ts`、`src/app/mobile/components/m-drawer/m-drawer.ts` |
+| 状态、完成提示       | `src/app/core/task-pulse.service.ts`、`src/app/mobile/pages/chat/chat.ts`;已经有状态脉冲与通知,不另建相互冲突的状态源              |
+| 当前数字生命快捷新建 | `m-drawer` 已有 quickNew 能力、chat 页已有 newChatInCurrent;优化可达入口,不重造建房逻辑                                            |
+| 标题编辑             | 复用会话目录重命名能力;LLM 自动重总结单独确认后再评估                                                                               |
+| 文件、成果与任务     | 保留会话内四标签面板;`fetchTasks` 云函数未实现,不能承诺真实跨会话任务聚合现成可用                                                  |
+| 全局导航             | 保留会话、通讯录、工作台、我的;不恢复已下线的群聊、全局任务等入口                                                                   |
+
+## 演示与真实能力
+
+状态、消息、标题候选、文件预览与完成提醒全部是明确标注的本地演示。可模拟其他会话完成,但不接入服务端。附件只保留本地 File 引用与文件名,不读取或上传。外观偏好使用原型专属 localStorage 键,草稿只在当前页面内按会话保存;刷新不保留聊天与附件。
+
+## 需要确认的迁移项
+
+本轮只用于确认视觉、导航与手感。自动标题总结策略、跨会话状态粒度和后台完成跳转,需要在正式迁移前核对数据契约与状态可靠性。不能把演示计时器带入生产状态机。

+ 56 - 0
prototypes/mobile-refresh-20261116/README.md

@@ -0,0 +1,56 @@
+# fmode 移动端协作体验原型
+
+本轮只新增独立 HTML 原型,不修改 `src/`、接口、路由配置、登录态或生产数据。以 2026-11-13 的需求网页为参考,结合当前仓库实际能力重新设计,而不是照抄效果图。
+
+## 预览
+
+- 双击 `mobile-preview.html` 即可离线打开,无需安装依赖或登录。
+- 桌面端显示手机预览与设计说明;手机宽度显示真实全屏布局。
+- 本地 HTTP 预览:在项目根目录执行 `node prototypes/mobile-refresh-20261116/preview.mjs`,打开 `http://127.0.0.1:4176/mobile-preview.html#/chat/c1`。
+- 服务只监听本机,未发布到公网;如果 4176 被占用,可通过 `PORT` 环境变量指定其他端口。
+
+## 建议这样体验
+
+1. 打开沉浸式协作,点输入坞右上方「2 个进行中」,查看进行中 / 待关注 / 已完成,搜索并直接切换。
+2. 在一条会话输入未发送的草稿,切到同一个数字生命的另一条会话,再回来检查草稿。
+3. 点标题编辑,生成一个演示候选标题;取消不保存,手动保存后同步到列表。
+4. 点输入坞左上方「新对话 · 小禾」,直接在当前数字生命和工作区中新建,旧会话不受影响。
+5. 输入多行内容:Enter 换行,只有发送按钮提交;附件只显示本地文件名,不读取或上传。
+6. 在协作面板底部点「模拟完成提醒」,通过提醒跳到对应会话;面板支持向下拖动关闭。
+7. 打开侧栏,体验「最近 / 数字生命 / 工作区」三个正交视图。工作区仍默认折叠,支持新建、改名、移动、归档与删除确认。
+8. 通过四栏导航体验通讯录、工作台、我的;在我的页面可切换深色、四种配色、正文字号,以及预览加载 / 空态 / 错误重试。
+
+## 本轮设计判断
+
+- 切换入口靠近拇指,但与发送按钮分层,减少误触;附件与新建对话也使用不同图标和位置。
+- 会话状态不等于分身在线状态。通过图形、文字与颜色共同表达,不靠大面积红绿或持续闪烁。
+- 保留当前四栏导航和工作区,不恢复已经下线的全局任务、项目、事件、成果及群聊入口。
+- 不按参考文档直接加入自动标题总结调用。候选标题只做本地演示,自动总结时机、成本与人工标题保护需要另行确认。
+- 详情面板仍保留任务 / 文件 / 成果 / 状态。下载入口明确为 TXT 演示稿,不伪装真实 DOCX 下载。
+
+详细需求取舍、实际代码映射与迁移边界见 `DESIGN.md`。
+
+## 验证
+
+从项目根目录执行:
+
+```powershell
+node prototypes/mobile-refresh-20261116/verify.mjs
+```
+
+使用项目已有的 Playwright 与本机 Chrome。可用 `PLAYWRIGHT_CHANNEL=msedge` 切换至 Edge。
+
+覆盖:Enter 换行与输入法保护、同分身多会话草稿隔离、协作筛选与跳转、标题候选取消与保存、当前分身快捷新建、附件与消息转义、模态焦点约束与拖动关闭、文件预览、完成跳转、工作区去重与安全删除、偏好隔离、加载 / 错误重试,以及 320 / 360 / 390 / 430 / 768 / 1440 宽度的六类页面。
+
+截图由验证脚本生成。浏览器自动化不能替代真实 iOS / Android 的软键盘、安全区、系统返回键、通知权限与长会话性能验收,正式迁移前需要真机回归。
+
+## 文件
+
+- `mobile-preview.html`:可直接交付的单文件离线版。
+- `index.html`、`styles.css`、`app.js`:便于后续迭代的源文件。
+- `build-single.mjs`:重新生成离线版。
+- `preview.mjs`:仅本机静态预览服务。
+- `verify.mjs`:独立原型的浏览器验证脚本。
+- `preview-*.png`:页面与交互截图。
+
+外观偏好只写原型专属的 `fmode_mobile_proposal_v1`。会话、草稿与附件只存在当前页面内,刷新即恢复演示数据;不承诺断电或刷新后的草稿持久化。

+ 1395 - 0
prototypes/mobile-refresh-20261116/app.js

@@ -0,0 +1,1395 @@
+const icons = {
+  menu: '<path d="M4 7h16M4 12h11M4 17h16"/>',
+  flower: Array.from(
+    { length: 8 },
+    (_, index) =>
+      `<ellipse cx="12" cy="7.3" rx="2.15" ry="4.6" transform="rotate(${index * 45} 12 12)"/>`,
+  ).join(''),
+  'arrow-right': '<path d="M5 12h14m-5-5 5 5-5 5"/>',
+  'arrow-up': '<path d="M12 19V5m-6 6 6-6 6 6"/>',
+  back: '<path d="m14 5-7 7 7 7"/>',
+  chevron: '<path d="m8 10 4 4 4-4"/>',
+  right: '<path d="m9 6 6 6-6 6"/>',
+  plus: '<path d="M12 5v14M5 12h14"/>',
+  close: '<path d="m6 6 12 12M6 18 18 6"/>',
+  chat: '<path d="M20 11.5a7.7 7.7 0 0 1-8 7.5 9 9 0 0 1-3-.5L4 20l1.5-4.5A7.2 7.2 0 0 1 4 11.5a8 8 0 0 1 16 0Z"/><path d="M8 10h8M8 14h5"/>',
+  edit: '<path d="M12 4H4v16h16v-8M10 14l1-4L19 2l3 3-8 8Z"/>',
+  search: '<circle cx="10.5" cy="10.5" r="6.5"/><path d="m16 16 4 4"/>',
+  people:
+    '<circle cx="9" cy="8" r="3"/><path d="M3 20v-3a6 6 0 0 1 12 0v3m1-15a3 3 0 0 1 0 6m2 3a5 5 0 0 1 3 4v2"/>',
+  grid: '<rect x="4" y="4" width="6" height="6" rx="1.5"/><rect x="14" y="4" width="6" height="6" rx="1.5"/><rect x="4" y="14" width="6" height="6" rx="1.5"/><rect x="14" y="14" width="6" height="6" rx="1.5"/>',
+  user: '<circle cx="12" cy="8" r="4"/><path d="M4 21v-2a8 8 0 0 1 16 0v2"/>',
+  more: '<circle cx="5" cy="12" r=".9"/><circle cx="12" cy="12" r=".9"/><circle cx="19" cy="12" r=".9"/>',
+  folder: '<path d="M3 7a2 2 0 0 1 2-2h5l2 3h7a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z"/>',
+  archive: '<rect x="3" y="4" width="18" height="4" rx="1"/><path d="M5 8v12h14V8M10 12h4"/>',
+  file: '<path d="M14 3H5v18h14V8Zm0 0v6h5M8 13h8M8 17h6"/>',
+  clip: '<path d="m8 13 7-7a3 3 0 0 1 4 4L9 20a5 5 0 0 1-7-7L13 2"/>',
+  check: '<path d="m5 12 4 4L19 6"/>',
+  shield: '<path d="m12 3 8 3v6c0 5-8 9-8 9s-8-4-8-9V6Z"/><path d="m8 12 3 3 5-6"/>',
+  copy: '<rect x="8" y="8" width="12" height="13" rx="2"/><path d="M15 8V3H3v13h5"/>',
+  moon: '<path d="M20 14A8 8 0 0 1 10 4a8.5 8.5 0 1 0 10 10Z"/>',
+  bell: '<path d="M5 17h14l-2-4V9a5 5 0 0 0-10 0v4Zm5 3h4"/>',
+  key: '<circle cx="8" cy="9" r="5"/><path d="m12 13 8 8m-4-4 3-3"/>',
+  eye: '<path d="M2 12s4-7 10-7 10 7 10 7-4 7-10 7S2 12 2 12Z"/><circle cx="12" cy="12" r="3"/>',
+  logout: '<path d="M10 4H4v16h6m5-12 5 4-5 4m-6-4h11"/>',
+  link: '<path d="m9 15 6-6m-4-3 2-2a5 5 0 0 1 7 7l-2 2m-5 5-2 2a5 5 0 0 1-7-7l2-2"/>',
+  wallet: '<rect x="3" y="5" width="18" height="15" rx="2"/><path d="M3 8h18m-5 4h5v5h-5Z"/>',
+  trash: '<path d="M3 6h18M9 6V3h6v3M5 6l1 15h12l1-15M10 10v7m4-7v7"/>',
+  download: '<path d="M12 3v12m-5-5 5 5 5-5M4 16v5h16v-5"/>',
+  spark: '<path d="m12 3 2.5 6.5L21 12l-6.5 2.5L12 21l-2.5-6.5L3 12l6.5-2.5Z"/>',
+  wifi: '<path d="M3 8a15 15 0 0 1 18 0M6 12a10 10 0 0 1 12 0M9 16a5 5 0 0 1 6 0"/><circle cx="12" cy="20" r=".7"/>',
+  signal: '<path d="M4 19v-3m5 3v-6m5 6V9m5 10V5" stroke-width="2.8"/>',
+  battery:
+    '<rect x="2" y="6" width="18" height="12" rx="3"/><path d="M22 10v4M5 9h12v6H5Z" fill="currentColor" stroke="none"/>',
+};
+const icon = (name, className = '') =>
+  `<svg class="${className}" viewBox="0 0 24 24" aria-hidden="true">${icons[name] || icons.spark}</svg>`;
+const esc = (value) =>
+  String(value).replace(
+    /[&<>"']/g,
+    (character) =>
+      ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[character],
+  );
+const ib = (name, label, action, extra = '') =>
+  `<button class="icon-button" aria-label="${esc(label)}" data-action="${action}" ${extra}>${icon(name)}</button>`;
+const agents = [
+  {
+    id: 'a1',
+    name: '小禾',
+    role: '研究与写作伙伴',
+    tone: '',
+    online: true,
+    cpu: '12%',
+    memory: '328 MB',
+    balance: '128.60',
+    task: '正在整理产品体验调研',
+    symbol: 'flower',
+  },
+  {
+    id: 'a2',
+    name: '阿澈',
+    role: '开发与技术伙伴',
+    tone: 'clay',
+    online: true,
+    cpu: '8%',
+    memory: '256 MB',
+    balance: '86.20',
+    task: '等待新的协作指令',
+    symbol: 'grid',
+  },
+  {
+    id: 'a3',
+    name: '知夏',
+    role: '设计与创意伙伴',
+    tone: 'lilac',
+    online: false,
+    cpu: '—',
+    memory: '—',
+    balance: '42.00',
+    task: '当前离线,连接恢复后继续协作',
+    symbol: 'spark',
+  },
+];
+const conversations = [
+  {
+    id: 'c1',
+    title: '把产品的第一印象做好',
+    agentId: 'a1',
+    preview: '我整理了三个可以落地的优化方向。',
+    time: '刚刚',
+    group: '今天',
+    workspace: 'w1',
+    unread: 2,
+    archived: false,
+  },
+  {
+    id: 'c2',
+    title: '官网首页的灵感与参考',
+    agentId: 'a3',
+    preview: '留白、秩序,以及一点点恰好的温度。',
+    time: '10:24',
+    group: '今天',
+    workspace: 'w1',
+    unread: 0,
+    archived: false,
+  },
+  {
+    id: 'c3',
+    title: '梳理一下这周的工作',
+    agentId: 'a1',
+    preview: '已按优先级整理好,随时可以继续。',
+    time: '昨天',
+    group: '昨天',
+    workspace: null,
+    unread: 0,
+    archived: false,
+  },
+  {
+    id: 'c4',
+    title: '登录接口联调记录',
+    agentId: 'a2',
+    preview: '接口参数和错误处理已经检查完毕。',
+    time: '昨天',
+    group: '昨天',
+    workspace: 'w2',
+    unread: 1,
+    archived: false,
+  },
+  {
+    id: 'c5',
+    title: '一些还没成形的小想法',
+    agentId: 'a1',
+    preview: '我们可以从一个最小的版本开始。',
+    time: '周五',
+    group: '更早',
+    workspace: null,
+    unread: 0,
+    archived: false,
+  },
+  {
+    id: 'c6',
+    title: '上一版品牌文案',
+    agentId: 'a1',
+    preview: '品牌文案讨论已归档。',
+    time: '11/08',
+    group: '更早',
+    workspace: 'w1',
+    unread: 0,
+    archived: true,
+  },
+];
+let workspaces = [
+  { id: 'w1', name: '产品与灵感' },
+  { id: 'w2', name: '研发协作' },
+];
+const messages = new Map();
+const collaboration = new Map([
+  ['c1', { kind: 'done', label: '体验优化建议已交付', elapsed: '刚刚完成' }],
+  ['c2', { kind: 'attention', label: '连接中断,等待恢复', elapsed: '需要关注' }],
+  ['c3', { kind: 'running', label: '正在整理本周的优先级', elapsed: '已进行 2 分钟' }],
+  ['c4', { kind: 'running', label: '正在检查接口返回结果', elapsed: '已进行 45 秒' }],
+  ['c5', { kind: 'idle', label: '等待新的想法', elapsed: '空闲' }],
+]);
+const activityNames = { running: '进行中', attention: '待关注', done: '已完成', idle: '空闲' };
+const drafts = new Map();
+const draftKey = () => (state.page === 'chat' ? state.currentId : 'home');
+function saveDraft() {
+  if (['home', 'chat'].includes(state.page))
+    drafts.set(draftKey(), { text: state.draft, files: [...state.attachments] });
+}
+function restoreDraft() {
+  const draft = drafts.get(draftKey());
+  state.draft = draft?.text || '';
+  state.attachments = [...(draft?.files || [])];
+}
+let preferences = { dark: false, palette: 'forest', font: 14 };
+try {
+  preferences = {
+    ...preferences,
+    ...JSON.parse(localStorage.getItem('fmode_mobile_proposal_v1') || '{}'),
+  };
+} catch {}
+const state = {
+  page: 'home',
+  currentId: 'c1',
+  agentId: null,
+  draft: '',
+  attachments: [],
+  filter: 'all',
+  contactFilter: 'agents',
+  agentFilter: 'all',
+  keyword: '',
+  expanded: new Set(),
+  drawerExpanded: new Set(),
+  pendingSend: false,
+  newWorkspace: null,
+  generating: false,
+  disconnected: false,
+  tokenVisible: false,
+  drawerView: 'recent',
+  activityFilter: 'all',
+  activityKeyword: '',
+  ...preferences,
+};
+const main = document.querySelector('#main'),
+  header = document.querySelector('#app-header'),
+  composerArea = document.querySelector('#composer-area'),
+  tabbar = document.querySelector('#tabbar'),
+  overlay = document.querySelector('#overlay-root'),
+  app = document.querySelector('#app');
+let returnFocus, toastTimer, generationTimer;
+const getAgent = (agentId) => agents.find((agent) => agent.id === agentId) || agents[0];
+const getConversation = (identifier = state.currentId) =>
+  conversations.find((conversation) => conversation.id === identifier);
+const avatar = (agent) => `<span class="avatar ${agent.tone}">${icon(agent.symbol)}</span>`;
+const activeConversations = () => conversations.filter((conversation) => !conversation.archived);
+const navItems = [
+  ['messages', 'chat', '会话'],
+  ['contacts', 'people', '通讯录'],
+  ['workbench', 'grid', '工作台'],
+  ['mine', 'user', '我的'],
+];
+const emptyState = (title, description = '', symbol = 'search') =>
+  `<div class="empty-state">${icon(symbol)}<strong>${title}</strong><p>${description}</p></div>`;
+const tabs = (items, active, action) =>
+  `<div class="segmented" aria-label="筛选">${items.map(([value, label]) => `<button data-action="${action}" data-value="${value}" aria-pressed="${value === active}" class="${value === active ? 'active' : ''}">${label}</button>`).join('')}</div>`;
+const searchField = (placeholder, action = 'search', value = '') =>
+  `<label class="search-field">${icon('search')}<input type="search" aria-label="${placeholder}" placeholder="${placeholder}" data-input="${action}" value="${esc(value)}" /></label>`;
+const navigation = () =>
+  navItems
+    .map(
+      ([page, symbol, label]) =>
+        `<button data-action="navigate" data-page="${page}" class="${state.page === page ? 'active' : ''}" ${state.page === page ? 'aria-current="page"' : ''}><span>${icon(symbol)}</span><span>${label}</span></button>`,
+    )
+    .join('');
+function applyPreferences() {
+  const device = document.querySelector('#device');
+  device.classList.toggle('dark', state.dark);
+  const palettes = {
+    forest: ['#386b52', '#eaf1e8', '#a4c59a', '#303f30'],
+    blue: ['#496a96', '#eaf0f8', '#a5bde0', '#2e3c50'],
+    purple: ['#806495', '#f0eaf5', '#c9acdf', '#403349'],
+    amber: ['#9a7641', '#f4efdf', '#ddc195', '#443a27'],
+  };
+  const palette = palettes[state.palette] || palettes.forest;
+  device.style.setProperty('--accent', palette[state.dark ? 2 : 0]);
+  device.style.setProperty('--tint', palette[state.dark ? 3 : 1]);
+  device.style.setProperty('--chat-font', `${state.font}px`);
+  try {
+    localStorage.setItem(
+      'fmode_mobile_proposal_v1',
+      JSON.stringify({ dark: state.dark, palette: state.palette, font: state.font }),
+    );
+  } catch {}
+}
+function navigate(page, identifier) {
+  const destination =
+    page === 'chat'
+      ? `#/chat/${identifier || state.currentId}`
+      : page === 'agent'
+        ? `#/agent/${identifier}`
+        : `#/${page}`;
+  if (location.hash === destination) readRoute();
+  else location.hash = destination;
+}
+function readRoute() {
+  saveDraft();
+  const [page = 'home', identifier] = location.hash.replace(/^#\/?/, '').split('/');
+  state.page = ['home', 'chat', 'messages', 'contacts', 'workbench', 'mine', 'agent'].includes(page)
+    ? page
+    : 'home';
+  if (state.page === 'chat') {
+    const conversation = getConversation(identifier);
+    if (conversation) {
+      state.currentId = identifier;
+      conversation.unread = 0;
+    } else state.page = 'messages';
+  }
+  if (state.page === 'agent') state.detailAgentId = identifier;
+  state.keyword = '';
+  restoreDraft();
+  closeOverlay();
+  render();
+  main.scrollTop = 0;
+}
+function render() {
+  const conversation = getConversation(),
+    agent = getAgent(conversation?.agentId);
+  if (state.page === 'chat')
+    header.innerHTML = `${ib('menu', '打开会话侧栏', 'drawer')}<div class="header-center"><button class="header-title" data-action="edit-current-title" aria-label="编辑会话标题:${esc(conversation.title)}"><strong>${esc(conversation.title)}</strong>${icon('edit')}</button><small>${esc(agent.name)}<span class="subtitle-separator">/</span><span class="activity-text ${collaboration.get(conversation.id)?.kind || 'idle'}">${activityNames[collaboration.get(conversation.id)?.kind || 'idle']}</span></small></div>${ib('more', '会话详情', 'details')}`;
+  else if (state.page === 'home')
+    header.innerHTML = `${ib('menu', '打开会话侧栏', 'drawer')}<div class="header-brand">${icon('flower')}<strong>fmode</strong></div><button class="profile-button" data-action="navigate" data-page="mine" aria-label="我的">林</button>`;
+  else if (state.page === 'agent')
+    header.innerHTML = `${ib('back', '返回通讯录', 'navigate', 'data-page="contacts"')}<strong class="page-title">数字生命设置</strong>`;
+  else
+    header.innerHTML = `${ib('menu', '打开会话侧栏', 'drawer')}<strong class="page-title">${navItems.find(([page]) => page === state.page)?.[2]}</strong>${state.page === 'messages' ? ib('edit', '新建对话', 'new-chat') : '<span style="width:44px"></span>'}`;
+  ({
+    home: renderHome,
+    chat: renderChat,
+    messages: renderMessages,
+    contacts: renderContacts,
+    workbench: renderWorkbench,
+    mine: renderMine,
+    agent: renderAgent,
+  })[state.page]();
+  if (state.page === 'chat' && messages.get(state.currentId)?.length === 0) {
+    main.innerHTML = `<section class="screen blank-chat"><div class="blank-chat-mark">${icon(agent.symbol)}</div><h1>新的想法,直接说。</h1><p>正在和 ${esc(agent.name)} 对话<br />${esc(workspaces.find((workspace) => workspace.id === conversation.workspace)?.name || '日常对话')} · 不影响之前的会话</p></section>`;
+  }
+  if (state.page === 'mine')
+    main
+      .querySelector('.version-text')
+      .insertAdjacentHTML(
+        'beforeend',
+        '<br /><button class="text-button" data-action="preview-states">查看加载与反馈状态 · 原型专用</button>',
+      );
+  tabbar.innerHTML = ['messages', 'contacts', 'workbench', 'mine'].includes(state.page)
+    ? navigation()
+    : '';
+  if (['home', 'chat'].includes(state.page)) renderComposer();
+  else composerArea.innerHTML = '';
+  document
+    .querySelectorAll('[data-scene]')
+    .forEach((button) => button.classList.toggle('active', button.dataset.scene === state.page));
+  applyPreferences();
+}
+function renderHome() {
+  main.innerHTML = `<section class="screen home-screen"><div class="home-hero"><div class="hero-art">${icon('flower')}</div><div class="overline">每一个想法,都值得被认真对待</div><h1>让想法,<br />再往前一步。</h1><p>写下想做的事,和你的数字生命一起完成。</p></div><div class="prompts"><button class="prompt" data-action="prompt" data-value="帮我梳理一下这周的工作安排">${icon('file')}梳理思路</button><button class="prompt" data-action="prompt" data-value="帮我写一份产品体验优化方案">${icon('edit')}写点什么</button><button class="prompt" data-action="prompt" data-value="帮我找几个官网设计的灵感方向">${icon('spark')}找点灵感</button></div><div class="recent-block"><div class="section-label"><span>接着上次的想法</span><button class="text-button" data-action="navigate" data-page="messages">全部会话 ${icon('arrow-right')}</button></div>${activeConversations()
+    .slice(0, 2)
+    .map(
+      (conversation) =>
+        `<button class="recent-row" data-action="open-chat" data-id="${conversation.id}">${icon('chat')}<span class="row-text"><strong>${esc(conversation.title)}</strong><small>${esc(getAgent(conversation.agentId).name)} · ${esc(workspaces.find((workspace) => workspace.id === conversation.workspace)?.name || '日常对话')}</small></span><time>${conversation.time}</time></button>`,
+    )
+    .join('')}</div></section>`;
+}
+function renderComposer() {
+  const agentId = state.page === 'chat' ? getConversation()?.agentId : state.agentId,
+    agent = agentId ? getAgent(agentId) : null;
+  composerArea.innerHTML = `<div class="composer"><div class="attachment-list">${state.attachments.map((file, index) => `<span class="attachment-chip">${icon('clip')}<span>${esc(file.name)}</span><button aria-label="移除附件 ${esc(file.name)}" data-action="remove-attachment" data-index="${index}">${icon('close')}</button></span>`).join('')}</div><textarea id="draft" rows="1" aria-label="输入消息" placeholder="说说你的想法…" ${state.generating ? 'disabled' : ''}>${esc(state.draft)}</textarea><div class="composer-tools">${ib('plus', '添加附件', 'attach')}<button class="agent-select" data-action="${state.page === 'home' ? 'pick-agent' : 'agent-info'}">${agent ? '<i class="dot ' + (agent.online ? '' : 'offline') + '"></i>' : icon('flower')}<span>${agent ? esc(agent.name) + ' · ' + agent.role : '选择数字生命'}</span>${state.page === 'home' ? icon('chevron') : ''}</button><button class="send-button" aria-label="${state.generating ? '发送中' : '发送消息'}" data-action="send" ${state.generating || (!state.draft.trim() && !state.attachments.length) ? 'disabled' : ''}>${state.generating ? '<span class="typing"><i></i><i></i><i></i></span>' : icon('arrow-up')}</button></div></div><div class="composer-footnote">${state.page === 'home' ? '和数字生命一起,把想法变成现实' : '内容由 AI 生成,请核实重要信息'} · 演示</div>`;
+  if (state.page === 'chat') {
+    const running = activeConversations().filter(
+      (conversation) => collaboration.get(conversation.id)?.kind === 'running',
+    ).length;
+    const attention = activeConversations().filter(
+      (conversation) => collaboration.get(conversation.id)?.kind === 'attention',
+    ).length;
+    composerArea.insertAdjacentHTML(
+      'afterbegin',
+      `<div class="collaboration-rail"><button class="quick-current" data-action="quick-current" aria-label="在当前数字生命 ${esc(agent.name)} 中新建对话">${icon('edit')}<span>新对话</span><span class="quick-agent">· ${esc(agent.name)}</span></button><button class="activity-entry" data-action="activity" aria-label="切换协作,${running} 个进行中,${attention} 个待关注"><span class="activity-orbit ${running ? 'running' : ''}"></span><span>${running ? running + ' 个进行中' : '协作动态'}</span>${attention ? `<span class="attention-count">${attention}</span>` : ''}${icon('chevron')}</button></div>`,
+    );
+  }
+  const textarea = document.querySelector('#draft');
+  textarea.setAttribute('enterkeyhint', 'enter');
+  textarea.style.height = 'auto';
+  textarea.style.height = `${Math.min(textarea.scrollHeight, 116)}px`;
+}
+function conversationRow(conversation) {
+  const agent = getAgent(conversation.agentId);
+  return `<article class="conversation-row"><button class="conversation-open" data-action="open-chat" data-id="${conversation.id}">${avatar(agent)}<span class="conversation-body"><span class="conversation-top"><strong>${esc(conversation.title)}</strong><time>${conversation.time}</time></span><p>${esc(conversation.preview)}</p><span class="conversation-meta">${esc(agent.name)}${conversation.workspace ? ' · ' + esc(workspaces.find((workspace) => workspace.id === conversation.workspace)?.name || '工作区') : ''}<span class="inline-activity ${collaboration.get(conversation.id)?.kind || 'idle'}">${activityNames[collaboration.get(conversation.id)?.kind || 'idle']}</span>${conversation.unread ? `<span class="unread">${conversation.unread}</span>` : ''}</span></span></button><button class="row-more" data-action="conversation-menu" data-id="${conversation.id}" aria-label="${esc(conversation.title)} 更多操作">${icon('more')}</button></article>`;
+}
+function renderMessages() {
+  main.innerHTML = `<section class="screen"><p class="page-subtitle">每一次对话,都是想法向前的一步。</p>${searchField('搜索会话或数字生命', 'search', state.keyword)}${tabs(
+    [
+      ['all', '全部'],
+      ['unread', '未读'],
+      ['workspace', '工作区'],
+    ],
+    state.filter,
+    'message-filter',
+  )}<div id="conversation-results">${conversationResults()}</div></section>`;
+}
+function conversationResults() {
+  const keyword = state.keyword.trim().toLowerCase(),
+    filtered = activeConversations().filter(
+      (conversation) =>
+        (state.filter !== 'unread' || conversation.unread > 0) &&
+        `${conversation.title} ${getAgent(conversation.agentId).name}`
+          .toLowerCase()
+          .includes(keyword),
+    );
+  if (state.filter === 'workspace')
+    return `<button class="text-button" data-action="create-workspace">${icon('plus')} 新建工作区</button>${workspaces
+      .map((workspace) => {
+        const rows = filtered.filter((conversation) => conversation.workspace === workspace.id);
+        if (keyword && !rows.length && !workspace.name.includes(keyword)) return '';
+        return `<section class="workspace"><header class="workspace-head"><button class="workspace-toggle" data-action="toggle-workspace" data-id="${workspace.id}" aria-expanded="${state.expanded.has(workspace.id)}" aria-controls="workspace-${workspace.id}">${icon(state.expanded.has(workspace.id) ? 'chevron' : 'right')}${icon('folder')} ${esc(workspace.name)}<small>${rows.length}</small></button>${ib('plus', '在 ' + workspace.name + ' 中新建对话', 'workspace-chat', `data-id="${workspace.id}"`)}${ib('more', workspace.name + ' 更多操作', 'workspace-menu', `data-id="${workspace.id}"`)}</header><div id="workspace-${workspace.id}" ${state.expanded.has(workspace.id) || keyword ? '' : 'hidden'}>${rows.length ? rows.map(conversationRow).join('') : emptyState('还没有对话', '在这里开始一个新的想法', 'chat')}</div></section>`;
+      })
+      .join('')}`;
+  if (!filtered.length)
+    return emptyState(
+      state.filter === 'unread' ? '未读已清空,安心专注' : '没有找到相关对话',
+      state.filter === 'unread' ? '新的消息会出现在这里。' : '换个关键词再试试。',
+    );
+  return ['今天', '昨天', '更早']
+    .map((group) => {
+      const rows = filtered.filter((conversation) => conversation.group === group);
+      return rows.length
+        ? `<div class="group-heading">${group}</div>${rows.map(conversationRow).join('')}`
+        : '';
+    })
+    .join('');
+}
+const sampleAnswer =
+  '<p>好的。第一印象不一定要做得更满,<br />而是让用户更快地感到:<strong>这里懂我。</strong></p><h2>先把这三件事做好</h2><ul><li><strong>让入口更清楚</strong><br />一个明确的主操作,比同时展示很多功能更有效。</li><li><strong>让阅读更轻松</strong><br />减少卡片边框,拉开段落间距,让内容成为主角。</li><li><strong>让操作有回应</strong><br />无论是发送、等待还是完成,都给出清晰、克制的反馈。</li></ul><blockquote>好的体验,是不用思考下一步该点哪里。</blockquote><p>我把具体建议整理成了一份文档,可以先从首页和对话页开始验证。</p>';
+function sampleMessages(conversation) {
+  if (conversation.id === 'c1')
+    return [
+      { role: 'user', text: '我们来想想,怎么把产品的第一印象做得更好?' },
+      { role: 'assistant', html: sampleAnswer, file: true },
+    ];
+  return [
+    { role: 'user', text: conversation.title },
+    {
+      role: 'assistant',
+      html: `<p>${esc(conversation.preview)}</p><p>这段对话保留在「${esc(workspaces.find((workspace) => workspace.id === conversation.workspace)?.name || '日常对话')}」中,你可以接着补充想法。</p><blockquote>这是界面演示内容,不是真实的历史消息。</blockquote>`,
+    },
+  ];
+}
+function fileCard() {
+  return `<button class="file-card" data-action="preview-file"><span class="file-badge">DOC</span><span><strong>产品初体验优化建议</strong><small>DOCX · 24 KB · 已上传云盘(演示)</small></span>${icon('right')}</button>`;
+}
+function renderChat() {
+  const conversation = getConversation(),
+    agent = getAgent(conversation.agentId);
+  if (!messages.has(conversation.id)) messages.set(conversation.id, sampleMessages(conversation));
+  const rows = messages.get(conversation.id);
+  main.innerHTML = `<section class="screen chat-screen">${state.disconnected ? `<button class="connection-banner" data-action="reconnect">${icon('wifi')}连接已断开,点击重连 ${icon('right')}</button>` : ''}<div class="chat-date">今天 · 10:42</div>${rows.map((message, index) => (message.role === 'user' ? `<div class="user-message"><div class="user-bubble">${esc(message.text).replace(/\n/g, '<br />')}${message.files?.map((name) => `<span class="user-file">${icon('clip')} ${esc(name)}</span>`).join('') || ''}</div></div>` : `<article class="assistant-message"><div class="assistant-heading">${icon(agent.symbol)}<span>${esc(agent.name)}</span><time>演示回复</time></div><details class="process"><summary>${icon('check')} 已完成 ${message.file ? '3' : '2'} 个步骤 · ${message.file ? '12' : '3'} 秒 ${icon('chevron', 'chevron')}</summary><ol><li>理解需求与对话上下文</li><li>整理可执行的建议</li>${message.file ? '<li>生成文档并上传云盘</li>' : ''}</ol></details><div class="assistant-body">${message.html}</div>${message.file ? fileCard() : ''}<div class="message-actions"><button aria-label="复制回复" data-action="copy-message" data-index="${index}">${icon('copy')}</button>${message.file ? `<button aria-label="查看成果文件" data-action="details" data-tab="deliver">${icon('file')}</button>` : ''}<small>AI 生成 · 请核实</small></div></article>`)).join('')}${state.generating && state.generatingId === conversation.id ? '<div class="assistant-heading">' + icon(agent.symbol) + '正在整理你的想法</div><div class="typing" role="status" aria-label="正在生成演示回复"><i></i><i></i><i></i></div>' : ''}</section>`;
+}
+function renderContacts() {
+  main.innerHTML = `<section class="screen">${tabs(
+    [
+      ['agents', '数字生命'],
+      ['coworkers', '同事'],
+    ],
+    state.contactFilter,
+    'contact-filter',
+  )}${searchField('搜索联系人', 'contact-search', state.keyword)}<div id="contact-results">${contactResults()}</div></section>`;
+}
+function contactResults() {
+  if (state.contactFilter === 'coworkers') {
+    const people = [
+      { name: '林一', role: '产品设计 · 我', initial: '林' },
+      { name: '陈序', role: '研发协作', initial: '陈' },
+    ].filter((person) => person.name.includes(state.keyword));
+    return people.length
+      ? `<div class="contact-department">产品与研发 · ${people.length} 人</div>${people.map((person) => `<div class="contact-row"><button data-action="coworker" data-name="${person.name}"><span class="avatar person">${person.initial}</span><span><strong>${person.name}</strong><small>${person.role}</small></span></button>${icon('right')}</div>`).join('')}`
+      : emptyState('没有找到联系人');
+  }
+  const filtered = agents.filter((agent) => `${agent.name} ${agent.role}`.includes(state.keyword));
+  return filtered.length
+    ? `<div class="section-label"><span>我的数字伙伴</span><span>${filtered.length} 位</span></div>${filtered.map((agent) => `<div class="contact-row"><button data-action="open-agent" data-id="${agent.id}">${avatar(agent)}<span><strong>${esc(agent.name)}</strong><small>${agent.role} · ${agent.online ? '在线' : '离线'}</small></span></button>${icon('right')}</div>`).join('')}`
+    : emptyState('没有找到数字生命');
+}
+function renderWorkbench() {
+  main.innerHTML = `<section class="screen"><p class="page-subtitle">伙伴们的工作状态,一眼就知道。</p><div class="overview"><div><strong>3</strong><small>数字生命</small></div><div><strong>2<span style="font-size:12px"> / 3</span></strong><small>在线</small></div><div><strong>1</strong><small>离线</small></div></div>${tabs(
+    [
+      ['all', '全部'],
+      ['online', '在线'],
+      ['offline', '离线'],
+    ],
+    state.agentFilter,
+    'agent-filter',
+  )}${searchField('搜索数字生命', 'agent-search', state.keyword)}<div id="agent-results">${agentResults()}</div></section>`;
+}
+function agentResults() {
+  const filtered = agents.filter(
+    (agent) =>
+      agent.name.includes(state.keyword) &&
+      (state.agentFilter === 'all' || agent.online === (state.agentFilter === 'online')),
+  );
+  return filtered.length
+    ? filtered
+        .map(
+          (agent) =>
+            `<article class="agent-card"><div class="agent-card-head">${avatar(agent)}<div><h2>${esc(agent.name)}</h2><small>${agent.role}</small></div><span class="tag ${agent.online ? '' : 'offline'}">${agent.online ? '在线' : '离线'}</span></div><p class="agent-current">${agent.task}</p><div class="agent-metrics"><span>CPU <b>${agent.cpu}</b></span><span>内存 <b>${agent.memory}</b></span><span>余额 <b>¥${agent.balance}</b></span></div><div class="agent-actions"><button data-action="channels" data-id="${agent.id}">${icon('link')}通道</button><button data-action="recharge" data-id="${agent.id}">${icon('wallet')}充值</button><button data-action="agent-chat" data-id="${agent.id}">进入会话 ${icon('arrow-right')}</button></div></article>`,
+        )
+        .join('')
+    : emptyState('没有匹配的数字生命');
+}
+function renderMine() {
+  main.innerHTML = `<section class="screen"><div class="profile-card"><span class="avatar">林</span><div><h2>林一</h2><p>fmode 体验空间 · 演示账号</p></div></div><section class="settings-group"><h2>外观与阅读</h2><div class="palette-row">${[
+    ['forest', '#386b52', '森林'],
+    ['blue', '#496a96', '湖蓝'],
+    ['purple', '#806495', '暮紫'],
+    ['amber', '#9a7641', '暖砂'],
+  ]
+    .map(
+      ([value, color, label]) =>
+        `<button class="palette-option ${state.palette === value ? 'active' : ''}" style="--swatch:${color}" aria-label="${label}配色" aria-pressed="${state.palette === value}" data-action="palette" data-value="${value}"><span></span></button>`,
+    )
+    .join(
+      '',
+    )}</div><button class="settings-row" data-action="theme" role="switch" aria-checked="${state.dark}">${icon('moon')}深色模式<span class="toggle ${state.dark ? 'on' : ''}"></span></button><button class="settings-row" data-action="font">${icon('file')}对话正文字号<small>${state.font === 14 ? '标准' : state.font === 16 ? '较大' : '大号'}</small>${icon('right')}</button></section><section class="settings-group"><h2>账号与通知</h2><button class="settings-row" data-action="token">${icon('key')}访问 Token<small>仅演示占位</small>${icon('right')}</button><button class="settings-row" data-action="notifications">${icon('bell')}消息与任务通知<small>权限说明</small>${icon('right')}</button><button class="settings-row danger" data-action="logout">${icon('logout')}退出登录${icon('right')}</button></section><div class="version-text">fmode · 人机共生中枢<br />Mobile experience / 01 · 独立体验提案</div></section>`;
+}
+function renderAgent() {
+  const agent = getAgent(state.detailAgentId);
+  main.innerHTML = `<section class="screen"><div class="profile-card">${avatar(agent)}<div><h2>${esc(agent.name)}</h2><p>${agent.role}</p></div></div><section class="settings-group"><h2>容器设置</h2><button class="settings-row" data-action="rename-agent" data-id="${agent.id}">显示名称<small>${esc(agent.name)}</small>${icon('right')}</button><div class="settings-row">连接状态<small>${agent.online ? '在线' : '离线'}</small></div></section><p class="page-subtitle">沿用现有通讯录逻辑:数字生命详情只提供重命名。</p></section>`;
+}
+function openOverlay(html) {
+  if (!overlay.childElementCount) returnFocus = document.activeElement;
+  overlay.innerHTML = html;
+  app.inert = true;
+  requestAnimationFrame(() => {
+    const target = overlay.querySelector('[autofocus]') || overlay.querySelector('button,input,select,summary');
+    target?.focus({ preventScroll: true });
+  });
+}
+function closeOverlay() {
+  const wasOpen = overlay.childElementCount > 0;
+  overlay.innerHTML = '';
+  app.inert = false;
+  state.pendingSend = false;
+  if (wasOpen && returnFocus?.isConnected) returnFocus.focus({ preventScroll: true });
+}
+function sheet(title, content, extra = '') {
+  openOverlay(
+    `<div class="backdrop" data-action="close" aria-hidden="true"></div><section class="sheet" role="dialog" aria-modal="true" aria-labelledby="sheet-title"><div class="sheet-handle" aria-hidden="true"></div><header class="sheet-header"><h2 id="sheet-title">${title}</h2>${ib('close', '关闭面板', 'close')}</header>${extra}<div class="sheet-body">${content}</div></section>`,
+  );
+}
+function drawerHistory(keyword = '') {
+  if (state.drawerView === 'recent') {
+    const recent = activeConversations().filter((conversation) =>
+      `${conversation.title} ${getAgent(conversation.agentId).name} ${workspaces.find((workspace) => workspace.id === conversation.workspace)?.name || ''}`.includes(
+        keyword,
+      ),
+    );
+    return `<div class="group-heading">最近的协作<span>${recent.length} 段对话</span></div>${recent.map((conversation) => drawerConversation(conversation)).join('') || emptyState('没有找到对话', '换个关键词再试试。')}`;
+  }
+  if (state.drawerView === 'agents') {
+    return (
+      agents
+        .map((agent) => {
+          const rows = activeConversations().filter(
+            (conversation) =>
+              conversation.agentId === agent.id &&
+              `${conversation.title} ${agent.name}`.includes(keyword),
+          );
+          if (!rows.length) return '';
+          const running = rows.filter(
+            (conversation) => collaboration.get(conversation.id)?.kind === 'running',
+          ).length;
+          return `<section class="drawer-agent-group"><div class="drawer-agent-head">${avatar(agent)}<span><strong>${esc(agent.name)}</strong><small>${agent.role}</small></span>${running ? `<span class="inline-activity running">${running} 进行中</span>` : `<small>${rows.length} 段对话</small>`}<button class="drawer-agent-new" data-action="agent-new" data-id="${agent.id}" aria-label="在 ${esc(agent.name)} 中新建对话">${icon('plus')}</button></div>${rows.map((conversation) => drawerConversation(conversation)).join('')}</section>`;
+        })
+        .join('') || emptyState('没有找到对话')
+    );
+  }
+  const matches = (conversation) =>
+      `${conversation.title} ${getAgent(conversation.agentId).name}`.includes(keyword),
+    row = (conversation) =>
+      `<button class="drawer-history ${state.page === 'chat' && state.currentId === conversation.id ? 'active' : ''}" data-action="open-chat" data-id="${conversation.id}">${icon('chat')}<span>${esc(conversation.title)}</span></button>`;
+  return `${workspaces
+    .map(
+      (workspace) =>
+        `<div class="workspace-head"><button class="workspace-toggle" data-action="drawer-workspace" data-id="${workspace.id}" aria-expanded="${state.drawerExpanded.has(workspace.id)}">${icon(state.drawerExpanded.has(workspace.id) ? 'chevron' : 'right')}${icon('folder')}${esc(workspace.name)}</button>${ib('more', workspace.name + ' 更多操作', 'workspace-menu', `data-id="${workspace.id}"`)}</div>${
+          state.drawerExpanded.has(workspace.id) || keyword
+            ? activeConversations()
+                .filter(
+                  (conversation) =>
+                    conversation.workspace === workspace.id && matches(conversation),
+                )
+                .map(row)
+                .join('')
+            : ''
+        }`,
+    )
+    .join(
+      '',
+    )}<button class="text-button" data-action="create-workspace">${icon('plus')} 新建工作区</button><div class="group-heading">日常对话</div>${
+    activeConversations()
+      .filter((conversation) => !conversation.workspace && matches(conversation))
+      .map(row)
+      .join('') || '<p class="sheet-description">暂无匹配对话</p>'
+  }<button class="drawer-history" data-action="show-archived">${icon('archive')}已归档 <span style="margin-left:auto">${conversations.filter((conversation) => conversation.archived).length}</span></button>`;
+}
+function openDrawer() {
+  openOverlay(
+    `<div class="backdrop" data-action="close" aria-hidden="true"></div><aside class="drawer" role="dialog" aria-modal="true" aria-label="会话与导航"><div class="drawer-header"><div class="header-brand">${icon('flower')}<strong>fmode</strong></div>${ib('close', '关闭侧栏', 'close')}</div><button class="primary-button" data-action="new-chat">${icon('plus')}新建对话</button>${searchField('搜索历史对话', 'drawer-search')}<div class="drawer-scroll" id="drawer-results">${drawerHistory()}</div><nav class="drawer-nav" aria-label="侧栏导航">${navigation()}</nav><div class="drawer-bottom">林一 · 体验空间 / 演示</div></aside>`,
+  );
+  overlay.querySelector('.search-field').insertAdjacentHTML(
+    'afterend',
+    tabs(
+      [
+        ['recent', '最近'],
+        ['agents', '数字生命'],
+        ['workspace', '工作区'],
+      ],
+      state.drawerView,
+      'drawer-view',
+    ),
+  );
+  overlay
+    .querySelector('.drawer-scroll')
+    .insertAdjacentHTML(
+      'afterend',
+      '<button class="drawer-archive" data-action="show-archived">' +
+        icon('archive') +
+        '已归档对话' +
+        icon('right') +
+        '</button>',
+    );
+}
+function pickAgent(pending = false) {
+  sheet(
+    '和谁一起开始?',
+    `<p class="sheet-description">选择数字生命,草稿和附件会一并保留。</p>${agents.map((agent) => `<button class="sheet-list-button" data-action="choose-agent" data-id="${agent.id}">${avatar(agent)}<span>${esc(agent.name)}<small>${agent.role} · ${agent.online ? '在线' : '离线'}</small></span>${state.agentId === agent.id ? icon('check', 'selected-check') : icon('right')}</button>`).join('')}<p class="sheet-description" style="margin-top:18px">保留「先选择数字生命,再建立会话」的现有流程。</p>`,
+  );
+  state.pendingSend = pending;
+}
+function details(tab = 'task') {
+  const agent = getAgent(getConversation().agentId),
+    content = {
+      task: `<p class="sheet-description">当前会话中的任务,不新增全局任务入口。</p><div class="sheet-item"><span class="tag">已完成</span><strong>产品初体验优化建议</strong><p>分析首页与对话页的体验问题,整理可执行的改进方向。</p><p>3 / 3 步骤完成 · ${esc(agent.name)}</p></div>`,
+      file: `${fileCard()}<p class="sheet-description">演示文件内容为静态预览,不会上传或读取云盘。</p>`,
+      deliver: `<div class="sheet-item"><span class="tag">v1.0</span><strong>产品初体验优化建议</strong><p>今天 10:42 · ${esc(agent.name)} 已交付</p>${fileCard()}</div>`,
+      state: `<div class="sheet-item"><strong>数字生命</strong><p>${esc(agent.name)} · ${agent.online ? '在线' : '离线'}</p></div><div class="sheet-item"><strong>会话连接</strong><p>${state.disconnected ? '连接中断,等待重连' : '已连接 · 当前没有待发送消息'}</p></div><p class="sheet-description" style="margin-top:18px">原型状态演示(不影响实际服务)</p><div class="state-chips"><button data-action="disconnect">模拟断线</button><button data-action="reconnect">恢复连接</button></div>`,
+    };
+  if (state.currentId !== 'c1' && tab !== 'state')
+    content[tab] = emptyState(
+      tab === 'task' ? '还没有任务' : tab === 'file' ? '还没有文件' : '还没有成果',
+      '这段对话中的内容会显示在这里。',
+      tab === 'task' ? 'check' : 'file',
+    );
+  sheet(
+    '会话详情',
+    content[tab] || content.task,
+    tabs(
+      [
+        ['task', '任务'],
+        ['file', '文件'],
+        ['deliver', '成果'],
+        ['state', '状态'],
+      ],
+      tab,
+      'detail-tab',
+    ),
+  );
+}
+function previewFile() {
+  sheet(
+    '文档预览',
+    `<p class="sheet-description">产品初体验优化建议.docx · 演示内容</p><article class="preview-document"><div class="eyebrow">FMODE / EXPERIENCE NOTE</div><h1>把第一印象做好</h1><p>一份围绕移动端的体验优化建议<br />2026.11.16 / v1.0</p><h2>01 · 让入口更清楚</h2><p>保留熟悉的导航,用明确的主操作降低理解成本。</p><h2>02 · 让内容回到中心</h2><p>减少无效的视觉容器,用段落、留白与字重建立信息层级。</p><table><thead><tr><th>页面</th><th>体验方向</th></tr></thead><tbody><tr><td>新建对话</td><td>一个输入框,开始协作</td></tr><tr><td>会话详情</td><td>正文优先,过程折叠</td></tr><tr><td>会话列表</td><td>搜索、分组与清晰状态</td></tr></tbody></table><h2>03 · 每次操作都有回应</h2><p>发送、加载、离线和失败状态清晰可见,操作始终可恢复。</p></article><button class="primary-button" data-action="download-demo">${icon('download')}下载演示文稿(TXT)</button><button class="text-button" data-action="details" data-tab="file">${icon('back')}返回会话文件</button>`,
+  );
+}
+function formSheet(title, label, value, submitAction, identifier = '') {
+  sheet(
+    title,
+    `<form class="sheet-form" data-form="${submitAction}" data-id="${identifier}"><label for="form-value">${label}</label><input id="form-value" name="value" maxlength="60" value="${esc(value)}" autocomplete="off" autofocus required /><p class="form-error" role="alert"></p><button class="primary-button" type="submit">保存</button></form>`,
+  );
+}
+function confirmation(title, description, action, identifier) {
+  sheet(
+    title,
+    `<p class="sheet-description">${description}</p><div class="button-row"><button class="secondary-button" data-action="close">取消</button><button class="secondary-button danger" data-action="${action}" data-id="${identifier || ''}">确认${title.replace('?', '')}</button></div>`,
+  );
+}
+function conversationMenu(identifier) {
+  const conversation = getConversation(identifier);
+  sheet(
+    '管理这段对话',
+    `<p class="sheet-description">${esc(conversation.title)}</p><button class="sheet-list-button" data-action="rename-conversation" data-id="${identifier}">${icon('edit')}重命名</button><button class="sheet-list-button" data-action="move-conversation" data-id="${identifier}">${icon('folder')}移动到工作区</button><button class="sheet-list-button" data-action="archive-conversation" data-id="${identifier}">${icon('archive')}${conversation.archived ? '取消归档' : '归档对话'}</button><button class="sheet-list-button danger" data-action="delete-conversation" data-id="${identifier}">${icon('trash')}删除对话</button>`,
+  );
+}
+function drawerConversation(conversation) {
+  const status = collaboration.get(conversation.id)?.kind || 'idle';
+  const workspace =
+    workspaces.find((item) => item.id === conversation.workspace)?.name || '日常对话';
+  return `<button class="drawer-conversation ${state.page === 'chat' && state.currentId === conversation.id ? 'active' : ''}" data-action="open-chat" data-id="${conversation.id}"><span class="drawer-conversation-title">${esc(conversation.title)}<span class="mini-state ${status}" aria-label="${activityNames[status]}">${status === 'done' ? icon('check') : status === 'attention' ? '!' : ''}</span></span><small>${state.drawerView === 'agents' ? '' : esc(getAgent(conversation.agentId).name) + ' · '}${esc(workspace)}</small></button>`;
+}
+function activityResults() {
+  const rows = activeConversations().filter((conversation) => {
+    const status = collaboration.get(conversation.id)?.kind;
+    return (
+      status &&
+      status !== 'idle' &&
+      (state.activityFilter === 'all' || status === state.activityFilter) &&
+      `${conversation.title} ${getAgent(conversation.agentId).name}`.includes(state.activityKeyword)
+    );
+  });
+  return (
+    ['running', 'attention', 'done']
+      .map((kind) => {
+        const group = rows.filter(
+          (conversation) => collaboration.get(conversation.id)?.kind === kind,
+        );
+        if (!group.length) return '';
+        return `<div class="activity-group-label"><span class="inline-activity ${kind}">${activityNames[kind]}</span><span>${group.length}</span></div>${group
+          .map((conversation) => {
+            const activity = collaboration.get(conversation.id);
+            const agent = getAgent(conversation.agentId);
+            const workspace =
+              workspaces.find((item) => item.id === conversation.workspace)?.name || '日常对话';
+            return `<button class="activity-card ${kind} ${conversation.id === state.currentId ? 'current' : ''}" data-action="activity-open" data-id="${conversation.id}"><span class="activity-card-avatar">${avatar(agent)}<span class="mini-state ${kind}">${kind === 'done' ? icon('check') : kind === 'attention' ? '!' : ''}</span></span><span class="activity-card-content"><strong>${esc(conversation.title)}</strong><small>${esc(agent.name)} · ${esc(workspace)}</small><span class="activity-detail">${esc(activity.label)}</span></span><span class="activity-card-end">${conversation.id === state.currentId ? '<em>当前</em>' : icon('right')}<small>${activity.elapsed}</small></span></button>`;
+          })
+          .join('')}`;
+      })
+      .join('') || emptyState('这里暂时没有协作动态', '切换筛选,看看其他会话。', 'check')
+  );
+}
+function openActivity() {
+  const count = (kind) =>
+    activeConversations().filter(
+      (conversation) => collaboration.get(conversation.id)?.kind === kind,
+    ).length;
+  sheet(
+    '切换协作',
+    `<p class="sheet-description">不用退出对话,也能知道每件事的进展。</p>${searchField('搜索正在协作的事', 'activity-search', state.activityKeyword)}${tabs(
+      [
+        ['all', '全部'],
+        ['running', '进行中 ' + count('running')],
+        ['attention', '待关注 ' + count('attention')],
+        ['done', '已完成 ' + count('done')],
+      ],
+      state.activityFilter,
+      'activity-filter',
+    )}<div id="activity-results">${activityResults()}</div><div class="activity-sheet-footer"><span>会话状态演示 · 不等于数字生命在线状态</span><button data-action="complete-demo">模拟完成提醒</button></div>`,
+  );
+  overlay.querySelector('.sheet').classList.add('activity-sheet');
+}
+function quickCurrent() {
+  if (state.generating) {
+    toast('演示回复完成后即可新建');
+    return;
+  }
+  const previous = getConversation();
+  saveDraft();
+  const identifier = `c${Date.now()}`;
+  conversations.unshift({
+    id: identifier,
+    title: '新对话',
+    agentId: previous.agentId,
+    preview: '等待你的第一个想法',
+    time: '刚刚',
+    group: '今天',
+    workspace: previous.workspace,
+    unread: 0,
+    archived: false,
+  });
+  collaboration.set(identifier, { kind: 'idle', label: '等待新的想法', elapsed: '空闲' });
+  messages.set(identifier, []);
+  navigate('chat', identifier);
+  toast('已在 ' + getAgent(previous.agentId).name + ' 中新建,原对话草稿已保留');
+}
+function editCurrentTitle() {
+  const conversation = getConversation();
+  formSheet(
+    '给这段对话起个名字',
+    '会话标题',
+    conversation.title,
+    'rename-conversation',
+    conversation.id,
+  );
+  const form = overlay.querySelector('form');
+  form.insertAdjacentHTML(
+    'beforeend',
+    `<button class="regenerate-title" type="button" data-action="regenerate-title">${icon('spark')}生成一个候选标题<span>演示</span></button><p class="title-protection">${icon('shield')}只有点保存才会更新。手动标题不会被自动覆盖。</p>`,
+  );
+}
+function previewListState(mode) {
+  saveDraft();
+  state.page = 'messages';
+  state.keyword = '';
+  history.pushState(null, '', '#/messages');
+  closeOverlay();
+  render();
+  const results = document.querySelector('#conversation-results');
+  if (mode === 'loading') {
+    results.innerHTML = `<div class="skeleton-list" role="status" aria-label="正在加载会话" aria-busy="true">${Array.from({ length: 5 }, () => '<div class="skeleton-row"><span></span><div><i></i><i></i></div></div>').join('')}</div>`;
+    setTimeout(() => {
+      if (results.isConnected) results.innerHTML = conversationResults();
+    }, 1800);
+  } else if (mode === 'error') {
+    results.innerHTML =
+      emptyState('暂时没连上,不是消息丢了', '网络恢复后可以重试,草稿仍然保留。', 'wifi') +
+      '<button class="primary-button" data-action="retry-list">重新加载</button>';
+  } else
+    results.innerHTML =
+      emptyState('还没有对话,从一个想法开始', '选择熟悉的数字生命,开始你的第一次协作。', 'chat') +
+      '<button class="primary-button" data-action="new-chat">开始新对话</button>';
+}
+function completeDemo() {
+  const conversation = getConversation('c4');
+  if (!conversation) {
+    toast('这条演示会话已删除,刷新可恢复');
+    return;
+  }
+  const activity = collaboration.get(conversation.id);
+  if (activity?.kind === 'done') {
+    toast('该协作已完成,可在「已完成」中查看');
+    return;
+  }
+  collaboration.set(conversation.id, {
+    kind: 'done',
+    label: '接口检查已完成,结果已整理',
+    elapsed: '刚刚完成',
+  });
+  conversation.unread = 1;
+  closeOverlay();
+  render();
+  document.querySelector('#completion-banner')?.remove();
+  document
+    .querySelector('#device')
+    .insertAdjacentHTML(
+      'beforeend',
+      `<div class="completion-banner" id="completion-banner" role="status"><span class="completion-mark">${icon('check')}</span><button data-action="completion-open" data-id="${conversation.id}"><strong>阿澈的接口检查完成了</strong><small>结果已整理好,点这里接着看 · 演示</small></button><button data-action="dismiss-completion" aria-label="关闭完成提醒">${icon('close')}</button></div>`,
+    );
+}
+function send() {
+  if (state.generating || (!state.draft.trim() && !state.attachments.length)) return;
+  if (state.disconnected && state.page === 'chat') {
+    toast('连接已断开,请先重连;草稿已保留');
+    return;
+  }
+  if (state.page === 'home' && !state.agentId) {
+    pickAgent(true);
+    return;
+  }
+  if (state.page === 'home') {
+    drafts.delete('home');
+    const identifier = `c${Date.now()}`;
+    conversations.unshift({
+      id: identifier,
+      title: state.draft.trim().slice(0, 18) || '附件对话',
+      agentId: state.agentId,
+      preview: '正在整理你的想法…',
+      time: '刚刚',
+      group: '今天',
+      workspace: state.newWorkspace,
+      unread: 0,
+      archived: false,
+    });
+    messages.set(identifier, []);
+    state.currentId = identifier;
+    state.newWorkspace = null;
+    state.page = 'chat';
+    history.pushState(null, '', `#/chat/${identifier}`);
+  }
+  const conversation = getConversation(),
+    rows = messages.get(conversation.id) || sampleMessages(conversation),
+    question = state.draft.trim(),
+    files = state.attachments.map((file) => file.name);
+  rows.push({ role: 'user', text: question || '请查看我添加的附件', files });
+  if (conversation.title === '新对话' && !conversation.manuallyNamed)
+    conversation.title = (question || '附件对话').slice(0, 18);
+  collaboration.set(conversation.id, {
+    kind: 'running',
+    label: '正在处理你的消息',
+    elapsed: '刚刚开始',
+  });
+  messages.set(conversation.id, rows);
+  state.draft = '';
+  state.attachments = [];
+  drafts.delete(conversation.id);
+  state.generating = true;
+  state.generatingId = conversation.id;
+  render();
+  main.scrollTop = main.scrollHeight;
+  clearTimeout(generationTimer);
+  generationTimer = setTimeout(() => {
+    rows.push({
+      role: 'assistant',
+      html: `<p>收到,我们就从「<strong>${esc(question || '这份附件')}</strong>」开始。</p><p>我会先把目标、已有信息和下一步梳理清楚,再一起把它变成可执行的行动。</p><blockquote>这是一条本地模拟回复,仅用于体验发送、等待和阅读的完整流程${files.length ? ';附件只展示文件名,未读取或上传' : ''}。</blockquote>`,
+    });
+    conversation.preview = '已整理好思路,可以继续讨论。';
+    collaboration.set(conversation.id, {
+      kind: 'done',
+      label: '演示回复已完成',
+      elapsed: '刚刚完成',
+    });
+    state.generating = false;
+    if (state.page === 'chat' && state.currentId === conversation.id) {
+      render();
+      main.scrollTop = main.scrollHeight;
+    } else if (['home', 'messages'].includes(state.page)) render();
+  }, 1100);
+}
+function toast(message) {
+  const element = document.querySelector('#toast');
+  element.textContent = message;
+  element.classList.add('visible');
+  clearTimeout(toastTimer);
+  toastTimer = setTimeout(() => element.classList.remove('visible'), 2700);
+}
+async function copyText(text) {
+  try {
+    await navigator.clipboard.writeText(text);
+    toast('已复制');
+  } catch {
+    toast('浏览器未开放剪贴板权限,请手动选择内容复制');
+  }
+}
+function downloadDemo() {
+  const content =
+      '产品初体验优化建议(演示文稿)\n\n01 让入口更清楚\n保留现有导航与功能,突出主操作。\n\n02 让阅读更轻松\n减少厚重卡片,扩大段落留白。\n\n03 让操作有回应\n清晰呈现加载、断线与错误状态。\n\n本文件为独立 HTML 原型的演示文稿,并非真实云盘文件。',
+    url = URL.createObjectURL(new Blob([content], { type: 'text/plain;charset=utf-8' })),
+    link = document.createElement('a');
+  link.href = url;
+  link.download = '产品初体验优化建议-演示.txt';
+  link.click();
+  setTimeout(() => URL.revokeObjectURL(url), 1000);
+  toast('演示文稿已下载,不是实际 DOCX 文件');
+}
+function showArchived() {
+  sheet(
+    '已归档对话',
+    conversations
+      .filter((conversation) => conversation.archived)
+      .map(conversationRow)
+      .join('') || emptyState('没有归档对话', '归档的对话会保留在这里。', 'archive'),
+  );
+}
+function newChat(workspace = null, agentId = null) {
+  if (state.generating) {
+    toast('演示回复完成后即可新建对话');
+    return;
+  }
+  state.agentId = agentId;
+  state.newWorkspace = workspace;
+  navigate('home');
+}
+const actions = {
+  'preview-states': () =>
+    sheet(
+      '加载与反馈状态',
+      '<p class="sheet-description">仅切换演示视图,不改变真实数据或权限。</p><button class="sheet-list-button" data-action="list-state" data-value="loading">' +
+        icon('more') +
+        '加载骨架屏</button><button class="sheet-list-button" data-action="list-state" data-value="empty">' +
+        icon('chat') +
+        '首次使用空态</button><button class="sheet-list-button" data-action="list-state" data-value="error">' +
+        icon('wifi') +
+        '断网与重试</button>',
+    ),
+  'list-state': (button) => previewListState(button.dataset.value),
+  'retry-list': renderMessages,
+  activity: openActivity,
+  'activity-filter': (button) => {
+    state.activityFilter = button.dataset.value;
+    openActivity();
+  },
+  'activity-open': (button) => {
+    closeOverlay();
+    navigate('chat', button.dataset.id);
+    requestAnimationFrame(() => {
+      main.scrollTop = main.scrollHeight;
+    });
+  },
+  'drawer-view': (button) => {
+    state.drawerView = button.dataset.value;
+    openDrawer();
+  },
+  'quick-current': quickCurrent,
+  'agent-new': (button) => {
+    newChat(null, button.dataset.id);
+    toast('已选中 ' + getAgent(button.dataset.id).name + ',不用再次选择');
+  },
+  'edit-current-title': editCurrentTitle,
+  'regenerate-title': () => {
+    const conversation = getConversation();
+    const rows = messages.get(conversation.id) || [];
+    const question = [...rows].reverse().find((message) => message.role === 'user')?.text;
+    overlay.querySelector('#form-value').value =
+      conversation.id === 'c1'
+        ? '移动端第一印象与体验优化'
+        : (question || conversation.title).slice(0, 22);
+    toast('候选标题已填入,保存后才会更新;未调用 AI');
+  },
+  'complete-demo': completeDemo,
+  'dismiss-completion': () => document.querySelector('#completion-banner')?.remove(),
+  'completion-open': (button) => {
+    document.querySelector('#completion-banner')?.remove();
+    navigate('chat', button.dataset.id);
+    requestAnimationFrame(() => {
+      main.scrollTop = main.scrollHeight;
+    });
+  },
+  navigate: (button) => navigate(button.dataset.page),
+  drawer: openDrawer,
+  close: closeOverlay,
+  'new-chat': () => newChat(),
+  'open-chat': (button) => navigate('chat', button.dataset.id),
+  'pick-agent': () => pickAgent(false),
+  'choose-agent': (button) => {
+    const pending = state.pendingSend;
+    state.agentId = button.dataset.id;
+    closeOverlay();
+    renderComposer();
+    if (pending) send();
+  },
+  'agent-info': () => {
+    const agent = getAgent(getConversation().agentId);
+    sheet(
+      '当前数字生命',
+      `<div class="profile-card">${avatar(agent)}<div><h2>${esc(agent.name)}</h2><p>${agent.role} · ${agent.online ? '在线' : '离线'}</p></div></div><p class="sheet-description">当前会话固定关联该数字生命。如需更换,请新建对话。</p>`,
+    );
+  },
+  prompt: (button) => {
+    state.draft = button.dataset.value;
+    renderComposer();
+    document.querySelector('#draft').focus();
+  },
+  send,
+  attach: () => {
+    if (state.generating) return;
+    document.querySelector('#file-input').click();
+  },
+  'remove-attachment': (button) => {
+    state.attachments.splice(Number(button.dataset.index), 1);
+    renderComposer();
+  },
+  'message-filter': (button) => {
+    state.filter = button.dataset.value;
+    renderMessages();
+  },
+  'contact-filter': (button) => {
+    state.contactFilter = button.dataset.value;
+    state.keyword = '';
+    renderContacts();
+  },
+  'agent-filter': (button) => {
+    state.agentFilter = button.dataset.value;
+    renderWorkbench();
+  },
+  'toggle-workspace': (button) => {
+    state.expanded.has(button.dataset.id)
+      ? state.expanded.delete(button.dataset.id)
+      : state.expanded.add(button.dataset.id);
+    document.querySelector('#conversation-results').innerHTML = conversationResults();
+  },
+  'drawer-workspace': (button) => {
+    state.drawerExpanded.has(button.dataset.id)
+      ? state.drawerExpanded.delete(button.dataset.id)
+      : state.drawerExpanded.add(button.dataset.id);
+    document.querySelector('#drawer-results').innerHTML = drawerHistory(
+      document.querySelector('[data-input="drawer-search"]').value,
+    );
+  },
+  'workspace-chat': (button) => newChat(button.dataset.id),
+  'create-workspace': () =>
+    formSheet('新建工作区', '工作区名称(最多 24 字)', '', 'create-workspace'),
+  'workspace-menu': (button) => {
+    const workspace = workspaces.find((item) => item.id === button.dataset.id);
+    sheet(
+      esc(workspace.name),
+      `<button class="sheet-list-button" data-action="rename-workspace" data-id="${workspace.id}">${icon('edit')}重命名工作区</button><button class="sheet-list-button danger" data-action="delete-workspace" data-id="${workspace.id}">${icon('trash')}删除工作区</button>`,
+    );
+  },
+  'rename-workspace': (button) =>
+    formSheet(
+      '重命名工作区',
+      '工作区名称(最多 24 字)',
+      workspaces.find((workspace) => workspace.id === button.dataset.id).name,
+      'rename-workspace',
+      button.dataset.id,
+    ),
+  'delete-workspace': (button) =>
+    confirmation(
+      '删除工作区?',
+      '其中的会话会移到「日常对话」,不会被删除。此操作只影响演示数据。',
+      'confirm-delete-workspace',
+      button.dataset.id,
+    ),
+  'confirm-delete-workspace': (button) => {
+    conversations.forEach((conversation) => {
+      if (conversation.workspace === button.dataset.id) conversation.workspace = null;
+    });
+    workspaces = workspaces.filter((workspace) => workspace.id !== button.dataset.id);
+    if (state.newWorkspace === button.dataset.id) state.newWorkspace = null;
+    closeOverlay();
+    render();
+    toast('工作区已删除,会话已移到日常对话');
+  },
+  'conversation-menu': (button) => conversationMenu(button.dataset.id),
+  'rename-conversation': (button) =>
+    formSheet(
+      '重命名对话',
+      '对话名称',
+      getConversation(button.dataset.id).title,
+      'rename-conversation',
+      button.dataset.id,
+    ),
+  'move-conversation': (button) =>
+    sheet(
+      '移动到工作区',
+      `<button class="sheet-list-button" data-action="choose-workspace" data-id="${button.dataset.id}" data-workspace="">${icon('chat')}日常对话</button>${workspaces.map((workspace) => `<button class="sheet-list-button" data-action="choose-workspace" data-id="${button.dataset.id}" data-workspace="${workspace.id}">${icon('folder')}${esc(workspace.name)}</button>`).join('')}`,
+    ),
+  'choose-workspace': (button) => {
+    getConversation(button.dataset.id).workspace = button.dataset.workspace || null;
+    closeOverlay();
+    render();
+    toast('已移动,仅影响本地演示数据');
+  },
+  'archive-conversation': (button) => {
+    const conversation = getConversation(button.dataset.id);
+    conversation.archived = !conversation.archived;
+    closeOverlay();
+    if (state.page === 'chat' && conversation.archived) navigate('messages');
+    else render();
+    toast(conversation.archived ? '已归档,可在侧栏中找回' : '已取消归档');
+  },
+  'delete-conversation': (button) =>
+    confirmation(
+      '删除对话?',
+      '删除后这条演示对话将从当前预览中移除,刷新页面可恢复。',
+      'confirm-delete-conversation',
+      button.dataset.id,
+    ),
+  'confirm-delete-conversation': (button) => {
+    const index = conversations.findIndex((conversation) => conversation.id === button.dataset.id);
+    if (index >= 0) conversations.splice(index, 1);
+    messages.delete(button.dataset.id);
+    closeOverlay();
+    if (state.page === 'chat') navigate('messages');
+    else render();
+    toast('演示对话已删除');
+  },
+  'show-archived': showArchived,
+  details: (button) => details(button?.dataset.tab || 'task'),
+  'detail-tab': (button) => details(button.dataset.value),
+  'preview-file': previewFile,
+  'download-demo': downloadDemo,
+  'copy-message': (button) => {
+    const message = messages.get(state.currentId)[Number(button.dataset.index)],
+      content = document.createElement('div');
+    content.innerHTML = message.html;
+    copyText(content.textContent);
+  },
+  disconnect: () => {
+    state.disconnected = true;
+    closeOverlay();
+    renderChat();
+    toast('已进入断线演示,草稿不会丢失');
+  },
+  reconnect: () => {
+    state.disconnected = false;
+    closeOverlay();
+    renderChat();
+    toast('演示连接已恢复');
+  },
+  'open-agent': (button) => navigate('agent', button.dataset.id),
+  'rename-agent': (button) =>
+    formSheet(
+      '重命名数字生命',
+      '显示名称',
+      getAgent(button.dataset.id).name,
+      'rename-agent',
+      button.dataset.id,
+    ),
+  'agent-chat': (button) => {
+    const conversation = activeConversations().find((item) => item.agentId === button.dataset.id);
+    conversation ? navigate('chat', conversation.id) : newChat(null, button.dataset.id);
+  },
+  channels: (button) =>
+    sheet(
+      '消息通道',
+      `<p class="sheet-description">${esc(getAgent(button.dataset.id).name)} · 演示连接信息</p><div class="sheet-item"><span class="tag">${getAgent(button.dataset.id).online ? '已连接' : '离线'}</span><strong>Matrix</strong><p>沿用现有消息通道,不在原型中建立真实连接。</p></div>`,
+    ),
+  recharge: (button) =>
+    sheet(
+      '数字生命充值',
+      `<p class="sheet-description">${esc(getAgent(button.dataset.id).name)} · 当前演示余额 ¥${getAgent(button.dataset.id).balance}</p><div class="empty-state">${icon('shield')}<strong>这里只预览,不会产生支付</strong><p>正式迁移时继续使用现有充值页面与接口,金额、账单和支付流程均不改变。</p></div>`,
+    ),
+  coworker: (button) =>
+    sheet(
+      esc(button.dataset.name),
+      `<p class="sheet-description">同事的数字生命 · 演示</p>${agents
+        .slice(0, 2)
+        .map(
+          (agent) =>
+            `<button class="sheet-list-button" data-action="open-agent" data-id="${agent.id}">${avatar(agent)}<span>${esc(agent.name)}<small>${agent.role}</small></span>${icon('right')}</button>`,
+        )
+        .join('')}`,
+    ),
+  theme: () => {
+    state.dark = !state.dark;
+    const scroll = main.scrollTop;
+    renderMine();
+    applyPreferences();
+    main.scrollTop = scroll;
+  },
+  palette: (button) => {
+    state.palette = button.dataset.value;
+    const scroll = main.scrollTop;
+    renderMine();
+    applyPreferences();
+    main.scrollTop = scroll;
+  },
+  font: () =>
+    sheet(
+      '舒适地阅读',
+      `<p class="sheet-description">仅调整对话正文,沿用现有字号偏好功能。</p><div class="font-options">${[
+        [14, '标准'],
+        [16, '较大'],
+        [18, '大号'],
+      ]
+        .map(
+          ([value, label]) =>
+            `<button data-action="choose-font" data-value="${value}" class="${state.font === value ? 'active' : ''}">${label}</button>`,
+        )
+        .join(
+          '',
+        )}</div><div class="assistant-body" id="font-preview" style="font-size:${state.font}px;line-height:1.9;padding:14px 0">让每一个想法,都有舒展的空间。<br />好的阅读体验,从恰好的字号开始。</div>`,
+    ),
+  'choose-font': (button) => {
+    state.font = Number(button.dataset.value);
+    applyPreferences();
+    renderMine();
+    actions.font();
+  },
+  token: () =>
+    sheet(
+      '访问 Token',
+      `<p class="sheet-description">演示占位,不读取或展示任何真实凭据。</p><div class="sheet-item"><strong>${state.tokenVisible ? 'DEMO-NOT-A-REAL-TOKEN' : '•••• •••• •••• ••••'}</strong></div><div class="button-row"><button class="secondary-button" data-action="toggle-token">${state.tokenVisible ? '隐藏' : '显示'}占位 Token</button><button class="secondary-button" data-action="copy-token" ${state.tokenVisible ? '' : 'disabled'}>复制占位内容</button></div>`,
+    ),
+  'toggle-token': () => {
+    state.tokenVisible = !state.tokenVisible;
+    actions.token();
+  },
+  'copy-token': () => copyText('DEMO-NOT-A-REAL-TOKEN'),
+  notifications: () =>
+    sheet(
+      '消息与任务通知',
+      `<p class="sheet-description">继续保留现有通知权限状态和系统设置入口。</p><div class="empty-state">${icon('bell')}<strong>原型不申请系统权限</strong><p>正式版本仍由现有通知服务检查权限,并引导到系统设置。</p></div>`,
+    ),
+  logout: () =>
+    confirmation('退出登录?', '此处仅演示二次确认,不会退出真实项目账号。', 'confirm-logout'),
+  'confirm-logout': () => {
+    closeOverlay();
+    navigate('home');
+    toast('退出交互演示完成;未操作真实账号');
+  },
+};
+document.addEventListener('click', (event) => {
+  const experience = event.target.closest('[data-experience]');
+  if (experience) {
+    const type = experience.dataset.experience;
+    closeOverlay();
+    if (state.page !== 'chat') {
+      saveDraft();
+      state.page = 'chat';
+      state.currentId = 'c1';
+      restoreDraft();
+      history.pushState(null, '', '#/chat/c1');
+      render();
+    }
+    if (type === 'activity') openActivity();
+    if (type === 'title') editCurrentTitle();
+    if (type === 'complete') completeDemo();
+    return;
+  }
+  const scene = event.target.closest('[data-scene]');
+  if (scene) {
+    navigate(scene.dataset.scene, scene.dataset.scene === 'chat' ? 'c1' : undefined);
+    return;
+  }
+  const button = event.target.closest('[data-action]');
+  if (button && !button.disabled) actions[button.dataset.action]?.(button);
+});
+document.addEventListener('input', (event) => {
+  const element = event.target;
+  if (element.id === 'draft') {
+    state.draft = element.value;
+    element.style.height = 'auto';
+    element.style.height = `${Math.min(element.scrollHeight, 116)}px`;
+    document.querySelector('.send-button').disabled =
+      state.generating || (!state.draft.trim() && !state.attachments.length);
+    return;
+  }
+  const kind = element.dataset.input;
+  if (!kind) return;
+  if (kind === 'activity-search') {
+    state.activityKeyword = element.value;
+    document.querySelector('#activity-results').innerHTML = activityResults();
+    return;
+  }
+  if (kind === 'drawer-search') {
+    document.querySelector('#drawer-results').innerHTML = drawerHistory(element.value);
+    return;
+  }
+  state.keyword = element.value;
+  if (kind === 'search')
+    document.querySelector('#conversation-results').innerHTML = conversationResults();
+  if (kind === 'contact-search')
+    document.querySelector('#contact-results').innerHTML = contactResults();
+  if (kind === 'agent-search') document.querySelector('#agent-results').innerHTML = agentResults();
+});
+document.addEventListener('keydown', (event) => {
+  if (event.key === 'Escape' && overlay.childElementCount) {
+    event.preventDefault();
+    closeOverlay();
+    return;
+  }
+  if (event.key === 'Tab' && overlay.childElementCount) {
+    const focusable = [
+        ...overlay.querySelectorAll('button:not(:disabled),input,select,a[href],summary'),
+      ].filter((element) => element.getClientRects().length),
+      first = focusable[0],
+      last = focusable.at(-1);
+    if (event.shiftKey && document.activeElement === first) {
+      event.preventDefault();
+      last?.focus();
+    } else if (!event.shiftKey && document.activeElement === last) {
+      event.preventDefault();
+      first?.focus();
+    }
+  }
+});
+let sheetDrag = null;
+overlay.addEventListener('pointerdown', (event) => {
+  const handle = event.target.closest('.sheet-handle');
+  if (!handle) return;
+  sheetDrag = { start: event.clientY, distance: 0, element: handle.closest('.sheet'), handle };
+  handle.setPointerCapture(event.pointerId);
+  sheetDrag.element.style.transition = 'none';
+  sheetDrag.element.style.animation = 'none';
+});
+overlay.addEventListener('pointermove', (event) => {
+  if (!sheetDrag) return;
+  sheetDrag.distance = Math.max(0, event.clientY - sheetDrag.start);
+  sheetDrag.element.style.transform = `translateY(${sheetDrag.distance}px)`;
+});
+overlay.addEventListener('pointerup', () => {
+  if (!sheetDrag) return;
+  if (sheetDrag.distance > 85) closeOverlay();
+  else {
+    sheetDrag.element.style.transition = 'transform .2s ease';
+    sheetDrag.element.style.transform = '';
+  }
+  sheetDrag = null;
+});
+overlay.addEventListener('pointercancel', () => {
+  if (sheetDrag) sheetDrag.element.style.transform = '';
+  sheetDrag = null;
+});
+document.addEventListener('submit', (event) => {
+  const form = event.target.closest('[data-form]');
+  if (!form) return;
+  event.preventDefault();
+  const value = new FormData(form).get('value').trim(),
+    kind = form.dataset.form,
+    identifier = form.dataset.id,
+    error = form.querySelector('.form-error');
+  if (!value) {
+    error.textContent = '名称不能为空';
+    return;
+  }
+  if (kind.includes('workspace')) {
+    if (value.length > 24) {
+      error.textContent = '工作区名称最多 24 字';
+      return;
+    }
+    if (workspaces.some((workspace) => workspace.name === value && workspace.id !== identifier)) {
+      error.textContent = '已有同名工作区,请换一个名称';
+      return;
+    }
+  }
+  if (kind === 'create-workspace') workspaces.push({ id: `w${Date.now()}`, name: value });
+  if (kind === 'rename-workspace')
+    workspaces.find((workspace) => workspace.id === identifier).name = value;
+  if (kind === 'rename-conversation') {
+    getConversation(identifier).title = value;
+    getConversation(identifier).manuallyNamed = true;
+  }
+  if (kind === 'rename-agent') getAgent(identifier).name = value;
+  closeOverlay();
+  render();
+  toast('已保存,仅影响本地演示数据');
+});
+document.querySelector('#file-input').addEventListener('change', (event) => {
+  state.attachments.push(...Array.from(event.target.files));
+  event.target.value = '';
+  renderComposer();
+  toast('附件仅暂存在本页,不会读取或上传');
+});
+window.addEventListener('hashchange', readRoute);
+function syncVisualViewport() {
+  if (window.innerWidth <= 520 && window.visualViewport?.scale === 1) {
+    document
+      .querySelector('#device')
+      .style.setProperty('--visual-height', `${window.visualViewport.height}px`);
+  } else document.querySelector('#device').style.removeProperty('--visual-height');
+}
+window.visualViewport?.addEventListener('resize', syncVisualViewport);
+window.addEventListener('resize', syncVisualViewport);
+syncVisualViewport();
+document
+  .querySelectorAll('[data-icon]')
+  .forEach((element) => (element.innerHTML = icon(element.dataset.icon)));
+readRoute();

+ 9 - 0
prototypes/mobile-refresh-20261116/build-single.mjs

@@ -0,0 +1,9 @@
+import { readFile, writeFile } from 'node:fs/promises';
+
+const read = (filename) => readFile(new URL(filename, import.meta.url), 'utf8');
+const [html, css, script] = await Promise.all([read('index.html'), read('styles.css'), read('app.js')]);
+const bundled = html
+  .replace('<link rel="stylesheet" href="styles.css" />', () => `<style>\n${css}\n</style>`)
+  .replace('<script src="app.js"></script>', () => `<script>\n${script}\n</script>`);
+await writeFile(new URL('mobile-preview.html', import.meta.url), bundled, 'utf8');
+console.log('Built offline prototype: mobile-preview.html');

+ 97 - 0
prototypes/mobile-refresh-20261116/index.html

@@ -0,0 +1,97 @@
+<!doctype html>
+<html lang="zh-CN">
+  <head>
+    <meta charset="UTF-8" />
+    <meta
+      name="viewport"
+      content="width=device-width, initial-scale=1, viewport-fit=cover, interactive-widget=resizes-content"
+    />
+    <meta name="theme-color" content="#fafbf8" />
+    <title>fmode · 移动端体验提案</title>
+    <link rel="stylesheet" href="styles.css" />
+  </head>
+  <body>
+    <div class="presentation">
+      <aside class="intro">
+        <a class="studio-brand" href="#/home"
+          ><span data-icon="flower"></span> fmode<span class="edition">MOBILE STUDY / 01</span></a
+        >
+        <div class="intro-copy">
+          <div class="eyebrow">不止是聊天,更是多线协作</div>
+          <h1>一手掌控。<br />多线从容。</h1>
+          <p>知道谁在工作,记得聊到哪里。<br />在每一段协作之间,自如切换。</p>
+          <span class="proposal-tag"><i class="dot"></i> 交互提案 · 非生产环境</span>
+        </div>
+        <div class="scene-switch" aria-label="原型场景">
+          <span class="eyebrow">从这里开始体验</span
+          ><button data-scene="chat">
+            <span>01</span> 沉浸式协作 <span data-icon="arrow-right"></span></button
+          ><button data-experience="activity">
+            <span>02</span> 一步切换,进展在握 <span data-icon="arrow-right"></span></button
+          ><button data-scene="messages">
+            <span>03</span> 找回之前的想法 <span data-icon="arrow-right"></span></button
+          ><button data-scene="home">
+            <span>04</span> 开始新的想法 <span data-icon="arrow-right"></span>
+          </button>
+        </div>
+        <div class="intro-footer">
+          FMODE / MOBILE EXPERIENCE<br /><span>独立 HTML 原型 · 2026.11.16</span>
+        </div>
+      </aside>
+      <div class="device-wrap">
+        <div class="device" id="device">
+          <div class="statusbar" aria-hidden="true">
+            <span>9:41</span>
+            <div class="island"></div>
+            <div class="status-icons">
+              <span data-icon="signal"></span><span data-icon="wifi"></span
+              ><span data-icon="battery"></span>
+            </div>
+          </div>
+          <div class="app" id="app">
+            <header id="app-header" class="app-header"></header>
+            <main id="main" tabindex="-1"></main>
+            <div id="composer-area"></div>
+            <nav id="tabbar" class="tabbar" aria-label="主导航"></nav>
+          </div>
+          <div id="overlay-root"></div>
+          <div id="toast" class="toast" role="status" aria-live="polite"></div>
+          <div class="home-indicator" aria-hidden="true"></div>
+        </div>
+        <div class="device-caption">
+          <i class="dot"></i> 可交互原型 <span>·</span> 点击、输入,试试看
+        </div>
+      </div>
+      <aside class="design-notes">
+        <span class="eyebrow">体验,而不是功能重做</span>
+        <div class="note">
+          <span>01 / AWARENESS</span>
+          <h2>专注这一件,也看得见全局</h2>
+          <p>输入坞上沿,一步打开协作动态。进行中、待关注、已完成,不再只靠猜。</p>
+        </div>
+        <div class="note">
+          <span>02 / REACH</span>
+          <h2>切换靠近拇指,不挤发送按钮</h2>
+          <p>新建、切换与发送各有位置。Enter 只换行,避免把未写完的想法发出去。</p>
+        </div>
+        <div class="note">
+          <span>03 / CONTINUITY</span>
+          <h2>按会话记住,不按分身覆盖</h2>
+          <p>切换保留草稿。标题可直接编辑,同一数字生命中新建,不必重新选人。</p>
+        </div>
+        <div class="prototype-shortcuts">
+          <button data-experience="title">体验标题编辑 <span data-icon="arrow-right"></span></button
+          ><button data-experience="complete">
+            体验完成提醒 <span data-icon="arrow-right"></span>
+          </button>
+        </div>
+        <div class="scope-note">
+          <span data-icon="shield"></span
+          ><span>不接真实接口,不修改现有项目。<br />所有消息、文件和余额均为演示。</span>
+        </div>
+      </aside>
+    </div>
+    <input id="file-input" type="file" multiple hidden />
+    <script src="app.js"></script>
+  </body>
+</html>

+ 4328 - 0
prototypes/mobile-refresh-20261116/mobile-preview.html

@@ -0,0 +1,4328 @@
+<!doctype html>
+<html lang="zh-CN">
+  <head>
+    <meta charset="UTF-8" />
+    <meta
+      name="viewport"
+      content="width=device-width, initial-scale=1, viewport-fit=cover, interactive-widget=resizes-content"
+    />
+    <meta name="theme-color" content="#fafbf8" />
+    <title>fmode · 移动端体验提案</title>
+    <style>
+:root {
+  color-scheme: light;
+  --canvas: #fafbf8;
+  --surface: #fff;
+  --soft: #f0f2ed;
+  --ink: #252d28;
+  --muted: #899183;
+  --secondary: #697363;
+  --line: #e7ebe2;
+  --accent: #386b52;
+  --tint: #eaf1e8;
+  --danger: #ae514a;
+  --shade: #1a221c42;
+  font-family:
+    Inter,
+    'Noto Sans SC',
+    'PingFang SC',
+    'Microsoft YaHei',
+    -apple-system,
+    BlinkMacSystemFont,
+    'Segoe UI',
+    sans-serif;
+  -webkit-font-smoothing: antialiased;
+}
+* {
+  box-sizing: border-box;
+}
+body {
+  margin: 0;
+  background: #eef0eb;
+  color: var(--ink);
+}
+button,
+input,
+textarea,
+select {
+  font: inherit;
+  -webkit-tap-highlight-color: transparent;
+}
+button {
+  color: inherit;
+  cursor: pointer;
+  border: 0;
+  background: none;
+  touch-action: manipulation;
+}
+button:disabled {
+  cursor: default;
+  opacity: 0.4;
+}
+button:focus-visible,
+a:focus-visible,
+input:focus-visible,
+summary:focus-visible,
+textarea:focus-visible {
+  outline: 2px solid var(--accent);
+  outline-offset: 3px;
+}
+a {
+  color: inherit;
+  text-decoration: none;
+}
+svg {
+  width: 22px;
+  height: 22px;
+  stroke: currentColor;
+  stroke-width: 1.65;
+  fill: none;
+  stroke-linecap: round;
+  stroke-linejoin: round;
+  flex-shrink: 0;
+}
+button svg {
+  pointer-events: none;
+}
+h1,
+h2,
+h3,
+p {
+  margin: 0;
+}
+[hidden] {
+  display: none !important;
+}
+.presentation {
+  max-width: 1400px;
+  min-height: 100dvh;
+  margin: auto;
+  display: grid;
+  grid-template-columns: minmax(270px, 1fr) 424px minmax(200px, 0.74fr);
+  gap: 65px;
+  align-items: center;
+  padding: 35px 60px;
+}
+.intro {
+  align-self: stretch;
+  display: flex;
+  flex-direction: column;
+  padding: 16px 0 8px;
+}
+.studio-brand {
+  display: flex;
+  align-items: center;
+  gap: 9px;
+  font-size: 25px;
+  letter-spacing: -1px;
+  font-weight: 650;
+  flex-wrap: wrap;
+}
+.studio-brand svg {
+  width: 29px;
+  height: 29px;
+  color: var(--accent);
+}
+.edition {
+  width: 100%;
+  margin-top: 9px;
+  font-size: 9px;
+  color: #8c948a;
+  letter-spacing: 2px;
+  font-weight: 500;
+}
+.intro-copy {
+  margin-top: clamp(44px, 9vh, 100px);
+}
+.eyebrow {
+  font-size: 11px;
+  letter-spacing: 1.4px;
+  color: var(--muted);
+}
+.intro h1 {
+  font-size: clamp(31px, 3vw, 43px);
+  font-weight: 500;
+  letter-spacing: -1.9px;
+  line-height: 1.65;
+  margin: 15px 0 16px;
+}
+.intro-copy p {
+  font-size: 13px;
+  line-height: 2;
+  color: var(--secondary);
+}
+.proposal-tag {
+  display: inline-flex;
+  gap: 7px;
+  align-items: center;
+  border: 1px solid #d9dfd5;
+  border-radius: 20px;
+  padding: 7px 11px;
+  font-size: 10px;
+  color: var(--secondary);
+  margin-top: 23px;
+}
+.dot {
+  width: 6px;
+  height: 6px;
+  background: #64866b;
+  border-radius: 100%;
+  display: inline-block;
+  flex-shrink: 0;
+}
+.dot.offline {
+  background: #b1b6a9;
+}
+.scene-switch {
+  margin-top: 42px;
+  max-width: 285px;
+}
+.scene-switch > .eyebrow {
+  display: block;
+  margin-bottom: 12px;
+}
+.scene-switch button {
+  display: flex;
+  align-items: center;
+  gap: 15px;
+  border-bottom: 1px solid #dde2d8;
+  width: 100%;
+  padding: 15px 0;
+  font-size: 12px;
+  text-align: left;
+}
+.scene-switch button > span:first-child {
+  font-size: 10px;
+  color: #9ba397;
+  font-family: monospace;
+}
+.scene-switch button > span:last-child {
+  margin-left: auto;
+}
+.scene-switch svg {
+  width: 15px;
+  height: 15px;
+}
+.scene-switch button:hover,
+.scene-switch button.active {
+  color: var(--accent);
+}
+.intro-footer {
+  margin-top: auto;
+  padding-top: 40px;
+  font-size: 9px;
+  letter-spacing: 1.4px;
+  line-height: 2;
+  color: #677160;
+}
+.intro-footer span {
+  font-size: 10px;
+  letter-spacing: 0.3px;
+  color: #92998d;
+}
+.device-wrap {
+  width: 424px;
+}
+.device {
+  height: min(858px, calc(100dvh - 90px));
+  min-height: 660px;
+  width: 424px;
+  padding: 7px;
+  border-radius: 46px;
+  background: var(--canvas);
+  border: 1px solid #cdd2c8;
+  box-shadow:
+    0 30px 70px -30px #3f4b3c33,
+    0 0 0 5px #e5e8df,
+    0 0 0 6px #d9ded2;
+  position: relative;
+  overflow: hidden;
+  isolation: isolate;
+}
+.statusbar {
+  height: 40px;
+  padding: 6px 23px;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  font-size: 13px;
+  font-weight: 650;
+}
+.island {
+  position: absolute;
+  top: 15px;
+  left: 50%;
+  transform: translateX(-50%);
+  width: 99px;
+  height: 25px;
+  border-radius: 25px;
+  background: #242824;
+}
+.status-icons {
+  display: flex;
+  gap: 4px;
+  align-items: center;
+}
+.status-icons svg {
+  width: 15px;
+  height: 15px;
+  stroke-width: 1.9;
+}
+.status-icons > span:last-child svg {
+  width: 22px;
+}
+.home-indicator {
+  position: absolute;
+  bottom: 8px;
+  left: 50%;
+  transform: translateX(-50%);
+  height: 4px;
+  width: 118px;
+  background: var(--ink);
+  border-radius: 8px;
+  pointer-events: none;
+  z-index: 30;
+}
+.device-caption {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  gap: 8px;
+  margin-top: 18px;
+  font-size: 10px;
+  color: #8b9386;
+  letter-spacing: 0.5px;
+}
+.device-caption .dot {
+  width: 5px;
+  height: 5px;
+}
+.design-notes {
+  max-width: 235px;
+}
+.design-notes > .eyebrow {
+  font-size: 10px;
+  letter-spacing: 1px;
+}
+.note {
+  margin-top: 37px;
+  padding-top: 16px;
+  border-top: 1px solid #d9dfd3;
+}
+.note > span {
+  font-size: 9px;
+  letter-spacing: 1.5px;
+  color: #8b9682;
+}
+.note h2 {
+  font-size: 14px;
+  font-weight: 550;
+  margin: 12px 0 10px;
+  letter-spacing: -0.3px;
+}
+.note p {
+  font-size: 11px;
+  line-height: 2.1;
+  color: #86907d;
+}
+.scope-note {
+  display: flex;
+  gap: 8px;
+  margin-top: 39px;
+  font-size: 9px;
+  color: #91998a;
+  line-height: 2;
+}
+.scope-note svg {
+  width: 16px;
+  height: 16px;
+  margin-top: 2px;
+}
+.app {
+  height: calc(100% - 40px);
+  display: flex;
+  flex-direction: column;
+  overflow: hidden;
+  border-radius: 0 0 35px 35px;
+  font-size: 14px;
+}
+.app-header {
+  height: 64px;
+  min-height: 64px;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  gap: 10px;
+  padding: 4px 17px;
+  z-index: 2;
+  background: var(--canvas);
+}
+.icon-button {
+  min-width: 44px;
+  width: 44px;
+  height: 44px;
+  display: inline-flex;
+  align-items: center;
+  justify-content: center;
+  border-radius: 50%;
+  flex-shrink: 0;
+}
+.icon-button:hover {
+  background: var(--soft);
+}
+.header-center {
+  text-align: center;
+  min-width: 0;
+}
+.header-center strong {
+  font-size: 15px;
+  font-weight: 600;
+  letter-spacing: -0.4px;
+}
+.header-center small {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  gap: 5px;
+  color: var(--muted);
+  font-size: 10px;
+  margin-top: 5px;
+}
+.header-center .dot {
+  width: 5px;
+  height: 5px;
+}
+.header-brand {
+  display: flex;
+  align-items: center;
+  gap: 6px;
+}
+.header-brand svg {
+  width: 20px;
+  height: 20px;
+  color: var(--accent);
+}
+.header-brand strong {
+  font-size: 21px;
+  font-weight: 600;
+  letter-spacing: -0.9px;
+}
+.profile-button {
+  width: 34px;
+  height: 34px;
+  margin: 5px;
+  border-radius: 50%;
+  background: #e8ebdf;
+  color: #657151;
+  font-size: 12px;
+}
+.page-title {
+  flex: 1;
+  font-size: 20px;
+  letter-spacing: -0.5px;
+  font-weight: 600;
+}
+#main {
+  flex: 1;
+  min-height: 0;
+  overflow-y: auto;
+  overflow-x: hidden;
+  overscroll-behavior: contain;
+  scrollbar-width: none;
+  outline: none;
+}
+#main::-webkit-scrollbar {
+  display: none;
+}
+.screen {
+  padding: 6px 23px 24px;
+  animation: arrive 0.24s ease-out;
+}
+.home-screen {
+  min-height: 100%;
+  display: flex;
+  flex-direction: column;
+  padding-top: 31px;
+}
+.home-hero {
+  padding: 4px 1px 10px;
+}
+.hero-art {
+  display: grid;
+  place-items: center;
+  width: 65px;
+  height: 65px;
+  border-radius: 22px;
+  background: #eaf0e4;
+  color: var(--accent);
+  margin-bottom: 25px;
+  transform: rotate(-6deg);
+}
+.hero-art svg {
+  width: 42px;
+  height: 42px;
+  transform: rotate(6deg);
+}
+.home-hero .overline {
+  font-size: 11px;
+  color: var(--muted);
+  margin-bottom: 11px;
+  letter-spacing: 1px;
+}
+.home-hero h1 {
+  font-size: 31px;
+  letter-spacing: -1.4px;
+  line-height: 1.6;
+  font-weight: 500;
+}
+.home-hero p {
+  color: var(--muted);
+  font-size: 12px;
+  margin-top: 12px;
+  line-height: 1.9;
+}
+.prompts {
+  display: flex;
+  gap: 8px;
+  overflow-x: auto;
+  scrollbar-width: none;
+  padding: 19px 0 6px;
+  flex-shrink: 0;
+}
+.prompt {
+  white-space: nowrap;
+  font-size: 11px;
+  color: var(--secondary);
+  border: 1px solid var(--line);
+  padding: 10px 13px;
+  border-radius: 12px;
+  display: flex;
+  align-items: center;
+  gap: 6px;
+  background: var(--surface);
+}
+.prompt svg {
+  width: 14px;
+  height: 14px;
+}
+.recent-block {
+  margin-top: auto;
+  padding-top: 25px;
+}
+.section-label {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  color: var(--muted);
+  font-size: 10px;
+  letter-spacing: 0.6px;
+  margin: 0 0 10px;
+}
+.text-button {
+  min-height: 36px;
+  font-size: 11px;
+  display: inline-flex;
+  align-items: center;
+  gap: 4px;
+  color: var(--secondary);
+}
+.text-button svg {
+  width: 13px;
+  height: 13px;
+}
+.recent-row {
+  width: 100%;
+  display: flex;
+  align-items: center;
+  gap: 11px;
+  padding: 12px 0;
+  border-top: 1px solid var(--line);
+  text-align: left;
+}
+.recent-row > svg {
+  color: var(--muted);
+  width: 16px;
+  height: 16px;
+}
+.row-text {
+  flex: 1;
+  min-width: 0;
+}
+.recent-row strong {
+  font-size: 12px;
+  font-weight: 500;
+  white-space: nowrap;
+  text-overflow: ellipsis;
+  overflow: hidden;
+  display: block;
+}
+.recent-row small {
+  font-size: 10px;
+  color: var(--muted);
+  margin-top: 5px;
+  display: block;
+}
+.recent-row time {
+  font-size: 10px;
+  color: var(--muted);
+}
+#composer-area {
+  flex-shrink: 0;
+  padding: 6px 15px 18px;
+  background: var(--canvas);
+}
+#composer-area:empty {
+  display: none;
+}
+.composer {
+  border: 1px solid #dfe4d9;
+  background: var(--surface);
+  border-radius: 24px;
+  padding: 12px 12px 9px;
+  box-shadow: 0 3px 14px #26352005;
+  transition: border-color 0.2s;
+}
+.composer:focus-within {
+  border-color: #9bae98;
+}
+.composer textarea {
+  width: 100%;
+  min-height: 46px;
+  max-height: 116px;
+  resize: none;
+  display: block;
+  border: 0;
+  background: none;
+  outline: none !important;
+  color: var(--ink);
+  font-size: 16px;
+  line-height: 1.6;
+  padding: 3px 4px;
+}
+.composer textarea::placeholder {
+  color: var(--muted);
+  font-size: 14px;
+}
+.composer-tools {
+  display: flex;
+  align-items: center;
+  gap: 5px;
+}
+.composer-tools .icon-button {
+  width: 40px;
+  min-width: 40px;
+  height: 40px;
+  color: var(--secondary);
+}
+.agent-select {
+  display: flex;
+  gap: 6px;
+  align-items: center;
+  font-size: 10px;
+  padding: 0 5px;
+  height: 40px;
+  color: var(--secondary);
+  max-width: 205px;
+  white-space: nowrap;
+  overflow: hidden;
+}
+.agent-select svg {
+  width: 13px;
+  height: 13px;
+}
+.agent-select .dot {
+  width: 5px;
+  height: 5px;
+}
+.send-button {
+  width: 37px;
+  height: 37px;
+  min-height: 37px;
+  border-radius: 50%;
+  display: grid;
+  place-items: center;
+  background: var(--accent);
+  color: white;
+  margin-left: auto;
+}
+.send-button:disabled {
+  background: var(--soft);
+  color: #a0a89a;
+  opacity: 1;
+}
+.send-button svg {
+  width: 20px;
+  height: 20px;
+}
+.composer-footnote {
+  text-align: center;
+  color: var(--muted);
+  font-size: 9px;
+  margin-top: 10px;
+}
+.attachment-list {
+  display: flex;
+  gap: 6px;
+  flex-wrap: wrap;
+}
+.attachment-chip {
+  font-size: 10px;
+  border-radius: 8px;
+  background: var(--soft);
+  padding: 6px 8px;
+  display: flex;
+  align-items: center;
+  gap: 4px;
+  margin-bottom: 6px;
+  max-width: 100%;
+}
+.attachment-chip > span {
+  max-width: 230px;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}
+.attachment-chip button {
+  min-width: 32px;
+  min-height: 32px;
+  display: grid;
+  place-items: center;
+  margin: -5px;
+}
+.attachment-chip svg {
+  width: 12px;
+  height: 12px;
+}
+.tabbar {
+  display: flex;
+  padding: 8px 9px 22px;
+  gap: 3px;
+  border-top: 1px solid var(--line);
+  background: var(--canvas);
+  flex-shrink: 0;
+}
+.tabbar:empty {
+  display: none;
+}
+.tabbar button {
+  flex: 1;
+  min-height: 48px;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  flex-direction: column;
+  gap: 5px;
+  color: var(--muted);
+  font-size: 9px;
+}
+.tabbar button svg {
+  width: 21px;
+  height: 21px;
+}
+.tabbar button.active {
+  color: var(--accent);
+  font-weight: 600;
+}
+.tabbar button.active > span:first-child {
+  background: var(--tint);
+  border-radius: 12px;
+  padding: 2px 12px;
+  margin: -2px -12px;
+}
+.tabbar button > span:first-child {
+  height: 25px;
+  display: flex;
+  align-items: center;
+}
+.page-subtitle {
+  font-size: 11px;
+  color: var(--muted);
+  line-height: 1.8;
+  margin-bottom: 19px;
+}
+.search-field {
+  display: flex;
+  gap: 8px;
+  align-items: center;
+  border-radius: 13px;
+  background: var(--soft);
+  padding: 0 12px;
+  margin-bottom: 16px;
+  min-height: 44px;
+}
+.search-field svg {
+  width: 16px;
+  height: 16px;
+  color: var(--muted);
+}
+.search-field input {
+  width: 100%;
+  border: 0;
+  outline: none;
+  background: none;
+  font-size: 13px;
+  color: var(--ink);
+  min-height: 44px;
+}
+.search-field input::placeholder {
+  color: var(--muted);
+}
+.segmented {
+  display: flex;
+  gap: 5px;
+  border-bottom: 1px solid var(--line);
+  margin-bottom: 19px;
+}
+.segmented button {
+  position: relative;
+  min-height: 42px;
+  flex: 1;
+  font-size: 12px;
+  color: var(--muted);
+  white-space: nowrap;
+}
+.segmented button.active {
+  color: var(--ink);
+  font-weight: 600;
+}
+.segmented button.active:after {
+  position: absolute;
+  content: '';
+  width: 18px;
+  height: 2px;
+  background: var(--accent);
+  bottom: -1px;
+  left: calc(50% - 9px);
+  border-radius: 2px;
+}
+.group-heading {
+  color: var(--muted);
+  font-size: 10px;
+  margin: 24px 0 5px;
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+}
+.conversation-row {
+  display: flex;
+  align-items: center;
+  gap: 7px;
+  padding: 17px 0;
+  border-bottom: 1px solid var(--line);
+}
+.avatar {
+  width: 39px;
+  height: 39px;
+  flex-shrink: 0;
+  border-radius: 14px;
+  display: grid;
+  place-items: center;
+  background: var(--tint);
+  color: var(--accent);
+  font-size: 13px;
+}
+.avatar svg {
+  width: 22px;
+  height: 22px;
+}
+.avatar.clay {
+  background: #f1eae4;
+  color: #95745e;
+}
+.avatar.lilac {
+  background: #eeebf5;
+  color: #8b7eaa;
+}
+.avatar.person {
+  border-radius: 50%;
+}
+.conversation-open {
+  display: flex;
+  gap: 11px;
+  text-align: left;
+  flex: 1;
+  min-width: 0;
+  padding: 0;
+}
+.conversation-body {
+  flex: 1;
+  min-width: 0;
+}
+.conversation-top {
+  display: flex;
+  align-items: center;
+  gap: 5px;
+}
+.conversation-top strong {
+  font-size: 13px;
+  font-weight: 550;
+  overflow: hidden;
+  white-space: nowrap;
+  text-overflow: ellipsis;
+  flex: 1;
+}
+.conversation-top time {
+  font-size: 9px;
+  color: var(--muted);
+  flex-shrink: 0;
+}
+.conversation-body p {
+  font-size: 11px;
+  color: var(--muted);
+  line-height: 1.6;
+  overflow: hidden;
+  white-space: nowrap;
+  text-overflow: ellipsis;
+  margin: 6px 0;
+}
+.conversation-meta {
+  display: flex;
+  align-items: center;
+  gap: 5px;
+  font-size: 9px;
+  color: var(--secondary);
+}
+.conversation-meta .dot {
+  width: 4px;
+  height: 4px;
+}
+.unread {
+  border-radius: 6px;
+  background: var(--accent);
+  color: #fff;
+  min-width: 16px;
+  padding: 2px 4px;
+  font-size: 9px;
+  text-align: center;
+}
+.row-more {
+  width: 30px;
+  min-height: 44px;
+  padding: 0;
+  display: grid;
+  place-items: center;
+  color: var(--muted);
+  align-self: flex-start;
+  margin-top: -7px;
+}
+.row-more svg {
+  width: 17px;
+}
+.workspace {
+  border-bottom: 1px solid var(--line);
+}
+.workspace-head {
+  display: flex;
+  align-items: center;
+  gap: 8px;
+  padding: 12px 0;
+}
+.workspace-toggle {
+  min-height: 40px;
+  flex: 1;
+  display: flex;
+  align-items: center;
+  gap: 9px;
+  text-align: left;
+  font-size: 13px;
+}
+.workspace-toggle svg {
+  width: 17px;
+  color: var(--secondary);
+}
+.workspace-toggle small {
+  color: var(--muted);
+  font-size: 10px;
+  margin-left: auto;
+}
+.workspace > div {
+  padding-left: 12px;
+}
+.workspace .icon-button {
+  min-width: 35px;
+  width: 35px;
+  height: 40px;
+  color: var(--muted);
+}
+.workspace .icon-button svg {
+  width: 17px;
+}
+.empty-state {
+  padding: 55px 15px;
+  text-align: center;
+  color: var(--muted);
+}
+.empty-state > svg {
+  width: 32px;
+  height: 32px;
+  margin-bottom: 15px;
+}
+.empty-state strong {
+  display: block;
+  font-size: 14px;
+  color: var(--ink);
+  font-weight: 500;
+}
+.empty-state p {
+  font-size: 12px;
+  line-height: 1.8;
+  margin-top: 9px;
+}
+.empty-state button {
+  margin-top: 16px;
+}
+.primary-button {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  gap: 7px;
+  width: 100%;
+  min-height: 47px;
+  border-radius: 14px;
+  background: var(--accent);
+  color: #fff;
+  font-size: 13px;
+}
+.secondary-button {
+  min-height: 44px;
+  border: 1px solid var(--line);
+  background: var(--surface);
+  border-radius: 12px;
+  font-size: 12px;
+  padding: 0 16px;
+}
+.primary-button svg {
+  width: 17px;
+}
+.button-row {
+  display: flex;
+  gap: 9px;
+  margin-top: 20px;
+}
+.button-row > * {
+  flex: 1;
+}
+.danger {
+  color: var(--danger) !important;
+}
+.chat-screen {
+  padding: 12px 23px 15px;
+  font-size: var(--chat-font, 15px);
+  line-height: 1.9;
+}
+.chat-date {
+  text-align: center;
+  color: var(--muted);
+  font-size: 9px;
+  margin: 2px 0 25px;
+  letter-spacing: 1px;
+}
+.user-message {
+  display: flex;
+  justify-content: flex-end;
+  margin: 20px 0 28px;
+}
+.user-bubble {
+  background: #edf0e7;
+  max-width: 88%;
+  padding: 12px 16px;
+  border-radius: 19px 19px 5px 19px;
+  line-height: 1.85;
+  font-size: 13px;
+  overflow-wrap: anywhere;
+}
+.user-file {
+  display: block;
+  font-size: 10px;
+  color: var(--secondary);
+  padding-top: 5px;
+}
+.assistant-heading {
+  display: flex;
+  gap: 8px;
+  align-items: center;
+  margin-bottom: 16px;
+  font-size: 11px;
+  color: var(--secondary);
+}
+.assistant-heading > svg {
+  width: 21px;
+  height: 21px;
+  color: var(--accent);
+}
+.assistant-heading time {
+  margin-left: auto;
+  font-size: 9px;
+  color: var(--muted);
+}
+.process {
+  margin-bottom: 18px;
+  border: 1px solid var(--line);
+  border-radius: 13px;
+  padding: 0 12px;
+  background: var(--surface);
+}
+.process summary {
+  cursor: pointer;
+  list-style: none;
+  display: flex;
+  gap: 7px;
+  align-items: center;
+  min-height: 42px;
+  font-size: 10px;
+  color: var(--secondary);
+}
+.process summary::-webkit-details-marker {
+  display: none;
+}
+.process summary svg {
+  width: 14px;
+  height: 14px;
+  color: var(--accent);
+}
+.process summary .chevron {
+  margin-left: auto;
+  transition: transform 0.2s;
+}
+.process[open] summary .chevron {
+  transform: rotate(180deg);
+}
+.process ol {
+  padding: 0 0 10px 21px;
+  margin: 0;
+  color: var(--muted);
+  font-size: 10px;
+  line-height: 2.4;
+}
+.assistant-body {
+  overflow-wrap: anywhere;
+}
+.assistant-body h2 {
+  font-size: 18px;
+  font-weight: 600;
+  letter-spacing: -0.5px;
+  line-height: 1.6;
+  margin: 21px 0 12px;
+}
+.assistant-body p {
+  margin: 0 0 14px;
+}
+.assistant-body ul {
+  padding-left: 19px;
+  margin: 0 0 17px;
+}
+.assistant-body li {
+  margin-bottom: 8px;
+}
+.assistant-body strong {
+  font-weight: 600;
+}
+.assistant-body blockquote {
+  margin: 18px 0;
+  padding: 3px 0 3px 13px;
+  border-left: 2px solid #9bb192;
+  color: var(--secondary);
+  font-size: 13px;
+}
+.file-card {
+  display: flex;
+  align-items: center;
+  gap: 11px;
+  width: 100%;
+  text-align: left;
+  padding: 14px;
+  border: 1px solid var(--line);
+  border-radius: 15px;
+  margin: 18px 0;
+  background: var(--surface);
+}
+.file-badge {
+  height: 39px;
+  width: 33px;
+  border: 1px solid #dce5d7;
+  border-radius: 6px;
+  background: var(--tint);
+  color: var(--accent);
+  font-size: 9px;
+  display: grid;
+  place-items: center;
+  font-weight: 600;
+  flex-shrink: 0;
+}
+.file-card strong {
+  display: block;
+  font-size: 12px;
+  font-weight: 500;
+}
+.file-card small {
+  font-size: 9px;
+  color: var(--muted);
+  display: block;
+  margin-top: 5px;
+}
+.file-card > svg {
+  width: 17px;
+  color: var(--muted);
+  margin-left: auto;
+}
+.message-actions {
+  display: flex;
+  gap: 7px;
+  align-items: center;
+  margin: 13px 0 24px;
+  color: var(--muted);
+}
+.message-actions button {
+  width: 37px;
+  height: 37px;
+  display: grid;
+  place-items: center;
+}
+.message-actions svg {
+  width: 16px;
+  height: 16px;
+}
+.message-actions small {
+  font-size: 9px;
+  margin-left: auto;
+}
+.typing {
+  display: flex;
+  align-items: center;
+  gap: 4px;
+  color: var(--muted);
+  font-size: 11px;
+  padding: 10px 0;
+}
+.typing i {
+  width: 4px;
+  height: 4px;
+  background: var(--accent);
+  border-radius: 50%;
+  animation: pulse 1s infinite;
+}
+.typing i:nth-child(2) {
+  animation-delay: 0.15s;
+}
+.typing i:nth-child(3) {
+  animation-delay: 0.3s;
+}
+.connection-banner {
+  display: flex;
+  gap: 7px;
+  align-items: center;
+  background: #f4ede1;
+  color: #906f3e;
+  border-radius: 10px;
+  padding: 10px;
+  font-size: 11px;
+  margin-bottom: 12px;
+  width: 100%;
+}
+.connection-banner svg {
+  width: 16px;
+}
+.overview {
+  display: grid;
+  grid-template-columns: repeat(3, 1fr);
+  background: var(--tint);
+  border-radius: 18px;
+  padding: 19px 13px;
+  margin: 3px 0 23px;
+}
+.overview > div {
+  padding-left: 10px;
+  border-right: 1px solid #d8e2d3;
+}
+.overview > div:last-child {
+  border: 0;
+}
+.overview strong {
+  display: block;
+  font-size: 23px;
+  letter-spacing: -1px;
+  font-weight: 500;
+  margin-bottom: 5px;
+}
+.overview small {
+  font-size: 10px;
+  color: var(--secondary);
+}
+.agent-card {
+  padding: 18px;
+  border: 1px solid var(--line);
+  border-radius: 18px;
+  background: var(--surface);
+  margin: 13px 0;
+}
+.agent-card-head {
+  display: flex;
+  align-items: center;
+  gap: 10px;
+}
+.agent-card-head h2 {
+  font-size: 14px;
+  font-weight: 550;
+}
+.agent-card-head small {
+  display: flex;
+  align-items: center;
+  gap: 5px;
+  margin-top: 6px;
+  font-size: 10px;
+  color: var(--muted);
+}
+.agent-card-head > .tag {
+  margin-left: auto;
+}
+.tag {
+  display: inline-flex;
+  align-items: center;
+  gap: 5px;
+  border-radius: 6px;
+  background: var(--tint);
+  color: var(--accent);
+  font-size: 9px;
+  padding: 5px 7px;
+}
+.tag.offline {
+  background: var(--soft);
+  color: var(--muted);
+}
+.agent-current {
+  font-size: 11px;
+  color: var(--secondary);
+  line-height: 1.8;
+  margin: 16px 0;
+  padding: 11px;
+  border-radius: 10px;
+  background: var(--canvas);
+}
+.agent-metrics {
+  display: flex;
+  gap: 20px;
+  font-size: 9px;
+  color: var(--muted);
+  margin-bottom: 15px;
+}
+.agent-metrics b {
+  font-weight: 500;
+  color: var(--secondary);
+  margin-left: 3px;
+}
+.agent-actions {
+  display: flex;
+  border-top: 1px solid var(--line);
+  padding-top: 9px;
+  gap: 7px;
+}
+.agent-actions button {
+  font-size: 10px;
+  min-height: 38px;
+  flex: 1;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  gap: 5px;
+  color: var(--secondary);
+}
+.agent-actions button:last-child {
+  color: var(--accent);
+  background: var(--tint);
+  border-radius: 9px;
+}
+.agent-actions svg {
+  width: 14px;
+  height: 14px;
+}
+.contact-row {
+  display: flex;
+  align-items: center;
+  gap: 11px;
+  padding: 17px 0;
+  border-bottom: 1px solid var(--line);
+}
+.contact-row > button {
+  padding: 0;
+  flex: 1;
+  text-align: left;
+  display: flex;
+  gap: 11px;
+  align-items: center;
+  min-height: 44px;
+}
+.contact-row strong {
+  font-size: 13px;
+  font-weight: 500;
+}
+.contact-row small {
+  display: block;
+  font-size: 10px;
+  color: var(--muted);
+  margin-top: 6px;
+}
+.contact-row > svg {
+  width: 16px;
+  color: var(--muted);
+}
+.contact-department {
+  font-size: 10px;
+  color: var(--muted);
+  margin: 22px 0 2px;
+}
+.profile-card {
+  padding: 18px 0 25px;
+  display: flex;
+  gap: 13px;
+  align-items: center;
+}
+.profile-card .avatar {
+  width: 55px;
+  height: 55px;
+  font-size: 21px;
+  background: #e9ecdf;
+  color: #6c7856;
+  border-radius: 19px;
+}
+.profile-card h2 {
+  font-size: 19px;
+  font-weight: 500;
+}
+.profile-card p {
+  font-size: 10px;
+  color: var(--muted);
+  margin-top: 8px;
+}
+.settings-group {
+  margin: 10px 0 26px;
+}
+.settings-group h2 {
+  font-size: 10px;
+  color: var(--muted);
+  font-weight: 500;
+  margin-bottom: 11px;
+}
+.settings-row {
+  display: flex;
+  align-items: center;
+  gap: 10px;
+  min-height: 58px;
+  border-bottom: 1px solid var(--line);
+  width: 100%;
+  font-size: 12px;
+  text-align: left;
+}
+.settings-row > svg {
+  width: 18px;
+  color: var(--secondary);
+}
+.settings-row small {
+  margin-left: auto;
+  font-size: 10px;
+  color: var(--muted);
+}
+.settings-row > svg:last-child {
+  width: 14px;
+  margin-left: auto;
+  color: var(--muted);
+}
+.settings-row small + svg {
+  margin-left: 0 !important;
+}
+.toggle {
+  margin-left: auto;
+  width: 37px;
+  height: 23px;
+  border-radius: 20px;
+  background: #d9dfd2;
+  padding: 3px;
+}
+.toggle:before {
+  content: '';
+  display: block;
+  width: 17px;
+  height: 17px;
+  border-radius: 50%;
+  background: #fff;
+  box-shadow: 0 1px 3px #0001;
+  transition: transform 0.2s;
+}
+.toggle.on {
+  background: var(--accent);
+}
+.toggle.on:before {
+  transform: translateX(14px);
+}
+.palette-row {
+  display: flex;
+  gap: 10px;
+  padding: 10px 0;
+}
+.palette-option {
+  width: 44px;
+  height: 44px;
+  border-radius: 50%;
+  border: 1px solid var(--line);
+  display: grid;
+  place-items: center;
+}
+.palette-option > span {
+  width: 27px;
+  height: 27px;
+  border-radius: 50%;
+  background: var(--swatch);
+}
+.palette-option.active {
+  border-color: var(--accent);
+  box-shadow: 0 0 0 2px var(--tint);
+}
+.version-text {
+  text-align: center;
+  color: var(--muted);
+  font-size: 10px;
+  line-height: 1.9;
+  padding-top: 8px;
+}
+.font-options {
+  display: flex;
+  gap: 6px;
+  margin: 14px 0;
+}
+.font-options button {
+  min-height: 42px;
+  flex: 1;
+  border: 1px solid var(--line);
+  border-radius: 10px;
+  font-size: 11px;
+}
+.font-options button.active {
+  background: var(--tint);
+  border-color: var(--accent);
+  color: var(--accent);
+}
+#overlay-root {
+  position: absolute;
+  inset: 0;
+  z-index: 20;
+  pointer-events: none;
+}
+#overlay-root:not(:empty) {
+  pointer-events: auto;
+}
+.backdrop {
+  position: absolute;
+  inset: 0;
+  background: var(--shade);
+  animation: fade 0.2s;
+}
+.sheet {
+  position: absolute;
+  bottom: 0;
+  left: 0;
+  right: 0;
+  max-height: 88%;
+  display: flex;
+  flex-direction: column;
+  background: var(--canvas);
+  border-radius: 27px 27px 0 0;
+  padding: 0 23px 30px;
+  box-shadow: 0 -8px 30px #00000005;
+  animation: sheet-in 0.25s cubic-bezier(0.2, 0.7, 0.2, 1);
+}
+.sheet-handle {
+  width: 34px;
+  height: 4px;
+  border-radius: 3px;
+  background: var(--line);
+  align-self: center;
+  margin: 10px 0 3px;
+  flex-shrink: 0;
+  min-height: 4px;
+}
+.sheet-header {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  gap: 10px;
+  min-height: 61px;
+  flex-shrink: 0;
+}
+.sheet-header h2 {
+  font-size: 17px;
+  font-weight: 550;
+}
+.sheet-header .icon-button {
+  margin-right: -10px;
+}
+.sheet-body {
+  overflow: auto;
+  min-height: 0;
+  scrollbar-width: none;
+  overscroll-behavior: contain;
+}
+.sheet-description {
+  font-size: 11px;
+  line-height: 1.9;
+  color: var(--muted);
+  margin: 0 0 17px;
+}
+.sheet-list-button {
+  display: flex;
+  align-items: center;
+  gap: 12px;
+  min-height: 59px;
+  width: 100%;
+  border-bottom: 1px solid var(--line);
+  text-align: left;
+  font-size: 13px;
+}
+.sheet-list-button > svg {
+  width: 19px;
+  color: var(--secondary);
+}
+.sheet-list-button .selected-check {
+  color: var(--accent);
+  margin-left: auto;
+}
+.sheet-list-button small {
+  display: block;
+  color: var(--muted);
+  font-size: 10px;
+  margin-top: 5px;
+}
+.sheet-list-button .avatar {
+  width: 37px;
+  height: 37px;
+  border-radius: 12px;
+}
+.sheet-list-button > span:nth-child(2) {
+  flex: 1;
+}
+.sheet .segmented {
+  flex-shrink: 0;
+}
+.sheet-item {
+  padding: 15px 0;
+  border-bottom: 1px solid var(--line);
+  font-size: 12px;
+}
+.sheet-item strong {
+  font-size: 12px;
+  font-weight: 500;
+}
+.sheet-item p {
+  font-size: 11px;
+  color: var(--muted);
+  line-height: 1.8;
+  margin-top: 8px;
+}
+.sheet-item .tag {
+  float: right;
+}
+.sheet-form label {
+  display: block;
+  font-size: 11px;
+  color: var(--secondary);
+  margin-bottom: 8px;
+}
+.sheet-form input,
+.sheet-form select {
+  width: 100%;
+  border: 1px solid var(--line);
+  background: var(--surface);
+  color: var(--ink);
+  border-radius: 11px;
+  min-height: 47px;
+  padding: 0 12px;
+  font-size: 14px;
+}
+.sheet-form .primary-button {
+  margin-top: 17px;
+}
+.form-error {
+  color: var(--danger);
+  font-size: 11px;
+  line-height: 1.7;
+  min-height: 22px;
+  padding-top: 5px;
+}
+.drawer {
+  position: absolute;
+  left: 0;
+  top: 0;
+  bottom: 0;
+  width: 88%;
+  max-width: 355px;
+  background: var(--canvas);
+  border-radius: 0 22px 22px 0;
+  display: flex;
+  flex-direction: column;
+  padding: 40px 20px 24px;
+  animation: drawer-in 0.25s cubic-bezier(0.2, 0.7, 0.2, 1);
+}
+.drawer-header {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  min-height: 44px;
+}
+.drawer > .primary-button {
+  margin: 19px 0 15px;
+  flex-shrink: 0;
+}
+.drawer > .search-field {
+  margin-bottom: 5px;
+  flex-shrink: 0;
+}
+.drawer-scroll {
+  flex: 1;
+  overflow: auto;
+  scrollbar-width: none;
+  margin: 5px -2px;
+  padding: 0 2px;
+}
+.drawer .group-heading {
+  padding: 0 4px;
+  margin-top: 13px;
+  min-height: 35px;
+}
+.drawer-history {
+  width: 100%;
+  display: flex;
+  gap: 7px;
+  align-items: center;
+  text-align: left;
+  min-height: 44px;
+  padding: 0 9px;
+  font-size: 11px;
+  border-radius: 9px;
+}
+.drawer-history.active {
+  background: var(--tint);
+  color: var(--accent);
+}
+.drawer-history svg {
+  width: 14px;
+  color: var(--muted);
+}
+.drawer-history span {
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}
+.drawer-nav {
+  display: grid;
+  grid-template-columns: repeat(4, 1fr);
+  border-top: 1px solid var(--line);
+  padding-top: 13px;
+  flex-shrink: 0;
+}
+.drawer-nav button {
+  min-height: 49px;
+  display: flex;
+  flex-direction: column;
+  gap: 6px;
+  align-items: center;
+  justify-content: center;
+  font-size: 9px;
+  color: var(--secondary);
+}
+.drawer-nav svg {
+  width: 20px;
+  height: 20px;
+}
+.drawer-bottom {
+  font-size: 9px;
+  color: var(--muted);
+  text-align: center;
+  margin-top: 15px;
+}
+.preview-document {
+  padding: 22px;
+  background: var(--surface);
+  border: 1px solid var(--line);
+  border-radius: 6px;
+  font-size: 11px;
+  line-height: 2;
+  margin: 5px 0 17px;
+  min-height: 280px;
+}
+.preview-document h1 {
+  font-size: 21px;
+  margin: 15px 0;
+}
+.preview-document h2 {
+  font-size: 14px;
+  margin: 18px 0 8px;
+}
+.preview-document p {
+  color: var(--secondary);
+  margin-bottom: 12px;
+}
+.preview-document table {
+  border-collapse: collapse;
+  width: 100%;
+  font-size: 10px;
+  margin: 18px 0;
+}
+.preview-document td,
+.preview-document th {
+  padding: 8px 4px;
+  text-align: left;
+  border-bottom: 1px solid var(--line);
+}
+.preview-document th {
+  background: var(--soft);
+}
+.toast {
+  position: absolute;
+  left: 50%;
+  bottom: 130px;
+  transform: translate(-50%, 8px);
+  background: #28392eeb;
+  color: #fff;
+  padding: 12px 17px;
+  border-radius: 13px;
+  z-index: 40;
+  font-size: 11px;
+  line-height: 1.7;
+  max-width: 85%;
+  width: max-content;
+  opacity: 0;
+  pointer-events: none;
+  transition:
+    opacity 0.2s,
+    transform 0.2s;
+  text-align: center;
+}
+.toast.visible {
+  opacity: 1;
+  transform: translate(-50%, 0);
+}
+.state-chips {
+  display: flex;
+  flex-wrap: wrap;
+  gap: 7px;
+  padding: 8px 0 18px;
+}
+.state-chips button {
+  border: 1px solid var(--line);
+  border-radius: 9px;
+  padding: 10px;
+  font-size: 11px;
+}
+.state-chips button.active {
+  background: var(--tint);
+  color: var(--accent);
+  border-color: var(--accent);
+}
+.device.dark {
+  color-scheme: dark;
+  --canvas: #1e2520;
+  --surface: #252e27;
+  --soft: #2b342d;
+  --ink: #e1e7dc;
+  --muted: #8f9c8b;
+  --secondary: #aeb9a7;
+  --line: #354035;
+  --accent: #a4c59a;
+  --tint: #303f30;
+  --shade: #080f0bbb;
+}
+.dark .send-button,
+.dark .primary-button,
+.dark .unread {
+  color: #1e2520;
+}
+.dark .user-bubble {
+  background: #303c2e;
+}
+.dark .hero-art {
+  background: #303c2c;
+}
+.dark .composer {
+  border-color: #43503e;
+}
+.dark .profile-button {
+  background: #35412f;
+  color: #b8c8aa;
+}
+.dark .overview > div {
+  border-color: #43513e;
+}
+.dark .file-badge {
+  border-color: #4c5e45;
+}
+.dark .avatar.clay {
+  background: #40362e;
+  color: #c6ab96;
+}
+.dark .avatar.lilac {
+  background: #36313e;
+  color: #b4a6cc;
+}
+.dark .connection-banner {
+  background: #403729;
+  color: #d8bb87;
+}
+.dark .profile-card .avatar {
+  background: #38432e;
+  color: #bbcca3;
+}
+@keyframes arrive {
+  from {
+    opacity: 0;
+    transform: translateY(5px);
+  }
+  to {
+    opacity: 1;
+    transform: translateY(0);
+  }
+}
+@keyframes fade {
+  from {
+    opacity: 0;
+  }
+  to {
+    opacity: 1;
+  }
+}
+@keyframes sheet-in {
+  from {
+    transform: translateY(50px);
+    opacity: 0.3;
+  }
+  to {
+    transform: translateY(0);
+    opacity: 1;
+  }
+}
+@keyframes drawer-in {
+  from {
+    transform: translateX(-35px);
+    opacity: 0.4;
+  }
+  to {
+    transform: translateX(0);
+    opacity: 1;
+  }
+}
+@keyframes pulse {
+  0%,
+  80%,
+  100% {
+    opacity: 0.25;
+    transform: translateY(0);
+  }
+  40% {
+    opacity: 1;
+    transform: translateY(-3px);
+  }
+}
+@media (max-width: 1200px) {
+  .presentation {
+    grid-template-columns: 1fr 424px;
+    max-width: 1000px;
+    gap: 65px;
+    padding: 35px 60px;
+  }
+  .design-notes {
+    display: none;
+  }
+}
+@media (max-width: 820px) {
+  .presentation {
+    display: flex;
+    justify-content: center;
+    padding: 30px 0;
+    min-height: 100dvh;
+  }
+  .intro {
+    display: none;
+  }
+  .device {
+    height: min(858px, calc(100dvh - 75px));
+  }
+}
+@media (max-width: 520px) {
+  body {
+    background: var(--canvas);
+  }
+  .presentation {
+    display: block;
+    padding: 0;
+    min-height: 0;
+  }
+  .device-wrap {
+    width: 100%;
+  }
+  .device {
+    width: 100%;
+    height: 100dvh;
+    min-height: 0;
+    padding: 0;
+    border: 0;
+    border-radius: 0;
+    box-shadow: none;
+  }
+  .statusbar,
+  .home-indicator,
+  .device-caption {
+    display: none;
+  }
+  .app {
+    height: 100%;
+    border-radius: 0;
+    padding-top: env(safe-area-inset-top);
+  }
+  .app-header {
+    height: 64px;
+    min-height: 64px;
+  }
+  #composer-area {
+    padding-bottom: max(13px, env(safe-area-inset-bottom));
+  }
+  .tabbar {
+    padding-bottom: max(9px, env(safe-area-inset-bottom));
+  }
+  .drawer {
+    padding-top: max(19px, env(safe-area-inset-top));
+    padding-bottom: max(20px, env(safe-area-inset-bottom));
+  }
+  .sheet {
+    padding-bottom: max(25px, env(safe-area-inset-bottom));
+  }
+  .home-screen {
+    padding-top: clamp(15px, 5vh, 42px);
+  }
+  .home-hero h1 {
+    font-size: 32px;
+  }
+  .toast {
+    bottom: 145px;
+  }
+}
+@media (max-width: 360px) {
+  .screen {
+    padding-left: 18px;
+    padding-right: 18px;
+  }
+  .home-hero h1 {
+    font-size: 29px;
+  }
+  .home-hero p {
+    font-size: 11px;
+  }
+  .home-screen {
+    padding-top: 15px;
+  }
+  .hero-art {
+    margin-bottom: 16px;
+    width: 55px;
+    height: 55px;
+  }
+  .home-hero .overline {
+    font-size: 10px;
+  }
+  .agent-select {
+    max-width: 180px;
+  }
+  .conversation-top strong {
+    font-size: 12px;
+  }
+}
+@media (max-height: 740px) {
+  .home-screen {
+    padding-top: 10px;
+  }
+  .hero-art {
+    margin-bottom: 12px;
+    width: 48px;
+    height: 48px;
+    border-radius: 16px;
+  }
+  .hero-art svg {
+    width: 32px;
+    height: 32px;
+  }
+  .home-hero h1 {
+    font-size: 27px;
+    line-height: 1.5;
+  }
+  .home-hero p {
+    margin-top: 7px;
+  }
+  .prompts {
+    padding-top: 12px;
+  }
+  .recent-block {
+    padding-top: 14px;
+  }
+  .recent-row {
+    padding: 9px 0;
+  }
+  .composer-footnote {
+    margin-top: 7px;
+  }
+  .home-hero .overline {
+    margin-bottom: 7px;
+  }
+  .home-screen {
+    padding-bottom: 12px;
+  }
+}
+@media (prefers-reduced-motion: reduce) {
+  *,
+  *:before,
+  *:after {
+    animation: none !important;
+    transition: none !important;
+    scroll-behavior: auto !important;
+  }
+}
+
+.home-hero p {
+  font-size: 13px;
+}
+.prompt {
+  min-height: 44px;
+  font-size: 12px;
+}
+.recent-row {
+  min-height: 65px;
+}
+.recent-row strong {
+  font-size: 14px;
+}
+.recent-row small {
+  font-size: 11px;
+}
+.recent-row time {
+  font-size: 11px;
+}
+.section-label {
+  font-size: 11px;
+}
+.text-button {
+  font-size: 12px;
+  min-height: 44px;
+}
+.conversation-top strong {
+  font-size: 14px;
+}
+.conversation-body p {
+  font-size: 12px;
+}
+.conversation-meta {
+  font-size: 10px;
+}
+.conversation-top time {
+  font-size: 10px;
+}
+.segmented button {
+  min-height: 44px;
+  font-size: 13px;
+}
+.contact-row strong {
+  font-size: 14px;
+}
+.contact-row small {
+  font-size: 12px;
+}
+.tabbar button {
+  font-size: 10px;
+}
+.page-subtitle {
+  font-size: 12px;
+}
+.agent-card-head small {
+  font-size: 11px;
+}
+.agent-current {
+  font-size: 12px;
+}
+.agent-metrics {
+  font-size: 10px;
+}
+.agent-actions button {
+  min-height: 44px;
+  font-size: 11px;
+}
+.sheet-description {
+  font-size: 12px;
+}
+.sheet-list-button {
+  min-height: 63px;
+}
+.sheet-list-button small {
+  font-size: 11px;
+}
+.process summary {
+  font-size: 11px;
+  min-height: 44px;
+}
+.process ol {
+  font-size: 12px;
+}
+.user-bubble {
+  font-size: 14px;
+}
+.assistant-heading {
+  font-size: 12px;
+}
+.settings-row {
+  font-size: 14px;
+}
+.settings-row small {
+  font-size: 11px;
+}
+.composer-tools .icon-button {
+  width: 44px;
+  min-width: 44px;
+  height: 44px;
+}
+.send-button {
+  width: 44px;
+  height: 44px;
+  min-height: 44px;
+}
+.agent-select {
+  height: 44px;
+  font-size: 11px;
+}
+.user-file svg {
+  width: 13px;
+  height: 13px;
+  vertical-align: middle;
+}
+.hero-art {
+  flex-shrink: 0;
+}
+
+.header-center {
+  flex: 1;
+}
+.header-title {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  gap: 7px;
+  min-height: 31px;
+  width: 100%;
+  padding: 0;
+}
+.header-title strong {
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+  font-size: 15px;
+}
+.header-title svg {
+  width: 12px;
+  height: 12px;
+  color: var(--muted);
+}
+.subtitle-separator {
+  color: var(--line);
+  margin: 0 3px;
+}
+.collaboration-rail {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  gap: 8px;
+  padding: 0 2px 8px;
+}
+.quick-current {
+  min-height: 44px;
+  display: flex;
+  align-items: center;
+  gap: 6px;
+  font-size: 11px;
+  color: var(--secondary);
+  padding: 0 7px;
+}
+.quick-current svg {
+  width: 15px;
+  height: 15px;
+}
+.quick-agent {
+  color: var(--muted);
+}
+.activity-entry {
+  min-height: 36px;
+  display: flex;
+  align-items: center;
+  gap: 7px;
+  font-size: 11px;
+  color: var(--accent);
+  padding: 0 11px;
+  border: 1px solid var(--line);
+  border-radius: 30px;
+  background: var(--surface);
+  position: relative;
+}
+.activity-entry:after {
+  content: '';
+  position: absolute;
+  inset: -4px 0;
+}
+.activity-entry svg {
+  width: 13px;
+  height: 13px;
+}
+.activity-orbit {
+  width: 7px;
+  height: 7px;
+  border: 1px solid var(--muted);
+  border-radius: 50%;
+}
+.activity-orbit.running {
+  border-color: var(--accent);
+  background: var(--accent);
+  box-shadow: 0 0 0 3px var(--tint);
+  animation: breathe 2.6s ease-in-out infinite;
+}
+.attention-count {
+  min-width: 17px;
+  height: 17px;
+  border-radius: 6px;
+  color: #a56434;
+  background: #f7eddf;
+  display: grid;
+  place-items: center;
+  font-size: 9px;
+  margin-left: 1px;
+}
+.activity-text {
+  color: var(--muted);
+}
+.activity-text.running,
+.activity-text.done {
+  color: var(--accent);
+}
+.activity-text.attention {
+  color: #ac6941;
+}
+.inline-activity {
+  font-size: 10px;
+  display: inline-flex;
+  align-items: center;
+  gap: 5px;
+  white-space: nowrap;
+}
+.inline-activity:before {
+  content: '';
+  width: 4px;
+  height: 4px;
+  border-radius: 50%;
+  background: currentColor;
+}
+.conversation-meta .inline-activity {
+  margin-left: auto;
+}
+.inline-activity.running {
+  color: var(--accent);
+}
+.inline-activity.attention {
+  color: #a86a40;
+}
+.inline-activity.done {
+  color: #718468;
+}
+.inline-activity.idle {
+  color: var(--muted);
+}
+.activity-sheet {
+  height: 86%;
+}
+.activity-sheet .search-field {
+  position: sticky;
+  top: 0;
+  z-index: 2;
+  box-shadow: 0 -8px 0 8px var(--canvas);
+}
+.activity-sheet .segmented {
+  position: sticky;
+  top: 60px;
+  background: var(--canvas);
+  z-index: 2;
+  padding-top: 2px;
+}
+.activity-sheet .segmented button {
+  font-size: 11px;
+}
+.activity-group-label {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  font-size: 10px;
+  color: var(--muted);
+  padding: 12px 1px;
+}
+.activity-group-label .inline-activity {
+  font-size: 11px;
+}
+.activity-card {
+  display: flex;
+  align-items: flex-start;
+  gap: 10px;
+  min-height: 91px;
+  padding: 15px 11px;
+  margin-bottom: 8px;
+  border: 1px solid var(--line);
+  border-radius: 15px;
+  background: var(--surface);
+  width: 100%;
+  text-align: left;
+}
+.activity-card.current {
+  background: var(--tint);
+  border-color: transparent;
+}
+.activity-card.attention {
+  border-color: #e7d6c1;
+}
+.activity-card-avatar {
+  flex-shrink: 0;
+  position: relative;
+}
+.activity-card-avatar .avatar {
+  width: 33px;
+  height: 33px;
+  border-radius: 11px;
+}
+.activity-card-avatar .avatar svg {
+  width: 20px;
+  height: 20px;
+}
+.mini-state {
+  display: inline-flex;
+  width: 12px;
+  height: 12px;
+  border-radius: 50%;
+  align-items: center;
+  justify-content: center;
+  flex-shrink: 0;
+  font-size: 8px;
+}
+.mini-state.running {
+  background: var(--accent);
+  width: 6px;
+  height: 6px;
+}
+.mini-state.attention {
+  background: #ab7146;
+  color: white;
+  font-weight: 600;
+}
+.mini-state.done {
+  background: var(--accent);
+  color: var(--canvas);
+}
+.mini-state svg {
+  width: 9px;
+  height: 9px;
+  stroke-width: 2;
+}
+.activity-card-avatar .mini-state {
+  position: absolute;
+  right: -2px;
+  bottom: -2px;
+  outline: 3px solid var(--surface);
+}
+.activity-card-avatar .mini-state.running {
+  right: -1px;
+  bottom: 0;
+}
+.activity-card-content {
+  flex: 1;
+  min-width: 0;
+}
+.activity-card-content strong {
+  display: block;
+  font-size: 12px;
+  font-weight: 550;
+  line-height: 1.6;
+}
+.activity-card-content > small {
+  display: block;
+  font-size: 10px;
+  color: var(--muted);
+  margin-top: 6px;
+}
+.activity-detail {
+  display: block;
+  color: var(--secondary);
+  font-size: 10px;
+  line-height: 1.7;
+  margin-top: 9px;
+}
+.attention .activity-detail {
+  color: #a86a40;
+}
+.activity-card-end {
+  display: flex;
+  align-items: flex-end;
+  justify-content: space-between;
+  flex-direction: column;
+  align-self: stretch;
+  width: 55px;
+  flex-shrink: 0;
+}
+.activity-card-end svg {
+  width: 14px;
+  height: 14px;
+  color: var(--muted);
+  margin-top: 2px;
+}
+.activity-card-end small {
+  font-size: 8px;
+  color: var(--muted);
+  white-space: nowrap;
+}
+.activity-card-end em {
+  font-size: 9px;
+  color: var(--accent);
+  font-style: normal;
+}
+.activity-sheet-footer {
+  margin-top: 16px;
+  border-top: 1px solid var(--line);
+  padding-top: 13px;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  gap: 3px;
+}
+.activity-sheet-footer > span {
+  font-size: 9px;
+  color: var(--muted);
+  text-align: center;
+}
+.activity-sheet-footer button {
+  min-height: 44px;
+  font-size: 10px;
+  color: var(--secondary);
+}
+.drawer > .segmented {
+  flex-shrink: 0;
+  margin-top: 8px;
+  margin-bottom: 1px;
+}
+.drawer > .segmented button {
+  font-size: 11px;
+}
+.drawer-conversation {
+  display: block;
+  width: 100%;
+  text-align: left;
+  padding: 12px 9px;
+  border-radius: 11px;
+  min-height: 64px;
+}
+.drawer-conversation.active {
+  background: var(--tint);
+}
+.drawer-conversation-title {
+  display: flex;
+  align-items: center;
+  gap: 8px;
+  font-size: 12px;
+  line-height: 1.7;
+}
+.drawer-conversation-title > .mini-state {
+  margin-left: auto;
+}
+.drawer-conversation > small {
+  display: block;
+  font-size: 10px;
+  color: var(--muted);
+  margin-top: 5px;
+}
+.drawer-agent-group {
+  padding: 13px 0;
+  border-bottom: 1px solid var(--line);
+}
+.drawer-agent-head {
+  display: flex;
+  gap: 8px;
+  align-items: center;
+  padding-left: 5px;
+}
+.drawer-agent-head .avatar {
+  width: 30px;
+  height: 30px;
+  border-radius: 10px;
+}
+.drawer-agent-head .avatar svg {
+  width: 18px;
+  height: 18px;
+}
+.drawer-agent-head strong {
+  font-size: 12px;
+  font-weight: 550;
+  display: block;
+}
+.drawer-agent-head small {
+  display: block;
+  font-size: 9px;
+  margin-top: 4px;
+  color: var(--muted);
+}
+.drawer-agent-head > .inline-activity,
+.drawer-agent-head > small {
+  margin-left: auto;
+}
+.drawer-agent-new {
+  width: 35px;
+  min-height: 44px;
+  display: grid;
+  place-items: center;
+  padding: 0;
+}
+.drawer-agent-new svg {
+  width: 15px;
+  color: var(--secondary);
+}
+.drawer-archive {
+  min-height: 41px;
+  display: flex;
+  align-items: center;
+  gap: 8px;
+  width: 100%;
+  font-size: 10px;
+  color: var(--muted);
+  flex-shrink: 0;
+}
+.drawer-archive svg {
+  width: 14px;
+  height: 14px;
+}
+.drawer-archive svg:last-child {
+  margin-left: auto;
+}
+.drawer-nav {
+  padding-top: 8px;
+}
+.regenerate-title {
+  width: 100%;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  gap: 8px;
+  min-height: 47px;
+  font-size: 12px;
+  border: 1px solid var(--line);
+  border-radius: 13px;
+  margin-top: 11px;
+  color: var(--secondary);
+}
+.regenerate-title svg {
+  width: 15px;
+  height: 15px;
+}
+.regenerate-title span {
+  font-size: 9px;
+  color: var(--muted);
+}
+.title-protection {
+  display: flex;
+  align-items: flex-start;
+  gap: 6px;
+  font-size: 10px;
+  line-height: 1.9;
+  color: var(--muted);
+  margin: 16px 0 3px;
+}
+.title-protection svg {
+  width: 13px;
+  height: 13px;
+  margin-top: 3px;
+}
+.blank-chat {
+  height: 100%;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: center;
+  text-align: center;
+  padding-bottom: 75px;
+}
+.blank-chat-mark {
+  width: 66px;
+  height: 66px;
+  display: grid;
+  place-items: center;
+  background: var(--tint);
+  color: var(--accent);
+  border-radius: 24px;
+  margin-bottom: 23px;
+}
+.blank-chat-mark svg {
+  width: 38px;
+  height: 38px;
+}
+.blank-chat h1 {
+  font-size: 24px;
+  font-weight: 500;
+  letter-spacing: -0.8px;
+}
+.blank-chat p {
+  font-size: 12px;
+  color: var(--muted);
+  line-height: 2;
+  margin-top: 15px;
+}
+.completion-banner {
+  position: absolute;
+  top: 105px;
+  left: 19px;
+  right: 19px;
+  display: flex;
+  align-items: center;
+  gap: 10px;
+  background: var(--surface);
+  padding: 14px 10px 14px 14px;
+  z-index: 25;
+  box-shadow: 0 10px 35px #233a2620;
+  border: 1px solid var(--line);
+  border-radius: 17px;
+  animation: arrive 0.25s ease;
+}
+.completion-mark {
+  background: var(--tint);
+  color: var(--accent);
+  width: 31px;
+  height: 31px;
+  display: grid;
+  place-items: center;
+  border-radius: 50%;
+  flex-shrink: 0;
+}
+.completion-mark svg {
+  width: 17px;
+}
+.completion-banner > button {
+  text-align: left;
+  padding: 0;
+  flex: 1;
+  min-width: 0;
+}
+.completion-banner > button strong {
+  font-size: 12px;
+  font-weight: 550;
+  display: block;
+}
+.completion-banner > button small {
+  display: block;
+  font-size: 10px;
+  line-height: 1.7;
+  color: var(--muted);
+  margin-top: 5px;
+}
+.completion-banner > button:last-child {
+  width: 35px;
+  flex: 0 0 35px;
+  min-height: 44px;
+  display: grid;
+  place-items: center;
+  color: var(--muted);
+}
+.completion-banner > button:last-child svg {
+  width: 15px;
+}
+.prototype-shortcuts {
+  margin-top: 20px;
+  display: flex;
+  flex-direction: column;
+}
+.prototype-shortcuts button {
+  display: flex;
+  align-items: center;
+  gap: 6px;
+  min-height: 35px;
+  padding: 0;
+  font-size: 10px;
+  color: #748268;
+  text-align: left;
+}
+.prototype-shortcuts svg {
+  width: 12px;
+  height: 12px;
+}
+.scope-note {
+  margin-top: 20px;
+}
+@keyframes breathe {
+  50% {
+    box-shadow: 0 0 0 5px var(--tint);
+  }
+}
+.sheet-handle {
+  width: 100%;
+  min-height: 25px;
+  height: 25px;
+  margin: 0;
+  background: none;
+  position: relative;
+  touch-action: none;
+  cursor: grab;
+}
+.sheet-handle:before {
+  content: '';
+  position: absolute;
+  left: calc(50% - 17px);
+  top: 10px;
+  width: 34px;
+  height: 4px;
+  background: var(--line);
+  border-radius: 4px;
+}
+.skeleton-list {
+  padding-top: 10px;
+}
+.skeleton-row {
+  display: flex;
+  align-items: center;
+  gap: 12px;
+  padding: 19px 0;
+  border-bottom: 1px solid var(--line);
+}
+.skeleton-row > span {
+  width: 39px;
+  height: 39px;
+  border-radius: 14px;
+  background: var(--soft);
+}
+.skeleton-row > div {
+  flex: 1;
+}
+.skeleton-row i {
+  display: block;
+  width: 78%;
+  height: 11px;
+  background: var(--soft);
+  border-radius: 5px;
+}
+.skeleton-row i:last-child {
+  width: 55%;
+  height: 8px;
+  margin-top: 12px;
+}
+@media (max-width: 520px) {
+  .device {
+    height: var(--visual-height, 100dvh);
+  }
+  .completion-banner {
+    top: calc(70px + env(safe-area-inset-top));
+  }
+}
+@media (max-width: 360px) {
+  .activity-card {
+    gap: 8px;
+    padding: 12px 9px;
+  }
+  .activity-card-content strong {
+    font-size: 11px;
+  }
+  .activity-card-end {
+    width: 44px;
+  }
+  .activity-card-end small {
+    font-size: 7px;
+  }
+  .quick-agent {
+    display: none;
+  }
+}
+@media (prefers-reduced-motion: reduce) {
+  .activity-orbit.running {
+    animation: none;
+  }
+}
+
+</style>
+  </head>
+  <body>
+    <div class="presentation">
+      <aside class="intro">
+        <a class="studio-brand" href="#/home"
+          ><span data-icon="flower"></span> fmode<span class="edition">MOBILE STUDY / 01</span></a
+        >
+        <div class="intro-copy">
+          <div class="eyebrow">不止是聊天,更是多线协作</div>
+          <h1>一手掌控。<br />多线从容。</h1>
+          <p>知道谁在工作,记得聊到哪里。<br />在每一段协作之间,自如切换。</p>
+          <span class="proposal-tag"><i class="dot"></i> 交互提案 · 非生产环境</span>
+        </div>
+        <div class="scene-switch" aria-label="原型场景">
+          <span class="eyebrow">从这里开始体验</span
+          ><button data-scene="chat">
+            <span>01</span> 沉浸式协作 <span data-icon="arrow-right"></span></button
+          ><button data-experience="activity">
+            <span>02</span> 一步切换,进展在握 <span data-icon="arrow-right"></span></button
+          ><button data-scene="messages">
+            <span>03</span> 找回之前的想法 <span data-icon="arrow-right"></span></button
+          ><button data-scene="home">
+            <span>04</span> 开始新的想法 <span data-icon="arrow-right"></span>
+          </button>
+        </div>
+        <div class="intro-footer">
+          FMODE / MOBILE EXPERIENCE<br /><span>独立 HTML 原型 · 2026.11.16</span>
+        </div>
+      </aside>
+      <div class="device-wrap">
+        <div class="device" id="device">
+          <div class="statusbar" aria-hidden="true">
+            <span>9:41</span>
+            <div class="island"></div>
+            <div class="status-icons">
+              <span data-icon="signal"></span><span data-icon="wifi"></span
+              ><span data-icon="battery"></span>
+            </div>
+          </div>
+          <div class="app" id="app">
+            <header id="app-header" class="app-header"></header>
+            <main id="main" tabindex="-1"></main>
+            <div id="composer-area"></div>
+            <nav id="tabbar" class="tabbar" aria-label="主导航"></nav>
+          </div>
+          <div id="overlay-root"></div>
+          <div id="toast" class="toast" role="status" aria-live="polite"></div>
+          <div class="home-indicator" aria-hidden="true"></div>
+        </div>
+        <div class="device-caption">
+          <i class="dot"></i> 可交互原型 <span>·</span> 点击、输入,试试看
+        </div>
+      </div>
+      <aside class="design-notes">
+        <span class="eyebrow">体验,而不是功能重做</span>
+        <div class="note">
+          <span>01 / AWARENESS</span>
+          <h2>专注这一件,也看得见全局</h2>
+          <p>输入坞上沿,一步打开协作动态。进行中、待关注、已完成,不再只靠猜。</p>
+        </div>
+        <div class="note">
+          <span>02 / REACH</span>
+          <h2>切换靠近拇指,不挤发送按钮</h2>
+          <p>新建、切换与发送各有位置。Enter 只换行,避免把未写完的想法发出去。</p>
+        </div>
+        <div class="note">
+          <span>03 / CONTINUITY</span>
+          <h2>按会话记住,不按分身覆盖</h2>
+          <p>切换保留草稿。标题可直接编辑,同一数字生命中新建,不必重新选人。</p>
+        </div>
+        <div class="prototype-shortcuts">
+          <button data-experience="title">体验标题编辑 <span data-icon="arrow-right"></span></button
+          ><button data-experience="complete">
+            体验完成提醒 <span data-icon="arrow-right"></span>
+          </button>
+        </div>
+        <div class="scope-note">
+          <span data-icon="shield"></span
+          ><span>不接真实接口,不修改现有项目。<br />所有消息、文件和余额均为演示。</span>
+        </div>
+      </aside>
+    </div>
+    <input id="file-input" type="file" multiple hidden />
+    <script>
+const icons = {
+  menu: '<path d="M4 7h16M4 12h11M4 17h16"/>',
+  flower: Array.from(
+    { length: 8 },
+    (_, index) =>
+      `<ellipse cx="12" cy="7.3" rx="2.15" ry="4.6" transform="rotate(${index * 45} 12 12)"/>`,
+  ).join(''),
+  'arrow-right': '<path d="M5 12h14m-5-5 5 5-5 5"/>',
+  'arrow-up': '<path d="M12 19V5m-6 6 6-6 6 6"/>',
+  back: '<path d="m14 5-7 7 7 7"/>',
+  chevron: '<path d="m8 10 4 4 4-4"/>',
+  right: '<path d="m9 6 6 6-6 6"/>',
+  plus: '<path d="M12 5v14M5 12h14"/>',
+  close: '<path d="m6 6 12 12M6 18 18 6"/>',
+  chat: '<path d="M20 11.5a7.7 7.7 0 0 1-8 7.5 9 9 0 0 1-3-.5L4 20l1.5-4.5A7.2 7.2 0 0 1 4 11.5a8 8 0 0 1 16 0Z"/><path d="M8 10h8M8 14h5"/>',
+  edit: '<path d="M12 4H4v16h16v-8M10 14l1-4L19 2l3 3-8 8Z"/>',
+  search: '<circle cx="10.5" cy="10.5" r="6.5"/><path d="m16 16 4 4"/>',
+  people:
+    '<circle cx="9" cy="8" r="3"/><path d="M3 20v-3a6 6 0 0 1 12 0v3m1-15a3 3 0 0 1 0 6m2 3a5 5 0 0 1 3 4v2"/>',
+  grid: '<rect x="4" y="4" width="6" height="6" rx="1.5"/><rect x="14" y="4" width="6" height="6" rx="1.5"/><rect x="4" y="14" width="6" height="6" rx="1.5"/><rect x="14" y="14" width="6" height="6" rx="1.5"/>',
+  user: '<circle cx="12" cy="8" r="4"/><path d="M4 21v-2a8 8 0 0 1 16 0v2"/>',
+  more: '<circle cx="5" cy="12" r=".9"/><circle cx="12" cy="12" r=".9"/><circle cx="19" cy="12" r=".9"/>',
+  folder: '<path d="M3 7a2 2 0 0 1 2-2h5l2 3h7a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z"/>',
+  archive: '<rect x="3" y="4" width="18" height="4" rx="1"/><path d="M5 8v12h14V8M10 12h4"/>',
+  file: '<path d="M14 3H5v18h14V8Zm0 0v6h5M8 13h8M8 17h6"/>',
+  clip: '<path d="m8 13 7-7a3 3 0 0 1 4 4L9 20a5 5 0 0 1-7-7L13 2"/>',
+  check: '<path d="m5 12 4 4L19 6"/>',
+  shield: '<path d="m12 3 8 3v6c0 5-8 9-8 9s-8-4-8-9V6Z"/><path d="m8 12 3 3 5-6"/>',
+  copy: '<rect x="8" y="8" width="12" height="13" rx="2"/><path d="M15 8V3H3v13h5"/>',
+  moon: '<path d="M20 14A8 8 0 0 1 10 4a8.5 8.5 0 1 0 10 10Z"/>',
+  bell: '<path d="M5 17h14l-2-4V9a5 5 0 0 0-10 0v4Zm5 3h4"/>',
+  key: '<circle cx="8" cy="9" r="5"/><path d="m12 13 8 8m-4-4 3-3"/>',
+  eye: '<path d="M2 12s4-7 10-7 10 7 10 7-4 7-10 7S2 12 2 12Z"/><circle cx="12" cy="12" r="3"/>',
+  logout: '<path d="M10 4H4v16h6m5-12 5 4-5 4m-6-4h11"/>',
+  link: '<path d="m9 15 6-6m-4-3 2-2a5 5 0 0 1 7 7l-2 2m-5 5-2 2a5 5 0 0 1-7-7l2-2"/>',
+  wallet: '<rect x="3" y="5" width="18" height="15" rx="2"/><path d="M3 8h18m-5 4h5v5h-5Z"/>',
+  trash: '<path d="M3 6h18M9 6V3h6v3M5 6l1 15h12l1-15M10 10v7m4-7v7"/>',
+  download: '<path d="M12 3v12m-5-5 5 5 5-5M4 16v5h16v-5"/>',
+  spark: '<path d="m12 3 2.5 6.5L21 12l-6.5 2.5L12 21l-2.5-6.5L3 12l6.5-2.5Z"/>',
+  wifi: '<path d="M3 8a15 15 0 0 1 18 0M6 12a10 10 0 0 1 12 0M9 16a5 5 0 0 1 6 0"/><circle cx="12" cy="20" r=".7"/>',
+  signal: '<path d="M4 19v-3m5 3v-6m5 6V9m5 10V5" stroke-width="2.8"/>',
+  battery:
+    '<rect x="2" y="6" width="18" height="12" rx="3"/><path d="M22 10v4M5 9h12v6H5Z" fill="currentColor" stroke="none"/>',
+};
+const icon = (name, className = '') =>
+  `<svg class="${className}" viewBox="0 0 24 24" aria-hidden="true">${icons[name] || icons.spark}</svg>`;
+const esc = (value) =>
+  String(value).replace(
+    /[&<>"']/g,
+    (character) =>
+      ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[character],
+  );
+const ib = (name, label, action, extra = '') =>
+  `<button class="icon-button" aria-label="${esc(label)}" data-action="${action}" ${extra}>${icon(name)}</button>`;
+const agents = [
+  {
+    id: 'a1',
+    name: '小禾',
+    role: '研究与写作伙伴',
+    tone: '',
+    online: true,
+    cpu: '12%',
+    memory: '328 MB',
+    balance: '128.60',
+    task: '正在整理产品体验调研',
+    symbol: 'flower',
+  },
+  {
+    id: 'a2',
+    name: '阿澈',
+    role: '开发与技术伙伴',
+    tone: 'clay',
+    online: true,
+    cpu: '8%',
+    memory: '256 MB',
+    balance: '86.20',
+    task: '等待新的协作指令',
+    symbol: 'grid',
+  },
+  {
+    id: 'a3',
+    name: '知夏',
+    role: '设计与创意伙伴',
+    tone: 'lilac',
+    online: false,
+    cpu: '—',
+    memory: '—',
+    balance: '42.00',
+    task: '当前离线,连接恢复后继续协作',
+    symbol: 'spark',
+  },
+];
+const conversations = [
+  {
+    id: 'c1',
+    title: '把产品的第一印象做好',
+    agentId: 'a1',
+    preview: '我整理了三个可以落地的优化方向。',
+    time: '刚刚',
+    group: '今天',
+    workspace: 'w1',
+    unread: 2,
+    archived: false,
+  },
+  {
+    id: 'c2',
+    title: '官网首页的灵感与参考',
+    agentId: 'a3',
+    preview: '留白、秩序,以及一点点恰好的温度。',
+    time: '10:24',
+    group: '今天',
+    workspace: 'w1',
+    unread: 0,
+    archived: false,
+  },
+  {
+    id: 'c3',
+    title: '梳理一下这周的工作',
+    agentId: 'a1',
+    preview: '已按优先级整理好,随时可以继续。',
+    time: '昨天',
+    group: '昨天',
+    workspace: null,
+    unread: 0,
+    archived: false,
+  },
+  {
+    id: 'c4',
+    title: '登录接口联调记录',
+    agentId: 'a2',
+    preview: '接口参数和错误处理已经检查完毕。',
+    time: '昨天',
+    group: '昨天',
+    workspace: 'w2',
+    unread: 1,
+    archived: false,
+  },
+  {
+    id: 'c5',
+    title: '一些还没成形的小想法',
+    agentId: 'a1',
+    preview: '我们可以从一个最小的版本开始。',
+    time: '周五',
+    group: '更早',
+    workspace: null,
+    unread: 0,
+    archived: false,
+  },
+  {
+    id: 'c6',
+    title: '上一版品牌文案',
+    agentId: 'a1',
+    preview: '品牌文案讨论已归档。',
+    time: '11/08',
+    group: '更早',
+    workspace: 'w1',
+    unread: 0,
+    archived: true,
+  },
+];
+let workspaces = [
+  { id: 'w1', name: '产品与灵感' },
+  { id: 'w2', name: '研发协作' },
+];
+const messages = new Map();
+const collaboration = new Map([
+  ['c1', { kind: 'done', label: '体验优化建议已交付', elapsed: '刚刚完成' }],
+  ['c2', { kind: 'attention', label: '连接中断,等待恢复', elapsed: '需要关注' }],
+  ['c3', { kind: 'running', label: '正在整理本周的优先级', elapsed: '已进行 2 分钟' }],
+  ['c4', { kind: 'running', label: '正在检查接口返回结果', elapsed: '已进行 45 秒' }],
+  ['c5', { kind: 'idle', label: '等待新的想法', elapsed: '空闲' }],
+]);
+const activityNames = { running: '进行中', attention: '待关注', done: '已完成', idle: '空闲' };
+const drafts = new Map();
+const draftKey = () => (state.page === 'chat' ? state.currentId : 'home');
+function saveDraft() {
+  if (['home', 'chat'].includes(state.page))
+    drafts.set(draftKey(), { text: state.draft, files: [...state.attachments] });
+}
+function restoreDraft() {
+  const draft = drafts.get(draftKey());
+  state.draft = draft?.text || '';
+  state.attachments = [...(draft?.files || [])];
+}
+let preferences = { dark: false, palette: 'forest', font: 14 };
+try {
+  preferences = {
+    ...preferences,
+    ...JSON.parse(localStorage.getItem('fmode_mobile_proposal_v1') || '{}'),
+  };
+} catch {}
+const state = {
+  page: 'home',
+  currentId: 'c1',
+  agentId: null,
+  draft: '',
+  attachments: [],
+  filter: 'all',
+  contactFilter: 'agents',
+  agentFilter: 'all',
+  keyword: '',
+  expanded: new Set(),
+  drawerExpanded: new Set(),
+  pendingSend: false,
+  newWorkspace: null,
+  generating: false,
+  disconnected: false,
+  tokenVisible: false,
+  drawerView: 'recent',
+  activityFilter: 'all',
+  activityKeyword: '',
+  ...preferences,
+};
+const main = document.querySelector('#main'),
+  header = document.querySelector('#app-header'),
+  composerArea = document.querySelector('#composer-area'),
+  tabbar = document.querySelector('#tabbar'),
+  overlay = document.querySelector('#overlay-root'),
+  app = document.querySelector('#app');
+let returnFocus, toastTimer, generationTimer;
+const getAgent = (agentId) => agents.find((agent) => agent.id === agentId) || agents[0];
+const getConversation = (identifier = state.currentId) =>
+  conversations.find((conversation) => conversation.id === identifier);
+const avatar = (agent) => `<span class="avatar ${agent.tone}">${icon(agent.symbol)}</span>`;
+const activeConversations = () => conversations.filter((conversation) => !conversation.archived);
+const navItems = [
+  ['messages', 'chat', '会话'],
+  ['contacts', 'people', '通讯录'],
+  ['workbench', 'grid', '工作台'],
+  ['mine', 'user', '我的'],
+];
+const emptyState = (title, description = '', symbol = 'search') =>
+  `<div class="empty-state">${icon(symbol)}<strong>${title}</strong><p>${description}</p></div>`;
+const tabs = (items, active, action) =>
+  `<div class="segmented" aria-label="筛选">${items.map(([value, label]) => `<button data-action="${action}" data-value="${value}" aria-pressed="${value === active}" class="${value === active ? 'active' : ''}">${label}</button>`).join('')}</div>`;
+const searchField = (placeholder, action = 'search', value = '') =>
+  `<label class="search-field">${icon('search')}<input type="search" aria-label="${placeholder}" placeholder="${placeholder}" data-input="${action}" value="${esc(value)}" /></label>`;
+const navigation = () =>
+  navItems
+    .map(
+      ([page, symbol, label]) =>
+        `<button data-action="navigate" data-page="${page}" class="${state.page === page ? 'active' : ''}" ${state.page === page ? 'aria-current="page"' : ''}><span>${icon(symbol)}</span><span>${label}</span></button>`,
+    )
+    .join('');
+function applyPreferences() {
+  const device = document.querySelector('#device');
+  device.classList.toggle('dark', state.dark);
+  const palettes = {
+    forest: ['#386b52', '#eaf1e8', '#a4c59a', '#303f30'],
+    blue: ['#496a96', '#eaf0f8', '#a5bde0', '#2e3c50'],
+    purple: ['#806495', '#f0eaf5', '#c9acdf', '#403349'],
+    amber: ['#9a7641', '#f4efdf', '#ddc195', '#443a27'],
+  };
+  const palette = palettes[state.palette] || palettes.forest;
+  device.style.setProperty('--accent', palette[state.dark ? 2 : 0]);
+  device.style.setProperty('--tint', palette[state.dark ? 3 : 1]);
+  device.style.setProperty('--chat-font', `${state.font}px`);
+  try {
+    localStorage.setItem(
+      'fmode_mobile_proposal_v1',
+      JSON.stringify({ dark: state.dark, palette: state.palette, font: state.font }),
+    );
+  } catch {}
+}
+function navigate(page, identifier) {
+  const destination =
+    page === 'chat'
+      ? `#/chat/${identifier || state.currentId}`
+      : page === 'agent'
+        ? `#/agent/${identifier}`
+        : `#/${page}`;
+  if (location.hash === destination) readRoute();
+  else location.hash = destination;
+}
+function readRoute() {
+  saveDraft();
+  const [page = 'home', identifier] = location.hash.replace(/^#\/?/, '').split('/');
+  state.page = ['home', 'chat', 'messages', 'contacts', 'workbench', 'mine', 'agent'].includes(page)
+    ? page
+    : 'home';
+  if (state.page === 'chat') {
+    const conversation = getConversation(identifier);
+    if (conversation) {
+      state.currentId = identifier;
+      conversation.unread = 0;
+    } else state.page = 'messages';
+  }
+  if (state.page === 'agent') state.detailAgentId = identifier;
+  state.keyword = '';
+  restoreDraft();
+  closeOverlay();
+  render();
+  main.scrollTop = 0;
+}
+function render() {
+  const conversation = getConversation(),
+    agent = getAgent(conversation?.agentId);
+  if (state.page === 'chat')
+    header.innerHTML = `${ib('menu', '打开会话侧栏', 'drawer')}<div class="header-center"><button class="header-title" data-action="edit-current-title" aria-label="编辑会话标题:${esc(conversation.title)}"><strong>${esc(conversation.title)}</strong>${icon('edit')}</button><small>${esc(agent.name)}<span class="subtitle-separator">/</span><span class="activity-text ${collaboration.get(conversation.id)?.kind || 'idle'}">${activityNames[collaboration.get(conversation.id)?.kind || 'idle']}</span></small></div>${ib('more', '会话详情', 'details')}`;
+  else if (state.page === 'home')
+    header.innerHTML = `${ib('menu', '打开会话侧栏', 'drawer')}<div class="header-brand">${icon('flower')}<strong>fmode</strong></div><button class="profile-button" data-action="navigate" data-page="mine" aria-label="我的">林</button>`;
+  else if (state.page === 'agent')
+    header.innerHTML = `${ib('back', '返回通讯录', 'navigate', 'data-page="contacts"')}<strong class="page-title">数字生命设置</strong>`;
+  else
+    header.innerHTML = `${ib('menu', '打开会话侧栏', 'drawer')}<strong class="page-title">${navItems.find(([page]) => page === state.page)?.[2]}</strong>${state.page === 'messages' ? ib('edit', '新建对话', 'new-chat') : '<span style="width:44px"></span>'}`;
+  ({
+    home: renderHome,
+    chat: renderChat,
+    messages: renderMessages,
+    contacts: renderContacts,
+    workbench: renderWorkbench,
+    mine: renderMine,
+    agent: renderAgent,
+  })[state.page]();
+  if (state.page === 'chat' && messages.get(state.currentId)?.length === 0) {
+    main.innerHTML = `<section class="screen blank-chat"><div class="blank-chat-mark">${icon(agent.symbol)}</div><h1>新的想法,直接说。</h1><p>正在和 ${esc(agent.name)} 对话<br />${esc(workspaces.find((workspace) => workspace.id === conversation.workspace)?.name || '日常对话')} · 不影响之前的会话</p></section>`;
+  }
+  if (state.page === 'mine')
+    main
+      .querySelector('.version-text')
+      .insertAdjacentHTML(
+        'beforeend',
+        '<br /><button class="text-button" data-action="preview-states">查看加载与反馈状态 · 原型专用</button>',
+      );
+  tabbar.innerHTML = ['messages', 'contacts', 'workbench', 'mine'].includes(state.page)
+    ? navigation()
+    : '';
+  if (['home', 'chat'].includes(state.page)) renderComposer();
+  else composerArea.innerHTML = '';
+  document
+    .querySelectorAll('[data-scene]')
+    .forEach((button) => button.classList.toggle('active', button.dataset.scene === state.page));
+  applyPreferences();
+}
+function renderHome() {
+  main.innerHTML = `<section class="screen home-screen"><div class="home-hero"><div class="hero-art">${icon('flower')}</div><div class="overline">每一个想法,都值得被认真对待</div><h1>让想法,<br />再往前一步。</h1><p>写下想做的事,和你的数字生命一起完成。</p></div><div class="prompts"><button class="prompt" data-action="prompt" data-value="帮我梳理一下这周的工作安排">${icon('file')}梳理思路</button><button class="prompt" data-action="prompt" data-value="帮我写一份产品体验优化方案">${icon('edit')}写点什么</button><button class="prompt" data-action="prompt" data-value="帮我找几个官网设计的灵感方向">${icon('spark')}找点灵感</button></div><div class="recent-block"><div class="section-label"><span>接着上次的想法</span><button class="text-button" data-action="navigate" data-page="messages">全部会话 ${icon('arrow-right')}</button></div>${activeConversations()
+    .slice(0, 2)
+    .map(
+      (conversation) =>
+        `<button class="recent-row" data-action="open-chat" data-id="${conversation.id}">${icon('chat')}<span class="row-text"><strong>${esc(conversation.title)}</strong><small>${esc(getAgent(conversation.agentId).name)} · ${esc(workspaces.find((workspace) => workspace.id === conversation.workspace)?.name || '日常对话')}</small></span><time>${conversation.time}</time></button>`,
+    )
+    .join('')}</div></section>`;
+}
+function renderComposer() {
+  const agentId = state.page === 'chat' ? getConversation()?.agentId : state.agentId,
+    agent = agentId ? getAgent(agentId) : null;
+  composerArea.innerHTML = `<div class="composer"><div class="attachment-list">${state.attachments.map((file, index) => `<span class="attachment-chip">${icon('clip')}<span>${esc(file.name)}</span><button aria-label="移除附件 ${esc(file.name)}" data-action="remove-attachment" data-index="${index}">${icon('close')}</button></span>`).join('')}</div><textarea id="draft" rows="1" aria-label="输入消息" placeholder="说说你的想法…" ${state.generating ? 'disabled' : ''}>${esc(state.draft)}</textarea><div class="composer-tools">${ib('plus', '添加附件', 'attach')}<button class="agent-select" data-action="${state.page === 'home' ? 'pick-agent' : 'agent-info'}">${agent ? '<i class="dot ' + (agent.online ? '' : 'offline') + '"></i>' : icon('flower')}<span>${agent ? esc(agent.name) + ' · ' + agent.role : '选择数字生命'}</span>${state.page === 'home' ? icon('chevron') : ''}</button><button class="send-button" aria-label="${state.generating ? '发送中' : '发送消息'}" data-action="send" ${state.generating || (!state.draft.trim() && !state.attachments.length) ? 'disabled' : ''}>${state.generating ? '<span class="typing"><i></i><i></i><i></i></span>' : icon('arrow-up')}</button></div></div><div class="composer-footnote">${state.page === 'home' ? '和数字生命一起,把想法变成现实' : '内容由 AI 生成,请核实重要信息'} · 演示</div>`;
+  if (state.page === 'chat') {
+    const running = activeConversations().filter(
+      (conversation) => collaboration.get(conversation.id)?.kind === 'running',
+    ).length;
+    const attention = activeConversations().filter(
+      (conversation) => collaboration.get(conversation.id)?.kind === 'attention',
+    ).length;
+    composerArea.insertAdjacentHTML(
+      'afterbegin',
+      `<div class="collaboration-rail"><button class="quick-current" data-action="quick-current" aria-label="在当前数字生命 ${esc(agent.name)} 中新建对话">${icon('edit')}<span>新对话</span><span class="quick-agent">· ${esc(agent.name)}</span></button><button class="activity-entry" data-action="activity" aria-label="切换协作,${running} 个进行中,${attention} 个待关注"><span class="activity-orbit ${running ? 'running' : ''}"></span><span>${running ? running + ' 个进行中' : '协作动态'}</span>${attention ? `<span class="attention-count">${attention}</span>` : ''}${icon('chevron')}</button></div>`,
+    );
+  }
+  const textarea = document.querySelector('#draft');
+  textarea.setAttribute('enterkeyhint', 'enter');
+  textarea.style.height = 'auto';
+  textarea.style.height = `${Math.min(textarea.scrollHeight, 116)}px`;
+}
+function conversationRow(conversation) {
+  const agent = getAgent(conversation.agentId);
+  return `<article class="conversation-row"><button class="conversation-open" data-action="open-chat" data-id="${conversation.id}">${avatar(agent)}<span class="conversation-body"><span class="conversation-top"><strong>${esc(conversation.title)}</strong><time>${conversation.time}</time></span><p>${esc(conversation.preview)}</p><span class="conversation-meta">${esc(agent.name)}${conversation.workspace ? ' · ' + esc(workspaces.find((workspace) => workspace.id === conversation.workspace)?.name || '工作区') : ''}<span class="inline-activity ${collaboration.get(conversation.id)?.kind || 'idle'}">${activityNames[collaboration.get(conversation.id)?.kind || 'idle']}</span>${conversation.unread ? `<span class="unread">${conversation.unread}</span>` : ''}</span></span></button><button class="row-more" data-action="conversation-menu" data-id="${conversation.id}" aria-label="${esc(conversation.title)} 更多操作">${icon('more')}</button></article>`;
+}
+function renderMessages() {
+  main.innerHTML = `<section class="screen"><p class="page-subtitle">每一次对话,都是想法向前的一步。</p>${searchField('搜索会话或数字生命', 'search', state.keyword)}${tabs(
+    [
+      ['all', '全部'],
+      ['unread', '未读'],
+      ['workspace', '工作区'],
+    ],
+    state.filter,
+    'message-filter',
+  )}<div id="conversation-results">${conversationResults()}</div></section>`;
+}
+function conversationResults() {
+  const keyword = state.keyword.trim().toLowerCase(),
+    filtered = activeConversations().filter(
+      (conversation) =>
+        (state.filter !== 'unread' || conversation.unread > 0) &&
+        `${conversation.title} ${getAgent(conversation.agentId).name}`
+          .toLowerCase()
+          .includes(keyword),
+    );
+  if (state.filter === 'workspace')
+    return `<button class="text-button" data-action="create-workspace">${icon('plus')} 新建工作区</button>${workspaces
+      .map((workspace) => {
+        const rows = filtered.filter((conversation) => conversation.workspace === workspace.id);
+        if (keyword && !rows.length && !workspace.name.includes(keyword)) return '';
+        return `<section class="workspace"><header class="workspace-head"><button class="workspace-toggle" data-action="toggle-workspace" data-id="${workspace.id}" aria-expanded="${state.expanded.has(workspace.id)}" aria-controls="workspace-${workspace.id}">${icon(state.expanded.has(workspace.id) ? 'chevron' : 'right')}${icon('folder')} ${esc(workspace.name)}<small>${rows.length}</small></button>${ib('plus', '在 ' + workspace.name + ' 中新建对话', 'workspace-chat', `data-id="${workspace.id}"`)}${ib('more', workspace.name + ' 更多操作', 'workspace-menu', `data-id="${workspace.id}"`)}</header><div id="workspace-${workspace.id}" ${state.expanded.has(workspace.id) || keyword ? '' : 'hidden'}>${rows.length ? rows.map(conversationRow).join('') : emptyState('还没有对话', '在这里开始一个新的想法', 'chat')}</div></section>`;
+      })
+      .join('')}`;
+  if (!filtered.length)
+    return emptyState(
+      state.filter === 'unread' ? '未读已清空,安心专注' : '没有找到相关对话',
+      state.filter === 'unread' ? '新的消息会出现在这里。' : '换个关键词再试试。',
+    );
+  return ['今天', '昨天', '更早']
+    .map((group) => {
+      const rows = filtered.filter((conversation) => conversation.group === group);
+      return rows.length
+        ? `<div class="group-heading">${group}</div>${rows.map(conversationRow).join('')}`
+        : '';
+    })
+    .join('');
+}
+const sampleAnswer =
+  '<p>好的。第一印象不一定要做得更满,<br />而是让用户更快地感到:<strong>这里懂我。</strong></p><h2>先把这三件事做好</h2><ul><li><strong>让入口更清楚</strong><br />一个明确的主操作,比同时展示很多功能更有效。</li><li><strong>让阅读更轻松</strong><br />减少卡片边框,拉开段落间距,让内容成为主角。</li><li><strong>让操作有回应</strong><br />无论是发送、等待还是完成,都给出清晰、克制的反馈。</li></ul><blockquote>好的体验,是不用思考下一步该点哪里。</blockquote><p>我把具体建议整理成了一份文档,可以先从首页和对话页开始验证。</p>';
+function sampleMessages(conversation) {
+  if (conversation.id === 'c1')
+    return [
+      { role: 'user', text: '我们来想想,怎么把产品的第一印象做得更好?' },
+      { role: 'assistant', html: sampleAnswer, file: true },
+    ];
+  return [
+    { role: 'user', text: conversation.title },
+    {
+      role: 'assistant',
+      html: `<p>${esc(conversation.preview)}</p><p>这段对话保留在「${esc(workspaces.find((workspace) => workspace.id === conversation.workspace)?.name || '日常对话')}」中,你可以接着补充想法。</p><blockquote>这是界面演示内容,不是真实的历史消息。</blockquote>`,
+    },
+  ];
+}
+function fileCard() {
+  return `<button class="file-card" data-action="preview-file"><span class="file-badge">DOC</span><span><strong>产品初体验优化建议</strong><small>DOCX · 24 KB · 已上传云盘(演示)</small></span>${icon('right')}</button>`;
+}
+function renderChat() {
+  const conversation = getConversation(),
+    agent = getAgent(conversation.agentId);
+  if (!messages.has(conversation.id)) messages.set(conversation.id, sampleMessages(conversation));
+  const rows = messages.get(conversation.id);
+  main.innerHTML = `<section class="screen chat-screen">${state.disconnected ? `<button class="connection-banner" data-action="reconnect">${icon('wifi')}连接已断开,点击重连 ${icon('right')}</button>` : ''}<div class="chat-date">今天 · 10:42</div>${rows.map((message, index) => (message.role === 'user' ? `<div class="user-message"><div class="user-bubble">${esc(message.text).replace(/\n/g, '<br />')}${message.files?.map((name) => `<span class="user-file">${icon('clip')} ${esc(name)}</span>`).join('') || ''}</div></div>` : `<article class="assistant-message"><div class="assistant-heading">${icon(agent.symbol)}<span>${esc(agent.name)}</span><time>演示回复</time></div><details class="process"><summary>${icon('check')} 已完成 ${message.file ? '3' : '2'} 个步骤 · ${message.file ? '12' : '3'} 秒 ${icon('chevron', 'chevron')}</summary><ol><li>理解需求与对话上下文</li><li>整理可执行的建议</li>${message.file ? '<li>生成文档并上传云盘</li>' : ''}</ol></details><div class="assistant-body">${message.html}</div>${message.file ? fileCard() : ''}<div class="message-actions"><button aria-label="复制回复" data-action="copy-message" data-index="${index}">${icon('copy')}</button>${message.file ? `<button aria-label="查看成果文件" data-action="details" data-tab="deliver">${icon('file')}</button>` : ''}<small>AI 生成 · 请核实</small></div></article>`)).join('')}${state.generating && state.generatingId === conversation.id ? '<div class="assistant-heading">' + icon(agent.symbol) + '正在整理你的想法</div><div class="typing" role="status" aria-label="正在生成演示回复"><i></i><i></i><i></i></div>' : ''}</section>`;
+}
+function renderContacts() {
+  main.innerHTML = `<section class="screen">${tabs(
+    [
+      ['agents', '数字生命'],
+      ['coworkers', '同事'],
+    ],
+    state.contactFilter,
+    'contact-filter',
+  )}${searchField('搜索联系人', 'contact-search', state.keyword)}<div id="contact-results">${contactResults()}</div></section>`;
+}
+function contactResults() {
+  if (state.contactFilter === 'coworkers') {
+    const people = [
+      { name: '林一', role: '产品设计 · 我', initial: '林' },
+      { name: '陈序', role: '研发协作', initial: '陈' },
+    ].filter((person) => person.name.includes(state.keyword));
+    return people.length
+      ? `<div class="contact-department">产品与研发 · ${people.length} 人</div>${people.map((person) => `<div class="contact-row"><button data-action="coworker" data-name="${person.name}"><span class="avatar person">${person.initial}</span><span><strong>${person.name}</strong><small>${person.role}</small></span></button>${icon('right')}</div>`).join('')}`
+      : emptyState('没有找到联系人');
+  }
+  const filtered = agents.filter((agent) => `${agent.name} ${agent.role}`.includes(state.keyword));
+  return filtered.length
+    ? `<div class="section-label"><span>我的数字伙伴</span><span>${filtered.length} 位</span></div>${filtered.map((agent) => `<div class="contact-row"><button data-action="open-agent" data-id="${agent.id}">${avatar(agent)}<span><strong>${esc(agent.name)}</strong><small>${agent.role} · ${agent.online ? '在线' : '离线'}</small></span></button>${icon('right')}</div>`).join('')}`
+    : emptyState('没有找到数字生命');
+}
+function renderWorkbench() {
+  main.innerHTML = `<section class="screen"><p class="page-subtitle">伙伴们的工作状态,一眼就知道。</p><div class="overview"><div><strong>3</strong><small>数字生命</small></div><div><strong>2<span style="font-size:12px"> / 3</span></strong><small>在线</small></div><div><strong>1</strong><small>离线</small></div></div>${tabs(
+    [
+      ['all', '全部'],
+      ['online', '在线'],
+      ['offline', '离线'],
+    ],
+    state.agentFilter,
+    'agent-filter',
+  )}${searchField('搜索数字生命', 'agent-search', state.keyword)}<div id="agent-results">${agentResults()}</div></section>`;
+}
+function agentResults() {
+  const filtered = agents.filter(
+    (agent) =>
+      agent.name.includes(state.keyword) &&
+      (state.agentFilter === 'all' || agent.online === (state.agentFilter === 'online')),
+  );
+  return filtered.length
+    ? filtered
+        .map(
+          (agent) =>
+            `<article class="agent-card"><div class="agent-card-head">${avatar(agent)}<div><h2>${esc(agent.name)}</h2><small>${agent.role}</small></div><span class="tag ${agent.online ? '' : 'offline'}">${agent.online ? '在线' : '离线'}</span></div><p class="agent-current">${agent.task}</p><div class="agent-metrics"><span>CPU <b>${agent.cpu}</b></span><span>内存 <b>${agent.memory}</b></span><span>余额 <b>¥${agent.balance}</b></span></div><div class="agent-actions"><button data-action="channels" data-id="${agent.id}">${icon('link')}通道</button><button data-action="recharge" data-id="${agent.id}">${icon('wallet')}充值</button><button data-action="agent-chat" data-id="${agent.id}">进入会话 ${icon('arrow-right')}</button></div></article>`,
+        )
+        .join('')
+    : emptyState('没有匹配的数字生命');
+}
+function renderMine() {
+  main.innerHTML = `<section class="screen"><div class="profile-card"><span class="avatar">林</span><div><h2>林一</h2><p>fmode 体验空间 · 演示账号</p></div></div><section class="settings-group"><h2>外观与阅读</h2><div class="palette-row">${[
+    ['forest', '#386b52', '森林'],
+    ['blue', '#496a96', '湖蓝'],
+    ['purple', '#806495', '暮紫'],
+    ['amber', '#9a7641', '暖砂'],
+  ]
+    .map(
+      ([value, color, label]) =>
+        `<button class="palette-option ${state.palette === value ? 'active' : ''}" style="--swatch:${color}" aria-label="${label}配色" aria-pressed="${state.palette === value}" data-action="palette" data-value="${value}"><span></span></button>`,
+    )
+    .join(
+      '',
+    )}</div><button class="settings-row" data-action="theme" role="switch" aria-checked="${state.dark}">${icon('moon')}深色模式<span class="toggle ${state.dark ? 'on' : ''}"></span></button><button class="settings-row" data-action="font">${icon('file')}对话正文字号<small>${state.font === 14 ? '标准' : state.font === 16 ? '较大' : '大号'}</small>${icon('right')}</button></section><section class="settings-group"><h2>账号与通知</h2><button class="settings-row" data-action="token">${icon('key')}访问 Token<small>仅演示占位</small>${icon('right')}</button><button class="settings-row" data-action="notifications">${icon('bell')}消息与任务通知<small>权限说明</small>${icon('right')}</button><button class="settings-row danger" data-action="logout">${icon('logout')}退出登录${icon('right')}</button></section><div class="version-text">fmode · 人机共生中枢<br />Mobile experience / 01 · 独立体验提案</div></section>`;
+}
+function renderAgent() {
+  const agent = getAgent(state.detailAgentId);
+  main.innerHTML = `<section class="screen"><div class="profile-card">${avatar(agent)}<div><h2>${esc(agent.name)}</h2><p>${agent.role}</p></div></div><section class="settings-group"><h2>容器设置</h2><button class="settings-row" data-action="rename-agent" data-id="${agent.id}">显示名称<small>${esc(agent.name)}</small>${icon('right')}</button><div class="settings-row">连接状态<small>${agent.online ? '在线' : '离线'}</small></div></section><p class="page-subtitle">沿用现有通讯录逻辑:数字生命详情只提供重命名。</p></section>`;
+}
+function openOverlay(html) {
+  if (!overlay.childElementCount) returnFocus = document.activeElement;
+  overlay.innerHTML = html;
+  app.inert = true;
+  requestAnimationFrame(() => {
+    const target = overlay.querySelector('[autofocus]') || overlay.querySelector('button,input,select,summary');
+    target?.focus({ preventScroll: true });
+  });
+}
+function closeOverlay() {
+  const wasOpen = overlay.childElementCount > 0;
+  overlay.innerHTML = '';
+  app.inert = false;
+  state.pendingSend = false;
+  if (wasOpen && returnFocus?.isConnected) returnFocus.focus({ preventScroll: true });
+}
+function sheet(title, content, extra = '') {
+  openOverlay(
+    `<div class="backdrop" data-action="close" aria-hidden="true"></div><section class="sheet" role="dialog" aria-modal="true" aria-labelledby="sheet-title"><div class="sheet-handle" aria-hidden="true"></div><header class="sheet-header"><h2 id="sheet-title">${title}</h2>${ib('close', '关闭面板', 'close')}</header>${extra}<div class="sheet-body">${content}</div></section>`,
+  );
+}
+function drawerHistory(keyword = '') {
+  if (state.drawerView === 'recent') {
+    const recent = activeConversations().filter((conversation) =>
+      `${conversation.title} ${getAgent(conversation.agentId).name} ${workspaces.find((workspace) => workspace.id === conversation.workspace)?.name || ''}`.includes(
+        keyword,
+      ),
+    );
+    return `<div class="group-heading">最近的协作<span>${recent.length} 段对话</span></div>${recent.map((conversation) => drawerConversation(conversation)).join('') || emptyState('没有找到对话', '换个关键词再试试。')}`;
+  }
+  if (state.drawerView === 'agents') {
+    return (
+      agents
+        .map((agent) => {
+          const rows = activeConversations().filter(
+            (conversation) =>
+              conversation.agentId === agent.id &&
+              `${conversation.title} ${agent.name}`.includes(keyword),
+          );
+          if (!rows.length) return '';
+          const running = rows.filter(
+            (conversation) => collaboration.get(conversation.id)?.kind === 'running',
+          ).length;
+          return `<section class="drawer-agent-group"><div class="drawer-agent-head">${avatar(agent)}<span><strong>${esc(agent.name)}</strong><small>${agent.role}</small></span>${running ? `<span class="inline-activity running">${running} 进行中</span>` : `<small>${rows.length} 段对话</small>`}<button class="drawer-agent-new" data-action="agent-new" data-id="${agent.id}" aria-label="在 ${esc(agent.name)} 中新建对话">${icon('plus')}</button></div>${rows.map((conversation) => drawerConversation(conversation)).join('')}</section>`;
+        })
+        .join('') || emptyState('没有找到对话')
+    );
+  }
+  const matches = (conversation) =>
+      `${conversation.title} ${getAgent(conversation.agentId).name}`.includes(keyword),
+    row = (conversation) =>
+      `<button class="drawer-history ${state.page === 'chat' && state.currentId === conversation.id ? 'active' : ''}" data-action="open-chat" data-id="${conversation.id}">${icon('chat')}<span>${esc(conversation.title)}</span></button>`;
+  return `${workspaces
+    .map(
+      (workspace) =>
+        `<div class="workspace-head"><button class="workspace-toggle" data-action="drawer-workspace" data-id="${workspace.id}" aria-expanded="${state.drawerExpanded.has(workspace.id)}">${icon(state.drawerExpanded.has(workspace.id) ? 'chevron' : 'right')}${icon('folder')}${esc(workspace.name)}</button>${ib('more', workspace.name + ' 更多操作', 'workspace-menu', `data-id="${workspace.id}"`)}</div>${
+          state.drawerExpanded.has(workspace.id) || keyword
+            ? activeConversations()
+                .filter(
+                  (conversation) =>
+                    conversation.workspace === workspace.id && matches(conversation),
+                )
+                .map(row)
+                .join('')
+            : ''
+        }`,
+    )
+    .join(
+      '',
+    )}<button class="text-button" data-action="create-workspace">${icon('plus')} 新建工作区</button><div class="group-heading">日常对话</div>${
+    activeConversations()
+      .filter((conversation) => !conversation.workspace && matches(conversation))
+      .map(row)
+      .join('') || '<p class="sheet-description">暂无匹配对话</p>'
+  }<button class="drawer-history" data-action="show-archived">${icon('archive')}已归档 <span style="margin-left:auto">${conversations.filter((conversation) => conversation.archived).length}</span></button>`;
+}
+function openDrawer() {
+  openOverlay(
+    `<div class="backdrop" data-action="close" aria-hidden="true"></div><aside class="drawer" role="dialog" aria-modal="true" aria-label="会话与导航"><div class="drawer-header"><div class="header-brand">${icon('flower')}<strong>fmode</strong></div>${ib('close', '关闭侧栏', 'close')}</div><button class="primary-button" data-action="new-chat">${icon('plus')}新建对话</button>${searchField('搜索历史对话', 'drawer-search')}<div class="drawer-scroll" id="drawer-results">${drawerHistory()}</div><nav class="drawer-nav" aria-label="侧栏导航">${navigation()}</nav><div class="drawer-bottom">林一 · 体验空间 / 演示</div></aside>`,
+  );
+  overlay.querySelector('.search-field').insertAdjacentHTML(
+    'afterend',
+    tabs(
+      [
+        ['recent', '最近'],
+        ['agents', '数字生命'],
+        ['workspace', '工作区'],
+      ],
+      state.drawerView,
+      'drawer-view',
+    ),
+  );
+  overlay
+    .querySelector('.drawer-scroll')
+    .insertAdjacentHTML(
+      'afterend',
+      '<button class="drawer-archive" data-action="show-archived">' +
+        icon('archive') +
+        '已归档对话' +
+        icon('right') +
+        '</button>',
+    );
+}
+function pickAgent(pending = false) {
+  sheet(
+    '和谁一起开始?',
+    `<p class="sheet-description">选择数字生命,草稿和附件会一并保留。</p>${agents.map((agent) => `<button class="sheet-list-button" data-action="choose-agent" data-id="${agent.id}">${avatar(agent)}<span>${esc(agent.name)}<small>${agent.role} · ${agent.online ? '在线' : '离线'}</small></span>${state.agentId === agent.id ? icon('check', 'selected-check') : icon('right')}</button>`).join('')}<p class="sheet-description" style="margin-top:18px">保留「先选择数字生命,再建立会话」的现有流程。</p>`,
+  );
+  state.pendingSend = pending;
+}
+function details(tab = 'task') {
+  const agent = getAgent(getConversation().agentId),
+    content = {
+      task: `<p class="sheet-description">当前会话中的任务,不新增全局任务入口。</p><div class="sheet-item"><span class="tag">已完成</span><strong>产品初体验优化建议</strong><p>分析首页与对话页的体验问题,整理可执行的改进方向。</p><p>3 / 3 步骤完成 · ${esc(agent.name)}</p></div>`,
+      file: `${fileCard()}<p class="sheet-description">演示文件内容为静态预览,不会上传或读取云盘。</p>`,
+      deliver: `<div class="sheet-item"><span class="tag">v1.0</span><strong>产品初体验优化建议</strong><p>今天 10:42 · ${esc(agent.name)} 已交付</p>${fileCard()}</div>`,
+      state: `<div class="sheet-item"><strong>数字生命</strong><p>${esc(agent.name)} · ${agent.online ? '在线' : '离线'}</p></div><div class="sheet-item"><strong>会话连接</strong><p>${state.disconnected ? '连接中断,等待重连' : '已连接 · 当前没有待发送消息'}</p></div><p class="sheet-description" style="margin-top:18px">原型状态演示(不影响实际服务)</p><div class="state-chips"><button data-action="disconnect">模拟断线</button><button data-action="reconnect">恢复连接</button></div>`,
+    };
+  if (state.currentId !== 'c1' && tab !== 'state')
+    content[tab] = emptyState(
+      tab === 'task' ? '还没有任务' : tab === 'file' ? '还没有文件' : '还没有成果',
+      '这段对话中的内容会显示在这里。',
+      tab === 'task' ? 'check' : 'file',
+    );
+  sheet(
+    '会话详情',
+    content[tab] || content.task,
+    tabs(
+      [
+        ['task', '任务'],
+        ['file', '文件'],
+        ['deliver', '成果'],
+        ['state', '状态'],
+      ],
+      tab,
+      'detail-tab',
+    ),
+  );
+}
+function previewFile() {
+  sheet(
+    '文档预览',
+    `<p class="sheet-description">产品初体验优化建议.docx · 演示内容</p><article class="preview-document"><div class="eyebrow">FMODE / EXPERIENCE NOTE</div><h1>把第一印象做好</h1><p>一份围绕移动端的体验优化建议<br />2026.11.16 / v1.0</p><h2>01 · 让入口更清楚</h2><p>保留熟悉的导航,用明确的主操作降低理解成本。</p><h2>02 · 让内容回到中心</h2><p>减少无效的视觉容器,用段落、留白与字重建立信息层级。</p><table><thead><tr><th>页面</th><th>体验方向</th></tr></thead><tbody><tr><td>新建对话</td><td>一个输入框,开始协作</td></tr><tr><td>会话详情</td><td>正文优先,过程折叠</td></tr><tr><td>会话列表</td><td>搜索、分组与清晰状态</td></tr></tbody></table><h2>03 · 每次操作都有回应</h2><p>发送、加载、离线和失败状态清晰可见,操作始终可恢复。</p></article><button class="primary-button" data-action="download-demo">${icon('download')}下载演示文稿(TXT)</button><button class="text-button" data-action="details" data-tab="file">${icon('back')}返回会话文件</button>`,
+  );
+}
+function formSheet(title, label, value, submitAction, identifier = '') {
+  sheet(
+    title,
+    `<form class="sheet-form" data-form="${submitAction}" data-id="${identifier}"><label for="form-value">${label}</label><input id="form-value" name="value" maxlength="60" value="${esc(value)}" autocomplete="off" autofocus required /><p class="form-error" role="alert"></p><button class="primary-button" type="submit">保存</button></form>`,
+  );
+}
+function confirmation(title, description, action, identifier) {
+  sheet(
+    title,
+    `<p class="sheet-description">${description}</p><div class="button-row"><button class="secondary-button" data-action="close">取消</button><button class="secondary-button danger" data-action="${action}" data-id="${identifier || ''}">确认${title.replace('?', '')}</button></div>`,
+  );
+}
+function conversationMenu(identifier) {
+  const conversation = getConversation(identifier);
+  sheet(
+    '管理这段对话',
+    `<p class="sheet-description">${esc(conversation.title)}</p><button class="sheet-list-button" data-action="rename-conversation" data-id="${identifier}">${icon('edit')}重命名</button><button class="sheet-list-button" data-action="move-conversation" data-id="${identifier}">${icon('folder')}移动到工作区</button><button class="sheet-list-button" data-action="archive-conversation" data-id="${identifier}">${icon('archive')}${conversation.archived ? '取消归档' : '归档对话'}</button><button class="sheet-list-button danger" data-action="delete-conversation" data-id="${identifier}">${icon('trash')}删除对话</button>`,
+  );
+}
+function drawerConversation(conversation) {
+  const status = collaboration.get(conversation.id)?.kind || 'idle';
+  const workspace =
+    workspaces.find((item) => item.id === conversation.workspace)?.name || '日常对话';
+  return `<button class="drawer-conversation ${state.page === 'chat' && state.currentId === conversation.id ? 'active' : ''}" data-action="open-chat" data-id="${conversation.id}"><span class="drawer-conversation-title">${esc(conversation.title)}<span class="mini-state ${status}" aria-label="${activityNames[status]}">${status === 'done' ? icon('check') : status === 'attention' ? '!' : ''}</span></span><small>${state.drawerView === 'agents' ? '' : esc(getAgent(conversation.agentId).name) + ' · '}${esc(workspace)}</small></button>`;
+}
+function activityResults() {
+  const rows = activeConversations().filter((conversation) => {
+    const status = collaboration.get(conversation.id)?.kind;
+    return (
+      status &&
+      status !== 'idle' &&
+      (state.activityFilter === 'all' || status === state.activityFilter) &&
+      `${conversation.title} ${getAgent(conversation.agentId).name}`.includes(state.activityKeyword)
+    );
+  });
+  return (
+    ['running', 'attention', 'done']
+      .map((kind) => {
+        const group = rows.filter(
+          (conversation) => collaboration.get(conversation.id)?.kind === kind,
+        );
+        if (!group.length) return '';
+        return `<div class="activity-group-label"><span class="inline-activity ${kind}">${activityNames[kind]}</span><span>${group.length}</span></div>${group
+          .map((conversation) => {
+            const activity = collaboration.get(conversation.id);
+            const agent = getAgent(conversation.agentId);
+            const workspace =
+              workspaces.find((item) => item.id === conversation.workspace)?.name || '日常对话';
+            return `<button class="activity-card ${kind} ${conversation.id === state.currentId ? 'current' : ''}" data-action="activity-open" data-id="${conversation.id}"><span class="activity-card-avatar">${avatar(agent)}<span class="mini-state ${kind}">${kind === 'done' ? icon('check') : kind === 'attention' ? '!' : ''}</span></span><span class="activity-card-content"><strong>${esc(conversation.title)}</strong><small>${esc(agent.name)} · ${esc(workspace)}</small><span class="activity-detail">${esc(activity.label)}</span></span><span class="activity-card-end">${conversation.id === state.currentId ? '<em>当前</em>' : icon('right')}<small>${activity.elapsed}</small></span></button>`;
+          })
+          .join('')}`;
+      })
+      .join('') || emptyState('这里暂时没有协作动态', '切换筛选,看看其他会话。', 'check')
+  );
+}
+function openActivity() {
+  const count = (kind) =>
+    activeConversations().filter(
+      (conversation) => collaboration.get(conversation.id)?.kind === kind,
+    ).length;
+  sheet(
+    '切换协作',
+    `<p class="sheet-description">不用退出对话,也能知道每件事的进展。</p>${searchField('搜索正在协作的事', 'activity-search', state.activityKeyword)}${tabs(
+      [
+        ['all', '全部'],
+        ['running', '进行中 ' + count('running')],
+        ['attention', '待关注 ' + count('attention')],
+        ['done', '已完成 ' + count('done')],
+      ],
+      state.activityFilter,
+      'activity-filter',
+    )}<div id="activity-results">${activityResults()}</div><div class="activity-sheet-footer"><span>会话状态演示 · 不等于数字生命在线状态</span><button data-action="complete-demo">模拟完成提醒</button></div>`,
+  );
+  overlay.querySelector('.sheet').classList.add('activity-sheet');
+}
+function quickCurrent() {
+  if (state.generating) {
+    toast('演示回复完成后即可新建');
+    return;
+  }
+  const previous = getConversation();
+  saveDraft();
+  const identifier = `c${Date.now()}`;
+  conversations.unshift({
+    id: identifier,
+    title: '新对话',
+    agentId: previous.agentId,
+    preview: '等待你的第一个想法',
+    time: '刚刚',
+    group: '今天',
+    workspace: previous.workspace,
+    unread: 0,
+    archived: false,
+  });
+  collaboration.set(identifier, { kind: 'idle', label: '等待新的想法', elapsed: '空闲' });
+  messages.set(identifier, []);
+  navigate('chat', identifier);
+  toast('已在 ' + getAgent(previous.agentId).name + ' 中新建,原对话草稿已保留');
+}
+function editCurrentTitle() {
+  const conversation = getConversation();
+  formSheet(
+    '给这段对话起个名字',
+    '会话标题',
+    conversation.title,
+    'rename-conversation',
+    conversation.id,
+  );
+  const form = overlay.querySelector('form');
+  form.insertAdjacentHTML(
+    'beforeend',
+    `<button class="regenerate-title" type="button" data-action="regenerate-title">${icon('spark')}生成一个候选标题<span>演示</span></button><p class="title-protection">${icon('shield')}只有点保存才会更新。手动标题不会被自动覆盖。</p>`,
+  );
+}
+function previewListState(mode) {
+  saveDraft();
+  state.page = 'messages';
+  state.keyword = '';
+  history.pushState(null, '', '#/messages');
+  closeOverlay();
+  render();
+  const results = document.querySelector('#conversation-results');
+  if (mode === 'loading') {
+    results.innerHTML = `<div class="skeleton-list" role="status" aria-label="正在加载会话" aria-busy="true">${Array.from({ length: 5 }, () => '<div class="skeleton-row"><span></span><div><i></i><i></i></div></div>').join('')}</div>`;
+    setTimeout(() => {
+      if (results.isConnected) results.innerHTML = conversationResults();
+    }, 1800);
+  } else if (mode === 'error') {
+    results.innerHTML =
+      emptyState('暂时没连上,不是消息丢了', '网络恢复后可以重试,草稿仍然保留。', 'wifi') +
+      '<button class="primary-button" data-action="retry-list">重新加载</button>';
+  } else
+    results.innerHTML =
+      emptyState('还没有对话,从一个想法开始', '选择熟悉的数字生命,开始你的第一次协作。', 'chat') +
+      '<button class="primary-button" data-action="new-chat">开始新对话</button>';
+}
+function completeDemo() {
+  const conversation = getConversation('c4');
+  if (!conversation) {
+    toast('这条演示会话已删除,刷新可恢复');
+    return;
+  }
+  const activity = collaboration.get(conversation.id);
+  if (activity?.kind === 'done') {
+    toast('该协作已完成,可在「已完成」中查看');
+    return;
+  }
+  collaboration.set(conversation.id, {
+    kind: 'done',
+    label: '接口检查已完成,结果已整理',
+    elapsed: '刚刚完成',
+  });
+  conversation.unread = 1;
+  closeOverlay();
+  render();
+  document.querySelector('#completion-banner')?.remove();
+  document
+    .querySelector('#device')
+    .insertAdjacentHTML(
+      'beforeend',
+      `<div class="completion-banner" id="completion-banner" role="status"><span class="completion-mark">${icon('check')}</span><button data-action="completion-open" data-id="${conversation.id}"><strong>阿澈的接口检查完成了</strong><small>结果已整理好,点这里接着看 · 演示</small></button><button data-action="dismiss-completion" aria-label="关闭完成提醒">${icon('close')}</button></div>`,
+    );
+}
+function send() {
+  if (state.generating || (!state.draft.trim() && !state.attachments.length)) return;
+  if (state.disconnected && state.page === 'chat') {
+    toast('连接已断开,请先重连;草稿已保留');
+    return;
+  }
+  if (state.page === 'home' && !state.agentId) {
+    pickAgent(true);
+    return;
+  }
+  if (state.page === 'home') {
+    drafts.delete('home');
+    const identifier = `c${Date.now()}`;
+    conversations.unshift({
+      id: identifier,
+      title: state.draft.trim().slice(0, 18) || '附件对话',
+      agentId: state.agentId,
+      preview: '正在整理你的想法…',
+      time: '刚刚',
+      group: '今天',
+      workspace: state.newWorkspace,
+      unread: 0,
+      archived: false,
+    });
+    messages.set(identifier, []);
+    state.currentId = identifier;
+    state.newWorkspace = null;
+    state.page = 'chat';
+    history.pushState(null, '', `#/chat/${identifier}`);
+  }
+  const conversation = getConversation(),
+    rows = messages.get(conversation.id) || sampleMessages(conversation),
+    question = state.draft.trim(),
+    files = state.attachments.map((file) => file.name);
+  rows.push({ role: 'user', text: question || '请查看我添加的附件', files });
+  if (conversation.title === '新对话' && !conversation.manuallyNamed)
+    conversation.title = (question || '附件对话').slice(0, 18);
+  collaboration.set(conversation.id, {
+    kind: 'running',
+    label: '正在处理你的消息',
+    elapsed: '刚刚开始',
+  });
+  messages.set(conversation.id, rows);
+  state.draft = '';
+  state.attachments = [];
+  drafts.delete(conversation.id);
+  state.generating = true;
+  state.generatingId = conversation.id;
+  render();
+  main.scrollTop = main.scrollHeight;
+  clearTimeout(generationTimer);
+  generationTimer = setTimeout(() => {
+    rows.push({
+      role: 'assistant',
+      html: `<p>收到,我们就从「<strong>${esc(question || '这份附件')}</strong>」开始。</p><p>我会先把目标、已有信息和下一步梳理清楚,再一起把它变成可执行的行动。</p><blockquote>这是一条本地模拟回复,仅用于体验发送、等待和阅读的完整流程${files.length ? ';附件只展示文件名,未读取或上传' : ''}。</blockquote>`,
+    });
+    conversation.preview = '已整理好思路,可以继续讨论。';
+    collaboration.set(conversation.id, {
+      kind: 'done',
+      label: '演示回复已完成',
+      elapsed: '刚刚完成',
+    });
+    state.generating = false;
+    if (state.page === 'chat' && state.currentId === conversation.id) {
+      render();
+      main.scrollTop = main.scrollHeight;
+    } else if (['home', 'messages'].includes(state.page)) render();
+  }, 1100);
+}
+function toast(message) {
+  const element = document.querySelector('#toast');
+  element.textContent = message;
+  element.classList.add('visible');
+  clearTimeout(toastTimer);
+  toastTimer = setTimeout(() => element.classList.remove('visible'), 2700);
+}
+async function copyText(text) {
+  try {
+    await navigator.clipboard.writeText(text);
+    toast('已复制');
+  } catch {
+    toast('浏览器未开放剪贴板权限,请手动选择内容复制');
+  }
+}
+function downloadDemo() {
+  const content =
+      '产品初体验优化建议(演示文稿)\n\n01 让入口更清楚\n保留现有导航与功能,突出主操作。\n\n02 让阅读更轻松\n减少厚重卡片,扩大段落留白。\n\n03 让操作有回应\n清晰呈现加载、断线与错误状态。\n\n本文件为独立 HTML 原型的演示文稿,并非真实云盘文件。',
+    url = URL.createObjectURL(new Blob([content], { type: 'text/plain;charset=utf-8' })),
+    link = document.createElement('a');
+  link.href = url;
+  link.download = '产品初体验优化建议-演示.txt';
+  link.click();
+  setTimeout(() => URL.revokeObjectURL(url), 1000);
+  toast('演示文稿已下载,不是实际 DOCX 文件');
+}
+function showArchived() {
+  sheet(
+    '已归档对话',
+    conversations
+      .filter((conversation) => conversation.archived)
+      .map(conversationRow)
+      .join('') || emptyState('没有归档对话', '归档的对话会保留在这里。', 'archive'),
+  );
+}
+function newChat(workspace = null, agentId = null) {
+  if (state.generating) {
+    toast('演示回复完成后即可新建对话');
+    return;
+  }
+  state.agentId = agentId;
+  state.newWorkspace = workspace;
+  navigate('home');
+}
+const actions = {
+  'preview-states': () =>
+    sheet(
+      '加载与反馈状态',
+      '<p class="sheet-description">仅切换演示视图,不改变真实数据或权限。</p><button class="sheet-list-button" data-action="list-state" data-value="loading">' +
+        icon('more') +
+        '加载骨架屏</button><button class="sheet-list-button" data-action="list-state" data-value="empty">' +
+        icon('chat') +
+        '首次使用空态</button><button class="sheet-list-button" data-action="list-state" data-value="error">' +
+        icon('wifi') +
+        '断网与重试</button>',
+    ),
+  'list-state': (button) => previewListState(button.dataset.value),
+  'retry-list': renderMessages,
+  activity: openActivity,
+  'activity-filter': (button) => {
+    state.activityFilter = button.dataset.value;
+    openActivity();
+  },
+  'activity-open': (button) => {
+    closeOverlay();
+    navigate('chat', button.dataset.id);
+    requestAnimationFrame(() => {
+      main.scrollTop = main.scrollHeight;
+    });
+  },
+  'drawer-view': (button) => {
+    state.drawerView = button.dataset.value;
+    openDrawer();
+  },
+  'quick-current': quickCurrent,
+  'agent-new': (button) => {
+    newChat(null, button.dataset.id);
+    toast('已选中 ' + getAgent(button.dataset.id).name + ',不用再次选择');
+  },
+  'edit-current-title': editCurrentTitle,
+  'regenerate-title': () => {
+    const conversation = getConversation();
+    const rows = messages.get(conversation.id) || [];
+    const question = [...rows].reverse().find((message) => message.role === 'user')?.text;
+    overlay.querySelector('#form-value').value =
+      conversation.id === 'c1'
+        ? '移动端第一印象与体验优化'
+        : (question || conversation.title).slice(0, 22);
+    toast('候选标题已填入,保存后才会更新;未调用 AI');
+  },
+  'complete-demo': completeDemo,
+  'dismiss-completion': () => document.querySelector('#completion-banner')?.remove(),
+  'completion-open': (button) => {
+    document.querySelector('#completion-banner')?.remove();
+    navigate('chat', button.dataset.id);
+    requestAnimationFrame(() => {
+      main.scrollTop = main.scrollHeight;
+    });
+  },
+  navigate: (button) => navigate(button.dataset.page),
+  drawer: openDrawer,
+  close: closeOverlay,
+  'new-chat': () => newChat(),
+  'open-chat': (button) => navigate('chat', button.dataset.id),
+  'pick-agent': () => pickAgent(false),
+  'choose-agent': (button) => {
+    const pending = state.pendingSend;
+    state.agentId = button.dataset.id;
+    closeOverlay();
+    renderComposer();
+    if (pending) send();
+  },
+  'agent-info': () => {
+    const agent = getAgent(getConversation().agentId);
+    sheet(
+      '当前数字生命',
+      `<div class="profile-card">${avatar(agent)}<div><h2>${esc(agent.name)}</h2><p>${agent.role} · ${agent.online ? '在线' : '离线'}</p></div></div><p class="sheet-description">当前会话固定关联该数字生命。如需更换,请新建对话。</p>`,
+    );
+  },
+  prompt: (button) => {
+    state.draft = button.dataset.value;
+    renderComposer();
+    document.querySelector('#draft').focus();
+  },
+  send,
+  attach: () => {
+    if (state.generating) return;
+    document.querySelector('#file-input').click();
+  },
+  'remove-attachment': (button) => {
+    state.attachments.splice(Number(button.dataset.index), 1);
+    renderComposer();
+  },
+  'message-filter': (button) => {
+    state.filter = button.dataset.value;
+    renderMessages();
+  },
+  'contact-filter': (button) => {
+    state.contactFilter = button.dataset.value;
+    state.keyword = '';
+    renderContacts();
+  },
+  'agent-filter': (button) => {
+    state.agentFilter = button.dataset.value;
+    renderWorkbench();
+  },
+  'toggle-workspace': (button) => {
+    state.expanded.has(button.dataset.id)
+      ? state.expanded.delete(button.dataset.id)
+      : state.expanded.add(button.dataset.id);
+    document.querySelector('#conversation-results').innerHTML = conversationResults();
+  },
+  'drawer-workspace': (button) => {
+    state.drawerExpanded.has(button.dataset.id)
+      ? state.drawerExpanded.delete(button.dataset.id)
+      : state.drawerExpanded.add(button.dataset.id);
+    document.querySelector('#drawer-results').innerHTML = drawerHistory(
+      document.querySelector('[data-input="drawer-search"]').value,
+    );
+  },
+  'workspace-chat': (button) => newChat(button.dataset.id),
+  'create-workspace': () =>
+    formSheet('新建工作区', '工作区名称(最多 24 字)', '', 'create-workspace'),
+  'workspace-menu': (button) => {
+    const workspace = workspaces.find((item) => item.id === button.dataset.id);
+    sheet(
+      esc(workspace.name),
+      `<button class="sheet-list-button" data-action="rename-workspace" data-id="${workspace.id}">${icon('edit')}重命名工作区</button><button class="sheet-list-button danger" data-action="delete-workspace" data-id="${workspace.id}">${icon('trash')}删除工作区</button>`,
+    );
+  },
+  'rename-workspace': (button) =>
+    formSheet(
+      '重命名工作区',
+      '工作区名称(最多 24 字)',
+      workspaces.find((workspace) => workspace.id === button.dataset.id).name,
+      'rename-workspace',
+      button.dataset.id,
+    ),
+  'delete-workspace': (button) =>
+    confirmation(
+      '删除工作区?',
+      '其中的会话会移到「日常对话」,不会被删除。此操作只影响演示数据。',
+      'confirm-delete-workspace',
+      button.dataset.id,
+    ),
+  'confirm-delete-workspace': (button) => {
+    conversations.forEach((conversation) => {
+      if (conversation.workspace === button.dataset.id) conversation.workspace = null;
+    });
+    workspaces = workspaces.filter((workspace) => workspace.id !== button.dataset.id);
+    if (state.newWorkspace === button.dataset.id) state.newWorkspace = null;
+    closeOverlay();
+    render();
+    toast('工作区已删除,会话已移到日常对话');
+  },
+  'conversation-menu': (button) => conversationMenu(button.dataset.id),
+  'rename-conversation': (button) =>
+    formSheet(
+      '重命名对话',
+      '对话名称',
+      getConversation(button.dataset.id).title,
+      'rename-conversation',
+      button.dataset.id,
+    ),
+  'move-conversation': (button) =>
+    sheet(
+      '移动到工作区',
+      `<button class="sheet-list-button" data-action="choose-workspace" data-id="${button.dataset.id}" data-workspace="">${icon('chat')}日常对话</button>${workspaces.map((workspace) => `<button class="sheet-list-button" data-action="choose-workspace" data-id="${button.dataset.id}" data-workspace="${workspace.id}">${icon('folder')}${esc(workspace.name)}</button>`).join('')}`,
+    ),
+  'choose-workspace': (button) => {
+    getConversation(button.dataset.id).workspace = button.dataset.workspace || null;
+    closeOverlay();
+    render();
+    toast('已移动,仅影响本地演示数据');
+  },
+  'archive-conversation': (button) => {
+    const conversation = getConversation(button.dataset.id);
+    conversation.archived = !conversation.archived;
+    closeOverlay();
+    if (state.page === 'chat' && conversation.archived) navigate('messages');
+    else render();
+    toast(conversation.archived ? '已归档,可在侧栏中找回' : '已取消归档');
+  },
+  'delete-conversation': (button) =>
+    confirmation(
+      '删除对话?',
+      '删除后这条演示对话将从当前预览中移除,刷新页面可恢复。',
+      'confirm-delete-conversation',
+      button.dataset.id,
+    ),
+  'confirm-delete-conversation': (button) => {
+    const index = conversations.findIndex((conversation) => conversation.id === button.dataset.id);
+    if (index >= 0) conversations.splice(index, 1);
+    messages.delete(button.dataset.id);
+    closeOverlay();
+    if (state.page === 'chat') navigate('messages');
+    else render();
+    toast('演示对话已删除');
+  },
+  'show-archived': showArchived,
+  details: (button) => details(button?.dataset.tab || 'task'),
+  'detail-tab': (button) => details(button.dataset.value),
+  'preview-file': previewFile,
+  'download-demo': downloadDemo,
+  'copy-message': (button) => {
+    const message = messages.get(state.currentId)[Number(button.dataset.index)],
+      content = document.createElement('div');
+    content.innerHTML = message.html;
+    copyText(content.textContent);
+  },
+  disconnect: () => {
+    state.disconnected = true;
+    closeOverlay();
+    renderChat();
+    toast('已进入断线演示,草稿不会丢失');
+  },
+  reconnect: () => {
+    state.disconnected = false;
+    closeOverlay();
+    renderChat();
+    toast('演示连接已恢复');
+  },
+  'open-agent': (button) => navigate('agent', button.dataset.id),
+  'rename-agent': (button) =>
+    formSheet(
+      '重命名数字生命',
+      '显示名称',
+      getAgent(button.dataset.id).name,
+      'rename-agent',
+      button.dataset.id,
+    ),
+  'agent-chat': (button) => {
+    const conversation = activeConversations().find((item) => item.agentId === button.dataset.id);
+    conversation ? navigate('chat', conversation.id) : newChat(null, button.dataset.id);
+  },
+  channels: (button) =>
+    sheet(
+      '消息通道',
+      `<p class="sheet-description">${esc(getAgent(button.dataset.id).name)} · 演示连接信息</p><div class="sheet-item"><span class="tag">${getAgent(button.dataset.id).online ? '已连接' : '离线'}</span><strong>Matrix</strong><p>沿用现有消息通道,不在原型中建立真实连接。</p></div>`,
+    ),
+  recharge: (button) =>
+    sheet(
+      '数字生命充值',
+      `<p class="sheet-description">${esc(getAgent(button.dataset.id).name)} · 当前演示余额 ¥${getAgent(button.dataset.id).balance}</p><div class="empty-state">${icon('shield')}<strong>这里只预览,不会产生支付</strong><p>正式迁移时继续使用现有充值页面与接口,金额、账单和支付流程均不改变。</p></div>`,
+    ),
+  coworker: (button) =>
+    sheet(
+      esc(button.dataset.name),
+      `<p class="sheet-description">同事的数字生命 · 演示</p>${agents
+        .slice(0, 2)
+        .map(
+          (agent) =>
+            `<button class="sheet-list-button" data-action="open-agent" data-id="${agent.id}">${avatar(agent)}<span>${esc(agent.name)}<small>${agent.role}</small></span>${icon('right')}</button>`,
+        )
+        .join('')}`,
+    ),
+  theme: () => {
+    state.dark = !state.dark;
+    const scroll = main.scrollTop;
+    renderMine();
+    applyPreferences();
+    main.scrollTop = scroll;
+  },
+  palette: (button) => {
+    state.palette = button.dataset.value;
+    const scroll = main.scrollTop;
+    renderMine();
+    applyPreferences();
+    main.scrollTop = scroll;
+  },
+  font: () =>
+    sheet(
+      '舒适地阅读',
+      `<p class="sheet-description">仅调整对话正文,沿用现有字号偏好功能。</p><div class="font-options">${[
+        [14, '标准'],
+        [16, '较大'],
+        [18, '大号'],
+      ]
+        .map(
+          ([value, label]) =>
+            `<button data-action="choose-font" data-value="${value}" class="${state.font === value ? 'active' : ''}">${label}</button>`,
+        )
+        .join(
+          '',
+        )}</div><div class="assistant-body" id="font-preview" style="font-size:${state.font}px;line-height:1.9;padding:14px 0">让每一个想法,都有舒展的空间。<br />好的阅读体验,从恰好的字号开始。</div>`,
+    ),
+  'choose-font': (button) => {
+    state.font = Number(button.dataset.value);
+    applyPreferences();
+    renderMine();
+    actions.font();
+  },
+  token: () =>
+    sheet(
+      '访问 Token',
+      `<p class="sheet-description">演示占位,不读取或展示任何真实凭据。</p><div class="sheet-item"><strong>${state.tokenVisible ? 'DEMO-NOT-A-REAL-TOKEN' : '•••• •••• •••• ••••'}</strong></div><div class="button-row"><button class="secondary-button" data-action="toggle-token">${state.tokenVisible ? '隐藏' : '显示'}占位 Token</button><button class="secondary-button" data-action="copy-token" ${state.tokenVisible ? '' : 'disabled'}>复制占位内容</button></div>`,
+    ),
+  'toggle-token': () => {
+    state.tokenVisible = !state.tokenVisible;
+    actions.token();
+  },
+  'copy-token': () => copyText('DEMO-NOT-A-REAL-TOKEN'),
+  notifications: () =>
+    sheet(
+      '消息与任务通知',
+      `<p class="sheet-description">继续保留现有通知权限状态和系统设置入口。</p><div class="empty-state">${icon('bell')}<strong>原型不申请系统权限</strong><p>正式版本仍由现有通知服务检查权限,并引导到系统设置。</p></div>`,
+    ),
+  logout: () =>
+    confirmation('退出登录?', '此处仅演示二次确认,不会退出真实项目账号。', 'confirm-logout'),
+  'confirm-logout': () => {
+    closeOverlay();
+    navigate('home');
+    toast('退出交互演示完成;未操作真实账号');
+  },
+};
+document.addEventListener('click', (event) => {
+  const experience = event.target.closest('[data-experience]');
+  if (experience) {
+    const type = experience.dataset.experience;
+    closeOverlay();
+    if (state.page !== 'chat') {
+      saveDraft();
+      state.page = 'chat';
+      state.currentId = 'c1';
+      restoreDraft();
+      history.pushState(null, '', '#/chat/c1');
+      render();
+    }
+    if (type === 'activity') openActivity();
+    if (type === 'title') editCurrentTitle();
+    if (type === 'complete') completeDemo();
+    return;
+  }
+  const scene = event.target.closest('[data-scene]');
+  if (scene) {
+    navigate(scene.dataset.scene, scene.dataset.scene === 'chat' ? 'c1' : undefined);
+    return;
+  }
+  const button = event.target.closest('[data-action]');
+  if (button && !button.disabled) actions[button.dataset.action]?.(button);
+});
+document.addEventListener('input', (event) => {
+  const element = event.target;
+  if (element.id === 'draft') {
+    state.draft = element.value;
+    element.style.height = 'auto';
+    element.style.height = `${Math.min(element.scrollHeight, 116)}px`;
+    document.querySelector('.send-button').disabled =
+      state.generating || (!state.draft.trim() && !state.attachments.length);
+    return;
+  }
+  const kind = element.dataset.input;
+  if (!kind) return;
+  if (kind === 'activity-search') {
+    state.activityKeyword = element.value;
+    document.querySelector('#activity-results').innerHTML = activityResults();
+    return;
+  }
+  if (kind === 'drawer-search') {
+    document.querySelector('#drawer-results').innerHTML = drawerHistory(element.value);
+    return;
+  }
+  state.keyword = element.value;
+  if (kind === 'search')
+    document.querySelector('#conversation-results').innerHTML = conversationResults();
+  if (kind === 'contact-search')
+    document.querySelector('#contact-results').innerHTML = contactResults();
+  if (kind === 'agent-search') document.querySelector('#agent-results').innerHTML = agentResults();
+});
+document.addEventListener('keydown', (event) => {
+  if (event.key === 'Escape' && overlay.childElementCount) {
+    event.preventDefault();
+    closeOverlay();
+    return;
+  }
+  if (event.key === 'Tab' && overlay.childElementCount) {
+    const focusable = [
+        ...overlay.querySelectorAll('button:not(:disabled),input,select,a[href],summary'),
+      ].filter((element) => element.getClientRects().length),
+      first = focusable[0],
+      last = focusable.at(-1);
+    if (event.shiftKey && document.activeElement === first) {
+      event.preventDefault();
+      last?.focus();
+    } else if (!event.shiftKey && document.activeElement === last) {
+      event.preventDefault();
+      first?.focus();
+    }
+  }
+});
+let sheetDrag = null;
+overlay.addEventListener('pointerdown', (event) => {
+  const handle = event.target.closest('.sheet-handle');
+  if (!handle) return;
+  sheetDrag = { start: event.clientY, distance: 0, element: handle.closest('.sheet'), handle };
+  handle.setPointerCapture(event.pointerId);
+  sheetDrag.element.style.transition = 'none';
+  sheetDrag.element.style.animation = 'none';
+});
+overlay.addEventListener('pointermove', (event) => {
+  if (!sheetDrag) return;
+  sheetDrag.distance = Math.max(0, event.clientY - sheetDrag.start);
+  sheetDrag.element.style.transform = `translateY(${sheetDrag.distance}px)`;
+});
+overlay.addEventListener('pointerup', () => {
+  if (!sheetDrag) return;
+  if (sheetDrag.distance > 85) closeOverlay();
+  else {
+    sheetDrag.element.style.transition = 'transform .2s ease';
+    sheetDrag.element.style.transform = '';
+  }
+  sheetDrag = null;
+});
+overlay.addEventListener('pointercancel', () => {
+  if (sheetDrag) sheetDrag.element.style.transform = '';
+  sheetDrag = null;
+});
+document.addEventListener('submit', (event) => {
+  const form = event.target.closest('[data-form]');
+  if (!form) return;
+  event.preventDefault();
+  const value = new FormData(form).get('value').trim(),
+    kind = form.dataset.form,
+    identifier = form.dataset.id,
+    error = form.querySelector('.form-error');
+  if (!value) {
+    error.textContent = '名称不能为空';
+    return;
+  }
+  if (kind.includes('workspace')) {
+    if (value.length > 24) {
+      error.textContent = '工作区名称最多 24 字';
+      return;
+    }
+    if (workspaces.some((workspace) => workspace.name === value && workspace.id !== identifier)) {
+      error.textContent = '已有同名工作区,请换一个名称';
+      return;
+    }
+  }
+  if (kind === 'create-workspace') workspaces.push({ id: `w${Date.now()}`, name: value });
+  if (kind === 'rename-workspace')
+    workspaces.find((workspace) => workspace.id === identifier).name = value;
+  if (kind === 'rename-conversation') {
+    getConversation(identifier).title = value;
+    getConversation(identifier).manuallyNamed = true;
+  }
+  if (kind === 'rename-agent') getAgent(identifier).name = value;
+  closeOverlay();
+  render();
+  toast('已保存,仅影响本地演示数据');
+});
+document.querySelector('#file-input').addEventListener('change', (event) => {
+  state.attachments.push(...Array.from(event.target.files));
+  event.target.value = '';
+  renderComposer();
+  toast('附件仅暂存在本页,不会读取或上传');
+});
+window.addEventListener('hashchange', readRoute);
+function syncVisualViewport() {
+  if (window.innerWidth <= 520 && window.visualViewport?.scale === 1) {
+    document
+      .querySelector('#device')
+      .style.setProperty('--visual-height', `${window.visualViewport.height}px`);
+  } else document.querySelector('#device').style.removeProperty('--visual-height');
+}
+window.visualViewport?.addEventListener('resize', syncVisualViewport);
+window.addEventListener('resize', syncVisualViewport);
+syncVisualViewport();
+document
+  .querySelectorAll('[data-icon]')
+  .forEach((element) => (element.innerHTML = icon(element.dataset.icon)));
+readRoute();
+
+</script>
+  </body>
+</html>

BIN
prototypes/mobile-refresh-20261116/preview-chat.png


BIN
prototypes/mobile-refresh-20261116/preview-completion.png


BIN
prototypes/mobile-refresh-20261116/preview-desktop.png


BIN
prototypes/mobile-refresh-20261116/preview-drawer.png


BIN
prototypes/mobile-refresh-20261116/preview-home.png


BIN
prototypes/mobile-refresh-20261116/preview-switcher.png


BIN
prototypes/mobile-refresh-20261116/preview-title.png


BIN
prototypes/mobile-refresh-20261116/preview-workbench.png


+ 38 - 0
prototypes/mobile-refresh-20261116/preview.mjs

@@ -0,0 +1,38 @@
+import { createServer } from 'node:http';
+import { readFile, stat } from 'node:fs/promises';
+import path from 'node:path';
+import { fileURLToPath } from 'node:url';
+
+const root = path.dirname(fileURLToPath(import.meta.url));
+const port = Number(process.env.PORT || 4176);
+const mimeTypes = {
+  '.html': 'text/html; charset=utf-8',
+  '.css': 'text/css; charset=utf-8',
+  '.js': 'text/javascript; charset=utf-8',
+  '.mjs': 'text/javascript; charset=utf-8',
+  '.png': 'image/png',
+  '.md': 'text/plain; charset=utf-8',
+};
+
+createServer(async (request, response) => {
+  try {
+    const pathname = decodeURIComponent(new URL(request.url, 'http://localhost').pathname);
+    const filename = path.resolve(root, `.${pathname === '/' ? '/index.html' : pathname}`);
+    if (!filename.startsWith(root + path.sep)) {
+      response.writeHead(403).end('Forbidden');
+      return;
+    }
+    if (!(await stat(filename)).isFile()) throw new Error('Not a file');
+    const content = await readFile(filename);
+    response.writeHead(200, {
+      'Content-Type': mimeTypes[path.extname(filename)] || 'application/octet-stream',
+      'Cache-Control': 'no-store',
+      'X-Content-Type-Options': 'nosniff',
+    });
+    response.end(content);
+  } catch {
+    response.writeHead(404).end('Not found');
+  }
+}).listen(port, '127.0.0.1', () => {
+  console.log(`Prototype: http://127.0.0.1:${port}/#/chat/c1`);
+});

+ 2832 - 0
prototypes/mobile-refresh-20261116/styles.css

@@ -0,0 +1,2832 @@
+:root {
+  color-scheme: light;
+  --canvas: #fafbf8;
+  --surface: #fff;
+  --soft: #f0f2ed;
+  --ink: #252d28;
+  --muted: #899183;
+  --secondary: #697363;
+  --line: #e7ebe2;
+  --accent: #386b52;
+  --tint: #eaf1e8;
+  --danger: #ae514a;
+  --shade: #1a221c42;
+  font-family:
+    Inter,
+    'Noto Sans SC',
+    'PingFang SC',
+    'Microsoft YaHei',
+    -apple-system,
+    BlinkMacSystemFont,
+    'Segoe UI',
+    sans-serif;
+  -webkit-font-smoothing: antialiased;
+}
+* {
+  box-sizing: border-box;
+}
+body {
+  margin: 0;
+  background: #eef0eb;
+  color: var(--ink);
+}
+button,
+input,
+textarea,
+select {
+  font: inherit;
+  -webkit-tap-highlight-color: transparent;
+}
+button {
+  color: inherit;
+  cursor: pointer;
+  border: 0;
+  background: none;
+  touch-action: manipulation;
+}
+button:disabled {
+  cursor: default;
+  opacity: 0.4;
+}
+button:focus-visible,
+a:focus-visible,
+input:focus-visible,
+summary:focus-visible,
+textarea:focus-visible {
+  outline: 2px solid var(--accent);
+  outline-offset: 3px;
+}
+a {
+  color: inherit;
+  text-decoration: none;
+}
+svg {
+  width: 22px;
+  height: 22px;
+  stroke: currentColor;
+  stroke-width: 1.65;
+  fill: none;
+  stroke-linecap: round;
+  stroke-linejoin: round;
+  flex-shrink: 0;
+}
+button svg {
+  pointer-events: none;
+}
+h1,
+h2,
+h3,
+p {
+  margin: 0;
+}
+[hidden] {
+  display: none !important;
+}
+.presentation {
+  max-width: 1400px;
+  min-height: 100dvh;
+  margin: auto;
+  display: grid;
+  grid-template-columns: minmax(270px, 1fr) 424px minmax(200px, 0.74fr);
+  gap: 65px;
+  align-items: center;
+  padding: 35px 60px;
+}
+.intro {
+  align-self: stretch;
+  display: flex;
+  flex-direction: column;
+  padding: 16px 0 8px;
+}
+.studio-brand {
+  display: flex;
+  align-items: center;
+  gap: 9px;
+  font-size: 25px;
+  letter-spacing: -1px;
+  font-weight: 650;
+  flex-wrap: wrap;
+}
+.studio-brand svg {
+  width: 29px;
+  height: 29px;
+  color: var(--accent);
+}
+.edition {
+  width: 100%;
+  margin-top: 9px;
+  font-size: 9px;
+  color: #8c948a;
+  letter-spacing: 2px;
+  font-weight: 500;
+}
+.intro-copy {
+  margin-top: clamp(44px, 9vh, 100px);
+}
+.eyebrow {
+  font-size: 11px;
+  letter-spacing: 1.4px;
+  color: var(--muted);
+}
+.intro h1 {
+  font-size: clamp(31px, 3vw, 43px);
+  font-weight: 500;
+  letter-spacing: -1.9px;
+  line-height: 1.65;
+  margin: 15px 0 16px;
+}
+.intro-copy p {
+  font-size: 13px;
+  line-height: 2;
+  color: var(--secondary);
+}
+.proposal-tag {
+  display: inline-flex;
+  gap: 7px;
+  align-items: center;
+  border: 1px solid #d9dfd5;
+  border-radius: 20px;
+  padding: 7px 11px;
+  font-size: 10px;
+  color: var(--secondary);
+  margin-top: 23px;
+}
+.dot {
+  width: 6px;
+  height: 6px;
+  background: #64866b;
+  border-radius: 100%;
+  display: inline-block;
+  flex-shrink: 0;
+}
+.dot.offline {
+  background: #b1b6a9;
+}
+.scene-switch {
+  margin-top: 42px;
+  max-width: 285px;
+}
+.scene-switch > .eyebrow {
+  display: block;
+  margin-bottom: 12px;
+}
+.scene-switch button {
+  display: flex;
+  align-items: center;
+  gap: 15px;
+  border-bottom: 1px solid #dde2d8;
+  width: 100%;
+  padding: 15px 0;
+  font-size: 12px;
+  text-align: left;
+}
+.scene-switch button > span:first-child {
+  font-size: 10px;
+  color: #9ba397;
+  font-family: monospace;
+}
+.scene-switch button > span:last-child {
+  margin-left: auto;
+}
+.scene-switch svg {
+  width: 15px;
+  height: 15px;
+}
+.scene-switch button:hover,
+.scene-switch button.active {
+  color: var(--accent);
+}
+.intro-footer {
+  margin-top: auto;
+  padding-top: 40px;
+  font-size: 9px;
+  letter-spacing: 1.4px;
+  line-height: 2;
+  color: #677160;
+}
+.intro-footer span {
+  font-size: 10px;
+  letter-spacing: 0.3px;
+  color: #92998d;
+}
+.device-wrap {
+  width: 424px;
+}
+.device {
+  height: min(858px, calc(100dvh - 90px));
+  min-height: 660px;
+  width: 424px;
+  padding: 7px;
+  border-radius: 46px;
+  background: var(--canvas);
+  border: 1px solid #cdd2c8;
+  box-shadow:
+    0 30px 70px -30px #3f4b3c33,
+    0 0 0 5px #e5e8df,
+    0 0 0 6px #d9ded2;
+  position: relative;
+  overflow: hidden;
+  isolation: isolate;
+}
+.statusbar {
+  height: 40px;
+  padding: 6px 23px;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  font-size: 13px;
+  font-weight: 650;
+}
+.island {
+  position: absolute;
+  top: 15px;
+  left: 50%;
+  transform: translateX(-50%);
+  width: 99px;
+  height: 25px;
+  border-radius: 25px;
+  background: #242824;
+}
+.status-icons {
+  display: flex;
+  gap: 4px;
+  align-items: center;
+}
+.status-icons svg {
+  width: 15px;
+  height: 15px;
+  stroke-width: 1.9;
+}
+.status-icons > span:last-child svg {
+  width: 22px;
+}
+.home-indicator {
+  position: absolute;
+  bottom: 8px;
+  left: 50%;
+  transform: translateX(-50%);
+  height: 4px;
+  width: 118px;
+  background: var(--ink);
+  border-radius: 8px;
+  pointer-events: none;
+  z-index: 30;
+}
+.device-caption {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  gap: 8px;
+  margin-top: 18px;
+  font-size: 10px;
+  color: #8b9386;
+  letter-spacing: 0.5px;
+}
+.device-caption .dot {
+  width: 5px;
+  height: 5px;
+}
+.design-notes {
+  max-width: 235px;
+}
+.design-notes > .eyebrow {
+  font-size: 10px;
+  letter-spacing: 1px;
+}
+.note {
+  margin-top: 37px;
+  padding-top: 16px;
+  border-top: 1px solid #d9dfd3;
+}
+.note > span {
+  font-size: 9px;
+  letter-spacing: 1.5px;
+  color: #8b9682;
+}
+.note h2 {
+  font-size: 14px;
+  font-weight: 550;
+  margin: 12px 0 10px;
+  letter-spacing: -0.3px;
+}
+.note p {
+  font-size: 11px;
+  line-height: 2.1;
+  color: #86907d;
+}
+.scope-note {
+  display: flex;
+  gap: 8px;
+  margin-top: 39px;
+  font-size: 9px;
+  color: #91998a;
+  line-height: 2;
+}
+.scope-note svg {
+  width: 16px;
+  height: 16px;
+  margin-top: 2px;
+}
+.app {
+  height: calc(100% - 40px);
+  display: flex;
+  flex-direction: column;
+  overflow: hidden;
+  border-radius: 0 0 35px 35px;
+  font-size: 14px;
+}
+.app-header {
+  height: 64px;
+  min-height: 64px;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  gap: 10px;
+  padding: 4px 17px;
+  z-index: 2;
+  background: var(--canvas);
+}
+.icon-button {
+  min-width: 44px;
+  width: 44px;
+  height: 44px;
+  display: inline-flex;
+  align-items: center;
+  justify-content: center;
+  border-radius: 50%;
+  flex-shrink: 0;
+}
+.icon-button:hover {
+  background: var(--soft);
+}
+.header-center {
+  text-align: center;
+  min-width: 0;
+}
+.header-center strong {
+  font-size: 15px;
+  font-weight: 600;
+  letter-spacing: -0.4px;
+}
+.header-center small {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  gap: 5px;
+  color: var(--muted);
+  font-size: 10px;
+  margin-top: 5px;
+}
+.header-center .dot {
+  width: 5px;
+  height: 5px;
+}
+.header-brand {
+  display: flex;
+  align-items: center;
+  gap: 6px;
+}
+.header-brand svg {
+  width: 20px;
+  height: 20px;
+  color: var(--accent);
+}
+.header-brand strong {
+  font-size: 21px;
+  font-weight: 600;
+  letter-spacing: -0.9px;
+}
+.profile-button {
+  width: 34px;
+  height: 34px;
+  margin: 5px;
+  border-radius: 50%;
+  background: #e8ebdf;
+  color: #657151;
+  font-size: 12px;
+}
+.page-title {
+  flex: 1;
+  font-size: 20px;
+  letter-spacing: -0.5px;
+  font-weight: 600;
+}
+#main {
+  flex: 1;
+  min-height: 0;
+  overflow-y: auto;
+  overflow-x: hidden;
+  overscroll-behavior: contain;
+  scrollbar-width: none;
+  outline: none;
+}
+#main::-webkit-scrollbar {
+  display: none;
+}
+.screen {
+  padding: 6px 23px 24px;
+  animation: arrive 0.24s ease-out;
+}
+.home-screen {
+  min-height: 100%;
+  display: flex;
+  flex-direction: column;
+  padding-top: 31px;
+}
+.home-hero {
+  padding: 4px 1px 10px;
+}
+.hero-art {
+  display: grid;
+  place-items: center;
+  width: 65px;
+  height: 65px;
+  border-radius: 22px;
+  background: #eaf0e4;
+  color: var(--accent);
+  margin-bottom: 25px;
+  transform: rotate(-6deg);
+}
+.hero-art svg {
+  width: 42px;
+  height: 42px;
+  transform: rotate(6deg);
+}
+.home-hero .overline {
+  font-size: 11px;
+  color: var(--muted);
+  margin-bottom: 11px;
+  letter-spacing: 1px;
+}
+.home-hero h1 {
+  font-size: 31px;
+  letter-spacing: -1.4px;
+  line-height: 1.6;
+  font-weight: 500;
+}
+.home-hero p {
+  color: var(--muted);
+  font-size: 12px;
+  margin-top: 12px;
+  line-height: 1.9;
+}
+.prompts {
+  display: flex;
+  gap: 8px;
+  overflow-x: auto;
+  scrollbar-width: none;
+  padding: 19px 0 6px;
+  flex-shrink: 0;
+}
+.prompt {
+  white-space: nowrap;
+  font-size: 11px;
+  color: var(--secondary);
+  border: 1px solid var(--line);
+  padding: 10px 13px;
+  border-radius: 12px;
+  display: flex;
+  align-items: center;
+  gap: 6px;
+  background: var(--surface);
+}
+.prompt svg {
+  width: 14px;
+  height: 14px;
+}
+.recent-block {
+  margin-top: auto;
+  padding-top: 25px;
+}
+.section-label {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  color: var(--muted);
+  font-size: 10px;
+  letter-spacing: 0.6px;
+  margin: 0 0 10px;
+}
+.text-button {
+  min-height: 36px;
+  font-size: 11px;
+  display: inline-flex;
+  align-items: center;
+  gap: 4px;
+  color: var(--secondary);
+}
+.text-button svg {
+  width: 13px;
+  height: 13px;
+}
+.recent-row {
+  width: 100%;
+  display: flex;
+  align-items: center;
+  gap: 11px;
+  padding: 12px 0;
+  border-top: 1px solid var(--line);
+  text-align: left;
+}
+.recent-row > svg {
+  color: var(--muted);
+  width: 16px;
+  height: 16px;
+}
+.row-text {
+  flex: 1;
+  min-width: 0;
+}
+.recent-row strong {
+  font-size: 12px;
+  font-weight: 500;
+  white-space: nowrap;
+  text-overflow: ellipsis;
+  overflow: hidden;
+  display: block;
+}
+.recent-row small {
+  font-size: 10px;
+  color: var(--muted);
+  margin-top: 5px;
+  display: block;
+}
+.recent-row time {
+  font-size: 10px;
+  color: var(--muted);
+}
+#composer-area {
+  flex-shrink: 0;
+  padding: 6px 15px 18px;
+  background: var(--canvas);
+}
+#composer-area:empty {
+  display: none;
+}
+.composer {
+  border: 1px solid #dfe4d9;
+  background: var(--surface);
+  border-radius: 24px;
+  padding: 12px 12px 9px;
+  box-shadow: 0 3px 14px #26352005;
+  transition: border-color 0.2s;
+}
+.composer:focus-within {
+  border-color: #9bae98;
+}
+.composer textarea {
+  width: 100%;
+  min-height: 46px;
+  max-height: 116px;
+  resize: none;
+  display: block;
+  border: 0;
+  background: none;
+  outline: none !important;
+  color: var(--ink);
+  font-size: 16px;
+  line-height: 1.6;
+  padding: 3px 4px;
+}
+.composer textarea::placeholder {
+  color: var(--muted);
+  font-size: 14px;
+}
+.composer-tools {
+  display: flex;
+  align-items: center;
+  gap: 5px;
+}
+.composer-tools .icon-button {
+  width: 40px;
+  min-width: 40px;
+  height: 40px;
+  color: var(--secondary);
+}
+.agent-select {
+  display: flex;
+  gap: 6px;
+  align-items: center;
+  font-size: 10px;
+  padding: 0 5px;
+  height: 40px;
+  color: var(--secondary);
+  max-width: 205px;
+  white-space: nowrap;
+  overflow: hidden;
+}
+.agent-select svg {
+  width: 13px;
+  height: 13px;
+}
+.agent-select .dot {
+  width: 5px;
+  height: 5px;
+}
+.send-button {
+  width: 37px;
+  height: 37px;
+  min-height: 37px;
+  border-radius: 50%;
+  display: grid;
+  place-items: center;
+  background: var(--accent);
+  color: white;
+  margin-left: auto;
+}
+.send-button:disabled {
+  background: var(--soft);
+  color: #a0a89a;
+  opacity: 1;
+}
+.send-button svg {
+  width: 20px;
+  height: 20px;
+}
+.composer-footnote {
+  text-align: center;
+  color: var(--muted);
+  font-size: 9px;
+  margin-top: 10px;
+}
+.attachment-list {
+  display: flex;
+  gap: 6px;
+  flex-wrap: wrap;
+}
+.attachment-chip {
+  font-size: 10px;
+  border-radius: 8px;
+  background: var(--soft);
+  padding: 6px 8px;
+  display: flex;
+  align-items: center;
+  gap: 4px;
+  margin-bottom: 6px;
+  max-width: 100%;
+}
+.attachment-chip > span {
+  max-width: 230px;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}
+.attachment-chip button {
+  min-width: 32px;
+  min-height: 32px;
+  display: grid;
+  place-items: center;
+  margin: -5px;
+}
+.attachment-chip svg {
+  width: 12px;
+  height: 12px;
+}
+.tabbar {
+  display: flex;
+  padding: 8px 9px 22px;
+  gap: 3px;
+  border-top: 1px solid var(--line);
+  background: var(--canvas);
+  flex-shrink: 0;
+}
+.tabbar:empty {
+  display: none;
+}
+.tabbar button {
+  flex: 1;
+  min-height: 48px;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  flex-direction: column;
+  gap: 5px;
+  color: var(--muted);
+  font-size: 9px;
+}
+.tabbar button svg {
+  width: 21px;
+  height: 21px;
+}
+.tabbar button.active {
+  color: var(--accent);
+  font-weight: 600;
+}
+.tabbar button.active > span:first-child {
+  background: var(--tint);
+  border-radius: 12px;
+  padding: 2px 12px;
+  margin: -2px -12px;
+}
+.tabbar button > span:first-child {
+  height: 25px;
+  display: flex;
+  align-items: center;
+}
+.page-subtitle {
+  font-size: 11px;
+  color: var(--muted);
+  line-height: 1.8;
+  margin-bottom: 19px;
+}
+.search-field {
+  display: flex;
+  gap: 8px;
+  align-items: center;
+  border-radius: 13px;
+  background: var(--soft);
+  padding: 0 12px;
+  margin-bottom: 16px;
+  min-height: 44px;
+}
+.search-field svg {
+  width: 16px;
+  height: 16px;
+  color: var(--muted);
+}
+.search-field input {
+  width: 100%;
+  border: 0;
+  outline: none;
+  background: none;
+  font-size: 13px;
+  color: var(--ink);
+  min-height: 44px;
+}
+.search-field input::placeholder {
+  color: var(--muted);
+}
+.segmented {
+  display: flex;
+  gap: 5px;
+  border-bottom: 1px solid var(--line);
+  margin-bottom: 19px;
+}
+.segmented button {
+  position: relative;
+  min-height: 42px;
+  flex: 1;
+  font-size: 12px;
+  color: var(--muted);
+  white-space: nowrap;
+}
+.segmented button.active {
+  color: var(--ink);
+  font-weight: 600;
+}
+.segmented button.active:after {
+  position: absolute;
+  content: '';
+  width: 18px;
+  height: 2px;
+  background: var(--accent);
+  bottom: -1px;
+  left: calc(50% - 9px);
+  border-radius: 2px;
+}
+.group-heading {
+  color: var(--muted);
+  font-size: 10px;
+  margin: 24px 0 5px;
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+}
+.conversation-row {
+  display: flex;
+  align-items: center;
+  gap: 7px;
+  padding: 17px 0;
+  border-bottom: 1px solid var(--line);
+}
+.avatar {
+  width: 39px;
+  height: 39px;
+  flex-shrink: 0;
+  border-radius: 14px;
+  display: grid;
+  place-items: center;
+  background: var(--tint);
+  color: var(--accent);
+  font-size: 13px;
+}
+.avatar svg {
+  width: 22px;
+  height: 22px;
+}
+.avatar.clay {
+  background: #f1eae4;
+  color: #95745e;
+}
+.avatar.lilac {
+  background: #eeebf5;
+  color: #8b7eaa;
+}
+.avatar.person {
+  border-radius: 50%;
+}
+.conversation-open {
+  display: flex;
+  gap: 11px;
+  text-align: left;
+  flex: 1;
+  min-width: 0;
+  padding: 0;
+}
+.conversation-body {
+  flex: 1;
+  min-width: 0;
+}
+.conversation-top {
+  display: flex;
+  align-items: center;
+  gap: 5px;
+}
+.conversation-top strong {
+  font-size: 13px;
+  font-weight: 550;
+  overflow: hidden;
+  white-space: nowrap;
+  text-overflow: ellipsis;
+  flex: 1;
+}
+.conversation-top time {
+  font-size: 9px;
+  color: var(--muted);
+  flex-shrink: 0;
+}
+.conversation-body p {
+  font-size: 11px;
+  color: var(--muted);
+  line-height: 1.6;
+  overflow: hidden;
+  white-space: nowrap;
+  text-overflow: ellipsis;
+  margin: 6px 0;
+}
+.conversation-meta {
+  display: flex;
+  align-items: center;
+  gap: 5px;
+  font-size: 9px;
+  color: var(--secondary);
+}
+.conversation-meta .dot {
+  width: 4px;
+  height: 4px;
+}
+.unread {
+  border-radius: 6px;
+  background: var(--accent);
+  color: #fff;
+  min-width: 16px;
+  padding: 2px 4px;
+  font-size: 9px;
+  text-align: center;
+}
+.row-more {
+  width: 30px;
+  min-height: 44px;
+  padding: 0;
+  display: grid;
+  place-items: center;
+  color: var(--muted);
+  align-self: flex-start;
+  margin-top: -7px;
+}
+.row-more svg {
+  width: 17px;
+}
+.workspace {
+  border-bottom: 1px solid var(--line);
+}
+.workspace-head {
+  display: flex;
+  align-items: center;
+  gap: 8px;
+  padding: 12px 0;
+}
+.workspace-toggle {
+  min-height: 40px;
+  flex: 1;
+  display: flex;
+  align-items: center;
+  gap: 9px;
+  text-align: left;
+  font-size: 13px;
+}
+.workspace-toggle svg {
+  width: 17px;
+  color: var(--secondary);
+}
+.workspace-toggle small {
+  color: var(--muted);
+  font-size: 10px;
+  margin-left: auto;
+}
+.workspace > div {
+  padding-left: 12px;
+}
+.workspace .icon-button {
+  min-width: 35px;
+  width: 35px;
+  height: 40px;
+  color: var(--muted);
+}
+.workspace .icon-button svg {
+  width: 17px;
+}
+.empty-state {
+  padding: 55px 15px;
+  text-align: center;
+  color: var(--muted);
+}
+.empty-state > svg {
+  width: 32px;
+  height: 32px;
+  margin-bottom: 15px;
+}
+.empty-state strong {
+  display: block;
+  font-size: 14px;
+  color: var(--ink);
+  font-weight: 500;
+}
+.empty-state p {
+  font-size: 12px;
+  line-height: 1.8;
+  margin-top: 9px;
+}
+.empty-state button {
+  margin-top: 16px;
+}
+.primary-button {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  gap: 7px;
+  width: 100%;
+  min-height: 47px;
+  border-radius: 14px;
+  background: var(--accent);
+  color: #fff;
+  font-size: 13px;
+}
+.secondary-button {
+  min-height: 44px;
+  border: 1px solid var(--line);
+  background: var(--surface);
+  border-radius: 12px;
+  font-size: 12px;
+  padding: 0 16px;
+}
+.primary-button svg {
+  width: 17px;
+}
+.button-row {
+  display: flex;
+  gap: 9px;
+  margin-top: 20px;
+}
+.button-row > * {
+  flex: 1;
+}
+.danger {
+  color: var(--danger) !important;
+}
+.chat-screen {
+  padding: 12px 23px 15px;
+  font-size: var(--chat-font, 15px);
+  line-height: 1.9;
+}
+.chat-date {
+  text-align: center;
+  color: var(--muted);
+  font-size: 9px;
+  margin: 2px 0 25px;
+  letter-spacing: 1px;
+}
+.user-message {
+  display: flex;
+  justify-content: flex-end;
+  margin: 20px 0 28px;
+}
+.user-bubble {
+  background: #edf0e7;
+  max-width: 88%;
+  padding: 12px 16px;
+  border-radius: 19px 19px 5px 19px;
+  line-height: 1.85;
+  font-size: 13px;
+  overflow-wrap: anywhere;
+}
+.user-file {
+  display: block;
+  font-size: 10px;
+  color: var(--secondary);
+  padding-top: 5px;
+}
+.assistant-heading {
+  display: flex;
+  gap: 8px;
+  align-items: center;
+  margin-bottom: 16px;
+  font-size: 11px;
+  color: var(--secondary);
+}
+.assistant-heading > svg {
+  width: 21px;
+  height: 21px;
+  color: var(--accent);
+}
+.assistant-heading time {
+  margin-left: auto;
+  font-size: 9px;
+  color: var(--muted);
+}
+.process {
+  margin-bottom: 18px;
+  border: 1px solid var(--line);
+  border-radius: 13px;
+  padding: 0 12px;
+  background: var(--surface);
+}
+.process summary {
+  cursor: pointer;
+  list-style: none;
+  display: flex;
+  gap: 7px;
+  align-items: center;
+  min-height: 42px;
+  font-size: 10px;
+  color: var(--secondary);
+}
+.process summary::-webkit-details-marker {
+  display: none;
+}
+.process summary svg {
+  width: 14px;
+  height: 14px;
+  color: var(--accent);
+}
+.process summary .chevron {
+  margin-left: auto;
+  transition: transform 0.2s;
+}
+.process[open] summary .chevron {
+  transform: rotate(180deg);
+}
+.process ol {
+  padding: 0 0 10px 21px;
+  margin: 0;
+  color: var(--muted);
+  font-size: 10px;
+  line-height: 2.4;
+}
+.assistant-body {
+  overflow-wrap: anywhere;
+}
+.assistant-body h2 {
+  font-size: 18px;
+  font-weight: 600;
+  letter-spacing: -0.5px;
+  line-height: 1.6;
+  margin: 21px 0 12px;
+}
+.assistant-body p {
+  margin: 0 0 14px;
+}
+.assistant-body ul {
+  padding-left: 19px;
+  margin: 0 0 17px;
+}
+.assistant-body li {
+  margin-bottom: 8px;
+}
+.assistant-body strong {
+  font-weight: 600;
+}
+.assistant-body blockquote {
+  margin: 18px 0;
+  padding: 3px 0 3px 13px;
+  border-left: 2px solid #9bb192;
+  color: var(--secondary);
+  font-size: 13px;
+}
+.file-card {
+  display: flex;
+  align-items: center;
+  gap: 11px;
+  width: 100%;
+  text-align: left;
+  padding: 14px;
+  border: 1px solid var(--line);
+  border-radius: 15px;
+  margin: 18px 0;
+  background: var(--surface);
+}
+.file-badge {
+  height: 39px;
+  width: 33px;
+  border: 1px solid #dce5d7;
+  border-radius: 6px;
+  background: var(--tint);
+  color: var(--accent);
+  font-size: 9px;
+  display: grid;
+  place-items: center;
+  font-weight: 600;
+  flex-shrink: 0;
+}
+.file-card strong {
+  display: block;
+  font-size: 12px;
+  font-weight: 500;
+}
+.file-card small {
+  font-size: 9px;
+  color: var(--muted);
+  display: block;
+  margin-top: 5px;
+}
+.file-card > svg {
+  width: 17px;
+  color: var(--muted);
+  margin-left: auto;
+}
+.message-actions {
+  display: flex;
+  gap: 7px;
+  align-items: center;
+  margin: 13px 0 24px;
+  color: var(--muted);
+}
+.message-actions button {
+  width: 37px;
+  height: 37px;
+  display: grid;
+  place-items: center;
+}
+.message-actions svg {
+  width: 16px;
+  height: 16px;
+}
+.message-actions small {
+  font-size: 9px;
+  margin-left: auto;
+}
+.typing {
+  display: flex;
+  align-items: center;
+  gap: 4px;
+  color: var(--muted);
+  font-size: 11px;
+  padding: 10px 0;
+}
+.typing i {
+  width: 4px;
+  height: 4px;
+  background: var(--accent);
+  border-radius: 50%;
+  animation: pulse 1s infinite;
+}
+.typing i:nth-child(2) {
+  animation-delay: 0.15s;
+}
+.typing i:nth-child(3) {
+  animation-delay: 0.3s;
+}
+.connection-banner {
+  display: flex;
+  gap: 7px;
+  align-items: center;
+  background: #f4ede1;
+  color: #906f3e;
+  border-radius: 10px;
+  padding: 10px;
+  font-size: 11px;
+  margin-bottom: 12px;
+  width: 100%;
+}
+.connection-banner svg {
+  width: 16px;
+}
+.overview {
+  display: grid;
+  grid-template-columns: repeat(3, 1fr);
+  background: var(--tint);
+  border-radius: 18px;
+  padding: 19px 13px;
+  margin: 3px 0 23px;
+}
+.overview > div {
+  padding-left: 10px;
+  border-right: 1px solid #d8e2d3;
+}
+.overview > div:last-child {
+  border: 0;
+}
+.overview strong {
+  display: block;
+  font-size: 23px;
+  letter-spacing: -1px;
+  font-weight: 500;
+  margin-bottom: 5px;
+}
+.overview small {
+  font-size: 10px;
+  color: var(--secondary);
+}
+.agent-card {
+  padding: 18px;
+  border: 1px solid var(--line);
+  border-radius: 18px;
+  background: var(--surface);
+  margin: 13px 0;
+}
+.agent-card-head {
+  display: flex;
+  align-items: center;
+  gap: 10px;
+}
+.agent-card-head h2 {
+  font-size: 14px;
+  font-weight: 550;
+}
+.agent-card-head small {
+  display: flex;
+  align-items: center;
+  gap: 5px;
+  margin-top: 6px;
+  font-size: 10px;
+  color: var(--muted);
+}
+.agent-card-head > .tag {
+  margin-left: auto;
+}
+.tag {
+  display: inline-flex;
+  align-items: center;
+  gap: 5px;
+  border-radius: 6px;
+  background: var(--tint);
+  color: var(--accent);
+  font-size: 9px;
+  padding: 5px 7px;
+}
+.tag.offline {
+  background: var(--soft);
+  color: var(--muted);
+}
+.agent-current {
+  font-size: 11px;
+  color: var(--secondary);
+  line-height: 1.8;
+  margin: 16px 0;
+  padding: 11px;
+  border-radius: 10px;
+  background: var(--canvas);
+}
+.agent-metrics {
+  display: flex;
+  gap: 20px;
+  font-size: 9px;
+  color: var(--muted);
+  margin-bottom: 15px;
+}
+.agent-metrics b {
+  font-weight: 500;
+  color: var(--secondary);
+  margin-left: 3px;
+}
+.agent-actions {
+  display: flex;
+  border-top: 1px solid var(--line);
+  padding-top: 9px;
+  gap: 7px;
+}
+.agent-actions button {
+  font-size: 10px;
+  min-height: 38px;
+  flex: 1;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  gap: 5px;
+  color: var(--secondary);
+}
+.agent-actions button:last-child {
+  color: var(--accent);
+  background: var(--tint);
+  border-radius: 9px;
+}
+.agent-actions svg {
+  width: 14px;
+  height: 14px;
+}
+.contact-row {
+  display: flex;
+  align-items: center;
+  gap: 11px;
+  padding: 17px 0;
+  border-bottom: 1px solid var(--line);
+}
+.contact-row > button {
+  padding: 0;
+  flex: 1;
+  text-align: left;
+  display: flex;
+  gap: 11px;
+  align-items: center;
+  min-height: 44px;
+}
+.contact-row strong {
+  font-size: 13px;
+  font-weight: 500;
+}
+.contact-row small {
+  display: block;
+  font-size: 10px;
+  color: var(--muted);
+  margin-top: 6px;
+}
+.contact-row > svg {
+  width: 16px;
+  color: var(--muted);
+}
+.contact-department {
+  font-size: 10px;
+  color: var(--muted);
+  margin: 22px 0 2px;
+}
+.profile-card {
+  padding: 18px 0 25px;
+  display: flex;
+  gap: 13px;
+  align-items: center;
+}
+.profile-card .avatar {
+  width: 55px;
+  height: 55px;
+  font-size: 21px;
+  background: #e9ecdf;
+  color: #6c7856;
+  border-radius: 19px;
+}
+.profile-card h2 {
+  font-size: 19px;
+  font-weight: 500;
+}
+.profile-card p {
+  font-size: 10px;
+  color: var(--muted);
+  margin-top: 8px;
+}
+.settings-group {
+  margin: 10px 0 26px;
+}
+.settings-group h2 {
+  font-size: 10px;
+  color: var(--muted);
+  font-weight: 500;
+  margin-bottom: 11px;
+}
+.settings-row {
+  display: flex;
+  align-items: center;
+  gap: 10px;
+  min-height: 58px;
+  border-bottom: 1px solid var(--line);
+  width: 100%;
+  font-size: 12px;
+  text-align: left;
+}
+.settings-row > svg {
+  width: 18px;
+  color: var(--secondary);
+}
+.settings-row small {
+  margin-left: auto;
+  font-size: 10px;
+  color: var(--muted);
+}
+.settings-row > svg:last-child {
+  width: 14px;
+  margin-left: auto;
+  color: var(--muted);
+}
+.settings-row small + svg {
+  margin-left: 0 !important;
+}
+.toggle {
+  margin-left: auto;
+  width: 37px;
+  height: 23px;
+  border-radius: 20px;
+  background: #d9dfd2;
+  padding: 3px;
+}
+.toggle:before {
+  content: '';
+  display: block;
+  width: 17px;
+  height: 17px;
+  border-radius: 50%;
+  background: #fff;
+  box-shadow: 0 1px 3px #0001;
+  transition: transform 0.2s;
+}
+.toggle.on {
+  background: var(--accent);
+}
+.toggle.on:before {
+  transform: translateX(14px);
+}
+.palette-row {
+  display: flex;
+  gap: 10px;
+  padding: 10px 0;
+}
+.palette-option {
+  width: 44px;
+  height: 44px;
+  border-radius: 50%;
+  border: 1px solid var(--line);
+  display: grid;
+  place-items: center;
+}
+.palette-option > span {
+  width: 27px;
+  height: 27px;
+  border-radius: 50%;
+  background: var(--swatch);
+}
+.palette-option.active {
+  border-color: var(--accent);
+  box-shadow: 0 0 0 2px var(--tint);
+}
+.version-text {
+  text-align: center;
+  color: var(--muted);
+  font-size: 10px;
+  line-height: 1.9;
+  padding-top: 8px;
+}
+.font-options {
+  display: flex;
+  gap: 6px;
+  margin: 14px 0;
+}
+.font-options button {
+  min-height: 42px;
+  flex: 1;
+  border: 1px solid var(--line);
+  border-radius: 10px;
+  font-size: 11px;
+}
+.font-options button.active {
+  background: var(--tint);
+  border-color: var(--accent);
+  color: var(--accent);
+}
+#overlay-root {
+  position: absolute;
+  inset: 0;
+  z-index: 20;
+  pointer-events: none;
+}
+#overlay-root:not(:empty) {
+  pointer-events: auto;
+}
+.backdrop {
+  position: absolute;
+  inset: 0;
+  background: var(--shade);
+  animation: fade 0.2s;
+}
+.sheet {
+  position: absolute;
+  bottom: 0;
+  left: 0;
+  right: 0;
+  max-height: 88%;
+  display: flex;
+  flex-direction: column;
+  background: var(--canvas);
+  border-radius: 27px 27px 0 0;
+  padding: 0 23px 30px;
+  box-shadow: 0 -8px 30px #00000005;
+  animation: sheet-in 0.25s cubic-bezier(0.2, 0.7, 0.2, 1);
+}
+.sheet-handle {
+  width: 34px;
+  height: 4px;
+  border-radius: 3px;
+  background: var(--line);
+  align-self: center;
+  margin: 10px 0 3px;
+  flex-shrink: 0;
+  min-height: 4px;
+}
+.sheet-header {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  gap: 10px;
+  min-height: 61px;
+  flex-shrink: 0;
+}
+.sheet-header h2 {
+  font-size: 17px;
+  font-weight: 550;
+}
+.sheet-header .icon-button {
+  margin-right: -10px;
+}
+.sheet-body {
+  overflow: auto;
+  min-height: 0;
+  scrollbar-width: none;
+  overscroll-behavior: contain;
+}
+.sheet-description {
+  font-size: 11px;
+  line-height: 1.9;
+  color: var(--muted);
+  margin: 0 0 17px;
+}
+.sheet-list-button {
+  display: flex;
+  align-items: center;
+  gap: 12px;
+  min-height: 59px;
+  width: 100%;
+  border-bottom: 1px solid var(--line);
+  text-align: left;
+  font-size: 13px;
+}
+.sheet-list-button > svg {
+  width: 19px;
+  color: var(--secondary);
+}
+.sheet-list-button .selected-check {
+  color: var(--accent);
+  margin-left: auto;
+}
+.sheet-list-button small {
+  display: block;
+  color: var(--muted);
+  font-size: 10px;
+  margin-top: 5px;
+}
+.sheet-list-button .avatar {
+  width: 37px;
+  height: 37px;
+  border-radius: 12px;
+}
+.sheet-list-button > span:nth-child(2) {
+  flex: 1;
+}
+.sheet .segmented {
+  flex-shrink: 0;
+}
+.sheet-item {
+  padding: 15px 0;
+  border-bottom: 1px solid var(--line);
+  font-size: 12px;
+}
+.sheet-item strong {
+  font-size: 12px;
+  font-weight: 500;
+}
+.sheet-item p {
+  font-size: 11px;
+  color: var(--muted);
+  line-height: 1.8;
+  margin-top: 8px;
+}
+.sheet-item .tag {
+  float: right;
+}
+.sheet-form label {
+  display: block;
+  font-size: 11px;
+  color: var(--secondary);
+  margin-bottom: 8px;
+}
+.sheet-form input,
+.sheet-form select {
+  width: 100%;
+  border: 1px solid var(--line);
+  background: var(--surface);
+  color: var(--ink);
+  border-radius: 11px;
+  min-height: 47px;
+  padding: 0 12px;
+  font-size: 14px;
+}
+.sheet-form .primary-button {
+  margin-top: 17px;
+}
+.form-error {
+  color: var(--danger);
+  font-size: 11px;
+  line-height: 1.7;
+  min-height: 22px;
+  padding-top: 5px;
+}
+.drawer {
+  position: absolute;
+  left: 0;
+  top: 0;
+  bottom: 0;
+  width: 88%;
+  max-width: 355px;
+  background: var(--canvas);
+  border-radius: 0 22px 22px 0;
+  display: flex;
+  flex-direction: column;
+  padding: 40px 20px 24px;
+  animation: drawer-in 0.25s cubic-bezier(0.2, 0.7, 0.2, 1);
+}
+.drawer-header {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  min-height: 44px;
+}
+.drawer > .primary-button {
+  margin: 19px 0 15px;
+  flex-shrink: 0;
+}
+.drawer > .search-field {
+  margin-bottom: 5px;
+  flex-shrink: 0;
+}
+.drawer-scroll {
+  flex: 1;
+  overflow: auto;
+  scrollbar-width: none;
+  margin: 5px -2px;
+  padding: 0 2px;
+}
+.drawer .group-heading {
+  padding: 0 4px;
+  margin-top: 13px;
+  min-height: 35px;
+}
+.drawer-history {
+  width: 100%;
+  display: flex;
+  gap: 7px;
+  align-items: center;
+  text-align: left;
+  min-height: 44px;
+  padding: 0 9px;
+  font-size: 11px;
+  border-radius: 9px;
+}
+.drawer-history.active {
+  background: var(--tint);
+  color: var(--accent);
+}
+.drawer-history svg {
+  width: 14px;
+  color: var(--muted);
+}
+.drawer-history span {
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}
+.drawer-nav {
+  display: grid;
+  grid-template-columns: repeat(4, 1fr);
+  border-top: 1px solid var(--line);
+  padding-top: 13px;
+  flex-shrink: 0;
+}
+.drawer-nav button {
+  min-height: 49px;
+  display: flex;
+  flex-direction: column;
+  gap: 6px;
+  align-items: center;
+  justify-content: center;
+  font-size: 9px;
+  color: var(--secondary);
+}
+.drawer-nav svg {
+  width: 20px;
+  height: 20px;
+}
+.drawer-bottom {
+  font-size: 9px;
+  color: var(--muted);
+  text-align: center;
+  margin-top: 15px;
+}
+.preview-document {
+  padding: 22px;
+  background: var(--surface);
+  border: 1px solid var(--line);
+  border-radius: 6px;
+  font-size: 11px;
+  line-height: 2;
+  margin: 5px 0 17px;
+  min-height: 280px;
+}
+.preview-document h1 {
+  font-size: 21px;
+  margin: 15px 0;
+}
+.preview-document h2 {
+  font-size: 14px;
+  margin: 18px 0 8px;
+}
+.preview-document p {
+  color: var(--secondary);
+  margin-bottom: 12px;
+}
+.preview-document table {
+  border-collapse: collapse;
+  width: 100%;
+  font-size: 10px;
+  margin: 18px 0;
+}
+.preview-document td,
+.preview-document th {
+  padding: 8px 4px;
+  text-align: left;
+  border-bottom: 1px solid var(--line);
+}
+.preview-document th {
+  background: var(--soft);
+}
+.toast {
+  position: absolute;
+  left: 50%;
+  bottom: 130px;
+  transform: translate(-50%, 8px);
+  background: #28392eeb;
+  color: #fff;
+  padding: 12px 17px;
+  border-radius: 13px;
+  z-index: 40;
+  font-size: 11px;
+  line-height: 1.7;
+  max-width: 85%;
+  width: max-content;
+  opacity: 0;
+  pointer-events: none;
+  transition:
+    opacity 0.2s,
+    transform 0.2s;
+  text-align: center;
+}
+.toast.visible {
+  opacity: 1;
+  transform: translate(-50%, 0);
+}
+.state-chips {
+  display: flex;
+  flex-wrap: wrap;
+  gap: 7px;
+  padding: 8px 0 18px;
+}
+.state-chips button {
+  border: 1px solid var(--line);
+  border-radius: 9px;
+  padding: 10px;
+  font-size: 11px;
+}
+.state-chips button.active {
+  background: var(--tint);
+  color: var(--accent);
+  border-color: var(--accent);
+}
+.device.dark {
+  color-scheme: dark;
+  --canvas: #1e2520;
+  --surface: #252e27;
+  --soft: #2b342d;
+  --ink: #e1e7dc;
+  --muted: #8f9c8b;
+  --secondary: #aeb9a7;
+  --line: #354035;
+  --accent: #a4c59a;
+  --tint: #303f30;
+  --shade: #080f0bbb;
+}
+.dark .send-button,
+.dark .primary-button,
+.dark .unread {
+  color: #1e2520;
+}
+.dark .user-bubble {
+  background: #303c2e;
+}
+.dark .hero-art {
+  background: #303c2c;
+}
+.dark .composer {
+  border-color: #43503e;
+}
+.dark .profile-button {
+  background: #35412f;
+  color: #b8c8aa;
+}
+.dark .overview > div {
+  border-color: #43513e;
+}
+.dark .file-badge {
+  border-color: #4c5e45;
+}
+.dark .avatar.clay {
+  background: #40362e;
+  color: #c6ab96;
+}
+.dark .avatar.lilac {
+  background: #36313e;
+  color: #b4a6cc;
+}
+.dark .connection-banner {
+  background: #403729;
+  color: #d8bb87;
+}
+.dark .profile-card .avatar {
+  background: #38432e;
+  color: #bbcca3;
+}
+@keyframes arrive {
+  from {
+    opacity: 0;
+    transform: translateY(5px);
+  }
+  to {
+    opacity: 1;
+    transform: translateY(0);
+  }
+}
+@keyframes fade {
+  from {
+    opacity: 0;
+  }
+  to {
+    opacity: 1;
+  }
+}
+@keyframes sheet-in {
+  from {
+    transform: translateY(50px);
+    opacity: 0.3;
+  }
+  to {
+    transform: translateY(0);
+    opacity: 1;
+  }
+}
+@keyframes drawer-in {
+  from {
+    transform: translateX(-35px);
+    opacity: 0.4;
+  }
+  to {
+    transform: translateX(0);
+    opacity: 1;
+  }
+}
+@keyframes pulse {
+  0%,
+  80%,
+  100% {
+    opacity: 0.25;
+    transform: translateY(0);
+  }
+  40% {
+    opacity: 1;
+    transform: translateY(-3px);
+  }
+}
+@media (max-width: 1200px) {
+  .presentation {
+    grid-template-columns: 1fr 424px;
+    max-width: 1000px;
+    gap: 65px;
+    padding: 35px 60px;
+  }
+  .design-notes {
+    display: none;
+  }
+}
+@media (max-width: 820px) {
+  .presentation {
+    display: flex;
+    justify-content: center;
+    padding: 30px 0;
+    min-height: 100dvh;
+  }
+  .intro {
+    display: none;
+  }
+  .device {
+    height: min(858px, calc(100dvh - 75px));
+  }
+}
+@media (max-width: 520px) {
+  body {
+    background: var(--canvas);
+  }
+  .presentation {
+    display: block;
+    padding: 0;
+    min-height: 0;
+  }
+  .device-wrap {
+    width: 100%;
+  }
+  .device {
+    width: 100%;
+    height: 100dvh;
+    min-height: 0;
+    padding: 0;
+    border: 0;
+    border-radius: 0;
+    box-shadow: none;
+  }
+  .statusbar,
+  .home-indicator,
+  .device-caption {
+    display: none;
+  }
+  .app {
+    height: 100%;
+    border-radius: 0;
+    padding-top: env(safe-area-inset-top);
+  }
+  .app-header {
+    height: 64px;
+    min-height: 64px;
+  }
+  #composer-area {
+    padding-bottom: max(13px, env(safe-area-inset-bottom));
+  }
+  .tabbar {
+    padding-bottom: max(9px, env(safe-area-inset-bottom));
+  }
+  .drawer {
+    padding-top: max(19px, env(safe-area-inset-top));
+    padding-bottom: max(20px, env(safe-area-inset-bottom));
+  }
+  .sheet {
+    padding-bottom: max(25px, env(safe-area-inset-bottom));
+  }
+  .home-screen {
+    padding-top: clamp(15px, 5vh, 42px);
+  }
+  .home-hero h1 {
+    font-size: 32px;
+  }
+  .toast {
+    bottom: 145px;
+  }
+}
+@media (max-width: 360px) {
+  .screen {
+    padding-left: 18px;
+    padding-right: 18px;
+  }
+  .home-hero h1 {
+    font-size: 29px;
+  }
+  .home-hero p {
+    font-size: 11px;
+  }
+  .home-screen {
+    padding-top: 15px;
+  }
+  .hero-art {
+    margin-bottom: 16px;
+    width: 55px;
+    height: 55px;
+  }
+  .home-hero .overline {
+    font-size: 10px;
+  }
+  .agent-select {
+    max-width: 180px;
+  }
+  .conversation-top strong {
+    font-size: 12px;
+  }
+}
+@media (max-height: 740px) {
+  .home-screen {
+    padding-top: 10px;
+  }
+  .hero-art {
+    margin-bottom: 12px;
+    width: 48px;
+    height: 48px;
+    border-radius: 16px;
+  }
+  .hero-art svg {
+    width: 32px;
+    height: 32px;
+  }
+  .home-hero h1 {
+    font-size: 27px;
+    line-height: 1.5;
+  }
+  .home-hero p {
+    margin-top: 7px;
+  }
+  .prompts {
+    padding-top: 12px;
+  }
+  .recent-block {
+    padding-top: 14px;
+  }
+  .recent-row {
+    padding: 9px 0;
+  }
+  .composer-footnote {
+    margin-top: 7px;
+  }
+  .home-hero .overline {
+    margin-bottom: 7px;
+  }
+  .home-screen {
+    padding-bottom: 12px;
+  }
+}
+@media (prefers-reduced-motion: reduce) {
+  *,
+  *:before,
+  *:after {
+    animation: none !important;
+    transition: none !important;
+    scroll-behavior: auto !important;
+  }
+}
+
+.home-hero p {
+  font-size: 13px;
+}
+.prompt {
+  min-height: 44px;
+  font-size: 12px;
+}
+.recent-row {
+  min-height: 65px;
+}
+.recent-row strong {
+  font-size: 14px;
+}
+.recent-row small {
+  font-size: 11px;
+}
+.recent-row time {
+  font-size: 11px;
+}
+.section-label {
+  font-size: 11px;
+}
+.text-button {
+  font-size: 12px;
+  min-height: 44px;
+}
+.conversation-top strong {
+  font-size: 14px;
+}
+.conversation-body p {
+  font-size: 12px;
+}
+.conversation-meta {
+  font-size: 10px;
+}
+.conversation-top time {
+  font-size: 10px;
+}
+.segmented button {
+  min-height: 44px;
+  font-size: 13px;
+}
+.contact-row strong {
+  font-size: 14px;
+}
+.contact-row small {
+  font-size: 12px;
+}
+.tabbar button {
+  font-size: 10px;
+}
+.page-subtitle {
+  font-size: 12px;
+}
+.agent-card-head small {
+  font-size: 11px;
+}
+.agent-current {
+  font-size: 12px;
+}
+.agent-metrics {
+  font-size: 10px;
+}
+.agent-actions button {
+  min-height: 44px;
+  font-size: 11px;
+}
+.sheet-description {
+  font-size: 12px;
+}
+.sheet-list-button {
+  min-height: 63px;
+}
+.sheet-list-button small {
+  font-size: 11px;
+}
+.process summary {
+  font-size: 11px;
+  min-height: 44px;
+}
+.process ol {
+  font-size: 12px;
+}
+.user-bubble {
+  font-size: 14px;
+}
+.assistant-heading {
+  font-size: 12px;
+}
+.settings-row {
+  font-size: 14px;
+}
+.settings-row small {
+  font-size: 11px;
+}
+.composer-tools .icon-button {
+  width: 44px;
+  min-width: 44px;
+  height: 44px;
+}
+.send-button {
+  width: 44px;
+  height: 44px;
+  min-height: 44px;
+}
+.agent-select {
+  height: 44px;
+  font-size: 11px;
+}
+.user-file svg {
+  width: 13px;
+  height: 13px;
+  vertical-align: middle;
+}
+.hero-art {
+  flex-shrink: 0;
+}
+
+.header-center {
+  flex: 1;
+}
+.header-title {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  gap: 7px;
+  min-height: 31px;
+  width: 100%;
+  padding: 0;
+}
+.header-title strong {
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+  font-size: 15px;
+}
+.header-title svg {
+  width: 12px;
+  height: 12px;
+  color: var(--muted);
+}
+.subtitle-separator {
+  color: var(--line);
+  margin: 0 3px;
+}
+.collaboration-rail {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  gap: 8px;
+  padding: 0 2px 8px;
+}
+.quick-current {
+  min-height: 44px;
+  display: flex;
+  align-items: center;
+  gap: 6px;
+  font-size: 11px;
+  color: var(--secondary);
+  padding: 0 7px;
+}
+.quick-current svg {
+  width: 15px;
+  height: 15px;
+}
+.quick-agent {
+  color: var(--muted);
+}
+.activity-entry {
+  min-height: 36px;
+  display: flex;
+  align-items: center;
+  gap: 7px;
+  font-size: 11px;
+  color: var(--accent);
+  padding: 0 11px;
+  border: 1px solid var(--line);
+  border-radius: 30px;
+  background: var(--surface);
+  position: relative;
+}
+.activity-entry:after {
+  content: '';
+  position: absolute;
+  inset: -4px 0;
+}
+.activity-entry svg {
+  width: 13px;
+  height: 13px;
+}
+.activity-orbit {
+  width: 7px;
+  height: 7px;
+  border: 1px solid var(--muted);
+  border-radius: 50%;
+}
+.activity-orbit.running {
+  border-color: var(--accent);
+  background: var(--accent);
+  box-shadow: 0 0 0 3px var(--tint);
+  animation: breathe 2.6s ease-in-out infinite;
+}
+.attention-count {
+  min-width: 17px;
+  height: 17px;
+  border-radius: 6px;
+  color: #a56434;
+  background: #f7eddf;
+  display: grid;
+  place-items: center;
+  font-size: 9px;
+  margin-left: 1px;
+}
+.activity-text {
+  color: var(--muted);
+}
+.activity-text.running,
+.activity-text.done {
+  color: var(--accent);
+}
+.activity-text.attention {
+  color: #ac6941;
+}
+.inline-activity {
+  font-size: 10px;
+  display: inline-flex;
+  align-items: center;
+  gap: 5px;
+  white-space: nowrap;
+}
+.inline-activity:before {
+  content: '';
+  width: 4px;
+  height: 4px;
+  border-radius: 50%;
+  background: currentColor;
+}
+.conversation-meta .inline-activity {
+  margin-left: auto;
+}
+.inline-activity.running {
+  color: var(--accent);
+}
+.inline-activity.attention {
+  color: #a86a40;
+}
+.inline-activity.done {
+  color: #718468;
+}
+.inline-activity.idle {
+  color: var(--muted);
+}
+.activity-sheet {
+  height: 86%;
+}
+.activity-sheet .search-field {
+  position: sticky;
+  top: 0;
+  z-index: 2;
+  box-shadow: 0 -8px 0 8px var(--canvas);
+}
+.activity-sheet .segmented {
+  position: sticky;
+  top: 60px;
+  background: var(--canvas);
+  z-index: 2;
+  padding-top: 2px;
+}
+.activity-sheet .segmented button {
+  font-size: 11px;
+}
+.activity-group-label {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  font-size: 10px;
+  color: var(--muted);
+  padding: 12px 1px;
+}
+.activity-group-label .inline-activity {
+  font-size: 11px;
+}
+.activity-card {
+  display: flex;
+  align-items: flex-start;
+  gap: 10px;
+  min-height: 91px;
+  padding: 15px 11px;
+  margin-bottom: 8px;
+  border: 1px solid var(--line);
+  border-radius: 15px;
+  background: var(--surface);
+  width: 100%;
+  text-align: left;
+}
+.activity-card.current {
+  background: var(--tint);
+  border-color: transparent;
+}
+.activity-card.attention {
+  border-color: #e7d6c1;
+}
+.activity-card-avatar {
+  flex-shrink: 0;
+  position: relative;
+}
+.activity-card-avatar .avatar {
+  width: 33px;
+  height: 33px;
+  border-radius: 11px;
+}
+.activity-card-avatar .avatar svg {
+  width: 20px;
+  height: 20px;
+}
+.mini-state {
+  display: inline-flex;
+  width: 12px;
+  height: 12px;
+  border-radius: 50%;
+  align-items: center;
+  justify-content: center;
+  flex-shrink: 0;
+  font-size: 8px;
+}
+.mini-state.running {
+  background: var(--accent);
+  width: 6px;
+  height: 6px;
+}
+.mini-state.attention {
+  background: #ab7146;
+  color: white;
+  font-weight: 600;
+}
+.mini-state.done {
+  background: var(--accent);
+  color: var(--canvas);
+}
+.mini-state svg {
+  width: 9px;
+  height: 9px;
+  stroke-width: 2;
+}
+.activity-card-avatar .mini-state {
+  position: absolute;
+  right: -2px;
+  bottom: -2px;
+  outline: 3px solid var(--surface);
+}
+.activity-card-avatar .mini-state.running {
+  right: -1px;
+  bottom: 0;
+}
+.activity-card-content {
+  flex: 1;
+  min-width: 0;
+}
+.activity-card-content strong {
+  display: block;
+  font-size: 12px;
+  font-weight: 550;
+  line-height: 1.6;
+}
+.activity-card-content > small {
+  display: block;
+  font-size: 10px;
+  color: var(--muted);
+  margin-top: 6px;
+}
+.activity-detail {
+  display: block;
+  color: var(--secondary);
+  font-size: 10px;
+  line-height: 1.7;
+  margin-top: 9px;
+}
+.attention .activity-detail {
+  color: #a86a40;
+}
+.activity-card-end {
+  display: flex;
+  align-items: flex-end;
+  justify-content: space-between;
+  flex-direction: column;
+  align-self: stretch;
+  width: 55px;
+  flex-shrink: 0;
+}
+.activity-card-end svg {
+  width: 14px;
+  height: 14px;
+  color: var(--muted);
+  margin-top: 2px;
+}
+.activity-card-end small {
+  font-size: 8px;
+  color: var(--muted);
+  white-space: nowrap;
+}
+.activity-card-end em {
+  font-size: 9px;
+  color: var(--accent);
+  font-style: normal;
+}
+.activity-sheet-footer {
+  margin-top: 16px;
+  border-top: 1px solid var(--line);
+  padding-top: 13px;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  gap: 3px;
+}
+.activity-sheet-footer > span {
+  font-size: 9px;
+  color: var(--muted);
+  text-align: center;
+}
+.activity-sheet-footer button {
+  min-height: 44px;
+  font-size: 10px;
+  color: var(--secondary);
+}
+.drawer > .segmented {
+  flex-shrink: 0;
+  margin-top: 8px;
+  margin-bottom: 1px;
+}
+.drawer > .segmented button {
+  font-size: 11px;
+}
+.drawer-conversation {
+  display: block;
+  width: 100%;
+  text-align: left;
+  padding: 12px 9px;
+  border-radius: 11px;
+  min-height: 64px;
+}
+.drawer-conversation.active {
+  background: var(--tint);
+}
+.drawer-conversation-title {
+  display: flex;
+  align-items: center;
+  gap: 8px;
+  font-size: 12px;
+  line-height: 1.7;
+}
+.drawer-conversation-title > .mini-state {
+  margin-left: auto;
+}
+.drawer-conversation > small {
+  display: block;
+  font-size: 10px;
+  color: var(--muted);
+  margin-top: 5px;
+}
+.drawer-agent-group {
+  padding: 13px 0;
+  border-bottom: 1px solid var(--line);
+}
+.drawer-agent-head {
+  display: flex;
+  gap: 8px;
+  align-items: center;
+  padding-left: 5px;
+}
+.drawer-agent-head .avatar {
+  width: 30px;
+  height: 30px;
+  border-radius: 10px;
+}
+.drawer-agent-head .avatar svg {
+  width: 18px;
+  height: 18px;
+}
+.drawer-agent-head strong {
+  font-size: 12px;
+  font-weight: 550;
+  display: block;
+}
+.drawer-agent-head small {
+  display: block;
+  font-size: 9px;
+  margin-top: 4px;
+  color: var(--muted);
+}
+.drawer-agent-head > .inline-activity,
+.drawer-agent-head > small {
+  margin-left: auto;
+}
+.drawer-agent-new {
+  width: 35px;
+  min-height: 44px;
+  display: grid;
+  place-items: center;
+  padding: 0;
+}
+.drawer-agent-new svg {
+  width: 15px;
+  color: var(--secondary);
+}
+.drawer-archive {
+  min-height: 41px;
+  display: flex;
+  align-items: center;
+  gap: 8px;
+  width: 100%;
+  font-size: 10px;
+  color: var(--muted);
+  flex-shrink: 0;
+}
+.drawer-archive svg {
+  width: 14px;
+  height: 14px;
+}
+.drawer-archive svg:last-child {
+  margin-left: auto;
+}
+.drawer-nav {
+  padding-top: 8px;
+}
+.regenerate-title {
+  width: 100%;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  gap: 8px;
+  min-height: 47px;
+  font-size: 12px;
+  border: 1px solid var(--line);
+  border-radius: 13px;
+  margin-top: 11px;
+  color: var(--secondary);
+}
+.regenerate-title svg {
+  width: 15px;
+  height: 15px;
+}
+.regenerate-title span {
+  font-size: 9px;
+  color: var(--muted);
+}
+.title-protection {
+  display: flex;
+  align-items: flex-start;
+  gap: 6px;
+  font-size: 10px;
+  line-height: 1.9;
+  color: var(--muted);
+  margin: 16px 0 3px;
+}
+.title-protection svg {
+  width: 13px;
+  height: 13px;
+  margin-top: 3px;
+}
+.blank-chat {
+  height: 100%;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: center;
+  text-align: center;
+  padding-bottom: 75px;
+}
+.blank-chat-mark {
+  width: 66px;
+  height: 66px;
+  display: grid;
+  place-items: center;
+  background: var(--tint);
+  color: var(--accent);
+  border-radius: 24px;
+  margin-bottom: 23px;
+}
+.blank-chat-mark svg {
+  width: 38px;
+  height: 38px;
+}
+.blank-chat h1 {
+  font-size: 24px;
+  font-weight: 500;
+  letter-spacing: -0.8px;
+}
+.blank-chat p {
+  font-size: 12px;
+  color: var(--muted);
+  line-height: 2;
+  margin-top: 15px;
+}
+.completion-banner {
+  position: absolute;
+  top: 105px;
+  left: 19px;
+  right: 19px;
+  display: flex;
+  align-items: center;
+  gap: 10px;
+  background: var(--surface);
+  padding: 14px 10px 14px 14px;
+  z-index: 25;
+  box-shadow: 0 10px 35px #233a2620;
+  border: 1px solid var(--line);
+  border-radius: 17px;
+  animation: arrive 0.25s ease;
+}
+.completion-mark {
+  background: var(--tint);
+  color: var(--accent);
+  width: 31px;
+  height: 31px;
+  display: grid;
+  place-items: center;
+  border-radius: 50%;
+  flex-shrink: 0;
+}
+.completion-mark svg {
+  width: 17px;
+}
+.completion-banner > button {
+  text-align: left;
+  padding: 0;
+  flex: 1;
+  min-width: 0;
+}
+.completion-banner > button strong {
+  font-size: 12px;
+  font-weight: 550;
+  display: block;
+}
+.completion-banner > button small {
+  display: block;
+  font-size: 10px;
+  line-height: 1.7;
+  color: var(--muted);
+  margin-top: 5px;
+}
+.completion-banner > button:last-child {
+  width: 35px;
+  flex: 0 0 35px;
+  min-height: 44px;
+  display: grid;
+  place-items: center;
+  color: var(--muted);
+}
+.completion-banner > button:last-child svg {
+  width: 15px;
+}
+.prototype-shortcuts {
+  margin-top: 20px;
+  display: flex;
+  flex-direction: column;
+}
+.prototype-shortcuts button {
+  display: flex;
+  align-items: center;
+  gap: 6px;
+  min-height: 35px;
+  padding: 0;
+  font-size: 10px;
+  color: #748268;
+  text-align: left;
+}
+.prototype-shortcuts svg {
+  width: 12px;
+  height: 12px;
+}
+.scope-note {
+  margin-top: 20px;
+}
+@keyframes breathe {
+  50% {
+    box-shadow: 0 0 0 5px var(--tint);
+  }
+}
+.sheet-handle {
+  width: 100%;
+  min-height: 25px;
+  height: 25px;
+  margin: 0;
+  background: none;
+  position: relative;
+  touch-action: none;
+  cursor: grab;
+}
+.sheet-handle:before {
+  content: '';
+  position: absolute;
+  left: calc(50% - 17px);
+  top: 10px;
+  width: 34px;
+  height: 4px;
+  background: var(--line);
+  border-radius: 4px;
+}
+.skeleton-list {
+  padding-top: 10px;
+}
+.skeleton-row {
+  display: flex;
+  align-items: center;
+  gap: 12px;
+  padding: 19px 0;
+  border-bottom: 1px solid var(--line);
+}
+.skeleton-row > span {
+  width: 39px;
+  height: 39px;
+  border-radius: 14px;
+  background: var(--soft);
+}
+.skeleton-row > div {
+  flex: 1;
+}
+.skeleton-row i {
+  display: block;
+  width: 78%;
+  height: 11px;
+  background: var(--soft);
+  border-radius: 5px;
+}
+.skeleton-row i:last-child {
+  width: 55%;
+  height: 8px;
+  margin-top: 12px;
+}
+@media (max-width: 520px) {
+  .device {
+    height: var(--visual-height, 100dvh);
+  }
+  .completion-banner {
+    top: calc(70px + env(safe-area-inset-top));
+  }
+}
+@media (max-width: 360px) {
+  .activity-card {
+    gap: 8px;
+    padding: 12px 9px;
+  }
+  .activity-card-content strong {
+    font-size: 11px;
+  }
+  .activity-card-end {
+    width: 44px;
+  }
+  .activity-card-end small {
+    font-size: 7px;
+  }
+  .quick-agent {
+    display: none;
+  }
+}
+@media (prefers-reduced-motion: reduce) {
+  .activity-orbit.running {
+    animation: none;
+  }
+}

+ 271 - 0
prototypes/mobile-refresh-20261116/verify.mjs

@@ -0,0 +1,271 @@
+import assert from 'node:assert/strict';
+import { chromium } from 'playwright';
+import { fileURLToPath, pathToFileURL } from 'node:url';
+import path from 'node:path';
+
+const root = path.dirname(fileURLToPath(import.meta.url));
+const base = pathToFileURL(path.join(root, 'index.html')).href;
+const browser = await chromium.launch({
+  channel: process.env.PLAYWRIGHT_CHANNEL || 'chrome',
+  headless: true,
+});
+const context = await browser.newContext({
+  viewport: { width: 390, height: 844 },
+  reducedMotion: 'reduce',
+  deviceScaleFactor: 1,
+});
+const page = await context.newPage();
+page.setDefaultTimeout(10000);
+const errors = [];
+const externalRequests = [];
+page.on('pageerror', (error) => errors.push(error.message));
+page.on('request', (request) => {
+  if (/^https?:/.test(request.url())) externalRequests.push(request.url());
+});
+let checks = 0;
+async function check(label, operation) {
+  await operation();
+  checks += 1;
+  console.log(`PASS ${checks}: ${label}`);
+}
+async function go(route) {
+  await page.goto(`${base}#/${route}`);
+  await page.evaluate(() => document.fonts.ready);
+}
+async function click(action, extra = '') {
+  const selector = `button[data-action="${action}"]${extra}`;
+  const overlayButton = page.locator('#overlay-root').locator(selector);
+  await (await overlayButton.count() ? overlayButton : page.locator(selector)).first().click();
+}
+async function screenshot(name) {
+  await page.screenshot({ path: path.join(root, name), style: '.toast { visibility: hidden !important; }' });
+}
+
+try {
+  await go('chat/c1');
+  await check('会话页隐藏主导航,保留正文与操作入口', async () => {
+    assert.equal(await page.locator('#tabbar button').count(), 0);
+    assert.equal(await page.locator('.activity-entry').count(), 1);
+    assert.equal(await page.locator('.assistant-body').count(), 1);
+    assert.equal(await page.locator('.process[open]').count(), 0);
+  });
+  await screenshot('preview-chat.png');
+  await check('回车只换行,中文组合输入不提交', async () => {
+    await page.locator('#draft').fill('第一行');
+    await page.locator('#draft').press('End');
+    await page.locator('#draft').press('Enter');
+    await page.locator('#draft').pressSequentially('第二行');
+    assert.equal(await page.locator('#draft').inputValue(), '第一行\n第二行');
+    assert.equal(await page.locator('.user-message').count(), 1);
+    await page
+      .locator('#draft')
+      .dispatchEvent('keydown', { key: 'Enter', isComposing: true, keyCode: 229 });
+    assert.equal(await page.locator('.user-message').count(), 1);
+  });
+  await check('跨会话切换与同分身多会话草稿隔离', async () => {
+    await click('activity');
+    assert.equal(await page.locator('.activity-card').count(), 4);
+    await screenshot('preview-switcher.png');
+    await click('activity-open', '[data-id="c3"]');
+    await page.waitForURL('**#/chat/c3');
+    assert.equal(await page.locator('#draft').inputValue(), '');
+    await page.locator('#draft').fill('这是另一条会话的草稿');
+    await click('activity');
+    await click('activity-open', '[data-id="c1"]');
+    await page.waitForURL('**#/chat/c1');
+    assert.equal(await page.locator('#draft').inputValue(), '第一行\n第二行');
+  });
+  await check('协作筛选与搜索不混淆在线状态', async () => {
+    await click('activity');
+    await click('activity-filter', '[data-value="attention"]');
+    assert.equal(await page.locator('.activity-card').count(), 1);
+    assert.match(await page.locator('.activity-card').innerText(), /连接中断/);
+    await page.getByRole('searchbox', { name: '搜索正在协作的事' }).fill('不存在的内容');
+    assert.equal(await page.locator('.activity-card').count(), 0);
+    await page.getByRole('searchbox', { name: '搜索正在协作的事' }).fill('');
+    await click('activity-filter', '[data-value="all"]');
+    await click('close');
+  });
+  await check('标题候选不会在取消时写回,手动保存同步到列表', async () => {
+    await click('edit-current-title');
+    await click('regenerate-title');
+    assert.equal(await page.locator('#form-value').inputValue(), '移动端第一印象与体验优化');
+    await click('close');
+    assert.equal(await page.locator('.header-title strong').innerText(), '把产品的第一印象做好');
+    await click('edit-current-title');
+    await page.locator('#form-value').fill('我的产品体验优化');
+    await screenshot('preview-title.png');
+    await page.locator('.sheet-form button[type="submit"]').click();
+    assert.equal(await page.locator('.header-title strong').innerText(), '我的产品体验优化');
+  });
+  await check('当前数字生命内新建,保留原会话和工作区', async () => {
+    await click('quick-current');
+    await page.waitForFunction(() => location.hash !== '#/chat/c1');
+    assert.match(await page.locator('.header-center small').innerText(), /小禾/);
+    assert.match(await page.locator('.blank-chat').innerText(), /产品与灵感/);
+    assert.equal(await page.locator('#draft').inputValue(), '');
+    await page.locator('#draft').fill('新会话独立草稿');
+    await click('drawer');
+    await click('open-chat', '[data-id="c1"]');
+    await page.waitForURL('**#/chat/c1');
+    assert.equal(await page.locator('#draft').inputValue(), '第一行\n第二行');
+  });
+  await check('附件仅本地暂存,发送和回复明确标记演示', async () => {
+    await page
+      .locator('#file-input')
+      .setInputFiles({ name: '体验调研.txt', mimeType: 'text/plain', buffer: Buffer.from('demo') });
+    assert.match(await page.locator('.attachment-list').innerText(), /体验调研/);
+    await page.locator('#draft').fill('<img src=x onerror="alert(1)">');
+    await click('send');
+    assert.equal(await page.locator('.send-button').isDisabled(), true);
+    await page.waitForFunction(
+      () =>
+        !document.querySelector('.send-button').disabled ||
+        document.querySelector('.send-button').getAttribute('aria-label') === '发送消息',
+    );
+    assert.equal(await page.locator('.user-bubble img').count(), 0);
+    assert.match(await page.locator('.assistant-body').last().innerText(), /本地模拟回复/);
+    assert.equal(await page.locator('#draft').inputValue(), '');
+    assert.equal(await page.locator('.attachment-chip').count(), 0);
+  });
+  await check('侧栏按数字生命分组,不引入全局任务入口', async () => {
+    await click('drawer');
+    await click('drawer-view', '[data-value="agents"]');
+    assert.equal(await page.locator('.drawer-agent-group').count(), 3);
+    assert.equal(await page.locator('.drawer-nav button').count(), 4);
+    await screenshot('preview-drawer.png');
+    await page.keyboard.press('Escape');
+    assert.equal(await page.locator('[role="dialog"]').count(), 0);
+  });
+  await check('弹层支持焦点约束、Escape 与下拉关闭', async () => {
+    await click('activity');
+    const buttons = page.locator('#overlay-root button');
+    await buttons.last().focus();
+    await page.keyboard.press('Tab');
+    assert.equal(await buttons.first().evaluate((element) => element === document.activeElement), true);
+    const handle = await page.locator('.sheet-handle').boundingBox();
+    await page.mouse.move(handle.x + handle.width / 2, handle.y + 12);
+    await page.mouse.down();
+    await page.mouse.move(handle.x + handle.width / 2, handle.y + 120, { steps: 6 });
+    await page.mouse.up();
+    assert.equal(await page.locator('[role="dialog"]').count(), 0);
+    assert.equal(await page.locator('#app').evaluate((element) => element.inert), false);
+  });
+  await check('文件/成果面板与真实格式区分,预览可返回', async () => {
+    await click('details');
+    await click('detail-tab', '[data-value="file"]');
+    await click('preview-file');
+    assert.equal(await page.locator('.preview-document').count(), 1);
+    assert.match(await page.locator('[data-action="download-demo"]').innerText(), /TXT/);
+    await click('details', '[data-tab="file"]');
+    await click('close');
+  });
+  await check('完成提醒可直接返回对应会话', async () => {
+    await click('activity');
+    await click('complete-demo');
+    assert.equal(await page.locator('#completion-banner').count(), 1);
+    await screenshot('preview-completion.png');
+    await click('completion-open');
+    await page.waitForURL('**#/chat/c4');
+    assert.match(await page.locator('.header-center small').innerText(), /已完成/);
+  });
+  await go('messages');
+  await check('工作区默认折叠、名称去重、删除不删会话', async () => {
+    await click('message-filter', '[data-value="workspace"]');
+    assert.equal(await page.locator('.workspace-toggle[aria-expanded="false"]').count(), 2);
+    await click('create-workspace');
+    await page.locator('#form-value').fill('产品与灵感');
+    await page.locator('.sheet-form button[type="submit"]').click();
+    assert.match(await page.locator('.form-error').innerText(), /同名/);
+    await page.locator('#form-value').fill('临时验证区');
+    await page.locator('.sheet-form button[type="submit"]').click();
+    assert.equal(await page.locator('.workspace').count(), 3);
+    await click('workspace-menu', '[data-id="w1"]');
+    await click('delete-workspace');
+    await click('confirm-delete-workspace');
+    assert.equal(await page.locator('.workspace').count(), 2);
+    await click('message-filter', '[data-value="all"]');
+    assert.match(await page.locator('#conversation-results').innerText(), /我的产品体验优化/);
+  });
+  await check('搜索保留输入焦点,主导航为四栏', async () => {
+    const search = page.getByRole('searchbox', { name: '搜索会话或数字生命' });
+    await search.fill('不存在');
+    assert.match(await page.locator('#conversation-results').innerText(), /没有找到/);
+    assert.equal(await search.evaluate((element) => element === document.activeElement), true);
+    assert.equal(await page.locator('#tabbar button').count(), 4);
+  });
+  await go('mine');
+  await check('深色、配色和字号只持久化原型偏好', async () => {
+    await click('theme');
+    assert.equal(await page.locator('#device.dark').count(), 1);
+    await click('palette', '[data-value="blue"]');
+    await click('font');
+    await click('choose-font', '[data-value="18"]');
+    await click('close');
+    assert.match(await page.locator('[data-action="font"]').innerText(), /大号/);
+    await page.reload();
+    assert.equal(await page.locator('#device.dark').count(), 1);
+    const stored = await page.evaluate(() =>
+      JSON.parse(localStorage.getItem('fmode_mobile_proposal_v1')),
+    );
+    assert.equal(stored.palette, 'blue');
+    assert.equal(stored.font, 18);
+  });
+  await check('骨架、空态、错误和重试可以完整体验', async () => {
+    await click('preview-states');
+    await click('list-state', '[data-value="loading"]');
+    assert.equal(await page.locator('.skeleton-row').count(), 5);
+    await page.waitForSelector('.conversation-row');
+    await page.goto(`${base}#/mine`);
+    await click('preview-states');
+    await click('list-state', '[data-value="error"]');
+    await click('retry-list');
+    assert.ok((await page.locator('.conversation-row').count()) > 0);
+  });
+  await page.evaluate(() => localStorage.removeItem('fmode_mobile_proposal_v1'));
+  await page.reload();
+  await check('320 到 1440 宽度无横向溢出,输入框始终在视窗内', async () => {
+    for (const [width, height] of [
+      [320, 568],
+      [360, 740],
+      [390, 844],
+      [430, 932],
+      [768, 1024],
+      [1440, 1000],
+    ]) {
+      await page.setViewportSize({ width, height });
+      for (const route of ['home', 'chat/c1', 'messages', 'contacts', 'workbench', 'mine']) {
+        await go(route);
+        const dimensions = await page.evaluate(() => ({
+          viewport: innerWidth,
+          width: document.documentElement.scrollWidth,
+          composer: document.querySelector('#composer-area').getBoundingClientRect().bottom,
+          height: innerHeight,
+        }));
+        assert.ok(
+          dimensions.width <= dimensions.viewport + 1,
+          `${width}px ${route}: horizontal overflow`,
+        );
+        assert.ok(
+          dimensions.composer <= dimensions.height + 1,
+          `${width}px ${route}: composer outside viewport`,
+        );
+      }
+    }
+  });
+  await page.setViewportSize({ width: 1440, height: 1000 });
+  await go('chat/c1');
+  await screenshot('preview-desktop.png');
+  await page.setViewportSize({ width: 390, height: 844 });
+  await go('home');
+  await screenshot('preview-home.png');
+  await go('workbench');
+  await screenshot('preview-workbench.png');
+  assert.deepEqual(errors, [], 'Browser runtime errors');
+  assert.deepEqual(externalRequests, [], 'Prototype must not make external requests');
+  console.log(
+    `PASS ${checks} groups; 36 responsive routes; no runtime errors or external requests.`,
+  );
+} finally {
+  await browser.close();
+}

+ 182 - 0
scripts/review-mobile-ui.mjs

@@ -0,0 +1,182 @@
+#!/usr/bin/env node
+/** 当前 Angular UI 的隔离审查;--verify 自动回归,默认打开可交互手机窗口。 */
+import { spawn } from 'node:child_process';
+import { createServer } from 'node:net';
+import { existsSync } from 'node:fs';
+import { mkdir, writeFile } from 'node:fs/promises';
+import { resolve, dirname } from 'node:path';
+import { fileURLToPath } from 'node:url';
+import { chromium } from 'playwright';
+
+const root = resolve(dirname(fileURLToPath(import.meta.url)), '..');
+const verify = process.argv.includes('--verify');
+const out = resolve(root, 'test-results/mobile-ui-20261120');
+const socket = createServer();
+await new Promise((ok, no) => { socket.once('error', no); socket.listen(0, '127.0.0.1', ok); });
+const port = socket.address().port;
+await new Promise((ok) => socket.close(ok));
+const base = 'http://127.0.0.1:' + port;
+const server = spawn(process.execPath, [resolve(root, 'node_modules/@angular/cli/bin/ng.js'),
+  'serve', '--configuration', 'mock', '--host', '127.0.0.1', '--port', String(port)],
+{ cwd: root, stdio: ['ignore', 'pipe', 'pipe'] });
+let serverLog = '';
+let serverClosed = false;
+server.on('exit', () => { serverClosed = true; });
+for (const stream of [server.stdout, server.stderr]) stream.on('data', (x) => { serverLog = (serverLog + x).slice(-16000); });
+let browser;
+const stop = () => { if (!serverClosed) server.kill(); };
+process.once('SIGINT', () => { stop(); process.exit(130); });
+process.once('SIGTERM', () => { stop(); process.exit(143); });
+
+try {
+  console.log('正在编译当前 Angular 移动端,使用隔离演示数据…');
+  const started = Date.now();
+  while (true) {
+    if (serverClosed) throw new Error(serverLog);
+    try { if ((await fetch(base)).ok) break; } catch { /* 等待开发服务 */ }
+    if (Date.now() - started > 120000) throw new Error('本地预览启动超时\n' + serverLog);
+    await new Promise((ok) => setTimeout(ok, 500));
+  }
+  const chrome = [
+    'C:/Program Files/Google/Chrome/Application/chrome.exe',
+    'C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe',
+  ].find(existsSync);
+  browser = await chromium.launch({ headless: verify, ...(chrome ? { executablePath: chrome } : {}) });
+  const context = await browser.newContext({ viewport: { width: 390, height: 844 },
+    deviceScaleFactor: 1, isMobile: true, hasTouch: true });
+  // 整个审查浏览器只允许访问本次新建的本地服务。
+  await context.route('**/*', (route) => new URL(route.request().url()).origin === base ? route.continue() : route.abort());
+  await context.addInitScript(() => {
+    if (sessionStorage.getItem('mobile-ui-review-seeded')) return;
+    sessionStorage.setItem('mobile-ui-review-seeded', '1');
+    localStorage.setItem('fmode_session_token', 'demo-fmode');
+    localStorage.setItem('fmode_me', JSON.stringify({ id: 'demo-user', name: '林悦', companyId: 'demo-company' }));
+    localStorage.setItem('fmode_ui_mode_override', 'mobile');
+    localStorage.setItem('fmode_palette', 'platinum');
+    localStorage.setItem('mock/chat-threads', JSON.stringify(Array.from({ length: 10 }, (_, i) => ({
+      objectId: 'ui-review-' + i, agentId: ['zhixia', 'qiyun', 'jianwei', 'xingzhou'][i % 4],
+      roomId: '!ui-review-' + i + ':example.invalid', threadRoot: '$ui-review-' + i,
+      title: ['整理秋季品牌策略提案与渠道执行清单', '预发布环境部署与验证', '第三季度业务数据分析', '客户反馈整理与待确认事项'][i % 4],
+      titleLocked: true, messageCount: 4, lastMessageAt: Date.now() - i * 2400000,
+      archived: false, lastPreview: '本地 UI 审查演示内容,方便检查摘要、长标题和状态。',
+    }))));
+  });
+  const page = await context.newPage();
+  const errors = [];
+  page.on('pageerror', (e) => errors.push(e.message));
+  const go = async (route) => {
+    await page.goto(base + '/mobile/' + route, { waitUntil: 'networkidle' });
+    await page.locator('app-m-app-bar .m-title-main').waitFor({ state: 'visible' });
+    await page.waitForTimeout(350);
+  };
+  if (!verify) {
+    await go('messages');
+    console.log('审查窗口已打开:' + base + '/mobile/messages');
+    console.log('这是当前源码的 Mock 页面,可修改本地演示内容;远程业务请求已阻断。');
+    console.log('聊天审查可在地址栏进入 ' + base + '/mobile/chat/zhixia/$ui-review-0');
+    console.log('关闭审查浏览器或按 Ctrl+C 结束,普通浏览器的登录和偏好不受影响。');
+    if (process.argv.includes('--smoke')) {
+      console.log('可交互审查窗口启动验证通过。');
+    } else {
+      await new Promise((ok) => browser.once('disconnected', ok));
+    }
+  } else {
+    await mkdir(out, { recursive: true });
+    const results = [];
+    const check = (name, ok, detail = '') => {
+      results.push({ name, ok: !!ok, detail });
+      console.log((ok ? 'PASS ' : 'FAIL ') + name + (detail ? ' ' + detail : ''));
+    };
+    const routes = ['messages', 'contacts', 'workbench', 'mine', 'chat/zhixia/$ui-review-0'];
+    for (const width of [320, 360, 390, 430]) {
+      await page.setViewportSize({ width, height: 844 });
+      for (const route of routes) {
+        await go(route);
+        const metrics = await page.evaluate(() => {
+          const title = document.querySelector('.m-title-main').getBoundingClientRect();
+          const right = document.querySelector('.m-bar-right').getBoundingClientRect();
+          const left = document.querySelector('.m-app-bar > .m-fab')?.getBoundingClientRect();
+          const body = document.querySelector('.m-body, .m-chat-body');
+          return { overflow: document.documentElement.scrollWidth > innerWidth || body.scrollWidth > body.clientWidth,
+            offset: title.x + title.width / 2 - innerWidth / 2,
+            overlap: title.width > 0 && ((left && title.x < left.right) || title.right > right.left) };
+        });
+        check(width + 'px ' + route, !metrics.overflow && !metrics.overlap && Math.abs(metrics.offset) < 1, JSON.stringify(metrics));
+        if (width === 390) await page.screenshot({ path: resolve(out, route.split('/').slice(0, 2).join('-') + '.png') });
+      }
+    }
+    await page.setViewportSize({ width: 390, height: 844 });
+    await go('chat/zhixia/$ui-review-0');
+    const textarea = page.locator('app-m-dock textarea');
+    const draft = 'UI审查第一行';
+    await textarea.fill(draft);
+    await textarea.press('Enter');
+    check('Enter 换行且保留草稿', (await textarea.inputValue()) === draft + '\n');
+    const composing = await textarea.evaluate((el) => {
+      const event = new KeyboardEvent('keydown', { key: 'Enter', ctrlKey: true, isComposing: true, bubbles: true, cancelable: true });
+      el.dispatchEvent(event);
+      return { prevented: event.defaultPrevented, value: el.value };
+    });
+    check('组合态快捷键不提交', !composing.prevented && composing.value === draft + '\n');
+    const message = 'UI审查发送验证-' + Date.now();
+    await textarea.fill(message + '\n第二行\n第三行');
+    const expanded = await textarea.evaluate((el) => el.getBoundingClientRect().height);
+    await page.locator('app-m-dock .m-send').click();
+    await page.waitForTimeout(600);
+    check('点击发送后草稿清空且高度复位', (await textarea.inputValue()) === '' &&
+      (await textarea.evaluate((el) => el.getBoundingClientRect().height)) < expanded);
+    check('演示消息显示在当前会话', (await page.locator('.m-chat-body').innerText()).includes(message));
+    const tools = await page.locator('app-m-dock button').evaluateAll((els) => els.map((el) => {
+      const r = el.getBoundingClientRect(); return { width: r.width, height: r.height };
+    }));
+    check('输入工具点击区域至少44px', tools.every((r) => r.width >= 44 && r.height >= 44));
+    await page.getByRole('button', { name: '查看成果与状态' }).click();
+    check('会话详情可打开', await page.locator('.m-sheet-root').isVisible());
+    await page.locator('.m-sheet-x').click();
+    check('会话详情可关闭', (await page.locator('.m-sheet-root').count()) === 0);
+    await go('workbench');
+    const cardGap = await page.locator('.m-life-card').evaluateAll((els) => els[1].getBoundingClientRect().top - els[0].getBoundingClientRect().bottom);
+    check('工作台卡片间距12px', Math.abs(cardGap - 12) < 1);
+    await page.locator('.m-body').evaluate((el) => { el.scrollTop = el.scrollHeight; });
+    const lastCard = await page.locator('.m-life-card').last().boundingBox();
+    const tab = await page.locator('.m-tabbar').boundingBox();
+    check('末张卡片不被底栏遮挡', lastCard.y + lastCard.height <= tab.y + 1);
+    await page.getByRole('button', { name: '打开导航' }).click();
+    check('导航抽屉可打开', await page.locator('app-m-drawer').evaluate((el) => !!el.querySelector('.open, .is-open, [aria-modal="true"]')));
+    await go('mine');
+    const paletteButtons = page.locator('.m-palette');
+    for (let i = 0; i < 4; i++) {
+      await paletteButtons.nth(i).click();
+      check('配色选中态 ' + i, await paletteButtons.nth(i).getAttribute('aria-pressed') === 'true');
+    }
+    await paletteButtons.first().click();
+    await page.getByRole('switch', { name: '深色模式' }).click();
+    check('深色模式与状态说明', await page.locator('html').evaluate((el) => el.classList.contains('dark')) &&
+      (await page.locator('.m-row--plain').innerText()).includes('已开启'));
+    await page.locator('.m-slider').fill('20');
+    for (const route of routes) {
+      await page.setViewportSize({ width: 320, height: 700 });
+      await go(route);
+      const appearance = await page.evaluate(() => {
+        const root = document.documentElement;
+        return { dark: root.classList.contains('dark'), font: root.style.getPropertyValue('--chat-read-size'),
+          scale: root.style.getPropertyValue('--ui-scale'), palette: root.dataset.palette,
+          overflow: root.scrollWidth > innerWidth };
+      });
+      check('320px 深色大字 ' + route, appearance.dark && appearance.font === '20px' &&
+        appearance.scale === '1.25' && appearance.palette === 'platinum' && !appearance.overflow, JSON.stringify(appearance));
+      await page.waitForTimeout(300);
+      await page.screenshot({ path: resolve(out, 'dark-large-' + route.split('/').slice(0, 2).join('-') + '.png') });
+    }
+    check('无浏览器运行异常', errors.length === 0, errors.join(' | '));
+    await writeFile(resolve(out, 'results.json'), JSON.stringify({ results, errors }, null, 2));
+    console.log('结果:' + results.filter((r) => r.ok).length + '/' + results.length + ';截图:' + out);
+    if (results.some((r) => !r.ok)) process.exitCode = 1;
+  }
+} catch (error) {
+  console.error(error);
+  process.exitCode = 1;
+} finally {
+  await browser?.close();
+  stop();
+}

+ 2 - 2
scripts/verify-mobile-composer.mjs

@@ -62,7 +62,7 @@ const grownH = await ta.evaluate((el) => el.getBoundingClientRect().height);
 check('② 多行输入时输入框会撑高', grownH > baseH + 5, `${baseH.toFixed(0)} → ${grownH.toFixed(0)}px`);
 
 /* 发送,然后看高度是否回落 */
-await ta.press('Enter');
+await page.locator('app-m-dock .m-send').click();
 await page.waitForTimeout(3000);
 const afterH = await ta.evaluate((el) => el.getBoundingClientRect().height);
 check(
@@ -80,7 +80,7 @@ if ((await input.count()) > 0) {
   const h2 = await ta.evaluate((el) => el.getBoundingClientRect().height);
   await input.setInputFiles(FILE);
   await page.waitForTimeout(1500);
-  await ta.press('Enter');
+  await page.locator('app-m-dock .m-send').click();
   await page.waitForTimeout(8000);
   const h3 = await ta.evaluate((el) => el.getBoundingClientRect().height);
   check(

+ 9 - 2
src/app/app.ts

@@ -1,6 +1,8 @@
-import { ChangeDetectionStrategy, Component, inject, isDevMode } from '@angular/core';
+import { ChangeDetectionStrategy, Component, effect, inject, isDevMode } from '@angular/core';
 import { RouterOutlet } from '@angular/router';
 import { PaletteService } from './core/palette.service';
+import { ChatFontService } from './core/chat-font.service';
+import { ThemeService } from './ui/theme/theme.service';
 import { installDataApi } from './core/data-tools';
 import { UiMToast } from './ui/mobile/components/toast/toast';
 import { AlertHostComponent } from './components/feedback/alert-host/alert-host';
@@ -10,7 +12,7 @@ import { MShareReceiveComponent } from './mobile/components/m-share-receive/m-sh
 /**
  * 应用根组件
  *
- * 职责:承载路由出口 + 启动期副作用(配色落位)。
+ * 职责:承载路由出口 + 启动期副作用(外观偏好恢复)。
  * 不承载任何业务逻辑 —— 业务按 desktop/ mobile/ 两端路由懒加载。
  */
 @Component({
@@ -46,11 +48,16 @@ import { MShareReceiveComponent } from './mobile/components/m-share-receive/m-sh
 export class App {
   protected readonly shares = inject(ShareReceiveService);
   private readonly palette = inject(PaletteService);
+  private readonly font = inject(ChatFontService);
   private readonly alert = inject(AlertService);
 
   constructor() {
+    // 全屏聊天等深链接也恢复明暗模式,无需先访问「我的」。
+    inject(ThemeService);
     // 在首帧前把已保存的配色写到 <html data-palette>,避免闪白/闪色
     this.palette.init();
+    // 登录或切换身份后同步恢复对应用户的字号。
+    effect(() => this.font.load());
     /* 开发期数据维护入口(生产构建不暴露):__fmodeData.clearDemo() 等 */
     if (isDevMode()) {
       installDataApi();

+ 8 - 1
src/app/components/domain/message-bubble/message-bubble.ts

@@ -26,7 +26,7 @@ import { ToolActivityComponent } from '../tool-activity/tool-activity';
     } @else if (message().kind === 'emote') {
       <p class="emote">{{ message().text }}</p>
     } @else {
-      <div class="bubble-row" [class.own]="own()">
+      <div class="bubble-row" [class.own]="own()" [class.mobile]="mobile()">
         <!--
           头像(2026-10-29 精细化):参考 ChatGPT / DSH 的纵向排布 ——
           左侧头像列固定,右侧为「姓名行 / 正文 / 操作条」。
@@ -310,6 +310,13 @@ import { ToolActivityComponent } from '../tool-activity/tool-activity';
         outline: 2px solid var(--primary);
         outline-offset: -2px;
       }
+      .bubble-row.mobile .act {
+        width: var(--touch-min);
+        height: var(--touch-min);
+      }
+      .bubble-row.mobile .acts {
+        opacity: 1;
+      }
       .sender-line {
         display: inline-flex;
         align-items: center;

+ 34 - 10
src/app/core/jpush.lifecycle.spec.ts

@@ -1,5 +1,5 @@
 import { ApplicationInitStatus, signal } from '@angular/core';
-import { TestBed } from '@angular/core/testing';
+import { TestBed, fakeAsync, tick } from '@angular/core/testing';
 import { JPushLifecycleService, provideJPushLifecycle } from './jpush.lifecycle';
 import { JPushService } from './jpush.service';
 import { SessionService } from './session.service';
@@ -12,9 +12,17 @@ describe('JPush lifecycle integration', () => {
   beforeEach(() => {
     loggedIn.set(false);
     me.set(null);
-    push = jasmine.createSpyObj<JPushService>('push', ['start', 'unbindAccount']);
+    push = jasmine.createSpyObj<JPushService>('push', [
+      'start',
+      'unbindAccount',
+      'bindAccount',
+      'phase',
+    ]);
     push.start.and.resolveTo(false);
     push.unbindAccount.and.resolveTo(true);
+    push.bindAccount.and.resolveTo(true);
+    /* 2026-11-20:绑定要等 SDK 就绪,测试里直接给 started */
+    (push as unknown as { phase: () => string }).phase = () => 'started';
     TestBed.configureTestingModule({ providers: [
       provideJPushLifecycle(),
       { provide: JPushService, useValue: push },
@@ -28,37 +36,53 @@ describe('JPush lifecycle integration', () => {
     expect(push.start).toHaveBeenCalledOnceWith();
   });
 
-  it('does not bind an account just because a session exists', () => {
+  it('登录后自动把 User Object ID 绑定为别名(2026-11-20)', () => {
     loggedIn.set(true);
-    me.set({ id: 'account-test' });
+    me.set({ id: 'xhVRjTMwQH' });
     TestBed.inject(JPushLifecycleService);
     TestBed.flushEffects();
+    /* 别名直接用 Parse 的 User Object ID */
+    expect(push.bindAccount).toHaveBeenCalledOnceWith('xhVRjTMwQH');
     expect(push.unbindAccount).not.toHaveBeenCalled();
     expect(push.start).toHaveBeenCalledOnceWith();
   });
 
-  it('automatically requests alias deletion on logout', () => {
+  it('automatically requests alias deletion on logout', fakeAsync(() => {
     loggedIn.set(true);
     me.set({ id: 'account-test' });
     TestBed.inject(JPushLifecycleService);
     TestBed.flushEffects();
+    tick(); // 等 bindAccount 的 Promise 落地,boundUserId 才会被设值
     loggedIn.set(false);
     me.set(null);
     TestBed.flushEffects();
+    tick();
     expect(push.unbindAccount).toHaveBeenCalledTimes(1);
-  });
+  }));
 
-  it('automatically unbinds on account or tenant changes', () => {
+  /*
+   * 🔴 2026-11-20 语义变更:推送按「人」而非「租户」。
+   *
+   * 别名 = User Object ID。同一个用户换公司(companyId 变化)不需要解绑重绑 ——
+   * 人没变,设备也没变。只有**换人**才解绑。
+   */
+  it('换账号时解绑;仅换租户不解绑(2026-11-20)', fakeAsync(() => {
     loggedIn.set(true);
     me.set({ id: 'account-one', companyId: 'tenant-one' });
     TestBed.inject(JPushLifecycleService);
     TestBed.flushEffects();
-    me.set({ id: 'account-two', companyId: 'tenant-one' });
+    tick();
+    /* 同一用户换租户 → 不做事 */
+    me.set({ id: 'account-one', companyId: 'tenant-two' });
     TestBed.flushEffects();
+    tick();
+    expect(push.unbindAccount).not.toHaveBeenCalled();
+    /* 换成另一个用户 → 解绑一次 */
     me.set({ id: 'account-two', companyId: 'tenant-two' });
     TestBed.flushEffects();
-    expect(push.unbindAccount).toHaveBeenCalledTimes(2);
-  });
+    tick();
+    expect(push.unbindAccount).toHaveBeenCalledTimes(1);
+  }));
 
   it('does not delete alias for an unchanged identity refresh', () => {
     loggedIn.set(true);

+ 72 - 10
src/app/core/jpush.lifecycle.ts

@@ -1,20 +1,72 @@
-import { Injectable, effect, inject, provideAppInitializer } from '@angular/core';
+import { Injectable, effect, inject, provideAppInitializer, untracked } from '@angular/core';
 import { SessionService } from './session.service';
 import { JPushService } from './jpush.service';
 
+/**
+ * 推送生命周期(2026-11-20 补全别名绑定)。
+ *
+ * ## 职责
+ *
+ *   ① App 启动 → `push.start()`(默认关闭时是 no-op)
+ *   ② **登录后 → 把 User Object ID 绑定为极光别名**
+ *   ③ 切换账号 / 登出 → 解绑(避免换号后收到上一个人的推送)
+ *
+ * ## 别名为什么是 User Object ID
+ *
+ * 2026-11-20 用户与团队确认:直接用 Parse 的 User Object ID 作别名。
+ * 服务端推送时 `audience.alias = [用户ObjectId]` 即可精准定位设备,
+ * 不需要额外维护「别名 ↔ 用户」的映射表。
+ *
+ * 原设计要求 `fm_` + 32 位 hash,已放宽(见 jpush.service.ts 注释)。
+ *
+ * ## 为什么绑定要等 `phase === 'started'`
+ *
+ * 极光 SDK 初始化是异步的:`start()` 返回后 SDK 才真正可用。
+ * 未启动时调 `setAlias` 会被原生侧拒绝。所以绑定逻辑放在 effect 里,
+ * 每次 `phase` 或账号变化都重新评估 —— SDK 一起来就自动补绑。
+ */
 @Injectable({ providedIn: 'root' })
 export class JPushLifecycleService {
   private readonly session = inject(SessionService);
   private readonly push = inject(JPushService);
-  private previousAccount = this.currentAccount();
+  /** 上一次成功绑定的用户 id(避免重复 setAlias) */
+  private boundUserId: string | null = null;
 
   constructor() {
+    /*
+     * 响应「账号」与「SDK 就绪状态」两个信号:
+     *   · 登录完成但 SDK 还没起来 → 等 phase 变 started 时再绑
+     *   · 先起来后登录             → 登录时立即绑
+     *   · 换账号 / 登出            → 解绑
+     */
     effect(() => {
-      const account = this.currentAccount();
-      if (this.previousAccount && this.previousAccount !== account) {
-        void this.push.unbindAccount();
-      }
-      this.previousAccount = account;
+      const userId = this.currentUserId();
+      const phase = this.push.phase();
+      untracked(() => {
+        if (!userId) {
+          /* 登出:解绑,避免换号后收到上一个人的推送 */
+          if (this.boundUserId) {
+            void this.push.unbindAccount();
+            this.boundUserId = null;
+          }
+          return;
+        }
+        if (phase !== 'started') return; // SDK 未就绪,等下一次评估
+        if (this.boundUserId === userId) return; // 已绑定同一个用户,不重复
+
+        /*
+         * 🔴 换账号:先解绑上一个用户,再绑新的(2026-11-20)。
+         *
+         * 极光的一个客户端只能挂**一个**别名 —— 直接 setAlias 会覆盖,
+         * 但为了语义清晰(以及避免服务端仍认为旧别名有效),
+         * 这里显式先解绑。
+         */
+        const previous = this.boundUserId;
+        void (async () => {
+          if (previous) await this.push.unbindAccount();
+          await this.bindTo(userId);
+        })();
+      });
     });
   }
 
@@ -22,10 +74,20 @@ export class JPushLifecycleService {
     return this.push.start();
   }
 
-  private currentAccount(): string | null {
+  private async bindTo(userId: string): Promise<void> {
+    const ok = await this.push.bindAccount(userId);
+    if (ok) this.boundUserId = userId;
+  }
+
+  /**
+   * 当前登录用户的 id(Parse Object ID)。
+   *
+   * 🔴 用 `user.id` 而不是 `companyId + id` 的组合:
+   *    推送是按「人」推的,同一用户换公司不需要重新绑定。
+   */
+  private currentUserId(): string | null {
     if (!this.session.isLoggedIn()) return null;
-    const account = this.session.me();
-    return account ? JSON.stringify([account.companyId ?? '', account.id]) : null;
+    return this.session.me()?.id ?? null;
   }
 }
 

+ 24 - 1
src/app/core/jpush.plugin.ts

@@ -1,6 +1,29 @@
 import { InjectionToken } from '@angular/core';
 import { Capacitor, PluginListenerHandle, registerPlugin } from '@capacitor/core';
 
+/**
+ * 推送是否启用。
+ *
+ * ## 两级开关
+ *
+ *   ① **Gradle** `fmodeJpushEnabled` —— 决定 SDK 是否打进 APK
+ *   ② **本常量** —— 决定前端是否调用 SDK
+ *
+ * 两者都是 `false` 时推送完全不工作。
+ * 打开时需要同步改两处 —— 有意为之:改一处容易忘另一处。
+ *
+ * ## 当前状态:已打开
+ *
+ * 前提已就绪:
+ *   · 用户点击权限引导里的「开启通知」= 对推送服务做出明确同意
+ *   · 该同意由原生侧持久化(SharedPreferences `fmode-jpush/consent`)
+ *   · 未同意时原生侧会拒绝启动(`JPUSH_CONSENT_REQUIRED`)
+ *
+ * 也就是说,本常量只表示「这个构建启用了推送能力」,
+ * **真正的启动仍由用户同意驱动** —— 不会在用户不知情时初始化 SDK。
+ */
+const JPUSH_CONFIGURED = true;
+
 export interface JPushStatus {
   available: boolean;
   started: boolean;
@@ -35,7 +58,7 @@ export interface JPushPlugin {
 
 export const JPUSH_OPTIONS = new InjectionToken<{ enabled: boolean }>('JPUSH_OPTIONS', {
   providedIn: 'root',
-  factory: () => ({ enabled: false }),
+  factory: () => ({ enabled: JPUSH_CONFIGURED }),
 });
 
 export const JPUSH_PLUGIN = new InjectionToken<JPushPlugin>('JPUSH_PLUGIN', {

+ 24 - 9
src/app/core/jpush.service.spec.ts

@@ -173,8 +173,9 @@ describe('JPushService', () => {
 
   it('serializes account switches and waits for native acknowledgment', async () => {
     await service.start(true);
-    const firstAlias = `fm_${'a'.repeat(32)}`;
-    const secondAlias = `fm_${'b'.repeat(32)}`;
+    /* 2026-11-20:别名 = User Object ID(Parse 的 10 位字母数字) */
+    const firstAlias = 'xhVRjTMwQH';
+    const secondAlias = 'aBcDeFgHiJ';
     let acknowledge: (() => void) | undefined;
     plugin.setAlias.and.callFake(() => new Promise<void>((resolve) => { acknowledge = resolve; }));
     const first = service.bindAccount(firstAlias);
@@ -194,16 +195,21 @@ describe('JPushService', () => {
     expect(plugin.deleteAlias).toHaveBeenCalledTimes(3);
   });
 
-  it('rejects non-opaque aliases without forwarding user identifiers', async () => {
+  it('拒绝非法别名(空值、含空格/特殊字符、超长)', async () => {
     await service.start(true);
-    expect(await service.bindAccount('user-name')).toBeFalse();
-    expect(await service.bindAccount('session-token')).toBeFalse();
+    /*
+     * 2026-11-20:校验放宽为「字母数字、6~64 位」,因为别名改成了 User Object ID。
+     * 仍然拒绝:空值、含连字符/空格、超长。
+     */
+    expect(await service.bindAccount('')).toBeFalse();
+    expect(await service.bindAccount('user-name')).toBeFalse(); // 含连字符
+    expect(await service.bindAccount('a'.repeat(70))).toBeFalse(); // 超长
     expect(plugin.setAlias).not.toHaveBeenCalled();
   });
 
   it('clears account binding on logout and stops if unbinding fails', async () => {
     await service.start(true);
-    expect(await service.bindAccount(`fm_${'a'.repeat(32)}`)).toBeTrue();
+    expect(await service.bindAccount('xhVRjTMwQH')).toBeTrue();
     plugin.deleteAlias.and.rejectWith(new Error('offline'));
     expect(await service.unbindAccount()).toBeFalse();
     expect(service.binding()).toBe('error');
@@ -228,8 +234,17 @@ describe('JPushService', () => {
   });
 });
 
-describe('JPush default configuration', () => {
-  it('is disabled without an application-level override', () => {
-    expect(TestBed.inject(JPUSH_OPTIONS)).toEqual({ enabled: false });
+describe('JPush 配置开关', () => {
+  it('开关状态与构建预期一致(2026-11-20 起已启用)', () => {
+    /*
+     * 🔴 这个断言守的是「开关不能被人误改」。
+     *
+     * 2026-11-20 起推送接入完成(云函数 + 别名绑定 + 隐私同意 UI 都就绪),
+     * 开关打开。如果某个改动把它关回去,这里会红。
+     *
+     * ⚠️ 打开开关**不等于**用户会收到推送:原生侧仍强制要求 `privacyConsent`,
+     *    而它只在用户点「开启通知」时才会传 true。
+     */
+    expect(TestBed.inject(JPUSH_OPTIONS)).toEqual({ enabled: true });
   });
 });

+ 23 - 1
src/app/core/jpush.service.ts

@@ -86,7 +86,29 @@ export class JPushService {
   }
 
   bindAccount(opaqueAlias: string): Promise<boolean> {
-    if (!/^fm_[a-f0-9]{32,60}$/.test(opaqueAlias)) return Promise.resolve(false);
+    /*
+     * 🔴 别名直接用 **Parse 的 User Object ID**(2026-11-20 用户裁决)。
+     *
+     * ## 原来的约束
+     *
+     * 原实现要求 `/^fm_[a-f0-9]{32,60}$/` —— 即「后端签发的不可反推 ID」。
+     * 设计意图是隐私:别名里不带可识别的用户信息。
+     *
+     * ## 为什么改
+     *
+     * 用户与团队确认:**直接用 User 的 Object ID 作别名**(如 `xhVRjTMwQH`)。
+     * 理由:
+     *   · 服务端推送时直接 `audience.alias = [用户ObjectId]`,无需额外映射表
+     *   · 极光别名本身就是「业务侧用户标识」的语义,用它最直接
+     *   · Object ID 本身也是随机串,不含姓名/手机号,隐私风险与 hash 相当
+     *
+     * ## 新校验
+     *
+     * Parse Object ID:10 位字母数字。放宽到 `^[A-Za-z0-9]{6,64}$`,
+     * 兼容 Parse 的 10 位、以及其他环境可能的变长 ID。
+     * 仍然禁止空值、空格与控制字符 —— 极光对别名格式有要求。
+     */
+    if (!/^[A-Za-z0-9]{6,64}$/.test(opaqueAlias)) return Promise.resolve(false);
     return this.enqueueAccount(async () => {
       if (this.phase() !== 'started') return false;
       this.bindingValue.set('binding');

+ 1 - 1
src/app/core/styles/_base.scss

@@ -57,7 +57,7 @@
   --desk-topbar-h: 56px; --desk-tree-w: 280px; --desk-nav-w: 200px; --desk-nav-w-compact: 176px; --desk-nav-w-icon: 72px;
   --desk-list-w: 274px; --desk-list-w-compact: 244px; --desk-list-w-narrow: 250px;
   --desk-main-min-w: 480px; --desk-aside-w: 320px; --desk-aside-w-compact: 300px;
-  --mob-navbar-h: 68px; --mob-tabbar-h: 70px; --mob-gutter: 20px;
+  --mob-navbar-h: 60px; --mob-tabbar-h: 64px; --mob-gutter: 16px;
   --mob-safe-top: env(safe-area-inset-top, 0px);
   --mob-safe-bottom: env(safe-area-inset-bottom, 0px);
   --touch-min: 44px; /* 无障碍硬约束,非设计偏好 */

+ 30 - 7
src/app/core/task-pulse.service.spec.ts

@@ -194,13 +194,26 @@ describe('TaskPulseService', () => {
   });
 
   it('观测到 running → idle 时产生「完成」动态,并带用时', () => {
+    /*
+     * 🔴 2026-11-20:完成需要**确认期**(FINISH_CONFIRM_MS)过后才报。
+     *
+     * 原实现「翻转即完成」,但容器跑工具时状态会抖动,
+     * 导致「正文还在输出就推了任务完成通知」。
+     * 现在要等确认期内状态保持非 running。
+     */
+    jasmine.clock().install();
+    jasmine.clock().mockDate(new Date(2026, 10, 20, 10, 0, 0));
     tick([agent({ status: 'running', currentTask: '写报告' })]); // 建基线
     tick([agent({ status: 'running', currentTask: '写报告' })]);
+    tick([agent({ status: 'idle' })]); // 翻转 → 只挂待确认,不报完成
+    expect(svc.pulses().find((p) => p.kind === 'finished')).toBeUndefined();
+    /* 确认期过后再观测一次 → 才真的报完成 */
+    jasmine.clock().tick(TaskPulseService.FINISH_CONFIRM_MS + 1000);
     tick([agent({ status: 'idle' })]);
-
     const finished = svc.pulses().find((p) => p.kind === 'finished');
     expect(finished).toBeDefined();
     expect(finished!.task).toBe('写报告');
+    jasmine.clock().uninstall();
   });
 
   it('首次观测只建基线,不把「第一次看到 idle」当成刚完成', () => {
@@ -209,15 +222,25 @@ describe('TaskPulseService', () => {
   });
 
   it('数据没变的轮次也要观测(running→idle 其它字段都没动)', () => {
-    const running = agent({ status: 'running' });
-    tick([running]);
-    (live as unknown as { _tick: { update(f: (n: number) => number): void } })._tick.update((n) => n + 1);
+    /* 2026-11-20:完成需要确认期,这里同样用时钟推进验证 */
+    jasmine.clock().install();
+    jasmine.clock().mockDate(new Date(2026, 10, 20, 10, 0, 0));
+    tick([agent({ status: 'running' })]);
+    const setAgents = (live as unknown as { _agents: { set(v: Agent[]): void } })._agents;
+    const bumpTick = (live as unknown as { _tick: { update(f: (n: number) => number): void } })._tick;
+    setAgents.set([agent({ status: 'running' })]);
+    bumpTick.update((n) => n + 1);
     TestBed.tick();
-    // 引用不变,但换了状态
-    (live as unknown as { _agents: { set(v: Agent[]): void } })._agents.set([agent({ status: 'idle' })]);
-    (live as unknown as { _tick: { update(f: (n: number) => number): void } })._tick.update((n) => n + 1);
+    setAgents.set([agent({ status: 'idle' })]);
+    bumpTick.update((n) => n + 1);
+    TestBed.tick();
+    /* 确认期过后再观测 */
+    jasmine.clock().tick(TaskPulseService.FINISH_CONFIRM_MS + 1000);
+    setAgents.set([agent({ status: 'idle' })]);
+    bumpTick.update((n) => n + 1);
     TestBed.tick();
     expect(svc.pulses().some((p) => p.kind === 'finished')).toBeTrue();
+    jasmine.clock().uninstall();
   });
 
   it('🔴 容器已报 idle 但仍在输出 → 显示「正在回复」,不显示「已完成」', () => {

+ 53 - 7
src/app/core/task-pulse.service.ts

@@ -117,6 +117,25 @@ export class TaskPulseService {
 
   /** 上一轮观测(agentId → 是否在忙 / 时刻 / 任务描述) */
   private marks = new Map<string, Mark>();
+  /**
+   * 待确认的「完成」(2026-11-20)。
+   *
+   * 容器状态从 running 翻成非 running 时,先挂在这里;
+   * 过了 `FINISH_CONFIRM_MS` 仍非 running 才真的报完成。
+   * 期间又变回 running → 作废(那是工具调用间隙的抖动,不是真的收工)。
+   */
+  private readonly pendingFinish = new Map<
+    string,
+    { at: number; task?: string; since: number }
+  >();
+  /**
+   * 完成确认期(毫秒)。
+   *
+   * 取 20 秒的依据:容器心跳间隔约 30 秒,一次 `observe()` 就能确认;
+   * 而工具调用的间隙通常十几秒内就会重新变 running。
+   * 取太小 → 挡不住抖动;取太大 → 用户等通知等得久。
+   */
+  static readonly FINISH_CONFIRM_MS = 20_000;
 
   /** 最近一条消息到达时刻(agentId → 毫秒),用于「正在回复」判定 */
   private readonly lastMsgAt = new Map<string, number>();
@@ -592,16 +611,43 @@ export class TaskPulseService {
       if (prev) {
         if (!prev.running && running) {
           pulses.push({ agentId: a.id, kind: 'started', at: now, task: a.currentTask });
+          /* 重新进入运行 → 作废待确认的完成 */
+          if (this.pendingFinish.has(a.id)) this.pendingFinish.delete(a.id);
         } else if (prev.running && !running) {
-          pulses.push({
-            agentId: a.id,
-            kind: 'finished',
-            at: now,
-            task: prev.task,
-            durationMs: Math.max(0, now - prev.at),
-          });
+          /*
+           * 🔴 不立即报完成,先挂「待确认」(2026-11-20 用户反馈「还没结束就推送」)。
+           *
+           * ## 问题
+           *
+           * 原来这里直接 `pulses.push({ kind: 'finished' })`。
+           * 但容器**跑工具调用的间隙**会短暂上报非 running —— 一次心跳抖动
+           * 就会被判成「完成任务」,用户收到通知时正文其实还在输出。
+           *
+           * ## 做法
+           *
+           * 翻转时只记下时间戳,**等 `FINISH_CONFIRM_MS` 确认**:
+           *   · 期间又变回 running → 作废,不发通知
+           *   · 期间一直非 running → 确认完成,补发脉冲
+           *
+           * 确认在下一次 `observe()` 里结算(心跳 30 秒一次,所以最多晚一轮)。
+           */
+          this.pendingFinish.set(a.id, { at: now, task: prev.task, since: prev.at });
         }
       }
+      /*
+       * 结算「待确认的完成」:只有确认期过了、且当前仍非 running,才真的报完成。
+       */
+      const pending = this.pendingFinish.get(a.id);
+      if (pending && !running && now - pending.at >= TaskPulseService.FINISH_CONFIRM_MS) {
+        pulses.push({
+          agentId: a.id,
+          kind: 'finished',
+          at: now,
+          task: pending.task,
+          durationMs: Math.max(0, now - pending.since),
+        });
+        this.pendingFinish.delete(a.id);
+      }
       /*
        * 本地「我刚发出消息」标记的清理:不能只挂在「running → 非 running」
        * 这条翻转上(2026-11-09)。

+ 13 - 37
src/app/mobile/components/m-app-bar/m-app-bar.ts

@@ -48,26 +48,21 @@ import { ChangeDetectionStrategy, Component, computed, input, output } from '@an
       :host {
         display: block;
       }
-      /*
-       * 🔴 标题必须相对**整个顶栏**居中(2026-11-04)。
-       *
-       * 原来三者等分 flex:左侧有时是返回键、有时是占位的 44px 圆圈,
-       * 右侧按钮数量也不固定(0/1 个),两边宽度不等 → 标题偏左/偏右。
-       *
-       * 改为绝对定位铺满:标题左右各让出 44px,在剩余区域水平居中,
-       * 左右按钮用相对定位压在两侧 —— 标题永远在整个顶栏的正中。
-       */
+      /* 对称网格确保标题相对整屏居中,按钮与标题各占独立列。 */
       .m-app-bar {
-        display: flex;
+        display: grid;
+        grid-template-columns: var(--touch-min) minmax(0, 1fr) var(--touch-min);
         align-items: center;
-        justify-content: space-between;
-        gap: var(--sp-3);
+        gap: var(--sp-2);
         height: calc(var(--mob-navbar-h) + var(--mob-safe-top));
         padding: var(--mob-safe-top) var(--sp-4) 0;
         position: relative;
         z-index: var(--z-affix);
         box-sizing: border-box;
       }
+      .m-app-bar:has(.m-bar-right > button:nth-of-type(2)) {
+        grid-template-columns: calc(var(--touch-min) * 2 + var(--sp-2)) minmax(0, 1fr) calc(var(--touch-min) * 2 + var(--sp-2));
+      }
       .m-fab {
         width: var(--touch-min);
         height: var(--touch-min);
@@ -80,7 +75,7 @@ import { ChangeDetectionStrategy, Component, computed, input, output } from '@an
         position: relative;
         z-index: 1;
         background: var(--surface);
-        box-shadow: var(--shadow-soft);
+        box-shadow: none;
         color: var(--ink);
         font-size: var(--fs-17);
         cursor: pointer;
@@ -95,23 +90,7 @@ import { ChangeDetectionStrategy, Component, computed, input, output } from '@an
         height: var(--touch-min);
         flex: none;
       }
-      /*
-       * 标题改用 flex 三栏:[左 44] [中间 flex:1] [右 auto](2026-11-15 真机事故后重构)
-       *
-       * 🔴 原来用 position: absolute 铺满整条顶栏来做「绝对居中」,代价是:
-       *    左右按钮是普通 flex 子项、没有 z-index,
-       *    而绝对定位层**默认绘制在普通流之后** → 标题任何溢出都会画在按钮之上。
-       *
-       *    真机表现:第一个会话标题「给我一个 HTML …」+ 副标题「lj-test · 在线」,
-       *    副标题没有 max-width 撑满整个标题层,左边界直抵返回按钮,把返回键盖住了。
-       *    max-width: 70% 挡不住,因为 70% 是相对**标题层**算的,不是相对顶栏。
-       *
-       * 三栏布局天然解决:中间栏 flex:1 + min-width:0,只会占用「左按钮之后」的空间,
-       * 标题再长也只会在自己栏内省略,物理上不可能越界到按钮上。
-       * 左右两栏等宽时标题依然居中;右侧按钮多时标题区自动收窄 —— 正是想要的行为。
-       */
       .m-title {
-        flex: 1 1 auto;
         min-width: 0;
         height: calc(var(--mob-navbar-h) - var(--sp-2));
         display: flex;
@@ -122,18 +101,14 @@ import { ChangeDetectionStrategy, Component, computed, input, output } from '@an
         overflow: hidden;
         pointer-events: none;
         text-align: center;
-        font-size: var(--fs-17);
+        font-size: var(--fs-18);
         font-weight: 600;
         line-height: 1.2;
         color: var(--ink);
       }
       .m-title-main {
         display: block;
-        /*
-         * 改为 100%(2026-11-15):三栏布局后,标题列本身已经被左右按钮夹住了,
-         * 不会越界。再留 70% 只会让长标题更早被截断,白白浪费空间。
-         * 「留呼吸空间」这个诉求由三栏之间的 gap(--sp-3 = 12px)承担。
-         */
+        /* 标题使用完整中栏宽度,与按钮之间的间距由网格 gap 保证。 */
         max-width: 100%;
         overflow: hidden;
         text-overflow: ellipsis;
@@ -149,7 +124,7 @@ import { ChangeDetectionStrategy, Component, computed, input, output } from '@an
          *    三栏布局已经兜住了越界,这里再补一道,让省略号位置可控。
          */
         max-width: 100%;
-        font-size: var(--fs-11);
+        font-size: var(--fs-12);
         font-weight: 400;
         color: var(--muted);
         overflow: hidden;
@@ -161,6 +136,7 @@ import { ChangeDetectionStrategy, Component, computed, input, output } from '@an
         align-items: center;
         gap: var(--sp-2);
         flex: none;
+        justify-self: end;
       }
     `,
   ],
@@ -175,7 +151,7 @@ export class MAppBarComponent {
   /** 右侧是否已有内容(父组件通过 `[barRight]` 投影);false 时渲染占位保持标题居中 */
   readonly hasRightContent = input(true);
   /**
-   * @deprecated 2026-11-15 起标题改为 flex 三栏布局,右侧栏宽度由实际投影的按钮
+   * @deprecated 2026-11-20 起标题采用对称网格,右侧栏宽度由实际投影的按钮
    * 自动撑开,不再需要手工计数。保留此 input 仅为不破坏现有调用方(聊天页仍传 2),
    * 传与不传都不影响布局。新代码不要再传。
    */

+ 2 - 2
src/app/mobile/components/m-badge/m-badge.ts

@@ -61,10 +61,10 @@ export const TASK_STATUS_TEXT: Record<TaskStatus, string> = {
         display: inline-flex;
         align-items: center;
         gap: var(--sp-1);
-        height: 20px;
+        min-height: 24px;
         padding: 0 var(--sp-2);
         border-radius: var(--r-sm);
-        font-size: var(--fs-11);
+        font-size: var(--fs-12);
         font-weight: 600;
         white-space: nowrap;
         background: var(--neutral-soft);

+ 65 - 0
src/app/mobile/components/m-dock/m-dock.spec.ts

@@ -0,0 +1,65 @@
+import { ComponentFixture, TestBed } from '@angular/core/testing';
+import { MDockComponent } from './m-dock';
+
+describe('MDockComponent mobile input', () => {
+  let fixture: ComponentFixture<MDockComponent>;
+  let textarea: HTMLTextAreaElement;
+  let sent: string[];
+
+  beforeEach(() => {
+    fixture = TestBed.createComponent(MDockComponent);
+    fixture.componentRef.setInput('draft', '待发送内容');
+    sent = [];
+    fixture.componentInstance.send.subscribe((text) => sent.push(text));
+    fixture.detectChanges();
+    textarea = fixture.nativeElement.querySelector('textarea');
+  });
+
+  function enter(options: KeyboardEventInit = {}): KeyboardEvent {
+    const event = new KeyboardEvent('keydown', {
+      key: 'Enter', bubbles: true, cancelable: true, ...options,
+    });
+    textarea.dispatchEvent(event);
+    return event;
+  }
+
+  it('keeps ordinary Enter and Shift+Enter available for native newlines', () => {
+    expect(enter().defaultPrevented).toBeFalse();
+    expect(enter({ shiftKey: true }).defaultPrevented).toBeFalse();
+    expect(sent).toEqual([]);
+  });
+
+  it('does not submit during IME composition, including shortcut keys', () => {
+    expect(enter({ isComposing: true }).defaultPrevented).toBeFalse();
+    expect(enter({ isComposing: true, ctrlKey: true }).defaultPrevented).toBeFalse();
+    expect(sent).toEqual([]);
+  });
+
+  it('submits once with an external keyboard shortcut', () => {
+    expect(enter({ ctrlKey: true }).defaultPrevented).toBeTrue();
+    expect(sent).toEqual(['待发送内容']);
+  });
+
+  it('submits with Command+Enter', () => {
+    enter({ metaKey: true });
+    expect(sent).toEqual(['待发送内容']);
+  });
+
+  it('disables the button and prevents shortcut submissions while sending', () => {
+    fixture.componentRef.setInput('sending', true);
+    fixture.detectChanges();
+    expect(fixture.nativeElement.querySelector('.m-send').disabled).toBeTrue();
+    enter({ ctrlKey: true });
+    expect(sent).toEqual([]);
+  });
+
+  it('allows an attachment-only submission and resets expanded input height', () => {
+    fixture.componentRef.setInput('draft', '');
+    fixture.componentRef.setInput('hasAttachments', true);
+    fixture.detectChanges();
+    textarea.style.height = '120px';
+    fixture.nativeElement.querySelector('.m-send').click();
+    expect(sent).toEqual(['']);
+    expect(textarea.style.height).toBe('auto');
+  });
+});

+ 29 - 13
src/app/mobile/components/m-dock/m-dock.ts

@@ -26,12 +26,13 @@ import { UploadPhase } from '../../../core/upload-state';
       <textarea
         #textRef
         rows="1"
+        enterkeyhint="enter"
         [value]="draft()"
         [placeholder]="placeholder()"
         [attr.aria-label]="placeholder()"
         [disabled]="disabled()"
         (input)="onInput($event)"
-        (keydown.enter)="onEnter($event)"
+        (keydown)="onEnter($event)"
       ></textarea>
       <div class="m-dock-tools">
         <button type="button" class="m-tool" aria-label="添加附件" [disabled]="disabled() || uploading()" (click)="pickFile()">
@@ -50,7 +51,7 @@ import { UploadPhase } from '../../../core/upload-state';
           type="button"
           class="m-send"
           [class.ready]="hasContent()"
-          [disabled]="disabled() || !hasContent()"
+          [disabled]="disabled() || sending() || !hasContent()"
           [attr.aria-label]="sending() ? '发送中' : (hint() || '发送')"
           [attr.title]="hint() || null"
           (click)="submit()"
@@ -76,20 +77,20 @@ import { UploadPhase } from '../../../core/upload-state';
         display: block;
       }
       .m-dock {
-        margin: 0 var(--sp-4);
-        padding: var(--sp-3) var(--sp-4);
+        margin: 0 var(--mob-gutter);
+        padding: var(--sp-1) var(--sp-3);
         border: 1px solid var(--edge);
         border-radius: var(--r-lg);
         background: var(--surface);
-        box-shadow: var(--shadow-pop);
+        box-shadow: var(--shadow-soft);
         box-sizing: border-box;
       }
       textarea {
         display: block;
         width: 100%;
-        min-height: 44px;
+        min-height: var(--touch-min);
         max-height: 120px;
-        padding: var(--sp-2) 0;
+        padding: var(--sp-1) var(--sp-1);
         border: 0;
         outline: 0;
         resize: none;
@@ -108,8 +109,9 @@ import { UploadPhase } from '../../../core/upload-state';
       .m-tool {
         display: grid;
         place-items: center;
-        width: 36px;
-        height: 36px;
+        width: var(--touch-min);
+        height: var(--touch-min);
+        flex: none;
         border: 0;
         border-radius: var(--r-tag);
         background: none;
@@ -133,8 +135,8 @@ import { UploadPhase } from '../../../core/upload-state';
         display: grid;
         place-items: center;
         flex: none;
-        width: 36px;
-        height: 36px;
+        width: var(--touch-min);
+        height: var(--touch-min);
         border: 0;
         border-radius: var(--r-tag);
         background: var(--primary-subtle);
@@ -151,6 +153,20 @@ import { UploadPhase } from '../../../core/upload-state';
       }
       .m-send:disabled {
         cursor: not-allowed;
+        opacity: 0.5;
+      }
+      .m-dock:focus-within {
+        border-color: var(--primary);
+      }
+      .m-tool:active,
+      .m-send:not(:disabled):active {
+        transform: scale(0.96);
+      }
+      @media (prefers-reduced-motion: reduce) {
+        .m-tool:active,
+        .m-send:not(:disabled):active {
+          transform: none;
+        }
       }
       .m-dock-progress {
         height: 3px;
@@ -233,10 +249,10 @@ export class MDockComponent {
     el.style.height = `${Math.min(el.scrollHeight, 120)}px`;
   }
 
-  /** 回车发送,Shift+Enter 换行 */
+  /** 手机回车换行;外接键盘 Ctrl/Cmd+Enter 发送,输入法选字期间不提交。 */
   protected onEnter(e: Event): void {
     const ke = e as KeyboardEvent;
-    if (ke.shiftKey) return;
+    if (ke.key !== 'Enter' || ke.isComposing || ke.keyCode === 229 || !(ke.ctrlKey || ke.metaKey)) return;
     ke.preventDefault();
     this.submit();
   }

+ 4 - 1
src/app/mobile/components/m-drawer/m-drawer.ts

@@ -5,6 +5,8 @@ import { filter } from 'rxjs';
 import { Agent } from '../../../core/api/models';
 import { groupOf } from '../../../core/chat-session';
 import { AgentStateView, resolveAgentState } from '../../../core/agent-state';
+import { livenessOf } from '../../../core/agent-liveness';
+import { mobilePresenceTone } from '../../presentation';
 import { ChatSessionService } from '../../../core/chat-session.service';
 import { LiveService } from '../../../core/live.service';
 import { MobileChatViewService, SessionRow } from '../../../core/mobile-chat-view.service';
@@ -1006,7 +1008,8 @@ export class MDrawerComponent {
 
   /** 会话所属容器的状态(2026-11-08):与 PC 左栏 / 会话列表同一口径 */
   protected stateOf(row: SessionRow): AgentStateView {
-    return resolveAgentState({ agent: row.agent });
+    const state = resolveAgentState({ agent: row.agent });
+    return { ...state, tone: state.busy ? state.tone : mobilePresenceTone(livenessOf(row.agent)) };
   }
 
   constructor() {

+ 12 - 12
src/app/mobile/components/m-life-card/m-life-card.ts

@@ -1,6 +1,7 @@
 import { ChangeDetectionStrategy, Component, computed, input, output } from '@angular/core';
 import { Agent } from '../../../core/api/models';
 import { isReporterSelfTalk, livenessOf } from '../../../core/agent-liveness';
+import { mobilePresenceTone } from '../../presentation';
 import { MAvatarComponent } from '../m-avatar/m-avatar';
 import { BadgeTone, MBadgeComponent } from '../m-badge/m-badge';
 
@@ -43,7 +44,7 @@ import { BadgeTone, MBadgeComponent } from '../m-badge/m-badge';
       }
 
       <div class="m-actions">
-        <button type="button" class="primary" (click)="enter.emit(agent())">进入</button>
+        <button type="button" class="primary" (click)="enter.emit(agent())">进入会话</button>
         <button type="button" (click)="channels.emit(agent())">通道</button>
         <button type="button" (click)="recharge.emit(agent())">充值</button>
       </div>
@@ -55,14 +56,11 @@ import { BadgeTone, MBadgeComponent } from '../m-badge/m-badge';
         display: block;
       }
       .m-life-card {
-        padding: var(--sp-3) var(--sp-4);
+        padding: var(--sp-4);
         border: 1px solid var(--edge);
         border-radius: var(--r-lg);
         background: var(--surface);
-        box-shadow: var(--shadow-soft);
-      }
-      .m-life-card + .m-life-card {
-        margin-top: var(--sp-2);
+        box-shadow: none;
       }
       .m-head {
         display: flex;
@@ -75,7 +73,7 @@ import { BadgeTone, MBadgeComponent } from '../m-badge/m-badge';
       }
       .m-name {
         color: var(--ink);
-        font-size: var(--fs-15);
+        font-size: var(--fs-16);
         font-weight: 600;
       }
       .m-specialty {
@@ -83,7 +81,7 @@ import { BadgeTone, MBadgeComponent } from '../m-badge/m-badge';
         text-overflow: ellipsis;
         white-space: nowrap;
         color: var(--muted);
-        font-size: var(--fs-12);
+        font-size: var(--fs-13);
       }
       .m-cur {
         margin: var(--sp-2) 0;
@@ -147,11 +145,12 @@ import { BadgeTone, MBadgeComponent } from '../m-badge/m-badge';
       }
       .m-actions button {
         flex: 1;
-        height: 36px;
-        border: 1px solid var(--edge);
+        min-height: var(--touch-min);
+        padding: var(--sp-2) var(--sp-1);
+        border: 1px solid transparent;
         border-radius: var(--r-md);
         background: var(--surface);
-        color: var(--ink);
+        color: var(--ink-2);
         font: inherit;
         font-size: var(--fs-13);
         cursor: pointer;
@@ -161,6 +160,7 @@ import { BadgeTone, MBadgeComponent } from '../m-badge/m-badge';
       }
       /* 主操作高亮,与次操作拉开层级(对齐 PC 的「查看任务」主按钮) */
       .m-actions button.primary {
+        flex: 1.5;
         border-color: var(--primary);
         background: var(--primary);
         color: var(--primary-content);
@@ -183,7 +183,7 @@ export class MLifeCardComponent {
    * 与 PC 工作台卡片完全同源。
    */
   private readonly live = computed(() => livenessOf(this.agent()));
-  protected readonly tone = computed<BadgeTone>(() => this.live().tone as BadgeTone);
+  protected readonly tone = computed<BadgeTone>(() => mobilePresenceTone(this.live()));
   protected readonly statusText = computed(() => this.live().text);
 
   /**

+ 6 - 3
src/app/mobile/components/m-new-chat/m-new-chat.ts

@@ -8,6 +8,8 @@ import { MAvatarComponent } from '../m-avatar/m-avatar';
 import { MSegmentedComponent } from '../m-segmented/m-segmented';
 import { BadgeTone, MBadgeComponent } from '../m-badge/m-badge';
 import { AgentStateView, isAgentUsable, resolveAgentState } from '../../../core/agent-state';
+import { livenessOf } from '../../../core/agent-liveness';
+import { mobilePresenceTone } from '../../presentation';
 import { GroupLiveService } from '../../../core/group-live.service';
 import { LockScrollDirective } from '../../directives/lock-scroll.directive';
 
@@ -74,7 +76,7 @@ import { LockScrollDirective } from '../../directives/lock-scroll.directive';
                         不可用时给出原因(离线 / 异常),可用时不给状态徽标。
                       -->
                       @if (!canUse(a)) {
-                        <app-m-badge [tone]="'danger'" [dot]="true">{{ statusText(a) }}</app-m-badge>
+                        <app-m-badge [tone]="toneOf(a)" [dot]="true">{{ statusText(a) }}</app-m-badge>
                       }
                     </button>
                   </li>
@@ -109,7 +111,7 @@ import { LockScrollDirective } from '../../directives/lock-scroll.directive';
                       </span>
                       <!-- 与单聊一致:只在不可用时说明原因,不展示运行态 -->
                       @if (!canUse(a)) {
-                        <app-m-badge [tone]="'danger'" [dot]="true">{{ statusText(a) }}</app-m-badge>
+                        <app-m-badge [tone]="toneOf(a)" [dot]="true">{{ statusText(a) }}</app-m-badge>
                       }
                     </button>
                   </li>
@@ -412,7 +414,8 @@ export class MNewChatSheetComponent {
   }
 
   protected toneOf(a: Agent): BadgeTone {
-    return this.stateOf(a).tone as BadgeTone;
+    const state = this.stateOf(a);
+    return state.busy ? state.tone : mobilePresenceTone(livenessOf(a));
   }
 
   protected statusText(a: Agent): string {

+ 12 - 3
src/app/mobile/components/m-search/m-search.ts

@@ -41,9 +41,9 @@ import { ChangeDetectionStrategy, Component, input, model } from '@angular/core'
         height: var(--touch-min);
         padding: 0 var(--sp-3);
         box-sizing: border-box;
-        border: 1px solid var(--edge);
+        border: 1px solid transparent;
         border-radius: var(--r-md);
-        background: var(--surface);
+        background: var(--surface-2);
         color: var(--muted);
       }
       .m-search-icon {
@@ -58,15 +58,24 @@ import { ChangeDetectionStrategy, Component, input, model } from '@angular/core'
         background: transparent;
         color: var(--ink);
       }
+      .m-search:focus-within {
+        border-color: var(--primary);
+        background: var(--surface);
+      }
       .m-search input::-webkit-search-cancel-button {
         display: none;
       }
       .m-search-clear {
+        display: grid;
+        place-items: center;
+        width: var(--touch-min);
+        height: var(--touch-min);
+        margin-right: calc(-1 * var(--sp-3));
         border: 0;
         background: none;
         color: var(--muted);
         font-size: var(--fs-14);
-        padding: var(--sp-1);
+        padding: 0;
         cursor: pointer;
         flex: none;
       }

+ 5 - 4
src/app/mobile/components/m-segmented/m-segmented.ts

@@ -34,16 +34,17 @@ import { ChangeDetectionStrategy, Component, input, model } from '@angular/core'
         display: flex;
         padding: var(--sp-1);
         width: 100%;
-        max-width: 300px;
+        max-width: 360px;
         margin: 0 auto;
         box-sizing: border-box;
-        border: 1px solid var(--edge);
+        border: 0;
         border-radius: var(--r-tag);
         background: var(--surface-2);
       }
       .m-segmented button {
         flex: 1;
-        height: 36px;
+        min-height: var(--touch-min);
+        padding: var(--sp-1) var(--sp-2);
         border: 0;
         border-radius: var(--r-tag);
         background: none;
@@ -59,7 +60,7 @@ import { ChangeDetectionStrategy, Component, input, model } from '@angular/core'
         background: var(--surface);
         color: var(--ink);
         font-weight: 600;
-        box-shadow: var(--shadow-soft);
+        box-shadow: none;
       }
     `,
   ],

+ 30 - 1
src/app/mobile/components/permission-guide/permission-guide.ts

@@ -1,5 +1,6 @@
 import { ChangeDetectionStrategy, Component, inject, input, output, signal } from '@angular/core';
 import { AppNotificationService } from '../../../core/app-notification.service';
+import { JPushService } from '../../../core/jpush.service';
 
 /**
  * 权限引导弹层(2026-11-15)
@@ -48,10 +49,15 @@ import { AppNotificationService } from '../../../core/app-notification.service';
               <i class="fa-solid fa-circle-check" aria-hidden="true"></i>
               <span><b>新回复</b>:重要消息到了及时知道</span>
             </li>
+            <li>
+              <i class="fa-solid fa-circle-check" aria-hidden="true"></i>
+              <span><b>关闭 App 也能收到</b>:切到后台或退出后,消息仍会推送到通知栏</span>
+            </li>
           </ul>
 
           <p class="pg-note">
-            系统要求你确认一次授权,之后可在「我的 → 通知」里随时关闭。
+            开启后将使用推送服务(极光 JPush)投递消息,仅传输「有新消息」这类通知,
+            不包含消息内容。系统要求你确认一次授权,之后可在「我的 → 通知」里随时关闭。
           </p>
 
           <div class="pg-actions">
@@ -177,6 +183,7 @@ import { AppNotificationService } from '../../../core/app-notification.service';
 })
 export class PermissionGuideComponent {
   private readonly notifySvc = inject(AppNotificationService);
+  private readonly push = inject(JPushService);
 
   readonly open = input(false);
   /** 用户关闭(拒绝或开启后) */
@@ -189,6 +196,28 @@ export class PermissionGuideComponent {
     if (this.busy()) return;
     this.busy.set(true);
     try {
+      /*
+       * 🔴 顺序很重要:**先启动推送 SDK,再申请系统通知权限**(2026-11-20)。
+       *
+       * ## 为什么先 SDK 后权限
+       *
+       * 两个是不同层面的东西:
+       *   · 推送 SDK 需要**用户对隐私政策的同意**(极光合规要求)
+       *   · 系统通知权限是 Android 的运行时权限
+       *
+       * 用户点了「开启通知」= 同时同意了这两件事。先把 SDK 起来,
+       * 它拿到 registrationId 后才有意义(否则系统权限开了也没设备标识可绑)。
+       *
+       * ## `start(true)` 的 true 是什么
+       *
+       * `privacyConsent: true` —— 原生侧强制要求,不传会被拒(`JPUSH_CONSENT_REQUIRED`)。
+       * 它同时把这个同意**持久化**到 SharedPreferences `fmode-jpush/consent`,
+       * 下次启动不需要再问。
+       *
+       * 推送没启用(`JPUSH_CONFIGURED=false`)时 `start()` 是 no-op,不报错。
+       */
+      await this.push.start(true);
+
       const ok = await this.notifySvc.request();
       if (ok) return;
 

+ 4 - 2
src/app/mobile/pages/chat/chat.ts

@@ -689,8 +689,8 @@ type SheetTab = 'task' | 'file' | 'deliver' | 'state';
         right: 2px;
         display: grid;
         place-items: center;
-        width: 20px;
-        height: 20px;
+        width: var(--touch-min);
+        height: var(--touch-min);
         padding: 0;
         border: 0;
         border-radius: var(--r-tag);
@@ -718,6 +718,8 @@ type SheetTab = 'task' | 'file' | 'deliver' | 'state';
         white-space: nowrap;
       }
       .m-pending-item button {
+        min-width: var(--touch-min);
+        min-height: var(--touch-min);
         border: 0;
         background: none;
         color: var(--muted);

+ 7 - 4
src/app/mobile/pages/contacts/contacts.ts

@@ -6,6 +6,7 @@ import { LiveService } from '../../../core/live.service';
 import { Agent, Person } from '../../../core/api/models';
 import { AlertService } from '../../../core/alert.service';
 import { blockedHint, livenessOf } from '../../../core/agent-liveness';
+import { mobilePresenceTone } from '../../presentation';
 import { MAppBarComponent } from '../../components/m-app-bar/m-app-bar';
 import { MAvatarComponent } from '../../components/m-avatar/m-avatar';
 import { BadgeTone, MBadgeComponent } from '../../components/m-badge/m-badge';
@@ -89,7 +90,8 @@ import { MSearchComponent } from '../../components/m-search/m-search';
                         <span class="m-row-body">
                           <span class="m-row-t1">{{ p.name }}</span>
                           <span class="m-row-t2">
-                            {{ p.mobile || '—' }} · {{ p.agents?.length || 0 }} 个容器
+                            @if (p.mobile) { {{ p.mobile }} · }
+                            {{ p.agents?.length || 0 }} 个数字生命
                           </span>
                         </span>
                         <i
@@ -110,7 +112,7 @@ import { MSearchComponent } from '../../components/m-search/m-search';
                             <app-m-badge [tone]="toneOf(a)" [dot]="true">{{ statusText(a) }}</app-m-badge>
                           </button>
                         } @empty {
-                          <p class="m-dept-empty">该同事暂无可对话的容器</p>
+                          <p class="m-dept-empty">该同事暂无可对话的数字生命</p>
                         }
                       }
                     </li>
@@ -287,7 +289,8 @@ import { MSearchComponent } from '../../components/m-search/m-search';
         white-space: nowrap;
       }
       .m-row-t1 {
-        font-size: var(--fs-15);
+        font-size: var(--fs-16);
+        font-weight: 500;
       }
       .m-row-t2 {
         color: var(--muted);
@@ -344,7 +347,7 @@ export class MbContactsPage {
    * 现在与 PC 通讯录、会话列表、新建弹窗共用 `resolveAgentState`。
    */
   protected toneOf(a: Agent): BadgeTone {
-    return livenessOf(a).tone as BadgeTone;
+    return mobilePresenceTone(livenessOf(a));
   }
 
   protected statusText(a: Agent): string {

+ 32 - 8
src/app/mobile/pages/messages/messages.ts

@@ -1,5 +1,6 @@
 import { ChatService } from '../../../core/chat.service';
-import { resolveAgentState } from '../../../core/agent-state';
+import { livenessOf } from '../../../core/agent-liveness';
+import { mobilePresenceTone } from '../../presentation';
 import { ChangeDetectionStrategy, Component, computed, effect, inject, signal, untracked } from '@angular/core';
 import { ActivatedRoute, Router } from '@angular/router';
 import { MAppBarComponent } from '../../components/m-app-bar/m-app-bar';
@@ -235,7 +236,8 @@ type MsgFilter = 'all' | 'group' | 'workspace';
                       }
                     } @else {
                       <app-m-avatar [name]="row.agent?.name ?? '?'" />
-                      <span class="m-presence" [class]="'m-presence--' + toneOf(row)"></span>
+                      <span class="m-presence" [class]="'m-presence--' + toneOf(row)"
+                        role="img" [attr.aria-label]="presenceText(row)" [attr.title]="presenceText(row)"></span>
                     }
                   </span>
                   <span class="m-row-body">
@@ -247,6 +249,9 @@ type MsgFilter = 'all' | 'group' | 'workspace';
                   </span>
                   <span class="m-row-side">
                     <span class="m-row-time">{{ rel(row) }}</span>
+                    @if (row.unread > 0) {
+                      <app-m-badge tone="danger">{{ row.unread > 99 ? '99+' : row.unread }}</app-m-badge>
+                    }
                   </span>
                 </button>
               </li>
@@ -563,14 +568,21 @@ type MsgFilter = 'all' | 'group' | 'workspace';
         overflow: hidden;
       }
       .m-list > li + li {
+        position: relative;
+      }
+      .m-list > li + li::before {
+        content: '';
+        position: absolute;
+        inset: 0 var(--sp-4) auto 68px;
         border-top: 1px solid var(--edge);
+        pointer-events: none;
       }
       .m-row {
         display: flex;
         align-items: center;
         gap: var(--sp-3);
         width: 100%;
-        min-height: 56px;
+        min-height: 80px;
         padding: var(--sp-3) var(--sp-4);
         border: 0;
         background: var(--surface);
@@ -628,17 +640,26 @@ type MsgFilter = 'all' | 'group' | 'workspace';
       }
       .m-row-t1 {
         color: var(--ink);
-        font-size: var(--fs-15);
+        font-size: var(--fs-16);
+        font-weight: 500;
+        line-height: 1.45;
+        display: -webkit-box;
+        -webkit-box-orient: vertical;
+        -webkit-line-clamp: 2;
+        white-space: normal;
+        overflow-wrap: anywhere;
       }
       .m-row-t2 {
         color: var(--muted);
-        font-size: var(--fs-13);
+        font-size: var(--fs-14);
+        margin-top: var(--sp-1);
       }
       .m-row-side {
         display: flex;
         flex: none;
         flex-direction: column;
         align-items: flex-end;
+        align-self: flex-start;
         gap: var(--sp-1);
       }
       .m-row-time {
@@ -985,11 +1006,14 @@ export class MbMessagesPage {
   /**
    * 会话行的状态色(2026-11-07 统一口径)。
    *
-   * 用 `resolveAgentState` 而不是直接读 `Agent.status`:
-   * 后者是容器 15s 轮询的历史值,掉线的容器仍会报 running。
+   * 复用共享存活状态解析,仅将离线的展示色映射为中性色。
    */
   protected toneOf(row: SessionRow): BadgeTone {
-    return resolveAgentState({ agent: row.agent }).tone as BadgeTone;
+    return mobilePresenceTone(livenessOf(row.agent));
+  }
+
+  protected presenceText(row: SessionRow): string {
+    return livenessOf(row.agent).text;
   }
 
   protected rel(row: SessionRow): string {

+ 63 - 54
src/app/mobile/pages/mine/mine.ts

@@ -17,7 +17,7 @@ import { UiMDialog } from '../../../ui/mobile/components/dialog/dialog';
 /**
  * 我的 / 设置(Demo 16)
  *
- * 四段:账号卡 / 账号 / 外观(4 套配色 + 深色 + 正文字号)/ 退出。
+ * 顺序:个人资料 / 通知(原生端)/ 外观 / 账号与 Token / 退出。
  *
  * 配色与深色直接复用既有服务(`PaletteService` / 底座 `ThemeService`),
  * 字号走 `ChatFontService`(写 `--ui-scale`),与桌面设置项**同一真源**,
@@ -37,53 +37,11 @@ import { UiMDialog } from '../../../ui/mobile/components/dialog/dialog';
           <app-m-avatar [name]="me()?.name || '未登录'" size="lg" tone="person" />
           <div class="m-profile-body">
             <div class="m-profile-name">{{ me()?.name || '未登录' }}</div>
-            <div class="m-profile-sub">{{ me()?.mobile || '—' }} · {{ me()?.companyName || '—' }}</div>
+            <div class="m-profile-sub">{{ me()?.mobile || '未设置手机号' }}@if (me()?.companyName) { · {{ me()?.companyName }} }</div>
           </div>
         </div>
       </section>
 
-      <section class="m-section">
-        <h2 class="m-section-title">账号</h2>
-        <ul class="m-list">
-          <!--
-            访问 Token(2026-11-04 对齐 PC):可显示/隐藏 + 复制。
-            默认脱敏,避免误拍屏泄漏;显示后可直接复制用于排障或换设备登录。
-          -->
-          <li class="m-token-row">
-            <span class="m-row-body">
-              <span class="m-row-t1">访问 Token</span>
-              <span class="m-row-t2 m-token-value" [class.m-token--masked]="!tokenShown()">
-                {{ tokenShown() ? tokenText() : maskToken() }}
-              </span>
-            </span>
-            <button
-              type="button"
-              class="m-token-btn"
-              [attr.aria-label]="tokenShown() ? '隐藏 Token' : '显示 Token'"
-              (click)="tokenShown.set(!tokenShown())"
-            >
-              <i [class]="tokenShown() ? 'fa-solid fa-eye-slash' : 'fa-solid fa-eye'" aria-hidden="true"></i>
-            </button>
-            <button
-              type="button"
-              class="m-token-btn"
-              aria-label="复制 Token"
-              [disabled]="!tokenShown()"
-              (click)="copyToken()"
-            >
-              <i [class]="copied() ? 'fa-solid fa-check' : 'fa-solid fa-copy'" aria-hidden="true"></i>
-            </button>
-          </li>
-          <li>
-            <button type="button" class="m-row" (click)="logoutOpen.set(true)">
-              <span class="m-row-body">
-                <span class="m-row-t1 m-danger">退出登录</span>
-              </span>
-              <i class="fa-solid fa-chevron-right m-chev" aria-hidden="true"></i>
-            </button>
-          </li>
-        </ul>
-      </section>
 
       <!--
         通知(2026-11-15):把「开不开系统通知」这件事摆到明面上。
@@ -130,7 +88,7 @@ import { UiMDialog } from '../../../ui/mobile/components/dialog/dialog';
           <div class="m-row m-row--plain">
             <span class="m-row-body">
               <span class="m-row-t1">深色模式</span>
-              <span class="m-row-t2">跟随手动切换</span>
+              <span class="m-row-t2">{{ theme.isDark() ? '已开启' : '已关闭' }}</span>
             </span>
             <button
               type="button"
@@ -160,6 +118,48 @@ import { UiMDialog } from '../../../ui/mobile/components/dialog/dialog';
           </div>
         </div>
       </section>
+      <section class="m-section">
+        <h2 class="m-section-title">账号</h2>
+        <ul class="m-list">
+          <!--
+            访问 Token(2026-11-04 对齐 PC):可显示/隐藏 + 复制。
+            默认脱敏,避免误拍屏泄漏;显示后可直接复制用于排障或换设备登录。
+          -->
+          <li class="m-token-row">
+            <span class="m-row-body">
+              <span class="m-row-t1">访问 Token</span>
+              <span class="m-row-t2 m-token-value" [class.m-token--masked]="!tokenShown()">
+                {{ tokenShown() ? tokenText() : maskToken() }}
+              </span>
+            </span>
+            <button
+              type="button"
+              class="m-token-btn"
+              [attr.aria-label]="tokenShown() ? '隐藏 Token' : '显示 Token'"
+              (click)="tokenShown.set(!tokenShown())"
+            >
+              <i [class]="tokenShown() ? 'fa-solid fa-eye-slash' : 'fa-solid fa-eye'" aria-hidden="true"></i>
+            </button>
+            <button
+              type="button"
+              class="m-token-btn"
+              aria-label="复制 Token"
+              [disabled]="!tokenShown()"
+              (click)="copyToken()"
+            >
+              <i [class]="copied() ? 'fa-solid fa-check' : 'fa-solid fa-copy'" aria-hidden="true"></i>
+            </button>
+          </li>
+          <li>
+            <button type="button" class="m-row" (click)="logoutOpen.set(true)">
+              <span class="m-row-body">
+                <span class="m-row-t1 m-danger">退出登录</span>
+              </span>
+              <i class="fa-solid fa-chevron-right m-chev" aria-hidden="true"></i>
+            </button>
+          </li>
+        </ul>
+      </section>
       </div>
     </div>
 
@@ -216,7 +216,7 @@ import { UiMDialog } from '../../../ui/mobile/components/dialog/dialog';
         border: 1px solid var(--edge);
         border-radius: var(--r-lg);
         background: var(--surface);
-        box-shadow: var(--shadow-soft);
+        box-shadow: none;
       }
       .m-profile {
         display: flex;
@@ -304,8 +304,8 @@ import { UiMDialog } from '../../../ui/mobile/components/dialog/dialog';
         display: grid;
         place-items: center;
         flex: none;
-        width: 32px;
-        height: 32px;
+        width: var(--touch-min);
+        height: var(--touch-min);
         border: 0;
         border-radius: var(--r-sm);
         background: none;
@@ -334,10 +334,11 @@ import { UiMDialog } from '../../../ui/mobile/components/dialog/dialog';
       }
       .m-palette-grid {
         display: grid;
-        grid-template-columns: repeat(4, 1fr);
+        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
         gap: var(--sp-2);
       }
       .m-palette {
+        min-width: 0;
         display: flex;
         flex-direction: column;
         align-items: center;
@@ -348,7 +349,7 @@ import { UiMDialog } from '../../../ui/mobile/components/dialog/dialog';
         background: var(--surface);
         color: var(--ink-2);
         font: inherit;
-        font-size: var(--fs-11);
+        font-size: var(--fs-12);
         cursor: pointer;
       }
       .m-palette.on {
@@ -387,17 +388,24 @@ import { UiMDialog } from '../../../ui/mobile/components/dialog/dialog';
         position: relative;
         flex: none;
         width: 48px;
-        height: 28px;
+        height: var(--touch-min);
         border: 0;
         border-radius: var(--r-tag);
-        background: var(--surface-active);
+        background: transparent;
         cursor: pointer;
         transition: background var(--motion-fast) var(--ease-standard);
       }
+      .m-switch::before {
+        content: '';
+        position: absolute;
+        inset: 8px 0;
+        border-radius: var(--r-tag);
+        background: var(--surface-active);
+      }
       .m-switch::after {
         content: '';
         position: absolute;
-        top: 3px;
+        top: 11px;
         left: 3px;
         width: 22px;
         height: 22px;
@@ -406,7 +414,7 @@ import { UiMDialog } from '../../../ui/mobile/components/dialog/dialog';
         box-shadow: var(--shadow-soft);
         transition: transform var(--motion-fast) var(--ease-standard);
       }
-      .m-switch[aria-checked='true'] {
+      .m-switch[aria-checked='true']::before {
         background: var(--primary);
       }
       .m-switch[aria-checked='true']::after {
@@ -425,6 +433,7 @@ import { UiMDialog } from '../../../ui/mobile/components/dialog/dialog';
       .m-slider {
         width: 100%;
         margin-top: var(--sp-2);
+        min-height: var(--touch-min);
         accent-color: var(--primary);
       }
     `

+ 8 - 4
src/app/mobile/pages/workbench/workbench.ts

@@ -177,7 +177,7 @@ import { LockScrollDirective } from '../../directives/lock-scroll.directive';
       }
       .m-stat-label {
         color: var(--muted);
-        font-size: var(--fs-11);
+        font-size: var(--fs-12);
       }
       .m-stat-value {
         color: var(--ink);
@@ -188,12 +188,12 @@ import { LockScrollDirective } from '../../directives/lock-scroll.directive';
         color: var(--success);
       }
       .m-stat-value--warn {
-        color: var(--danger);
+        color: var(--ink-2);
       }
       .m-blocked {
         margin-bottom: var(--sp-3);
         padding: var(--sp-3);
-        border: 1px solid var(--danger);
+        border: 1px solid transparent;
         border-radius: var(--r-md);
         background: var(--danger-subtle);
       }
@@ -210,6 +210,7 @@ import { LockScrollDirective } from '../../directives/lock-scroll.directive';
         align-items: center;
         gap: var(--sp-2);
         width: 100%;
+        min-height: var(--touch-min);
         padding: var(--sp-2) 0;
         border: 0;
         background: none;
@@ -244,7 +245,10 @@ import { LockScrollDirective } from '../../directives/lock-scroll.directive';
          * 🔴 顶部间距要够(2026-11-04):搜索框与下方统计卡之间只留 sp-2 时,
          *    深色模式下两块几乎粘在一起、分不出层次。改为 sp-4。
          */
-        padding: var(--sp-4) var(--mob-gutter) 0;
+        padding: var(--sp-4) var(--mob-gutter) var(--sp-6);
+      }
+      .m-body > app-m-life-card + app-m-life-card {
+        margin-top: var(--sp-3);
       }
       .m-fab {
         display: grid;

+ 8 - 0
src/app/mobile/presentation.ts

@@ -0,0 +1,8 @@
+import { LivenessView } from '../core/agent-liveness';
+import { SemanticTone } from '../core/api/models';
+
+/** 移动端只降低离线状态的视觉强调,不改状态判据与文案。 */
+export function mobilePresenceTone(view: LivenessView): SemanticTone {
+  if (view.offlineBecause === 'heartbeat-expired' || view.offlineBecause === 'stopped') return 'neutral';
+  return view.tone;
+}

+ 1 - 1
src/app/mobile/shell/mobile-shell.ts

@@ -162,7 +162,7 @@ interface TabDef {
         background: none;
         color: var(--muted);
         font: inherit;
-        font-size: var(--fs-11);
+        font-size: var(--fs-12);
         cursor: pointer;
         transition: color var(--motion-fast) var(--ease-standard);
       }

+ 1 - 1
src/styles.scss

@@ -74,4 +74,4 @@ body:has(.m-sheet-root) .m-tabbar {
 
 /* 全局字号缩放:ChatFontService 写 --ui-scale(16px=1.0),此处乘上;只乘字号不乘间距(覆盖底座生成物,ADR-006)。
    档位口径与 _base.scss 一致:--fs-XX 的数字 = 该档未缩放前的 px 值。 */
-:root { --fs-9: calc(10.5px * var(--ui-scale, 1)); --fs-10: calc(11px * var(--ui-scale, 1)); --fs-11: calc(11.5px * var(--ui-scale, 1)); --fs-12: calc(12px * var(--ui-scale, 1)); --fs-13: calc(13px * var(--ui-scale, 1)); --fs-135: calc(13.5px * var(--ui-scale, 1)); --fs-14: calc(14px * var(--ui-scale, 1)); --fs-15: calc(15px * var(--ui-scale, 1)); --fs-17: calc(17px * var(--ui-scale, 1)); }
+:root { --fs-16: calc(16px * var(--ui-scale, 1)); --fs-18: calc(18px * var(--ui-scale, 1)); --fs-9: calc(10.5px * var(--ui-scale, 1)); --fs-10: calc(11px * var(--ui-scale, 1)); --fs-11: calc(11.5px * var(--ui-scale, 1)); --fs-12: calc(12px * var(--ui-scale, 1)); --fs-13: calc(13px * var(--ui-scale, 1)); --fs-135: calc(13.5px * var(--ui-scale, 1)); --fs-14: calc(14px * var(--ui-scale, 1)); --fs-15: calc(15px * var(--ui-scale, 1)); --fs-17: calc(17px * var(--ui-scale, 1)); }

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels