index.html 120 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665
  1. <!doctype html>
  2. <html lang="zh-CN" data-palette="platinum">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover">
  6. <meta name="color-scheme" content="light dark">
  7. <meta name="description" content="Fmode 套餐与异步开通交互原型。全部状态均为本地演示,不连接平台、不创建容器、不付款。">
  8. <title>Fmode · 套餐与开通交互原型</title>
  9. <style>/* ============================================================
  10. * UI-Kit Design System
  11. * Tailwind CSS v3 + 语义化设计 token
  12. * 所有可切换的运行时变量都以 CSS 自定义属性定义在 :root / .dark /
  13. * [data-accent="..."] 上,组件模板通过 Tailwind 工具类引用它们;
  14. * token → 工具类 的映射见根目录 tailwind.config.js。
  15. * ============================================================ */
  16. /* ------------------------------------------------------------
  17. * 2. 亮色模式(默认)
  18. * ------------------------------------------------------------ */
  19. :root {
  20. color-scheme: light;
  21. --canvas: #f6f7f9;
  22. --surface: #ffffff;
  23. --surface-2: #f1f3f6;
  24. --surface-hover: #f6f7f9;
  25. --surface-active: #eef1f5;
  26. --edge: #e4e7ec;
  27. --edge-strong: #cbd2da;
  28. /* 文字层级全部对白底达到 WCAG AA 4.5:1:
  29. ink ≈14.7:1 / ink-2 ≈8.0:1 / muted ≈4.8:1。
  30. ⚠️ faint 为 #9aa1ac(≈2.6:1),**仅限装饰**——
  31. 分隔线、图标底、占位图形;禁止用于任何承载信息的文字。 */
  32. --ink: #1f2733;
  33. --ink-2: #4a5568;
  34. --muted: #6b7280;
  35. --faint: #9aa1ac;
  36. --inverse: #ffffff;
  37. /* 强调色:靛蓝。避开 Tailwind 默认蓝(#2563eb)的"模板感" */
  38. --primary: #3b5bdb;
  39. --primary-hover: #3450c4;
  40. --primary-active: #2c44a8;
  41. --primary-subtle: #eef1fd;
  42. --primary-content: #ffffff;
  43. --primary-ring: rgb(59 91 219 / 0.35);
  44. /* 语义色:一律"深字 + 浅底",保证小字标签也能过 AA */
  45. --success: #047857;
  46. --success-subtle: #e7f5ef;
  47. --danger: #b91c1c;
  48. --danger-subtle: #fdecec;
  49. --warning: #a04b08;
  50. --warning-subtle: #fdf1dc;
  51. --info: #0369a1;
  52. --info-subtle: #e6f2fa;
  53. /* 阴影(对齐 tailwind.config boxShadow.soft,供 SCSS 组件内联引用) */
  54. --shadow-soft: 0 1px 2px rgb(15 23 42 / 0.04), 0 4px 12px rgb(15 23 42 / 0.06);
  55. }
  56. /* ------------------------------------------------------------
  57. * 4. 浮层层级体系(z-index token,由低到高)
  58. * 所有浮层组件统一引用,禁止再写散落的 z-40/z-50 魔数:
  59. * - affix 吸顶/吸底元素
  60. * - float 悬浮按钮(back-top / tabbar / floating-bubble 等)
  61. * - mask 局部点击遮罩(popconfirm / select / cascader / time-picker /
  62. * data-table 列设置与筛选 / 横向 menu 的收起遮罩)
  63. * - popover 局部浮层面板(dropdown / tooltip / select / date-picker /
  64. * cascader / autocomplete / time-picker 面板、popconfirm 气泡等)
  65. * - modal 全屏弹层遮罩+面板(modal / drawer / 移动端弹层),
  66. * 多个同时打开时由 OverlayStackService 在上层动态递增
  67. * - context-menu 右键菜单
  68. * - palette 命令面板全屏遮罩
  69. * - toast 全局消息,永远最高
  70. * 层级关系:页面内容 < affix < float < mask < popover < modal <
  71. * context-menu < palette < toast。
  72. * 注意:popover < modal,因此 modal 打开时页面上的局部浮层不会穿透;
  73. * modal 内部的浮层则由 modal 面板的 stacking context 兜底,正常显示在其上。
  74. * ------------------------------------------------------------ */
  75. :root {
  76. /* 浮层层级体系(从低到高,保证浮层永远盖住页面内容) */
  77. --z-affix: 900; /* 固钉 / 回到顶部 */
  78. --z-float: 950; /* 悬浮按钮 / 悬浮气泡 */
  79. --z-mask: 980; /* 透明遮罩 */
  80. --z-popover: 1000; /* 气泡 / 下拉 / 选择器 / 日期面板 / 气泡确认 */
  81. --z-modal: 1100; /* 抽屉 / 对话框 */
  82. --z-context-menu: 1150;/* 右键菜单 */
  83. --z-palette: 1200; /* 命令面板 */
  84. --z-preview: 1300; /* 图片预览灯箱 */
  85. --z-toast: 1400; /* 全局消息通知(最高) */
  86. }
  87. /* ------------------------------------------------------------
  88. * 3. 暗色模式(<html class="dark">)
  89. * ------------------------------------------------------------ */
  90. .dark {
  91. color-scheme: dark;
  92. --canvas: #16181d;
  93. --surface: #1e2128;
  94. --surface-2: #272b33;
  95. --surface-hover: #272b33;
  96. --surface-active: #333842;
  97. --edge: #2e333c;
  98. --edge-strong: #454b56;
  99. --ink: #f2f4f7;
  100. --ink-2: #c9cfd8;
  101. --muted: #98a1ad;
  102. --faint: #6b727d;
  103. --inverse: #16181d;
  104. --primary: #7b93ff;
  105. --primary-hover: #94a8ff;
  106. --primary-active: #5c78e8;
  107. --primary-subtle: rgb(123 147 255 / 0.16);
  108. --primary-content: #14161b;
  109. --primary-ring: rgb(123 147 255 / 0.4);
  110. --success: #34d399;
  111. --success-subtle: rgb(52 211 153 / 0.14);
  112. --danger: #f87171;
  113. --danger-subtle: rgb(248 113 113 / 0.14);
  114. --warning: #fbbf24;
  115. --warning-subtle: rgb(251 191 36 / 0.14);
  116. --info: #38bdf8;
  117. --info-subtle: rgb(56 189 248 / 0.14);
  118. }
  119. /* ------------------------------------------------------------
  120. * 4. 主题色(accent)切换:覆盖 --primary 系列变量
  121. * 亮/暗各一套。data-accent 由 ThemeService 写到 <html> 上。
  122. * ------------------------------------------------------------ */
  123. [data-accent='violet'] {
  124. --primary: #7c3aed;
  125. --primary-hover: #6d28d9;
  126. --primary-active: #5b21b6;
  127. --primary-subtle: #f0ebfe;
  128. --primary-ring: rgb(124 58 237 / 0.35);
  129. }
  130. .dark[data-accent='violet'] {
  131. --primary: #8b5cf6;
  132. --primary-hover: #a78bfa;
  133. --primary-active: #7c3aed;
  134. --primary-subtle: rgb(139 92 246 / 0.16);
  135. --primary-ring: rgb(139 92 246 / 0.4);
  136. }
  137. [data-accent='emerald'] {
  138. --primary: #059669;
  139. --primary-hover: #047857;
  140. --primary-active: #065f46;
  141. --primary-subtle: #e7f6ef;
  142. --primary-ring: rgb(5 150 105 / 0.35);
  143. }
  144. .dark[data-accent='emerald'] {
  145. --primary: #10b981;
  146. --primary-hover: #34d399;
  147. --primary-active: #059669;
  148. --primary-subtle: rgb(16 185 129 / 0.16);
  149. --primary-ring: rgb(16 185 129 / 0.4);
  150. }
  151. [data-accent='rose'] {
  152. --primary: #e11d48;
  153. --primary-hover: #be123c;
  154. --primary-active: #9f1239;
  155. --primary-subtle: #fde8ee;
  156. --primary-ring: rgb(225 29 72 / 0.35);
  157. }
  158. .dark[data-accent='rose'] {
  159. --primary: #f43f5e;
  160. --primary-hover: #fb7185;
  161. --primary-active: #e11d48;
  162. --primary-subtle: rgb(244 63 94 / 0.16);
  163. --primary-ring: rgb(244 63 94 / 0.4);
  164. }
  165. [data-accent='amber'] {
  166. --primary: #d97706;
  167. --primary-hover: #b45309;
  168. --primary-active: #92400e;
  169. --primary-subtle: #fdf1dc;
  170. --primary-ring: rgb(217 119 6 / 0.35);
  171. }
  172. .dark[data-accent='amber'] {
  173. --primary: #f59e0b;
  174. --primary-hover: #fbbf24;
  175. --primary-active: #d97706;
  176. --primary-subtle: rgb(245 158 11 / 0.16);
  177. --primary-ring: rgb(245 158 11 / 0.4);
  178. }
  179. [data-accent='cyan'] {
  180. --primary: #0891b2;
  181. --primary-hover: #0e7490;
  182. --primary-active: #155e75;
  183. --primary-subtle: #e0f6fb;
  184. --primary-ring: rgb(8 145 178 / 0.35);
  185. }
  186. .dark[data-accent='cyan'] {
  187. --primary: #06b6d4;
  188. --primary-hover: #22d3ee;
  189. --primary-active: #0891b2;
  190. --primary-subtle: rgb(6 182 212 / 0.16);
  191. --primary-ring: rgb(6 182 212 / 0.4);
  192. }
  193. /* ------------------------------------------------------------
  194. * 5. 基础(base)样式
  195. * ------------------------------------------------------------ */
  196. @layer base {
  197. * {
  198. border-color: var(--edge);
  199. }
  200. html {
  201. scroll-behavior: smooth;
  202. -webkit-tap-highlight-color: transparent;
  203. }
  204. body {
  205. background-color: var(--canvas);
  206. color: var(--ink);
  207. /* Inter 优先(行业标配数字界面字体),本机没有则优雅回退到系统字体栈 */
  208. font-family:
  209. 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue',
  210. Arial, 'Noto Sans', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  211. font-size: 16px;
  212. line-height: 1.6;
  213. -webkit-font-smoothing: antialiased;
  214. -moz-osx-font-smoothing: grayscale;
  215. }
  216. /* 全局可见焦点环(键盘导航可达性) */
  217. :focus-visible {
  218. outline: 2px solid var(--primary-ring);
  219. outline-offset: 2px;
  220. }
  221. ::selection {
  222. background-color: var(--primary);
  223. color: var(--primary-content);
  224. }
  225. /* 滚动条 */
  226. ::-webkit-scrollbar {
  227. width: 10px;
  228. height: 10px;
  229. }
  230. ::-webkit-scrollbar-track {
  231. background: transparent;
  232. }
  233. ::-webkit-scrollbar-thumb {
  234. background: var(--edge-strong);
  235. border-radius: 9999px;
  236. border: 2px solid var(--canvas);
  237. }
  238. ::-webkit-scrollbar-thumb:hover {
  239. background: var(--muted);
  240. }
  241. }
  242. /* ============================================================
  243. * 主题切换动画(View Transitions API)
  244. * 关闭浏览器默认的根快照动画,改由 ThemeService 通过 Web Animations
  245. * 控制 ::view-transition-new(root) / old(root):
  246. * - circle:以触发按钮为圆心的向外扩散
  247. * - wave :从左往右的波浪式扫过
  248. * - fade :平滑淡入淡出
  249. * - zoom :缩放聚焦
  250. * ============================================================ */
  251. ::view-transition-old(root),
  252. ::view-transition-new(root) {
  253. animation: none;
  254. mix-blend-mode: normal;
  255. }
  256. /* ============================================================
  257. * 后台管理系统辅助模式(灰阶 / 色弱)
  258. * 应用在 <html> 根元素上,而非局部容器:
  259. * 若加在容器上,filter 会创建新的包含块,导致内部 position:fixed
  260. * 浮层(抽屉/对话框/下拉面板)定位错乱。根元素上则不影响任何浮层。
  261. * ============================================================ */
  262. html.ui-admin-gray {
  263. filter: grayscale(1);
  264. }
  265. html.ui-admin-color-weak {
  266. filter: invert(0.8) hue-rotate(180deg);
  267. }
  268. /* ============================================================
  269. * 浮层层级体系(统一 z-index,保证浮层永远在最上层)
  270. * - 900 回到顶部
  271. * - 1000 气泡/下拉/选择器/日期面板(触发器上的悬浮层)
  272. * - 1100 抽屉/对话框/右键菜单
  273. * - 1200 命令面板
  274. * - 1300 图片预览灯箱
  275. * ============================================================ */
  276. /* ============================================================
  277. * 6. 学员端增量令牌段(D11 · 自 demo/assets/css/tokens.css 移植)
  278. * ------------------------------------------------------------
  279. * ⚠️ 纯追加:只定义新名字,不覆盖既有令牌 → 管理端零影响。
  280. * 冲突名处理:
  281. * - --surface 已被 ui-kit 占用(卡片面 #fff),demo 的「输入底/次级面」
  282. * 更名为 --well;
  283. * - --ink 两库值近似(#1f2733 vs #1C1E21),沿用 ui-kit 原值不重定义。
  284. * 暗色跟随 ui-kit 既有机制:html.dark 类(ThemeService 单写入);
  285. * accent 走 [data-accent],新增 cobalt/green/indigo 三名并同步
  286. * 映射 --primary 系列(管理端主题选择器选中新色时依然可用)。
  287. * data-font/data-radius/data-density/data-motion 变体在应用侧
  288. * (apps/web/src/styles/learner-tokens.css),不进底座。
  289. * ============================================================ */
  290. :root {
  291. /* 字体栈(学员端;中文优先) */
  292. --font-ui: "PingFang SC", "Noto Sans SC", "HarmonyOS Sans SC", "Microsoft YaHei",
  293. -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  294. /* 字号 12 级 */
  295. --fs-9: 10.5px; --fs-10: 11px; --fs-11: 11.5px; --fs-12: 12px;
  296. --fs-13: 13px; --fs-135: 13.5px; --fs-15: 15px; --fs-17: 17px;
  297. --fs-20: 20px; --fs-26: 26px; --fs-30: 30px; --fs-42: 42px;
  298. /* 间距 */
  299. --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
  300. --sp-5: 20px; --sp-6: 24px; --sp-8: 32px;
  301. /* 圆角 */
  302. --r-tag: 999px;
  303. --r-sm: 11px; /* 小件:图标块 / 引文 */
  304. --r-md: 14px; /* 输入 / 小卡 */
  305. --r-lg: 18px; /* 任务条 / 记录条 */
  306. --r-xl: 20px; /* 场景卡 / 卡片 */
  307. --r-2xl: 24px; /* 报告大卡 */
  308. --r-sheet: 32px;/* 底部抽屉 */
  309. /* 墨色五级(新名,不覆盖 ui-kit --ink/--ink-2/--muted) */
  310. --ink-deep: #0A1317; /* 近黑:选中底 / 深色 CTA */
  311. --charcoal: #444950; /* 次文本 */
  312. --steel: #5D6C7B; /* 三级文本 / 图标 */
  313. --stone: #8595A4; /* 弱文本 */
  314. --hairline: #CED0D4; /* 控件描边 */
  315. --line: #DEE3E9; /* 卡片描边 / 分隔 */
  316. --well: #F1F4F7; /* 输入底 / 次级面(demo --surface 改名) */
  317. --card: #FFFFFF;
  318. --page: #FFFFFF; /* 学员端页面底 */
  319. --sel-bg: #0A1317; --sel-fg: #FFFFFF; /* tab/chip 选中(暗色下反转) */
  320. --overlay: rgba(10, 19, 23, .5);
  321. --overlay-strong: rgba(10, 19, 23, .86); /* 灯箱专用深色遮罩 */
  322. --on-overlay: #ffffff; --on-overlay-soft: rgb(255 255 255 / .14); --on-overlay-hover: rgb(255 255 255 / .24);
  323. --sheet-shadow: 0 -12px 40px rgba(10, 19, 23, .18);
  324. --shadow-card: 0 1px 2px rgba(10, 19, 23, .04);
  325. /* 毛玻璃(底部导航 / 悬浮工具条) */
  326. --glass: rgba(255, 255, 255, .72);
  327. --glass-strong: rgba(255, 255, 255, .86);
  328. --glass-border: rgba(10, 19, 23, .08);
  329. --glass-shadow: 0 8px 30px rgba(10, 19, 23, .14);
  330. --glass-tint: rgba(10, 19, 23, .34);
  331. /* 语义色(v2 原值) */
  332. --ok: #31A24C; --ok-bg: #EAF7EF; --ok-ink: #1F7A38;
  333. --warn-ink: #B26A00; --warn-bg: #FEF6E6;
  334. --crit: #E41E3F; --crit-ink: #C81836; --crit-soft: #FDECEF;
  335. --info-bg: #E7F0FD;
  336. /* 强调色(默认 cobalt) */
  337. --accent: #0064E0; --accent-deep: #0457CB;
  338. --accent-soft: #E7F0FD; --accent-tint: #F0F7FF;
  339. /* 「压在实色上」的前景色 —— 独立评审 A-7:此前这几处散落 #fff 字面量。
  340. 单开语义位而不是复用 --surface:后者在暗色下会翻成深色,而这几个前景
  341. 必须始终是与底色拉开对比的那一头。 */
  342. --accent-fg: #FFFFFF;
  343. --crit-fg: #FFFFFF;
  344. --switch-knob: #FFFFFF;
  345. /* 毛玻璃药丸顶部高光的渐变起点(暗色下要弱得多,故必须进令牌) */
  346. --glass-sheen: rgba(255, 255, 255, .42);
  347. /* 氛围背景的第二、三团柔光的色相 —— 与主题色无关(不随 accent / 明暗变化,
  348. 暗色只压透明度),但仍是色值,按规范收进令牌而非留在组件里 */
  349. --bgfx-teal: rgba(94, 234, 212, .35);
  350. --bgfx-violet: rgba(167, 139, 250, .28);
  351. /* 图表(8 色,亮) */
  352. --chart-1: #0064E0; --chart-2: #31A24C; --chart-3: #B26A00; --chart-4: #E41E3F;
  353. --chart-5: #0E9DD7; --chart-6: #7857FF; --chart-7: #0E9384; --chart-8: #5D6C7B;
  354. --chart-grid: #DEE3E9; --chart-axis: #8595A4; --chart-area: rgba(0, 100, 224, .16);
  355. }
  356. /* ---- 暗色(跟随 html.dark,ThemeService 单写入) ---- */
  357. .dark {
  358. --ink-deep: #F5F6F7;
  359. --charcoal: #D3D5DA;
  360. --steel: #98A0AA;
  361. --stone: #6C7480;
  362. --hairline: #3A3E45;
  363. --line: #2C2F35;
  364. --well: #1C1E21;
  365. --card: #1C1E21;
  366. --page: #000000;
  367. --sel-bg: #F5F5F7; --sel-fg: #0A1317;
  368. --overlay: rgba(0, 0, 0, .6);
  369. --sheet-shadow: 0 -12px 40px rgba(0, 0, 0, .5);
  370. --shadow-card: 0 1px 2px rgba(0, 0, 0, .3);
  371. --glass: rgba(28, 30, 33, .72);
  372. --glass-strong: rgba(28, 30, 33, .88);
  373. --glass-border: rgba(255, 255, 255, .09);
  374. --glass-shadow: 0 8px 30px rgba(0, 0, 0, .5);
  375. --glass-tint: rgba(255, 255, 255, .13);
  376. --ok: #30D158; --ok-bg: rgba(48, 209, 88, .15); --ok-ink: #5BD677;
  377. --warn-ink: #FFB340; --warn-bg: rgba(255, 179, 64, .14);
  378. --crit: #FF453A; --crit-ink: #FF6961; --crit-soft: rgba(255, 69, 58, .15);
  379. --info-bg: rgba(41, 151, 255, .16);
  380. --accent: #2997FF; --accent-deep: #5CB3FF;
  381. --accent-soft: rgba(41, 151, 255, .17); --accent-tint: rgba(41, 151, 255, .09);
  382. /* 暗色下这三处仍是白(底色 accent/crit 在暗色里更亮,白字对比反而更好) */
  383. --accent-fg: #FFFFFF;
  384. --crit-fg: #FFFFFF;
  385. --switch-knob: #FFFFFF;
  386. --glass-sheen: rgba(255, 255, 255, .09);
  387. --chart-1: #2997FF; --chart-2: #30D158; --chart-3: #FFB340; --chart-4: #FF6961;
  388. --chart-5: #64D2FF; --chart-6: #A78BFF; --chart-7: #66D4CF; --chart-8: #98A0AA;
  389. --chart-grid: #2C2F35; --chart-axis: #6C7480; --chart-area: rgba(41, 151, 255, .2);
  390. }
  391. /* ---- 新增 accent:cobalt(显式规则兜底) ---- */
  392. :root[data-accent='cobalt'] {
  393. --accent: #0064E0; --accent-deep: #0457CB; --accent-soft: #E7F0FD; --accent-tint: #F0F7FF;
  394. --chart-1: #0064E0; --chart-area: rgba(0, 100, 224, .16);
  395. --primary: #0064E0; --primary-hover: #0457CB; --primary-active: #0448a8;
  396. --primary-subtle: #E7F0FD; --primary-ring: rgb(0 100 224 / .35);
  397. }
  398. .dark[data-accent='cobalt'] {
  399. --accent: #2997FF; --accent-deep: #5CB3FF; --accent-soft: rgba(41, 151, 255, .17); --accent-tint: rgba(41, 151, 255, .09);
  400. --chart-1: #2997FF; --chart-area: rgba(41, 151, 255, .2);
  401. --primary: #2997FF; --primary-hover: #5CB3FF; --primary-active: #0064E0;
  402. --primary-subtle: rgb(41 151 255 / .16); --primary-ring: rgb(41 151 255 / .4);
  403. }
  404. /* ---- 新增 accent:green ---- */
  405. :root[data-accent='green'] {
  406. --accent: #1F8A3B; --accent-deep: #15702F; --accent-soft: #E4F6E9; --accent-tint: #F0FBF3;
  407. --chart-1: #1F8A3B; --chart-area: rgba(31, 138, 59, .16);
  408. --primary: #1F8A3B; --primary-hover: #15702F; --primary-active: #0f5a26;
  409. --primary-subtle: #E4F6E9; --primary-ring: rgb(31 138 59 / .35);
  410. }
  411. .dark[data-accent='green'] {
  412. --accent: #30D158; --accent-deep: #69DE85; --accent-soft: rgba(48, 209, 88, .16); --accent-tint: rgba(48, 209, 88, .09);
  413. --chart-1: #30D158; --chart-area: rgba(48, 209, 88, .2);
  414. --primary: #30D158; --primary-hover: #69DE85; --primary-active: #1F8A3B;
  415. --primary-subtle: rgb(48 209 88 / .16); --primary-ring: rgb(48 209 88 / .4);
  416. }
  417. /* ---- 新增 accent:indigo ---- */
  418. :root[data-accent='indigo'] {
  419. --accent: #5856D6; --accent-deep: #4442BE; --accent-soft: #ECEBFC; --accent-tint: #F4F3FE;
  420. --chart-1: #5856D6; --chart-area: rgba(88, 86, 214, .16);
  421. --primary: #5856D6; --primary-hover: #4442BE; --primary-active: #3836a3;
  422. --primary-subtle: #ECEBFC; --primary-ring: rgb(88 86 214 / .35);
  423. }
  424. .dark[data-accent='indigo'] {
  425. --accent: #7D7AFF; --accent-deep: #9B99FF; --accent-soft: rgba(125, 122, 255, .17); --accent-tint: rgba(125, 122, 255, .09);
  426. --chart-1: #7D7AFF; --chart-area: rgba(125, 122, 255, .2);
  427. --primary: #7D7AFF; --primary-hover: #9B99FF; --primary-active: #5856D6;
  428. --primary-subtle: rgb(125 122 255 / .17); --primary-ring: rgb(125 122 255 / .4);
  429. }
  430. /* ---- amber/rose 补 accent 系令牌(demo 五套主题色的剩余两套) ---- */
  431. :root[data-accent='amber'] {
  432. --accent: #B26A00; --accent-deep: #8F5400; --accent-soft: #FDF0DA; --accent-tint: #FEF8EE;
  433. --chart-1: #B26A00; --chart-area: rgba(178, 106, 0, .16);
  434. }
  435. .dark[data-accent='amber'] {
  436. --accent: #FFB340; --accent-deep: #FFC666; --accent-soft: rgba(255, 179, 64, .16); --accent-tint: rgba(255, 179, 64, .09);
  437. --chart-1: #FFB340; --chart-area: rgba(255, 179, 64, .2);
  438. }
  439. :root[data-accent='rose'] {
  440. --accent: #D8264A; --accent-deep: #B01B3B; --accent-soft: #FCE7EB; --accent-tint: #FEF2F4;
  441. --chart-1: #D8264A; --chart-area: rgba(216, 38, 74, .15);
  442. }
  443. .dark[data-accent='rose'] {
  444. --accent: #FF6961; --accent-deep: #FF8B85; --accent-soft: rgba(255, 105, 97, .16); --accent-tint: rgba(255, 105, 97, .09);
  445. --chart-1: #FF6961; --chart-area: rgba(255, 105, 97, .2);
  446. }
  447. /* ---- blue/violet/emerald/cyan 的 --accent 映射(学员端组件引用 --accent* 时跟随切换) ---- */
  448. :root[data-accent='blue'], :root:not([data-accent]) {
  449. --accent: #3b5bdb; --accent-deep: #364fc7; --accent-soft: #e7edfb; --accent-tint: #f2f6fd;
  450. --chart-1: #3b5bdb; --chart-area: rgb(59 91 219 / .16);
  451. }
  452. .dark[data-accent='blue'], .dark:not([data-accent]) {
  453. --accent: #748ffc; --accent-deep: #91a7ff; --accent-soft: rgb(116 143 252 / .16); --accent-tint: rgb(116 143 252 / .09);
  454. --chart-1: #748ffc; --chart-area: rgb(116 143 252 / .2);
  455. }
  456. :root[data-accent='violet'] {
  457. --accent: #7c3aed; --accent-deep: #6d28d9; --accent-soft: #f0e9fd; --accent-tint: #f8f5fe;
  458. --chart-1: #7c3aed; --chart-area: rgb(124 58 237 / .16);
  459. }
  460. .dark[data-accent='violet'] {
  461. --accent: #a78bfa; --accent-deep: #c4b5fd; --accent-soft: rgb(167 139 250 / .16); --accent-tint: rgb(167 139 250 / .09);
  462. --chart-1: #a78bfa; --chart-area: rgb(167 139 250 / .2);
  463. }
  464. :root[data-accent='emerald'] {
  465. --accent: #059669; --accent-deep: #047857; --accent-soft: #e2f6ee; --accent-tint: #f0faf6;
  466. --chart-1: #059669; --chart-area: rgb(5 150 105 / .16);
  467. }
  468. .dark[data-accent='emerald'] {
  469. --accent: #34d399; --accent-deep: #6ee7b7; --accent-soft: rgb(52 211 153 / .16); --accent-tint: rgb(52 211 153 / .09);
  470. --chart-1: #34d399; --chart-area: rgb(52 211 153 / .2);
  471. }
  472. :root[data-accent='cyan'] {
  473. --accent: #0891b2; --accent-deep: #0e7490; --accent-soft: #e0f6fb; --accent-tint: #effbfe;
  474. --chart-1: #0891b2; --chart-area: rgb(8 145 178 / .16);
  475. }
  476. .dark[data-accent='cyan'] {
  477. --accent: #06b6d4; --accent-deep: #22d3ee; --accent-soft: rgb(6 182 212 / .16); --accent-tint: rgb(6 182 212 / .09);
  478. --chart-1: #06b6d4; --chart-area: rgb(6 182 212 / .2);
  479. }
  480. /* 基底令牌(原型 :root / midnight)+ 明暗模式 + 布局/动效/阴影
  481. 真源 styles.css:2-73 | 依据《设计令牌.md》v3.0 §三·§六·§七·§八·§九
  482. 说明:语义色跨配色固定,故在此定义(palette 只覆盖表面/导航/主色族)。
  483. 命名一律用 ui-kit 词汇(--canvas/--ink/--edge/--primary…),禁止自有前缀。*/
  484. :root {
  485. /* 表面与文字 */
  486. --canvas: #edf1f6; --surface: #ffffff; --surface-2: #f5f7fa; --surface-hover: #eaf0f7;
  487. --surface-active: #dfe6f0; --rail-surface: #f0f3f8;
  488. --edge: #dce3ed; --edge-strong: #c5d0df;
  489. --ink: #172337; --ink-2: #495b74; --muted: #61728a; --inverse: #ffffff;
  490. /* 语义色(跨配色固定)—— info 取原型值,非底座 #0369a1(评审 S2)
  491. --on-danger:danger 底上的文字色。暗色下 --danger 是浅粉,故文字须用深色 */
  492. --success: #207550; --success-subtle: #edf7f1;
  493. --warning: #91600e; --warning-subtle: #fff7e8;
  494. --danger: #c33f42; --danger-subtle: #fff0f0; --on-danger: #ffffff;
  495. --info: #315fa8; --info-subtle: #edf3fd;
  496. /* 主色(基底;4 套配色整体覆盖)—— --primary-ring 为推导值(原型未定义 focus 环) */
  497. --primary: #315acb; --primary-hover: #2548aa; --primary-active: #2548aa;
  498. --primary-subtle: #eaf0ff; --primary-content: #ffffff; --primary-ring: rgb(49 90 203 / .35);
  499. /* 导航族(随配色整套变化) */
  500. --nav-surface: #18243a; --nav-ink: #f3f6fc; --nav-text: #c4cfdf; --nav-muted: #9aadc8;
  501. --nav-line: #30405a; --nav-hover: #24334d; --nav-active: #2c4167;
  502. --nav-accent: #b4ccff; --nav-brand: #4269d8; --nav-on-brand: #ffffff;
  503. /* 辅助族 */
  504. --metric-fill: #5476ca;
  505. --avatar-ink: #46618c; --avatar-bg: #eaf0fa; --avatar-ink-alt: #596780; --avatar-bg-alt: #edf0f5;
  506. --neutral: #687385; --neutral-soft: #eff1f5;
  507. --overlay: #18223966; --overlay-strong: #182239d9;
  508. /* 深色遮罩上的前景色:明暗主题下都保持浅色(灯箱/全屏预览用) */
  509. --on-overlay: #ffffff;
  510. --on-overlay-soft: rgb(255 255 255 / .14);
  511. --on-overlay-hover: rgb(255 255 255 / .24);
  512. /* 字号:锁定 8 档(名称 = 底座,数值 = 原型) */
  513. --fs-11: 11px; --fs-12: 12px; --fs-13: 13px; --fs-14: 14px;
  514. --fs-15: 14px; --fs-17: 16px; --fs-20: 20px; --fs-26: 28px; --fs-42: 36px;
  515. /* 圆角:锁定 4 档 */
  516. --r-sm: 6px; --r-md: 10px; --r-lg: 16px; --r-tag: 999px;
  517. /* 动效(底座无此层,由原型引入) */
  518. --motion-fast: 120ms; --motion-page: 160ms; --motion-detail: 200ms;
  519. --motion-panel: 240ms; --motion-exit: 160ms;
  520. --ease-standard: cubic-bezier(.2, 0, 0, 1);
  521. /* 阴影四级(色基取原型,结构沿用底座;修复底座暗色不可见缺陷) */
  522. --shadow-soft: 0 1px 2px rgb(23 36 60 / .04), 0 4px 12px rgb(23 36 60 / .06);
  523. --shadow-card: 0 1px 2px rgb(23 36 60 / .05), 0 8px 24px rgb(23 36 60 / .07);
  524. --shadow-pop: 0 4px 8px rgb(23 36 60 / .08), 0 16px 32px rgb(23 36 60 / .12);
  525. --shadow-overlay: 0 8px 16px rgb(23 36 60 / .1), 0 24px 48px rgb(23 36 60 / .18);
  526. /* 布局令牌 —— 前缀用 --desk-/--mob-(--dk- 是存量禁用前缀);--desk-nav-w* 已随竖栏废弃 */
  527. --desk-topbar-h: 56px; --desk-tree-w: 280px; --desk-nav-w: 200px; --desk-nav-w-compact: 176px; --desk-nav-w-icon: 72px;
  528. --desk-list-w: 274px; --desk-list-w-compact: 244px; --desk-list-w-narrow: 250px;
  529. --desk-main-min-w: 480px; --desk-aside-w: 320px; --desk-aside-w-compact: 300px;
  530. --mob-navbar-h: 60px; --mob-tabbar-h: 64px; --mob-gutter: 16px;
  531. --mob-safe-top: env(safe-area-inset-top, 0px);
  532. --mob-safe-bottom: env(safe-area-inset-bottom, 0px);
  533. --touch-min: 44px; /* 无障碍硬约束,非设计偏好 */
  534. /* 页面最大宽度(《双端布局规范》v2.1 §2.4)—— 窗口更宽时居中留白,避免超宽屏内容拉散 */
  535. --page-max-w: 1440px; /* 通用/仪表盘类 */
  536. --page-max-w-narrow: 980px; /* 阅读型(事件流) */
  537. --page-max-w-settings: 1240px; /* 设置页 */
  538. }
  539. /* 暗色:--inverse 与 --primary-content 同源统一(评审 A5) */
  540. .dark {
  541. --canvas: #11151c; --surface: #191f29; --surface-2: #1e2531; --surface-hover: #2a3342;
  542. --surface-active: #333c4c; --rail-surface: #141b26;
  543. --edge: #2d3747; --edge-strong: #414f65;
  544. --ink: #edf1f8; --ink-2: #b8c2d2; --muted: #98a6bc; --inverse: #14203b;
  545. --success: #8ed2ac; --success-subtle: #1d352c;
  546. --warning: #e8bf77; --warning-subtle: #382f22;
  547. --danger: #f2a0a5; --danger-subtle: #3b272f; --on-danger: #3b272f;
  548. --info: #acc9fa; --info-subtle: #273a55;
  549. --primary: #93b5ff; --primary-hover: #b0c9ff; --primary-active: #93b5ff;
  550. --primary-subtle: #253451; --primary-content: #14203b; --primary-ring: rgb(147 181 255 / .4);
  551. --nav-surface: #0c1320; --nav-hover: #1a2940; --nav-active: #243957; --nav-line: #25324a;
  552. --metric-fill: #a8c2ff;
  553. --avatar-ink: #b7cdf2; --avatar-bg: #2b3b56; --avatar-ink-alt: #bac7db; --avatar-bg-alt: #2d3748;
  554. --neutral: #acb7c9; --neutral-soft: #2b3341;
  555. --overlay: #070b12a6; --overlay-strong: #070b12e6;
  556. --on-overlay: #ffffff; --on-overlay-soft: rgb(255 255 255 / .14); --on-overlay-hover: rgb(255 255 255 / .24);
  557. --shadow-soft: 0 1px 2px rgb(0 0 0 / .3), 0 4px 12px rgb(0 0 0 / .28); --shadow-card: 0 1px 2px rgb(0 0 0 / .34), 0 8px 24px rgb(0 0 0 / .32);
  558. --shadow-pop: 0 4px 8px rgb(0 0 0 / .38), 0 16px 32px rgb(0 0 0 / .34); --shadow-overlay: 0 8px 16px rgb(0 0 0 / .42), 0 24px 48px rgb(0 0 0 / .4);
  559. }
  560. /* 四套「整体配色」· 应用层覆盖块(令牌数据,非业务样式)
  561. 真源 styles.css:116-195 | 依据 ADR-006 v2.0 §三 +《设计令牌.md》v3.0 §四
  562. 🔴 必须用 :root[data-palette] / .dark[data-palette](与底座同特异性,评审 G4)
  563. 语义色不在此:跨配色固定,定义在 styles.scss
  564. 🔑 同时命中 [data-preview-palette] —— 让「我的」页的配色缩略图能在各自作用域内
  565. 渲染出**该套配色自身**的 nav/content 色块(否则缩略图只显示当前配色,看不出差异)。*/
  566. /* ---------- platinum · 铂金曜黑(默认)---------- */
  567. :root[data-palette='platinum'],
  568. [data-preview-palette='platinum'] {
  569. --canvas: #f2f3f5; --surface: #ffffff; --surface-2: #f7f7f8; --surface-hover: #e9eaec;
  570. --rail-surface: #eceef0; --ink: #202124; --ink-2: #45474b; --muted: #62666d;
  571. --edge: #dfe1e4; --edge-strong: #c4c7cc;
  572. --primary: #25272a; --primary-hover: #111214; --primary-subtle: #e8e9eb; --primary-content: #ffffff;
  573. --nav-surface: #202124; --nav-ink: #f5f5f6; --nav-text: #c6c8cc; --nav-muted: #a9adb4;
  574. --nav-line: #393b3f; --nav-hover: #303236; --nav-active: #3b3d41;
  575. --nav-accent: #ffffff; --nav-brand: #f5f5f6; --nav-on-brand: #202124;
  576. --metric-fill: #6c737d;
  577. --avatar-ink: #565d67; --avatar-bg: #e9eaec; --avatar-ink-alt: #62666d; --avatar-bg-alt: #eeeff0;
  578. --neutral: #656a72; --neutral-soft: #eceef0;
  579. --overlay: #11121470; --overlay-strong: #111214d9; --shadow: 0 16px 56px #2021241f;
  580. }
  581. .dark[data-palette='platinum'],
  582. [data-preview-palette='platinum'][data-preview-theme='dark'] {
  583. --canvas: #18191b; --surface: #222426; --surface-2: #292b2e; --surface-hover: #383b3f;
  584. --rail-surface: #1d1f21; --ink: #f2f3f4; --ink-2: #c5c8cc; --muted: #a7abb1;
  585. --edge: #383b3f; --edge-strong: #565a60;
  586. --primary: #f1f2f3; --primary-hover: #ffffff; --primary-subtle: #373a3e; --primary-content: #202124;
  587. --nav-surface: #111214; --nav-ink: #f2f3f4; --nav-text: #c6c8cc; --nav-muted: #a4a8ae;
  588. --nav-line: #303236; --nav-hover: #25272a; --nav-active: #34373b;
  589. --nav-accent: #f1f2f3; --nav-brand: #f1f2f3; --nav-on-brand: #202124;
  590. --metric-fill: #c0c4ca;
  591. --avatar-ink: #c9cdd3; --avatar-bg: #373a3e; --avatar-ink-alt: #c5c8cd; --avatar-bg-alt: #393c40;
  592. --neutral: #bec2c8; --neutral-soft: #373a3e;
  593. --overlay: #08090bb0; --overlay-strong: #08090be6; --shadow: 0 18px 70px #00000066;
  594. }
  595. /* ---------- ice · 冰白靛蓝(导航为浅色)---------- */
  596. :root[data-palette='ice'],
  597. [data-preview-palette='ice'] {
  598. --canvas: #f6f8fc; --surface: #ffffff; --surface-2: #f1f4f9; --surface-hover: #e7ecf5;
  599. --rail-surface: #edf1f7; --ink: #202a3c; --ink-2: #46536b; --muted: #606e86;
  600. --edge: #dce2ec; --edge-strong: #c2ccdc;
  601. --primary: #4056c7; --primary-hover: #3045ae; --primary-subtle: #e8ecfb; --primary-content: #ffffff;
  602. --nav-surface: #e9edf5; --nav-ink: #202a3c; --nav-text: #394761; --nav-muted: #53617a;
  603. --nav-line: #d3dae7; --nav-hover: #dce3ef; --nav-active: #d9e1f2;
  604. --nav-accent: #4056c7; --nav-brand: #4056c7; --nav-on-brand: #ffffff;
  605. --metric-fill: #536ac9;
  606. --avatar-ink: #475b9a; --avatar-bg: #e6ebf7; --avatar-ink-alt: #55647f; --avatar-bg-alt: #e9edf3;
  607. --neutral: #626e83; --neutral-soft: #e9edf3;
  608. --overlay: #18243b66; --overlay-strong: #18243bd9; --shadow: 0 16px 56px #27354d1c;
  609. }
  610. .dark[data-palette='ice'],
  611. [data-preview-palette='ice'][data-preview-theme='dark'] {
  612. --canvas: #171b24; --surface: #202632; --surface-2: #272f3d; --surface-hover: #343f51;
  613. --rail-surface: #1b222e; --ink: #f0f3fa; --ink-2: #bec8d9; --muted: #a1aec3;
  614. --edge: #343e4f; --edge-strong: #515f76;
  615. --primary: #b4c2ff; --primary-hover: #cbd4ff; --primary-subtle: #303957; --primary-content: #1d2546;
  616. --nav-surface: #111722; --nav-ink: #f0f3fa; --nav-text: #c7d0e0; --nav-muted: #a6b3c9;
  617. --nav-line: #2b3546; --nav-hover: #212b3c; --nav-active: #2c3954;
  618. --nav-accent: #b4c2ff; --nav-brand: #b4c2ff; --nav-on-brand: #1d2546;
  619. --metric-fill: #acbcff;
  620. --avatar-ink: #becbfa; --avatar-bg: #2d3854; --avatar-ink-alt: #c1cce0; --avatar-bg-alt: #303a4c;
  621. --neutral: #bdc7d8; --neutral-soft: #303947;
  622. --overlay: #080c14b0; --overlay-strong: #080c14e6; --shadow: 0 18px 70px #00000066;
  623. }
  624. /* ---------- clay · 暖瓷陶橘 ---------- */
  625. :root[data-palette='clay'],
  626. [data-preview-palette='clay'] {
  627. --canvas: #f3f0eb; --surface: #fffdfa; --surface-2: #f7f3ee; --surface-hover: #ede7df;
  628. --rail-surface: #eee9e2; --ink: #2a2623; --ink-2: #514943; --muted: #70665f;
  629. --edge: #e2dbd3; --edge-strong: #cfc4b9;
  630. --primary: #af482b; --primary-hover: #92391f; --primary-subtle: #f6e8e1; --primary-content: #ffffff;
  631. --nav-surface: #302c29; --nav-ink: #f7f3ef; --nav-text: #d5cbc3; --nav-muted: #b9ada4;
  632. --nav-line: #49413c; --nav-hover: #403a35; --nav-active: #50453d;
  633. --nav-accent: #f1ad8e; --nav-brand: #f1ad8e; --nav-on-brand: #30211b;
  634. --metric-fill: #ad674d;
  635. --avatar-ink: #795643; --avatar-bg: #f0e7df; --avatar-ink-alt: #6d5d52; --avatar-bg-alt: #eee9e4;
  636. --neutral: #70665f; --neutral-soft: #eee9e4;
  637. --overlay: #211b1770; --overlay-strong: #211b17d9; --shadow: 0 16px 56px #38281e1c;
  638. }
  639. .dark[data-palette='clay'],
  640. [data-preview-palette='clay'][data-preview-theme='dark'] {
  641. --canvas: #1d1a18; --surface: #292522; --surface-2: #322d29; --surface-hover: #433a34;
  642. --rail-surface: #221f1c; --ink: #f3eee9; --ink-2: #d0c5bc; --muted: #b2a69c;
  643. --edge: #403832; --edge-strong: #5d5047;
  644. --primary: #f0a184; --primary-hover: #ffb89c; --primary-subtle: #49342c; --primary-content: #3b2119;
  645. --nav-surface: #171513; --nav-ink: #f3eee9; --nav-text: #d2c7be; --nav-muted: #afa197;
  646. --nav-line: #38302b; --nav-hover: #2b2521; --nav-active: #3c3029;
  647. --nav-accent: #f0a184; --nav-brand: #f0a184; --nav-on-brand: #3b2119;
  648. --metric-fill: #e09a7c;
  649. --avatar-ink: #e3b99c; --avatar-bg: #40332c; --avatar-ink-alt: #d7c2b2; --avatar-bg-alt: #3a332e;
  650. --neutral: #cec0b5; --neutral-soft: #39332e;
  651. --overlay: #0d0a08b0; --overlay-strong: #0d0a08e6; --shadow: 0 18px 70px #00000066;
  652. }
  653. /* ---------- slate · 岩灰鸢紫 ---------- */
  654. :root[data-palette='slate'],
  655. [data-preview-palette='slate'] {
  656. --canvas: #f1f0f5; --surface: #ffffff; --surface-2: #f6f5f9; --surface-hover: #eae8f0;
  657. --rail-surface: #eceaf1; --ink: #282633; --ink-2: #4c4a5d; --muted: #666476;
  658. --edge: #dfdde7; --edge-strong: #c7c3d2;
  659. --primary: #6952a3; --primary-hover: #55418b; --primary-subtle: #efebf8; --primary-content: #ffffff;
  660. --nav-surface: #282735; --nav-ink: #f4f2fa; --nav-text: #d1cde0; --nav-muted: #b2adc6;
  661. --nav-line: #403e50; --nav-hover: #373546; --nav-active: #48445d;
  662. --nav-accent: #c9baf1; --nav-brand: #c9baf1; --nav-on-brand: #302844;
  663. --metric-fill: #7a66ad;
  664. --avatar-ink: #655a91; --avatar-bg: #eeebf5; --avatar-ink-alt: #666174; --avatar-bg-alt: #efedf2;
  665. --neutral: #686678; --neutral-soft: #edecf1;
  666. --overlay: #201d2b70; --overlay-strong: #201d2bd9; --shadow: 0 16px 56px #2826331c;
  667. }
  668. .dark[data-palette='slate'],
  669. [data-preview-palette='slate'][data-preview-theme='dark'] {
  670. --canvas: #1b1a22; --surface: #26242f; --surface-2: #302d3b; --surface-hover: #413d50;
  671. --rail-surface: #211f29; --ink: #f2f0f8; --ink-2: #c9c5d7; --muted: #aaa6bc;
  672. --edge: #3d394a; --edge-strong: #5a556d;
  673. --primary: #c9baf1; --primary-hover: #dacff7; --primary-subtle: #3c354f; --primary-content: #302844;
  674. --nav-surface: #17161e; --nav-ink: #f2f0f8; --nav-text: #d0cce0; --nav-muted: #aaa5bf;
  675. --nav-line: #343141; --nav-hover: #282634; --nav-active: #383447;
  676. --nav-accent: #c9baf1; --nav-brand: #c9baf1; --nav-on-brand: #302844;
  677. --metric-fill: #c1b1ee;
  678. --avatar-ink: #c9bdf0; --avatar-bg: #373249; --avatar-ink-alt: #c9c2da; --avatar-bg-alt: #393644;
  679. --neutral: #c4bfd2; --neutral-soft: #383543;
  680. --overlay: #0c0b10b0; --overlay-strong: #0c0b10e6; --shadow: 0 18px 70px #00000066;
  681. }
  682. /* Review shell uses the application's real tokens; no production components change. */
  683. * { box-sizing: border-box; }
  684. [hidden] { display: none !important; }
  685. html { height: 100%; }
  686. body { margin: 0; min-width: 320px; height: 100dvh; display: grid; grid-template-rows: auto minmax(0,1fr); overflow: hidden; color: var(--ink); background: var(--canvas); font-family: var(--font-ui); font-size: var(--fs-17); line-height: 1.6; }
  687. button, input, select { font: inherit; color: inherit; }
  688. button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
  689. button { cursor: pointer; }
  690. a { color: inherit; text-decoration: none; }
  691. button { border: 0; background: none; }
  692. button:disabled { opacity: .45; cursor: not-allowed; }
  693. button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
  694. h1,h2,h3,h4,p { margin: 0; }
  695. svg { display: block; flex: none; }
  696. .icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
  697. .skip-link { position: fixed; z-index: var(--z-toast); top: 12px; left: 12px; padding: 12px 16px; background: var(--primary); color: var(--primary-content); border-radius: var(--r-md); transform: translateY(-200%); }
  698. .skip-link:focus { transform: none; }
  699. .review-bar { position: relative; z-index: var(--z-affix); background: var(--surface); border-bottom: 1px solid var(--edge); }
  700. .review-line { display: flex; min-height: 48px; align-items: center; gap: var(--sp-5); padding: 0 var(--sp-6); }
  701. .review-label { display: flex; align-items: center; gap: var(--sp-2); flex: none; font-size: var(--fs-13); font-weight: 600; }
  702. .review-dot { width: 7px; height: 7px; border-radius: var(--r-tag); background: var(--warning); }
  703. .review-version { color: var(--muted); font-size: var(--fs-12); font-weight: 400; }
  704. .review-line > p { flex: 1; color: var(--ink-2); font-size: var(--fs-12); }
  705. .review-line > p > span { margin-left: var(--sp-3); color: var(--muted); }
  706. .review-actions { display: flex; gap: var(--sp-2); margin-left: auto; }
  707. .review-button { display: inline-flex; min-height: 44px; align-items: center; gap: var(--sp-2); padding-inline: var(--sp-3); color: var(--ink-2); font-size: var(--fs-13); }
  708. .review-controls { max-height: 32dvh; overflow-y: auto; padding: var(--sp-3) var(--sp-6); border-top: 1px solid var(--edge); background: var(--surface-2); }
  709. .review-scenarios, .review-events { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
  710. .review-controls button { min-height: 44px; padding: var(--sp-2) var(--sp-3); border: 1px solid var(--edge); border-radius: var(--r-sm); background: var(--surface); font-size: var(--fs-13); }
  711. .review-controls button:hover { border-color: var(--edge-strong); background: var(--surface-hover); }
  712. .review-events { margin-top: var(--sp-2); }
  713. .review-events > span, .review-state { color: var(--muted); font-size: var(--fs-12); }
  714. .review-state { margin-top: var(--sp-2); }
  715. .app-shell { display: grid; grid-template-columns: 224px minmax(0,1fr); min-height: 0; }
  716. .sidebar { position: relative; display: flex; min-height: 0; flex-direction: column; padding: var(--sp-6) var(--sp-4) var(--sp-3); border-right: 1px solid var(--edge); background: var(--surface); }
  717. .brand { display: flex; align-items: center; gap: 9px; width: fit-content; margin: 0 var(--sp-3) var(--sp-6); font-size: var(--fs-26); line-height: 1; font-weight: 700; letter-spacing: -.07em; }
  718. .brand-mark { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 9px; background: var(--primary); color: var(--primary-content); font-size: var(--fs-20); letter-spacing: -.08em; }
  719. .brand-registered { align-self: start; margin: 1px 0 0 -5px; color: var(--muted); font-size: 9px; }
  720. .workspace-label { display: flex; align-items: center; gap: var(--sp-3); margin: 0 var(--sp-2) var(--sp-6); color: var(--ink); font-size: var(--fs-13); font-weight: 600; }
  721. .workspace-avatar { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--edge); border-radius: var(--r-md); background: var(--surface-2); font-size: var(--fs-13); }
  722. .workspace-label small { display: block; margin-top: 2px; color: var(--muted); font-size: var(--fs-11); font-weight: 400; }
  723. .sidebar-heading { margin: 0 var(--sp-3) var(--sp-2); color: var(--muted); font-size: var(--fs-11); }
  724. .nav-button { display: flex; width: 100%; min-height: 46px; align-items: center; gap: var(--sp-3); margin-top: var(--sp-1); padding: 0 var(--sp-3); border-radius: var(--r-md); color: var(--muted); font-size: var(--fs-14); text-align: left; }
  725. .nav-button.on { background: var(--primary-subtle); color: var(--ink); font-weight: 600; }
  726. .nav-button:hover { background: var(--surface-hover); color: var(--ink); }
  727. .nav-button .icon { width: 18px; height: 18px; }
  728. .nav-badge { margin-left: auto; padding: 0 6px; border-radius: var(--r-tag); background: var(--surface); color: var(--ink-2); font-size: var(--fs-11); }
  729. .sidebar-bottom { margin-top: auto; padding-top: var(--sp-6); }
  730. .sidebar-note { display: flex; gap: var(--sp-2); margin: 0 var(--sp-3) var(--sp-5); color: var(--ink-2); font-size: var(--fs-12); }
  731. .sidebar-note small { display: block; margin-top: var(--sp-1); color: var(--muted); font-size: var(--fs-11); }
  732. .status-dot { display: inline-block; width: 6px; height: 6px; flex: none; margin-top: 7px; border-radius: var(--r-tag); background: var(--success); }
  733. .account-button { display: flex; width: 100%; min-height: 60px; align-items: center; gap: var(--sp-3); padding: var(--sp-3); border-top: 1px solid var(--edge); text-align: left; font-size: var(--fs-13); }
  734. .account-avatar, .avatar-button { display: grid; width: 32px; height: 32px; flex: none; place-items: center; border-radius: var(--r-tag); background: var(--avatar-bg); color: var(--avatar-ink); font-size: var(--fs-12); }
  735. .account-button small { display: block; color: var(--muted); font-size: var(--fs-11); }
  736. .account-more { margin-left: auto; }
  737. .workspace { display: grid; min-height: 0; min-width: 0; grid-template-rows: 64px minmax(0,1fr); }
  738. .app-header { display: flex; align-items: center; justify-content: space-between; padding-inline: var(--sp-8); border-bottom: 1px solid var(--edge); background: var(--surface); }
  739. .app-breadcrumb { display: flex; align-items: center; gap: var(--sp-3); font-size: var(--fs-13); }
  740. .desktop-breadcrumb { color: var(--muted); }
  741. .desktop-breadcrumb > span { margin-left: var(--sp-3); color: var(--edge-strong); }
  742. .app-breadcrumb strong { font-weight: 500; }
  743. .mobile-brand { display: none; }
  744. .header-end { display: flex; align-items: center; gap: var(--sp-5); }
  745. .header-safe { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: var(--fs-12); }
  746. .header-safe .icon { width: 15px; height: 15px; }
  747. .avatar-button { min-width: 44px; min-height: 44px; width: 32px; height: 32px; background: transparent; }
  748. .avatar-button::first-letter { background: var(--avatar-bg); }
  749. main { min-height: 0; min-width: 0; overflow: auto; overscroll-behavior: contain; padding: var(--sp-8); }
  750. .page { width: min(1120px,100%); margin-inline: auto; }
  751. .page.narrow { max-width: 850px; }
  752. .subject-switch { display: flex; width: min(1120px,100%); flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin: 0 auto var(--sp-5); padding-bottom: var(--sp-4); border-bottom: 1px solid var(--edge); }
  753. .subject-switch > span,.subject-switch small { color: var(--muted); font-size: var(--fs-12); }
  754. .subject-switch > span { margin-right: var(--sp-2); }
  755. .subject-switch small { margin-left: auto; }
  756. .subject-switch button { display: flex; min-height: 44px; align-items: center; gap: var(--sp-2); padding: var(--sp-2) var(--sp-3); border-radius: var(--r-md); font-size: var(--fs-13); }
  757. .subject-switch button[aria-pressed='true'] { background: var(--primary-subtle); color: var(--ink); font-weight: 600; }
  758. .subject-switch .icon { width: 16px; height: 16px; }
  759. .page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-6); margin-bottom: var(--sp-6); }
  760. .eyebrow { display: flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-2); color: var(--muted); font-size: var(--fs-12); }
  761. .eyebrow .icon { width: 15px; height: 15px; }
  762. h1 { font-size: var(--fs-26); font-weight: 600; letter-spacing: -.05em; line-height: 1.4; }
  763. .page-heading p, .lead { margin-top: var(--sp-2); color: var(--muted); font-size: var(--fs-14); }
  764. .page-heading > .button { flex: none; }
  765. .button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: var(--sp-2); padding: var(--sp-2) var(--sp-4); border: 1px solid transparent; border-radius: var(--r-md); background: var(--primary); color: var(--primary-content); font-size: var(--fs-14); font-weight: 500; text-align: center; }
  766. .button:hover { background: var(--primary-hover); }
  767. .button.secondary { border-color: var(--edge); background: var(--surface); color: var(--ink); }
  768. .button.secondary:hover { border-color: var(--edge-strong); background: var(--surface-hover); }
  769. .button.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
  770. .button.ghost:hover { background: var(--surface-hover); }
  771. .button .icon { width: 17px; height: 17px; }
  772. .text-action { display: inline-flex; min-height: 44px; align-items: center; gap: var(--sp-2); padding: 0; color: var(--ink); font-size: var(--fs-13); font-weight: 500; text-decoration: underline; text-decoration-color: var(--edge-strong); text-underline-offset: 4px; }
  773. .text-action .icon { width: 15px; height: 15px; }
  774. .panel { padding: var(--sp-6); border: 1px solid var(--edge); border-radius: var(--r-lg); background: var(--surface); }
  775. .trial-banner { position: relative; display: grid; grid-template-columns: 48px minmax(0,1fr) auto; align-items: center; gap: var(--sp-5); margin-bottom: var(--sp-8); padding: var(--sp-6); border: 1px solid var(--edge-strong); border-radius: var(--r-lg); background: var(--surface); }
  776. .trial-icon { display: grid; width: 48px; height: 48px; place-items: center; border: 1px solid var(--edge); border-radius: var(--r-lg); background: var(--surface-2); }
  777. .trial-icon .icon { width: 24px; height: 24px; }
  778. .trial-banner h2 { display: flex; align-items: center; gap: var(--sp-3); font-size: var(--fs-20); font-weight: 600; letter-spacing: -.04em; }
  779. .trial-banner h2 > span { flex: none; padding: 1px 7px; border-radius: var(--r-sm); background: var(--success-subtle); color: var(--success); font-size: var(--fs-11); font-weight: 500; }
  780. .trial-banner p { margin-top: 6px; color: var(--muted); font-size: var(--fs-13); }
  781. .trial-facts { display: flex; flex-wrap: wrap; gap: var(--sp-4); margin-top: var(--sp-3); color: var(--ink-2); font-size: var(--fs-12); }
  782. .trial-facts span { display: inline-flex; align-items: center; gap: 5px; }
  783. .trial-facts .icon { width: 13px; height: 13px; color: var(--success); }
  784. .section-heading { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); margin-bottom: var(--sp-4); }
  785. .section-heading h2 { font-size: var(--fs-17); font-weight: 600; }
  786. .section-heading p { color: var(--muted); font-size: var(--fs-12); }
  787. .plan-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: var(--sp-4); }
  788. .plan-card { position: relative; display: flex; flex-direction: column; min-width: 0; padding: var(--sp-6); border: 1px solid var(--edge); border-radius: var(--r-lg); background: var(--surface); }
  789. .plan-card.featured { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
  790. .plan-mobile-copy,.plan-mobile-action { display: none; }
  791. .plan-recommend { position: absolute; top: -12px; left: var(--sp-5); padding: 2px 9px; border-radius: var(--r-sm); background: var(--primary); color: var(--primary-content); font-size: var(--fs-11); white-space: nowrap; }
  792. .plan-icon { display: grid; width: 36px; height: 36px; place-items: center; margin-bottom: var(--sp-4); border: 1px solid var(--edge); border-radius: var(--r-md); background: var(--surface-2); }
  793. .plan-card h3 { font-size: var(--fs-20); font-weight: 600; }
  794. .plan-name-short { display: none; }
  795. .plan-card > p { margin-top: 5px; color: var(--muted); font-size: var(--fs-13); }
  796. .plan-quota { display: none; }
  797. .plan-price { display: flex; align-items: baseline; gap: 7px; margin-block: var(--sp-6) var(--sp-1); }
  798. .plan-price strong { font-size: var(--fs-26); font-weight: 600; letter-spacing: -.05em; }
  799. .plan-price span { color: var(--muted); font-size: var(--fs-12); }
  800. .plan-billing-note { min-height: 24px; color: var(--muted); font-size: var(--fs-12); }
  801. .plan-card > .button { margin-top: var(--sp-4); width: 100%; }
  802. .plan-perks { display: flex; flex-direction: column; gap: var(--sp-3); margin: var(--sp-6) 0 0; padding: var(--sp-5) 0 0; border-top: 1px solid var(--edge); list-style: none; }
  803. .plan-perks li { display: flex; align-items: flex-start; gap: var(--sp-2); color: var(--ink-2); font-size: var(--fs-13); line-height: 1.7; }
  804. .plan-perks .icon { width: 14px; height: 14px; margin-top: 4px; color: var(--muted); }
  805. .plans-note { display: flex; gap: var(--sp-2); margin: var(--sp-5) 0 var(--sp-8); color: var(--muted); font-size: var(--fs-12); }
  806. .plans-note .icon { width: 15px; height: 15px; margin-top: 2px; }
  807. .info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
  808. .info-item { display: flex; align-items: flex-start; gap: var(--sp-3); }
  809. .info-item > .icon { margin-top: 4px; color: var(--muted); }
  810. .info-item h3 { margin-bottom: 5px; font-size: var(--fs-14); font-weight: 500; }
  811. .info-item p { max-width: 400px; color: var(--muted); font-size: var(--fs-13); }
  812. .info-item .text-action { margin-top: var(--sp-1); }
  813. .notice { display: flex; align-items: flex-start; gap: var(--sp-3); margin-bottom: var(--sp-5); padding: var(--sp-4) var(--sp-5); border: 1px solid var(--edge); border-radius: var(--r-md); background: var(--surface); font-size: var(--fs-13); }
  814. .notice .icon { width: 18px; height: 18px; margin-top: 2px; flex: none; }
  815. .notice strong { display: block; font-weight: 500; }
  816. .notice p { margin-top: var(--sp-1); color: var(--muted); }
  817. .notice.warning { border-color: color-mix(in srgb,var(--warning) 25%,var(--edge)); background: var(--warning-subtle); color: var(--warning); }
  818. .notice.warning p { color: var(--warning); }
  819. .notice.info { background: var(--info-subtle); color: var(--info); }
  820. .notice.info p { color: var(--info); }
  821. .notice.success { background: var(--success-subtle); color: var(--success); }
  822. .notice.success p { color: var(--success); }
  823. .notice > .button { margin-left: auto; flex: none; }
  824. .waiting-layout { display: grid; grid-template-columns: minmax(0,1fr) 280px; align-items: start; gap: var(--sp-5); }
  825. .waiting-card { padding: var(--sp-6); }
  826. .task-hero { display: flex; align-items: center; gap: var(--sp-4); padding-bottom: var(--sp-6); }
  827. .task-orb { display: grid; width: 56px; height: 56px; flex: none; place-items: center; border: 1px solid var(--edge); border-radius: var(--r-lg); background: var(--surface-2); }
  828. .task-orb .icon { width: 26px; height: 26px; }
  829. .task-orb.success { background: var(--success-subtle); color: var(--success); }
  830. .task-orb.failed { background: var(--danger-subtle); color: var(--danger); }
  831. .task-hero h2 { font-size: var(--fs-20); font-weight: 600; letter-spacing: -.04em; }
  832. .task-hero p { margin-top: var(--sp-1); color: var(--muted); font-size: var(--fs-13); }
  833. .progress-label { display: flex; justify-content: space-between; color: var(--muted); font-size: var(--fs-12); }
  834. .progress-label strong { color: var(--ink); font-weight: 500; }
  835. .progress-track { width: 100%; height: 5px; margin-top: var(--sp-3); overflow: hidden; border-radius: var(--r-tag); background: var(--surface-hover); }
  836. .progress-fill { height: 100%; border-radius: inherit; background: var(--primary); }
  837. .job-steps { margin: var(--sp-6) 0; padding: 0; list-style: none; }
  838. .job-step { position: relative; display: grid; grid-template-columns: 28px minmax(0,1fr) auto; gap: var(--sp-3); min-height: 72px; }
  839. .job-step:not(:last-child)::after { position: absolute; top: 29px; bottom: 3px; left: 13px; width: 1px; background: var(--edge); content: ''; }
  840. .step-icon { display: grid; width: 28px; height: 28px; place-items: center; border: 1px solid var(--edge); border-radius: var(--r-tag); background: var(--surface); color: var(--muted); font-size: var(--fs-12); }
  841. .step-icon .icon { width: 14px; height: 14px; }
  842. .job-step.done .step-icon { border-color: transparent; background: var(--success-subtle); color: var(--success); }
  843. .job-step.current .step-icon { border-color: var(--primary); background: var(--primary); color: var(--primary-content); }
  844. .job-step.failed .step-icon { border-color: transparent; background: var(--danger-subtle); color: var(--danger); }
  845. .step-copy strong { display: block; font-size: var(--fs-14); font-weight: 500; }
  846. .step-copy p { margin-top: 3px; color: var(--muted); font-size: var(--fs-12); }
  847. .step-state { padding-top: 3px; color: var(--muted); font-size: var(--fs-11); white-space: nowrap; }
  848. .job-step.done .step-state { color: var(--success); }
  849. .job-step.failed .step-state { color: var(--danger); }
  850. .waiting-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); padding-top: var(--sp-5); border-top: 1px solid var(--edge); }
  851. .waiting-foot { margin-top: var(--sp-4); color: var(--muted); font-size: var(--fs-12); }
  852. .waiting-simple { display: flex; min-height: 500px; align-items: center; flex-direction: column; justify-content: center; padding: var(--sp-8); }
  853. .waiting-current { text-align: center; }
  854. .waiting-current .task-orb { width: 64px; height: 64px; margin: 0 auto var(--sp-5); }
  855. .waiting-current h2 { font-size: var(--fs-26); font-weight: 600; letter-spacing: -.04em; }
  856. .waiting-current > p { margin: var(--sp-2) 0 var(--sp-3); color: var(--muted); font-size: var(--fs-14); }
  857. .waiting-progress { width: min(360px,100%); margin-top: var(--sp-8); }
  858. .waiting-meta { display: grid; width: min(360px,100%); grid-template-columns: 1fr 1fr; gap: var(--sp-5); margin: var(--sp-6) 0; text-align: center; }
  859. .waiting-meta dt { color: var(--muted); font-size: var(--fs-12); }
  860. .waiting-meta dd { margin: var(--sp-1) 0 0; color: var(--ink); font-size: var(--fs-14); }
  861. .waiting-simple .waiting-actions { justify-content: center; padding-top: 0; border-top: 0; }
  862. .support-action { margin-top: var(--sp-3); color: var(--muted); font-size: var(--fs-12); }
  863. .task-summary h3 { margin-bottom: var(--sp-4); font-size: var(--fs-14); font-weight: 500; }
  864. .summary-facts { margin: 0; }
  865. .summary-facts > div { margin-top: var(--sp-4); }
  866. .summary-facts dt { margin-bottom: 4px; color: var(--muted); font-size: var(--fs-12); }
  867. .summary-facts dd { margin: 0; font-size: var(--fs-13); overflow-wrap: anywhere; }
  868. .summary-facts dd.emphasis { font-weight: 600; }
  869. .task-summary .text-action { margin-top: var(--sp-4); font-size: var(--fs-12); }
  870. .small-panel { margin-top: var(--sp-4); padding: var(--sp-5); }
  871. .small-panel h3 { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-13); font-weight: 500; }
  872. .small-panel h3 .icon { width: 16px; height: 16px; }
  873. .small-panel p { margin-top: var(--sp-2); color: var(--muted); font-size: var(--fs-12); }
  874. .state-pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: var(--r-tag); background: var(--surface-2); color: var(--muted); font-size: var(--fs-11); white-space: nowrap; }
  875. .state-pill.ready { color: var(--success); background: var(--success-subtle); }
  876. .state-pill.pending { color: var(--warning); background: var(--warning-subtle); }
  877. .state-pill.expired { color: var(--danger); background: var(--danger-subtle); }
  878. .quota-panel { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-5); margin-bottom: var(--sp-6); }
  879. .quota-copy h2 { font-size: var(--fs-14); font-weight: 500; }
  880. .quota-copy p { margin-top: var(--sp-1); color: var(--muted); font-size: var(--fs-13); }
  881. .quota-meter { min-width: 180px; }
  882. .quota-meter p { color: var(--muted); font-size: var(--fs-12); }
  883. .quota-meter strong { color: var(--ink); font-size: var(--fs-20); font-weight: 600; }
  884. .container-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: var(--sp-4); }
  885. .container-card { padding: var(--sp-5); }
  886. .container-head { display: flex; align-items: center; gap: var(--sp-3); }
  887. .container-avatar { display: grid; width: 44px; height: 44px; flex: none; place-items: center; border-radius: var(--r-md); background: var(--avatar-bg); color: var(--avatar-ink); font-size: var(--fs-17); font-weight: 600; }
  888. .container-head > div { min-width: 0; }
  889. .container-head h3 { overflow: hidden; font-size: var(--fs-17); font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
  890. .container-head small { color: var(--muted); font-size: var(--fs-12); }
  891. .container-head > .state-pill { margin-left: auto; }
  892. .container-meta { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-5); color: var(--muted); font-size: var(--fs-12); }
  893. .container-caption { margin-top: var(--sp-3); color: var(--ink-2); font-size: var(--fs-13); }
  894. .container-actions { display: grid; grid-template-columns: 1fr auto; gap: var(--sp-2); margin-top: var(--sp-5); }
  895. .container-actions .button { padding-inline: var(--sp-3); font-size: var(--fs-13); }
  896. .create-card { display: flex; min-height: 237px; align-items: center; justify-content: center; flex-direction: column; gap: var(--sp-3); border: 1px dashed var(--edge-strong); border-radius: var(--r-lg); color: var(--muted); background: transparent; }
  897. .create-card > .icon { width: 26px; height: 26px; }
  898. .create-card strong { color: var(--ink-2); font-size: var(--fs-14); font-weight: 500; }
  899. .create-card p { font-size: var(--fs-12); }
  900. .empty-state { display: flex; min-height: 350px; align-items: center; justify-content: center; flex-direction: column; gap: var(--sp-3); text-align: center; }
  901. .empty-state > .task-orb { margin-bottom: var(--sp-3); }
  902. .empty-state h2 { font-size: var(--fs-20); font-weight: 500; }
  903. .empty-state p { max-width: 430px; color: var(--muted); font-size: var(--fs-14); }
  904. .empty-state .button { margin-top: var(--sp-3); }
  905. .resource-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-5); }
  906. .resource-panel h2 { display: flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-2); font-size: var(--fs-17); font-weight: 600; }
  907. .resource-panel h2 .icon { width: 19px; height: 19px; }
  908. .resource-panel > p { color: var(--muted); font-size: var(--fs-13); }
  909. .credential-list { margin: var(--sp-5) 0 0; }
  910. .credential-row { padding-block: var(--sp-4); border-top: 1px solid var(--edge); }
  911. .credential-row dt { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-2); color: var(--muted); font-size: var(--fs-12); }
  912. .credential-row dd { display: flex; min-height: 24px; justify-content: space-between; gap: var(--sp-3); margin: var(--sp-1) 0 0; font-family: ui-monospace,Consolas,monospace; font-size: var(--fs-13); overflow-wrap: anywhere; }
  913. .credential-row .button { min-height: 44px; padding-inline: var(--sp-2); flex: none; margin: -10px 0; font-size: var(--fs-12); }
  914. .masked-value { letter-spacing: .12em; }
  915. .credential-fake { margin-top: var(--sp-3); color: var(--muted); font-size: var(--fs-12); }
  916. .expired-intro { margin-bottom: var(--sp-6); }
  917. .expired-intro .task-orb { margin-bottom: var(--sp-4); }
  918. .expired-intro h1 { margin-bottom: var(--sp-3); }
  919. .expired-intro p { max-width: 620px; color: var(--muted); font-size: var(--fs-14); }
  920. .preserved-resource { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-6); padding: var(--sp-4) var(--sp-5); border: 1px solid var(--edge); border-radius: var(--r-md); background: var(--surface); }
  921. .preserved-resource > div { flex: 1; }
  922. .preserved-resource strong { font-size: var(--fs-14); font-weight: 500; }
  923. .preserved-resource p { margin-top: 3px; color: var(--muted); font-size: var(--fs-12); }
  924. .enterprise-layout { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: var(--sp-5); }
  925. .enterprise-card h2 { margin-bottom: var(--sp-3); font-size: var(--fs-20); font-weight: 600; }
  926. .enterprise-card > p { color: var(--muted); font-size: var(--fs-14); }
  927. .join-steps { display: flex; flex-direction: column; gap: var(--sp-5); margin-block: var(--sp-6); }
  928. .join-step { display: flex; align-items: flex-start; gap: var(--sp-3); }
  929. .join-step > span { display: grid; width: 26px; height: 26px; flex: none; place-items: center; border: 1px solid var(--edge); border-radius: var(--r-tag); font-size: var(--fs-12); }
  930. .join-step strong { font-size: var(--fs-14); font-weight: 500; }
  931. .join-step p { margin-top: var(--sp-1); color: var(--muted); font-size: var(--fs-13); }
  932. .copy-id { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border: 1px solid var(--edge); border-radius: var(--r-md); background: var(--surface-2); }
  933. .copy-id > div { flex: 1; }
  934. .copy-id small { display: block; color: var(--muted); font-size: var(--fs-12); }
  935. .copy-id strong { font-family: ui-monospace,Consolas,monospace; font-size: var(--fs-14); font-weight: 500; }
  936. .company-heading { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-5); }
  937. .company-heading h2 { font-size: var(--fs-17); font-weight: 500; }
  938. .company-heading p { color: var(--muted); font-size: var(--fs-12); }
  939. .company-member { display: flex; align-items: center; gap: var(--sp-3); min-height: 72px; padding-block: var(--sp-3); border-top: 1px solid var(--edge); }
  940. .company-member strong { font-size: var(--fs-14); font-weight: 500; }
  941. .company-member small { display: block; color: var(--muted); font-size: var(--fs-12); }
  942. .company-member > .state-pill { margin-left: auto; }
  943. .mobile-nav { display: none; }
  944. .ui-dialog { position: fixed; width: min(480px,calc(100% - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; padding: var(--sp-8); border: 1px solid var(--edge); border-radius: var(--r-lg); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-overlay); }
  945. .ui-dialog::backdrop { background: var(--overlay); backdrop-filter: blur(3px); }
  946. .dialog-close { position: absolute; top: var(--sp-2); right: var(--sp-2); width: 44px; height: 44px; color: var(--muted); font-size: var(--fs-26); }
  947. .dialog-kicker { display: inline-flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-4); color: var(--muted); font-size: var(--fs-12); }
  948. .dialog-kicker .icon { width: 17px; height: 17px; }
  949. .ui-dialog h2 { padding-right: var(--sp-4); font-size: var(--fs-20); font-weight: 600; }
  950. .dialog-description { margin-top: var(--sp-3); color: var(--muted); font-size: var(--fs-14); }
  951. .ui-dialog .notice { margin-top: var(--sp-5); margin-bottom: 0; }
  952. .form-field { display: block; margin-top: var(--sp-5); }
  953. .form-field > span { display: block; margin-bottom: var(--sp-2); font-size: var(--fs-13); }
  954. .form-field input, .form-field select { width: 100%; min-height: 48px; padding: 10px var(--sp-3); border: 1px solid var(--edge-strong); border-radius: var(--r-md); background: var(--surface); color: var(--ink); font-size: 16px; }
  955. .form-field small { display: block; margin-top: var(--sp-2); color: var(--muted); font-size: var(--fs-12); }
  956. .dialog-facts { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); margin-top: var(--sp-5); padding: var(--sp-4); border-radius: var(--r-md); background: var(--surface-2); }
  957. .dialog-facts small { display: block; margin-bottom: var(--sp-1); color: var(--muted); font-size: var(--fs-12); }
  958. .dialog-facts strong { font-size: var(--fs-13); font-weight: 500; }
  959. .dialog-actions { display: flex; justify-content: flex-end; gap: var(--sp-3); margin-top: var(--sp-6); }
  960. .dialog-actions .button { min-width: 100px; }
  961. .dialog-feedback { margin-top: var(--sp-4); color: var(--success); font-size: var(--fs-13); }
  962. .demo-secret { display: block; margin-top: var(--sp-4); padding: var(--sp-3); border: 1px solid var(--edge); border-radius: var(--r-sm); background: var(--surface-2); font: var(--fs-13) ui-monospace,Consolas,monospace; overflow-wrap: anywhere; }
  963. .toast { position: fixed; z-index: var(--z-toast); right: var(--sp-5); bottom: var(--sp-5); left: var(--sp-5); width: fit-content; max-width: calc(100% - 40px); margin-inline: auto; padding: var(--sp-3) var(--sp-5); border: 1px solid var(--edge-strong); border-radius: var(--r-md); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-pop); font-size: var(--fs-13); opacity: 0; transform: translateY(8px); transition: opacity var(--motion-fast),transform var(--motion-fast); pointer-events: none; }
  964. .toast.visible { opacity: 1; transform: none; }
  965. @media (max-width: 1100px) {
  966. .app-shell { grid-template-columns: 192px minmax(0,1fr); }
  967. main { padding: var(--sp-6); }
  968. .plan-grid { gap: var(--sp-3); }
  969. .plan-card { padding: var(--sp-5); }
  970. .waiting-layout { grid-template-columns: minmax(0,1fr) 240px; gap: var(--sp-4); }
  971. .enterprise-layout { grid-template-columns: 1fr; }
  972. }
  973. @media (max-width: 939px) and (min-width: 768px) {
  974. .app-shell { grid-template-columns: 76px minmax(0,1fr); }
  975. .sidebar { padding-inline: var(--sp-3); }
  976. .brand { margin: 0 auto var(--sp-6); font-size: 0; }
  977. .brand-mark { font-size: var(--fs-20); }
  978. .brand-registered,.workspace-label,.sidebar-heading,.nav-button > span,.sidebar-note,.account-button > span:not(.account-avatar) { display: none; }
  979. .nav-button { justify-content: center; padding: 0; }
  980. .account-button { justify-content: center; padding-inline: 0; }
  981. .waiting-layout { grid-template-columns: 1fr; }
  982. .task-aside { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
  983. .small-panel { margin-top: 0; }
  984. .review-line > p { display: none; }
  985. }
  986. @media (max-width: 767px) {
  987. body { font-size: var(--fs-14); }
  988. .review-line { min-height: 44px; gap: var(--sp-2); padding-inline: var(--sp-3); }
  989. .review-line > p,.review-version { display: none; }
  990. .review-label { font-size: var(--fs-12); }
  991. .review-actions { gap: 0; }
  992. .review-button { font-size: var(--fs-12); padding-inline: var(--sp-2); }
  993. .review-controls { max-height: 35dvh; padding: var(--sp-3); }
  994. .review-controls button { font-size: var(--fs-12); min-height: 40px; }
  995. .review-events > span { width: 100%; margin-block: var(--sp-1); }
  996. .app-shell { display: block; }
  997. .sidebar { display: none; }
  998. .workspace { height: 100%; grid-template-rows: 52px minmax(0,1fr) auto; }
  999. .app-header { padding-inline: var(--sp-4); }
  1000. .desktop-breadcrumb,.header-safe { display: none; }
  1001. .app-breadcrumb { gap: var(--sp-2); }
  1002. .app-breadcrumb strong { padding-left: var(--sp-2); border-left: 1px solid var(--edge); font-size: var(--fs-13); }
  1003. .mobile-brand { display: inline; font-size: var(--fs-17); font-weight: 700; letter-spacing: -.07em; }
  1004. main { padding: var(--sp-4) var(--sp-4) var(--sp-6); }
  1005. h1 { font-size: var(--fs-20); letter-spacing: -.03em; }
  1006. .eyebrow { font-size: var(--fs-11); margin-bottom: var(--sp-1); }
  1007. .page-heading { align-items: flex-start; gap: var(--sp-2); flex-direction: column; margin-bottom: var(--sp-4); }
  1008. .page-heading p,.lead { font-size: var(--fs-13); line-height: 1.6; }
  1009. .page-heading > .button { width: 100%; }
  1010. .button { min-height: 44px; font-size: var(--fs-14); padding-inline: var(--sp-3); }
  1011. .text-action { font-size: var(--fs-13); min-height: 40px; }
  1012. .panel { padding: var(--sp-4); border-radius: var(--r-md); }
  1013. .trial-banner { grid-template-columns: minmax(0,1fr); gap: var(--sp-3); margin-bottom: var(--sp-5); padding: var(--sp-4); }
  1014. .trial-icon { width: 36px; height: 36px; border-radius: var(--r-md); }
  1015. .trial-icon .icon { width: 20px; height: 20px; }
  1016. .trial-banner h2 { flex-wrap: wrap; gap: var(--sp-2); font-size: var(--fs-17); }
  1017. .trial-banner h2 > span { font-size: var(--fs-11); }
  1018. .trial-banner p { font-size: var(--fs-13); }
  1019. .trial-facts { gap: var(--sp-2) var(--sp-3); font-size: var(--fs-12); }
  1020. .trial-banner > .button { width: 100%; }
  1021. .section-heading { align-items: flex-start; flex-direction: column; gap: var(--sp-1); }
  1022. .section-heading h2 { font-size: var(--fs-15); }
  1023. .section-heading p { font-size: var(--fs-12); }
  1024. .plan-grid { grid-template-columns: 1fr; gap: var(--sp-3); }
  1025. .plan-card { display: grid; grid-template-columns: minmax(0,1fr) 88px; align-items: center; gap: var(--sp-3); padding: var(--sp-3); border-radius: var(--r-md); text-align: left; }
  1026. .plan-card.featured { background: var(--primary-subtle); box-shadow: inset 0 0 0 1px var(--primary); }
  1027. .plan-card.current { border-color: var(--success); background: var(--success-subtle); box-shadow: none; }
  1028. .plan-mobile-copy { display: block; min-width: 0; }
  1029. .plan-mobile-heading { display: flex; align-items: center; gap: var(--sp-2); }
  1030. .plan-mobile-heading h3 { font-size: var(--fs-17); line-height: 1.3; }
  1031. .plan-mobile-recommend { padding: 2px 6px; border-radius: var(--r-sm); background: var(--primary); color: var(--primary-content); font-size: var(--fs-11); white-space: nowrap; }
  1032. .plan-mobile-quota { margin-top: var(--sp-2); color: var(--ink-2); font-size: var(--fs-13); line-height: 1.4; }
  1033. .plan-mobile-benefit { margin-top: var(--sp-1); color: var(--muted); font-size: var(--fs-12); line-height: 1.4; }
  1034. .plan-mobile-action { display: flex; align-items: stretch; flex-direction: column; gap: var(--sp-2); }
  1035. .plan-mobile-price { text-align: center; line-height: 1.25; }
  1036. .plan-mobile-price strong { display: block; color: var(--ink-2); font-size: var(--fs-12); font-weight: 500; white-space: nowrap; }
  1037. .plan-mobile-price span { display: block; color: var(--muted); font-size: var(--fs-11); white-space: nowrap; }
  1038. .plan-mobile-action .button { width: 100%; min-height: 44px; padding-inline: var(--sp-1); font-size: var(--fs-12); }
  1039. .plan-card.current .plan-mobile-action .button { border-color: var(--success); color: var(--success); background: var(--surface); }
  1040. .plan-icon,.plan-recommend,.plan-name-full,.plan-name-short,.plan-card > p,.plan-quota,.plan-price,.plan-billing-note,.plan-card > .button,.plan-perks { display: none; }
  1041. .plans-note { font-size: var(--fs-12); margin: var(--sp-3) 0 var(--sp-5); }
  1042. .info-grid { grid-template-columns: 1fr; gap: var(--sp-4); }
  1043. .info-item h3,.info-item p { font-size: var(--fs-13); }
  1044. .waiting-layout,.resource-grid { grid-template-columns: 1fr; }
  1045. .task-hero { gap: var(--sp-2); padding-bottom: var(--sp-4); }
  1046. .task-orb { width: 40px; height: 40px; }
  1047. .task-hero h2 { font-size: var(--fs-17); }
  1048. .task-hero p { font-size: var(--fs-12); }
  1049. .job-step { grid-template-columns: 24px minmax(0,1fr) auto; gap: var(--sp-2); min-height: 76px; }
  1050. .step-copy strong { font-size: var(--fs-14); }
  1051. .step-copy p { max-width: 220px; font-size: var(--fs-12); }
  1052. .step-state { font-size: var(--fs-11); }
  1053. .waiting-actions { flex-direction: column; gap: var(--sp-2); }
  1054. .waiting-actions .button { width: 100%; }
  1055. .waiting-foot { font-size: var(--fs-12); }
  1056. .waiting-simple { min-height: 0; padding: var(--sp-6) var(--sp-4); border-radius: var(--r-lg); }
  1057. .waiting-current .task-orb { width: 52px; height: 52px; margin-bottom: var(--sp-4); }
  1058. .waiting-current h2 { font-size: var(--fs-20); }
  1059. .waiting-current > p { font-size: var(--fs-13); }
  1060. .waiting-progress { margin-top: var(--sp-5); }
  1061. .waiting-meta { margin: var(--sp-4) 0; gap: var(--sp-4); }
  1062. .waiting-meta dt { font-size: var(--fs-11); }
  1063. .waiting-meta dd { font-size: var(--fs-13); }
  1064. .waiting-simple .waiting-actions { width: 100%; gap: var(--sp-2); }
  1065. .support-action { font-size: var(--fs-12); }
  1066. .task-aside { display: grid; grid-template-columns: 1fr; gap: var(--sp-3); }
  1067. .small-panel { margin: 0; padding: var(--sp-4); }
  1068. .task-summary h3,.small-panel h3 { font-size: var(--fs-13); }
  1069. .summary-facts { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
  1070. .summary-facts > div { margin-top: 0; }
  1071. .summary-facts dt,.small-panel p { font-size: var(--fs-11); }
  1072. .summary-facts dd { font-size: var(--fs-13); }
  1073. .task-summary .text-action { font-size: var(--fs-12); }
  1074. .notice { flex-wrap: wrap; padding: var(--sp-3); font-size: var(--fs-13); margin-bottom: var(--sp-4); }
  1075. .notice > div { flex: 1; min-width: 0; }
  1076. .notice > .button { width: 100%; margin-left: 0; }
  1077. .quota-panel { align-items: stretch; flex-direction: column; gap: var(--sp-3); margin-bottom: var(--sp-4); padding: var(--sp-4); }
  1078. .quota-copy h2 { font-size: var(--fs-13); }
  1079. .quota-copy p { font-size: var(--fs-12); }
  1080. .quota-meter { min-width: 0; }
  1081. .quota-meter p { font-size: var(--fs-11); }
  1082. .quota-meter strong { font-size: var(--fs-17); }
  1083. .container-grid { grid-template-columns: minmax(0,1fr); gap: var(--sp-3); }
  1084. .container-card { padding: var(--sp-4); }
  1085. .container-avatar { width: 36px; height: 36px; font-size: var(--fs-14); }
  1086. .container-head h3 { font-size: var(--fs-15); }
  1087. .container-head small { font-size: var(--fs-11); }
  1088. .container-meta { gap: var(--sp-2); margin-top: var(--sp-3); font-size: var(--fs-11); }
  1089. .container-caption { font-size: var(--fs-12); margin-top: var(--sp-2); }
  1090. .container-actions { margin-top: var(--sp-3); }
  1091. .container-actions .button { font-size: var(--fs-13); }
  1092. .create-card { min-height: 120px; gap: var(--sp-2); }
  1093. .create-card > .icon { width: 22px; height: 22px; }
  1094. .create-card strong { font-size: var(--fs-14); }
  1095. .create-card p { font-size: var(--fs-11); }
  1096. .empty-state { min-height: 260px; gap: var(--sp-2); }
  1097. .empty-state h2 { font-size: var(--fs-17); }
  1098. .empty-state p { font-size: var(--fs-13); }
  1099. .resource-panel > p { font-size: var(--fs-13); }
  1100. .resource-panel h2 { font-size: var(--fs-15); }
  1101. .credential-list { margin-top: var(--sp-4); }
  1102. .credential-row { padding-block: var(--sp-3); }
  1103. .credential-row dt { font-size: var(--fs-11); }
  1104. .credential-row dd { font-size: var(--fs-12); }
  1105. .credential-row .button { font-size: var(--fs-12); min-height: 40px; }
  1106. .credential-fake { font-size: var(--fs-11); }
  1107. .expired-intro { margin-bottom: var(--sp-5); }
  1108. .expired-intro p { font-size: var(--fs-13); }
  1109. .preserved-resource { flex-wrap: wrap; padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-4); }
  1110. .preserved-resource strong { font-size: var(--fs-14); }
  1111. .preserved-resource p { font-size: var(--fs-11); }
  1112. .enterprise-layout { grid-template-columns: 1fr; gap: var(--sp-4); }
  1113. .enterprise-card h2 { font-size: var(--fs-17); }
  1114. .enterprise-card > p,.join-step strong,.join-step p { font-size: var(--fs-13); }
  1115. .join-steps { gap: var(--sp-4); margin-block: var(--sp-4); }
  1116. .company-heading h2 { font-size: var(--fs-15); }
  1117. .company-member { min-height: 60px; }
  1118. .company-member strong { font-size: var(--fs-13); }
  1119. .company-member small { font-size: var(--fs-11); }
  1120. .copy-id { padding: var(--sp-2) var(--sp-3); }
  1121. .copy-id strong { font-size: var(--fs-13); }
  1122. .state-pill { font-size: var(--fs-10, 11px); padding: 1px 6px; }
  1123. .mobile-nav { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); min-height: 56px; gap: 0; padding: var(--sp-1) var(--sp-2) max(var(--sp-1),env(safe-area-inset-bottom,0px)); border-top: 1px solid var(--edge); background: var(--surface); }
  1124. .mobile-nav button { display: flex; min-height: 48px; align-items: center; justify-content: center; flex-direction: column; gap: 2px; color: var(--muted); font-size: var(--fs-10, 11px); }
  1125. .mobile-nav button.on { color: var(--ink); font-weight: 600; }
  1126. .mobile-nav .icon { width: 19px; height: 19px; }
  1127. .ui-dialog { padding: var(--sp-5) var(--sp-4); width: min(480px,calc(100% - 24px)); }
  1128. .ui-dialog h2 { font-size: var(--fs-17); }
  1129. .dialog-description { font-size: var(--fs-13); }
  1130. .dialog-facts { padding: var(--sp-3); gap: var(--sp-2); }
  1131. .dialog-facts strong { font-size: var(--fs-12); }
  1132. .dialog-actions { flex-direction: column-reverse; gap: var(--sp-2); }
  1133. .dialog-actions .button { width: 100%; }
  1134. .form-field > span { font-size: var(--fs-13); }
  1135. .form-field small { font-size: var(--fs-11); }
  1136. .toast { bottom: calc(68px + env(safe-area-inset-bottom,0px)); font-size: var(--fs-13); }
  1137. }
  1138. @media (prefers-reduced-motion: reduce) { *,*::before,*::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
  1139. </style>
  1140. </head>
  1141. <body>
  1142. <a class="skip-link" href="#main">跳到主内容</a>
  1143. <section class="review-bar" aria-label="原型评审控制">
  1144. <div class="review-line"><span class="review-label"><span class="review-dot"></span>交互原型 <span class="review-version">G-D1 / 待确认</span></span><p>体验从开通到可用的完整动线。<span>以下为本地演示,不会创建容器或付款。</span></p><div class="review-actions"><button type="button" id="themeToggle" class="review-button" aria-label="切换深色模式">深色</button><button type="button" id="reviewToggle" class="review-button" aria-controls="reviewControls" aria-expanded="false">演示场景 <span aria-hidden="true">⌄</span></button></div></div>
  1145. <div class="review-controls" id="reviewControls" hidden>
  1146. <div class="review-scenarios" role="group" aria-label="选择演示场景"><button type="button" data-scenario="new">首次进入</button><button type="button" data-scenario="waiting">开通进行中</button><button type="button" data-scenario="failed">开通失败</button><button type="button" data-scenario="advanced">已有容器</button><button type="button" data-scenario="quota">名额已满</button><button type="button" data-scenario="expired">试用到期</button><button type="button" data-scenario="enterprise">企业账号</button></div>
  1147. <div class="review-events" role="group" aria-label="模拟平台事件"><span>模拟平台回报</span><button type="button" data-event="advance">推进一个阶段</button><button type="button" data-event="fail">当前阶段失败</button><button type="button" data-event="slow">进度延迟</button><button type="button" data-event="offline">切换断网</button><button type="button" data-event="approve">管理员确认</button><button type="button" data-event="expire">试用到期</button><button type="button" data-event="join">企业确认加入</button></div>
  1148. <p class="review-state" id="reviewState" aria-live="polite"></p>
  1149. </div>
  1150. </section>
  1151. <div class="app-shell">
  1152. <aside class="sidebar" aria-label="桌面导航">
  1153. <a class="brand" href="#plans" aria-label="Fmode 套餐首页"><span class="brand-mark">F</span>fmode<span class="brand-registered">®</span></a>
  1154. <div class="workspace-label"><span class="workspace-avatar">我</span><span>我的协作空间<small>个人与企业,同一个入口</small></span></div>
  1155. <div class="sidebar-heading">工作空间</div>
  1156. <nav id="desktopNav"></nav>
  1157. <div class="sidebar-bottom"><div class="sidebar-note"><span class="status-dot"></span><span>让想法,更进一步。<small>连接你与数字生命。</small></span></div><button type="button" class="account-button" data-view="account"><span class="account-avatar">体</span><span>体验账号<small>原型演示数据</small></span><span class="account-more" aria-hidden="true">···</span></button></div>
  1158. </aside>
  1159. <div class="workspace">
  1160. <header class="app-header"><div class="app-breadcrumb"><span class="mobile-brand">fmode</span><span class="desktop-breadcrumb">账户与空间 <span aria-hidden="true">/</span></span><strong id="pageLabel">套餐与开通</strong></div><div class="header-end"><span class="header-safe" id="headerStatus"></span><button type="button" class="avatar-button" data-view="account" aria-label="查看账号与套餐">体</button></div></header>
  1161. <main id="main" tabindex="-1"></main>
  1162. <nav class="mobile-nav" id="mobileNav" aria-label="手机导航"></nav>
  1163. </div>
  1164. </div>
  1165. <dialog class="ui-dialog" id="dialog" aria-labelledby="dialogTitle"><button type="button" class="dialog-close icon-button" id="dialogClose" aria-label="关闭弹窗" autofocus>×</button><div id="dialogBody"></div></dialog>
  1166. <div class="toast" id="toast" role="status" aria-live="polite" aria-atomic="true"></div>
  1167. <script>/* Local, in-memory review model. It neither calls a platform nor grants real access. */
  1168. const SubscriptionDemo = (() => {
  1169. const PLANS = {
  1170. trial: { name: '两天试用', limit: 1 },
  1171. starter: { name: '入门版', limit: 1 },
  1172. advanced: { name: '进阶版', limit: 3 },
  1173. enterprise: { name: '企业版', limit: 5 },
  1174. };
  1175. const STAGES = [
  1176. { key: 'entitlement', title: '确认权益与容器名额', detail: '检查套餐权益,预留本次开通名额。' },
  1177. { key: 'cloud', title: '准备独立云资源', detail: '配置独立后端、云函数与专属资源凭据。' },
  1178. { key: 'matrix', title: '建立通信身份', detail: '创建归属于你的 Matrix 身份与会话通道。' },
  1179. { key: 'container', title: '创建并初始化容器', detail: '准备平台容器,安装已验证的运行环境。' },
  1180. { key: 'connectivity', title: '接入协作空间', detail: '验证身份与房间,完成通信接入。' },
  1181. { key: 'verification', title: '完成可用性核验', detail: '核对真实回复、完成信号和新鲜心跳。' },
  1182. ];
  1183. const scopeFields = ['plan', 'access', 'trialClaimed', 'trialStartedAt', 'trialExpiresAt', 'containers', 'addon', 'application', 'job', 'jobSequence'];
  1184. const captureScope = (state) => Object.fromEntries(scopeFields.map((key) => [key, JSON.parse(JSON.stringify(state[key]))]));
  1185. function switchSubject(state, subject) {
  1186. if (state.activeSubject === subject) return;
  1187. const account = state[subject + 'Account'];
  1188. if (!account) return;
  1189. state[state.activeSubject + 'Account'] = captureScope(state);
  1190. for (const key of scopeFields) state[key] = JSON.parse(JSON.stringify(account[key]));
  1191. state.activeSubject = subject;
  1192. state.company = subject === 'company';
  1193. }
  1194. const seedContainer = (index, company = false) => ({ id: (company ? 'demo-company-container-' : 'demo-container-') + index, name: ['我的协作伙伴', '内容助手', '研究助手', '项目伙伴', '知识助手'][index - 1] || '新的协作伙伴', owner: company ? '示例企业' : '我', company, ready: true });
  1195. function initial(scenario = 'new') {
  1196. const state = { scenario, view: 'plans', plan: null, access: 'unopened', trialClaimed: false, trialStartedAt: null, trialExpiresAt: null, now: Date.parse('2026-11-25T10:00:00+08:00'), containers: [], addon: 0, application: null, job: null, offline: false, jobSequence: 0, company: false, activeSubject: 'personal', personalAccount: null, companyAccount: null, note: '' };
  1197. if (['advanced', 'quota', 'enterprise'].includes(scenario)) {
  1198. if (scenario === 'enterprise') { state.personalAccount = captureScope(state); state.activeSubject = 'company'; }
  1199. state.plan = scenario === 'enterprise' ? 'enterprise' : 'advanced';
  1200. state.company = scenario === 'enterprise';
  1201. state.access = 'active';
  1202. state.view = 'containers';
  1203. state.containers = Array.from({ length: scenario === 'quota' ? 3 : scenario === 'enterprise' ? 2 : 1 }, (_, index) => seedContainer(index + 1, state.company));
  1204. }
  1205. if (scenario === 'expired') {
  1206. state.plan = 'trial'; state.trialClaimed = true; state.access = 'expired'; state.view = 'expired';
  1207. state.trialStartedAt = state.now - 48 * 3600000; state.trialExpiresAt = state.now;
  1208. state.containers = [seedContainer(1)];
  1209. }
  1210. if (['waiting', 'failed'].includes(scenario)) {
  1211. const started = reduce(state, { type: 'start', name: '我的第一个容器', plan: 'trial' });
  1212. started.job.stage = 3; started.job.completed = 3; started.job.status = scenario === 'failed' ? 'failed' : 'provisioning';
  1213. started.now += 6 * 60000; started.job.updatedAt = started.now;
  1214. started.job.error = scenario === 'failed' ? '运行环境初始化暂时失败,平台保留了已完成的资源和任务进度。' : null;
  1215. return started;
  1216. }
  1217. return state;
  1218. }
  1219. const limit = (state) => state.plan ? PLANS[state.plan].limit + (['advanced', 'enterprise'].includes(state.plan) ? state.addon : 0) : 0;
  1220. const reserved = (state) => state.job && state.job.status !== 'ready' ? 1 : 0;
  1221. const used = (state) => state.containers.length;
  1222. const hasAccess = (state) => state.access === 'active';
  1223. const canCreate = (state) => hasAccess(state) && !reserved(state) && used(state) < limit(state);
  1224. const clone = (state) => JSON.parse(JSON.stringify(state));
  1225. function reduce(previous, action) {
  1226. const s = clone(previous);
  1227. s.note = '';
  1228. if (action.type === 'subject') {
  1229. switchSubject(s, action.subject);
  1230. s.view = s.access === 'expired' ? 'expired' : action.view || 'containers';
  1231. return s;
  1232. }
  1233. if (action.type === 'view') {
  1234. s.view = action.view;
  1235. if (s.access === 'expired' && ['containers', 'access', 'chat'].includes(s.view)) s.view = 'expired';
  1236. return s;
  1237. }
  1238. if (action.type === 'offline') { s.offline = !s.offline; s.note = s.offline ? '网络连接已断开' : '网络已恢复'; return s; }
  1239. if (s.offline && ['start', 'apply', 'retry', 'addon'].includes(action.type)) { s.note = '网络暂时不可用,请重试。'; return s; }
  1240. if (action.type === 'start') {
  1241. if (s.job && s.job.status !== 'ready') { s.view = 'waiting'; s.note = '正在开通'; return s; }
  1242. if (action.plan === 'trial') {
  1243. if (s.trialClaimed) { s.note = '试用已领取'; return s; }
  1244. s.plan = 'trial'; s.trialClaimed = true;
  1245. } else if (!canCreate(s) && s.access !== 'unopened') { s.note = '名额不足'; return s; }
  1246. s.jobSequence += 1;
  1247. s.job = { id: 'DEMO-JOB-' + String(s.jobSequence).padStart(3, '0'), status: 'queued', stage: 0, completed: 0, name: action.name || '我的第一个容器', createdAt: s.now, updatedAt: s.now, attempt: 1, delayed: false, error: null };
  1248. if (!s.containers.length) s.access = 'provisioning';
  1249. s.view = 'waiting';
  1250. }
  1251. if (action.type === 'advance' && s.job && !['ready', 'failed'].includes(s.job.status)) {
  1252. s.now += 90000; s.job.updatedAt = s.now; s.job.delayed = false;
  1253. if (s.job.stage < STAGES.length - 1) {
  1254. s.job.stage += 1; s.job.completed = s.job.stage;
  1255. s.job.status = s.job.stage === STAGES.length - 1 ? 'verifying' : 'provisioning';
  1256. } else {
  1257. s.job.status = 'ready'; s.job.completed = STAGES.length;
  1258. const container = { ...seedContainer(s.containers.length + 1, s.company), name: s.job.name };
  1259. s.containers.push(container); s.job.agentId = container.id; s.access = 'active';
  1260. if (s.plan === 'trial' && s.trialStartedAt === null) { s.trialStartedAt = s.now; s.trialExpiresAt = s.now + 48 * 3600000; }
  1261. s.note = '已就绪';
  1262. }
  1263. }
  1264. if (action.type === 'fail' && s.job && s.job.status !== 'ready') { s.job.status = 'failed'; s.job.error = '当前步骤执行失败。平台已保留完成的资源与原任务,可安全重试。'; s.job.updatedAt = s.now; }
  1265. if (action.type === 'slow' && s.job && !['ready', 'failed'].includes(s.job.status)) { s.now += 45 * 60000; s.job.delayed = true; }
  1266. if (action.type === 'retry' && s.job?.status === 'failed') { s.job.status = s.job.stage === 5 ? 'verifying' : 'provisioning'; s.job.error = null; s.job.attempt += 1; s.job.updatedAt = s.now; s.view = 'waiting'; s.note = '正在重试'; }
  1267. if (action.type === 'apply') {
  1268. if (action.plan === 'enterprise' && s.activeSubject !== 'company') { s.view = 'enterprise'; s.note = '请先核实企业身份,企业权益与个人权益分别管理。'; return s; }
  1269. if (s.activeSubject === 'company' && action.plan !== 'enterprise') switchSubject(s, 'personal');
  1270. if (s.access === 'active' && s.plan !== 'trial' && PLANS[action.plan].limit < limit(s)) { s.note = '更换套餐请联系客服。'; return s; }
  1271. s.application = { kind: s.access === 'expired' ? 'restore' : 'plan', plan: action.plan, status: 'pending' }; s.note = '申请已提交';
  1272. }
  1273. if (action.type === 'addon') {
  1274. if (!['advanced', 'enterprise'].includes(s.plan)) { s.note = '请先升级套餐'; return s; }
  1275. s.application = { kind: 'addon', quantity: action.quantity, status: 'pending' }; s.note = '申请已提交';
  1276. }
  1277. if (action.type === 'approve' && s.application?.status === 'pending') {
  1278. const application = s.application; s.application = null;
  1279. if (application.kind === 'addon') { s.addon += application.quantity; s.note = '名额已更新'; }
  1280. else {
  1281. const hadContainer = s.containers.length > 0;
  1282. s.plan = application.plan;
  1283. s.access = 'active';
  1284. if (hadContainer) { s.view = 'containers'; s.note = '已恢复使用'; }
  1285. else return reduce(s, { type: 'start', plan: s.plan, name: '我的第一个容器' });
  1286. }
  1287. }
  1288. if (action.type === 'expire' && s.plan === 'trial' && s.access === 'active') { s.now = s.trialExpiresAt; s.access = 'expired'; s.view = 'expired'; s.note = '试用已结束'; }
  1289. if (action.type === 'join' && s.view === 'enterprise') {
  1290. if (s.activeSubject === 'company') return s;
  1291. if (!s.companyAccount) s.companyAccount = { plan: 'enterprise', access: 'active', trialClaimed: false, trialStartedAt: null, trialExpiresAt: null, containers: [seedContainer(1, true), seedContainer(2, true)], addon: 0, application: null, job: null, jobSequence: 0 };
  1292. switchSubject(s, 'company'); s.view = 'enterprise'; s.note = '已加入企业';
  1293. }
  1294. if (action.type === 'rename') { const target = s.containers.find((item) => item.id === action.id); if (target && hasAccess(s)) target.name = action.name; }
  1295. return s;
  1296. }
  1297. return { PLANS, STAGES, initial, reduce, limit, reserved, used, hasAccess, canCreate };
  1298. })();
  1299. </script>
  1300. <script>const Demo = SubscriptionDemo;
  1301. const params = new URLSearchParams(location.search);
  1302. const knownScenarios = ['new', 'waiting', 'failed', 'advanced', 'quota', 'expired', 'enterprise'];
  1303. let state = Demo.initial(knownScenarios.includes(params.get('scenario')) ? params.get('scenario') : 'new');
  1304. const views = { plans: '套餐与开通', waiting: '开通进度', containers: '我的容器', access: '接入信息', enterprise: '加入企业', account: '我的账号', expired: '继续使用 Fmode', chat: '开始协作' };
  1305. const requestedView = params.get('screen') || location.hash.slice(1);
  1306. if (views[requestedView]) state = Demo.reduce(state, { type: 'view', view: requestedView });
  1307. if (params.get('theme') === 'dark') document.documentElement.classList.add('dark');
  1308. const main = document.getElementById('main');
  1309. const dialog = document.getElementById('dialog');
  1310. const dialogBody = document.getElementById('dialogBody');
  1311. let dialogContext = null;
  1312. let dialogTrigger = null;
  1313. let toastTimer;
  1314. const esc = (value) => String(value ?? '').replace(/[&<>"']/g, (character) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[character]);
  1315. const paths = {
  1316. grid: '<rect x="3" y="3" width="7" height="7" rx="1.5"/><rect x="14" y="3" width="7" height="7" rx="1.5"/><rect x="3" y="14" width="7" height="7" rx="1.5"/><rect x="14" y="14" width="7" height="7" rx="1.5"/>',
  1317. server: '<rect x="3" y="3" width="18" height="7" rx="2"/><rect x="3" y="14" width="18" height="7" rx="2"/><path d="M7 6.5h.01M7 17.5h.01M12 6.5h5M12 17.5h5"/>',
  1318. arrow: '<path d="M4 12h16m-6-6 6 6-6 6"/>',
  1319. check: '<path d="m5 12 4 4L19 6"/>',
  1320. clock: '<circle cx="12" cy="12" r="9"/><path d="M12 7v5l3 2"/>',
  1321. shield: '<path d="m12 3 8 3v6c0 5-8 9-8 9S4 17 4 12V6l8-3Z"/><path d="m8 12 3 3 5-6"/>',
  1322. person: '<circle cx="12" cy="8" r="4"/><path d="M4 21v-2a8 8 0 0 1 16 0v2"/>',
  1323. people: '<circle cx="9" cy="8" r="3"/><path d="M3 21v-3a6 6 0 0 1 12 0v3M16 5a3 3 0 0 1 0 6m2 3a5 5 0 0 1 3 4v3"/>',
  1324. key: '<circle cx="8" cy="8" r="5"/><path d="m12 12 9 9m-4-4 3-3m-6 0 3-3"/>',
  1325. copy: '<rect x="8" y="8" width="12" height="13" rx="2"/><path d="M16 8V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h3"/>',
  1326. plus: '<path d="M12 5v14M5 12h14"/>',
  1327. refresh: '<path d="M20 7v5h-5M4 17v-5h5"/><path d="M6 6a8 8 0 0 1 13 3M5 15a8 8 0 0 0 13 3"/>',
  1328. spark: '<path d="m12 3 2.4 6.6L21 12l-6.6 2.4L12 21l-2.4-6.6L3 12l6.6-2.4L12 3Z"/>',
  1329. cloud: '<path d="M7 19a5 5 0 1 1 .5-10A7 7 0 0 1 21 12a4 4 0 0 1-1 7H7Z"/>',
  1330. chat: '<path d="M5 4h14a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H9l-6 3V6a2 2 0 0 1 2-2Z"/><path d="M7 9h10M7 13h6"/>',
  1331. info: '<circle cx="12" cy="12" r="9"/><path d="M12 11v6M12 7h.01"/>',
  1332. warning: '<path d="m12 3 10 18H2L12 3Z"/><path d="M12 9v5M12 17h.01"/>',
  1333. wifi: '<path d="M2 8a16 16 0 0 1 20 0M5 12a11 11 0 0 1 14 0M8 16a6 6 0 0 1 8 0M12 20h.01M3 3l18 18"/>',
  1334. close: '<path d="m6 6 12 12M18 6 6 18"/>',
  1335. building: '<path d="M4 21V5l8-3 8 3v16H4ZM9 21v-5h6v5M8 7h1m6 0h1M8 11h1m6 0h1"/>',
  1336. link: '<path d="m10 14 4-4m-6 6-2 2a4 4 0 0 1-6-6l5-5a4 4 0 0 1 6 0m2 10a4 4 0 0 0 6 0l5-5a4 4 0 0 0-6-6l-2 2" transform="translate(2 0) scale(.85 1)"/>',
  1337. };
  1338. const icon = (name) => `<svg class="icon" viewBox="0 0 24 24" aria-hidden="true">${paths[name] || paths.grid}</svg>`;
  1339. const button = (text, action, kind = '', extra = '') => `<button type="button" class="button ${kind}" data-action="${action}" ${extra}>${text}</button>`;
  1340. const notice = (title, text, tone = '', name = 'info') => `<div class="notice ${tone}">${icon(name)}<div><strong>${title}</strong>${text ? `<p>${text}</p>` : ''}</div></div>`;
  1341. const planName = () => state.plan ? Demo.PLANS[state.plan].name : '尚未开通';
  1342. const stateLabel = () => state.offline ? '网络未连接' : ({ unopened: '尚未开通', provisioning: '正在开通', active: state.plan === 'trial' ? '试用中' : '已开通', expired: '试用已到期' })[state.access];
  1343. const priceNotice = '具体价格请咨询客服。';
  1344. function nav() {
  1345. const items = [{ view: 'plans', label: '套餐与开通', mobile: '套餐', icon: 'grid' }, { view: 'containers', label: '我的容器', mobile: '容器', icon: 'server' }, { view: 'access', label: '接入信息', mobile: '接入', icon: 'key' }, { view: 'enterprise', label: state.company || state.companyAccount ? '企业空间' : '加入企业', mobile: '企业', icon: 'people' }];
  1346. document.getElementById('desktopNav').innerHTML = items.map((item) => `<button type="button" class="nav-button ${state.view === item.view || state.view === 'expired' && item.view === 'plans' || state.view === 'waiting' && item.view === 'containers' ? 'on' : ''}" data-view="${item.view}" ${state.view === item.view ? 'aria-current="page"' : ''}>${icon(item.icon)}<span>${item.label}</span>${item.view === 'containers' && state.containers.length ? `<span class="nav-badge">${state.containers.length}</span>` : ''}</button>`).join('');
  1347. document.getElementById('mobileNav').innerHTML = items.map((item) => `<button type="button" class="${state.view === item.view || state.view === 'expired' && item.view === 'plans' || state.view === 'waiting' && item.view === 'containers' ? 'on' : ''}" data-view="${item.view}" ${state.view === item.view ? 'aria-current="page"' : ''}>${icon(item.icon)}<span>${item.mobile}</span></button>`).join('');
  1348. }
  1349. function planCards() {
  1350. const cards = [
  1351. { key: 'starter', icon: 'server', name: '入门版', short: '入门', sub: '一个专属空间,从这里开始。', unit: '/ 月', note: '支持 1 个容器', mobileQuota: '1 个专属容器 · 2 核 4G', mobileBenefit: '独立云资源 · 含完整接入信息', quota: '1', quotaLabel: '个容器', perks: ['1 个专属容器', '2 核 4G 标准规格', '独立云资源', '完整接入信息', '手机与电脑均可使用'] },
  1352. { key: 'advanced', icon: 'spark', name: '进阶版', short: '进阶', sub: '更多空间,接住不同的想法。', unit: '/ 年', note: '含一年资源费用', mobileQuota: '3 个专属容器 · 2 核 4G', mobileBenefit: '独立云资源 · 支持加购名额', quota: '3', quotaLabel: '个容器', perks: ['3 个专属容器', '2 核 4G 标准规格', '独立云资源与接入信息', '支持加购容器名额'] },
  1353. { key: 'enterprise', icon: 'building', name: '企业版', short: '企业', sub: '让整个团队,有序地协作。', unit: '', note: '团队共享', mobileQuota: '5 个共享容器 · 2 核 4G', mobileBenefit: '成员管理 · 通讯录与容器共享', quota: '5', quotaLabel: '个共享', perks: ['5 个企业容器', '2 核 4G 标准规格(新容器)', '企业成员管理', '通讯录与容器共享', '支持加购容器名额'] },
  1354. ];
  1355. const cta = (card) => state.access === 'expired' ? '恢复' : state.plan === card.key ? '当前' : '开通';
  1356. return `<div class="plan-grid">${cards.map((card) => {
  1357. const disabled = state.plan === card.key && state.access === 'active';
  1358. const current = state.plan === card.key && state.access === 'active';
  1359. return `<article class="plan-card ${card.key === 'advanced' ? 'featured' : ''} ${current ? 'current' : ''}" data-plan-card="${card.key}">${card.key === 'advanced' ? '<span class="plan-recommend">推荐</span>' : ''}
  1360. <div class="plan-mobile-copy"><div class="plan-mobile-heading"><h3>${card.name}</h3>${card.key === 'advanced' ? '<span class="plan-mobile-recommend">推荐</span>' : ''}</div><p class="plan-mobile-quota">${card.mobileQuota}</p><p class="plan-mobile-benefit">${card.mobileBenefit}</p></div>
  1361. <div class="plan-mobile-action"><div class="plan-mobile-price"><strong>价格待定</strong><span>${card.unit || card.note}</span></div>${button(cta(card), 'apply', card.key === 'advanced' ? '' : 'secondary', `data-plan="${card.key}" ${disabled ? 'disabled' : ''}`)}</div>
  1362. <div class="plan-icon">${icon(card.icon)}</div>
  1363. <h3><span class="plan-name-full">${card.name}</span><span class="plan-name-short">${card.short}</span></h3>
  1364. <p class="plan-sub">${card.sub}</p>
  1365. <div class="plan-quota"><strong>${card.quota}</strong><span>${card.quotaLabel}</span></div>
  1366. <div class="plan-price"><strong>价格待定</strong><span>${card.unit}</span></div>
  1367. <div class="plan-billing-note">${card.note}</div>
  1368. ${button(cta(card), 'apply', card.key === 'advanced' ? '' : 'secondary', `data-plan="${card.key}" ${disabled ? 'disabled' : ''}`)}
  1369. <ul class="plan-perks">${card.perks.map((perk) => `<li>${icon('check')}<span>${perk}</span></li>`).join('')}</ul>
  1370. </article>`;
  1371. }).join('')}</div>`;
  1372. }
  1373. function applicationNotice() {
  1374. if (!state.application) return '';
  1375. const addon = state.application.kind === 'addon';
  1376. return notice(addon ? '增配申请已提交' : '开通申请已提交', '等待确认。', 'info', 'clock');
  1377. }
  1378. function plansPage() {
  1379. let trial = '';
  1380. if (!state.trialClaimed && state.access === 'unopened') {
  1381. trial = `<section class="trial-banner" aria-label="两天试用"><div class="trial-icon">${icon('spark')}</div><div><h2>先体验,再决定。<span>两天试用</span></h2><p>1 个专属容器,开通后开始体验。</p></div>${button('开始两天试用 ' + icon('arrow'), 'trial')}</section>`;
  1382. } else if (state.job && state.job.status !== 'ready') {
  1383. trial = `<section class="trial-banner"><div class="trial-icon">${icon('clock')}</div><div><h2>正在开通</h2><p>${esc(state.job.name)}</p></div>${button('查看进度 ' + icon('arrow'), 'waiting')}</section>`;
  1384. } else if (state.access === 'active') {
  1385. trial = `<section class="trial-banner"><div class="trial-icon">${icon('check')}</div><div><h2>${esc(planName())}<span>${state.plan === 'trial' ? '试用中' : '使用中'}</span></h2><p>已使用 ${Demo.used(state)} / ${Demo.limit(state)} 个名额</p></div>${button('我的容器 ' + icon('arrow'), 'containers')}</section>`;
  1386. }
  1387. return `<div class="page"><header class="page-heading"><div><span class="eyebrow">${icon('grid')}套餐与开通</span><h1>选择适合你的协作方式。</h1><p>按需选择,随时升级。</p></div></header>${applicationNotice()}${trial}<div class="section-heading"><h2>为下一步,准备合适的空间</h2><p>个人专属 · 企业共享 · 按需增配</p></div>${planCards()}<p class="plans-note">${icon('info')}<span>${priceNotice}</span></p><div class="info-grid"><section class="info-item">${icon('building')}<div><h3>加入企业</h3><p>使用企业容器</p><button type="button" class="text-action" data-view="enterprise">加入企业 ${icon('arrow')}</button></div></section><section class="info-item">${icon('shield')}<div><h3>数据为你保留</h3><p>试用结束后,开通套餐即可继续使用。</p></div></section></div></div>`;
  1388. }
  1389. function waitingPage() {
  1390. const job = state.job;
  1391. if (!job) return `<div class="page narrow"><div class="panel empty-state"><div class="task-orb">${icon('clock')}</div><h2>暂无开通记录</h2>${button('查看套餐', 'plans')}</div></div>`;
  1392. const ready = job.status === 'ready', failed = job.status === 'failed';
  1393. const percent = ready ? 100 : Math.min(99, Math.floor(job.completed / Demo.STAGES.length * 100));
  1394. const label = ready ? '已就绪' : failed ? '开通失败' : job.status === 'queued' ? '等待开通' : job.status === 'verifying' ? '即将就绪' : '正在开通';
  1395. const elapsed = Math.floor((state.now - job.createdAt) / 60000);
  1396. const feedback = state.offline ? notice('网络连接已断开', '请检查网络后重试。', 'warning', 'wifi') : failed ? notice('暂时未能完成开通', '请稍后重试。', 'warning', 'warning') : job.delayed ? notice('仍在处理中', '请稍后查看。', '', 'clock') : '';
  1397. return `<div class="page narrow"><header class="page-heading"><div><h1>开通进度</h1></div></header>${feedback}<section class="panel waiting-simple"><div class="waiting-current"><span class="task-orb ${ready ? 'success' : failed ? 'failed' : ''}">${icon(ready ? 'check' : failed ? 'warning' : 'server')}</span><h2>${label}</h2><p>${esc(job.name)}</p><span class="state-pill">${esc(planName())}</span></div><div class="waiting-progress"><div class="progress-label"><span>开通进度</span><strong>${percent}%</strong></div><div class="progress-track" role="progressbar" aria-label="开通进度" aria-valuenow="${percent}" aria-valuemin="0" aria-valuemax="100"><div class="progress-fill" style="width:${percent}%"></div></div></div><dl class="waiting-meta"><div><dt>${ready ? '状态' : '已等待'}</dt><dd>${ready ? '已就绪' : elapsed + ' 分钟'}</dd></div><div><dt>${ready ? '当前套餐' : '预计完成'}</dt><dd>${ready ? esc(planName()) : '稍后更新'}</dd></div></dl><div class="waiting-actions">${ready ? button('开始使用 ' + icon('arrow'), 'chat') : failed ? button(icon('refresh') + '重试', 'retry', '', state.offline ? 'disabled' : '') : button(icon('refresh') + '检查进度', 'check', '', state.offline ? 'disabled' : '')}${button('我的容器', 'containers', 'secondary')}</div><button type="button" class="text-action support-action" data-action="copy-job">${icon('copy')}复制服务编号</button></section></div>`;
  1398. }
  1399. function quotaPanel() {
  1400. const used = Demo.used(state), reserved = Demo.reserved(state), max = Demo.limit(state);
  1401. return `<section class="panel quota-panel"><div class="quota-copy"><h2>${state.company ? '企业共享名额' : '我的容器名额'} <span class="state-pill ${state.plan === 'trial' ? 'pending' : 'ready'}">${esc(planName())}</span></h2><p>已用 ${used} 个${reserved ? `,开通中 ${reserved} 个` : ''}${state.addon ? `,已含加购 ${state.addon} 个` : ''}。</p></div><div class="quota-meter"><p><strong>${used + reserved}</strong> / ${max} 个名额</p><div class="progress-track"><div class="progress-fill" style="width:${max ? Math.min(100,(used + reserved) / max * 100) : 0}%"></div></div></div>${['advanced', 'enterprise'].includes(state.plan) ? button('增加名额', 'addon', 'secondary') : button('查看套餐', 'plans', 'secondary')}</section>`;
  1402. }
  1403. function containerCard(container) {
  1404. return `<article class="panel container-card" data-container-id="${esc(container.id)}"><div class="container-head"><span class="container-avatar">${esc(container.name.slice(0,1))}</span><div><h3>${esc(container.name)}</h3><small>${container.company ? '企业共享' : '归属于我'}</small></div><span class="state-pill ready">已就绪</span></div><div class="container-meta"><span>2 核 CPU</span><span>4 GB 内存</span><span>平台容器</span></div><p class="container-caption">可以开始使用。</p><div class="container-actions">${button('进入会话 ' + icon('arrow'), 'chat', '', `data-id="${esc(container.id)}"`)}${button('设置', 'settings', 'secondary', `data-id="${esc(container.id)}"`)}</div></article>`;
  1405. }
  1406. function containersPage() {
  1407. if (!state.plan) return `<div class="page"><header class="page-heading"><div><span class="eyebrow">${icon('server')}我的容器</span><h1>我的容器</h1><p>管理你的专属空间。</p></div></header><div class="panel empty-state"><div class="task-orb">${icon('server')}</div><h2>还没有容器</h2><p>选择套餐,开始使用。</p>${button('领取两天试用 ' + icon('arrow'), 'trial')}</div></div>`;
  1408. const activeJob = state.job && state.job.status !== 'ready';
  1409. return `<div class="page"><header class="page-heading"><div><span class="eyebrow">${icon('server')}${state.company ? '企业容器' : '我的容器'}</span><h1>${state.company ? '企业容器' : '我的容器'}</h1><p>${state.company ? '团队共享的容器。' : '管理你的专属空间。'}</p></div>${button(icon('plus') + '创建容器', 'create', '', !Demo.canCreate(state) ? 'disabled' : '')}</header>${applicationNotice()}${quotaPanel()}${activeJob ? notice('有一个容器正在开通', '', 'info', 'clock') + button('查看开通进度 ' + icon('arrow'), 'waiting', 'secondary') : ''}${Demo.used(state) >= Demo.limit(state) && !activeJob ? notice('名额已用完', ['advanced','enterprise'].includes(state.plan) ? '可申请增加名额。' : '升级套餐,获取更多名额。', '', 'info') : ''}<div class="container-grid" style="margin-top:var(--sp-5)">${state.containers.map(containerCard).join('')}${Demo.canCreate(state) ? `<button type="button" class="create-card" data-action="create">${icon('plus')}<strong>为新的想法,创建一个空间</strong><p>剩余 ${Demo.limit(state) - Demo.used(state)} 个名额</p></button>` : ''}</div>${!state.containers.length ? '<p class="lead">正在开通,请稍后查看。</p>' : ''}</div>`;
  1410. }
  1411. const fakeCredentials = [
  1412. { group: 'matrix', label: 'agentMxId', value: '@demo-agent:example.invalid' },
  1413. { group: 'matrix', label: 'userMxId', value: '@demo-user:example.invalid' },
  1414. { group: 'matrix', label: 'homeserver', value: 'https://matrix.example.invalid' },
  1415. { group: 'matrix', label: 'roomId', value: '!demo-room:example.invalid' },
  1416. { group: 'matrix', label: 'accessToken', value: 'DEMO_ONLY_NOT_A_REAL_MATRIX_TOKEN' },
  1417. { group: 'backend', label: 'appId', value: 'DEMO_APP_ID_NOT_REAL' },
  1418. { group: 'backend', label: 'serverURL', value: 'https://backend.example.invalid/parse' },
  1419. { group: 'backend', label: 'functionsURL', value: 'https://backend.example.invalid/functions' },
  1420. { group: 'backend', label: '独立资源专属凭据', value: 'DEMO_ONLY_RESOURCE_SCOPED_CREDENTIAL' },
  1421. ];
  1422. function credentialsPage() {
  1423. if (!Demo.hasAccess(state) || !state.containers.length) return `<div class="page narrow"><header class="page-heading"><div><span class="eyebrow">${icon('key')}接入信息</span><h1>接入信息</h1><p></p></div></header><div class="panel empty-state"><div class="task-orb">${icon('key')}</div><h2>${state.job ? '正在准备' : '暂无接入信息'}</h2><p>开通完成后可查看。</p>${button(state.job ? '查看开通进度' : '查看套餐', state.job ? 'waiting' : 'plans')}</div></div>`;
  1424. const panel = (group, heading, text, name) => `<section class="panel resource-panel"><h2>${icon(name)}${heading}</h2><p>${text}</p><dl class="credential-list">${fakeCredentials.filter((field) => field.group === group).map((field) => `<div class="credential-row"><dt>${field.label}</dt><dd><span class="masked-value">••••••••••••</span>${button(icon('copy') + '查看与复制', 'credential', 'ghost', `data-field="${esc(field.label)}"`)}</dd></div>`).join('')}</dl></section>`;
  1425. const backendPanel = state.company ? `<section class="panel resource-panel"><h2>${icon('cloud')}企业资源</h2><p>请联系企业管理员。</p><p class="credential-fake"></p></section>` : panel('backend', '独立云资源', '', 'cloud');
  1426. return `<div class="page"><header class="page-heading"><div><span class="eyebrow">${icon('key')}接入信息</span><h1>接入信息</h1><p>当前容器:${esc(state.containers[0].name)}。</p></div></header>${notice('请勿分享密钥', '', '', 'shield')}<div class="resource-grid">${panel('matrix', '通信信息', '', 'chat')}${backendPanel}</div><p class="credential-fake"></p></div>`;
  1427. }
  1428. function expiredPage() {
  1429. return `<div class="page"><section class="expired-intro"><div class="task-orb">${icon('clock')}</div><span class="eyebrow">两天试用已结束</span><h1>试用已结束</h1><p>开通套餐后继续使用。</p></section><section class="preserved-resource">${icon('shield')}<div><strong>${esc(state.containers[0]?.name || '我的协作伙伴')}</strong><p>容器和数据已保留。</p></div><span class="state-pill expired">待开通</span></section>${applicationNotice()}${planCards()}<p class="plans-note">${icon('info')}<span>${priceNotice} </span></p><button type="button" class="text-action" data-view="enterprise">加入企业 ${icon('arrow')}</button></div>`;
  1430. }
  1431. function enterprisePage() {
  1432. const org = state.company;
  1433. if (!org && state.companyAccount) return `<div class="page narrow"><header class="page-heading"><div><span class="eyebrow">${icon('building')}企业空间</span><h1>企业空间</h1><p></p></div></header><section class="panel empty-state"><div class="task-orb">${icon('building')}</div><h2>示例企业</h2><p>5 个共享容器名额</p>${button('进入企业空间 ' + icon('arrow'), 'switch-company')}</section></div>`;
  1434. return `<div class="page"><header class="page-heading"><div><span class="eyebrow">${icon('building')}${org ? '企业空间' : '加入企业'}</span><h1>${org ? '企业空间' : '加入企业'}</h1><p>${org ? '' : '联系管理员完成邀请。'}</p></div></header>${org ? quotaPanel() : ''}<div class="enterprise-layout"><section class="panel enterprise-card">${org ? `<div class="company-heading"><span class="container-avatar">企</span><div><h2>示例企业</h2><p>企业成员</p></div></div>${['产品协作组','内容协作组'].map((name,index) => `<div class="company-member"><span class="account-avatar">${index ? '内' : '产'}</span><div><strong>${name}</strong><small>示例成员 · 名下 1 个企业容器</small></div><span class="state-pill ready">可协作</span></div>`).join('')}${button('查看企业容器 ' + icon('arrow'), 'containers', 'secondary', 'style="margin-top:var(--sp-5)"')}` : `<h2>等待加入</h2><p>将用户 ID 发给管理员。</p><div class="copy-id"><div><small>用户 ID</small><strong>DEMO_USER_001</strong></div>${button(icon('copy') + '复制', 'copy-user', 'secondary')}</div><div class="waiting-actions" style="margin-top:var(--sp-5)">${button(icon('refresh') + '我已被邀请,立即检查', 'check-org')}</div>`}</section><aside><section class="panel small-panel" style="margin-top:0"><h3>${icon('people')}企业邀请</h3><p>已有邀请?联系管理员完成加入。</p></section>${!org ? `<section class="panel small-panel"><h3>个人使用</h3><p>查看适合你的个人套餐。</p>${button('查看个人套餐', 'plans', 'secondary', 'style="margin-top:var(--sp-4)"')}</section>` : ''}</aside></div></div>`;
  1435. }
  1436. function accountPage() {
  1437. return `<div class="page narrow"><header class="page-heading"><div><h1>我的账号</h1></div></header><section class="panel"><div class="section-heading"><h2>当前套餐</h2><span class="state-pill ${state.access === 'active' ? 'ready' : state.access === 'expired' ? 'expired' : 'pending'}">${stateLabel()}</span></div><dl class="summary-facts"><div><dt>套餐</dt><dd>${esc(planName())}</dd></div><div><dt>容器名额</dt><dd>${Demo.used(state)} / ${Demo.limit(state)}</dd></div><div><dt>试用状态</dt><dd>${state.plan === 'trial' ? stateLabel() : '—'}</dd></div><div><dt>当前空间</dt><dd>${state.company ? '示例企业' : '个人空间'}</dd></div></dl><div class="waiting-actions" style="margin-top:var(--sp-5)">${button('查看套餐', 'plans')}${button('我的容器', 'containers', 'secondary')}</div></section></div>`;
  1438. }
  1439. function chatPage() {
  1440. if (!Demo.hasAccess(state) || !state.containers.length) return state.access === 'expired' ? expiredPage() : waitingPage();
  1441. return `<div class="page narrow"><div class="panel empty-state"><div class="task-orb success">${icon('chat')}</div><h2>已就绪</h2><p>${esc(state.containers[0].name)}</p>${button('我的容器', 'containers', 'secondary')}</div></div>`;
  1442. }
  1443. function render(resetScroll = false) {
  1444. nav();
  1445. document.getElementById('pageLabel').textContent = views[state.view] || views.plans;
  1446. document.getElementById('headerStatus').innerHTML = icon(state.offline ? 'wifi' : 'shield') + esc(stateLabel());
  1447. const pages = { plans: plansPage, waiting: waitingPage, containers: containersPage, access: credentialsPage, enterprise: enterprisePage, account: accountPage, expired: expiredPage, chat: chatPage };
  1448. const subjectSwitcher = state.company || state.companyAccount ? `<div class="subject-switch" aria-label="切换权益主体"><span>当前空间</span><button type="button" data-subject="personal" aria-pressed="${!state.company}">${icon('person')}个人空间</button><button type="button" data-subject="company" aria-pressed="${state.company}">${icon('building')}示例企业</button><small></small></div>` : '';
  1449. main.innerHTML = subjectSwitcher + (pages[state.view] || plansPage)();
  1450. if (resetScroll) main.scrollTop = 0;
  1451. document.getElementById('reviewState').textContent = `当前演示:${state.company ? '企业' : '个人'}空间 · ${planName()} · ${stateLabel()} · 容器 ${Demo.used(state)} 个 · 任务预占 ${Demo.reserved(state)} 个 · 配额 ${Demo.limit(state)} 个${state.job ? ' · 任务 ' + state.job.id + ' · 尝试 ' + state.job.attempt + ' 次' : ''}。所有状态均为本地模拟。`;
  1452. document.querySelector('[data-event="advance"]').disabled = !state.job || ['ready','failed'].includes(state.job.status) || state.offline;
  1453. document.querySelector('[data-event="fail"]').disabled = !state.job || state.job.status === 'ready';
  1454. document.querySelector('[data-event="slow"]').disabled = !state.job || ['ready','failed'].includes(state.job.status);
  1455. document.querySelector('[data-event="approve"]').disabled = !state.application;
  1456. document.querySelector('[data-event="expire"]').disabled = state.plan !== 'trial' || state.access !== 'active';
  1457. document.querySelector('[data-event="join"]').disabled = state.view !== 'enterprise' || state.company;
  1458. document.querySelector('[data-event="offline"]').textContent = state.offline ? '恢复网络' : '模拟断网';
  1459. document.getElementById('themeToggle').textContent = document.documentElement.classList.contains('dark') ? '浅色' : '深色';
  1460. }
  1461. function toast(message) {
  1462. clearTimeout(toastTimer);
  1463. const element = document.getElementById('toast');
  1464. element.textContent = message; element.classList.add('visible');
  1465. toastTimer = setTimeout(() => element.classList.remove('visible'), 3400);
  1466. }
  1467. function dispatch(action) {
  1468. const oldView = state.view;
  1469. state = Demo.reduce(state, action);
  1470. render(state.view !== oldView);
  1471. if (state.note) toast(state.note);
  1472. }
  1473. function go(view) { dispatch({ type: 'view', view }); }
  1474. function closeDialog() { if (dialog.open) dialog.close(); }
  1475. function openDialog(kind, data = {}, trigger = document.activeElement) {
  1476. dialogContext = { kind, ...data }; dialogTrigger = trigger;
  1477. const cancel = '<button type="button" class="button secondary" data-close-dialog>暂不操作</button>';
  1478. if (kind === 'create') {
  1479. const trial = data.trial;
  1480. dialogBody.innerHTML = `<form id="createForm"><span class="dialog-kicker">${icon(trial ? 'spark' : 'server')}${trial ? '两天试用' : '创建平台容器'}</span><h2 id="dialogTitle">${trial ? '开始两天试用' : '创建容器'}</h2><p class="dialog-description">${trial ? '1 个专属容器,开通后开始计时。' : '提交后可查看开通进度。'}</p><label class="form-field"><span>容器名称</span><input id="containerName" name="containerName" maxlength="24" required value="${trial ? '我的第一个容器' : '新的协作伙伴'}" autocomplete="off"><small>最多 24 个字符,之后可在容器设置中修改。</small></label><div class="dialog-facts"><div><small>容器规格</small><strong>2 核 4G · 平台容器</strong></div><div><small>${trial ? '试用名额' : '将占用名额'}</small><strong>1 个</strong></div></div>${notice('开通进度', '开通中,请稍后查看。', '', 'shield')}<div class="dialog-actions">${cancel}<button type="submit" class="button">${trial ? '开始开通试用' : '提交创建申请'} ${icon('arrow')}</button></div></form>`;
  1481. } else if (kind === 'apply') {
  1482. const name = Demo.PLANS[data.plan].name;
  1483. dialogBody.innerHTML = `<form id="applyForm"><span class="dialog-kicker">${icon('grid')}套餐开通</span><h2 id="dialogTitle">${state.access === 'expired' ? '开通套餐' : '申请开通' + name}</h2><p class="dialog-description">${name} · 价格待定。请联系客服确认。</p><div class="dialog-facts"><div><small>基础容器上限</small><strong>${Demo.PLANS[data.plan].limit} 个${data.plan === 'enterprise' ? ',企业共享' : ',个人专属'}</strong></div><div><small>当前状态</small><strong>等待开通</strong></div></div>${notice(state.access === 'expired' ? '数据已保留' : '待确认', state.access === 'expired' ? '开通后继续使用。' : '请联系客服。', '', 'info')}<div class="dialog-actions">${cancel}<button type="submit" class="button">提交申请 ${icon('arrow')}</button></div></form>`;
  1484. } else if (kind === 'addon') {
  1485. dialogBody.innerHTML = `<form id="addonForm"><span class="dialog-kicker">${icon('plus')}容器名额增配</span><h2 id="dialogTitle">增加容器名额</h2><p class="dialog-description">当前名额 ${Demo.limit(state)} 个。具体价格请咨询客服。</p><label class="form-field"><span>申请增加名额</span><select id="addonQuantity" name="quantity"><option value="1">增加 1 个</option><option value="2">增加 2 个</option><option value="3">增加 3 个</option></select></label>${notice('等待确认', '', '', 'info')}<div class="dialog-actions">${cancel}<button type="submit" class="button">提交申请</button></div></form>`;
  1486. } else if (kind === 'credential') {
  1487. dialogBody.innerHTML = `<span class="dialog-kicker">${icon('shield')}敏感信息确认</span><h2 id="dialogTitle">仅供本人使用,请勿外发。</h2><p class="dialog-description">即将查看并复制「${esc(data.field)}」。请妥善保管。</p>${notice('仅供本人使用', '', '', 'info')}<div id="credentialResult" hidden></div><div class="dialog-actions">${cancel}<button type="button" class="button" data-confirm-credential>确认复制</button></div>`;
  1488. } else if (kind === 'settings') {
  1489. const container = state.containers.find((item) => item.id === data.id);
  1490. if (!container) return;
  1491. dialogBody.innerHTML = `<form id="renameForm"><span class="dialog-kicker">${icon('server')}容器设置</span><h2 id="dialogTitle">容器设置</h2><label class="form-field"><span>容器名称</span><input id="renameInput" maxlength="24" required value="${esc(container.name)}" autocomplete="off"></label><div class="dialog-actions">${cancel}<button type="submit" class="button">保存名称</button></div></form>`;
  1492. }
  1493. dialog.showModal(); document.getElementById('dialogClose').focus();
  1494. }
  1495. async function copyText(value, message = '已复制') {
  1496. try {
  1497. if (!navigator.clipboard?.writeText) throw new Error('unavailable');
  1498. await navigator.clipboard.writeText(value);
  1499. return message;
  1500. } catch { return '浏览器未允许自动复制,可选中文本手动复制。'; }
  1501. }
  1502. document.getElementById('dialogClose').addEventListener('click', closeDialog);
  1503. dialog.addEventListener('close', () => { if (dialogTrigger?.isConnected) dialogTrigger.focus({ preventScroll: true }); else main.focus({ preventScroll: true }); });
  1504. dialog.addEventListener('click', (event) => {
  1505. const rect = dialog.getBoundingClientRect();
  1506. if (event.target === dialog && (event.clientX < rect.left || event.clientX > rect.right || event.clientY < rect.top || event.clientY > rect.bottom)) closeDialog();
  1507. });
  1508. document.addEventListener('click', async (event) => {
  1509. const target = event.target.closest('button, a');
  1510. if (!target || target.disabled) return;
  1511. if (target.hasAttribute('data-close-dialog')) return closeDialog();
  1512. if (target.dataset.subject) return dispatch({ type: 'subject', subject: target.dataset.subject });
  1513. if (target.dataset.view) return go(target.dataset.view);
  1514. if (target.dataset.scenario) { state = Demo.initial(target.dataset.scenario); render(true); return; }
  1515. if (target.dataset.event) return dispatch({ type: target.dataset.event });
  1516. if (target.hasAttribute('data-confirm-credential')) {
  1517. const field = fakeCredentials.find((item) => item.label === dialogContext?.field);
  1518. if (!field) return;
  1519. const result = document.getElementById('credentialResult');
  1520. result.hidden = false; result.replaceChildren();
  1521. const code = document.createElement('code'); code.className = 'demo-secret'; code.textContent = field.value;
  1522. const feedback = document.createElement('p'); feedback.className = 'dialog-feedback'; feedback.setAttribute('role', 'status');
  1523. result.append(code, feedback); target.disabled = true;
  1524. feedback.textContent = await copyText(field.value, '原型假数据已复制,请勿用于实际接入。');
  1525. return;
  1526. }
  1527. const action = target.dataset.action;
  1528. if (!action) return;
  1529. if (['plans','waiting','containers','chat'].includes(action)) return go(action === 'plans' && state.access === 'expired' ? 'expired' : action);
  1530. if (action === 'trial') return openDialog('create', { trial: true }, target);
  1531. if (action === 'create') {
  1532. if (Demo.canCreate(state)) openDialog('create', { trial: false }, target);
  1533. else toast('当前名额不可用,请查看套餐或开通中的任务。');
  1534. return;
  1535. }
  1536. if (action === 'apply') {
  1537. const plan = target.dataset.plan;
  1538. if (plan === 'enterprise' && !state.company) return go('enterprise');
  1539. if (state.company && plan !== 'enterprise') dispatch({ type: 'subject', subject: 'personal', view: 'plans' });
  1540. if (state.access === 'active' && state.plan !== 'trial' && Demo.PLANS[plan].limit < Demo.limit(state)) return toast('更换套餐请联系客服。');
  1541. return openDialog('apply', { plan }, target);
  1542. }
  1543. if (action === 'switch-company') return dispatch({ type: 'subject', subject: 'company', view: 'enterprise' });
  1544. if (action === 'addon') return openDialog('addon', {}, target);
  1545. if (action === 'credential') return openDialog('credential', { field: target.dataset.field }, target);
  1546. if (action === 'settings') return openDialog('settings', { id: target.dataset.id }, target);
  1547. if (action === 'retry') return dispatch({ type: 'retry' });
  1548. if (action === 'check') return toast(state.offline ? '网络暂时不可用,原任务仍在平台保留。' : '仍在开通中,请稍后查看。');
  1549. if (action === 'check-org') return toast('仍在等待邀请。');
  1550. if (action === 'copy-job') return toast(await copyText(state.job?.id || '', '演示任务编号已复制'));
  1551. if (action === 'copy-user') return toast(await copyText('DEMO_USER_001', '演示用户 ID 已复制'));
  1552. });
  1553. document.addEventListener('submit', (event) => {
  1554. event.preventDefault();
  1555. const id = event.target.id;
  1556. if (id === 'createForm') {
  1557. const name = document.getElementById('containerName').value.trim();
  1558. if (!name) return;
  1559. const trial = dialogContext.trial; closeDialog(); dispatch({ type: 'start', name, plan: trial ? 'trial' : state.plan });
  1560. }
  1561. if (id === 'applyForm') { const plan = dialogContext.plan; closeDialog(); dispatch({ type: 'apply', plan }); }
  1562. if (id === 'addonForm') { const quantity = Number(document.getElementById('addonQuantity').value); closeDialog(); dispatch({ type: 'addon', quantity }); }
  1563. if (id === 'renameForm') {
  1564. const name = document.getElementById('renameInput').value.trim(); if (!name) return;
  1565. const containerId = dialogContext.id; closeDialog(); dispatch({ type: 'rename', id: containerId, name }); toast('演示容器名称已修改');
  1566. }
  1567. });
  1568. document.getElementById('reviewToggle').addEventListener('click', () => {
  1569. const controls = document.getElementById('reviewControls'); controls.hidden = !controls.hidden;
  1570. document.getElementById('reviewToggle').setAttribute('aria-expanded', String(!controls.hidden));
  1571. });
  1572. document.getElementById('themeToggle').addEventListener('click', () => { document.documentElement.classList.toggle('dark'); render(); });
  1573. document.querySelector('.brand').addEventListener('click', (event) => { event.preventDefault(); go('plans'); });
  1574. render(true);
  1575. </script>
  1576. </body>
  1577. </html>