| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665 |
- <!doctype html>
- <html lang="zh-CN" data-palette="platinum">
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover">
- <meta name="color-scheme" content="light dark">
- <meta name="description" content="Fmode 套餐与异步开通交互原型。全部状态均为本地演示,不连接平台、不创建容器、不付款。">
- <title>Fmode · 套餐与开通交互原型</title>
- <style>/* ============================================================
- * UI-Kit Design System
- * Tailwind CSS v3 + 语义化设计 token
- * 所有可切换的运行时变量都以 CSS 自定义属性定义在 :root / .dark /
- * [data-accent="..."] 上,组件模板通过 Tailwind 工具类引用它们;
- * token → 工具类 的映射见根目录 tailwind.config.js。
- * ============================================================ */
- /* ------------------------------------------------------------
- * 2. 亮色模式(默认)
- * ------------------------------------------------------------ */
- :root {
- color-scheme: light;
- --canvas: #f6f7f9;
- --surface: #ffffff;
- --surface-2: #f1f3f6;
- --surface-hover: #f6f7f9;
- --surface-active: #eef1f5;
- --edge: #e4e7ec;
- --edge-strong: #cbd2da;
- /* 文字层级全部对白底达到 WCAG AA 4.5:1:
- ink ≈14.7:1 / ink-2 ≈8.0:1 / muted ≈4.8:1。
- ⚠️ faint 为 #9aa1ac(≈2.6:1),**仅限装饰**——
- 分隔线、图标底、占位图形;禁止用于任何承载信息的文字。 */
- --ink: #1f2733;
- --ink-2: #4a5568;
- --muted: #6b7280;
- --faint: #9aa1ac;
- --inverse: #ffffff;
- /* 强调色:靛蓝。避开 Tailwind 默认蓝(#2563eb)的"模板感" */
- --primary: #3b5bdb;
- --primary-hover: #3450c4;
- --primary-active: #2c44a8;
- --primary-subtle: #eef1fd;
- --primary-content: #ffffff;
- --primary-ring: rgb(59 91 219 / 0.35);
- /* 语义色:一律"深字 + 浅底",保证小字标签也能过 AA */
- --success: #047857;
- --success-subtle: #e7f5ef;
- --danger: #b91c1c;
- --danger-subtle: #fdecec;
- --warning: #a04b08;
- --warning-subtle: #fdf1dc;
- --info: #0369a1;
- --info-subtle: #e6f2fa;
- /* 阴影(对齐 tailwind.config boxShadow.soft,供 SCSS 组件内联引用) */
- --shadow-soft: 0 1px 2px rgb(15 23 42 / 0.04), 0 4px 12px rgb(15 23 42 / 0.06);
- }
- /* ------------------------------------------------------------
- * 4. 浮层层级体系(z-index token,由低到高)
- * 所有浮层组件统一引用,禁止再写散落的 z-40/z-50 魔数:
- * - affix 吸顶/吸底元素
- * - float 悬浮按钮(back-top / tabbar / floating-bubble 等)
- * - mask 局部点击遮罩(popconfirm / select / cascader / time-picker /
- * data-table 列设置与筛选 / 横向 menu 的收起遮罩)
- * - popover 局部浮层面板(dropdown / tooltip / select / date-picker /
- * cascader / autocomplete / time-picker 面板、popconfirm 气泡等)
- * - modal 全屏弹层遮罩+面板(modal / drawer / 移动端弹层),
- * 多个同时打开时由 OverlayStackService 在上层动态递增
- * - context-menu 右键菜单
- * - palette 命令面板全屏遮罩
- * - toast 全局消息,永远最高
- * 层级关系:页面内容 < affix < float < mask < popover < modal <
- * context-menu < palette < toast。
- * 注意:popover < modal,因此 modal 打开时页面上的局部浮层不会穿透;
- * modal 内部的浮层则由 modal 面板的 stacking context 兜底,正常显示在其上。
- * ------------------------------------------------------------ */
- :root {
- /* 浮层层级体系(从低到高,保证浮层永远盖住页面内容) */
- --z-affix: 900; /* 固钉 / 回到顶部 */
- --z-float: 950; /* 悬浮按钮 / 悬浮气泡 */
- --z-mask: 980; /* 透明遮罩 */
- --z-popover: 1000; /* 气泡 / 下拉 / 选择器 / 日期面板 / 气泡确认 */
- --z-modal: 1100; /* 抽屉 / 对话框 */
- --z-context-menu: 1150;/* 右键菜单 */
- --z-palette: 1200; /* 命令面板 */
- --z-preview: 1300; /* 图片预览灯箱 */
- --z-toast: 1400; /* 全局消息通知(最高) */
- }
- /* ------------------------------------------------------------
- * 3. 暗色模式(<html class="dark">)
- * ------------------------------------------------------------ */
- .dark {
- color-scheme: dark;
- --canvas: #16181d;
- --surface: #1e2128;
- --surface-2: #272b33;
- --surface-hover: #272b33;
- --surface-active: #333842;
- --edge: #2e333c;
- --edge-strong: #454b56;
- --ink: #f2f4f7;
- --ink-2: #c9cfd8;
- --muted: #98a1ad;
- --faint: #6b727d;
- --inverse: #16181d;
- --primary: #7b93ff;
- --primary-hover: #94a8ff;
- --primary-active: #5c78e8;
- --primary-subtle: rgb(123 147 255 / 0.16);
- --primary-content: #14161b;
- --primary-ring: rgb(123 147 255 / 0.4);
- --success: #34d399;
- --success-subtle: rgb(52 211 153 / 0.14);
- --danger: #f87171;
- --danger-subtle: rgb(248 113 113 / 0.14);
- --warning: #fbbf24;
- --warning-subtle: rgb(251 191 36 / 0.14);
- --info: #38bdf8;
- --info-subtle: rgb(56 189 248 / 0.14);
- }
- /* ------------------------------------------------------------
- * 4. 主题色(accent)切换:覆盖 --primary 系列变量
- * 亮/暗各一套。data-accent 由 ThemeService 写到 <html> 上。
- * ------------------------------------------------------------ */
- [data-accent='violet'] {
- --primary: #7c3aed;
- --primary-hover: #6d28d9;
- --primary-active: #5b21b6;
- --primary-subtle: #f0ebfe;
- --primary-ring: rgb(124 58 237 / 0.35);
- }
- .dark[data-accent='violet'] {
- --primary: #8b5cf6;
- --primary-hover: #a78bfa;
- --primary-active: #7c3aed;
- --primary-subtle: rgb(139 92 246 / 0.16);
- --primary-ring: rgb(139 92 246 / 0.4);
- }
- [data-accent='emerald'] {
- --primary: #059669;
- --primary-hover: #047857;
- --primary-active: #065f46;
- --primary-subtle: #e7f6ef;
- --primary-ring: rgb(5 150 105 / 0.35);
- }
- .dark[data-accent='emerald'] {
- --primary: #10b981;
- --primary-hover: #34d399;
- --primary-active: #059669;
- --primary-subtle: rgb(16 185 129 / 0.16);
- --primary-ring: rgb(16 185 129 / 0.4);
- }
- [data-accent='rose'] {
- --primary: #e11d48;
- --primary-hover: #be123c;
- --primary-active: #9f1239;
- --primary-subtle: #fde8ee;
- --primary-ring: rgb(225 29 72 / 0.35);
- }
- .dark[data-accent='rose'] {
- --primary: #f43f5e;
- --primary-hover: #fb7185;
- --primary-active: #e11d48;
- --primary-subtle: rgb(244 63 94 / 0.16);
- --primary-ring: rgb(244 63 94 / 0.4);
- }
- [data-accent='amber'] {
- --primary: #d97706;
- --primary-hover: #b45309;
- --primary-active: #92400e;
- --primary-subtle: #fdf1dc;
- --primary-ring: rgb(217 119 6 / 0.35);
- }
- .dark[data-accent='amber'] {
- --primary: #f59e0b;
- --primary-hover: #fbbf24;
- --primary-active: #d97706;
- --primary-subtle: rgb(245 158 11 / 0.16);
- --primary-ring: rgb(245 158 11 / 0.4);
- }
- [data-accent='cyan'] {
- --primary: #0891b2;
- --primary-hover: #0e7490;
- --primary-active: #155e75;
- --primary-subtle: #e0f6fb;
- --primary-ring: rgb(8 145 178 / 0.35);
- }
- .dark[data-accent='cyan'] {
- --primary: #06b6d4;
- --primary-hover: #22d3ee;
- --primary-active: #0891b2;
- --primary-subtle: rgb(6 182 212 / 0.16);
- --primary-ring: rgb(6 182 212 / 0.4);
- }
- /* ------------------------------------------------------------
- * 5. 基础(base)样式
- * ------------------------------------------------------------ */
- @layer base {
- * {
- border-color: var(--edge);
- }
- html {
- scroll-behavior: smooth;
- -webkit-tap-highlight-color: transparent;
- }
- body {
- background-color: var(--canvas);
- color: var(--ink);
- /* Inter 优先(行业标配数字界面字体),本机没有则优雅回退到系统字体栈 */
- font-family:
- 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue',
- Arial, 'Noto Sans', 'PingFang SC', 'Microsoft YaHei', sans-serif;
- font-size: 16px;
- line-height: 1.6;
- -webkit-font-smoothing: antialiased;
- -moz-osx-font-smoothing: grayscale;
- }
- /* 全局可见焦点环(键盘导航可达性) */
- :focus-visible {
- outline: 2px solid var(--primary-ring);
- outline-offset: 2px;
- }
- ::selection {
- background-color: var(--primary);
- color: var(--primary-content);
- }
- /* 滚动条 */
- ::-webkit-scrollbar {
- width: 10px;
- height: 10px;
- }
- ::-webkit-scrollbar-track {
- background: transparent;
- }
- ::-webkit-scrollbar-thumb {
- background: var(--edge-strong);
- border-radius: 9999px;
- border: 2px solid var(--canvas);
- }
- ::-webkit-scrollbar-thumb:hover {
- background: var(--muted);
- }
- }
- /* ============================================================
- * 主题切换动画(View Transitions API)
- * 关闭浏览器默认的根快照动画,改由 ThemeService 通过 Web Animations
- * 控制 ::view-transition-new(root) / old(root):
- * - circle:以触发按钮为圆心的向外扩散
- * - wave :从左往右的波浪式扫过
- * - fade :平滑淡入淡出
- * - zoom :缩放聚焦
- * ============================================================ */
- ::view-transition-old(root),
- ::view-transition-new(root) {
- animation: none;
- mix-blend-mode: normal;
- }
- /* ============================================================
- * 后台管理系统辅助模式(灰阶 / 色弱)
- * 应用在 <html> 根元素上,而非局部容器:
- * 若加在容器上,filter 会创建新的包含块,导致内部 position:fixed
- * 浮层(抽屉/对话框/下拉面板)定位错乱。根元素上则不影响任何浮层。
- * ============================================================ */
- html.ui-admin-gray {
- filter: grayscale(1);
- }
- html.ui-admin-color-weak {
- filter: invert(0.8) hue-rotate(180deg);
- }
- /* ============================================================
- * 浮层层级体系(统一 z-index,保证浮层永远在最上层)
- * - 900 回到顶部
- * - 1000 气泡/下拉/选择器/日期面板(触发器上的悬浮层)
- * - 1100 抽屉/对话框/右键菜单
- * - 1200 命令面板
- * - 1300 图片预览灯箱
- * ============================================================ */
- /* ============================================================
- * 6. 学员端增量令牌段(D11 · 自 demo/assets/css/tokens.css 移植)
- * ------------------------------------------------------------
- * ⚠️ 纯追加:只定义新名字,不覆盖既有令牌 → 管理端零影响。
- * 冲突名处理:
- * - --surface 已被 ui-kit 占用(卡片面 #fff),demo 的「输入底/次级面」
- * 更名为 --well;
- * - --ink 两库值近似(#1f2733 vs #1C1E21),沿用 ui-kit 原值不重定义。
- * 暗色跟随 ui-kit 既有机制:html.dark 类(ThemeService 单写入);
- * accent 走 [data-accent],新增 cobalt/green/indigo 三名并同步
- * 映射 --primary 系列(管理端主题选择器选中新色时依然可用)。
- * data-font/data-radius/data-density/data-motion 变体在应用侧
- * (apps/web/src/styles/learner-tokens.css),不进底座。
- * ============================================================ */
- :root {
- /* 字体栈(学员端;中文优先) */
- --font-ui: "PingFang SC", "Noto Sans SC", "HarmonyOS Sans SC", "Microsoft YaHei",
- -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
- /* 字号 12 级 */
- --fs-9: 10.5px; --fs-10: 11px; --fs-11: 11.5px; --fs-12: 12px;
- --fs-13: 13px; --fs-135: 13.5px; --fs-15: 15px; --fs-17: 17px;
- --fs-20: 20px; --fs-26: 26px; --fs-30: 30px; --fs-42: 42px;
- /* 间距 */
- --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
- --sp-5: 20px; --sp-6: 24px; --sp-8: 32px;
- /* 圆角 */
- --r-tag: 999px;
- --r-sm: 11px; /* 小件:图标块 / 引文 */
- --r-md: 14px; /* 输入 / 小卡 */
- --r-lg: 18px; /* 任务条 / 记录条 */
- --r-xl: 20px; /* 场景卡 / 卡片 */
- --r-2xl: 24px; /* 报告大卡 */
- --r-sheet: 32px;/* 底部抽屉 */
- /* 墨色五级(新名,不覆盖 ui-kit --ink/--ink-2/--muted) */
- --ink-deep: #0A1317; /* 近黑:选中底 / 深色 CTA */
- --charcoal: #444950; /* 次文本 */
- --steel: #5D6C7B; /* 三级文本 / 图标 */
- --stone: #8595A4; /* 弱文本 */
- --hairline: #CED0D4; /* 控件描边 */
- --line: #DEE3E9; /* 卡片描边 / 分隔 */
- --well: #F1F4F7; /* 输入底 / 次级面(demo --surface 改名) */
- --card: #FFFFFF;
- --page: #FFFFFF; /* 学员端页面底 */
- --sel-bg: #0A1317; --sel-fg: #FFFFFF; /* tab/chip 选中(暗色下反转) */
- --overlay: rgba(10, 19, 23, .5);
- --overlay-strong: rgba(10, 19, 23, .86); /* 灯箱专用深色遮罩 */
- --on-overlay: #ffffff; --on-overlay-soft: rgb(255 255 255 / .14); --on-overlay-hover: rgb(255 255 255 / .24);
- --sheet-shadow: 0 -12px 40px rgba(10, 19, 23, .18);
- --shadow-card: 0 1px 2px rgba(10, 19, 23, .04);
- /* 毛玻璃(底部导航 / 悬浮工具条) */
- --glass: rgba(255, 255, 255, .72);
- --glass-strong: rgba(255, 255, 255, .86);
- --glass-border: rgba(10, 19, 23, .08);
- --glass-shadow: 0 8px 30px rgba(10, 19, 23, .14);
- --glass-tint: rgba(10, 19, 23, .34);
- /* 语义色(v2 原值) */
- --ok: #31A24C; --ok-bg: #EAF7EF; --ok-ink: #1F7A38;
- --warn-ink: #B26A00; --warn-bg: #FEF6E6;
- --crit: #E41E3F; --crit-ink: #C81836; --crit-soft: #FDECEF;
- --info-bg: #E7F0FD;
- /* 强调色(默认 cobalt) */
- --accent: #0064E0; --accent-deep: #0457CB;
- --accent-soft: #E7F0FD; --accent-tint: #F0F7FF;
- /* 「压在实色上」的前景色 —— 独立评审 A-7:此前这几处散落 #fff 字面量。
- 单开语义位而不是复用 --surface:后者在暗色下会翻成深色,而这几个前景
- 必须始终是与底色拉开对比的那一头。 */
- --accent-fg: #FFFFFF;
- --crit-fg: #FFFFFF;
- --switch-knob: #FFFFFF;
- /* 毛玻璃药丸顶部高光的渐变起点(暗色下要弱得多,故必须进令牌) */
- --glass-sheen: rgba(255, 255, 255, .42);
- /* 氛围背景的第二、三团柔光的色相 —— 与主题色无关(不随 accent / 明暗变化,
- 暗色只压透明度),但仍是色值,按规范收进令牌而非留在组件里 */
- --bgfx-teal: rgba(94, 234, 212, .35);
- --bgfx-violet: rgba(167, 139, 250, .28);
- /* 图表(8 色,亮) */
- --chart-1: #0064E0; --chart-2: #31A24C; --chart-3: #B26A00; --chart-4: #E41E3F;
- --chart-5: #0E9DD7; --chart-6: #7857FF; --chart-7: #0E9384; --chart-8: #5D6C7B;
- --chart-grid: #DEE3E9; --chart-axis: #8595A4; --chart-area: rgba(0, 100, 224, .16);
- }
- /* ---- 暗色(跟随 html.dark,ThemeService 单写入) ---- */
- .dark {
- --ink-deep: #F5F6F7;
- --charcoal: #D3D5DA;
- --steel: #98A0AA;
- --stone: #6C7480;
- --hairline: #3A3E45;
- --line: #2C2F35;
- --well: #1C1E21;
- --card: #1C1E21;
- --page: #000000;
- --sel-bg: #F5F5F7; --sel-fg: #0A1317;
- --overlay: rgba(0, 0, 0, .6);
- --sheet-shadow: 0 -12px 40px rgba(0, 0, 0, .5);
- --shadow-card: 0 1px 2px rgba(0, 0, 0, .3);
- --glass: rgba(28, 30, 33, .72);
- --glass-strong: rgba(28, 30, 33, .88);
- --glass-border: rgba(255, 255, 255, .09);
- --glass-shadow: 0 8px 30px rgba(0, 0, 0, .5);
- --glass-tint: rgba(255, 255, 255, .13);
- --ok: #30D158; --ok-bg: rgba(48, 209, 88, .15); --ok-ink: #5BD677;
- --warn-ink: #FFB340; --warn-bg: rgba(255, 179, 64, .14);
- --crit: #FF453A; --crit-ink: #FF6961; --crit-soft: rgba(255, 69, 58, .15);
- --info-bg: rgba(41, 151, 255, .16);
- --accent: #2997FF; --accent-deep: #5CB3FF;
- --accent-soft: rgba(41, 151, 255, .17); --accent-tint: rgba(41, 151, 255, .09);
- /* 暗色下这三处仍是白(底色 accent/crit 在暗色里更亮,白字对比反而更好) */
- --accent-fg: #FFFFFF;
- --crit-fg: #FFFFFF;
- --switch-knob: #FFFFFF;
- --glass-sheen: rgba(255, 255, 255, .09);
- --chart-1: #2997FF; --chart-2: #30D158; --chart-3: #FFB340; --chart-4: #FF6961;
- --chart-5: #64D2FF; --chart-6: #A78BFF; --chart-7: #66D4CF; --chart-8: #98A0AA;
- --chart-grid: #2C2F35; --chart-axis: #6C7480; --chart-area: rgba(41, 151, 255, .2);
- }
- /* ---- 新增 accent:cobalt(显式规则兜底) ---- */
- :root[data-accent='cobalt'] {
- --accent: #0064E0; --accent-deep: #0457CB; --accent-soft: #E7F0FD; --accent-tint: #F0F7FF;
- --chart-1: #0064E0; --chart-area: rgba(0, 100, 224, .16);
- --primary: #0064E0; --primary-hover: #0457CB; --primary-active: #0448a8;
- --primary-subtle: #E7F0FD; --primary-ring: rgb(0 100 224 / .35);
- }
- .dark[data-accent='cobalt'] {
- --accent: #2997FF; --accent-deep: #5CB3FF; --accent-soft: rgba(41, 151, 255, .17); --accent-tint: rgba(41, 151, 255, .09);
- --chart-1: #2997FF; --chart-area: rgba(41, 151, 255, .2);
- --primary: #2997FF; --primary-hover: #5CB3FF; --primary-active: #0064E0;
- --primary-subtle: rgb(41 151 255 / .16); --primary-ring: rgb(41 151 255 / .4);
- }
- /* ---- 新增 accent:green ---- */
- :root[data-accent='green'] {
- --accent: #1F8A3B; --accent-deep: #15702F; --accent-soft: #E4F6E9; --accent-tint: #F0FBF3;
- --chart-1: #1F8A3B; --chart-area: rgba(31, 138, 59, .16);
- --primary: #1F8A3B; --primary-hover: #15702F; --primary-active: #0f5a26;
- --primary-subtle: #E4F6E9; --primary-ring: rgb(31 138 59 / .35);
- }
- .dark[data-accent='green'] {
- --accent: #30D158; --accent-deep: #69DE85; --accent-soft: rgba(48, 209, 88, .16); --accent-tint: rgba(48, 209, 88, .09);
- --chart-1: #30D158; --chart-area: rgba(48, 209, 88, .2);
- --primary: #30D158; --primary-hover: #69DE85; --primary-active: #1F8A3B;
- --primary-subtle: rgb(48 209 88 / .16); --primary-ring: rgb(48 209 88 / .4);
- }
- /* ---- 新增 accent:indigo ---- */
- :root[data-accent='indigo'] {
- --accent: #5856D6; --accent-deep: #4442BE; --accent-soft: #ECEBFC; --accent-tint: #F4F3FE;
- --chart-1: #5856D6; --chart-area: rgba(88, 86, 214, .16);
- --primary: #5856D6; --primary-hover: #4442BE; --primary-active: #3836a3;
- --primary-subtle: #ECEBFC; --primary-ring: rgb(88 86 214 / .35);
- }
- .dark[data-accent='indigo'] {
- --accent: #7D7AFF; --accent-deep: #9B99FF; --accent-soft: rgba(125, 122, 255, .17); --accent-tint: rgba(125, 122, 255, .09);
- --chart-1: #7D7AFF; --chart-area: rgba(125, 122, 255, .2);
- --primary: #7D7AFF; --primary-hover: #9B99FF; --primary-active: #5856D6;
- --primary-subtle: rgb(125 122 255 / .17); --primary-ring: rgb(125 122 255 / .4);
- }
- /* ---- amber/rose 补 accent 系令牌(demo 五套主题色的剩余两套) ---- */
- :root[data-accent='amber'] {
- --accent: #B26A00; --accent-deep: #8F5400; --accent-soft: #FDF0DA; --accent-tint: #FEF8EE;
- --chart-1: #B26A00; --chart-area: rgba(178, 106, 0, .16);
- }
- .dark[data-accent='amber'] {
- --accent: #FFB340; --accent-deep: #FFC666; --accent-soft: rgba(255, 179, 64, .16); --accent-tint: rgba(255, 179, 64, .09);
- --chart-1: #FFB340; --chart-area: rgba(255, 179, 64, .2);
- }
- :root[data-accent='rose'] {
- --accent: #D8264A; --accent-deep: #B01B3B; --accent-soft: #FCE7EB; --accent-tint: #FEF2F4;
- --chart-1: #D8264A; --chart-area: rgba(216, 38, 74, .15);
- }
- .dark[data-accent='rose'] {
- --accent: #FF6961; --accent-deep: #FF8B85; --accent-soft: rgba(255, 105, 97, .16); --accent-tint: rgba(255, 105, 97, .09);
- --chart-1: #FF6961; --chart-area: rgba(255, 105, 97, .2);
- }
- /* ---- blue/violet/emerald/cyan 的 --accent 映射(学员端组件引用 --accent* 时跟随切换) ---- */
- :root[data-accent='blue'], :root:not([data-accent]) {
- --accent: #3b5bdb; --accent-deep: #364fc7; --accent-soft: #e7edfb; --accent-tint: #f2f6fd;
- --chart-1: #3b5bdb; --chart-area: rgb(59 91 219 / .16);
- }
- .dark[data-accent='blue'], .dark:not([data-accent]) {
- --accent: #748ffc; --accent-deep: #91a7ff; --accent-soft: rgb(116 143 252 / .16); --accent-tint: rgb(116 143 252 / .09);
- --chart-1: #748ffc; --chart-area: rgb(116 143 252 / .2);
- }
- :root[data-accent='violet'] {
- --accent: #7c3aed; --accent-deep: #6d28d9; --accent-soft: #f0e9fd; --accent-tint: #f8f5fe;
- --chart-1: #7c3aed; --chart-area: rgb(124 58 237 / .16);
- }
- .dark[data-accent='violet'] {
- --accent: #a78bfa; --accent-deep: #c4b5fd; --accent-soft: rgb(167 139 250 / .16); --accent-tint: rgb(167 139 250 / .09);
- --chart-1: #a78bfa; --chart-area: rgb(167 139 250 / .2);
- }
- :root[data-accent='emerald'] {
- --accent: #059669; --accent-deep: #047857; --accent-soft: #e2f6ee; --accent-tint: #f0faf6;
- --chart-1: #059669; --chart-area: rgb(5 150 105 / .16);
- }
- .dark[data-accent='emerald'] {
- --accent: #34d399; --accent-deep: #6ee7b7; --accent-soft: rgb(52 211 153 / .16); --accent-tint: rgb(52 211 153 / .09);
- --chart-1: #34d399; --chart-area: rgb(52 211 153 / .2);
- }
- :root[data-accent='cyan'] {
- --accent: #0891b2; --accent-deep: #0e7490; --accent-soft: #e0f6fb; --accent-tint: #effbfe;
- --chart-1: #0891b2; --chart-area: rgb(8 145 178 / .16);
- }
- .dark[data-accent='cyan'] {
- --accent: #06b6d4; --accent-deep: #22d3ee; --accent-soft: rgb(6 182 212 / .16); --accent-tint: rgb(6 182 212 / .09);
- --chart-1: #06b6d4; --chart-area: rgb(6 182 212 / .2);
- }
- /* 基底令牌(原型 :root / midnight)+ 明暗模式 + 布局/动效/阴影
- 真源 styles.css:2-73 | 依据《设计令牌.md》v3.0 §三·§六·§七·§八·§九
- 说明:语义色跨配色固定,故在此定义(palette 只覆盖表面/导航/主色族)。
- 命名一律用 ui-kit 词汇(--canvas/--ink/--edge/--primary…),禁止自有前缀。*/
- :root {
- /* 表面与文字 */
- --canvas: #edf1f6; --surface: #ffffff; --surface-2: #f5f7fa; --surface-hover: #eaf0f7;
- --surface-active: #dfe6f0; --rail-surface: #f0f3f8;
- --edge: #dce3ed; --edge-strong: #c5d0df;
- --ink: #172337; --ink-2: #495b74; --muted: #61728a; --inverse: #ffffff;
- /* 语义色(跨配色固定)—— info 取原型值,非底座 #0369a1(评审 S2)
- --on-danger:danger 底上的文字色。暗色下 --danger 是浅粉,故文字须用深色 */
- --success: #207550; --success-subtle: #edf7f1;
- --warning: #91600e; --warning-subtle: #fff7e8;
- --danger: #c33f42; --danger-subtle: #fff0f0; --on-danger: #ffffff;
- --info: #315fa8; --info-subtle: #edf3fd;
- /* 主色(基底;4 套配色整体覆盖)—— --primary-ring 为推导值(原型未定义 focus 环) */
- --primary: #315acb; --primary-hover: #2548aa; --primary-active: #2548aa;
- --primary-subtle: #eaf0ff; --primary-content: #ffffff; --primary-ring: rgb(49 90 203 / .35);
- /* 导航族(随配色整套变化) */
- --nav-surface: #18243a; --nav-ink: #f3f6fc; --nav-text: #c4cfdf; --nav-muted: #9aadc8;
- --nav-line: #30405a; --nav-hover: #24334d; --nav-active: #2c4167;
- --nav-accent: #b4ccff; --nav-brand: #4269d8; --nav-on-brand: #ffffff;
- /* 辅助族 */
- --metric-fill: #5476ca;
- --avatar-ink: #46618c; --avatar-bg: #eaf0fa; --avatar-ink-alt: #596780; --avatar-bg-alt: #edf0f5;
- --neutral: #687385; --neutral-soft: #eff1f5;
- --overlay: #18223966; --overlay-strong: #182239d9;
- /* 深色遮罩上的前景色:明暗主题下都保持浅色(灯箱/全屏预览用) */
- --on-overlay: #ffffff;
- --on-overlay-soft: rgb(255 255 255 / .14);
- --on-overlay-hover: rgb(255 255 255 / .24);
- /* 字号:锁定 8 档(名称 = 底座,数值 = 原型) */
- --fs-11: 11px; --fs-12: 12px; --fs-13: 13px; --fs-14: 14px;
- --fs-15: 14px; --fs-17: 16px; --fs-20: 20px; --fs-26: 28px; --fs-42: 36px;
- /* 圆角:锁定 4 档 */
- --r-sm: 6px; --r-md: 10px; --r-lg: 16px; --r-tag: 999px;
- /* 动效(底座无此层,由原型引入) */
- --motion-fast: 120ms; --motion-page: 160ms; --motion-detail: 200ms;
- --motion-panel: 240ms; --motion-exit: 160ms;
- --ease-standard: cubic-bezier(.2, 0, 0, 1);
- /* 阴影四级(色基取原型,结构沿用底座;修复底座暗色不可见缺陷) */
- --shadow-soft: 0 1px 2px rgb(23 36 60 / .04), 0 4px 12px rgb(23 36 60 / .06);
- --shadow-card: 0 1px 2px rgb(23 36 60 / .05), 0 8px 24px rgb(23 36 60 / .07);
- --shadow-pop: 0 4px 8px rgb(23 36 60 / .08), 0 16px 32px rgb(23 36 60 / .12);
- --shadow-overlay: 0 8px 16px rgb(23 36 60 / .1), 0 24px 48px rgb(23 36 60 / .18);
- /* 布局令牌 —— 前缀用 --desk-/--mob-(--dk- 是存量禁用前缀);--desk-nav-w* 已随竖栏废弃 */
- --desk-topbar-h: 56px; --desk-tree-w: 280px; --desk-nav-w: 200px; --desk-nav-w-compact: 176px; --desk-nav-w-icon: 72px;
- --desk-list-w: 274px; --desk-list-w-compact: 244px; --desk-list-w-narrow: 250px;
- --desk-main-min-w: 480px; --desk-aside-w: 320px; --desk-aside-w-compact: 300px;
- --mob-navbar-h: 60px; --mob-tabbar-h: 64px; --mob-gutter: 16px;
- --mob-safe-top: env(safe-area-inset-top, 0px);
- --mob-safe-bottom: env(safe-area-inset-bottom, 0px);
- --touch-min: 44px; /* 无障碍硬约束,非设计偏好 */
- /* 页面最大宽度(《双端布局规范》v2.1 §2.4)—— 窗口更宽时居中留白,避免超宽屏内容拉散 */
- --page-max-w: 1440px; /* 通用/仪表盘类 */
- --page-max-w-narrow: 980px; /* 阅读型(事件流) */
- --page-max-w-settings: 1240px; /* 设置页 */
- }
- /* 暗色:--inverse 与 --primary-content 同源统一(评审 A5) */
- .dark {
- --canvas: #11151c; --surface: #191f29; --surface-2: #1e2531; --surface-hover: #2a3342;
- --surface-active: #333c4c; --rail-surface: #141b26;
- --edge: #2d3747; --edge-strong: #414f65;
- --ink: #edf1f8; --ink-2: #b8c2d2; --muted: #98a6bc; --inverse: #14203b;
- --success: #8ed2ac; --success-subtle: #1d352c;
- --warning: #e8bf77; --warning-subtle: #382f22;
- --danger: #f2a0a5; --danger-subtle: #3b272f; --on-danger: #3b272f;
- --info: #acc9fa; --info-subtle: #273a55;
- --primary: #93b5ff; --primary-hover: #b0c9ff; --primary-active: #93b5ff;
- --primary-subtle: #253451; --primary-content: #14203b; --primary-ring: rgb(147 181 255 / .4);
- --nav-surface: #0c1320; --nav-hover: #1a2940; --nav-active: #243957; --nav-line: #25324a;
- --metric-fill: #a8c2ff;
- --avatar-ink: #b7cdf2; --avatar-bg: #2b3b56; --avatar-ink-alt: #bac7db; --avatar-bg-alt: #2d3748;
- --neutral: #acb7c9; --neutral-soft: #2b3341;
- --overlay: #070b12a6; --overlay-strong: #070b12e6;
- --on-overlay: #ffffff; --on-overlay-soft: rgb(255 255 255 / .14); --on-overlay-hover: rgb(255 255 255 / .24);
- --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);
- --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);
- }
- /* 四套「整体配色」· 应用层覆盖块(令牌数据,非业务样式)
- 真源 styles.css:116-195 | 依据 ADR-006 v2.0 §三 +《设计令牌.md》v3.0 §四
- 🔴 必须用 :root[data-palette] / .dark[data-palette](与底座同特异性,评审 G4)
- 语义色不在此:跨配色固定,定义在 styles.scss
- 🔑 同时命中 [data-preview-palette] —— 让「我的」页的配色缩略图能在各自作用域内
- 渲染出**该套配色自身**的 nav/content 色块(否则缩略图只显示当前配色,看不出差异)。*/
- /* ---------- platinum · 铂金曜黑(默认)---------- */
- :root[data-palette='platinum'],
- [data-preview-palette='platinum'] {
- --canvas: #f2f3f5; --surface: #ffffff; --surface-2: #f7f7f8; --surface-hover: #e9eaec;
- --rail-surface: #eceef0; --ink: #202124; --ink-2: #45474b; --muted: #62666d;
- --edge: #dfe1e4; --edge-strong: #c4c7cc;
- --primary: #25272a; --primary-hover: #111214; --primary-subtle: #e8e9eb; --primary-content: #ffffff;
- --nav-surface: #202124; --nav-ink: #f5f5f6; --nav-text: #c6c8cc; --nav-muted: #a9adb4;
- --nav-line: #393b3f; --nav-hover: #303236; --nav-active: #3b3d41;
- --nav-accent: #ffffff; --nav-brand: #f5f5f6; --nav-on-brand: #202124;
- --metric-fill: #6c737d;
- --avatar-ink: #565d67; --avatar-bg: #e9eaec; --avatar-ink-alt: #62666d; --avatar-bg-alt: #eeeff0;
- --neutral: #656a72; --neutral-soft: #eceef0;
- --overlay: #11121470; --overlay-strong: #111214d9; --shadow: 0 16px 56px #2021241f;
- }
- .dark[data-palette='platinum'],
- [data-preview-palette='platinum'][data-preview-theme='dark'] {
- --canvas: #18191b; --surface: #222426; --surface-2: #292b2e; --surface-hover: #383b3f;
- --rail-surface: #1d1f21; --ink: #f2f3f4; --ink-2: #c5c8cc; --muted: #a7abb1;
- --edge: #383b3f; --edge-strong: #565a60;
- --primary: #f1f2f3; --primary-hover: #ffffff; --primary-subtle: #373a3e; --primary-content: #202124;
- --nav-surface: #111214; --nav-ink: #f2f3f4; --nav-text: #c6c8cc; --nav-muted: #a4a8ae;
- --nav-line: #303236; --nav-hover: #25272a; --nav-active: #34373b;
- --nav-accent: #f1f2f3; --nav-brand: #f1f2f3; --nav-on-brand: #202124;
- --metric-fill: #c0c4ca;
- --avatar-ink: #c9cdd3; --avatar-bg: #373a3e; --avatar-ink-alt: #c5c8cd; --avatar-bg-alt: #393c40;
- --neutral: #bec2c8; --neutral-soft: #373a3e;
- --overlay: #08090bb0; --overlay-strong: #08090be6; --shadow: 0 18px 70px #00000066;
- }
- /* ---------- ice · 冰白靛蓝(导航为浅色)---------- */
- :root[data-palette='ice'],
- [data-preview-palette='ice'] {
- --canvas: #f6f8fc; --surface: #ffffff; --surface-2: #f1f4f9; --surface-hover: #e7ecf5;
- --rail-surface: #edf1f7; --ink: #202a3c; --ink-2: #46536b; --muted: #606e86;
- --edge: #dce2ec; --edge-strong: #c2ccdc;
- --primary: #4056c7; --primary-hover: #3045ae; --primary-subtle: #e8ecfb; --primary-content: #ffffff;
- --nav-surface: #e9edf5; --nav-ink: #202a3c; --nav-text: #394761; --nav-muted: #53617a;
- --nav-line: #d3dae7; --nav-hover: #dce3ef; --nav-active: #d9e1f2;
- --nav-accent: #4056c7; --nav-brand: #4056c7; --nav-on-brand: #ffffff;
- --metric-fill: #536ac9;
- --avatar-ink: #475b9a; --avatar-bg: #e6ebf7; --avatar-ink-alt: #55647f; --avatar-bg-alt: #e9edf3;
- --neutral: #626e83; --neutral-soft: #e9edf3;
- --overlay: #18243b66; --overlay-strong: #18243bd9; --shadow: 0 16px 56px #27354d1c;
- }
- .dark[data-palette='ice'],
- [data-preview-palette='ice'][data-preview-theme='dark'] {
- --canvas: #171b24; --surface: #202632; --surface-2: #272f3d; --surface-hover: #343f51;
- --rail-surface: #1b222e; --ink: #f0f3fa; --ink-2: #bec8d9; --muted: #a1aec3;
- --edge: #343e4f; --edge-strong: #515f76;
- --primary: #b4c2ff; --primary-hover: #cbd4ff; --primary-subtle: #303957; --primary-content: #1d2546;
- --nav-surface: #111722; --nav-ink: #f0f3fa; --nav-text: #c7d0e0; --nav-muted: #a6b3c9;
- --nav-line: #2b3546; --nav-hover: #212b3c; --nav-active: #2c3954;
- --nav-accent: #b4c2ff; --nav-brand: #b4c2ff; --nav-on-brand: #1d2546;
- --metric-fill: #acbcff;
- --avatar-ink: #becbfa; --avatar-bg: #2d3854; --avatar-ink-alt: #c1cce0; --avatar-bg-alt: #303a4c;
- --neutral: #bdc7d8; --neutral-soft: #303947;
- --overlay: #080c14b0; --overlay-strong: #080c14e6; --shadow: 0 18px 70px #00000066;
- }
- /* ---------- clay · 暖瓷陶橘 ---------- */
- :root[data-palette='clay'],
- [data-preview-palette='clay'] {
- --canvas: #f3f0eb; --surface: #fffdfa; --surface-2: #f7f3ee; --surface-hover: #ede7df;
- --rail-surface: #eee9e2; --ink: #2a2623; --ink-2: #514943; --muted: #70665f;
- --edge: #e2dbd3; --edge-strong: #cfc4b9;
- --primary: #af482b; --primary-hover: #92391f; --primary-subtle: #f6e8e1; --primary-content: #ffffff;
- --nav-surface: #302c29; --nav-ink: #f7f3ef; --nav-text: #d5cbc3; --nav-muted: #b9ada4;
- --nav-line: #49413c; --nav-hover: #403a35; --nav-active: #50453d;
- --nav-accent: #f1ad8e; --nav-brand: #f1ad8e; --nav-on-brand: #30211b;
- --metric-fill: #ad674d;
- --avatar-ink: #795643; --avatar-bg: #f0e7df; --avatar-ink-alt: #6d5d52; --avatar-bg-alt: #eee9e4;
- --neutral: #70665f; --neutral-soft: #eee9e4;
- --overlay: #211b1770; --overlay-strong: #211b17d9; --shadow: 0 16px 56px #38281e1c;
- }
- .dark[data-palette='clay'],
- [data-preview-palette='clay'][data-preview-theme='dark'] {
- --canvas: #1d1a18; --surface: #292522; --surface-2: #322d29; --surface-hover: #433a34;
- --rail-surface: #221f1c; --ink: #f3eee9; --ink-2: #d0c5bc; --muted: #b2a69c;
- --edge: #403832; --edge-strong: #5d5047;
- --primary: #f0a184; --primary-hover: #ffb89c; --primary-subtle: #49342c; --primary-content: #3b2119;
- --nav-surface: #171513; --nav-ink: #f3eee9; --nav-text: #d2c7be; --nav-muted: #afa197;
- --nav-line: #38302b; --nav-hover: #2b2521; --nav-active: #3c3029;
- --nav-accent: #f0a184; --nav-brand: #f0a184; --nav-on-brand: #3b2119;
- --metric-fill: #e09a7c;
- --avatar-ink: #e3b99c; --avatar-bg: #40332c; --avatar-ink-alt: #d7c2b2; --avatar-bg-alt: #3a332e;
- --neutral: #cec0b5; --neutral-soft: #39332e;
- --overlay: #0d0a08b0; --overlay-strong: #0d0a08e6; --shadow: 0 18px 70px #00000066;
- }
- /* ---------- slate · 岩灰鸢紫 ---------- */
- :root[data-palette='slate'],
- [data-preview-palette='slate'] {
- --canvas: #f1f0f5; --surface: #ffffff; --surface-2: #f6f5f9; --surface-hover: #eae8f0;
- --rail-surface: #eceaf1; --ink: #282633; --ink-2: #4c4a5d; --muted: #666476;
- --edge: #dfdde7; --edge-strong: #c7c3d2;
- --primary: #6952a3; --primary-hover: #55418b; --primary-subtle: #efebf8; --primary-content: #ffffff;
- --nav-surface: #282735; --nav-ink: #f4f2fa; --nav-text: #d1cde0; --nav-muted: #b2adc6;
- --nav-line: #403e50; --nav-hover: #373546; --nav-active: #48445d;
- --nav-accent: #c9baf1; --nav-brand: #c9baf1; --nav-on-brand: #302844;
- --metric-fill: #7a66ad;
- --avatar-ink: #655a91; --avatar-bg: #eeebf5; --avatar-ink-alt: #666174; --avatar-bg-alt: #efedf2;
- --neutral: #686678; --neutral-soft: #edecf1;
- --overlay: #201d2b70; --overlay-strong: #201d2bd9; --shadow: 0 16px 56px #2826331c;
- }
- .dark[data-palette='slate'],
- [data-preview-palette='slate'][data-preview-theme='dark'] {
- --canvas: #1b1a22; --surface: #26242f; --surface-2: #302d3b; --surface-hover: #413d50;
- --rail-surface: #211f29; --ink: #f2f0f8; --ink-2: #c9c5d7; --muted: #aaa6bc;
- --edge: #3d394a; --edge-strong: #5a556d;
- --primary: #c9baf1; --primary-hover: #dacff7; --primary-subtle: #3c354f; --primary-content: #302844;
- --nav-surface: #17161e; --nav-ink: #f2f0f8; --nav-text: #d0cce0; --nav-muted: #aaa5bf;
- --nav-line: #343141; --nav-hover: #282634; --nav-active: #383447;
- --nav-accent: #c9baf1; --nav-brand: #c9baf1; --nav-on-brand: #302844;
- --metric-fill: #c1b1ee;
- --avatar-ink: #c9bdf0; --avatar-bg: #373249; --avatar-ink-alt: #c9c2da; --avatar-bg-alt: #393644;
- --neutral: #c4bfd2; --neutral-soft: #383543;
- --overlay: #0c0b10b0; --overlay-strong: #0c0b10e6; --shadow: 0 18px 70px #00000066;
- }
- /* Review shell uses the application's real tokens; no production components change. */
- * { box-sizing: border-box; }
- [hidden] { display: none !important; }
- html { height: 100%; }
- 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; }
- button, input, select { font: inherit; color: inherit; }
- button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
- button { cursor: pointer; }
- a { color: inherit; text-decoration: none; }
- button { border: 0; background: none; }
- button:disabled { opacity: .45; cursor: not-allowed; }
- button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
- h1,h2,h3,h4,p { margin: 0; }
- svg { display: block; flex: none; }
- .icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
- .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%); }
- .skip-link:focus { transform: none; }
- .review-bar { position: relative; z-index: var(--z-affix); background: var(--surface); border-bottom: 1px solid var(--edge); }
- .review-line { display: flex; min-height: 48px; align-items: center; gap: var(--sp-5); padding: 0 var(--sp-6); }
- .review-label { display: flex; align-items: center; gap: var(--sp-2); flex: none; font-size: var(--fs-13); font-weight: 600; }
- .review-dot { width: 7px; height: 7px; border-radius: var(--r-tag); background: var(--warning); }
- .review-version { color: var(--muted); font-size: var(--fs-12); font-weight: 400; }
- .review-line > p { flex: 1; color: var(--ink-2); font-size: var(--fs-12); }
- .review-line > p > span { margin-left: var(--sp-3); color: var(--muted); }
- .review-actions { display: flex; gap: var(--sp-2); margin-left: auto; }
- .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); }
- .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); }
- .review-scenarios, .review-events { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
- .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); }
- .review-controls button:hover { border-color: var(--edge-strong); background: var(--surface-hover); }
- .review-events { margin-top: var(--sp-2); }
- .review-events > span, .review-state { color: var(--muted); font-size: var(--fs-12); }
- .review-state { margin-top: var(--sp-2); }
- .app-shell { display: grid; grid-template-columns: 224px minmax(0,1fr); min-height: 0; }
- .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); }
- .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; }
- .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; }
- .brand-registered { align-self: start; margin: 1px 0 0 -5px; color: var(--muted); font-size: 9px; }
- .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; }
- .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); }
- .workspace-label small { display: block; margin-top: 2px; color: var(--muted); font-size: var(--fs-11); font-weight: 400; }
- .sidebar-heading { margin: 0 var(--sp-3) var(--sp-2); color: var(--muted); font-size: var(--fs-11); }
- .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; }
- .nav-button.on { background: var(--primary-subtle); color: var(--ink); font-weight: 600; }
- .nav-button:hover { background: var(--surface-hover); color: var(--ink); }
- .nav-button .icon { width: 18px; height: 18px; }
- .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); }
- .sidebar-bottom { margin-top: auto; padding-top: var(--sp-6); }
- .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); }
- .sidebar-note small { display: block; margin-top: var(--sp-1); color: var(--muted); font-size: var(--fs-11); }
- .status-dot { display: inline-block; width: 6px; height: 6px; flex: none; margin-top: 7px; border-radius: var(--r-tag); background: var(--success); }
- .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); }
- .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); }
- .account-button small { display: block; color: var(--muted); font-size: var(--fs-11); }
- .account-more { margin-left: auto; }
- .workspace { display: grid; min-height: 0; min-width: 0; grid-template-rows: 64px minmax(0,1fr); }
- .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); }
- .app-breadcrumb { display: flex; align-items: center; gap: var(--sp-3); font-size: var(--fs-13); }
- .desktop-breadcrumb { color: var(--muted); }
- .desktop-breadcrumb > span { margin-left: var(--sp-3); color: var(--edge-strong); }
- .app-breadcrumb strong { font-weight: 500; }
- .mobile-brand { display: none; }
- .header-end { display: flex; align-items: center; gap: var(--sp-5); }
- .header-safe { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: var(--fs-12); }
- .header-safe .icon { width: 15px; height: 15px; }
- .avatar-button { min-width: 44px; min-height: 44px; width: 32px; height: 32px; background: transparent; }
- .avatar-button::first-letter { background: var(--avatar-bg); }
- main { min-height: 0; min-width: 0; overflow: auto; overscroll-behavior: contain; padding: var(--sp-8); }
- .page { width: min(1120px,100%); margin-inline: auto; }
- .page.narrow { max-width: 850px; }
- .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); }
- .subject-switch > span,.subject-switch small { color: var(--muted); font-size: var(--fs-12); }
- .subject-switch > span { margin-right: var(--sp-2); }
- .subject-switch small { margin-left: auto; }
- .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); }
- .subject-switch button[aria-pressed='true'] { background: var(--primary-subtle); color: var(--ink); font-weight: 600; }
- .subject-switch .icon { width: 16px; height: 16px; }
- .page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-6); margin-bottom: var(--sp-6); }
- .eyebrow { display: flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-2); color: var(--muted); font-size: var(--fs-12); }
- .eyebrow .icon { width: 15px; height: 15px; }
- h1 { font-size: var(--fs-26); font-weight: 600; letter-spacing: -.05em; line-height: 1.4; }
- .page-heading p, .lead { margin-top: var(--sp-2); color: var(--muted); font-size: var(--fs-14); }
- .page-heading > .button { flex: none; }
- .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; }
- .button:hover { background: var(--primary-hover); }
- .button.secondary { border-color: var(--edge); background: var(--surface); color: var(--ink); }
- .button.secondary:hover { border-color: var(--edge-strong); background: var(--surface-hover); }
- .button.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
- .button.ghost:hover { background: var(--surface-hover); }
- .button .icon { width: 17px; height: 17px; }
- .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; }
- .text-action .icon { width: 15px; height: 15px; }
- .panel { padding: var(--sp-6); border: 1px solid var(--edge); border-radius: var(--r-lg); background: var(--surface); }
- .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); }
- .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); }
- .trial-icon .icon { width: 24px; height: 24px; }
- .trial-banner h2 { display: flex; align-items: center; gap: var(--sp-3); font-size: var(--fs-20); font-weight: 600; letter-spacing: -.04em; }
- .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; }
- .trial-banner p { margin-top: 6px; color: var(--muted); font-size: var(--fs-13); }
- .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); }
- .trial-facts span { display: inline-flex; align-items: center; gap: 5px; }
- .trial-facts .icon { width: 13px; height: 13px; color: var(--success); }
- .section-heading { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); margin-bottom: var(--sp-4); }
- .section-heading h2 { font-size: var(--fs-17); font-weight: 600; }
- .section-heading p { color: var(--muted); font-size: var(--fs-12); }
- .plan-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: var(--sp-4); }
- .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); }
- .plan-card.featured { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
- .plan-mobile-copy,.plan-mobile-action { display: none; }
- .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; }
- .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); }
- .plan-card h3 { font-size: var(--fs-20); font-weight: 600; }
- .plan-name-short { display: none; }
- .plan-card > p { margin-top: 5px; color: var(--muted); font-size: var(--fs-13); }
- .plan-quota { display: none; }
- .plan-price { display: flex; align-items: baseline; gap: 7px; margin-block: var(--sp-6) var(--sp-1); }
- .plan-price strong { font-size: var(--fs-26); font-weight: 600; letter-spacing: -.05em; }
- .plan-price span { color: var(--muted); font-size: var(--fs-12); }
- .plan-billing-note { min-height: 24px; color: var(--muted); font-size: var(--fs-12); }
- .plan-card > .button { margin-top: var(--sp-4); width: 100%; }
- .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; }
- .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; }
- .plan-perks .icon { width: 14px; height: 14px; margin-top: 4px; color: var(--muted); }
- .plans-note { display: flex; gap: var(--sp-2); margin: var(--sp-5) 0 var(--sp-8); color: var(--muted); font-size: var(--fs-12); }
- .plans-note .icon { width: 15px; height: 15px; margin-top: 2px; }
- .info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
- .info-item { display: flex; align-items: flex-start; gap: var(--sp-3); }
- .info-item > .icon { margin-top: 4px; color: var(--muted); }
- .info-item h3 { margin-bottom: 5px; font-size: var(--fs-14); font-weight: 500; }
- .info-item p { max-width: 400px; color: var(--muted); font-size: var(--fs-13); }
- .info-item .text-action { margin-top: var(--sp-1); }
- .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); }
- .notice .icon { width: 18px; height: 18px; margin-top: 2px; flex: none; }
- .notice strong { display: block; font-weight: 500; }
- .notice p { margin-top: var(--sp-1); color: var(--muted); }
- .notice.warning { border-color: color-mix(in srgb,var(--warning) 25%,var(--edge)); background: var(--warning-subtle); color: var(--warning); }
- .notice.warning p { color: var(--warning); }
- .notice.info { background: var(--info-subtle); color: var(--info); }
- .notice.info p { color: var(--info); }
- .notice.success { background: var(--success-subtle); color: var(--success); }
- .notice.success p { color: var(--success); }
- .notice > .button { margin-left: auto; flex: none; }
- .waiting-layout { display: grid; grid-template-columns: minmax(0,1fr) 280px; align-items: start; gap: var(--sp-5); }
- .waiting-card { padding: var(--sp-6); }
- .task-hero { display: flex; align-items: center; gap: var(--sp-4); padding-bottom: var(--sp-6); }
- .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); }
- .task-orb .icon { width: 26px; height: 26px; }
- .task-orb.success { background: var(--success-subtle); color: var(--success); }
- .task-orb.failed { background: var(--danger-subtle); color: var(--danger); }
- .task-hero h2 { font-size: var(--fs-20); font-weight: 600; letter-spacing: -.04em; }
- .task-hero p { margin-top: var(--sp-1); color: var(--muted); font-size: var(--fs-13); }
- .progress-label { display: flex; justify-content: space-between; color: var(--muted); font-size: var(--fs-12); }
- .progress-label strong { color: var(--ink); font-weight: 500; }
- .progress-track { width: 100%; height: 5px; margin-top: var(--sp-3); overflow: hidden; border-radius: var(--r-tag); background: var(--surface-hover); }
- .progress-fill { height: 100%; border-radius: inherit; background: var(--primary); }
- .job-steps { margin: var(--sp-6) 0; padding: 0; list-style: none; }
- .job-step { position: relative; display: grid; grid-template-columns: 28px minmax(0,1fr) auto; gap: var(--sp-3); min-height: 72px; }
- .job-step:not(:last-child)::after { position: absolute; top: 29px; bottom: 3px; left: 13px; width: 1px; background: var(--edge); content: ''; }
- .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); }
- .step-icon .icon { width: 14px; height: 14px; }
- .job-step.done .step-icon { border-color: transparent; background: var(--success-subtle); color: var(--success); }
- .job-step.current .step-icon { border-color: var(--primary); background: var(--primary); color: var(--primary-content); }
- .job-step.failed .step-icon { border-color: transparent; background: var(--danger-subtle); color: var(--danger); }
- .step-copy strong { display: block; font-size: var(--fs-14); font-weight: 500; }
- .step-copy p { margin-top: 3px; color: var(--muted); font-size: var(--fs-12); }
- .step-state { padding-top: 3px; color: var(--muted); font-size: var(--fs-11); white-space: nowrap; }
- .job-step.done .step-state { color: var(--success); }
- .job-step.failed .step-state { color: var(--danger); }
- .waiting-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); padding-top: var(--sp-5); border-top: 1px solid var(--edge); }
- .waiting-foot { margin-top: var(--sp-4); color: var(--muted); font-size: var(--fs-12); }
- .waiting-simple { display: flex; min-height: 500px; align-items: center; flex-direction: column; justify-content: center; padding: var(--sp-8); }
- .waiting-current { text-align: center; }
- .waiting-current .task-orb { width: 64px; height: 64px; margin: 0 auto var(--sp-5); }
- .waiting-current h2 { font-size: var(--fs-26); font-weight: 600; letter-spacing: -.04em; }
- .waiting-current > p { margin: var(--sp-2) 0 var(--sp-3); color: var(--muted); font-size: var(--fs-14); }
- .waiting-progress { width: min(360px,100%); margin-top: var(--sp-8); }
- .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; }
- .waiting-meta dt { color: var(--muted); font-size: var(--fs-12); }
- .waiting-meta dd { margin: var(--sp-1) 0 0; color: var(--ink); font-size: var(--fs-14); }
- .waiting-simple .waiting-actions { justify-content: center; padding-top: 0; border-top: 0; }
- .support-action { margin-top: var(--sp-3); color: var(--muted); font-size: var(--fs-12); }
- .task-summary h3 { margin-bottom: var(--sp-4); font-size: var(--fs-14); font-weight: 500; }
- .summary-facts { margin: 0; }
- .summary-facts > div { margin-top: var(--sp-4); }
- .summary-facts dt { margin-bottom: 4px; color: var(--muted); font-size: var(--fs-12); }
- .summary-facts dd { margin: 0; font-size: var(--fs-13); overflow-wrap: anywhere; }
- .summary-facts dd.emphasis { font-weight: 600; }
- .task-summary .text-action { margin-top: var(--sp-4); font-size: var(--fs-12); }
- .small-panel { margin-top: var(--sp-4); padding: var(--sp-5); }
- .small-panel h3 { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-13); font-weight: 500; }
- .small-panel h3 .icon { width: 16px; height: 16px; }
- .small-panel p { margin-top: var(--sp-2); color: var(--muted); font-size: var(--fs-12); }
- .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; }
- .state-pill.ready { color: var(--success); background: var(--success-subtle); }
- .state-pill.pending { color: var(--warning); background: var(--warning-subtle); }
- .state-pill.expired { color: var(--danger); background: var(--danger-subtle); }
- .quota-panel { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-5); margin-bottom: var(--sp-6); }
- .quota-copy h2 { font-size: var(--fs-14); font-weight: 500; }
- .quota-copy p { margin-top: var(--sp-1); color: var(--muted); font-size: var(--fs-13); }
- .quota-meter { min-width: 180px; }
- .quota-meter p { color: var(--muted); font-size: var(--fs-12); }
- .quota-meter strong { color: var(--ink); font-size: var(--fs-20); font-weight: 600; }
- .container-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: var(--sp-4); }
- .container-card { padding: var(--sp-5); }
- .container-head { display: flex; align-items: center; gap: var(--sp-3); }
- .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; }
- .container-head > div { min-width: 0; }
- .container-head h3 { overflow: hidden; font-size: var(--fs-17); font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
- .container-head small { color: var(--muted); font-size: var(--fs-12); }
- .container-head > .state-pill { margin-left: auto; }
- .container-meta { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-5); color: var(--muted); font-size: var(--fs-12); }
- .container-caption { margin-top: var(--sp-3); color: var(--ink-2); font-size: var(--fs-13); }
- .container-actions { display: grid; grid-template-columns: 1fr auto; gap: var(--sp-2); margin-top: var(--sp-5); }
- .container-actions .button { padding-inline: var(--sp-3); font-size: var(--fs-13); }
- .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; }
- .create-card > .icon { width: 26px; height: 26px; }
- .create-card strong { color: var(--ink-2); font-size: var(--fs-14); font-weight: 500; }
- .create-card p { font-size: var(--fs-12); }
- .empty-state { display: flex; min-height: 350px; align-items: center; justify-content: center; flex-direction: column; gap: var(--sp-3); text-align: center; }
- .empty-state > .task-orb { margin-bottom: var(--sp-3); }
- .empty-state h2 { font-size: var(--fs-20); font-weight: 500; }
- .empty-state p { max-width: 430px; color: var(--muted); font-size: var(--fs-14); }
- .empty-state .button { margin-top: var(--sp-3); }
- .resource-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-5); }
- .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; }
- .resource-panel h2 .icon { width: 19px; height: 19px; }
- .resource-panel > p { color: var(--muted); font-size: var(--fs-13); }
- .credential-list { margin: var(--sp-5) 0 0; }
- .credential-row { padding-block: var(--sp-4); border-top: 1px solid var(--edge); }
- .credential-row dt { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-2); color: var(--muted); font-size: var(--fs-12); }
- .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; }
- .credential-row .button { min-height: 44px; padding-inline: var(--sp-2); flex: none; margin: -10px 0; font-size: var(--fs-12); }
- .masked-value { letter-spacing: .12em; }
- .credential-fake { margin-top: var(--sp-3); color: var(--muted); font-size: var(--fs-12); }
- .expired-intro { margin-bottom: var(--sp-6); }
- .expired-intro .task-orb { margin-bottom: var(--sp-4); }
- .expired-intro h1 { margin-bottom: var(--sp-3); }
- .expired-intro p { max-width: 620px; color: var(--muted); font-size: var(--fs-14); }
- .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); }
- .preserved-resource > div { flex: 1; }
- .preserved-resource strong { font-size: var(--fs-14); font-weight: 500; }
- .preserved-resource p { margin-top: 3px; color: var(--muted); font-size: var(--fs-12); }
- .enterprise-layout { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: var(--sp-5); }
- .enterprise-card h2 { margin-bottom: var(--sp-3); font-size: var(--fs-20); font-weight: 600; }
- .enterprise-card > p { color: var(--muted); font-size: var(--fs-14); }
- .join-steps { display: flex; flex-direction: column; gap: var(--sp-5); margin-block: var(--sp-6); }
- .join-step { display: flex; align-items: flex-start; gap: var(--sp-3); }
- .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); }
- .join-step strong { font-size: var(--fs-14); font-weight: 500; }
- .join-step p { margin-top: var(--sp-1); color: var(--muted); font-size: var(--fs-13); }
- .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); }
- .copy-id > div { flex: 1; }
- .copy-id small { display: block; color: var(--muted); font-size: var(--fs-12); }
- .copy-id strong { font-family: ui-monospace,Consolas,monospace; font-size: var(--fs-14); font-weight: 500; }
- .company-heading { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-5); }
- .company-heading h2 { font-size: var(--fs-17); font-weight: 500; }
- .company-heading p { color: var(--muted); font-size: var(--fs-12); }
- .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); }
- .company-member strong { font-size: var(--fs-14); font-weight: 500; }
- .company-member small { display: block; color: var(--muted); font-size: var(--fs-12); }
- .company-member > .state-pill { margin-left: auto; }
- .mobile-nav { display: none; }
- .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); }
- .ui-dialog::backdrop { background: var(--overlay); backdrop-filter: blur(3px); }
- .dialog-close { position: absolute; top: var(--sp-2); right: var(--sp-2); width: 44px; height: 44px; color: var(--muted); font-size: var(--fs-26); }
- .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); }
- .dialog-kicker .icon { width: 17px; height: 17px; }
- .ui-dialog h2 { padding-right: var(--sp-4); font-size: var(--fs-20); font-weight: 600; }
- .dialog-description { margin-top: var(--sp-3); color: var(--muted); font-size: var(--fs-14); }
- .ui-dialog .notice { margin-top: var(--sp-5); margin-bottom: 0; }
- .form-field { display: block; margin-top: var(--sp-5); }
- .form-field > span { display: block; margin-bottom: var(--sp-2); font-size: var(--fs-13); }
- .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; }
- .form-field small { display: block; margin-top: var(--sp-2); color: var(--muted); font-size: var(--fs-12); }
- .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); }
- .dialog-facts small { display: block; margin-bottom: var(--sp-1); color: var(--muted); font-size: var(--fs-12); }
- .dialog-facts strong { font-size: var(--fs-13); font-weight: 500; }
- .dialog-actions { display: flex; justify-content: flex-end; gap: var(--sp-3); margin-top: var(--sp-6); }
- .dialog-actions .button { min-width: 100px; }
- .dialog-feedback { margin-top: var(--sp-4); color: var(--success); font-size: var(--fs-13); }
- .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; }
- .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; }
- .toast.visible { opacity: 1; transform: none; }
- @media (max-width: 1100px) {
- .app-shell { grid-template-columns: 192px minmax(0,1fr); }
- main { padding: var(--sp-6); }
- .plan-grid { gap: var(--sp-3); }
- .plan-card { padding: var(--sp-5); }
- .waiting-layout { grid-template-columns: minmax(0,1fr) 240px; gap: var(--sp-4); }
- .enterprise-layout { grid-template-columns: 1fr; }
- }
- @media (max-width: 939px) and (min-width: 768px) {
- .app-shell { grid-template-columns: 76px minmax(0,1fr); }
- .sidebar { padding-inline: var(--sp-3); }
- .brand { margin: 0 auto var(--sp-6); font-size: 0; }
- .brand-mark { font-size: var(--fs-20); }
- .brand-registered,.workspace-label,.sidebar-heading,.nav-button > span,.sidebar-note,.account-button > span:not(.account-avatar) { display: none; }
- .nav-button { justify-content: center; padding: 0; }
- .account-button { justify-content: center; padding-inline: 0; }
- .waiting-layout { grid-template-columns: 1fr; }
- .task-aside { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
- .small-panel { margin-top: 0; }
- .review-line > p { display: none; }
- }
- @media (max-width: 767px) {
- body { font-size: var(--fs-14); }
- .review-line { min-height: 44px; gap: var(--sp-2); padding-inline: var(--sp-3); }
- .review-line > p,.review-version { display: none; }
- .review-label { font-size: var(--fs-12); }
- .review-actions { gap: 0; }
- .review-button { font-size: var(--fs-12); padding-inline: var(--sp-2); }
- .review-controls { max-height: 35dvh; padding: var(--sp-3); }
- .review-controls button { font-size: var(--fs-12); min-height: 40px; }
- .review-events > span { width: 100%; margin-block: var(--sp-1); }
- .app-shell { display: block; }
- .sidebar { display: none; }
- .workspace { height: 100%; grid-template-rows: 52px minmax(0,1fr) auto; }
- .app-header { padding-inline: var(--sp-4); }
- .desktop-breadcrumb,.header-safe { display: none; }
- .app-breadcrumb { gap: var(--sp-2); }
- .app-breadcrumb strong { padding-left: var(--sp-2); border-left: 1px solid var(--edge); font-size: var(--fs-13); }
- .mobile-brand { display: inline; font-size: var(--fs-17); font-weight: 700; letter-spacing: -.07em; }
- main { padding: var(--sp-4) var(--sp-4) var(--sp-6); }
- h1 { font-size: var(--fs-20); letter-spacing: -.03em; }
- .eyebrow { font-size: var(--fs-11); margin-bottom: var(--sp-1); }
- .page-heading { align-items: flex-start; gap: var(--sp-2); flex-direction: column; margin-bottom: var(--sp-4); }
- .page-heading p,.lead { font-size: var(--fs-13); line-height: 1.6; }
- .page-heading > .button { width: 100%; }
- .button { min-height: 44px; font-size: var(--fs-14); padding-inline: var(--sp-3); }
- .text-action { font-size: var(--fs-13); min-height: 40px; }
- .panel { padding: var(--sp-4); border-radius: var(--r-md); }
- .trial-banner { grid-template-columns: minmax(0,1fr); gap: var(--sp-3); margin-bottom: var(--sp-5); padding: var(--sp-4); }
- .trial-icon { width: 36px; height: 36px; border-radius: var(--r-md); }
- .trial-icon .icon { width: 20px; height: 20px; }
- .trial-banner h2 { flex-wrap: wrap; gap: var(--sp-2); font-size: var(--fs-17); }
- .trial-banner h2 > span { font-size: var(--fs-11); }
- .trial-banner p { font-size: var(--fs-13); }
- .trial-facts { gap: var(--sp-2) var(--sp-3); font-size: var(--fs-12); }
- .trial-banner > .button { width: 100%; }
- .section-heading { align-items: flex-start; flex-direction: column; gap: var(--sp-1); }
- .section-heading h2 { font-size: var(--fs-15); }
- .section-heading p { font-size: var(--fs-12); }
- .plan-grid { grid-template-columns: 1fr; gap: var(--sp-3); }
- .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; }
- .plan-card.featured { background: var(--primary-subtle); box-shadow: inset 0 0 0 1px var(--primary); }
- .plan-card.current { border-color: var(--success); background: var(--success-subtle); box-shadow: none; }
- .plan-mobile-copy { display: block; min-width: 0; }
- .plan-mobile-heading { display: flex; align-items: center; gap: var(--sp-2); }
- .plan-mobile-heading h3 { font-size: var(--fs-17); line-height: 1.3; }
- .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; }
- .plan-mobile-quota { margin-top: var(--sp-2); color: var(--ink-2); font-size: var(--fs-13); line-height: 1.4; }
- .plan-mobile-benefit { margin-top: var(--sp-1); color: var(--muted); font-size: var(--fs-12); line-height: 1.4; }
- .plan-mobile-action { display: flex; align-items: stretch; flex-direction: column; gap: var(--sp-2); }
- .plan-mobile-price { text-align: center; line-height: 1.25; }
- .plan-mobile-price strong { display: block; color: var(--ink-2); font-size: var(--fs-12); font-weight: 500; white-space: nowrap; }
- .plan-mobile-price span { display: block; color: var(--muted); font-size: var(--fs-11); white-space: nowrap; }
- .plan-mobile-action .button { width: 100%; min-height: 44px; padding-inline: var(--sp-1); font-size: var(--fs-12); }
- .plan-card.current .plan-mobile-action .button { border-color: var(--success); color: var(--success); background: var(--surface); }
- .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; }
- .plans-note { font-size: var(--fs-12); margin: var(--sp-3) 0 var(--sp-5); }
- .info-grid { grid-template-columns: 1fr; gap: var(--sp-4); }
- .info-item h3,.info-item p { font-size: var(--fs-13); }
- .waiting-layout,.resource-grid { grid-template-columns: 1fr; }
- .task-hero { gap: var(--sp-2); padding-bottom: var(--sp-4); }
- .task-orb { width: 40px; height: 40px; }
- .task-hero h2 { font-size: var(--fs-17); }
- .task-hero p { font-size: var(--fs-12); }
- .job-step { grid-template-columns: 24px minmax(0,1fr) auto; gap: var(--sp-2); min-height: 76px; }
- .step-copy strong { font-size: var(--fs-14); }
- .step-copy p { max-width: 220px; font-size: var(--fs-12); }
- .step-state { font-size: var(--fs-11); }
- .waiting-actions { flex-direction: column; gap: var(--sp-2); }
- .waiting-actions .button { width: 100%; }
- .waiting-foot { font-size: var(--fs-12); }
- .waiting-simple { min-height: 0; padding: var(--sp-6) var(--sp-4); border-radius: var(--r-lg); }
- .waiting-current .task-orb { width: 52px; height: 52px; margin-bottom: var(--sp-4); }
- .waiting-current h2 { font-size: var(--fs-20); }
- .waiting-current > p { font-size: var(--fs-13); }
- .waiting-progress { margin-top: var(--sp-5); }
- .waiting-meta { margin: var(--sp-4) 0; gap: var(--sp-4); }
- .waiting-meta dt { font-size: var(--fs-11); }
- .waiting-meta dd { font-size: var(--fs-13); }
- .waiting-simple .waiting-actions { width: 100%; gap: var(--sp-2); }
- .support-action { font-size: var(--fs-12); }
- .task-aside { display: grid; grid-template-columns: 1fr; gap: var(--sp-3); }
- .small-panel { margin: 0; padding: var(--sp-4); }
- .task-summary h3,.small-panel h3 { font-size: var(--fs-13); }
- .summary-facts { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
- .summary-facts > div { margin-top: 0; }
- .summary-facts dt,.small-panel p { font-size: var(--fs-11); }
- .summary-facts dd { font-size: var(--fs-13); }
- .task-summary .text-action { font-size: var(--fs-12); }
- .notice { flex-wrap: wrap; padding: var(--sp-3); font-size: var(--fs-13); margin-bottom: var(--sp-4); }
- .notice > div { flex: 1; min-width: 0; }
- .notice > .button { width: 100%; margin-left: 0; }
- .quota-panel { align-items: stretch; flex-direction: column; gap: var(--sp-3); margin-bottom: var(--sp-4); padding: var(--sp-4); }
- .quota-copy h2 { font-size: var(--fs-13); }
- .quota-copy p { font-size: var(--fs-12); }
- .quota-meter { min-width: 0; }
- .quota-meter p { font-size: var(--fs-11); }
- .quota-meter strong { font-size: var(--fs-17); }
- .container-grid { grid-template-columns: minmax(0,1fr); gap: var(--sp-3); }
- .container-card { padding: var(--sp-4); }
- .container-avatar { width: 36px; height: 36px; font-size: var(--fs-14); }
- .container-head h3 { font-size: var(--fs-15); }
- .container-head small { font-size: var(--fs-11); }
- .container-meta { gap: var(--sp-2); margin-top: var(--sp-3); font-size: var(--fs-11); }
- .container-caption { font-size: var(--fs-12); margin-top: var(--sp-2); }
- .container-actions { margin-top: var(--sp-3); }
- .container-actions .button { font-size: var(--fs-13); }
- .create-card { min-height: 120px; gap: var(--sp-2); }
- .create-card > .icon { width: 22px; height: 22px; }
- .create-card strong { font-size: var(--fs-14); }
- .create-card p { font-size: var(--fs-11); }
- .empty-state { min-height: 260px; gap: var(--sp-2); }
- .empty-state h2 { font-size: var(--fs-17); }
- .empty-state p { font-size: var(--fs-13); }
- .resource-panel > p { font-size: var(--fs-13); }
- .resource-panel h2 { font-size: var(--fs-15); }
- .credential-list { margin-top: var(--sp-4); }
- .credential-row { padding-block: var(--sp-3); }
- .credential-row dt { font-size: var(--fs-11); }
- .credential-row dd { font-size: var(--fs-12); }
- .credential-row .button { font-size: var(--fs-12); min-height: 40px; }
- .credential-fake { font-size: var(--fs-11); }
- .expired-intro { margin-bottom: var(--sp-5); }
- .expired-intro p { font-size: var(--fs-13); }
- .preserved-resource { flex-wrap: wrap; padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-4); }
- .preserved-resource strong { font-size: var(--fs-14); }
- .preserved-resource p { font-size: var(--fs-11); }
- .enterprise-layout { grid-template-columns: 1fr; gap: var(--sp-4); }
- .enterprise-card h2 { font-size: var(--fs-17); }
- .enterprise-card > p,.join-step strong,.join-step p { font-size: var(--fs-13); }
- .join-steps { gap: var(--sp-4); margin-block: var(--sp-4); }
- .company-heading h2 { font-size: var(--fs-15); }
- .company-member { min-height: 60px; }
- .company-member strong { font-size: var(--fs-13); }
- .company-member small { font-size: var(--fs-11); }
- .copy-id { padding: var(--sp-2) var(--sp-3); }
- .copy-id strong { font-size: var(--fs-13); }
- .state-pill { font-size: var(--fs-10, 11px); padding: 1px 6px; }
- .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); }
- .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); }
- .mobile-nav button.on { color: var(--ink); font-weight: 600; }
- .mobile-nav .icon { width: 19px; height: 19px; }
- .ui-dialog { padding: var(--sp-5) var(--sp-4); width: min(480px,calc(100% - 24px)); }
- .ui-dialog h2 { font-size: var(--fs-17); }
- .dialog-description { font-size: var(--fs-13); }
- .dialog-facts { padding: var(--sp-3); gap: var(--sp-2); }
- .dialog-facts strong { font-size: var(--fs-12); }
- .dialog-actions { flex-direction: column-reverse; gap: var(--sp-2); }
- .dialog-actions .button { width: 100%; }
- .form-field > span { font-size: var(--fs-13); }
- .form-field small { font-size: var(--fs-11); }
- .toast { bottom: calc(68px + env(safe-area-inset-bottom,0px)); font-size: var(--fs-13); }
- }
- @media (prefers-reduced-motion: reduce) { *,*::before,*::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
- </style>
- </head>
- <body>
- <a class="skip-link" href="#main">跳到主内容</a>
- <section class="review-bar" aria-label="原型评审控制">
- <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>
- <div class="review-controls" id="reviewControls" hidden>
- <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>
- <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>
- <p class="review-state" id="reviewState" aria-live="polite"></p>
- </div>
- </section>
- <div class="app-shell">
- <aside class="sidebar" aria-label="桌面导航">
- <a class="brand" href="#plans" aria-label="Fmode 套餐首页"><span class="brand-mark">F</span>fmode<span class="brand-registered">®</span></a>
- <div class="workspace-label"><span class="workspace-avatar">我</span><span>我的协作空间<small>个人与企业,同一个入口</small></span></div>
- <div class="sidebar-heading">工作空间</div>
- <nav id="desktopNav"></nav>
- <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>
- </aside>
- <div class="workspace">
- <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>
- <main id="main" tabindex="-1"></main>
- <nav class="mobile-nav" id="mobileNav" aria-label="手机导航"></nav>
- </div>
- </div>
- <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>
- <div class="toast" id="toast" role="status" aria-live="polite" aria-atomic="true"></div>
- <script>/* Local, in-memory review model. It neither calls a platform nor grants real access. */
- const SubscriptionDemo = (() => {
- const PLANS = {
- trial: { name: '两天试用', limit: 1 },
- starter: { name: '入门版', limit: 1 },
- advanced: { name: '进阶版', limit: 3 },
- enterprise: { name: '企业版', limit: 5 },
- };
- const STAGES = [
- { key: 'entitlement', title: '确认权益与容器名额', detail: '检查套餐权益,预留本次开通名额。' },
- { key: 'cloud', title: '准备独立云资源', detail: '配置独立后端、云函数与专属资源凭据。' },
- { key: 'matrix', title: '建立通信身份', detail: '创建归属于你的 Matrix 身份与会话通道。' },
- { key: 'container', title: '创建并初始化容器', detail: '准备平台容器,安装已验证的运行环境。' },
- { key: 'connectivity', title: '接入协作空间', detail: '验证身份与房间,完成通信接入。' },
- { key: 'verification', title: '完成可用性核验', detail: '核对真实回复、完成信号和新鲜心跳。' },
- ];
- const scopeFields = ['plan', 'access', 'trialClaimed', 'trialStartedAt', 'trialExpiresAt', 'containers', 'addon', 'application', 'job', 'jobSequence'];
- const captureScope = (state) => Object.fromEntries(scopeFields.map((key) => [key, JSON.parse(JSON.stringify(state[key]))]));
- function switchSubject(state, subject) {
- if (state.activeSubject === subject) return;
- const account = state[subject + 'Account'];
- if (!account) return;
- state[state.activeSubject + 'Account'] = captureScope(state);
- for (const key of scopeFields) state[key] = JSON.parse(JSON.stringify(account[key]));
- state.activeSubject = subject;
- state.company = subject === 'company';
- }
- const seedContainer = (index, company = false) => ({ id: (company ? 'demo-company-container-' : 'demo-container-') + index, name: ['我的协作伙伴', '内容助手', '研究助手', '项目伙伴', '知识助手'][index - 1] || '新的协作伙伴', owner: company ? '示例企业' : '我', company, ready: true });
- function initial(scenario = 'new') {
- 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: '' };
- if (['advanced', 'quota', 'enterprise'].includes(scenario)) {
- if (scenario === 'enterprise') { state.personalAccount = captureScope(state); state.activeSubject = 'company'; }
- state.plan = scenario === 'enterprise' ? 'enterprise' : 'advanced';
- state.company = scenario === 'enterprise';
- state.access = 'active';
- state.view = 'containers';
- state.containers = Array.from({ length: scenario === 'quota' ? 3 : scenario === 'enterprise' ? 2 : 1 }, (_, index) => seedContainer(index + 1, state.company));
- }
- if (scenario === 'expired') {
- state.plan = 'trial'; state.trialClaimed = true; state.access = 'expired'; state.view = 'expired';
- state.trialStartedAt = state.now - 48 * 3600000; state.trialExpiresAt = state.now;
- state.containers = [seedContainer(1)];
- }
- if (['waiting', 'failed'].includes(scenario)) {
- const started = reduce(state, { type: 'start', name: '我的第一个容器', plan: 'trial' });
- started.job.stage = 3; started.job.completed = 3; started.job.status = scenario === 'failed' ? 'failed' : 'provisioning';
- started.now += 6 * 60000; started.job.updatedAt = started.now;
- started.job.error = scenario === 'failed' ? '运行环境初始化暂时失败,平台保留了已完成的资源和任务进度。' : null;
- return started;
- }
- return state;
- }
- const limit = (state) => state.plan ? PLANS[state.plan].limit + (['advanced', 'enterprise'].includes(state.plan) ? state.addon : 0) : 0;
- const reserved = (state) => state.job && state.job.status !== 'ready' ? 1 : 0;
- const used = (state) => state.containers.length;
- const hasAccess = (state) => state.access === 'active';
- const canCreate = (state) => hasAccess(state) && !reserved(state) && used(state) < limit(state);
- const clone = (state) => JSON.parse(JSON.stringify(state));
- function reduce(previous, action) {
- const s = clone(previous);
- s.note = '';
- if (action.type === 'subject') {
- switchSubject(s, action.subject);
- s.view = s.access === 'expired' ? 'expired' : action.view || 'containers';
- return s;
- }
- if (action.type === 'view') {
- s.view = action.view;
- if (s.access === 'expired' && ['containers', 'access', 'chat'].includes(s.view)) s.view = 'expired';
- return s;
- }
- if (action.type === 'offline') { s.offline = !s.offline; s.note = s.offline ? '网络连接已断开' : '网络已恢复'; return s; }
- if (s.offline && ['start', 'apply', 'retry', 'addon'].includes(action.type)) { s.note = '网络暂时不可用,请重试。'; return s; }
- if (action.type === 'start') {
- if (s.job && s.job.status !== 'ready') { s.view = 'waiting'; s.note = '正在开通'; return s; }
- if (action.plan === 'trial') {
- if (s.trialClaimed) { s.note = '试用已领取'; return s; }
- s.plan = 'trial'; s.trialClaimed = true;
- } else if (!canCreate(s) && s.access !== 'unopened') { s.note = '名额不足'; return s; }
- s.jobSequence += 1;
- 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 };
- if (!s.containers.length) s.access = 'provisioning';
- s.view = 'waiting';
- }
- if (action.type === 'advance' && s.job && !['ready', 'failed'].includes(s.job.status)) {
- s.now += 90000; s.job.updatedAt = s.now; s.job.delayed = false;
- if (s.job.stage < STAGES.length - 1) {
- s.job.stage += 1; s.job.completed = s.job.stage;
- s.job.status = s.job.stage === STAGES.length - 1 ? 'verifying' : 'provisioning';
- } else {
- s.job.status = 'ready'; s.job.completed = STAGES.length;
- const container = { ...seedContainer(s.containers.length + 1, s.company), name: s.job.name };
- s.containers.push(container); s.job.agentId = container.id; s.access = 'active';
- if (s.plan === 'trial' && s.trialStartedAt === null) { s.trialStartedAt = s.now; s.trialExpiresAt = s.now + 48 * 3600000; }
- s.note = '已就绪';
- }
- }
- if (action.type === 'fail' && s.job && s.job.status !== 'ready') { s.job.status = 'failed'; s.job.error = '当前步骤执行失败。平台已保留完成的资源与原任务,可安全重试。'; s.job.updatedAt = s.now; }
- if (action.type === 'slow' && s.job && !['ready', 'failed'].includes(s.job.status)) { s.now += 45 * 60000; s.job.delayed = true; }
- 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 = '正在重试'; }
- if (action.type === 'apply') {
- if (action.plan === 'enterprise' && s.activeSubject !== 'company') { s.view = 'enterprise'; s.note = '请先核实企业身份,企业权益与个人权益分别管理。'; return s; }
- if (s.activeSubject === 'company' && action.plan !== 'enterprise') switchSubject(s, 'personal');
- if (s.access === 'active' && s.plan !== 'trial' && PLANS[action.plan].limit < limit(s)) { s.note = '更换套餐请联系客服。'; return s; }
- s.application = { kind: s.access === 'expired' ? 'restore' : 'plan', plan: action.plan, status: 'pending' }; s.note = '申请已提交';
- }
- if (action.type === 'addon') {
- if (!['advanced', 'enterprise'].includes(s.plan)) { s.note = '请先升级套餐'; return s; }
- s.application = { kind: 'addon', quantity: action.quantity, status: 'pending' }; s.note = '申请已提交';
- }
- if (action.type === 'approve' && s.application?.status === 'pending') {
- const application = s.application; s.application = null;
- if (application.kind === 'addon') { s.addon += application.quantity; s.note = '名额已更新'; }
- else {
- const hadContainer = s.containers.length > 0;
- s.plan = application.plan;
- s.access = 'active';
- if (hadContainer) { s.view = 'containers'; s.note = '已恢复使用'; }
- else return reduce(s, { type: 'start', plan: s.plan, name: '我的第一个容器' });
- }
- }
- if (action.type === 'expire' && s.plan === 'trial' && s.access === 'active') { s.now = s.trialExpiresAt; s.access = 'expired'; s.view = 'expired'; s.note = '试用已结束'; }
- if (action.type === 'join' && s.view === 'enterprise') {
- if (s.activeSubject === 'company') return s;
- 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 };
- switchSubject(s, 'company'); s.view = 'enterprise'; s.note = '已加入企业';
- }
- if (action.type === 'rename') { const target = s.containers.find((item) => item.id === action.id); if (target && hasAccess(s)) target.name = action.name; }
- return s;
- }
- return { PLANS, STAGES, initial, reduce, limit, reserved, used, hasAccess, canCreate };
- })();
- </script>
- <script>const Demo = SubscriptionDemo;
- const params = new URLSearchParams(location.search);
- const knownScenarios = ['new', 'waiting', 'failed', 'advanced', 'quota', 'expired', 'enterprise'];
- let state = Demo.initial(knownScenarios.includes(params.get('scenario')) ? params.get('scenario') : 'new');
- const views = { plans: '套餐与开通', waiting: '开通进度', containers: '我的容器', access: '接入信息', enterprise: '加入企业', account: '我的账号', expired: '继续使用 Fmode', chat: '开始协作' };
- const requestedView = params.get('screen') || location.hash.slice(1);
- if (views[requestedView]) state = Demo.reduce(state, { type: 'view', view: requestedView });
- if (params.get('theme') === 'dark') document.documentElement.classList.add('dark');
- const main = document.getElementById('main');
- const dialog = document.getElementById('dialog');
- const dialogBody = document.getElementById('dialogBody');
- let dialogContext = null;
- let dialogTrigger = null;
- let toastTimer;
- const esc = (value) => String(value ?? '').replace(/[&<>"']/g, (character) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[character]);
- const paths = {
- 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"/>',
- 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"/>',
- arrow: '<path d="M4 12h16m-6-6 6 6-6 6"/>',
- check: '<path d="m5 12 4 4L19 6"/>',
- clock: '<circle cx="12" cy="12" r="9"/><path d="M12 7v5l3 2"/>',
- shield: '<path d="m12 3 8 3v6c0 5-8 9-8 9S4 17 4 12V6l8-3Z"/><path d="m8 12 3 3 5-6"/>',
- person: '<circle cx="12" cy="8" r="4"/><path d="M4 21v-2a8 8 0 0 1 16 0v2"/>',
- 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"/>',
- key: '<circle cx="8" cy="8" r="5"/><path d="m12 12 9 9m-4-4 3-3m-6 0 3-3"/>',
- 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"/>',
- plus: '<path d="M12 5v14M5 12h14"/>',
- 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"/>',
- spark: '<path d="m12 3 2.4 6.6L21 12l-6.6 2.4L12 21l-2.4-6.6L3 12l6.6-2.4L12 3Z"/>',
- cloud: '<path d="M7 19a5 5 0 1 1 .5-10A7 7 0 0 1 21 12a4 4 0 0 1-1 7H7Z"/>',
- 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"/>',
- info: '<circle cx="12" cy="12" r="9"/><path d="M12 11v6M12 7h.01"/>',
- warning: '<path d="m12 3 10 18H2L12 3Z"/><path d="M12 9v5M12 17h.01"/>',
- 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"/>',
- close: '<path d="m6 6 12 12M18 6 6 18"/>',
- building: '<path d="M4 21V5l8-3 8 3v16H4ZM9 21v-5h6v5M8 7h1m6 0h1M8 11h1m6 0h1"/>',
- 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)"/>',
- };
- const icon = (name) => `<svg class="icon" viewBox="0 0 24 24" aria-hidden="true">${paths[name] || paths.grid}</svg>`;
- const button = (text, action, kind = '', extra = '') => `<button type="button" class="button ${kind}" data-action="${action}" ${extra}>${text}</button>`;
- const notice = (title, text, tone = '', name = 'info') => `<div class="notice ${tone}">${icon(name)}<div><strong>${title}</strong>${text ? `<p>${text}</p>` : ''}</div></div>`;
- const planName = () => state.plan ? Demo.PLANS[state.plan].name : '尚未开通';
- const stateLabel = () => state.offline ? '网络未连接' : ({ unopened: '尚未开通', provisioning: '正在开通', active: state.plan === 'trial' ? '试用中' : '已开通', expired: '试用已到期' })[state.access];
- const priceNotice = '具体价格请咨询客服。';
- function nav() {
- 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' }];
- 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('');
- 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('');
- }
- function planCards() {
- const cards = [
- { key: 'starter', icon: 'server', name: '入门版', short: '入门', sub: '一个专属空间,从这里开始。', unit: '/ 月', note: '支持 1 个容器', mobileQuota: '1 个专属容器 · 2 核 4G', mobileBenefit: '独立云资源 · 含完整接入信息', quota: '1', quotaLabel: '个容器', perks: ['1 个专属容器', '2 核 4G 标准规格', '独立云资源', '完整接入信息', '手机与电脑均可使用'] },
- { key: 'advanced', icon: 'spark', name: '进阶版', short: '进阶', sub: '更多空间,接住不同的想法。', unit: '/ 年', note: '含一年资源费用', mobileQuota: '3 个专属容器 · 2 核 4G', mobileBenefit: '独立云资源 · 支持加购名额', quota: '3', quotaLabel: '个容器', perks: ['3 个专属容器', '2 核 4G 标准规格', '独立云资源与接入信息', '支持加购容器名额'] },
- { key: 'enterprise', icon: 'building', name: '企业版', short: '企业', sub: '让整个团队,有序地协作。', unit: '', note: '团队共享', mobileQuota: '5 个共享容器 · 2 核 4G', mobileBenefit: '成员管理 · 通讯录与容器共享', quota: '5', quotaLabel: '个共享', perks: ['5 个企业容器', '2 核 4G 标准规格(新容器)', '企业成员管理', '通讯录与容器共享', '支持加购容器名额'] },
- ];
- const cta = (card) => state.access === 'expired' ? '恢复' : state.plan === card.key ? '当前' : '开通';
- return `<div class="plan-grid">${cards.map((card) => {
- const disabled = state.plan === card.key && state.access === 'active';
- const current = state.plan === card.key && state.access === 'active';
- return `<article class="plan-card ${card.key === 'advanced' ? 'featured' : ''} ${current ? 'current' : ''}" data-plan-card="${card.key}">${card.key === 'advanced' ? '<span class="plan-recommend">推荐</span>' : ''}
- <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>
- <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>
- <div class="plan-icon">${icon(card.icon)}</div>
- <h3><span class="plan-name-full">${card.name}</span><span class="plan-name-short">${card.short}</span></h3>
- <p class="plan-sub">${card.sub}</p>
- <div class="plan-quota"><strong>${card.quota}</strong><span>${card.quotaLabel}</span></div>
- <div class="plan-price"><strong>价格待定</strong><span>${card.unit}</span></div>
- <div class="plan-billing-note">${card.note}</div>
- ${button(cta(card), 'apply', card.key === 'advanced' ? '' : 'secondary', `data-plan="${card.key}" ${disabled ? 'disabled' : ''}`)}
- <ul class="plan-perks">${card.perks.map((perk) => `<li>${icon('check')}<span>${perk}</span></li>`).join('')}</ul>
- </article>`;
- }).join('')}</div>`;
- }
- function applicationNotice() {
- if (!state.application) return '';
- const addon = state.application.kind === 'addon';
- return notice(addon ? '增配申请已提交' : '开通申请已提交', '等待确认。', 'info', 'clock');
- }
- function plansPage() {
- let trial = '';
- if (!state.trialClaimed && state.access === 'unopened') {
- 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>`;
- } else if (state.job && state.job.status !== 'ready') {
- 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>`;
- } else if (state.access === 'active') {
- 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>`;
- }
- 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>`;
- }
- function waitingPage() {
- const job = state.job;
- 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>`;
- const ready = job.status === 'ready', failed = job.status === 'failed';
- const percent = ready ? 100 : Math.min(99, Math.floor(job.completed / Demo.STAGES.length * 100));
- const label = ready ? '已就绪' : failed ? '开通失败' : job.status === 'queued' ? '等待开通' : job.status === 'verifying' ? '即将就绪' : '正在开通';
- const elapsed = Math.floor((state.now - job.createdAt) / 60000);
- const feedback = state.offline ? notice('网络连接已断开', '请检查网络后重试。', 'warning', 'wifi') : failed ? notice('暂时未能完成开通', '请稍后重试。', 'warning', 'warning') : job.delayed ? notice('仍在处理中', '请稍后查看。', '', 'clock') : '';
- 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>`;
- }
- function quotaPanel() {
- const used = Demo.used(state), reserved = Demo.reserved(state), max = Demo.limit(state);
- 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>`;
- }
- function containerCard(container) {
- 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>`;
- }
- function containersPage() {
- 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>`;
- const activeJob = state.job && state.job.status !== 'ready';
- 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>`;
- }
- const fakeCredentials = [
- { group: 'matrix', label: 'agentMxId', value: '@demo-agent:example.invalid' },
- { group: 'matrix', label: 'userMxId', value: '@demo-user:example.invalid' },
- { group: 'matrix', label: 'homeserver', value: 'https://matrix.example.invalid' },
- { group: 'matrix', label: 'roomId', value: '!demo-room:example.invalid' },
- { group: 'matrix', label: 'accessToken', value: 'DEMO_ONLY_NOT_A_REAL_MATRIX_TOKEN' },
- { group: 'backend', label: 'appId', value: 'DEMO_APP_ID_NOT_REAL' },
- { group: 'backend', label: 'serverURL', value: 'https://backend.example.invalid/parse' },
- { group: 'backend', label: 'functionsURL', value: 'https://backend.example.invalid/functions' },
- { group: 'backend', label: '独立资源专属凭据', value: 'DEMO_ONLY_RESOURCE_SCOPED_CREDENTIAL' },
- ];
- function credentialsPage() {
- 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>`;
- 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>`;
- const backendPanel = state.company ? `<section class="panel resource-panel"><h2>${icon('cloud')}企业资源</h2><p>请联系企业管理员。</p><p class="credential-fake"></p></section>` : panel('backend', '独立云资源', '', 'cloud');
- 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>`;
- }
- function expiredPage() {
- 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>`;
- }
- function enterprisePage() {
- const org = state.company;
- 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>`;
- 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>`;
- }
- function accountPage() {
- 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>`;
- }
- function chatPage() {
- if (!Demo.hasAccess(state) || !state.containers.length) return state.access === 'expired' ? expiredPage() : waitingPage();
- 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>`;
- }
- function render(resetScroll = false) {
- nav();
- document.getElementById('pageLabel').textContent = views[state.view] || views.plans;
- document.getElementById('headerStatus').innerHTML = icon(state.offline ? 'wifi' : 'shield') + esc(stateLabel());
- const pages = { plans: plansPage, waiting: waitingPage, containers: containersPage, access: credentialsPage, enterprise: enterprisePage, account: accountPage, expired: expiredPage, chat: chatPage };
- 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>` : '';
- main.innerHTML = subjectSwitcher + (pages[state.view] || plansPage)();
- if (resetScroll) main.scrollTop = 0;
- 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 + ' 次' : ''}。所有状态均为本地模拟。`;
- document.querySelector('[data-event="advance"]').disabled = !state.job || ['ready','failed'].includes(state.job.status) || state.offline;
- document.querySelector('[data-event="fail"]').disabled = !state.job || state.job.status === 'ready';
- document.querySelector('[data-event="slow"]').disabled = !state.job || ['ready','failed'].includes(state.job.status);
- document.querySelector('[data-event="approve"]').disabled = !state.application;
- document.querySelector('[data-event="expire"]').disabled = state.plan !== 'trial' || state.access !== 'active';
- document.querySelector('[data-event="join"]').disabled = state.view !== 'enterprise' || state.company;
- document.querySelector('[data-event="offline"]').textContent = state.offline ? '恢复网络' : '模拟断网';
- document.getElementById('themeToggle').textContent = document.documentElement.classList.contains('dark') ? '浅色' : '深色';
- }
- function toast(message) {
- clearTimeout(toastTimer);
- const element = document.getElementById('toast');
- element.textContent = message; element.classList.add('visible');
- toastTimer = setTimeout(() => element.classList.remove('visible'), 3400);
- }
- function dispatch(action) {
- const oldView = state.view;
- state = Demo.reduce(state, action);
- render(state.view !== oldView);
- if (state.note) toast(state.note);
- }
- function go(view) { dispatch({ type: 'view', view }); }
- function closeDialog() { if (dialog.open) dialog.close(); }
- function openDialog(kind, data = {}, trigger = document.activeElement) {
- dialogContext = { kind, ...data }; dialogTrigger = trigger;
- const cancel = '<button type="button" class="button secondary" data-close-dialog>暂不操作</button>';
- if (kind === 'create') {
- const trial = data.trial;
- 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>`;
- } else if (kind === 'apply') {
- const name = Demo.PLANS[data.plan].name;
- 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>`;
- } else if (kind === 'addon') {
- 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>`;
- } else if (kind === 'credential') {
- 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>`;
- } else if (kind === 'settings') {
- const container = state.containers.find((item) => item.id === data.id);
- if (!container) return;
- 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>`;
- }
- dialog.showModal(); document.getElementById('dialogClose').focus();
- }
- async function copyText(value, message = '已复制') {
- try {
- if (!navigator.clipboard?.writeText) throw new Error('unavailable');
- await navigator.clipboard.writeText(value);
- return message;
- } catch { return '浏览器未允许自动复制,可选中文本手动复制。'; }
- }
- document.getElementById('dialogClose').addEventListener('click', closeDialog);
- dialog.addEventListener('close', () => { if (dialogTrigger?.isConnected) dialogTrigger.focus({ preventScroll: true }); else main.focus({ preventScroll: true }); });
- dialog.addEventListener('click', (event) => {
- const rect = dialog.getBoundingClientRect();
- if (event.target === dialog && (event.clientX < rect.left || event.clientX > rect.right || event.clientY < rect.top || event.clientY > rect.bottom)) closeDialog();
- });
- document.addEventListener('click', async (event) => {
- const target = event.target.closest('button, a');
- if (!target || target.disabled) return;
- if (target.hasAttribute('data-close-dialog')) return closeDialog();
- if (target.dataset.subject) return dispatch({ type: 'subject', subject: target.dataset.subject });
- if (target.dataset.view) return go(target.dataset.view);
- if (target.dataset.scenario) { state = Demo.initial(target.dataset.scenario); render(true); return; }
- if (target.dataset.event) return dispatch({ type: target.dataset.event });
- if (target.hasAttribute('data-confirm-credential')) {
- const field = fakeCredentials.find((item) => item.label === dialogContext?.field);
- if (!field) return;
- const result = document.getElementById('credentialResult');
- result.hidden = false; result.replaceChildren();
- const code = document.createElement('code'); code.className = 'demo-secret'; code.textContent = field.value;
- const feedback = document.createElement('p'); feedback.className = 'dialog-feedback'; feedback.setAttribute('role', 'status');
- result.append(code, feedback); target.disabled = true;
- feedback.textContent = await copyText(field.value, '原型假数据已复制,请勿用于实际接入。');
- return;
- }
- const action = target.dataset.action;
- if (!action) return;
- if (['plans','waiting','containers','chat'].includes(action)) return go(action === 'plans' && state.access === 'expired' ? 'expired' : action);
- if (action === 'trial') return openDialog('create', { trial: true }, target);
- if (action === 'create') {
- if (Demo.canCreate(state)) openDialog('create', { trial: false }, target);
- else toast('当前名额不可用,请查看套餐或开通中的任务。');
- return;
- }
- if (action === 'apply') {
- const plan = target.dataset.plan;
- if (plan === 'enterprise' && !state.company) return go('enterprise');
- if (state.company && plan !== 'enterprise') dispatch({ type: 'subject', subject: 'personal', view: 'plans' });
- if (state.access === 'active' && state.plan !== 'trial' && Demo.PLANS[plan].limit < Demo.limit(state)) return toast('更换套餐请联系客服。');
- return openDialog('apply', { plan }, target);
- }
- if (action === 'switch-company') return dispatch({ type: 'subject', subject: 'company', view: 'enterprise' });
- if (action === 'addon') return openDialog('addon', {}, target);
- if (action === 'credential') return openDialog('credential', { field: target.dataset.field }, target);
- if (action === 'settings') return openDialog('settings', { id: target.dataset.id }, target);
- if (action === 'retry') return dispatch({ type: 'retry' });
- if (action === 'check') return toast(state.offline ? '网络暂时不可用,原任务仍在平台保留。' : '仍在开通中,请稍后查看。');
- if (action === 'check-org') return toast('仍在等待邀请。');
- if (action === 'copy-job') return toast(await copyText(state.job?.id || '', '演示任务编号已复制'));
- if (action === 'copy-user') return toast(await copyText('DEMO_USER_001', '演示用户 ID 已复制'));
- });
- document.addEventListener('submit', (event) => {
- event.preventDefault();
- const id = event.target.id;
- if (id === 'createForm') {
- const name = document.getElementById('containerName').value.trim();
- if (!name) return;
- const trial = dialogContext.trial; closeDialog(); dispatch({ type: 'start', name, plan: trial ? 'trial' : state.plan });
- }
- if (id === 'applyForm') { const plan = dialogContext.plan; closeDialog(); dispatch({ type: 'apply', plan }); }
- if (id === 'addonForm') { const quantity = Number(document.getElementById('addonQuantity').value); closeDialog(); dispatch({ type: 'addon', quantity }); }
- if (id === 'renameForm') {
- const name = document.getElementById('renameInput').value.trim(); if (!name) return;
- const containerId = dialogContext.id; closeDialog(); dispatch({ type: 'rename', id: containerId, name }); toast('演示容器名称已修改');
- }
- });
- document.getElementById('reviewToggle').addEventListener('click', () => {
- const controls = document.getElementById('reviewControls'); controls.hidden = !controls.hidden;
- document.getElementById('reviewToggle').setAttribute('aria-expanded', String(!controls.hidden));
- });
- document.getElementById('themeToggle').addEventListener('click', () => { document.documentElement.classList.toggle('dark'); render(); });
- document.querySelector('.brand').addEventListener('click', (event) => { event.preventDefault(); go('plans'); });
- render(true);
- </script>
- </body>
- </html>
|