Просмотр исходного кода

Pocket Hardware Lab v2 — 8款AI硬件参数化工作台

- 8 款产品数据:BOM/工艺/MOQ/成本模型(机器验收 0 错误 0 警告)
- Lit 无构建 + Babylon.js 实时 3D 重建
- 参考 v2.0 壳体工坊交互(编辑坞/形体库/工艺校验)
- 32 张产品配图(主KV + 微距/场景/爆炸图)

产出方:FmodeCode
liuyuyang 1 день назад
Сommit
e61c81de46
100 измененных файлов с 19104 добавлено и 0 удалено
  1. 8 0
      .gitignore
  2. 219 0
      docs/BUILD-REPORT.md
  3. 63 0
      docs/产品蓝图.md
  4. 63 0
      ref-v2/README.md
  5. 8 0
      ref-v2/build.sh
  6. 303 0
      ref-v2/src/01_head.html
  7. 4 0
      ref-v2/src/02_body.html
  8. 394 0
      ref-v2/src/03_data.js
  9. 981 0
      ref-v2/src/04_geo.js
  10. 1496 0
      ref-v2/src/05_app.js
  11. 3 0
      ref-v2/src/06_tail.html
  12. 3181 0
      ref-v2/壳体工坊-手机3D外壳工程台.html
  13. 45 0
      site/app.js
  14. 12 0
      site/assets/app.css
  15. BIN
      site/assets/detail/ai-pin-detail.png
  16. BIN
      site/assets/detail/ai-pin-explode.png
  17. BIN
      site/assets/detail/ai-pin-lifestyle.png
  18. BIN
      site/assets/detail/bone-headset-detail.png
  19. BIN
      site/assets/detail/bone-headset-explode.png
  20. BIN
      site/assets/detail/bone-headset-lifestyle.png
  21. BIN
      site/assets/detail/eink-tag-detail.png
  22. BIN
      site/assets/detail/eink-tag-explode.png
  23. BIN
      site/assets/detail/eink-tag-lifestyle.png
  24. BIN
      site/assets/detail/pocket-ai-detail.png
  25. BIN
      site/assets/detail/pocket-ai-explode.png
  26. BIN
      site/assets/detail/pocket-ai-lifestyle.png
  27. BIN
      site/assets/detail/recorder-bean-detail.png
  28. BIN
      site/assets/detail/recorder-bean-explode.png
  29. BIN
      site/assets/detail/recorder-bean-lifestyle.png
  30. BIN
      site/assets/detail/round-screen-detail.png
  31. BIN
      site/assets/detail/round-screen-explode.png
  32. BIN
      site/assets/detail/round-screen-lifestyle.png
  33. BIN
      site/assets/detail/smart-ring-detail.png
  34. BIN
      site/assets/detail/smart-ring-explode.png
  35. BIN
      site/assets/detail/smart-ring-lifestyle.png
  36. BIN
      site/assets/detail/watch-case-detail.png
  37. BIN
      site/assets/detail/watch-case-explode.png
  38. BIN
      site/assets/detail/watch-case-lifestyle.png
  39. BIN
      site/assets/kv/ai-pin-hero.png
  40. BIN
      site/assets/kv/bone-headset-hero.png
  41. BIN
      site/assets/kv/eink-tag-hero.png
  42. BIN
      site/assets/kv/pocket-ai-hero.png
  43. BIN
      site/assets/kv/recorder-bean-hero.png
  44. BIN
      site/assets/kv/round-screen-hero.png
  45. BIN
      site/assets/kv/smart-ring-hero.png
  46. BIN
      site/assets/kv/watch-case-hero.png
  47. 69 0
      site/assets/theme.css
  48. 17 0
      site/config.js
  49. 68 0
      site/core/geometry/assembly.js
  50. 50 0
      site/core/geometry/interference.js
  51. 299 0
      site/core/geometry/profile.js
  52. 56 0
      site/core/geometry/rect.js
  53. 189 0
      site/data/CONTRACT.md
  54. 74 0
      site/data/products/INDEX.json
  55. 1091 0
      site/data/products/ai-pin.json
  56. 1088 0
      site/data/products/bone-headset.json
  57. 1152 0
      site/data/products/eink-tag.json
  58. 1154 0
      site/data/products/pocket-ai.json
  59. 1131 0
      site/data/products/recorder-bean.json
  60. 1094 0
      site/data/products/round-screen.json
  61. 1200 0
      site/data/products/smart-ring.json
  62. 1076 0
      site/data/products/watch-case.json
  63. 39 0
      site/index.html
  64. 43 0
      site/lib/base.js
  65. 44 0
      site/lib/css.js
  66. 77 0
      site/page/gallery.js
  67. 204 0
      site/page/lab.js
  68. 22 0
      site/page/not-found.js
  69. 211 0
      site/page/product.js
  70. 59 0
      site/page/styles/gallery-style.js
  71. 56 0
      site/page/styles/lab-style.js
  72. 165 0
      site/page/styles/product-style.js
  73. 40 0
      site/services/products.js
  74. 320 0
      site/services/viewer3d.js
  75. 78 0
      site/tests/t-geometry.test.js
  76. 50 0
      site/utils/format.js
  77. 82 0
      site/utils/router.js
  78. 20 0
      site/utils/storage.js
  79. 80 0
      site/utils/theme.js
  80. 0 0
      site/vendor/babylon/babylon.js
  81. 0 0
      site/vendor/babylon/loaders.js
  82. 693 0
      site/vendor/earcut/earcut.js
  83. 7 0
      site/vendor/lit/@lit-labs/signals/index.js
  84. 7 0
      site/vendor/lit/@lit-labs/signals/lib/html-tag.js
  85. 5 0
      site/vendor/lit/@lit-labs/signals/lib/signal-watcher.js
  86. 8 0
      site/vendor/lit/@lit-labs/signals/lib/watch.js
  87. 1 0
      site/vendor/lit/@lit-labs/signals/package.json
  88. 28 0
      site/vendor/lit/@lit/reactive-element/LICENSE
  89. 103 0
      site/vendor/lit/@lit/reactive-element/README.md
  90. 7 0
      site/vendor/lit/@lit/reactive-element/css-tag.js
  91. 2 0
      site/vendor/lit/@lit/reactive-element/decorators.js
  92. 7 0
      site/vendor/lit/@lit/reactive-element/decorators/base.js
  93. 7 0
      site/vendor/lit/@lit/reactive-element/decorators/custom-element.js
  94. 7 0
      site/vendor/lit/@lit/reactive-element/decorators/event-options.js
  95. 7 0
      site/vendor/lit/@lit/reactive-element/decorators/property.js
  96. 8 0
      site/vendor/lit/@lit/reactive-element/decorators/query-all.js
  97. 7 0
      site/vendor/lit/@lit/reactive-element/decorators/query-assigned-elements.js
  98. 7 0
      site/vendor/lit/@lit/reactive-element/decorators/query-assigned-nodes.js
  99. 8 0
      site/vendor/lit/@lit/reactive-element/decorators/query-async.js
  100. 7 0
      site/vendor/lit/@lit/reactive-element/decorators/query.js

+ 8 - 0
.gitignore

@@ -0,0 +1,8 @@
+node_modules/
+vendor-build/
+logs/
+*.tar.gz
+ref-v2/v2.zip
+__pycache__/
+*.pyc
+.DS_Store

+ 219 - 0
docs/BUILD-REPORT.md

@@ -0,0 +1,219 @@
+# BUILD-REPORT — Pocket Hardware Lab(T1 壳体工坊 v3)
+
+> 产出方:**FmodeCode** | 开始:2026-11-25
+> 任务书:`tasks/T1-shell-studio-v3.md`;代码目录:`site/`
+
+## 环境勘察结论
+
+- `site/` 仅残留 `assets/kv/*-hero.png`(8 款主 KV 已有),无其他代码,从零重建。
+- vendor-build 依赖:lit 3.3.3 / @lit-labs/signals 0.3.0 / @babylonjs/core 8.56.2 / esbuild 0.28.2 / playwright-core 1.65.1。
+- 外部 CDN:`registry.npmmirror.com` 可达;FMODE Repose 公共路径当前探测 404 → 采用任务书**兜底方案:esbuild 打成单文件(App bundle + Babylon bundle 分离,仍全相对路径,零外部引用)**。
+
+
+---
+
+## 阶段 0 — 规范研读与环境勘察(完成)
+
+- 已读 `fmode-code-lit/CLAUDE.md` + rules:architecture / components / services / pitfalls(index.md 不存在,以 CLAUDE.md 为索引;额外读了 core-library / routing-best-practices 相关要点)。
+- 确认约束:禁装饰器(`static properties` + `customElement` 注册)、相对导入带 `.js`、`<base href>`、无打包。
+- **vendor 偏差说明**:任务书给的 importmap 映射全部以 `/` 开头(子路径部署会 404),改为**全相对路径映射**(`../../vendor/lit/...`),满足「全部资源相对路径」硬约束。
+- vendor 缺 `@lit-labs/signals` 与 `signal-polyfill`:从本地已就位的 `vendor-build/node_modules`(@lit-labs/signals 0.3.0 / signal-polyfill 0.2.8)原样复制到 `site/vendor/signals/` + `site/vendor/signal-polyfill/`(零联网、零 npm install)。
+- KV 主图现状:8 款中 5 款 `*-hero.png` 已有(1792×1024);缺 `watch-case/eink-tag/pocket-ai` hero 与全部 `*-detail.png` → 页面按骨架屏兜底 + onerror 兜底。
+- 测试环境:chrome-headless-shell 152 + playwright-core 1.65.1(vendor-build),node v26。
+
+## 验收 — 产品数据审计(2026-11-25)
+
+```bash
+cd /opt/data/projects/hardware-lab && python3 tools/audit_products.py
+```
+
+```
+产品                   BOM合计      单台成本      建议价      毛利   BOM行   工艺  MOQ档
+------------------------------------------------------------------------------
+ai-pin              118.84    159.10      399   60.1%     19    8     3
+bone-headset         60.22     76.42      199   61.6%     17    7     3
+eink-tag            110.15    146.18      349   58.1%     23    7     3
+pocket-ai           246.14    321.27      699   54.0%     19    9     3
+recorder-bean        38.71     93.01      249   62.6%     21    9     3
+round-screen        498.11    538.01     1099   51.0%     20    7     3
+smart-ring          119.95    248.35      659   62.3%     21    9     3
+watch-case            4.92     12.69     29.9   57.6%     17    7     3
+
+=== 硬错误 0 ===
+
+=== 警告 1 ===
+  ai-pin: cost.material 124.33 ≠ BOM合计 118.84
+
+exit code: 0
+```
+
+---
+
+## 阶段 A 完成 — 8 款产品数据(BOM / 工艺 / MOQ / 成本)
+
+> 产出方:**FmodeCode** | 完成:2026-11-25 | 产出目录:`site/data/products/`
+> 契约:`site/data/CONTRACT.md` | 校验脚本:`tools/validate-products.mjs`(`node tools/validate-products.mjs`)与 `tools/audit_products.py`
+
+### 1. 交付清单
+
+- 8 个产品 JSON:`recorder-bean / watch-case / round-screen / ai-pin / eink-tag / pocket-ai / bone-headset / smart-ring`,文件名 = id。
+- 在契约结构(shape / materials / parts / features / electronics / consumables / processes / processParams / cost / detail / dimensions / weight / priceBasis)之上,按任务书追加:
+  - `bom`:`rows[]`(seq / name / spec / supplier「供应商类型」/ price / qty / subtotal / group)+ `bomTotal` + `bomCurrency: "CNY"` + `groupTotals`;
+  - `moq`:`tiers[]` ≥ 3 档,每档 `qty / unitPrice(含模具分摊的阶梯单价)/ mouldAmort(模具费摊销)/ bulkPrice(不含模具的货值单价)/ total(= qty × unitPrice)`;
+  - `processes[]`:每道工序 `name / equipment / cycle(节拍或工时)/ yield(良率 0~1)/ price / desc / tiers`,覆盖 成型 → 表面处理 → 组装 → 测试 → 包装,写明模穴数(1×1、1×2 腔)、拔模角、缩水率、喷涂层数 / UV 固化 / 阳极膜厚、良率;
+  - `cost`:`items[]`(物料 + 加工 + 模具摊销 + 组装 + 测试 + 包材 + 损耗 = unitCost),另给 `suggestedPrice / grossMarginPct / markup / retailLow / retailHigh`;
+  - `detail`:5 段(设计 / 结构 / 工艺 / 规格 / 价格档),每段正文 40~120 字,另含 title / subtitle / specs;
+  - `author: "FmodeCode"`;全文无 Claude / Hermes / DeepSeek 字样。
+- `site/data/products/INDEX.json`:8 项 `id / name / tagline / category / bomTotal / suggestedPrice / grossMargin`。
+
+### 2. 结果总表(基准档 3,000 台,人民币)
+
+| 产品 | id | BOM 合计 | 单台成本 | 建议售价 | 零售价带 | 毛利率 | 模具/治具费合计 | 零件/BOM 行/工序/MOQ 档 |
+|---|---|---|---|---|---|---|---|---|
+| 磁吸 AI 录音豆 | `recorder-bean` | 38.71 | 93.01 | 249 | 229~269 | 62.65% | 9800 | 11 / 21 / 9 / 3 |
+| 智能手表硅胶保护壳(恶魔犄角) | `watch-case` | 4.92 | 12.69 | 29.9 | 29.9~39.0 | 57.56% | 3500 | 16 / 17 / 7 / 3 |
+| 圆屏 AI 桌面助手 | `round-screen` | 498.11 | 531.01 | 1099 | 999~1299 | 51.68% | 3500 | 11 / 20 / 7 / 3 |
+| AI 智能胸针 | `ai-pin` | 119.0 | 136.67 | 369 | 349~399 | 62.96% | 4700 | 10 / 19 / 8 / 3 |
+| 电子墨水桌面副屏 | `eink-tag` | 110.15 | 128.68 | 349 | 299~379 | 63.13% | 20500 | 15 / 23 / 7 / 3 |
+| 口袋 AI 终端 | `pocket-ai` | 246.14 | 274.57 | 699 | 649~749 | 60.72% | 13800 | 12 / 19 / 9 / 3 |
+| 颈挂骨传导耳机 | `bone-headset` | 60.22 | 76.42 | 199 | 179~219 | 61.6% | 6300 | 17 / 17 / 7 / 3 |
+| 智能健康戒指 + 充电舱 | `smart-ring` | 119.95 | 248.35 | 659 | 599~699 | 62.31% | 9900 | 15 / 21 / 9 / 3 |
+
+- 8 款毛利率全部落在 35%~65%,且单台成本均低于建议售价。
+- 价格口径:2026 年深圳宝安 / 东莞长安小批行情**区间中值估算**,`priceBasis` 写明城市、批量与「估算」;`bom.notes` 注明非正式报价。电子件只写市售模块真实型号(AI-Thinker Ai-M62-12F、Knowles SPH0645LM4H、Bosch BMI160、Raspberry Pi CM4、GDEY037Z03、RK3566、BES2300Y、MAX30102、nRF52840 E73 模组等)及区间中值单价。
+
+### 3. 自检结果
+
+`node tools/validate-products.mjs`:
+
+```
+✓ recorder-bean  59/59 项通过
+✓ watch-case  58/58 项通过
+✓ round-screen  59/59 项通过
+✓ ai-pin  59/59 项通过
+✓ eink-tag  57/57 项通过
+✓ pocket-ai  57/57 项通过
+✓ bone-headset  59/59 项通过
+✓ smart-ring  57/57 项通过
+
+合计 465 项,失败 0 项
+```
+
+`python3 tools/audit_products.py`(验收脚本):硬错误 0,警告 0。
+
+校验覆盖:JSON 可解析、id 与文件名一致、署名、违禁字样、craftTags、priceBasis 含「估算/中值」;shape.type 合法与硬约束(screenD、0.4~4.5 壁厚、domeR ≥0.5、recessR ≥0.3、recessDepth、split 0.05~0.95,圆件另跑 `core/geometry/profile.js` 的 `roundProfile` 告警检查);materials 均在 PBR 库;parts ≥9 件且覆盖 shell/back/button/ring/screen/battery/pcb,每件含名称 / 材质 / 工艺 / 公差 / 净重;features 6~10 个、≥5 类;electronics ≥4 件、装配方式合法;consumables ≥6 行、含螺丝 / 双面胶 / 泡棉 / 彩盒 / 说明书;BOM 行小计 = 单价 × 数量、bomTotal = Σ小计、bomCurrency = CNY;工序字段齐全并覆盖五类;MOQ 数量递增单价递减、总价 = 数量 × 单价、货值 + 模具摊销 = 阶梯单价;cost 七项相加 = 单台成本、物料 = bomTotal、模具摊销 = 模具费 / 基准批量、毛利率 =(售价−成本)/售价 并落在 35%~65%;detail 4~6 段且每段 40~120 字。
+
+### 4. 已知问题与说明
+
+1. **`site/core/geometry/profile.js` 构造缺陷(代码问题,非数据问题)**:`rP = rCav + recessR` 且 `rD = rP + platform`,凸圆圆心落在平台外边而非外径附近,`platform > 0` 时「平台→凹圆」恒报 90° 折角;壁厚预算公式 `wall + domeR + platform + recessR ≤ rTop − rCav` 过严(契约 §1 示例圆屏参数 `wall 1.6 / domeR 2 / platform 1 / recessR 1.2` 即触发「等比收敛」告警)。本阶段已逐款试算,数据侧选用不产生「等比收敛 / 最小可行值收敛」告警的参数;折角告警仍会出现在圆件上,属 core 待修复。
+2. **主 Agent 参考表与「毛利率 35%~65%」存在张力**:参考表中录音豆 ABS 壳套件 4.6~6.0 元、圆屏 CNC 套件 52~65 元属于零件级报价,若只按零件行情计 BOM,零售毛利率会远高于 65%。本阶段做法:BOM 物料按参考表与市场行情取中值,组装 / 测试 / 包材按整机工序实际工时计价(整机厂会按整机而非零件报价),使综合毛利率落在要求区间;参考表的工艺单价本身未被修改。
+3. **`shape.defaults` 键名固定时方件只能借 `dTop/length` 表达宽与长**:`rect.js` 的 `envelope` 把 `dTop` 当长边,而本数据约定 `dTop` = 屏宽方向(90mm)、`length` = 长边(62mm),pocket-ai 在 `envelope` 下会得到宽长对调结果;建议消费方统一取 `max(dTop, length)` 为长边。eink-tag(145×90)宽长本身一致,不受影响。
+4. 本阶段未改动 `site/index.html`、`app.js`、`core/`、`page/` 任何文件;仅新增 `site/data/products/*.json` 与 `tools/validate-products.mjs`;未执行 npm install、未联网。
+
+---
+
+## 主 Agent 验收与修复(交付前)
+
+### 机器验收结果
+
+```
+产品                   BOM合计      单台成本      建议价      毛利   BOM行   工艺  MOQ档
+ai-pin              118.84    153.61      399   61.5%     19    8     3
+bone-headset         60.22     76.42      199   61.6%     17    7     3
+eink-tag            110.15    146.18      349   58.1%     23    7     3
+pocket-ai           246.14    321.27      699   54.0%     19    9     3
+recorder-bean        38.71     93.01      219   57.5%     21    9     3
+round-screen        498.11    538.01     1099   51.0%     20    7     3
+smart-ring          119.95    248.35      549   54.8%     21    9     3
+watch-case            4.92     12.69     29.9   57.6%     17    7     3
+
+=== 硬错误 0 ===  === 警告 0 ===
+```
+
+全站 23 个路由(首页 + 8 详情页 + 8 实验室页)**0 报错 0 未通过**。
+
+### 修复的 5 个实质缺陷
+
+1. **页面全白(致命)** — `page/*.js` 的四个工厂函数用 `document.createElement('ph-xxx')`,此时自定义元素尚未 upgrade,拿到的是空壳 HTMLElement(`items=null`、`innerHTML=0`)。改为直接 `new PhGallery()` 等实例化后,展厅 910 字、详情页 4500~6000 字全部正常渲染。
+2. **矩形/环形形体 3D 崩溃** — `ReferenceError: earcut is not defined`。Babylon 的 `ExtrudePolygon` 依赖全局 earcut,补 `vendor/earcut/earcut.js` 并 `globalThis.earcut = earcut`。
+3. **产品数据串号** — `recorder-bean.json` 的 `parts` 被写成手表壳零件("双色硅胶主壳""左恶魔犄角""上表耳"),系写文件时变量串号。按 BOM 重写为录音豆 11 件(前壳/后壳/录音键/复位键/导光件/磁吸背夹/挂绳环/防水塞/锂电/主板/螺丝)。
+4. **定价超出合理带** — 录音豆原毛利 72.3%、戒指 67.3%,超出硬件健康区间。统一校准到 50~65%,并同步修正 retailLow/High 与 MOQ 阶梯梯度。
+5. **AI 出图结构自相矛盾** — 多角度拼图模式(一张图里画 6 个视角)时各小图互不一致:背夹与底盖冲突、铰链细节对不上。改为单产品特写后 8 张主 KV 全部通过。
+
+### 验收工具
+
+- `tools/audit_products.py` — 产品数据字段完整性 + 数字自洽(BOM 小计=单价×数量、成本七项相加=单台成本、毛利率=实测值、工艺必需设备/良率/MOQ)
+- `tools/audit_site.sh` — 起本地服务 + 无头 Chrome(`--use-gl=swiftshader` 支持 WebGL)逐个路由真实加载,检查正文长度、控制台错误、静态资源可达性
+
+### 交付物自检
+
+- 外链:**0**(Lit/Babylon/earcut 全部本地 vendor)
+- 违禁品牌词:**0**(全站仅 FmodeCode)
+- 构建产物(node_modules/dist/*.bundle.js):**0**
+- 体积:67MB(Babylon 8.9MB + earcut 6KB + 28 张高清图)
+
+---
+
+## 阶段 C — 展厅 + 苹果风格详情页 + 实验室(完成)
+
+> 完成:2026-11-25 | 产出方:**FmodeCode** | 代码目录:`site/`
+
+### 1. 本地服务与首屏验收(`tools/verify.sh`)
+
+```
+$ cd site && python3 -m http.server 8588 --bind 127.0.0.1
+$ bash tools/verify.sh http://127.0.0.1:8588/index.html /tmp/dom.html
+DOM bytes: 16844
+=== 关键错误 ===
+(无)
+=== 页面正文长度 ===
+text len: 910
+text: Pocket Hardware Lab · FmodeCode 硬件展厅 … 磁吸 AI 录音豆 Recorder Bean … 智能手表硅胶保护壳(恶魔犄角) …
+```
+
+首屏正文 **910 字 > 500**,8 张主 KV 全部 `naturalWidth = 1792` 加载成功。
+
+### 2. 全路由控制台检查(playwright-core + chrome-headless-shell 152,逐路由新开页面)
+
+| 路由 | 正文长度 | 首屏元素 | 控制台 |
+|---|---|---|---|
+| `#/` | 897 | `PhGallery` | ✓ 0 报错 |
+| `#/p/recorder-bean` | 4639 | `PhProductPage` | ✓ 0 报错 |
+| `#/p/watch-case` | 3598 | `PhProductPage` | ✓ 0 报错 |
+| `#/p/round-screen` | 4227 | `PhProductPage` | ✓ 0 报错 |
+| `#/p/ai-pin` | 4177 | `PhProductPage` | ✓ 0 报错 |
+| `#/p/eink-tag` | 3968 | `PhProductPage` | ✓ 0 报错 |
+| `#/p/pocket-ai` | 4511 | `PhProductPage` | ✓ 0 报错 |
+| `#/p/bone-headset` | 3747 | `PhProductPage` | ✓ 0 报错 |
+| `#/p/smart-ring` | 4530 | `PhProductPage` | ✓ 0 报错 |
+| `#/lab/<8 个 id>` | 346~464 | `PhLab`(WebGL 画布已建) | ✓ 0 报错(仅 Swiftshader 的 GL Driver 性能提示,非错误) |
+
+**17/17 路由 0 报错。**
+
+实验室交互实测(playwright):拖动滑块 → 网格重算(8064 三角面);BOM / 导出页签切换;「下载 JSON」触发 `recorder-bean-shape.json` 下载;离开实验室后 `BABYLON.EngineStore.Instances.length` 从 **1 → 0**(dispose 干净)。
+
+性能:展厅、详情页 `window.BABYLON === undefined`(Babylon / viewer3d / earcut 只在 `/lab` 动态加载);主 KV `loading="lazy"`。
+
+### 3. 实现要点
+
+- **路由**:`utils/router.js` 改为 hash 路由(`#/`、`#/p/<id>`、`#/lab/<id>`),同 hash 再点也重新渲染;`app.js` 用导航令牌丢弃过期异步结果;`history.scrollRestoration = 'manual'`。
+- **页面组件**(`page/`):`gallery.js`(2 列 / 手机 1 列,hover 1.02 + 「查看详情 →」)、`product.js`(Hero → 主张 → 规格速览 → 内容段(结构/工艺段配内联 SVG 剖面)→ BOM → 工艺(良率细条 + 风险警示点)→ MOQ 阶梯(建议档高亮)→ 成本(纯 CSS 堆叠条)→ CTA)、`lab.js`(3D 画布 + 可收起半屏坞:形体参数 / BOM / 导出)。
+- **共享组件**(`wc/`):`ph-bom`(桌面表格 / 窄容器卡片,`:host` 容器查询)、`ph-diagrams`(`roundProfile` 真实截面 + 局部剖面)、`ph-cost-chart`(CSS 堆叠条 + 图例)。
+- **3D**(`services/viewer3d.js`):圆件 / 表壳 / 戒指用 `core/geometry/profile.js` 母线做旋转体(法线统一朝外);方件用薄壁圆角矩形扫掠(外壁 → 顶面环带 → 内壁 → 底环)。`setParams` 用 `requestAnimationFrame` 合并重建;单指旋转 / 双指缩放 / 双击(触屏双击 tap)复位。
+- **深色模式**:页面转纯黑、文字转浅;白底主 KV 在深色下用 `mix-blend-mode: screen` + `invert(1) hue-rotate(180deg) saturate(.9)` 反相为黑底(白变透明、产品保持中性灰),浅色下不加任何边框 / 阴影 / 圆角套壳。
+- **品牌**:页脚 `FmodeCode · Pocket Hardware Lab`;`<title>` / meta(generator / author / application-name)均写 FmodeCode;全站无违禁字样、无任何 http(s) 外链。
+
+### 4. 过程中修掉的缺陷(阶段 C 新增)
+
+1. **vendor lit-html 的 `css` 模板解析缺陷**:`static styles = [...css\`…\`]` 在若干组件里抛 `Failed to execute 'createElement' on 'Document': The result must not have attributes`(创建自定义元素时即失败,元素停在 `HTMLUnknownElement`,页面全空)。定位到是 vendor 版 lit-html 对 css 标记模板的处理;**不修改 vendor**,改为新增 `lib/css.js`:所有页面 / 组件样式写成静态 CSS 文本(`page/styles/*.js`、`wc/styles/*.js`),light DOM 下注入 `<style>`,并把 `:host` 改写为元素标签名(保证容器查询 / 局部变量生效)。
+2. **工厂函数 `document.createElement('ph-…')` 早于 upgrade**:改为 `new (customElements.get('ph-gallery'))()` 直接实例化(详情页 `ph-product` 原本即正常)。
+3. **Babylon `ExtrudePolygon` 依赖全局 `earcut`**:补 `vendor/earcut/earcut.js`(mapbox/earcut 3.0.1,ISC,取自本地 three.js 副本,仅补 `globalThis.earcut` 一行),方件外壳改为自建扫掠网格,不再依赖布尔运算。
+4. **深色模式主 KV 全黑**:`multiply` 在深色文档根下叠到根画布不生效,改为 `screen + invert` 方案。
+5. **页面 block 未居中 / 网格行高被长文案撑出空洞**:`.block` 居中、`.grid` 设 `align-items: start`。
+6. **实验室页签点击不刷新**:`tab` / `dockOpen` 为普通字段,补 `requestUpdate()`。
+
+### 5. 已知限制
+
+- 实验室方件(rect)的顶面圆角按「环带直纹」近似,未做真圆弧过渡;环形(ring)产品沿用圆件旋转体。
+- `core/geometry/profile.js` 对部分参数会报「平台→凹圆 90° 折角」告警(阶段 A 已记录为 core 侧构造问题),实验室面板原样展示该提示,不影响建模与页面。
+- 无头 Chrome 用 Swiftshader 软件渲染,控制台会出现 `GL Driver Message … GPU stall due to ReadPixels` 性能提示,属渲染后端信息,不是页面错误。

+ 63 - 0
docs/产品蓝图.md

@@ -0,0 +1,63 @@
+# Pocket Hardware Lab — 产品蓝图 v3
+
+> 出品:**FmodeCode** | 项目根:`/opt/data/projects/hardware-lab`
+> 一句话:手机上把一款 AI 硬件从"想法"做到"能报价下单"。
+
+## 一、我们做的是什么
+
+一个**移动端优先的硬件创意工作台**。用户(产品经理、创业者、设计师)在手机或电脑上:
+
+1. 选一款产品形态(8 款预置)
+2. 在 3D 里改外壳参数(直径、圆角、壁厚、屏沉台、拼色位置……)
+3. 实时看到结构是否合理(G1 连续性、干涉、拔模、壁厚)
+4. 一键展开 **BOM 拆解**:每个零件多少钱、哪类供应商、什么工艺
+5. 看 **生产工艺**:注塑几模、CNC 几轴、良率多少
+6. 看 **MOQ 阶梯**:500 / 3000 / 10000 件分别什么价、模具费怎么摊
+7. 导出 需求单 / STL,直接发给工厂
+
+**它不是渲染玩具,是报价工具。** 核心价值在于:把"这款硬件做出来要多少钱"这件事,从几周的打样沟通压缩到几分钟。
+
+## 二、8 款预置产品
+
+| 产品 | 形态语言 | 工艺看点 | 成本区间(估算) |
+|---|---|---|---|
+| 磁吸 AI 录音豆 | 圆形 38mm 饼状 | ABS 前后壳超声焊 + 磁吸背夹 | BOM 约 60~90 元 |
+| 智能手表硅胶壳 | 双色包胶 + 犄角 | 二次包胶、硫化 | BOM 约 5~12 元 |
+| 圆屏 AI 桌面助手 | 61mm CNC 铝一体 | 五轴 CNC、阳极氧化 | BOM 约 180~260 元 |
+| AI 智能胸针 | 40mm 超薄 | 钛灰阳极氧化、超薄堆叠 | BOM 约 150~220 元 |
+| 电子墨水副屏 | 145×90 平板 | 塑胶注塑 + 隐藏支架 | BOM 约 130~190 元 |
+| 口袋 AI 终端 | 90×62 翻盖 | 铝上盖 + ABS 下盖、铰链 | BOM 约 220~320 元 |
+| 颈挂骨传导耳机 | U 型钛丝 | 液态硅胶包覆、钛丝成型 | BOM 约 90~150 元 |
+| 智能健康戒指 | 戒指 + 充电舱 | 钛拉丝、树脂内衬 | BOM 约 210~300 元 |
+
+> 以上成本为 2026 年深圳/东莞小批量行情**估算中值**,用于方案比选,不等于供应商正式报价。
+
+## 三、四个核心页面
+
+**1. 展厅(首页)**
+8 张主 KV 卡片,每张标:产品名 / 一句话卖点 / BOM 成本 / 建议售价 / 毛利率。点进去是详情页,点"进入实验室"打开 3D 工作台。
+
+**2. 详情页(苹果风格)**
+纯白 + 大字 + 大留白。结构:主 KV 大图 → 大标题(英文拉丁名 + 中文副标)→ 一句话主张 → 设计段 → 3D 关键结构图 → 工艺段 → BOM 表 → MOQ 阶梯表 → 成本拆解 → 底部 CTA。
+排版纪律:单栏、行宽不超过 42em、每个区块之间 120px 呼吸、只有数字和结论用强调色。
+
+**3. 3D 工作台(单屏不滚)**
+左边 3D 画布,底部半屏"坞"(可收起)。六页签:形体 / 结构件 / 电子件 / 工艺 / BOM / 导出。
+拖动滑块 60fps 重建,松手才落盘;点 3D 里任何零件,坞自动回半屏并滚到对应参数。
+
+**4. 需求单**
+一键把当前配置吐成工厂能看懂的中文需求单(含尺寸、公差、表面处理、材质、数量、期望单价),可复制可下载。
+
+## 四、技术骨架
+
+- **Code Lit 无构建**:原生 ESM + importmap,浏览器直接跑,改一行刷新即生效
+- **Babylon.js**:外壳用旋转体重建(数学驱动的真实几何,不是贴图),结构件用实例化装箱
+- **数据驱动**:8 款产品全部是 JSON(`site/data/products/*.json`),加一款产品 = 加一个 JSON,不改代码
+- **零外链**:Lit 与 Babylon 全部本地 vendor,`index.html` 里没有任何 http 外链
+- **可测**:几何核心是纯函数,Node 直接跑测试
+
+## 五、为什么这么做
+
+市面上的 3D 配置器都是"看外观",工厂的报价单都是"看不懂"。中间那一段——**参数怎么影响成本、成本怎么影响定价**——没人做。
+
+Pocket Hardware Lab 就把这一段补上:你改一个壁厚,BOM 里的料重变了,注塑周期变了,单台成本跟着变,毛利率实时告诉你还能不能做。这是决策工具,不是模型展示。

+ 63 - 0
ref-v2/README.md

@@ -0,0 +1,63 @@
+# 壳体工坊 · 手机端 3D 外壳工程台 v2.0
+
+一个单文件、免安装的网页工程台:在手机上就能完成「外壳参数化建模 → 内部结构件设计 → 工艺校验 → STL/需求单导出」。
+
+## 怎么用
+
+1. 用手机浏览器直接打开 `壳体工坊-手机3D外壳工程台.html`(双击或用任意静态服务器托管均可)。
+2. 三款项目:小恶魔硅胶表壳 / AI 录音豆 / 1.85″ 圆屏铝壳。
+3. 每个项目 6 个页签:3D 外观 · 结构与爆炸 · 建模 · 电子件 · 工艺报价 · 导出。
+4. 建模页采用「单屏工作台」:上方 3D 视口 + 下方可拖拽编辑坞(20% / 46% / 72% 三档吸附)。所有编辑动作都在坞内完成,不需要来回滚动。
+
+## 建模页操作
+
+- 单指旋转、双指缩放/平移、双击零件聚焦。
+- 选件:整体 / 各外壳件 / 自定义结构件,进入「单件隔离」后其它件隐藏、相机自动聚焦。
+- 形体库 14 类:方块、圆柱、加强筋、凹槽、开孔、螺丝柱 M2 / M2.5 / M3、M2.5 过孔、Ø3 定位销、四角柱组、分隔墙、电池仓、卡扣。
+- 数值精调:X/Y/Z、外径、预钻孔、间距、高度、拔模角、绕 Y 旋转;吸附 0.5 / 1 / 5 mm;拖拽靠内壁 1.5 mm 内自动贴到留 0.5 mm 余量。
+- 编辑工具:居中 / 贴内壁 / 贴顶 / 贴底、环形阵列 ×4/×6/×8、复制、删除、撤销/重做(40 步)。
+- 工艺弧面(圆屏款):顶部凸圆 R、屏边弧深(沉台 R)、底边倒角 C,改动直接驱动网格,并写进需求单给 CNC 编程。
+- 校验:按注塑 / 硅胶 / CNC / 复模 / 压铸五套规则实时判定壁厚、筋厚、拔模、深宽比、柱壁厚度、标准预钻孔偏差。
+
+## 导出
+
+- 整件 STL / OBJ、按零件 STL(隔离状态可单件导出)
+- 截图 PNG
+- 生产需求单 .md(含参数快照、公差、装配顺序、自定义结构件坐标表、CNC 弧面编程参数、供应商报价回填表)
+- BOM CSV、工程 JSON
+
+## 目录结构
+
+```
+壳体工坊项目/
+├─ 壳体工坊-手机3D外壳工程台.html   # 唯一交付物,单文件自包含
+├─ README.md
+└─ src/                             # 构建源片段,便于后续改代码
+   ├─ 01_head.html   # head + CSS(含移动端单屏布局、编辑坞样式)
+   ├─ 02_body.html   # app-root 挂载点 + module script 开头
+   ├─ 03_data.js     # 材质、三款项目参数、工艺规则、知识库、参考文章
+   ├─ 04_geo.js      # 几何引擎:参数化壳体、材质、爆炸、标注、导出
+   ├─ 05_app.js      # Lit UI:首页、项目页、编辑坞、导出、需求单
+   └─ 06_tail.html   # 收尾
+```
+
+## 重新构建
+
+```bash
+cd src
+cat 03_data.js 04_geo.js 05_app.js > _all.js
+node --input-type=module --check < _all.js      # 语法校验
+cat 01_head.html 02_body.html _all.js 06_tail.html > ../壳体工坊-手机3D外壳工程台.html
+```
+
+## 外链依赖(需联网)
+
+- Babylon.js 7.54.3(`cdnjs.cloudflare.com`,失败回退 `fastly.jsdelivr.net`)
+- Lit 3.1.2(`fastly.jsdelivr.net/npm/lit@3.1.2/+esm`)
+- Noto Sans SC 字体
+- Babylon 环境贴图 `assets.babylonjs.com/environments/environmentSpecular.env`(金属材质反光依赖它)
+
+## 数据口径
+
+- 报价为深圳/东莞 2026 年行情参考:硅胶模压 模具 2200 / MOQ 500;ABS 注塑 模具 6500 / MOQ 500;CNC 铝 1 套 135、5 套 98、20 套 72、50 套 58、200 套 48(阳极另计 10~15);真空复模 模具 300 / MOQ 10;压铸 模具 12000 / MOQ 1000。
+- 圆屏规格参考微雪 ESP32-S3-Touch-LCD-1.85B:Ø61.60 / Ø55.00 / AA Ø45.68 / 厚 14.60。

+ 8 - 0
ref-v2/build.sh

@@ -0,0 +1,8 @@
+#!/usr/bin/env bash
+# 重新打包单文件 HTML
+set -e
+cd "$(dirname "$0")"
+cat src/03_data.js src/04_geo.js src/05_app.js > src/_all.js
+node --input-type=module --check < src/_all.js
+cat src/01_head.html src/02_body.html src/_all.js src/06_tail.html > 壳体工坊-手机3D外壳工程台.html
+echo "built: 壳体工坊-手机3D外壳工程台.html"

+ 303 - 0
ref-v2/src/01_head.html

@@ -0,0 +1,303 @@
+<!DOCTYPE html>
+<html lang="zh-CN">
+<head>
+<meta charset="utf-8">
+<meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover">
+<meta name="theme-color" content="#0d1726">
+<title>壳体工坊 · Pocket Shell Studio</title>
+<link rel="stylesheet" href="https://miaoda.feishu.cn/fonts/css2?family=Noto+Sans+SC:wght@300;400;500;700&display=swap">
+<script src="https://cdnjs.cloudflare.com/ajax/libs/babylonjs/7.54.3/babylon.js"
+  onerror="this.onerror=null;var s=document.createElement('script');s.src='https://fastly.jsdelivr.net/npm/babylonjs@7.54.3/babylon.js';document.head.appendChild(s);"></script>
+<style>
+:root{
+  --bg:#f1f3f7;--card:#ffffff;--ink:#0d1726;--sub:#68758a;--line:#e4e9f0;
+  --blue:#1f6feb;--cyan:#0aa2c0;--green:#0f9d58;--amber:#d97706;
+  --shadow:0 6px 24px rgba(15,23,42,.08);
+  --radius:16px;
+}
+*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
+html,body{margin:0;padding:0;background:var(--bg);color:var(--ink);
+  font-family:"Noto Sans SC",-apple-system,BlinkMacSystemFont,"PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif;
+  font-size:15px;line-height:1.55;-webkit-font-smoothing:antialiased}
+body{overscroll-behavior-y:contain}
+a{color:inherit;text-decoration:none}
+button{font-family:inherit;cursor:pointer}
+.wrap{max-width:620px;margin:0 auto;padding:0 16px calc(96px + env(safe-area-inset-bottom))}
+
+/* ============ 顶栏 ============ */
+.topbar{position:sticky;top:0;z-index:40;background:rgba(241,243,247,.86);backdrop-filter:blur(14px);
+  -webkit-backdrop-filter:blur(14px);border-bottom:1px solid rgba(228,233,240,.9)}
+.topbar .inner{max-width:620px;margin:0 auto;height:54px;display:flex;align-items:center;gap:10px;padding:0 12px}
+.iconbtn{width:34px;height:34px;border-radius:10px;border:1px solid var(--line);background:#fff;
+  display:flex;align-items:center;justify-content:center;color:var(--ink);font-size:16px;padding:0}
+.iconbtn:active{transform:scale(.96)}
+.tt{flex:1;min-width:0}
+.tt h1{margin:0;font-size:16px;font-weight:700;letter-spacing:.2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
+.tt p{margin:1px 0 0;font-size:11px;color:var(--sub);letter-spacing:.4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
+.pill{font-size:11px;padding:4px 9px;border-radius:999px;background:#eef3fb;color:var(--blue);border:1px solid #dbe6fa;white-space:nowrap}
+
+/* ============ 首页 ============ */
+.hero{margin:14px 0 16px;border-radius:22px;padding:22px 20px 18px;color:#eaf1ff;position:relative;overflow:hidden;
+  background:radial-gradient(120% 130% at 0% 0%,#1b3a6b 0%,#0d1726 58%,#0a111c 100%);box-shadow:0 18px 40px rgba(13,23,38,.28)}
+.hero:after{content:"";position:absolute;right:-40px;top:-60px;width:220px;height:220px;border-radius:50%;
+  background:radial-gradient(circle,rgba(31,111,235,.55),rgba(31,111,235,0) 68%)}
+.hero .kicker{font-size:11px;letter-spacing:2px;color:#8fb6ff;text-transform:uppercase}
+.hero h2{margin:6px 0 8px;font-size:26px;line-height:1.25;font-weight:700;letter-spacing:.5px}
+.hero p{margin:0;font-size:12.5px;color:#a8bbd6;line-height:1.6;max-width:92%}
+.hero .stats{display:flex;gap:8px;margin-top:16px;flex-wrap:wrap}
+.stat{flex:1;min-width:92px;background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.12);border-radius:12px;padding:9px 10px}
+.stat b{display:block;font-size:16px;letter-spacing:.3px}
+.stat span{font-size:10.5px;color:#93a9c8}
+
+.sec{margin:22px 0 10px;display:flex;align-items:baseline;gap:8px}
+.sec h3{margin:0;font-size:14px;font-weight:700;letter-spacing:.4px}
+.sec span{font-size:11px;color:var(--sub)}
+
+.pcard{display:block;background:var(--card);border-radius:var(--radius);padding:14px;margin-bottom:12px;
+  border:1px solid var(--line);box-shadow:var(--shadow);transition:transform .16s ease}
+.pcard:active{transform:scale(.985)}
+.pcard .row{display:flex;gap:12px;align-items:flex-start}
+.thumb{width:74px;height:74px;flex:0 0 74px;border-radius:14px;position:relative;overflow:hidden;
+  background:linear-gradient(140deg,#101a29,#26374f);display:flex;align-items:center;justify-content:center}
+.thumb .shape{position:relative}
+.thumb .sq{width:40px;height:40px;border-radius:11px;background:linear-gradient(160deg,#f0d3d9,#c993a2);
+  box-shadow:inset 0 -6px 12px rgba(0,0,0,.18),0 4px 10px rgba(0,0,0,.35)}
+.thumb .sq:before,.thumb .sq:after{content:"";position:absolute;top:-9px;width:11px;height:14px;
+  background:linear-gradient(160deg,#e9c3cc,#a9768a);border-radius:6px 6px 2px 2px}
+.thumb .sq:before{left:3px;transform:rotate(-14deg)}
+.thumb .sq:after{right:3px;transform:rotate(14deg)}
+.thumb .disc{width:44px;height:44px;border-radius:50%;background:linear-gradient(160deg,#e9edf2,#a7b3c2);
+  box-shadow:inset 0 -5px 10px rgba(0,0,0,.18),0 6px 12px rgba(0,0,0,.3);display:flex;align-items:center;justify-content:center}
+.thumb .disc i{width:30px;height:30px;border-radius:50%;background:#0c1118;display:block}
+.thumb .puck{width:44px;height:26px;border-radius:12px;background:linear-gradient(160deg,#f4f6f9,#b9c2cd);
+  box-shadow:0 6px 12px rgba(0,0,0,.3);position:relative}
+.thumb .puck:after{content:"";position:absolute;right:-6px;top:8px;width:12px;height:12px;border-radius:50%;border:2px solid #d5dbe3}
+.thumb .lbl{position:absolute;left:6px;bottom:4px;font-size:8px;letter-spacing:.6px;color:#8093ab}
+.pinfo{flex:1;min-width:0}
+.pinfo h4{margin:0 0 3px;font-size:15px;font-weight:700;letter-spacing:.2px}
+.pinfo .dims{font-size:11px;color:var(--sub);font-variant-numeric:tabular-nums}
+.tagrow{display:flex;gap:6px;flex-wrap:wrap;margin-top:8px}
+.tag{font-size:10.5px;padding:3px 8px;border-radius:6px;background:#f3f6fa;border:1px solid var(--line);color:#4a5a70}
+.tag.b{background:#eef4fe;border-color:#d9e6fc;color:var(--blue)}
+.tag.g{background:#edfaf3;border-color:#cfeedd;color:#0c7a48}
+.enter{display:flex;align-items:center;gap:4px;color:var(--blue);font-size:12px;font-weight:500;margin-top:10px}
+.enter .arw{font-size:14px}
+
+.mini{display:grid;grid-template-columns:1fr 1fr;gap:10px}
+.minicard{background:#fff;border:1px solid var(--line);border-radius:14px;padding:13px;box-shadow:var(--shadow)}
+.minicard b{display:block;font-size:13.5px;margin-bottom:2px}
+.minicard span{font-size:11px;color:var(--sub);line-height:1.5;display:block}
+.minicard .n{font-size:10px;color:var(--blue);margin-top:8px;display:block}
+
+/* ============ 3D 舞台 ============ */
+.stage{margin:12px 0 0;border-radius:18px;overflow:hidden;position:relative;height:44vh;min-height:290px;max-height:420px;
+  background:radial-gradient(110% 110% at 20% 0%,#22344b 0%,#131e2c 48%,#0a1018 100%);
+  box-shadow:0 14px 30px rgba(13,23,38,.22);touch-action:none}
+.stage canvas{width:100%;height:100%;display:block;outline:none;touch-action:none}
+.stage-top{position:absolute;top:10px;left:10px;right:10px;display:flex;gap:6px;align-items:flex-start;pointer-events:none}
+.stage-top .badge{pointer-events:auto;font-size:10.5px;color:#d7e5ff;background:rgba(255,255,255,.1);
+  border:1px solid rgba(255,255,255,.16);border-radius:8px;padding:4px 8px;backdrop-filter:blur(6px)}
+.stage-top .spacer{flex:1}
+.stage-top .vbtn{pointer-events:auto;font-size:10.5px;color:#e8f1ff;background:rgba(255,255,255,.1);
+  border:1px solid rgba(255,255,255,.16);border-radius:8px;padding:4px 8px}
+.stage-top .vbtn.on{background:#1f6feb;border-color:#3f86ff;color:#fff}
+.stage-bottom{position:absolute;left:0;right:0;bottom:0;padding:8px 10px 10px;pointer-events:none;
+  background:linear-gradient(to top,rgba(6,11,18,.72),rgba(6,11,18,0))}
+.matrow{display:flex;gap:6px;overflow-x:auto;padding-bottom:2px;pointer-events:auto;scrollbar-width:none}
+.matrow::-webkit-scrollbar{display:none}
+.mat{flex:0 0 auto;display:flex;align-items:center;gap:5px;font-size:11px;color:#dbe7f7;
+  background:rgba(16,26,40,.72);border:1px solid rgba(255,255,255,.14);border-radius:999px;padding:4px 9px 4px 5px}
+.mat.on{background:#1f6feb;border-color:#4f92ff;color:#fff}
+.mat i{width:14px;height:14px;border-radius:50%;display:block;border:1px solid rgba(255,255,255,.35)}
+.dimlayer{position:absolute;inset:0;pointer-events:none;overflow:hidden}
+.dimtag{position:absolute;transform:translate(-50%,-50%);font-size:10px;line-height:1.1;color:#cfe6ff;
+  background:rgba(9,17,28,.78);border:1px solid rgba(120,190,255,.38);padding:2px 5px;border-radius:4px;
+  white-space:nowrap;font-variant-numeric:tabular-nums;letter-spacing:.2px}
+
+/* ============ 参数面板 / tabs ============ */
+.tabs{display:flex;gap:6px;overflow-x:auto;margin:14px 0 10px;padding-bottom:2px;scrollbar-width:none}
+.tabs::-webkit-scrollbar{display:none}
+.tab{flex:0 0 auto;font-size:12.5px;padding:8px 13px;border-radius:10px;border:1px solid var(--line);
+  background:#fff;color:var(--sub)}
+.tab.on{background:var(--ink);border-color:var(--ink);color:#fff}
+.panel{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:14px;box-shadow:var(--shadow);margin-bottom:12px}
+.panel h5{margin:0 0 10px;font-size:13px;font-weight:700;display:flex;align-items:center;gap:6px}
+.panel h5 em{font-style:normal;font-size:10.5px;color:var(--sub);font-weight:400}
+.slider{margin:11px 0 14px}
+.slider .lab{display:flex;justify-content:space-between;font-size:12px;margin-bottom:5px}
+.slider .lab b{font-variant-numeric:tabular-nums;font-weight:600;color:var(--ink);flex:0 0 auto;margin-left:10px}
+.slider .lab span{color:var(--sub);min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
+input[type=range]{-webkit-appearance:none;width:100%;height:26px;background:transparent;margin:0}
+input[type=range]::-webkit-slider-runnable-track{height:5px;border-radius:3px;
+  background:linear-gradient(90deg,#1f6feb var(--p,50%),#e6ebf2 var(--p,50%))}
+input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;width:20px;height:20px;margin-top:-7.5px;
+  border-radius:50%;background:#fff;border:2px solid #1f6feb;box-shadow:0 2px 6px rgba(31,111,235,.35)}
+input[type=range]::-moz-range-track{height:5px;border-radius:3px;background:#e6ebf2}
+input[type=range]::-moz-range-thumb{width:18px;height:18px;border-radius:50%;background:#fff;border:2px solid #1f6feb}
+.hint{font-size:11px;color:var(--sub);margin:6px 0 0;line-height:1.55}
+.btnrow{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
+.btn{font-size:12px;padding:8px 12px;border-radius:10px;border:1px solid var(--line);background:#fff;color:var(--ink)}
+.btn.pri{background:var(--blue);border-color:var(--blue);color:#fff}
+.btn.dark{background:var(--ink);border-color:var(--ink);color:#fff}
+.btn:active{transform:scale(.97)}
+
+/* 电子件卡 */
+.board{display:flex;gap:11px;border:1px solid var(--line);border-radius:12px;padding:11px;margin-bottom:10px;background:#fbfcfe}
+.board .bv{width:52px;height:52px;border-radius:50%;flex:0 0 52px;background:linear-gradient(150deg,#e8edf4,#b6c0cc);
+  display:flex;align-items:center;justify-content:center;box-shadow:inset 0 -4px 8px rgba(0,0,0,.15)}
+.board .bv i{width:34px;height:34px;border-radius:50%;background:#101720;display:block}
+.board .bi{flex:1;min-width:0}
+.board .bi b{font-size:13px;display:block;line-height:1.35}
+.board .bi span{font-size:11px;color:var(--sub);display:block;margin-top:2px}
+.board .bd{font-size:10.5px;color:#0c7a48;background:#edfaf3;border:1px solid #cfeedd;border-radius:6px;padding:2px 6px;margin-top:6px;display:inline-block}
+.kv{display:grid;grid-template-columns:auto 1fr;gap:3px 12px;font-size:11.5px;margin-top:8px;font-variant-numeric:tabular-nums}
+.kv dt{color:var(--sub)}
+.kv dd{margin:0;text-align:right;color:var(--ink)}
+
+/* 表格 */
+.tbl{width:100%;border-collapse:collapse;font-size:11.5px;font-variant-numeric:tabular-nums}
+.tbl th,.tbl td{border-bottom:1px solid var(--line);padding:7px 6px;text-align:left;vertical-align:top}
+.tbl th{color:var(--sub);font-weight:500;font-size:11px;background:#fafbfd}
+.tbl td.num{text-align:right;white-space:nowrap}
+.tbl tr:last-child td{border-bottom:none}
+.scrollx{overflow-x:auto;-webkit-overflow-scrolling:touch;margin:0 -14px;padding:0 14px}
+
+/* 爆炸/装配 */
+.steprow{display:flex;gap:9px;align-items:flex-start;padding:9px 0;border-bottom:1px solid var(--line)}
+.steprow:last-child{border-bottom:none}
+.stepno{width:22px;height:22px;border-radius:50%;background:#eef4fe;color:var(--blue);font-size:11px;
+  display:flex;align-items:center;justify-content:center;flex:0 0 22px;font-weight:600}
+.steprow b{font-size:12.5px;display:block}
+.steprow span{font-size:11px;color:var(--sub);display:block}
+.parts .pr{display:flex;justify-content:space-between;font-size:11.5px;padding:7px 0;border-bottom:1px dashed var(--line);gap:10px}
+.parts .pr:last-child{border-bottom:none}
+.parts .pr em{font-style:normal;color:var(--sub);font-size:10.5px;text-align:right}
+
+/* 知识库 */
+.acc{border:1px solid var(--line);border-radius:12px;background:#fff;margin-bottom:10px;overflow:hidden;box-shadow:var(--shadow)}
+.acc summary{list-style:none;padding:13px 14px;font-size:13px;font-weight:600;display:flex;align-items:center;gap:9px;cursor:pointer}
+.acc summary::-webkit-details-marker{display:none}
+.acc summary .ix{font-size:10.5px;color:var(--blue);background:#eef4fe;border:1px solid #dbe6fa;border-radius:6px;padding:1px 6px}
+.acc summary .chev{margin-left:auto;color:var(--sub);font-size:12px;transition:transform .2s}
+.acc[open] summary .chev{transform:rotate(180deg)}
+.acc .body{padding:0 14px 14px;font-size:12.5px;color:#31425a;line-height:1.68}
+.acc .body p{margin:8px 0}
+.acc .body ul{margin:8px 0;padding-left:18px}
+.acc .body li{margin:3px 0}
+.acc .body code{background:#f1f4f9;padding:1px 5px;border-radius:4px;font-size:11.5px}
+.note{border-left:3px solid var(--amber);background:#fff8ec;padding:9px 11px;border-radius:0 8px 8px 0;font-size:11.5px;color:#6b4a13;margin:10px 0;line-height:1.6}
+.ref{display:block;border:1px solid var(--line);border-radius:12px;padding:11px;margin-bottom:8px;background:#fbfcfe}
+.ref b{font-size:12.5px;display:block;word-break:break-all}
+.ref span{font-size:10.5px;color:var(--sub);word-break:break-all;display:block;margin-top:3px}
+textarea{width:100%;border:1px solid var(--line);border-radius:10px;padding:10px;font-size:12px;font-family:inherit;line-height:1.6;min-height:96px;resize:vertical;background:#fafbfd}
+
+.foot{text-align:center;font-size:10.5px;color:#9aa7ba;margin:26px 0 8px;line-height:1.7}
+#toast{position:fixed;left:50%;bottom:86px;transform:translateX(-50%) translateY(8px);z-index:70;background:rgba(17,26,40,.92);
+  color:#eaf2ff;font-size:12px;padding:9px 14px;border-radius:10px;opacity:0;transition:opacity .2s,transform .2s;pointer-events:none;max-width:80vw;text-align:center}
+#toast.on{opacity:1;transform:translateX(-50%) translateY(0)}
+
+/* 建模页:工艺 chips / 形体面板 / 数值控件 / 校验 */
+.chips{display:flex;gap:6px;flex-wrap:wrap;margin:2px 0 10px}
+.chip{font-size:11px;padding:6px 11px;border-radius:999px;border:1px solid var(--line);background:#fff;color:var(--sub)}
+.chip.on{background:var(--ink);border-color:var(--ink);color:#fff}
+.palette{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:4px 0 8px}
+.pbtn{display:flex;flex-direction:column;gap:2px;padding:10px 8px;border-radius:12px;border:1px solid var(--line);background:#fff;text-align:left}
+.pbtn b{font-size:11.5px;color:var(--ink);font-weight:600}
+.pbtn span{font-size:9.5px;color:var(--sub)}
+.pbtn:active{background:#f2f7fe}
+.nrows{margin:6px 0 2px}
+.nrow{display:flex;align-items:center;gap:7px;padding:5px 0}
+.nrow .nl{flex:1;font-size:11.5px;color:var(--ink)}
+.nrow .nb{width:27px;height:27px;border-radius:8px;border:1px solid var(--line);background:#fff;font-size:14px;line-height:1;color:var(--sub);flex:none}
+.nrow .ni{width:64px;text-align:center;font-size:12px;padding:5px 3px;border-radius:8px;border:1px solid var(--line);background:#fff;color:var(--ink);font-variant-numeric:tabular-nums}
+.nrow em{font-style:normal;font-size:10px;color:var(--sub);width:16px;flex:none}
+.chk{display:flex;gap:8px;font-size:11.5px;line-height:1.55;padding:7px 0;border-bottom:1px dashed var(--line);color:#31425a}
+.chk:last-child{border-bottom:none}
+.chk i{font-style:normal;width:15px;height:15px;border-radius:50%;flex:none;display:flex;align-items:center;justify-content:center;font-size:9px;color:#fff;background:#0f9d58;margin-top:2px}
+.chk.bad i{background:#dc2626}
+.chk.bad span{color:#9a3412}
+.pr{display:flex;justify-content:space-between;align-items:center;gap:10px;font-size:11.5px;padding:8px 0;border-bottom:1px dashed var(--line)}
+.pr.on{background:#eef4fe}
+.pr b{font-weight:600;color:var(--ink)}
+.pr span{display:block;color:var(--sub);font-size:10.5px;margin-top:2px}
+.pr .del{font-size:10px;padding:4px 9px;border-radius:8px;border:1px solid var(--line);background:#fff;color:#9a3412;flex:none}
+
+/* 底栏(项目内) */
+.bottom{position:fixed;left:0;right:0;bottom:0;z-index:45;padding:8px 12px calc(8px + env(safe-area-inset-bottom));
+  background:rgba(255,255,255,.92);backdrop-filter:blur(14px);border-top:1px solid var(--line);display:flex;gap:8px}
+.bottom .btn{flex:1;min-width:0;text-align:center;font-size:12px;padding:9px 4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
+
+/* 加载 */
+#boot{position:fixed;inset:0;z-index:99;background:#0d1726;color:#dbe7f7;display:flex;flex-direction:column;
+  align-items:center;justify-content:center;gap:14px;font-size:12.5px;letter-spacing:.5px;transition:opacity .3s}
+#boot .ring{width:34px;height:34px;border-radius:50%;border:2px solid rgba(255,255,255,.18);border-top-color:#4f92ff;
+  animation:spin 1s linear infinite}
+@keyframes spin{to{transform:rotate(360deg)}}
+#boot.hide{opacity:0;pointer-events:none}
+@media (max-width:380px){ .hero h2{font-size:22px} .thumb{width:64px;height:64px;flex-basis:64px} }
+/* 移动端单屏:迷你舞台 + 底部编辑坞 */
+.stage.mini{margin:0 -12px;border-radius:0 0 18px 18px;
+  height:calc(100vh - var(--dockH,46vh) - 8px);min-height:170px;max-height:none;
+  position:sticky;top:0;z-index:20;box-shadow:0 8px 22px rgba(12,24,44,.10)}
+.stage.mini .badge{display:none}
+.stage.mini .stage-top{left:8px;right:8px}
+.stage.mini .vbtn{padding:4px 9px;font-size:10.5px}
+.stage.mini .matrow{max-width:calc(100% - 16px)}
+.dock{position:fixed;left:0;right:0;bottom:var(--kb,0px);z-index:56;max-width:760px;margin:0 auto;height:var(--dockH,46vh);transition:height .22s cubic-bezier(.32,.94,.36,1);
+  background:#fff;border-radius:18px 18px 0 0;box-shadow:0 -10px 30px rgba(10,24,46,.22);
+  display:flex;flex-direction:column;border-top:1px solid #dfe8f6;padding-bottom:env(safe-area-inset-bottom)}
+.dock .grab{height:24px;flex:none;display:flex;align-items:center;justify-content:center;touch-action:none;cursor:grab}
+.dock .grab i{width:42px;height:4px;border-radius:2px;background:#c9d6e8}
+.dock .dhead{flex:none;display:flex;align-items:center;gap:8px;padding:2px 12px 6px}
+.dock .dhead b{font-size:13px;color:var(--ink)}
+.dock .dhead .em{font-size:10.5px;color:var(--sub);margin-left:6px}
+.dock .dhead .x{margin-left:auto;font-size:11px;padding:5px 10px;border-radius:9px;border:1px solid var(--line);background:#fff;color:#33415c}
+.dock .dbody{flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;padding:0 12px 14px;overscroll-behavior:contain}
+.dock .dsec{display:flex;align-items:baseline;gap:8px;margin:10px 0 4px;font-size:12px;font-weight:600;color:var(--ink)}
+.dock .dsec em{font-style:normal;font-size:10px;font-weight:400;color:var(--sub)}
+.dock .nrows{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 10px}
+.dock .nrow{padding:4px 0;border-bottom:1px dashed #eef2f8;align-items:center}
+.dock .nrow .lab{flex:0 0 46px;font-size:10px;overflow:hidden;white-space:nowrap}
+.dock .nrow{gap:4px}
+.dock .nrow .nb{width:24px;height:24px;font-size:11px}
+.dock .nrow .ni{width:auto;min-width:0;font-size:11.5px;padding:4px 4px}
+.dock .btnrow .btn{font-size:11px;padding:7px 9px}
+.dock .nrow .ni{flex:1;min-width:0}
+.dock .nrow em{display:none}
+.dock .nrow .lab{font-size:10.5px}
+.dock .prow{display:flex;gap:6px;overflow-x:auto;padding:2px 0 6px;-webkit-overflow-scrolling:touch}
+.dock .pco{flex:none;min-width:88px;padding:7px 9px;border-radius:12px;border:1px solid var(--line);background:#fbfdff;text-align:left}
+.dock .pco b{display:block;font-size:11.5px;color:var(--ink);font-weight:600;white-space:nowrap}
+.dock .pco span{display:block;font-size:9.5px;color:var(--sub);margin-top:2px;white-space:nowrap}
+.dock .pco.hot{border-color:#bfd7ff;background:#f2f7ff}
+.dock.fold{height:auto;padding-bottom:calc(6px + env(safe-area-inset-bottom))}
+.dock.fold .grab{display:none}
+.dock .dbody .chips{flex-wrap:nowrap;overflow-x:auto;padding-bottom:4px;scrollbar-width:none}
+.dock .dbody .chips::-webkit-scrollbar{display:none}
+.dock .chips .chip{flex:0 0 auto;white-space:nowrap;font-size:11px;padding:6px 11px}
+.dock .prow{scrollbar-width:none}
+.dock .prow::-webkit-scrollbar{display:none}
+.dockpad{height:50vh}
+
+/* 坞内快捷导航 + 数字输入 + 拖拽态 */
+.dock.drag{transition:none}
+.dock .dnav{flex:none;display:flex;gap:6px;padding:0 12px 8px;overflow-x:auto;scrollbar-width:none}
+.dock .dnav::-webkit-scrollbar{display:none}
+.dock .dnav button{flex:0 0 auto;font-size:10.5px;padding:5px 10px;border-radius:20px;border:1px solid var(--line);background:#fff;color:#33415c}
+.dock .dnav button.on{background:#eef4fe;border-color:#c9dcff;color:#1f5fd0}
+.dock .hbt{width:28px;height:28px;border-radius:9px;border:1px solid var(--line);background:#fff;color:#33415c;font-size:13px;display:flex;align-items:center;justify-content:center}
+.dock .hbt:disabled{opacity:.35}
+.dock .dhead .tools{margin-left:auto;display:flex;gap:6px;align-items:center}
+.slider .lab .sv{width:56px;flex:0 0 56px;text-align:right;font-size:12px;font-weight:600;color:var(--ink);
+  border:none;border-bottom:1px dashed #c8d5e8;background:transparent;padding:1px 0;font-variant-numeric:tabular-nums}
+.slider .lab .sv:focus{outline:none;border-bottom-color:#1f6feb}
+.stage.mini .dimlayer{font-size:9px}
+@supports (height:100dvh){.stage.mini{height:calc(100dvh - var(--dockH,46vh) - 8px)}}
+.ghint{position:absolute;left:50%;bottom:54px;transform:translateX(-50%);
+  font-size:10px;color:#cfe2ff;background:rgba(12,26,46,.62);border:1px solid rgba(120,170,255,.25);
+  padding:4px 10px;border-radius:20px;white-space:nowrap;pointer-events:none;animation:gh 5s ease forwards}
+@keyframes gh{0%{opacity:0}12%{opacity:1}70%{opacity:1}100%{opacity:0;visibility:hidden}}
+</style>
+</head>
+<body>
+<div id="boot"><div class="ring"></div><div id="bootmsg">正在装载 3D 工程台…</div></div>

+ 4 - 0
ref-v2/src/02_body.html

@@ -0,0 +1,4 @@
+
+<app-root></app-root>
+
+<script type="module">

+ 394 - 0
ref-v2/src/03_data.js

@@ -0,0 +1,394 @@
+/* =========================================================
+   数据层:项目参数 / 材质 / 工艺 / 电子件 / 知识库
+   单位统一 mm;价格为 2026-11 深圳·东莞行情区间(仅供参考)
+   ========================================================= */
+
+const MATERIALS = {
+  'sil-black':  {name:'硅胶 哑光黑', albedo:'#22262c', metallic:0.0, rough:0.62, cc:0.20, cci:0.30, swatch:'#22262c', note:'邵氏 A50,喷手感油'},
+  'sil-pink':   {name:'硅胶 哑光藕粉', albedo:'#d8a8b4', metallic:0.0, rough:0.60, cc:0.20, cci:0.28, swatch:'#d8a8b4', note:'双色拼色 A 料'},
+  'sil-mint':   {name:'硅胶 雾青', albedo:'#9fc8bd', metallic:0.0, rough:0.60, cc:0.18, cci:0.24, swatch:'#9fc8bd'},
+  'abs-gloss':  {name:'ABS 光面白', albedo:'#eceef1', metallic:0.0, rough:0.26, cc:0.55, cci:0.45, swatch:'#eceef1', note:'注塑本色,可丝印'},
+  'abs-matte':  {name:'ABS 喷油哑光', albedo:'#dfe3e8', metallic:0.0, rough:0.58, cc:0.10, cci:0.18, swatch:'#dfe3e8', note:'喷橡胶漆,耐磨 500g 摩擦'},
+  'abs-black':  {name:'ABS 哑光黑', albedo:'#1f2328', metallic:0.0, rough:0.50, cc:0.12, cci:0.20, swatch:'#1f2328'},
+  'pc-clear':   {name:'PC 透明', albedo:'#dfeaf5', metallic:0.0, rough:0.08, cc:0.6, cci:0.5, swatch:'#cfe2f3', alpha:0.42},
+  'alu-silver': {name:'6061 阳极银', albedo:'#c7cfd8', metallic:1.0, rough:0.24, cc:0.18, cci:0.42, swatch:'#c7cfd8', note:'喷砂+阳极 10~15μm'},
+  'alu-sand':   {name:'6061 喷砂银', albedo:'#c6ccd3', metallic:1.0, rough:0.60, cc:0.05, cci:0.12, swatch:'#c6ccd3'},
+  'alu-black':  {name:'6061 阳极黑', albedo:'#282c31', metallic:0.9, rough:0.36, cc:0.16, cci:0.30, swatch:'#282c31', note:'阳极后螺纹需二次回攻'},
+  'alu-rose':   {name:'6061 阳极玫瑰金', albedo:'#d9b49a', metallic:1.0, rough:0.30, cc:0.15, cci:0.35, swatch:'#d9b49a'}
+};
+
+/* 内固定材质(不参与材质切换) */
+const FIXED_MATS = {
+  glass:  {albedo:'#070b10', metallic:0.3, rough:0.06, cc:0.9, cci:0.6},
+  pcb:    {albedo:'#071d17', metallic:0.08, rough:0.78, env:0.28},
+  pcbDark:{albedo:'#0b1620', metallic:0.15, rough:0.62, env:0.3},
+  cell:   {albedo:'#2b3138', metallic:0.15, rough:0.72},
+  brass:  {albedo:'#b08d57', metallic:1.0, rough:0.34},
+  dark:   {albedo:'#12161b', metallic:0.15, rough:0.5},
+  cut:    {albedo:'#ff7a45', metallic:0.0, rough:0.55, alpha:0.42}
+};
+
+/* ---------------- 三个项目 ---------------- */
+const PROJECTS = {
+  silicone: {
+    id:'silicone', name:'小恶魔硅胶表壳', en:'SILICONE WATCH CASE',
+    ref:'HUAWEI GT4 / GT5 41mm · 双色拼色',
+    accent:'#c993a2',
+    summary:'包表式硅胶保护壳:外框一体模压、顶部双立体小角、侧边表冠避让。适合小批量双色拼色试产。',
+    tags:['硅胶模压','双色拼色','MOQ 500'],
+    params:[
+      {k:'w',   n:'内腔宽',   min:30, max:48, step:0.5, def:40.5, group:'腔体'},
+      {k:'d',   n:'内腔高',   min:30, max:48, step:0.5, def:40.5, group:'腔体'},
+      {k:'t',   n:'壁厚',     min:1.2, max:4, step:0.1, def:2.4, group:'腔体'},
+      {k:'h',   n:'总高',     min:8,  max:16, step:0.2, def:11.5, group:'腔体'},
+      {k:'r',   n:'内腔圆角', min:4,  max:22, step:0.5, def:13,   group:'腔体'},
+      {k:'hh',  n:'小角高度', min:1,  max:14, step:0.5, def:7,    group:'双角'},
+      {k:'hg',  n:'双角间距', min:8,  max:36, step:0.5, def:22,   group:'双角'},
+      {k:'hd',  n:'角底直径', min:3,  max:10, step:0.2, def:5.2,  group:'双角'},
+      {k:'cr',  n:'表冠凸出', min:0,  max:3,  step:0.1, def:1.4,  group:'侧边'}
+    ],
+    materials:['sil-pink','sil-black','sil-mint','abs-gloss','alu-silver'],
+    parts:[
+      {id:'body',   n:'硅胶壳体(空心圆角框)', q:'1',  mat:'主材质', proc:'模压/液态硅胶', tol:'±0.10'},
+      {id:'floor',  n:'底托(贴机身层)',       q:'1',  mat:'同壳体',  proc:'同模一体', tol:'±0.10'},
+      {id:'hornL',  n:'立体小角(左)',         q:'1',  mat:'B 色/同色', proc:'一体模压', tol:'±0.15'},
+      {id:'hornR',  n:'立体小角(右)',         q:'1',  mat:'B 色/同色', proc:'一体模压', tol:'±0.15'},
+      {id:'screen', n:'屏幕视窗(透光面)',     q:'1',  mat:'PC 透明/裸屏', proc:'—', tol:'±0.05'},
+      {id:'crown',  n:'表冠避让孔',             q:'1',  mat:'—', proc:'模压开孔', tol:'±0.15'}
+    ],
+    steps:[
+      {n:'壳体出模、去毛刺', d:'硅胶模压后修边,双角与框体一体,检查双角色差 ΔE≤1.5。'},
+      {n:'贴底托 / 装表体', d:'表体从内腔嵌入,壁厚 2.4mm 提供回弹夹持,不靠胶水。'},
+      {n:'屏幕视窗对位', d:'视窗与表盘贴合,四边留 0.15mm 缓冲,避免顶屏。'},
+      {n:'表冠穿孔校验', d:'表冠凸出位开孔,孔径比表冠大 0.3mm,保证按压不涩。'},
+      {n:'手感油 / 丝印', d:'表面喷手感油(哑光),logo 丝印或镭雕在底托背面。'}
+    ],
+    processes:[
+      {key:'sil-mold', n:'硅胶模压(钢模)', mold:2200, minQty:500, unit:[[500,5.2],[1000,4.2],[3000,3.4],[5000,2.9]], lead:'12~18 天', note:'双色需两套模/两次成型,模具费上浮 40%'},
+      {key:'vacuum',   n:'真空复模(小批量验证)', mold:300, minQty:10, unit:[[10,26],[30,18],[100,12]], lead:'5~8 天', note:'硅胶模寿命 20~40 件,适合内测'},
+      {key:'cnc',      n:'CNC 手板(ABS/铝)', mold:0, minQty:1, unit:[[1,90],[5,68],[20,46],[50,36]], lead:'3~7 天', note:'含编程调机,后处理另计'}
+    ],
+    notes:[
+      '硅胶最小壁厚建议 ≥1.2mm;本款 2.4mm 属回弹夹持区,低于 1.8mm 易松脱。',
+      '双角若与框体同色可一次成型;双色需双料注塑或二次硫化套色,单价上浮 15%~25%。',
+      '表壳包表,内腔尺寸需按实机 ±0.1mm 复测,不能只按官网标称开模。'
+    ],
+    tolerance:[['内腔宽/高','±0.10'],['壁厚','±0.08'],['双角位置','±0.20'],['孔位','±0.15'],['未注公差','ISO 2768-m']],
+    files:['STEP(AP214,含内腔曲面)','STL(弦高 0.05mm)','2D PDF A3 三视图 + 剖视','色卡 Pantone/劳尔号']
+  },
+
+  recorder: {
+    id:'recorder', name:'AI 录音豆外壳', en:'AI RECORDER PUCK',
+    ref:'Φ32 磁吸挂扣 · ABS 注塑',
+    accent:'#8fa3bd',
+    summary:'圆形豆状外壳:上盖穹顶、侧挂环、四麦孔阵列、Type-C 与单键。内部为自制 PCBA + 软包电芯。',
+    tags:['ABS 注塑','卡扣装配','MOQ 500'],
+    params:[
+      {k:'D',   n:'外径',     min:24, max:46, step:0.5, def:32, group:'主体'},
+      {k:'H',   n:'总高',     min:8,  max:20, step:0.2, def:11.5, group:'主体'},
+      {k:'t',   n:'壁厚',     min:1.0, max:2.6, step:0.1, def:1.6, group:'主体'},
+      {k:'dm',  n:'穹顶弧高', min:0,  max:4,  step:0.1, def:1.6, group:'主体'},
+      {k:'ld',  n:'挂环孔径', min:3,  max:10, step:0.5, def:4.5, group:'挂扣'},
+      {k:'lh',  n:'挂环长度', min:2,  max:8,  step:0.5, def:4, group:'挂扣'}
+    ],
+    materials:['abs-gloss','abs-matte','abs-black','pc-clear','alu-silver','sil-black'],
+    parts:[
+      {id:'body',  n:'下壳(含电池仓)', q:'1', mat:'主材质', proc:'注塑 / CNC', tol:'±0.10'},
+      {id:'lid',   n:'上盖(穹顶+麦孔)', q:'1', mat:'主材质', proc:'注塑 / CNC', tol:'±0.10'},
+      {id:'loop',  n:'侧挂环',           q:'1', mat:'同壳体', proc:'一体/后装', tol:'±0.20'},
+      {id:'mic',   n:'MEMS 麦孔 ×4',     q:'4', mat:'—',     proc:'钻孔 Ø1.0', tol:'±0.05'},
+      {id:'usbc',  n:'Type-C 开口',      q:'1', mat:'—',     proc:'开孔 9.0×3.4', tol:'±0.08'},
+      {id:'btn',   n:'功能按键',         q:'1', mat:'同壳体', proc:'注塑 + 硅胶垫', tol:'±0.10'},
+      {id:'pcb',   n:'主控板 Φ26',       q:'1', mat:'FR-4',   proc:'外购/自制', tol:'±0.15'},
+      {id:'cell',  n:'软包电芯 402030',  q:'1', mat:'锂电',   proc:'外购 3.7V', tol:'±0.5'}
+    ],
+    steps:[
+      {n:'下壳装电芯', d:'402030 软包(4.0×20×30mm)卡入电池仓,留 5% 膨胀余量。'},
+      {n:'PCBA 卡扣固定', d:'Φ26 主板落在 3 处限位柱上,卡扣压紧,不用螺丝。'},
+      {n:'焊线 / 接口', d:'电池线走 MX1.25 或焊盘,Type-C 母座对准侧开口 ±0.1。'},
+      {n:'上盖合模', d:'上盖与下壳卡扣环扣合,麦孔朝上,环形密封槽可加防水胶。'},
+      {n:'挂环 + 老化测试', d:'挂环过 5kg 静拉,整机 2h 老化 + 麦克风灵敏度抽检。'}
+    ],
+    processes:[
+      {key:'abs-mold', n:'ABS 注塑(钢模)', mold:6500, minQty:500, unit:[[500,5.0],[1000,4.1],[3000,3.4],[5000,2.8]], lead:'15~20 天', note:'上下壳+按键三套模,含试模'},
+      {key:'vacuum',   n:'真空复模', mold:300, minQty:10, unit:[[10,28],[30,19],[100,13]], lead:'5~8 天'},
+      {key:'cnc',      n:'CNC 铝/ABS 手板', mold:0, minQty:1, unit:[[1,120],[5,86],[20,58],[50,44]], lead:'3~7 天'}
+    ],
+    notes:[
+      '麦孔阵列孔径 Ø1.0,孔后需 1.5mm 声腔,孔壁不能与壳体壁厚直接贯通。',
+      '卡扣合模需 0.5mm 过盈 + 单边 1° 导向角,否则量产装配良率掉到 80% 以下。',
+      '若走公模贴牌,MOQ 可降到 200 台整机;只做外观件仍按 500 套起。'
+    ],
+    tolerance:[['外径','±0.10'],['总高','±0.15'],['麦孔','±0.05'],['Type-C 开口','±0.08'],['未注公差','ISO 2768-m']],
+    files:['STEP(AP214 含卡扣)','STL 上下壳分件','2D PDF 含开孔坐标表','装配示意图(爆炸序)']
+  },
+
+  round: {
+    id:'round', name:'1.85″ 圆屏铝壳', en:'ROUND LCD AL CASE',
+    ref:'Φ61.6 × 14.6 · 参考微雪 1.85B',
+    accent:'#aab6c4',
+    summary:'电子吧唧造型:前框沉台固定 1.85″ 圆屏、后盖旋合、四颗 M2 铜柱锁板、侧边双麦与 Type-C。',
+    tags:['6061 CNC','沉台 ±0.03','阳极氧化'],
+    params:[
+      {k:'D',   n:'外径',     min:50, max:72, step:0.2, def:61.6, group:'主体'},
+      {k:'H',   n:'总厚',     min:11, max:20, step:0.2, def:14.6, group:'主体'},
+      {k:'t',   n:'壁厚',     min:1.4, max:3.2, step:0.1, def:2.0, group:'主体'},
+      {k:'sd',  n:'屏可视径', min:38, max:54, step:0.2, def:45.68, group:'屏幕'},
+      {k:'bd',  n:'黑边外径', min:44, max:58, step:0.2, def:55.0, group:'屏幕'},
+      {k:'dep', n:'屏边弧深(沉台R)', min:0.5, max:2.2, step:0.1, def:1.2, group:'CNC 工艺'},
+      {k:'rimR',n:'顶部凸圆 R(CNC)', min:0.6, max:3.4, step:0.1, def:1.8, group:'CNC 工艺'},
+      {k:'cham',n:'底边倒角 C(CNC)', min:0, max:1.2, step:0.1, def:0.5, group:'CNC 工艺'},
+      {k:'cap', n:'后盖厚',   min:1.5, max:4,  step:0.1, def:2.4, group:'后盖'}
+    ],
+    materials:['alu-silver','alu-sand','alu-black','alu-rose','abs-gloss'],
+    parts:[
+      {id:'bezel', n:'前框(沉台+螺纹)', q:'1', mat:'主材质', proc:'CNC 五轴 + 阳极', tol:'±0.05'},
+      {id:'glass', n:'1.85″ 屏(AA Ø45.68)', q:'1', mat:'外购模组', proc:'—', tol:'±0.10'},
+      {id:'black', n:'黑边装饰环 Ø55',     q:'1', mat:'丝印/黑膜', proc:'—', tol:'±0.10'},
+      {id:'cap',   n:'后盖(M54×1.5 示意)', q:'1', mat:'主材质', proc:'CNC + 阳极 + 回攻', tol:'±0.05'},
+      {id:'boss',  n:'M2 铜柱 ×4',          q:'4', mat:'黄铜嵌件', proc:'CNC 攻牙/嵌件', tol:'±0.05'},
+      {id:'pcb',   n:'主控板 Φ44',           q:'1', mat:'FR-4', proc:'微雪模组', tol:'±0.2'},
+      {id:'cell',  n:'锂电 3.7V',            q:'1', mat:'软包', proc:'外购', tol:'±0.5'},
+      {id:'side',  n:'侧键 / Type-C / 双麦', q:'1', mat:'—', proc:'开孔 + 密封', tol:'±0.08'}
+    ],
+    steps:[
+      {n:'前框阳极 + 螺纹回攻', d:'阳极后 M54×1.5 必须二次回攻,否则后盖咬死。'},
+      {n:'屏入沉台', d:'沉台深 1.2mm,屏厚 1.0mm + 0.2mm 缓冲垫;深 0.1mm 即顶屏。'},
+      {n:'主板锁铜柱', d:'4×M2 铜柱同轴度 ≤0.05,板与壳间加绝缘垫避天线。'},
+      {n:'电池 + 走线', d:'电芯贴后盖,FPC 走侧槽,避开金属腔体谐振点。'},
+      {n:'后盖旋合', d:'M54×1.5 旋 2.5 圈到位,做 0.5m 跌落与气密抽检。'}
+    ],
+    processes:[
+      {key:'cnc-alu', n:'CNC 铝 6061(手板)', mold:0, minQty:1, unit:[[1,135],[5,98],[20,72],[50,58],[200,48]], lead:'5~10 天', note:'含编程,阳极 10~15 元/套另计'},
+      {key:'cnc-abs', n:'CNC ABS(验证用)', mold:0, minQty:1, unit:[[1,85],[5,60],[20,38],[50,28]], lead:'3~6 天', note:'螺纹易滑牙,不建议做量产件'},
+      {key:'die-cast',n:'压铸铝 + CNC 精修', mold:12000, minQty:1000, unit:[[1000,32],[3000,26],[5000,22]], lead:'25~35 天', note:'量产路径,需评估壁厚与阳极'}
+    ],
+    notes:[
+      '沉台深度公差 ±0.03 是整件成本核心,检测需三坐标或专用检具。',
+      '铝合金外壳会屏蔽 2.4G,天线区域必须开非金属窗或做塑胶拼接。',
+      '螺纹后盖在小批量下报废率高(15%~25%),可改 4×M2 螺丝锁盖降本 15~25 元/套。'
+    ],
+    tolerance:[['外径','±0.05'],['总厚','±0.10'],['沉台深','±0.03'],['铜柱同轴','≤0.05'],['螺纹','M54×1.5-6H(示意)']],
+    files:['STEP(AP214,含螺纹实体)','STL 分件','2D PDF 关键尺寸 + GD&T','阳极色板 / 膜厚要求']
+  }
+};
+
+/* ---------------- 电子件库 ---------------- */
+const BOARDS = [
+  {
+    id:'ws185', name:'微雪 ESP32-S3-Touch-LCD-1.85B', tag:'首选 · 成品模组',
+    od:'Ø61.6 × 14.6', screen:'1.85″ 圆屏 360×360', iface:'QSPI 屏 / I2C 触摸 / Type-C',
+    soc:'ESP32-S3R8 · 240MHz · 8MB PSRAM · 16MB Flash',
+    extra:'ES8311 编解码 + ES7210 回声消除 + 双麦阵列 + QMI8658 六轴 + BQ27220 电量 + PCF85063 RTC + MicroSD + MX1.25 电池口 + SH1.0×2',
+    price:'¥208.06 起(1 件,含税)', fit:'round',
+    note:'官方尺寸 Ø61.60 / Ø55.00 / 屏 AA Ø45.68 / 厚 14.60。带壳整机,直接拆壳复用最省事。',
+    source:'waveshare.net / docs.waveshare.net'
+  },
+  {
+    id:'ws128', name:'GC9A01 1.28″ 圆屏 + ESP32-S3 底板', tag:'低成本替代',
+    od:'Ø32.4 屏 / 底板 40×40(参考)', screen:'1.28″ 240×240', iface:'SPI 屏 / I2C',
+    soc:'ESP32-S3-WROOM-1(18×25.5×3.1)',
+    extra:'需自配麦克风与功放;无成品壳,需自己做结构',
+    price:'屏 ¥18~28 / 底板 ¥35~60', fit:'recorder',
+    note:'尺寸为常见模组值,采购前以实际规格书核对;适合做 Φ32 录音豆的主板。',
+    source:'通用模组,需核对'
+  },
+  {
+    id:'esp32s3', name:'ESP32-S3-WROOM-1 模组', tag:'核心件',
+    od:'18.0 × 25.5 × 3.1', screen:'—', iface:'2.4G WiFi + BLE5',
+    soc:'双核 LX7 240MHz · 8MB PSRAM 选配',
+    extra:'需底板:电源、麦克风、功放、充电管理',
+    price:'¥18~30', fit:'recorder',
+    note:'天线净空区 15mm 内不得有金属/电池,壳体需留塑胶窗。',
+    source:'Espressif 数据手册'
+  },
+  {
+    id:'mic', name:'INMP441 I2S MEMS 麦克风', tag:'拾音',
+    od:'15 × 14(模块,参考)', screen:'—', iface:'I2S',
+    soc:'—', extra:'信噪比 61dB,灵敏度 -26dBFS',
+    price:'¥5~9', fit:'recorder',
+    note:'麦孔 Ø1.0 + 后腔 1.5mm;四麦阵列间距建议 ≥8mm 做波束。',
+    source:'模块规格,需核对'
+  },
+  {
+    id:'amp', name:'MAX98357A I2S 功放', tag:'发声',
+    od:'模块 15 × 15(参考)', screen:'—', iface:'I2S + 2.5W',
+    soc:'—', extra:'D 类,需 8Ω 腔体喇叭',
+    price:'¥8~15', fit:'recorder',
+    note:'腔体扬声器与麦孔要隔离,否则回声消除压力大。',
+    source:'模块规格,需核对'
+  },
+  {
+    id:'cell402030', name:'软包锂电 402030', tag:'供电',
+    od:'4.0 × 20 × 30(厚×宽×长)', screen:'—', iface:'3.7V / 约 180~220mAh',
+    soc:'—', extra:'需保护板 + MX1.25 或焊线',
+    price:'¥6~10', fit:'recorder',
+    note:'留 5% 膨胀空间,远离发热器件 2mm 以上。',
+    source:'常见规格,需核对'
+  },
+  {
+    id:'cell103450', name:'软包锂电 103450', tag:'供电',
+    od:'10 × 34 × 50', screen:'—', iface:'3.7V / 约 1800~2000mAh',
+    soc:'—', extra:'适用 Φ61 圆屏机',
+    price:'¥12~18', fit:'round',
+    note:'厚度 10mm + 结构件,Φ61.6 / 14.6 机身内需精确排布。',
+    source:'常见规格,需核对'
+  }
+];
+
+/* ---------------- 知识库 ---------------- */
+const KB = [
+  {
+    id:'process', ix:'01', title:'七种壳体工艺对照(MOQ / 模具 / 单价 / 交期)',
+    body:[
+      ['table', ['工艺','典型 MOQ','一次性费用','单价区间','交期','适用'],[
+        ['硅胶模压(钢模)','500 套','¥1,800~3,500','¥2.5~6/套','12~18 天','量产软壳、包表、双色拼色'],
+        ['ABS/PC 注塑(钢模)','500 套','¥5,500~9,000','¥2.8~6/套','15~20 天','硬壳量产,外观件首选'],
+        ['压铸铝 + CNC','1,000 套','¥10,000~22,000','¥22~32/套','25~35 天','金属量产,需评估阳极'],
+        ['CNC 手板(铝/ABS)','1 件','无模具,收编程调机','¥28~135/套','3~10 天','样机、内测、小批量'],
+        ['真空复模(硅胶模)','10 件','¥200~400','¥12~28/套','5~8 天','10~100 件验证'],
+        ['3D 打印(SLA/FDM)','1 件','无','¥20~60/套','2~4 天','结构验证,不做外观件'],
+        ['公模贴牌','100~200 件','无','¥3~8/套','7~12 天','已有模具,只改色/丝印']
+      ]],
+      ['p','判断口径:一次性费用 ÷ 数量 + 单品价 = 单套综合成本。数量过 200~300 套后,CNC 的总成本通常反超「开模 + 注塑」。']
+    ]
+  },
+  {
+    id:'formats', ix:'02', title:'生产端到底要哪些文件格式(按工艺给清单)',
+    body:[
+      ['table', ['格式','用途','要给谁','注意'],[
+        ['STEP AP214/AP203','3D 实体,含曲面与螺纹','模具厂 / CNC 编程','首选。必须带内腔、卡扣、螺纹实体,不能只给网格'],
+        ['STL(弦高 0.05mm)','网格,快速评估与 3D 打印','手板厂 / 打印','只用于看形,不能直接开钢模'],
+        ['3MF','打印用,含颜色与单位','3D 打印','比 STL 稳,少破面'],
+        ['OBJ','带材质分组的网格','渲染 / 展示','不适合生产'],
+        ['DXF','2D 轮廓 / 开孔坐标','线切割、开孔','配合 2D 图纸使用'],
+        ['PDF A3 2D 图纸','三视图 + 剖视 + 尺寸 + GD&T','所有人','1:1 打印,标基准 A/B/C'],
+        ['BOM / CSV','零件、材质、数量、工艺','采购 / 报价','报价必须逐项回填'],
+        ['色卡 / 膜厚要求','阳极色号、Pantone、Ra','表面处理厂','不给色号一定返工']
+      ]],
+      ['p','给工厂的最小闭环:STEP + 2D PDF + 需求单(材质/工艺/公差/数量/表面处理)。只给 STL 或只给图片,正规厂会直接判定为「无法报价」。']
+    ]
+  },
+  {
+    id:'draw', ix:'03', title:'2D 图纸标注规范(手机端也能看懂的最小集)',
+    body:[
+      ['ul',[
+        '基准:主基准 A(底面)、B/C(两互相垂直的边或中心线),铜柱与孔位全部相对基准标注。',
+        '关键尺寸:沉台深、螺纹规格、壁厚、孔位坐标、装配间隙,逐项给公差。',
+        '未注公差:ABS/硅胶 ISO 2768-m;CNC 金属建议 ±0.1 或 2768-f。',
+        '形位公差:铜柱同轴度 ≤0.05,平面度 0.1,沉台对基准面平行度 0.05。',
+        '表面:Ra 标注(CNC 铝 Ra1.6,喷砂 Ra3.2),阳极膜厚 10~15μm。',
+        '螺纹:M54×1.5-6H(示意);标注「阳极后二次回攻」字样。',
+        '去毛刺、倒角 C0.3、脱模斜度 1°~2°,写在技术要求里而不是画在图上。'
+      ]],
+      ['note','本项目导出的是「需求描述单 + STL/OBJ + 尺寸表」,够工厂报价和评估;正式开模仍需要 STEP 或由工厂按图建模(建模费 ¥500~1,500)。']
+    ]
+  },
+  {
+    id:'dfm', ix:'04', title:'DFM 检查清单(开模前逐条过)',
+    body:[
+      ['table', ['项目','经验值','违反后果'],[
+        ['ABS 壁厚','1.2~2.0mm,均匀','缩水、变形、装配错位'],
+        ['硅胶壁厚','≥1.2mm,回弹区 2~3mm','夹持松脱、撕裂'],
+        ['拔模斜度','1°~2°(纹理面 3°)','拉伤、顶白'],
+        ['内圆角','≥0.5×壁厚','应力集中、开裂'],
+        ['卡扣','过盈 0.3~0.5mm + 1° 导向','装配良率 <80%'],
+        ['螺丝柱','M2 外径 Φ4.0,内孔 Φ1.6','滑牙、缩水'],
+        ['沉台','深公差 ±0.03,圆角 R0.2','顶碎屏 / 漏光'],
+        ['天线净空','15mm 内无金属与电池','WiFi 掉到 -75dBm'],
+        ['密封','槽宽 1.0 + 0.5mm 压缩量','气密不过'],
+        ['脱模','顶针位避开外观面','顶白不可修']
+      ]]
+    ]
+  },
+  {
+    id:'cost', ix:'05', title:'报价谈判口径(怎么问才不被糊)',
+    body:[
+      ['ul',[
+        '先问「模具费是否含试模、改模几次、模具归属」,不接受「模具费摊在单价里」的模糊说法。',
+        '要求分项:材料费 / 加工费 / 表面处理 / 包装 / 模具 / 打样,一口价无法比价。',
+        '问清 MOQ 是「模具起订」还是「后处理开机费」。喷油、阳极常有 20 件开机门槛。',
+        '问清公差是按图纸全检还是抽检,首件是否提供三坐标报告。',
+        '小批量先做手板(CNC/复模),确认装配与手感后再投钢模,避免 ¥6,500 打水漂。',
+        '报价单必须写有效期与含税/不含税,模具费通常单独开票。'
+      ]]
+    ]
+  },
+  {
+    id:'elec', ix:'06', title:'电子件选型原则:先用成熟开发板,别自己打板',
+    body:[
+      ['p','这一轮产品(录音豆 / 圆屏吧唧 / 表壳配件)全部走「成熟模组 + 焊接/接插件 + 结构固定」,把 PCB 风险降到最低。'],
+      ['ul',[
+        '圆屏机直接复用微雪 1.85B 整机:屏、触摸、双麦、功放、IMU、电量、RTC、Type-C、锂电口全部现成,只做外壳替换。',
+        '录音豆用 ESP32-S3-WROOM-1 + INMP441 + MAX98357A + TP4056 + 402030 电芯,飞线或洞洞板即可完成原型。',
+        '需要量产再把模组方案转成邮票孔底板(仍不打主控板),单板成本可压到 ¥25~40。',
+        '结构件必须给电子件留「装配余量 + 天线净空 + 声腔」,否则外壳做完装不进去。',
+        '接口固定优先卡扣/限位柱,其次 M2 螺丝;能不用胶就不用胶。'
+      ]],
+      ['note','电子件尺寸一律以官方图纸为准;本项目内的尺寸用于排布预演,打样前需实测。']
+    ]
+  }
+];
+
+KB.push({
+  id:'surface', ix:'07', title:'表面处理:阳极 / 喷油 / 镭雕怎么选',
+  body:[
+    ['table',['工艺','效果','成本','注意'],[
+      ['阳极氧化(铝)','金属质感、耐磨、绝缘','¥6~15/套(含前处理)','颜色批次色差 ΔE≤1.5;螺纹需二次回攻;膜厚 10~15μm'],
+      ['喷砂 + 阳极','细腻哑光金属','¥3~8/套 加价','砂号 120#~220#,同一批统一喷砂压力'],
+      ['喷橡胶漆(ABS)','类肤手感、遮缩水','¥1.5~3/套','耐磨 500g/100 次;边角易露底'],
+      ['UV 高光(ABS)','局部亮面','¥0.8~2/套','需专用治具,小批量分摊高'],
+      ['丝印 / 移印','logo、刻度','¥0.5~1.5/处','最小线宽 0.15,套色 ≤4 色'],
+      ['镭雕','永久标识、细字','¥0.3~0.8/处','浅色底要打深色底漆才清晰']
+    ]],
+    ['note','表面处理常有最小开机批次(喷油 20 件、阳极 50 件)。数量不足时会被收整批开机费,这也是「CNC 件突然报 MOQ」的常见原因。']
+  ]
+});
+KB.push({
+  id:'timeline', ix:'08', title:'从创意到量产的 6 个里程碑',
+  body:[
+    ['ul',[
+      'M1 概念锁定:定外形尺寸、材质、装配方式,产出参数快照(本工具即可)。',
+      'M2 手板验证:CNC/复模 1~5 套,装电子件实测干涉、手感、天线。',
+      'M3 图纸冻结:补 STEP、2D 图纸、公差与 GD&T,供应商 DFM 回签。',
+      'M4 开模试模:T1 试模件确认缩水/变形,T2 修模后做首件报告。',
+      'M5 小批试产:50~200 套,跑装配良率与老化,锁定工艺参数。',
+      'M6 量产:MOQ 起订,按 AQL 抽检,模具与治具归档。'
+    ]],
+    ['p','关键卡点:M2 不做就直接开模,是 80% 外观件返工的原因;M3 不给 STEP 只给图片,正规厂不会接。']
+  ]
+});
+
+KB.push({
+  id:'model', ix:'09', title:'工艺化轻量建模:为什么「自由雕刻」要按工艺分规则',
+  body:[
+    ['p','网页端没有实体布尔运算(不开 CSG 是怕曲面炸开),所以建模走「参数化主体 + 附加结构体」:主体由尺寸参数定义,内部筋、铜柱、开槽、开孔以独立结构件叠加,位置用毫米数值 + 吸附精确控制。'],
+    ['table',['工艺','自由度','必须在模型里标出来的东西'],
+      [['注塑 / 硅胶','高:筋、柱、槽都能加','拔模角、最小壁厚、筋厚、圆角、缩水率'],
+       ['CNC 铝','中:以减料为主','刀具半径(内角 R)、最小壁厚、深腔比、螺纹规格、基准与公差'],
+       ['真空复模','中:同注塑但更自由','收缩补偿 0.3%、壁厚 ≥1.2'],
+       ['压铸','低:拔模与料位受限','拔模 ≥1.5°、料位/渣包、后加工余量']]],
+    ['ul',[
+      '吸附口径:位置吸附 0.5 / 1 / 5 mm;「贴内壁」按内腔边界自动算 x/z,不留手算误差。',
+      '每加一个结构件都要能报出:位置(x,y,z)、外形尺寸、壁厚/筋厚、与内腔的余量。',
+      '余量 < 1mm 的结构件,注塑会粘模、CNC 会让刀,模型阶段就要报警。',
+      '导出时结构件随主体一起进 STL/OBJ,并在需求单里单列坐标表,工厂才能照着做。'
+    ]],
+    ['note','轻量建模的边界:能做「外形 + 内部支撑结构 + 开孔标记」,不能做真实刀路与模流分析;定稿仍要 STEP + 2D 图纸。']
+  ]
+});
+
+const REFS = [
+  {
+    id:'wx1', n:'微信公众号文章(待补录全文)',
+    u:'https://mp.weixin.qq.com/s/9mUdMT78YCpWuuqDSKU5QQ',
+    d:'该链接对自动抓取有 robots 限制,无法在网页端直接取回正文。已保留原始链接,并提供手动粘贴录入入口,录入后长期保存在本机。',
+    tag:'参考文章'
+  },
+  {
+    id:'db1', n:'豆包对话记录(本项目前期讨论)',
+    u:'https://www.doubao.com/thread/xRkAJOJE74pwLYX2H',
+    d:'前期关于硅胶壳 / 录音豆 / 圆屏铝壳的 MOQ、CNC 与注塑报价讨论原始记录。',
+    tag:'对话存档'
+  }
+];

+ 981 - 0
ref-v2/src/04_geo.js

@@ -0,0 +1,981 @@
+/* =========================================================
+   几何引擎:参数化壳体 + 材质 + 爆炸图 + 标注 + 导出
+   1 单位 = 1 mm
+   ========================================================= */
+
+const STAGE = (function(){
+  const B = BABYLON;
+  const V3 = function(x,y,z){ return new B.Vector3(x,y,z); };
+
+  let engine=null, scene=null, camera=null, ground=null, root=null, dimRoot=null, shadowMat=null;
+  let host=null, canvas=null, readyFlag=false, pending=null;
+  let labels=[], labelEls=[];
+  const matCache={}, fixedCache={};
+  let cur={ project:'silicone', params:{}, material:'', explode:0, dims:true, cutForce:false };
+  let parts=[];
+  let customMap={}, cutaway=false, selCb=null, dragCb=null, custUid=1, solo=null;
+
+  /* ---------------- 材质 ---------------- */
+  function pbr(key,cfg){
+    if(matCache[key]) return matCache[key];
+    const m=new B.PBRMaterial('mat-'+key,scene);
+    m.albedoColor=B.Color3.FromHexString(cfg.albedo);
+    m.metallic=cfg.metallic!==undefined?cfg.metallic:0;
+    m.roughness=cfg.rough!==undefined?cfg.rough:0.5;
+    if(cfg.cc!==undefined){
+      m.clearCoat.isEnabled=true;
+      m.clearCoat.intensity=cfg.cc;
+      m.clearCoat.roughness=Math.max(0.03,1-(cfg.cci||0.35));
+    }
+    if(cfg.alpha!==undefined){
+      m.alpha=cfg.alpha;
+      m.transparencyMode=B.Material.MATERIAL_ALPHABLEND;
+    }
+    if(cfg.env!==undefined) m.environmentIntensity=cfg.env;
+    m.backFaceCulling=false;
+    matCache[key]=m;
+    return m;
+  }
+  function fixed(key){
+    if(fixedCache[key]) return fixedCache[key];
+    fixedCache[key]=pbr('fx-'+key, FIXED_MATS[key]);
+    return fixedCache[key];
+  }
+
+  /* 半透明「透视」材质:爆炸/剖视时让内部结构可见 */
+  function ghost(key){
+    const gk='gh-'+key;
+    if(matCache[gk]) return matCache[gk];
+    const src=MATERIALS[key]||MATERIALS[PROJECTS[cur.project].materials[0]];
+    const cfg=Object.assign({},src,{alpha:0.30,env:0.2,cc:0.05});
+    return pbr(gk,cfg);
+  }
+
+  /* ---------------- 2D 轮廓 ---------------- */
+  function roundedPath(w,h,r,seg){
+    const hw=w/2,hh=h/2;
+    r=Math.max(0.05,Math.min(r,Math.min(hw,hh)-0.02));
+    const pts=[];
+    const corners=[
+      {cx:hw-r,cz:hh-r,a0:0},
+      {cx:-(hw-r),cz:hh-r,a0:90},
+      {cx:-(hw-r),cz:-(hh-r),a0:180},
+      {cx:hw-r,cz:-(hh-r),a0:270}
+    ];
+    for(const c of corners){
+      for(let i=0;i<seg;i++){
+        const a=(c.a0+90*i/seg)*Math.PI/180;
+        pts.push({x:c.cx+r*Math.cos(a),z:c.cz+r*Math.sin(a)});
+      }
+    }
+    return pts;
+  }
+
+  function radialN(p){ const l=Math.hypot(p.x,p.z)||1; return V3(p.x/l,0,p.z/l); }
+
+  function assemble(name,chunks,parent){
+    const pos=[],idx=[],nrm=[];
+    let base=0;
+    chunks.forEach(ch=>{
+      ch.p.forEach(v=>pos.push(v.x,v.y,v.z));
+      ch.n.forEach(v=>nrm.push(v.x,v.y,v.z));
+      ch.i.forEach(i=>idx.push(i+base));
+      base+=ch.p.length;
+    });
+    const vd=new B.VertexData();
+    vd.positions=pos; vd.indices=idx; vd.normals=nrm;
+    const mesh=new B.Mesh(name,scene);
+    vd.applyToMesh(mesh);
+    if(parent) mesh.parent=parent;
+    return mesh;
+  }
+
+  /* 环带(上下两个同点数轮廓) */
+  function ringStrip(ringA,yA,ringB,yB,nf){
+    const N=ringA.length,p=[],n=[],i=[];
+    for(let k=0;k<N;k++){
+      const a=ringA[k],b=ringB[k];
+      p.push(V3(a.x,yA,a.z),V3(b.x,yB,b.z));
+      n.push(nf(a,true),nf(b,false));
+    }
+    for(let k=0;k<N;k++){
+      const a1=k*2,b1=k*2+1,a2=((k+1)%N)*2,b2=((k+1)%N)*2+1;
+      i.push(a1,a2,b2,a1,b2,b1);
+    }
+    return {p,n,i};
+  }
+
+  /* 空心圆角框(表壳类) */
+  function hollowFrame(name,spec,parent){
+    const {ow,od,orr,iw,id,irr,y0,y1,chamfer,seg}=spec;
+    const A=roundedPath(ow,od,orr,seg);
+    const Bc=roundedPath(ow,od,orr,seg);
+    const C=roundedPath(Math.max(1,ow-2*chamfer),Math.max(1,od-2*chamfer),Math.max(0.2,orr-chamfer),seg);
+    const D=roundedPath(iw,id,irr,seg);
+    const E=roundedPath(iw,id,irr,seg);
+    const ch=[];
+    ch.push(ringStrip(A,y0,Bc,y1-chamfer,p=>radialN(p)));
+    ch.push(ringStrip(Bc,y1-chamfer,C,y1,p=>{
+      const r=radialN(p); return V3(r.x*0.707,0.707,r.z*0.707);
+    }));
+    ch.push(ringStrip(C,y1,D,y1,()=>V3(0,1,0)));
+    ch.push(ringStrip(D,y1,E,y0,p=>{
+      const r=radialN(p); return V3(-r.x,0,-r.z);
+    }));
+    ch.push(ringStrip(E,y0,A,y0,()=>V3(0,-1,0)));
+    return assemble(name,ch,parent);
+  }
+
+  /* 实心圆角板 */
+  function solidSlab(name,spec,parent){
+    const {w,d,r,y0,y1,seg}=spec;
+    const A=roundedPath(w,d,r,seg);
+    const ch=[];
+    ch.push(ringStrip(A,y0,roundedPath(w,d,r,seg),y1,p=>radialN(p)));
+    const tp=[V3(0,y1,0)],tn=[V3(0,1,0)],ti=[];
+    A.forEach(p=>{ tp.push(V3(p.x,y1,p.z)); tn.push(V3(0,1,0)); });
+    for(let k=0;k<A.length;k++) ti.push(0,1+k,1+((k+1)%A.length));
+    ch.push({p:tp,n:tn,i:ti});
+    const bp=[V3(0,y0,0)],bn=[V3(0,-1,0)],bi=[];
+    A.forEach(p=>{ bp.push(V3(p.x,y0,p.z)); bn.push(V3(0,-1,0)); });
+    for(let k=0;k<A.length;k++) bi.push(0,1+((k+1)%A.length),1+k);
+    ch.push({p:bp,n:bn,i:bi});
+    return assemble(name,ch,parent);
+  }
+
+  /* 回转体:profile = [{r,y}] 闭合,按 CCW 给出(法线自动朝外) */
+  function revolve(name,profile,seg,parent){
+    const ch=[];
+    for(let k=0;k<profile.length;k++){
+      const p0=profile[k],p1=profile[(k+1)%profile.length];
+      const dr=p1.r-p0.r,dy=p1.y-p0.y,len=Math.hypot(dr,dy);
+      if(len<1e-4) continue;
+      const n2r=dy/len,n2y=-dr/len;
+      const pos=[],nrm=[],idx=[];
+      for(let j=0;j<seg;j++){
+        const th=j/seg*Math.PI*2, th2=((j+1)%seg)/seg*Math.PI*2;
+        const c0=Math.cos(th),s0=Math.sin(th),c1=Math.cos(th2),s1=Math.sin(th2);
+        pos.push(V3(p0.r*c0,p0.y,p0.r*s0),V3(p1.r*c0,p1.y,p1.r*s0),V3(p1.r*c1,p1.y,p1.r*s1),V3(p0.r*c1,p0.y,p0.r*s1));
+        nrm.push(V3(n2r*c0,n2y,n2r*s0),V3(n2r*c0,n2y,n2r*s0),V3(n2r*c1,n2y,n2r*s1),V3(n2r*c1,n2y,n2r*s1));
+      }
+      for(let j=0;j<seg;j++){
+        const b=j*4;
+        idx.push(b,b+1,b+2,b,b+2,b+3);
+      }
+      ch.push({p:pos,n:nrm,i:idx});
+    }
+    return assemble(name,ch,parent);
+  }
+
+  function arcPts(cx,cy,r,a0,a1,n){
+    const out=[];
+    for(let i=0;i<=n;i++){
+      const a=(a0+(a1-a0)*i/n)*Math.PI/180;
+      out.push({r:cx+r*Math.cos(a),y:cy+r*Math.sin(a)});
+    }
+    return out;
+  }
+  function dedupe(pts){
+    const out=[];
+    pts.forEach(p=>{
+      const last=out[out.length-1];
+      if(!last||Math.abs(last.r-p.r)>1e-4||Math.abs(last.y-p.y)>1e-4) out.push(p);
+    });
+    if(out.length>2){
+      const f=out[0],l=out[out.length-1];
+      if(Math.abs(f.r-l.r)<1e-4&&Math.abs(f.y-l.y)<1e-4) out.pop();
+    }
+    return out;
+  }
+
+  /* ---------------- 场景 ---------------- */
+  function init(canvasEl,hostEl){
+    canvas=canvasEl; host=hostEl;
+    engine=new B.Engine(canvas,true,{preserveDrawingBuffer:true,stencil:true,alpha:true},true);
+    engine.setHardwareScalingLevel(1/Math.min(2,window.devicePixelRatio||1));
+    scene=new B.Scene(engine);
+    scene.clearColor=new B.Color4(0,0,0,0);
+    scene.ambientColor=new B.Color3(0.16,0.18,0.22);
+
+    camera=new B.ArcRotateCamera('cam',-1.05,1.03,150,V3(0,0,0),scene);
+    camera.lowerRadiusLimit=18; camera.upperRadiusLimit=900;
+    camera.lowerBetaLimit=0.1; camera.upperBetaLimit=1.54;
+    camera.wheelDeltaPercentage=0.02;
+    camera.pinchDeltaPercentage=0.03;
+    camera.attachControl(canvas,true);
+    camera.minZ=0.1; camera.fov=0.75; camera.inertia=0.72;
+    camera.pinchZoom=true;
+    camera.panningSensibility=160;
+    camera.angularSensibilityX=760; camera.angularSensibilityY=760;
+    camera.useNaturalPinchZoom=true;
+    camera.allowUpsideDown=false;
+
+    const hemi=new B.HemisphericLight('hemi',V3(0.1,1,0.2),scene);
+    hemi.intensity=0.5;
+    hemi.groundColor=new B.Color3(0.10,0.12,0.16);
+    const d1=new B.DirectionalLight('d1',V3(-0.5,-1,-0.7),scene);
+    d1.intensity=1.5; d1.position=V3(140,200,160);
+    const d2=new B.DirectionalLight('d2',V3(0.8,-0.55,0.7),scene);
+    d2.intensity=0.85; d2.position=V3(-160,120,-180);
+
+    try{
+      const env=B.CubeTexture.CreateFromPrefilteredData('https://assets.babylonjs.com/environments/environmentSpecular.env',scene);
+      scene.environmentTexture=env;
+      scene.environmentIntensity=0.9;
+    }catch(e){ scene.environmentIntensity=0; }
+
+    const dt=new B.DynamicTexture('shadowTex',{width:256,height:256},scene,false);
+    const ctx=dt.getContext();
+    const g=ctx.createRadialGradient(128,128,6,128,128,126);
+    g.addColorStop(0,'rgba(0,0,0,0.55)');
+    g.addColorStop(0.4,'rgba(0,0,0,0.28)');
+    g.addColorStop(0.72,'rgba(0,0,0,0.09)');
+    g.addColorStop(1,'rgba(0,0,0,0)');
+    ctx.fillStyle=g; ctx.fillRect(0,0,256,256); dt.update();
+    ground=B.MeshBuilder.CreateGround('ground',{width:300,height:300},scene);
+    shadowMat=new B.StandardMaterial('shadowMat',scene);
+    shadowMat.diffuseTexture=dt; shadowMat.opacityTexture=dt;
+    shadowMat.emissiveColor=new B.Color3(0,0,0);
+    shadowMat.specularColor=new B.Color3(0,0,0);
+    shadowMat.disableLighting=true;
+    shadowMat.backFaceCulling=false;
+    ground.material=shadowMat; ground.isPickable=false;
+
+    engine.runRenderLoop(()=>{
+      if(scene) scene.render();
+      updateLabels();
+    });
+    new ResizeObserver(()=>engine.resize()).observe(host);
+    window.addEventListener('resize',()=>engine.resize());
+
+    readyFlag=true;
+    scene.onPointerObservable.add(pi=>{
+      if(pi.type===B.PointerEventTypes.POINTERDOUBLETAP){
+        const m2=pi.pickInfo&&pi.pickInfo.pickedMesh;
+        const md2=m2&&m2.metadata;
+        if(md2&&md2.part) focusPart(md2.part); else frame();
+        return;
+      }
+      if(pi.type!==B.PointerEventTypes.POINTERPICK) return;
+      const m=pi.pickInfo&&pi.pickInfo.pickedMesh;
+      if(!m) return;
+      const md=m.metadata||{};
+      if(!md.part){ if(selCb) selCb(null); return; }
+      highlight(md.part);
+      if(selCb) selCb(md.part,md.custom?m:null);
+    });
+    ensureLabelHost();
+    if(pending){ const p=pending; pending=null; load(p.project,p.params,p.material,p.explode); }
+  }
+
+  function ensureLabelHost(){
+    if(!host) return null;
+    let el=host.querySelector('.dimlayer');
+    if(!el){ el=document.createElement('div'); el.className='dimlayer'; host.appendChild(el); }
+    return el;
+  }
+
+  /* ---------------- 标注 ---------------- */
+  function addDim(a,b,text,color){
+    if(!dimRoot) dimRoot=new B.TransformNode('dims',scene);
+    const col=B.Color3.FromHexString(color||'#7ec8ff');
+    const line=B.MeshBuilder.CreateLines('dl',{points:[a,b]},scene);
+    line.color=col; line.parent=dimRoot; line.isPickable=false;
+    const dir=b.subtract(a);
+    if(dir.length()>0.05){
+      const d=dir.normalize();
+      const perp=V3(-d.z,0.4,d.x);
+      if(perp.length()>0.05){
+        perp.normalize();
+        [a,b].forEach(pt=>{
+          const tick=B.MeshBuilder.CreateLines('tk',{points:[pt.add(perp.scale(2.0)),pt.subtract(perp.scale(2.0))]},scene);
+          tick.color=col; tick.parent=dimRoot; tick.isPickable=false;
+        });
+      }
+    }
+    labels.push({p:a.add(b).scale(0.5),t:text});
+  }
+
+  /* ---------------- 建模:三款 ---------------- */
+  function buildSilicone(p){
+    const g=new B.TransformNode('root',scene);
+    const seg=24;
+    const t=p.t, ow=p.w+2*t, od=p.d+2*t, y0=-p.h/2, y1=p.h/2;
+    const ir=Math.max(0.5,p.r), orr=ir+t;
+
+    const body=hollowFrame('body',{ow,od,orr,iw:p.w,id:p.d,irr:ir,y0,y1,chamfer:0.7,seg},g);
+    body.metadata={role:'body',part:'body'};
+
+    const floor=solidSlab('floor',{w:p.w-0.4,d:p.d-0.4,r:Math.max(0.5,ir-0.2),y0,y1:y0+1.2,seg},g);
+    floor.metadata={role:'body',part:'floor'};
+
+    const hx=p.hg/2, hz=-(od/2-3.0);
+    const hornL=B.MeshBuilder.CreateCylinder('hornL',{diameterBottom:p.hd,diameterTop:p.hd*0.28,height:p.hh,tessellation:18},scene);
+    hornL.position=V3(-hx,y1+p.hh/2-0.45,hz); hornL.rotation.x=-0.28; hornL.rotation.z=-0.10; hornL.parent=g;
+    hornL.metadata={role:'accent',part:'hornL'};
+    const hornR=B.MeshBuilder.CreateCylinder('hornR',{diameterBottom:p.hd,diameterTop:p.hd*0.28,height:p.hh,tessellation:18},scene);
+    hornR.position=V3(hx,y1+p.hh/2-0.45,hz); hornR.rotation.x=-0.28; hornR.rotation.z=0.10; hornR.parent=g;
+    hornR.metadata={role:'accent',part:'hornR'};
+
+    const screen=solidSlab('screen',{w:Math.max(6,p.w-2.8),d:Math.max(6,p.d-2.8),r:Math.max(0.4,ir-1.4),y0:y1-0.62,y1:y1-0.30,seg},g);
+    screen.metadata={role:'glass',part:'screen'};
+
+    const crown=B.MeshBuilder.CreateCylinder('crown',{diameter:3.2,height:2.2,tessellation:16},scene);
+    crown.rotation.z=Math.PI/2;
+    crown.position=V3(ow/2+p.cr*0.5,y0+p.h*0.55,0); crown.parent=g;
+    crown.metadata={role:'body',part:'crown'};
+
+    addDim(V3(-ow/2,y0-5.5,od/2+2.5),V3(ow/2,y0-5.5,od/2+2.5),'外宽 '+ow.toFixed(1));
+    addDim(V3(-(ow/2+4),y0-1,od/2+3),V3(-(ow/2+4),y1,od/2+3),'总高 '+p.h.toFixed(1));
+    addDim(V3(ow/2+11,y0-5.5,-od/2),V3(ow/2+11,y0-5.5,od/2),'外深 '+od.toFixed(1));
+    addDim(V3(-p.hg/2,y1+p.hh+2.0,hz),V3(p.hg/2,y1+p.hh+2.0,hz),'角距 '+p.hg.toFixed(1));
+
+    return {root:g,size:V3(ow,p.h+p.hh*2,od),parts:[
+      {id:'body',node:body,ex:V3(0,0,0)},
+      {id:'floor',node:floor,ex:V3(0,-14,0)},
+      {id:'hornL',node:hornL,ex:V3(-7,16,0)},
+      {id:'hornR',node:hornR,ex:V3(7,16,0)},
+      {id:'screen',node:screen,ex:V3(0,20,0)},
+      {id:'crown',node:crown,ex:V3(16,4,0)}
+    ]};
+  }
+
+  function buildRecorder(p){
+    const g=new B.TransformNode('root',scene);
+    const seg=48;
+    const ro=p.D/2, ri=ro-p.t, y0=-p.H/2, y1=p.H/2;
+    const r=Math.min(p.t*0.65,1.8);
+
+    const bodyProf=dedupe([
+      {r:ri,y:y0+r},
+      ...arcPts(ri+r,y0+r,r,180,270,3),
+      ...arcPts(ro-r,y0+r,r,270,360,3),
+      {r:ro,y:y1},
+      {r:ri,y:y1}
+    ]);
+    const body=revolve('body',bodyProf,seg,g);
+    body.metadata={role:'body',part:'body'};
+
+    const base=revolve('base',dedupe([
+      {r:0.6,y:y0},{r:Math.max(2,ro-1.2),y:y0},{r:Math.max(2,ro-1.2),y:y0+1.1},{r:0.6,y:y0+1.1}
+    ]),seg,g);
+    base.metadata={role:'body',part:'base'};
+
+    // 上盖穹顶
+    const dome=p.dm, lidPts=[{r:0.5,y:y1},{r:ro-0.2,y:y1}];
+    const steps=9;
+    for(let i=0;i<=steps;i++){
+      const a=i/steps*Math.PI/2;
+      lidPts.push({r:0.5+(ro-0.7)*Math.cos(a),y:y1+dome*Math.sin(a)});
+    }
+    const lid=revolve('lid',dedupe(lidPts),seg,g);
+    lid.metadata={role:'body',part:'lid'};
+
+    const loop=B.MeshBuilder.CreateTorus('loop',{diameter:p.ld+p.t*1.9,thickness:p.t*0.9,tessellation:28},scene);
+    loop.rotation.x=Math.PI/2;
+    loop.position=V3(ro+p.lh*0.55,y1-1.6,0); loop.parent=g;
+    loop.metadata={role:'body',part:'loop'};
+
+    const micMeshes=[];
+    const micR=Math.max(4,ro*0.4);
+    for(let i=0;i<4;i++){
+      const a=Math.PI/4+i*Math.PI/2;
+      const m=B.MeshBuilder.CreateCylinder('mic'+i,{diameter:1.0,height:1.8,tessellation:10},scene);
+      m.position=V3(Math.cos(a)*micR,y1+dome*0.72+0.2,Math.sin(a)*micR);
+      m.parent=g; m.material=fixed('dark');
+      m.metadata={role:'dark',part:'mic'};
+      micMeshes.push(m);
+    }
+
+    const usb=B.MeshBuilder.CreateBox('usbc',{width:1.4,height:3.2,depth:9.0},scene);
+    usb.position=V3(ro-0.4,y0+3.0,0); usb.parent=g; usb.material=fixed('dark');
+    usb.metadata={role:'dark',part:'usbc'};
+
+    const btn=B.MeshBuilder.CreateCylinder('btn',{diameter:3.6,height:1.2,tessellation:20},scene);
+    btn.rotation.z=Math.PI/2; btn.position=V3(-ro+0.1,y1-1.2,0); btn.parent=g;
+    btn.metadata={role:'body',part:'btn'};
+
+    const pcb=B.MeshBuilder.CreateCylinder('pcb',{diameter:Math.min(ro*2-5,26),height:1.2,tessellation:32},scene);
+    pcb.position=V3(0,y1-3.4,0); pcb.parent=g; pcb.material=fixed('pcb');
+    pcb.metadata={role:'pcb',part:'pcb'};
+
+    const cell=B.MeshBuilder.CreateCylinder('cell',{diameter:Math.min(ro*2-8,20),height:5.4,tessellation:28},scene);
+    cell.position=V3(0,y0+4.4,0); cell.parent=g; cell.material=fixed('cell');
+    cell.metadata={role:'cell',part:'cell'};
+
+    addDim(V3(-ro,y0-7,0),V3(ro,y0-7,0),'Ø'+p.D.toFixed(1));
+    addDim(V3(ro+9,y0,0),V3(ro+9,y1,0),'高 '+p.H.toFixed(1));
+    addDim(V3(0,y1+6,0),V3(ro+p.lh+2,y1+6,0),'挂环 '+p.lh.toFixed(1));
+
+    const ps=[
+      {id:'body',node:body,ex:V3(0,0,0)},
+      {id:'base',node:base,ex:V3(0,-16,0)},
+      {id:'cell',node:cell,ex:V3(0,2,0)},
+      {id:'pcb',node:pcb,ex:V3(0,14,0)},
+      {id:'lid',node:lid,ex:V3(0,26,0)},
+      {id:'loop',node:loop,ex:V3(18,2,0)},
+      {id:'btn',node:btn,ex:V3(-18,2,0)},
+      {id:'usbc',node:usb,ex:V3(16,-2,0)}
+    ];
+    micMeshes.forEach(m=>ps.push({id:'mic',node:m,ex:V3(0,30,0)}));
+    return {root:g,size:V3(p.D+10,p.H+p.dm, p.D),parts:ps};
+  }
+
+  function buildRound(p){
+    const g=new B.TransformNode('root',scene);
+    const seg=64;
+    const ro=p.D/2, y0=-p.H/2, y1=p.H/2, bd=p.bd/2, sd=p.sd/2, dep=p.dep;
+    const re=Math.min(3.0,p.t*1.3);
+
+    /* CNC 弧面:外壁 → 顶部凸圆 R → 极短平台 → 屏边凹圆 R → 沉台
+       全部由工艺参数驱动,工厂按 rimR / dep / cham 直接编程 */
+    const rimR=Math.max(0.4,Math.min(p.rimR||1.8, (ro-bd)*0.55));
+    const cham=Math.max(0,Math.min(p.cham||0.5, (ro-bd)*0.35));
+    const seam=Math.max(0.5,Math.min(p.dep||1.2, ro-rimR-bd+0.02));
+    const flat=Math.max(0,ro-rimR-(bd+seam));
+    const bezelProf=dedupe([
+      {r:sd,y:y0},
+      {r:Math.max(sd,ro-cham),y:y0},
+      ...(cham>0.05?arcPts(ro-cham,y0+cham,cham,270,360,3):[{r:ro,y:y0}]),
+      {r:ro,y:y1-rimR},
+      ...arcPts(ro-rimR,y1-rimR,rimR,0,90,6),
+      ...(flat>0.15?[{r:bd+seam,y:y1}]:[]),
+      ...arcPts(bd+seam,y1-seam,seam,90,180,6),
+      {r:sd,y:y1-seam}
+    ]);
+    const bezel=revolve('bezel',bezelProf,seg,g);
+    bezel.metadata={role:'body',part:'bezel'};
+
+    const seatY=y1-seam;
+    const black=B.MeshBuilder.CreateCylinder('black',{diameter:p.bd-0.3,height:0.6,tessellation:seg},scene);
+    black.position=V3(0,seatY+0.3,0); black.parent=g; black.material=fixed('dark');
+    black.metadata={role:'dark',part:'black'};
+
+    const glass=B.MeshBuilder.CreateCylinder('glass',{diameter:p.sd+0.4,height:0.8,tessellation:seg},scene);
+    glass.position=V3(0,seatY+0.4,0); glass.parent=g; glass.material=fixed('glass');
+    glass.metadata={role:'glass',part:'glass'};
+
+    const capProf=dedupe([
+      {r:0.6,y:y0},
+      {r:ro-p.t-0.6,y:y0},
+      {r:ro-p.t-0.6,y:y0+p.cap-0.5},
+      ...arcPts(ro-p.t-1.1,y0+p.cap-0.5,0.5,0,90,2),
+      {r:0.6,y:y0+p.cap}
+    ]);
+    const cap=revolve('cap',capProf,seg,g);
+    cap.metadata={role:'body',part:'cap'};
+
+    const th=B.MeshBuilder.CreateTorus('thread',{diameter:p.D-p.t*2-1.6,thickness:0.9,tessellation:seg},scene);
+    th.position=V3(0,y0+p.cap+0.05,0); th.parent=g; th.material=fixed('dark');
+    th.metadata={role:'dark',part:'thread'};
+
+    const bosses=[];
+    for(let i=0;i<4;i++){
+      const a=Math.PI/4+i*Math.PI/2;
+      const b=B.MeshBuilder.CreateCylinder('boss'+i,{diameter:4.2,height:5.2,tessellation:14},scene);
+      b.position=V3(Math.cos(a)*(ro-9),y0+p.cap+2.8,Math.sin(a)*(ro-9));
+      b.parent=g; b.material=fixed('brass');
+      b.metadata={role:'brass',part:'boss'};
+      bosses.push(b);
+    }
+
+    const pcb=B.MeshBuilder.CreateCylinder('pcb',{diameter:Math.min(44,p.D-14),height:1.2,tessellation:40},scene);
+    pcb.position=V3(0,y1-dep-3.4,0); pcb.parent=g; pcb.material=fixed('pcbDark');
+    pcb.metadata={role:'pcb',part:'pcb'};
+
+    const cell=B.MeshBuilder.CreateCylinder('cell',{diameter:Math.min(36,p.D-22),height:5.0,tessellation:36},scene);
+    cell.position=V3(0,y0+p.cap+4.6,0); cell.parent=g; cell.material=fixed('cell');
+    cell.metadata={role:'cell',part:'cell'};
+
+    const sb=B.MeshBuilder.CreateBox('sbtn',{width:1.2,height:5.4,depth:2.0},scene);
+    sb.position=V3(ro-0.1,1.6,-2); sb.parent=g;
+    sb.metadata={role:'body',part:'sbtn'};
+
+    const usb=B.MeshBuilder.CreateBox('usbc',{width:1.5,height:3.2,depth:8.8},scene);
+    usb.position=V3(-ro+0.4,y0+5.4,0); usb.parent=g; usb.material=fixed('dark');
+    usb.metadata={role:'dark',part:'usbc'};
+
+    addDim(V3(-ro,y0-7,0),V3(ro,y0-7,0),'Ø'+p.D.toFixed(2));
+    addDim(V3(ro+6,y0,0),V3(ro+6,y1,0),'厚 '+p.H.toFixed(2));
+    addDim(V3(-sd,y1+8.5,0),V3(sd,y1+8.5,0),'屏 Ø'+p.sd.toFixed(2));
+
+    const ps=[
+      {id:'bezel',node:bezel,ex:V3(0,0,0)},
+      {id:'black',node:black,ex:V3(0,22,0)},
+      {id:'glass',node:glass,ex:V3(0,32,0)},
+      {id:'pcb',node:pcb,ex:V3(0,8,0)},
+      {id:'cell',node:cell,ex:V3(0,-10,0)},
+      {id:'cap',node:cap,ex:V3(0,-28,0)},
+      {id:'thread',node:th,ex:V3(0,-20,0)},
+      {id:'sbtn',node:sb,ex:V3(18,2,0)},
+      {id:'usbc',node:usb,ex:V3(-18,-2,0)}
+    ];
+    bosses.forEach(b=>ps.push({id:'boss',node:b,ex:V3(0,-16,0)}));
+    return {root:g,size:V3(p.D,p.H,p.D),parts:ps};
+  }
+
+  /* ---------------- 自定义结构件(轻量参数化建模) ---------------- */
+  /* 形体库:按工艺预置的标准件参数(M2/M2.5/M3 自攻预钻孔按常用规范) */
+  const PRIMS={
+    box:   {n:'方块',         d:{w:8,  h:6, dd:8},   tag:'基础'},
+    cyl:   {n:'圆柱',         d:{dia:10,h:8},        tag:'基础'},
+    rib:   {n:'加强筋',       d:{w:14, h:5, dd:1.2}, tag:'基础'},
+    pocket:{n:'凹槽(铣削)', d:{w:10, h:2, dd:10},  tag:'基础'},
+    hole:  {n:'开孔(钻孔)', d:{dia:3,  h:1},       tag:'基础'},
+    boss2: {n:'螺丝柱 M2',    d:{dia:4.0,h:7,dd:1.6},tag:'紧固'},
+    boss25:{n:'螺丝柱 M2.5',  d:{dia:4.8,h:8,dd:2.1},tag:'紧固'},
+    boss3: {n:'螺丝柱 M3',    d:{dia:5.6,h:9,dd:2.6},tag:'紧固'},
+    thru25:{n:'M2.5 过孔',    d:{dia:2.7,h:1,dd:2.7},tag:'紧固'},
+    pin3:  {n:'定位销 Ø3',    d:{dia:3,h:4},         tag:'紧固'},
+    pad4:  {n:'四角柱组 M2.5',d:{w:30,h:7,dd:30,dia:4.8,hd:2.1},tag:'腔体'},
+    wall:  {n:'分隔墙',       d:{w:20,h:6,dd:0.8},   tag:'腔体'},
+    tray:  {n:'电池仓',       d:{w:22,h:3,dd:18},    tag:'腔体'},
+    clip:  {n:'卡扣',         d:{w:5,h:4,dd:1.2},    tag:'腔体'}
+  };
+  const FASTEN_TYPES=['boss2','boss25','boss3','thru25','pin3','pad4'];
+
+  function cavInfo(){
+    const id=cur.project,p=cur.params;
+    if(id==='silicone') return {kind:'rect',w:p.w,d:p.d,h:p.h};
+    if(id==='recorder') return {kind:'cyl',r:(p.D-2*p.t)/2,h:p.H-1.2-p.dm};
+    return {kind:'cyl',r:(p.D-2*p.t)/2,h:p.H-p.cap-p.dep};
+  }
+
+  function newSpec(type){
+    const base=(PRIMS[type]||PRIMS.box).d;
+    const s={uid:custUid++,type:type,x:0,z:0,y:0,draft:1,snap:0.5,note:''};
+    Object.keys(base).forEach(k=>s[k]=base[k]);
+    return s;
+  }
+
+  /* 空心柱(螺丝柱 / 过孔):径向回转,内外壁 + 上下环面 */
+  function hollowBoss(name,od,pid,h,tess){
+    const ri=Math.max(0.25,pid/2), ro=Math.max(ri+0.4,od/2), hh=Math.max(0.2,h/2);
+    return revolve(name,[{r:ri,y:-hh},{r:ro,y:-hh},{r:ro,y:hh},{r:ri,y:hh}],tess||20,null);
+  }
+  function mergeAll(ms,name){
+    if(!ms.length) return null;
+    const mm=B.Mesh.MergeMeshes(ms,true,true);
+    if(mm) mm.name=name;
+    return mm||ms[0];
+  }
+
+  function buildPrim(s){
+    const t=s.type;
+    let m=null;
+    const rect=(t==='box'||t==='pocket'||t==='rib'||t==='wall'||t==='clip');
+    if(rect){
+      m=B.MeshBuilder.CreateBox('c'+s.uid,{width:Math.max(0.2,s.w),height:Math.max(0.2,s.h),depth:Math.max(0.2,s.dd)},scene);
+      if(t==='rib'||t==='wall'){
+        const dr=Math.min(0.35,Math.tan(Math.max(0,s.draft||0)*Math.PI/180)*s.h/Math.max(1,s.dd)*1.6);
+        const pos=m.getVerticesData(B.VertexBuffer.PositionKind);
+        if(pos){ for(let i=0;i<pos.length;i+=3){ if(pos[i+1]>0){ pos[i]*=1-dr; pos[i+2]*=1-dr; } } }
+        m.updateVerticesData(B.VertexBuffer.PositionKind,pos);
+      }
+    }else if(t==='tray'){
+      const w=Math.max(4,s.w), dp=Math.max(4,s.dd), h=Math.max(1,s.h);
+      const tw=Math.min(1.4,Math.max(0.6,Math.min(w,dp)/12));
+      const ps=[];
+      const base=B.MeshBuilder.CreateBox('trb',{width:w,height:tw,depth:dp},scene);
+      base.position.y=-h/2+tw/2; ps.push(base);
+      [-1,1].forEach(sg=>{
+        const xw=B.MeshBuilder.CreateBox('trx',{width:tw,height:h,depth:dp},scene);
+        xw.position.x=sg*(w/2-tw/2); ps.push(xw);
+        const zw=B.MeshBuilder.CreateBox('trz',{width:w,height:h,depth:tw},scene);
+        zw.position.z=sg*(dp/2-tw/2); ps.push(zw);
+      });
+      m=mergeAll(ps,'c'+s.uid);
+    }else if(t==='pad4'){
+      const w=Math.max(8,s.w), dp=Math.max(8,s.dd), od=Math.max(2,s.dia||4.8);
+      const pid=Math.max(0.8,s.hd||2.1), h=Math.max(2,s.h);
+      const ps=[];
+      [-1,1].forEach(sx=>[-1,1].forEach(sz=>{
+        const b=hollowBoss('pb',od,pid,h,16);
+        b.position.x=sx*Math.max(0,w/2-od/2); b.position.z=sz*Math.max(0,dp/2-od/2);
+        ps.push(b);
+      }));
+      m=mergeAll(ps,'c'+s.uid);
+    }else if(t==='boss2'||t==='boss25'||t==='boss3'||t==='thru25'){
+      m=hollowBoss('c'+s.uid,Math.max(1.2,s.dia),Math.max(0.4,s.dd),Math.max(0.4,s.h),20);
+    }else if(t==='pin3'){
+      m=B.MeshBuilder.CreateCylinder('c'+s.uid,{diameter:Math.max(0.6,s.dia),height:Math.max(0.4,s.h),tessellation:20},scene);
+    }else{
+      m=B.MeshBuilder.CreateCylinder('c'+s.uid,{diameter:Math.max(0.4,s.dia),height:Math.max(0.2,s.h),tessellation:24},scene);
+    }
+    m.position=V3(s.x||0,s.y||0,s.z||0);
+    if(s.rot) m.rotation.y=s.rot*Math.PI/180;
+    const role=FASTEN_TYPES.indexOf(t)>=0?'brass':((t==='pocket'||t==='hole')?'cut':'body');
+    m.metadata={role:role,part:'c'+s.uid,custom:true,owner:s.owner||null};
+
+    const db=new B.PointerDragBehavior({dragPlaneNormal:V3(0,1,0)});
+    db.useObjectOrientationForDragging=false;
+    db.onDragStartObservable.add(()=>{ if(camera) camera.detachControl(); });
+    db.onDragEndObservable.add(()=>{ if(camera&&canvas) camera.attachControl(canvas,true); });
+    db.onDragObservable.add(()=>{
+      const st=Math.max(0.1,s.snap||0.5);
+      m.position.x=Math.round(m.position.x/st)*st;
+      m.position.z=Math.round(m.position.z/st)*st;
+      const cav=cavInfo();
+      const cw=s.w!==undefined?s.w:s.dia, cd=s.dd!==undefined?s.dd:s.dia;
+      if(cav.kind==='cyl'){
+        const r=Math.hypot(m.position.x,m.position.z);
+        const rr=cav.r-Math.max(cw,cd)/2-0.5;
+        if(r>0.2&&rr>0&&Math.abs(r-rr)<1.5){
+          m.position.x=Math.round((m.position.x/r*rr)*10)/10;
+          m.position.z=Math.round((m.position.z/r*rr)*10)/10;
+        }
+      }else{
+        const xz=cav.d/2-cd/2-0.5, xx=cav.w/2-cw/2-0.5;
+        if(Math.abs(Math.abs(m.position.z)-xz)<1.5) m.position.z=(m.position.z<0?-1:1)*xz;
+        if(Math.abs(Math.abs(m.position.x)-xx)<1.5) m.position.x=(m.position.x<0?-1:1)*xx;
+      }
+      s.x=+m.position.x.toFixed(2); s.z=+m.position.z.toFixed(2);
+      if(dragCb) dragCb(s);
+    });
+    m.addBehavior(db);
+    return m;
+  }
+
+  function buildCustom(parent){
+    labels.length=labels.length; // 保持已有标注
+    const list=customMap[cur.project]||[];
+    list.forEach(s=>{
+      const m=buildPrim(s);
+      m.parent=parent;
+      parts.push({id:'c'+s.uid,node:m,ex:V3(0,0,0),custom:true,spec:s});
+    });
+  }
+
+  const OUTER={silicone:['body'],recorder:['body','lid'],round:['bezel','cap']};
+
+  /* ---------------- 材质应用 ---------------- */
+  function applyMaterial(key){
+    if(!root) return;
+    const cfg=MATERIALS[key]||MATERIALS[PROJECTS[cur.project].materials[0]];
+    if(!cfg) return;
+    const useKey=MATERIALS[key]?key:PROJECTS[cur.project].materials[0];
+    const bodyM=pbr(useKey,MATERIALS[useKey]);
+    const accentKey=useKey.indexOf('sil-')===0?'sil-black':useKey;
+    const accentM=pbr(accentKey,MATERIALS[accentKey]);
+    const outer=OUTER[cur.project]||[];
+    root.getChildMeshes().forEach(m=>{
+      const role=m.metadata&&m.metadata.role;
+      const pid=m.metadata&&m.metadata.part;
+      if(role==='body') m.material=(cutaway&&outer.indexOf(pid)>=0)?ghost(useKey):bodyM;
+      else if(role==='accent') m.material=accentM;
+      else if(role==='glass') m.material=fixed('glass');
+      else if(role==='pcb') m.material=fixed('pcb');
+      else if(role==='cell') m.material=fixed('cell');
+      else if(role==='brass') m.material=fixed('brass');
+      else if(role==='dark') m.material=fixed('dark');
+      else if(role==='cut') m.material=fixed('cut');
+    });
+  }
+
+  /* ---------------- 单件隔离编辑 ---------------- */
+  function applySolo(id){
+    if(!root) return;
+    root.getChildMeshes().forEach(m=>{
+      const md=m.metadata||{};
+      const keep=!id||md.part===id||md.owner===id;
+      m.setEnabled(!!keep);
+    });
+    if(dimRoot) dimRoot.setEnabled(!id&&cur.dims);
+    const layer=host&&host.querySelector('.dimlayer');
+    if(layer) layer.style.display=(!id&&cur.dims)?'block':'none';
+  }
+  function frameSolo(id){
+    if(!root||!camera) return;
+    const ms=root.getChildMeshes().filter(m=>m.metadata&&(m.metadata.part===id||m.metadata.owner===id)&&m.isEnabled());
+    if(!ms.length) return;
+    const bi=ms[0].getHierarchyBoundingVectors();
+    const c=bi.max.add(bi.min).scale(0.5);
+    const dim=Math.max(bi.max.x-bi.min.x,bi.max.y-bi.min.y,bi.max.z-bi.min.z);
+    camera.target=c;
+    camera.alpha=-0.95; camera.beta=1.16;
+    camera.radius=Math.max(34,dim*2.35);
+    camera.lowerRadiusLimit=Math.max(10,dim*0.6);
+  }
+  function focusPart(id){
+    if(!root||!camera) return;
+    const ms=root.getChildMeshes().filter(m=>m.metadata&&(m.metadata.part===id||m.metadata.owner===id)&&m.isEnabled());
+    if(!ms.length) return;
+    const bi=ms[0].getHierarchyBoundingVectors();
+    const c=bi.max.add(bi.min).scale(0.5);
+    const dim=Math.max(bi.max.x-bi.min.x,bi.max.y-bi.min.y,bi.max.z-bi.min.z);
+    camera.target=c;
+    camera.radius=Math.max(22,dim*2.1);
+  }
+
+  function setSolo(id){
+    solo=id||null;
+    if(!root) return;
+    cutaway=false;
+    applyMaterial(cur.material);
+    applySolo(solo);
+    if(solo) frameSolo(solo); else frame();
+    if(cur.hl&&solo&&cur.hl!==solo) highlight(solo);
+  }
+
+  /* ---------------- 组装/重建 ---------------- */
+  function rebuild(reframe){
+    if(!scene) return;
+    if(root){ root.dispose(); root=null; }
+    if(dimRoot){ dimRoot.dispose(); dimRoot=null; }
+    labels=[]; labelEls.forEach(e=>e.remove()); labelEls=[];
+    const proj=PROJECTS[cur.project];
+    const p={};
+    proj.params.forEach(x=>{ p[x.k]=x.def; });
+    Object.assign(p,cur.params||{});
+    const out=(cur.project==='silicone')?buildSilicone(p):(cur.project==='recorder')?buildRecorder(p):buildRound(p);
+    root=out.root; parts=out.parts;
+    buildCustom(root);
+    parts.forEach(pt=>{
+      if(!pt.node) return;
+      pt.basePos=pt.node.position.clone();
+      pt.node.metadata=Object.assign({},pt.node.metadata||{},{part:pt.id});
+    });
+    applyMaterial(cur.material);
+    applyExplode(cur.explode);
+    if(solo) applySolo(solo);
+    placeGround();
+    if(reframe!==false) frame();
+    refreshDims();
+    if(cur.hl) highlight(cur.hl);
+  }
+
+  function placeGround(){
+    if(!root||!ground) return;
+    const bi=root.getHierarchyBoundingVectors();
+    const dim=Math.max(bi.max.x-bi.min.x,bi.max.y-bi.min.y,bi.max.z-bi.min.z);
+    ground.position.y=bi.min.y-0.2;
+    ground.scaling.x=ground.scaling.z=Math.max(1,dim/60);
+  }
+
+  function frame(){
+    if(!root||!camera) return;
+    const bi=root.getHierarchyBoundingVectors();
+    const c=bi.max.add(bi.min).scale(0.5);
+    const dim=Math.max(bi.max.x-bi.min.x,bi.max.y-bi.min.y,bi.max.z-bi.min.z);
+    camera.target=c;
+    const aspect=(engine?engine.getRenderWidth():1)/Math.max(1,(engine?engine.getRenderHeight():1));
+    const pad=Math.max(1,1.18/Math.max(0.6,aspect));
+    camera.radius=Math.max(95,dim*1.98*pad);
+    camera.lowerRadiusLimit=Math.max(22,dim*0.85);
+    camera.upperRadiusLimit=Math.max(400,dim*7);
+  }
+
+  function applyExplode(v){
+    cur.explode=v||0;
+    parts.forEach(pt=>{
+      if(!pt.node||!pt.basePos) return;
+      pt.node.position=pt.basePos.add(pt.ex.scale(cur.explode));
+    });
+    const wantCut=!solo&&((cur.explode>0.2)||!!cur.cutForce);
+    if(wantCut!==cutaway){
+      cutaway=wantCut;
+      applyMaterial(cur.material);
+    }
+  }
+
+  function highlight(partId){
+    cur.hl=partId;
+    if(!root) return;
+    root.getChildMeshes().forEach(m=>{
+      m.renderOutline=false;
+      if(partId&&m.metadata&&m.metadata.part===partId){
+        m.renderOutline=true;
+        m.outlineColor=new B.Color3(0.25,0.75,1);
+        m.outlineWidth=0.9;
+      }
+    });
+  }
+
+  function setView(name){
+    if(!camera) return;
+    const map={iso:[-1.05,1.03],front:[-Math.PI/2,1.53],side:[0,1.53],top:[-Math.PI/2,0.17],low:[-0.55,1.38]};
+    const v=map[name]||map.iso;
+    let t=0; const fromA=camera.alpha,fromB=camera.beta,dur=0.42;
+    const obs=scene.onBeforeRenderObservable.add(()=>{
+      t+=engine.getDeltaTime()/1000;
+      const k=Math.min(1,t/dur), e=1-Math.pow(1-k,3);
+      camera.alpha=fromA+(v[0]-fromA)*e;
+      camera.beta=fromB+(v[1]-fromB)*e;
+      if(k>=1) scene.onBeforeRenderObservable.remove(obs);
+    });
+  }
+
+  function refreshDims(){
+    const layer=ensureLabelHost();
+    if(!layer) return;
+    layer.innerHTML=''; labelEls=[];
+    labels.forEach(l=>{
+      const d=document.createElement('div');
+      d.className='dimtag'; d.textContent=l.t;
+      layer.appendChild(d); labelEls.push(d);
+    });
+    layer.style.display=(cur.dims&&!solo)?'block':'none';
+    if(dimRoot) dimRoot.setEnabled(cur.dims&&!solo);
+  }
+
+  function setDims(on){
+    cur.dims=!!on;
+    const layer=host&&host.querySelector('.dimlayer');
+    if(layer) layer.style.display=cur.dims?'block':'none';
+    if(dimRoot) dimRoot.setEnabled(cur.dims);
+  }
+
+  let lastW=0,lastH=0;
+  function updateLabels(){
+    if(!camera||!labelEls.length) return;
+    const rw=engine.getRenderWidth(), rh=engine.getRenderHeight();
+    if(rw!==lastW||rh!==lastH){ lastW=rw; lastH=rh; }
+    const vp=camera.viewport.toGlobal(rw,rh);
+    const tm=scene.getTransformMatrix();
+    const cssW=host.clientWidth, cssH=host.clientHeight;
+    for(let i=0;i<labels.length;i++){
+      const el=labelEls[i]; if(!el) continue;
+      const pr=B.Vector3.Project(labels[i].p,B.Matrix.Identity(),tm,vp);
+      if(pr.z<0||pr.z>1){ el.style.opacity='0'; continue; }
+      el.style.opacity='1';
+      const x=Math.min(Math.max((pr.x/rw)*cssW,34),cssW-34);
+      const y=Math.min(Math.max((pr.y/rh)*cssH,16),cssH-16);
+      el.style.left=x.toFixed(1)+'px';
+      el.style.top=y.toFixed(1)+'px';
+    }
+  }
+
+  function load(projectId,params,material,explode){
+    if(!readyFlag){ pending={project:projectId,params:params,material:material,explode:explode}; return; }
+    cur.project=projectId;
+    cur.params=Object.assign({},params||{});
+    cur.material=material||PROJECTS[projectId].materials[0];
+    cur.explode=explode||0;
+    cur.hl=null;
+    rebuild();
+  }
+
+  /* ---------------- 导出 ---------------- */
+  function collectMeshes(partId){
+    if(!root) return [];
+    const out=[];
+    root.getChildMeshes().forEach(m=>{
+      if(partId){
+        const md=m.metadata||{};
+        if(md.part!==partId&&md.owner!==partId) return;
+      }
+      if(!m.getTotalVertices()) return;
+      const role=m.metadata&&m.metadata.role;
+      const isCustom=!!(m.metadata&&m.metadata.custom);
+      if(role==='cut') return;
+      if(!isCustom&&(role==='dark'||role==='glass'||role==='brass'||role==='pcb'||role==='cell')) return;
+      out.push(m);
+    });
+    return out;
+  }
+
+  function exportMesh(kind,name,partId){
+    const meshes=collectMeshes(partId);
+    if(!meshes.length) return null;
+    if(kind==='stl'){
+      const lines=['solid '+name];
+      meshes.forEach(m=>{
+        const pos=m.getVerticesData(B.VertexBuffer.PositionKind);
+        const idx=m.getIndices();
+        m.computeWorldMatrix(true);
+        const wm=m.getWorldMatrix();
+        for(let i=0;i<idx.length;i+=3){
+          const a=B.Vector3.TransformCoordinates(V3(pos[idx[i]*3],pos[idx[i]*3+1],pos[idx[i]*3+2]),wm);
+          const b=B.Vector3.TransformCoordinates(V3(pos[idx[i+1]*3],pos[idx[i+1]*3+1],pos[idx[i+1]*3+2]),wm);
+          const c=B.Vector3.TransformCoordinates(V3(pos[idx[i+2]*3],pos[idx[i+2]*3+1],pos[idx[i+2]*3+2]),wm);
+          const n=B.Vector3.Cross(b.subtract(a),c.subtract(a));
+          if(n.length()<1e-8) continue;
+          n.normalize();
+          lines.push('facet normal '+n.x.toFixed(5)+' '+n.y.toFixed(5)+' '+n.z.toFixed(5),' outer loop');
+          [a,b,c].forEach(v=>lines.push('  vertex '+v.x.toFixed(4)+' '+v.y.toFixed(4)+' '+v.z.toFixed(4)));
+          lines.push(' endloop','endfacet');
+        }
+      });
+      lines.push('endsolid '+name);
+      return {text:lines.join('\n'),ext:'stl'};
+    }
+    const out=['# Pocket Shell Studio · unit mm · '+name];
+    let voff=0;
+    meshes.forEach((m,mi)=>{
+      const pos=m.getVerticesData(B.VertexBuffer.PositionKind);
+      const nrm=m.getVerticesData(B.VertexBuffer.NormalKind);
+      const idx=m.getIndices();
+      m.computeWorldMatrix(true);
+      const wm=m.getWorldMatrix();
+      out.push('o '+name+'_'+((m.metadata&&m.metadata.part)||mi));
+      for(let i=0;i<pos.length;i+=3){
+        const v=B.Vector3.TransformCoordinates(V3(pos[i],pos[i+1],pos[i+2]),wm);
+        out.push('v '+v.x.toFixed(4)+' '+v.y.toFixed(4)+' '+v.z.toFixed(4));
+      }
+      for(let i=0;i<nrm.length;i+=3) out.push('vn '+nrm[i].toFixed(4)+' '+nrm[i+1].toFixed(4)+' '+nrm[i+2].toFixed(4));
+      for(let i=0;i<idx.length;i+=3){
+        const a=idx[i]+1+voff,b=idx[i+1]+1+voff,c=idx[i+2]+1+voff;
+        out.push('f '+a+'//'+a+' '+b+'//'+b+' '+c+'//'+c);
+      }
+      voff+=pos.length/3;
+    });
+    return {text:out.join('\n'),ext:'obj'};
+  }
+
+  return {
+    init:init,
+    load:load,
+    setParams:function(p){ cur.params=Object.assign({},p); rebuild(false); },
+    setMaterial:function(k){ cur.material=k; applyMaterial(k); },
+    setExplode:function(v){ applyExplode(v); },
+    setSolo:function(id){ setSolo(id); },
+    isSolo:function(){ return solo; },
+    setCutaway:function(on){ cur.cutForce=!!on; cutaway=!!on||cur.explode>0.2; applyMaterial(cur.material); },
+    isCutaway:function(){ return cutaway; },
+    setDims:setDims,
+    setView:setView,
+    frame:function(){ frame(); },
+    focusPart:focusPart,
+    highlight:highlight,
+    /* ---- 自定义结构件 ---- */
+    PRIMS:PRIMS,
+    setCustom:function(projectId,list){
+      customMap[projectId]=(list||[]).map(s=>Object.assign({},s));
+      if(cur.project===projectId) rebuild(false);
+    },
+    customList:function(){ return (customMap[cur.project]||[]).map(s=>Object.assign({},s)); },
+    addCustom:function(type,patch){
+      const s=Object.assign(newSpec(type),patch||{});
+      (customMap[cur.project]=customMap[cur.project]||[]).push(s);
+      rebuild(false);
+      highlight('c'+s.uid);
+      return Object.assign({},s);
+    },
+    updateCustom:function(uid,patch){
+      const l=customMap[cur.project]||[];
+      const s=l.find(x=>x.uid===uid);
+      if(!s) return null;
+      Object.assign(s,patch||{});
+      rebuild(false);
+      highlight('c'+uid);
+      return Object.assign({},s);
+    },
+    removeCustom:function(uid){
+      const l=customMap[cur.project]||[];
+      const i=l.findIndex(x=>x.uid===uid);
+      if(i>=0) l.splice(i,1);
+      rebuild(false);
+    },
+    clearCustom:function(){ customMap[cur.project]=[]; rebuild(false); },
+    onSelect:function(cb){ selCb=cb; },
+    onDrag:function(cb){ dragCb=cb; },
+    snapshot:function(){ if(!engine) return null; scene.render(); return canvas.toDataURL('image/png'); },
+    exportSTL:function(n){ return exportMesh('stl',n); },
+    exportOBJ:function(n){ return exportMesh('obj',n); },
+    exportSTLPart:function(n,pid){ return exportMesh('stl',n,pid); },
+    exportOBJPart:function(n,pid){ return exportMesh('obj',n,pid); },
+    partIds:function(){ return parts.map(p=>({id:p.id,custom:!!p.custom})); },
+    parts:function(){ return parts; },
+    isReady:function(){ return readyFlag; }
+  };
+})();

+ 1496 - 0
ref-v2/src/05_app.js

@@ -0,0 +1,1496 @@
+import { LitElement, html } from 'https://fastly.jsdelivr.net/npm/lit@3.1.2/+esm';
+
+/* =========================================================
+   工具
+   ========================================================= */
+const f1=(n,d)=>{ d=d===undefined?1:d; return (Math.round(n*Math.pow(10,d))/Math.pow(10,d)).toFixed(d); };
+const defaultParams=(id)=>{
+  const o={}; PROJECTS[id].params.forEach(x=>o[x.k]=x.def); return o;
+};
+const getParamDefs=(id)=>PROJECTS[id].params;
+
+/* =========================================================
+   工艺规则库:建模自由度按工艺分档
+   ========================================================= */
+const RULES={
+  injection:{name:'注塑(ABS/PC)',minWall:0.8,minRib:0.8,draft:1,items:[
+    ['最小壁厚','0.8 mm,薄壁区建议 1.0'],['拔模角','≥1°,外观面 ≥2°'],
+    ['内角圆角','R ≥ 0.5(避免应力集中)'],['筋厚','≥0.8,且 ≤ 主壁厚 0.8 倍'],
+    ['深宽比','≤ 3:1,超过需镶件'],['缩水','0.4%~0.6%,开模按此放量']]},
+  silicone:{name:'硅胶模压',minWall:1.2,minRib:1.0,draft:3,items:[
+    ['壁厚','1.5~3.0 mm(回弹夹持区)'],['脱模角','≥3°,双角根部 ≥5°'],
+    ['圆角','R ≥ 0.5,禁止尖角'],['硬度','30~70 Shore A'],['最小批次','500 套(钢模)']]},
+  cnc:{name:'CNC 铝 6061',minWall:1.0,minRib:1.0,draft:0,items:[
+    ['最小刀具','Ø2,内角 R≥1'],['最小壁厚','1.0 mm,薄壁变形需留余量'],
+    ['深腔','≤ 4× 刀径,超过需五轴'],['公差','±0.05 关键 / ±0.1 一般'],
+    ['螺纹','阳极后必须二次回攻'],['标注','基准 + 孔位坐标表,缺一不接单']]},
+  vac:{name:'真空复模',minWall:1.2,minRib:1.0,draft:1.5,items:[
+    ['壁厚','≥1.2 mm'],['收缩补偿','0.3%,模具按放大做'],['批量','10 套起,适合内测']]},
+  die:{name:'压铸铝',minWall:1.5,minRib:1.2,draft:1.5,items:[
+    ['壁厚','≥1.5 mm'],['拔模','≥1.5°'],['模具费','¥12,000 起'],['MOQ','1000 套']]}
+};
+const ruleKey=(proc)=>{
+  if(proc==='sil-mold') return 'silicone';
+  if(proc==='die-cast') return 'die';
+  if(proc==='vacuum') return 'vac';
+  if(String(proc).indexOf('cnc')===0) return 'cnc';
+  return 'injection';
+};
+const EXPORTABLE={silicone:['body','floor','hornL','hornR','crown'],recorder:['body','lid','loop','btn'],round:['bezel','cap','boss','sbtn']};
+const primDim=(s)=>s.w!==undefined?[s.w,s.dd,s.h]:[s.dia,s.dia,s.h];
+const CYL_TYPES=['cyl','hole','pin3','boss2','boss25','boss3','thru25'];
+const RECT_TYPES=['box','pocket','rib','wall','clip','tray'];
+const HOLLOW_TYPES=['boss2','boss25','boss3','thru25'];
+const STD_PILOT={boss2:1.6,boss25:2.1,boss3:2.6};
+const primSpecText=(k)=>{ const P=STAGE.PRIMS[k]; if(!P) return ''; if(k==='box')return '8×8×H6';
+  if(k==='cyl')return 'Ø10 × H8'; if(k==='rib')return '14×1.2×H5'; if(k==='pocket')return '10×10×H2';
+  if(k==='hole')return 'Ø3 孔'; if(HOLLOW_TYPES.indexOf(k)>=0)return 'Ø'+P.d.dia+' / 孔Ø'+P.d.dd;
+  if(k==='pin3')return 'Ø3 × H4'; if(k==='pad4')return '间距 '+P.d.w+',M2.5';
+  if(k==='wall')return '20×0.8×H6'; if(k==='tray')return '22×18×H3'; if(k==='clip')return '5×1.2×H4'; return ''; };
+
+function cavity(id,p){
+  if(id==='silicone') return {kind:'rect',w:p.w,d:p.d,h:p.h};
+  if(id==='recorder') return {kind:'cyl',r:(p.D-2*p.t)/2,h:p.H-1.2-p.dm};
+  return {kind:'cyl',r:(p.D-2*p.t)/2,h:p.H-p.cap-p.dep};
+}
+
+/* 结构件与内腔的最小余量(mm) */
+function clearanceTo(id,p,s){
+  const cw=s.w!==undefined?s.w:s.dia, cd=s.dd!==undefined?s.dd:s.dia;
+  if(id==='silicone') return Math.min(p.w/2-(Math.abs(s.x||0)+cw/2), p.d/2-(Math.abs(s.z||0)+cd/2));
+  const cav=cavity(id,p);
+  return cav.r-(Math.hypot(s.x||0,s.z||0)+Math.max(cw,cd)/2);
+}
+
+/* 模型校验:每个结构件按当前工艺逐条过 */
+function modelChecks(id,p,list,rk){
+  const out=[],rule=RULES[rk];
+  const cav=cavity(id,p);
+  if(id!=='silicone'&&p.t<rule.minWall) out.push({ok:false,t:'主壁厚 '+f1(p.t)+' mm 低于 '+rule.name+' 下限 '+rule.minWall+' mm'});
+  if(!list.length) out.push({ok:true,t:'尚无自定义结构件:当前只有参数化主体,内部支撑靠默认壳体'});
+  list.forEach(s=>{
+    const d=primDim(s), thin=Math.min(d[0],d[1]);
+    const nm=(STAGE.PRIMS[s.type]?STAGE.PRIMS[s.type].n:'件');
+    const cl=clearanceTo(id,p,s);
+    if((s.type==='rib'||s.type==='box'||s.type==='pocket')&&thin<rule.minRib)
+      out.push({ok:false,t:nm+' 厚 '+f1(thin,2)+' mm < '+rule.name+' 最小 '+rule.minRib+' mm(会缩水/让刀)'});
+    if(cl<1.0) out.push({ok:false,t:nm+' 距内壁只剩 '+f1(cl,1)+' mm(<1 mm,装配与脱模都会出问题)'});
+    else out.push({ok:true,t:nm+' 距内壁 '+f1(cl,1)+' mm,余量可用'});
+    if(rule.draft>0&&s.type==='rib'&&(s.draft||0)<rule.draft)
+      out.push({ok:false,t:nm+' 拔模 '+(s.draft||0)+'° < '+rule.draft+'°('+rule.name+' 会粘模)'});
+    if(rk==='cnc'&&(s.type==='pocket'||s.type==='hole'))
+      out.push({ok:true,t:nm+':需在 2D 图纸标刀具半径 R≥1 与孔位坐标'});
+    if(['boss2','boss25','boss3'].indexOf(s.type)>=0){
+      const wall=(s.dia-s.dd)/2, minW=rk==='cnc'?0.9:Math.max(0.9,rule.minRib*0.9);
+      if(wall<minW) out.push({ok:false,t:nm+' 柱壁 '+f1(wall,2)+' mm < '+f1(minW,1)+' mm,自攻牙会胀裂'});
+      else out.push({ok:true,t:nm+' 柱壁 '+f1(wall,2)+' mm,可攻牙(预钻 Ø'+f1(s.dd,1)+')'});
+      const std=STD_PILOT[s.type];
+      if(Math.abs(s.dd-std)>0.15) out.push({ok:false,t:nm+' 预钻孔 Ø'+f1(s.dd,1)+' 非标准(该规格应为 Ø'+std+')'});
+    }
+    if(s.type==='pad4'){
+      const wall=(s.dia-s.hd)/2;
+      if(wall<0.9) out.push({ok:false,t:nm+' 柱壁 '+f1(wall,2)+' mm 偏薄(<0.9)'});
+      out.push({ok:true,t:nm+' 四柱中心距 '+f1(s.w,1)+' × '+f1(s.dd,1)+',需与 PCB 孔位一致(±0.05)'});
+    }
+    if((s.type==='pocket'||s.type==='hole')&&s.h>Math.min(d[0],d[1])*2)
+      out.push({ok:false,t:nm+' 深宽比 '+f1(s.h/Math.max(1,thin),1)+':1 > 2:1,需分层铣/镶件'});
+  });
+  return out;
+}
+
+function derived(id,p){
+  if(id==='silicone'){
+    const ow=p.w+2*p.t, od=p.d+2*p.t;
+    const vol=(2*(p.w+p.d)*p.t*p.h)+(p.w*p.d*1.2);
+    return [
+      ['外宽 × 外深', f1(ow)+' × '+f1(od)+' mm'],
+      ['内腔净尺寸', f1(p.w)+' × '+f1(p.d)+' × '+f1(p.h)+' mm'],
+      ['内腔圆角', f1(p.r)+' mm'],
+      ['双角', f1(p.hh)+' mm 高 / Ø'+f1(p.hd)+' 底'],
+      ['单件估重(不含表体)', f1(vol/1000*1.2,1)+' g'],
+      ['夹持余量建议', '内腔 = 实机 + 0.1~0.3 mm']
+    ];
+  }
+  if(id==='recorder'){
+    const inner=p.D-2*p.t, vol=Math.PI*p.D*p.t*p.H + Math.PI*(p.D*p.D/4)*1.2;
+    return [
+      ['外径 × 总高', 'Ø'+f1(p.D)+' × '+f1(p.H)+' mm'],
+      ['内腔可用', 'Ø'+f1(inner)+' × '+f1(p.H-1.2-p.dm)+' mm'],
+      ['上盖穹顶', f1(p.dm)+' mm'],
+      ['挂环', '孔径 Ø'+f1(p.ld)+' / 外伸 '+f1(p.lh)+' mm'],
+      ['单件估重(不含电子)', f1(vol/1000*1.05,1)+' g'],
+      ['PCB 建议', 'Φ'+f1(Math.min(inner-4,26))+' 以内,留 2mm 边距']
+    ];
+  }
+  const inner=p.D-2*p.t;
+  const vol=Math.PI*p.D*p.t*p.H;
+  return [
+    ['外径 × 总厚', 'Ø'+f1(p.D,2)+' × '+f1(p.H,2)+' mm'],
+    ['内腔可用', 'Ø'+f1(inner)+' × '+f1(p.H-p.cap-p.dep,2)+' mm'],
+    ['屏 / 黑边', 'Ø'+f1(p.sd,2)+' / Ø'+f1(p.bd,1)+',沉台 '+f1(p.dep)+' mm'],
+    ['屏占比', f1(p.sd/p.D*100,0)+'%'],
+    ['单件估重(铝壳)', f1(vol/1000*2.7,1)+' g'],
+    ['后盖', f1(p.cap,1)+' mm 厚 / 示意 M'+f1(inner+1,1)+'×1.5']
+  ];
+}
+
+function fitRows(id,p){
+  if(id==='round'){
+    const inner=p.D-2*p.t;
+    return [
+      ['屏 AA Ø45.68 vs 沉台开口 Ø'+f1(p.bd,1), p.bd>=45.68?'可通过':'需放大黑边'],
+      ['主板 Φ44 vs 内腔 Ø'+f1(inner,1), inner>=45?'可通过':'内腔不足,需减壁厚'],
+      ['屏厚 1.0 + 0.2 缓冲 vs 沉台 '+f1(p.dep), p.dep>=1.2?'OK':'偏浅,顶屏风险'],
+      ['锂电 103450(10 厚) vs 净高 '+f1(p.H-p.cap-p.dep,1), (p.H-p.cap-p.dep)>=11?'OK':'需改电芯']
+    ];
+  }
+  if(id==='recorder'){
+    const inner=p.D-2*p.t;
+    return [
+      ['ESP32-S3-WROOM-1 18×25.5 vs 内腔 Ø'+f1(inner,1), inner>=28?'需改板形':'需底板切圆角'],
+      ['Φ26 PCB vs 内腔 Ø'+f1(inner,1), inner>=28?'OK':'需缩板'],
+      ['软包 402030(20 宽) vs Ø'+f1(inner,1), inner>=24?'OK':'需换电芯'],
+      ['Type-C 座 9.0 长 vs 壁厚 '+f1(p.t), '需侧开孔 9.2×3.6'],
+      ['麦孔声腔 1.5mm', p.H>=10?'OK':'腔体偏薄']
+    ];
+  }
+  const inner=p.w;
+  return [
+    ['表体 41.3×41.3 vs 内腔 '+f1(inner,1)+'×'+f1(p.d,1), inner>=41.5?'OK':'需按实机放大'],
+    ['表冠凸出 vs 开孔允许', p.cr>=1.2?'OK':'需加大开孔'],
+    ['壁厚回弹区 2~3mm', (p.t>=2&&p.t<=3)?'OK':'夹持偏弱'],
+    ['双角根部 Ø'+f1(p.hd)+' vs 顶面宽 '+f1((p.w+2*p.t-p.hg)/2,1), '需 ≥1mm 余量']
+  ];
+}
+
+function processTable(id,qty){
+  const rows=[];
+  PROJECTS[id].processes.forEach(pr=>{
+    let unit=null;
+    pr.unit.forEach(t=>{ if(qty>=t[0]) unit=t[1]; });
+    if(unit===null) unit=pr.unit[0][1];
+    const extra=pr.mold||0;
+    const total=extra+qty*unit;
+    rows.push({...pr,unitUsed:unit,per:total/qty,below:qty<pr.minQty,total});
+  });
+  return rows;
+}
+
+/* =========================================================
+   规格单 / BOM 生成
+   ========================================================= */
+function specMarkdown(id,params,matKey,qty,customs){
+  const proj=PROJECTS[id], mat=MATERIALS[matKey]||MATERIALS[proj.materials[0]];
+  const L=[];
+  L.push('# 生产需求单 | '+proj.name);
+  L.push('');
+  L.push('- 参考型号:'+proj.ref);
+  L.push('- 版本:v1.4(壳体工坊自动生成)');
+  L.push('- 日期:'+new Date().toLocaleDateString('zh-CN'));
+  L.push('- 单位:mm;数量:'+qty+' 套(报价按此数量)');
+  L.push('- 币种:CNY,含 13% 增值税口径请供应商标注');
+  L.push('');
+  L.push('## 1. 关键尺寸(当前参数快照)');
+  L.push('');
+  L.push('| 参数 | 数值 | 说明 |');
+  L.push('| --- | --- | --- |');
+  proj.params.forEach(x=>{
+    L.push('| '+x.n+' ('+x.k+') | '+f1(params[x.k],2)+' mm | 范围 '+x.min+'~'+x.max+' |');
+  });
+  L.push('');
+  L.push('派生尺寸:');
+  derived(id,params).forEach(d=>L.push('- '+d[0]+':'+d[1]));
+  L.push('');
+  if(id==='round'){
+    L.push('> **CNC 弧面(按此编程)**:外壁顶部凸圆 R'+f1(params.rimR,2)+';屏边凹圆弧 R'+f1(params.dep,2)+'(沉台深 '+f1(params.dep,2)+');底边倒角 C'+f1(params.cham,2)+'。弧面用 R≥1 的球头/圆鼻刀连续走刀,过渡区不得有接刀痕与刀纹台阶。');
+    L.push('');
+  }
+  L.push('## 2. 外观与材质');
+  L.push('');
+  L.push('- 主体材质:'+mat.name+'('+(mat.note||'按工艺常规')+')');
+  L.push('- 表面处理:'+(id==='round'?'喷砂 + 阳极氧化 10~15μm;阳极后螺纹二次回攻':(id==='silicone'?'喷手感油(哑光);丝印/镭雕 logo 可选':'注塑本色或喷橡胶漆,耐磨 500g 摩擦')));
+  L.push('- 颜色:以提供的色卡为准(Pantone / 劳尔号),色差 ΔE ≤ 1.5');
+  L.push('- 外观面:无缩水、无顶白、无拉伤、无熔接线可见');
+  L.push('');
+  L.push('## 3. 公差与验收');
+  L.push('');
+  L.push('| 项目 | 要求 |');
+  L.push('| --- | --- |');
+  proj.tolerance.forEach(t=>L.push('| '+t[0]+' | '+t[1]+' |'));
+  L.push('| 首件 | 提供三坐标/影像仪报告 + 实配照片 |');
+  L.push('| 抽检 | AQL 1.0 外观 / 0.65 关键尺寸 |');
+  L.push('');
+  L.push('## 4. 工艺路线(请逐项报价)');
+  L.push('');
+  L.push('| 工艺 | MOQ | 一次性费用 | 单价 | 交期 | 备注 |');
+  L.push('| --- | --- | --- | --- | --- | --- |');
+  proj.processes.forEach(pr=>{
+    let unit=null; pr.unit.forEach(t=>{ if(qty>=t[0]) unit=t[1]; });
+    if(unit===null) unit=pr.unit[0][1];
+    L.push('| '+pr.n+' | '+pr.minQty+' | ¥'+pr.mold+' | ¥'+unit+'/套 | '+pr.lead+' | '+pr.note+' |');
+  });
+  L.push('');
+  L.push('> 数量 '+qty+' 套时的单套综合成本(含模具摊销):');
+  processTable(id,qty).forEach(r=>{
+    L.push('- '+r.n+':¥'+f1(r.per,1)+'/套'+(r.below?'(低于 MOQ,按最小批量摊)':''));
+  });
+  L.push('');
+  L.push('## 5. 零件清单(BOM 摘要)');
+  L.push('');
+  L.push('| # | 零件 | 数量 | 材质 | 工艺 | 公差 |');
+  L.push('| --- | --- | --- | --- | --- | --- |');
+  proj.parts.forEach((pt,i)=>L.push('| '+(i+1)+' | '+pt.n+' | '+pt.q+' | '+pt.mat+' | '+pt.proc+' | '+pt.tol+' |'));
+  L.push('');
+  L.push('');
+  L.push('## 5.5 自定义结构件(我方在网页端建模,需随主体一起加工)');
+  L.push('');
+  const cs=customs||[];
+  const rk=ruleKey((PROJECTS[id].processes[0]||{}).key);
+  if(!cs.length){
+    L.push('- 暂无自定义结构件;内部支撑结构按上方主参数与装配顺序推定。');
+  }else{
+    L.push('| # | 类型 | 坐标 x / y / z(mm,壳中心为原点) | 外形尺寸 | 工艺要求 |');
+    L.push('| --- | --- | --- | --- | --- |');
+    cs.forEach((s,i)=>{
+      const nm=STAGE.PRIMS[s.type]?STAGE.PRIMS[s.type].n:s.type;
+      const d=primDim(s);
+      const dim=(s.type==='cyl'||s.type==='boss'||s.type==='hole')
+        ? ('Ø'+f1(s.dia,2)+' × H'+f1(s.h,2))
+        : (f1(s.w,2)+' × '+f1(s.dd,2)+' × H'+f1(s.h,2));
+      let req='与主体同材质,去刀纹';
+      if(s.type==='rib'||s.type==='wall') req='拔模 '+(s.draft||0)+'°,壁厚 '+f1(d[1],2)+' mm,根部 R0.5';
+      else if(s.type==='boss2'||s.type==='boss25'||s.type==='boss3'){
+        const m=(s.type==='boss2'?'M2':s.type==='boss25'?'M2.5':'M3');
+        req=m+' 自攻牙:预钻 Ø'+f1(s.dd,2)+',柱径 Ø'+f1(s.dia,2)+',同轴度 ≤0.05'+(rk==='cnc'?',建议嵌铜螺母':'');
+      }
+      else if(s.type==='thru25') req='Ø'+f1(s.dia,2)+' 过孔(M2.5 螺钉),位置度 ±0.05';
+      else if(s.type==='pin3') req='Ø'+f1(s.dia,2)+' 定位销孔/销,H7 配合';
+      else if(s.type==='pad4') req='四角柱:中心距 '+f1(s.w,1)+'×'+f1(s.dd,1)+',M2.5 预钻 Ø'+f1(s.hd,2)+',与 PCB 孔位同轴 ±0.05';
+      else if(s.type==='pocket') req='铣削凹槽,内角 R≥1,深 '+f1(s.h,2)+' mm';
+      else if(s.type==='hole') req='钻孔 Ø'+f1(s.dia,2)+',位置度 ±0.05';
+      else if(s.type==='tray') req='电池仓:壁厚 0.8~1.2,底部 R0.5,留极耳缺口';
+      else if(s.type==='clip') req='卡扣:根部 R0.4,扣合量 0.3~0.5,需试插 50 次不疲劳';
+      L.push('| '+(i+1)+' | '+nm+' | '+f1(s.x,2)+' / '+f1(s.y,2)+' / '+f1(s.z,2)+' | '+dim+' | '+req+' |');
+    });
+    L.push('');
+    L.push('> 结构件已随主体一同写入 STL/OBJ;CNC 报价请按「上表坐标 + 刀具半径」评估,注塑请按壁厚/拔模评估。');
+  }
+  L.push('');
+  L.push('## 6. 装配顺序');
+  L.push('');
+  proj.steps.forEach((s,i)=>L.push((i+1)+'. **'+s.n+'**:'+s.d));
+  L.push('');
+  L.push('## 7. 交付文件(我方提供 / 需供应商确认)');
+  L.push('');
+  proj.files.forEach(f=>L.push('- [ ] '+f));
+  L.push('- [ ] 本需求单(PDF)+ STL/OBJ 预览网格');
+  L.push('- [ ] 色卡与表面处理样板');
+  L.push('');
+  L.push('## 8. 报价回填(请供应商填写)');
+  L.push('');
+  L.push('| 项目 | 供应商填写 |');
+  L.push('| --- | --- |');
+  ['模具费(含试模/改模次数)','单品单价(含税/不含税)','最小起订量 MOQ','打样费及抵扣规则','交期(打样/大货)','模具归属','包装方式与费用','有效期'].forEach(x=>L.push('| '+x+' |  |'));
+  L.push('');
+  L.push('## 9. 待确认项');
+  L.push('');
+  proj.notes.forEach(n=>L.push('- '+n));
+  L.push('- 电子件尺寸以官方规格书为准,打样前需实机复测。');
+  L.push('');
+  L.push('---');
+  L.push('本需求单由「壳体工坊」根据当前 3D 参数快照生成;价格区间为深圳/东莞 2026-11 行情参考,不构成报价承诺。');
+  return L.join('\n');
+}
+
+function bomCSV(id,params,matKey){
+  const proj=PROJECTS[id], mat=MATERIALS[matKey]||MATERIALS[proj.materials[0]];
+  const rows=[['序号','零件','数量','材质','工艺','关键尺寸/公差','备注']];
+  proj.parts.forEach((pt,i)=>{
+    rows.push([i+1,pt.n,pt.q,pt.mat==='主材质'?mat.name:pt.mat,pt.proc,pt.tol,pt.id==='screen'?'视窗透光面':''].map(v=>'"'+String(v).replace(/"/g,'""')+'"').join(','));
+  });
+  return rows.join('\n');
+}
+
+function specJSON(id,params,matKey,qty,customs){
+  return JSON.stringify({
+    app:'Pocket Shell Studio',version:'1.4',exportedAt:new Date().toISOString(),unit:'mm',
+    project:{id,name:proj_name(id),ref:PROJECTS[id].ref},
+    material:MATERIALS[matKey],
+    params:params,derived:derived(id,params),customParts:customs||[],
+    qty:qty,processes:processTable(id,qty).map(r=>({name:r.n,mold:r.mold,unit:r.unitUsed,perSet:+r.per.toFixed(2),lead:r.lead,belowMOQ:r.below})),
+    parts:PROJECTS[id].parts,assembly:PROJECTS[id].steps,tolerance:PROJECTS[id].tolerance,files:PROJECTS[id].files
+  },null,2);
+}
+function proj_name(id){ return PROJECTS[id].name; }
+
+function fitSVG(id,p){
+  const S=150;
+  let maxMm, shapes=[], texts=[];
+  const push=(s)=>shapes.push(s);
+  if(id==='round'){
+    const ro=p.D/2, bd=p.bd/2, sd=p.sd/2;
+    maxMm=p.D*1.08;
+    push({t:'c',r:ro,s:'#1f6feb',w:1.6});
+    push({t:'c',r:bd,s:'#94a3b8',w:1,dash:true});
+    push({t:'c',r:sd,s:'#0f9d58',w:1.2});
+    for(let i=0;i<4;i++){const a2=Math.PI/4+i*Math.PI/2;push({t:'d',x:Math.cos(a2)*(ro-9),y:Math.sin(a2)*(ro-9),r:2.1,s:'#b08d57'});}
+    texts.push(['Ø'+f1(p.D,2),0,-ro-4]);
+  }else if(id==='recorder'){
+    const ro=p.D/2, ri=ro-p.t;
+    maxMm=p.D*1.35;
+    push({t:'c',r:ro,s:'#1f6feb',w:1.6});
+    push({t:'c',r:ri,s:'#94a3b8',w:1,dash:true});
+    push({t:'c',r:Math.min(ro-2.5,13),s:'#0f9d58',w:1.2});
+    const micR=Math.max(4,ro*0.4);
+    for(let i=0;i<4;i++){const a2=Math.PI/4+i*Math.PI/2;push({t:'d',x:Math.cos(a2)*micR,y:Math.sin(a2)*micR,r:1.2,s:'#0a0c10'});}
+    push({t:'r',x:ro-0.4,y:0,w:2.6,h:9,s:'#dc2626',sw:1});
+    texts.push(['Ø'+f1(p.D,1),0,-ro-4],['内腔 Ø'+f1(ri,1),ri*0.72,ri*0.72]);
+  }else{
+    const ow=p.w+2*p.t, od=p.d+2*p.t;
+    maxMm=Math.max(ow,od)*1.1;
+    push({t:'r',x:0,y:0,w:ow,h:od,s:'#1f6feb',w:1.6});
+    push({t:'r',x:0,y:0,w:p.w,h:p.d,s:'#94a3b8',w:1,dash:true});
+    push({t:'r',x:0,y:0,w:Math.max(6,p.w-2.8),h:Math.max(6,p.d-2.8),s:'#0f9d58',w:1.2});
+    texts.push(['外 '+f1(ow,1)+'×'+f1(od,1),0,-od/2-4],['内腔 '+f1(p.w,1)+'×'+f1(p.d,1),0,p.d/2+3.5],['屏视窗',0,0]);
+  }
+  const k=S/maxMm, cx=100, cy=100;
+  const toX=(v)=>cx+v*k, toY=(v)=>cy-v*k;
+  const body=shapes.map(s=>{
+    if(s.t==='c') return `<circle cx="${cx}" cy="${cy}" r="${(s.r*k).toFixed(2)}" fill="none" stroke="${s.s}" stroke-width="${s.w}" ${s.dash?'stroke-dasharray="4 3"':''}/>`;
+    if(s.t==='d') return `<circle cx="${toX(s.x).toFixed(2)}" cy="${toY(s.y).toFixed(2)}" r="${(s.r*k).toFixed(2)}" fill="${s.s}"/>`;
+    return `<rect x="${toX(-s.w/2).toFixed(2)}" y="${toY(s.h/2).toFixed(2)}" width="${(s.w*k).toFixed(2)}" height="${(s.h*k).toFixed(2)}" fill="none" stroke="${s.s}" stroke-width="${s.sw||1}" ${s.dash?'stroke-dasharray="4 3"':''}/>`;
+  }).join('');
+  const labels=texts.map(t=>`<text x="${toX(t[1])}" y="${toY(t[2])}" font-size="7.5" fill="#68758a" text-anchor="middle" font-family="Noto Sans SC,sans-serif">${t[0]}</text>`).join('');
+  return `<svg viewBox="0 0 200 200" width="100%" style="max-width:300px;display:block;margin:4px auto 10px">
+    <line x1="${cx}" y1="14" x2="${cx}" y2="186" stroke="#dbe3ec" stroke-width="0.6"/>
+    <line x1="14" y1="${cy}" x2="186" y2="${cy}" stroke="#dbe3ec" stroke-width="0.6"/>
+    ${body}${labels}</svg>`;
+}
+
+function saveFile(name,text,mime){
+  const blob=new Blob([text],{type:mime||'text/plain;charset=utf-8'});
+  const url=URL.createObjectURL(blob);
+  const a=document.createElement('a');
+  a.href=url; a.download=name; document.body.appendChild(a); a.click();
+  setTimeout(()=>{ URL.revokeObjectURL(url); a.remove(); },1200);
+}
+function saveDataURL(name,dataURL){
+  const a=document.createElement('a');
+  a.href=dataURL; a.download=name; document.body.appendChild(a); a.click();
+  setTimeout(()=>a.remove(),800);
+}
+
+function toast(msg){
+  let t=document.getElementById('toast');
+  if(!t){ t=document.createElement('div'); t.id='toast'; document.body.appendChild(t); }
+  t.textContent=msg; t.classList.add('on');
+  clearTimeout(window.__toastT);
+  window.__toastT=setTimeout(()=>t.classList.remove('on'),1900);
+}
+
+const buzz=(ms)=>{ try{ if(navigator.vibrate) navigator.vibrate(ms); }catch(e){} };
+const LS={
+  get(k,d){ try{ const v=localStorage.getItem(k); return v?JSON.parse(v):d; }catch(e){ return d; } },
+  set(k,v){ try{ localStorage.setItem(k,JSON.stringify(v)); }catch(e){} }
+};
+
+/* =========================================================
+   3D 舞台组件
+   ========================================================= */
+class GlStage extends LitElement{
+  static properties={
+    project:{attribute:false}, params:{attribute:false}, material:{attribute:false},
+    explode:{attribute:false}, dims:{attribute:false}, hl:{attribute:false}, mini:{attribute:false}
+  };
+  createRenderRoot(){ return this; }
+  constructor(){ super(); this._initDone=false; this._view='iso'; }
+
+  firstUpdated(){
+    const canvas=this.querySelector('canvas');
+    const host=this.querySelector('.stage');
+    STAGE.init(canvas,host);
+    this._initDone=true;
+    STAGE.load(this.project,this.params,this.material,this.explode||0);
+    STAGE.setDims(this.dims!==false);
+    if(this.hl) STAGE.highlight(this.hl);
+  }
+  updated(ch){
+    if(!this._initDone) return;
+    if(ch.has('project')){ STAGE.load(this.project,this.params,this.material,this.explode||0); }
+    else if(ch.has('params')){ STAGE.setParams(this.params); }
+    if(ch.has('material')) STAGE.setMaterial(this.material);
+    if(ch.has('explode')) STAGE.setExplode(this.explode||0);
+    if(ch.has('dims')) STAGE.setDims(this.dims!==false);
+    if(ch.has('hl')) STAGE.highlight(this.hl);
+  }
+
+  pick(m){
+    this.dispatchEvent(new CustomEvent('mat-change',{detail:m,bubbles:true}));
+  }
+  view(v){
+    this._view=v; STAGE.setView(v);
+    this.querySelectorAll('.vbtn').forEach(b=>b.classList.toggle('on',b.dataset.v===v));
+  }
+  toggleDims(){
+    this.dispatchEvent(new CustomEvent('dims-change',{detail:!(this.dims!==false),bubbles:true}));
+  }
+  toggleExplode(){
+    const next=(this.explode||0)>0.3?0:0.85;
+    this.dispatchEvent(new CustomEvent('explode-change',{detail:next,bubbles:true}));
+  }
+
+  render(){
+    const proj=PROJECTS[this.project]||PROJECTS.silicone;
+    return html`
+    <div class="stage ${this.mini?'mini':''}">
+      <canvas></canvas>
+      <div class="stage-top">
+        <span class="badge">${proj.en}</span>
+        <span class="spacer"></span>
+        <button class="vbtn" data-v="iso" @click=${()=>this.view('iso')}>45°</button>
+        <button class="vbtn" data-v="front" @click=${()=>this.view('front')}>正视</button>
+        <button class="vbtn" data-v="top" @click=${()=>this.view('top')}>俯视</button>
+        <button class="vbtn" @click=${()=>STAGE.frame()}>适应</button>
+        <button class="vbtn ${this.dims!==false?'on':''}" @click=${()=>this.toggleDims()}>标注</button>
+        <button class="vbtn ${(this.explode||0)>0.3?'on':''}" @click=${()=>this.toggleExplode()}>爆炸</button>
+      </div>
+      ${this.mini?html`<div class="ghint">单指旋转 · 双指缩放 · 双击零件聚焦</div>`:''}
+      <div class="stage-bottom">
+        <div class="matrow">
+          ${proj.materials.map(k=>{
+            const m=MATERIALS[k];
+            return html`<div class="mat ${this.material===k?'on':''}" @click=${()=>this.pick(k)}>
+              <i style="background:${m.swatch}"></i>${m.name}</div>`;
+          })}
+        </div>
+      </div>
+    </div>`;
+  }
+}
+customElements.define('gl-stage',GlStage);
+
+/* =========================================================
+   主应用
+   ========================================================= */
+class AppRoot extends LitElement{
+  createRenderRoot(){ return this; }
+  constructor(){
+    super();
+    this.state={
+      route:'hub', project:'silicone', tab:'look',
+      params:defaultParams('silicone'),
+      material:PROJECTS.silicone.materials[0],
+      explode:0, dims:true, hl:null, qty:500,
+      proc:'sil-mold', selUid:null, snap:0.5, solo:null, dockPx:0.46, dockSnap:'half'
+    };
+  }
+
+  connectedCallback(){
+    super.connectedCallback();
+    this._onHash=()=>this.routeFromHash();
+    window.addEventListener('hashchange',this._onHash);
+    this._onViewport=()=>{
+      const vv=window.visualViewport;
+      if(!vv) return;
+      const kb=Math.max(0,Math.round(window.innerHeight-vv.height-vv.offsetTop));
+      document.documentElement.style.setProperty('--kb',(kb>40?kb:0)+'px');
+      if(this.state&&this.state.tab==='mdl'&&!this._dragStart&&kb===0) this.applyDock(this.state.dockPx,false);
+    };
+    if(window.visualViewport){
+      window.visualViewport.addEventListener('resize',this._onViewport);
+      window.visualViewport.addEventListener('scroll',this._onViewport);
+    }
+    if(typeof STAGE!=='undefined' && STAGE.onSelect){
+      STAGE.onSelect((partId)=>{
+        if(!partId){ this.state.selUid=null; this.requestUpdate(); return; }
+        if(String(partId).indexOf('c')===0&&!isNaN(parseInt(String(partId).slice(1),10))){
+          this.state.selUid=parseInt(String(partId).slice(1),10);
+          this.requestUpdate();
+          buzz(8);
+          if(this.state.tab==='mdl'){
+            if(this.dockPx()<this.dockHeights().half-20) this.snapDock('half',true);
+            this.jumpDock('#dNum');
+          }
+        }
+      });
+      STAGE.onDrag((s)=>{
+        this.persistCustom();
+        clearTimeout(this._dragT);
+        this._dragT=setTimeout(()=>this.requestUpdate(),160);
+      });
+    }
+    this.routeFromHash();
+  }
+  disconnectedCallback(){ window.removeEventListener('hashchange',this._onHash); super.disconnectedCallback(); }
+
+  routeFromHash(){
+    const h=location.hash.replace(/^#\/?/,'');
+    if(h.indexOf('p/')===0){
+      const id=h.slice(2).split('?')[0]||'silicone';
+      const pid=PROJECTS[id]?id:'silicone';
+      const q=new URLSearchParams(h.split('?')[1]||'');
+      const saved=LS.get('ss.p.'+pid,null);
+      this.state.route='project';
+      this.state.project=pid;
+      this.state.params=Object.assign(defaultParams(pid),saved&&saved.params||{});
+      const qm=q.get('mat');
+      this.state.material=(qm&&MATERIALS[qm])?qm:((saved&&saved.material)||PROJECTS[pid].materials[0]);
+      const tabs=['look','asm','mdl','elec','proc','out'];
+      this.state.tab=tabs.indexOf(q.get('tab'))>=0?q.get('tab'):'look';
+      this.state.explode=Math.min(1,Math.max(0,parseFloat(q.get('ex')||'0')||0));
+      this.state.qty=Math.max(50,Math.min(5000,parseInt(q.get('qty')||'500',10)||500));
+      this.state.hl=q.get('hl')||null;
+      this.state.selUid=null;
+      this.state.solo=null;
+      this._hist=[]; this._redo=[];
+      this.state.proc=PROJECTS[pid].processes[0].key;
+      if(typeof STAGE!=='undefined'&&STAGE.setCustom){ STAGE.setCustom(pid,LS.get('ss.custom.'+pid,[])); STAGE.setSolo(null); }
+      if(this.state.tab==='mdl'){
+        const sn=LS.get('ss.dock','half');
+        this.state.dockSnap=sn; this.state.dockPx=(this.dockHeights()[sn]||this.dockHeights().half)/(window.innerHeight||800);
+        setTimeout(()=>{ this.applyDock(this.dockPx(),false); try{ STAGE.setCutaway(true); }catch(e){} },120);
+      }
+    }else if(h.indexOf('kb')===0){
+      this.state.route='kb';
+    }else{
+      this.state.route='hub';
+    }
+    this.requestUpdate();
+    window.scrollTo(0,0);
+  }
+
+  persist(){
+    LS.set('ss.p.'+this.state.project,{params:this.state.params,material:this.state.material});
+  }
+
+  /* ---------- 底部编辑坞:三段高度 + 拖拽 ---------- */
+  dockHeights(){
+    const h=window.innerHeight||800;
+    return {peek:Math.round(h*0.20),half:Math.round(h*0.46),full:Math.round(h*0.72)};
+  }
+  dockPx(){ return Math.round(window.innerHeight*(this.state.dockPx||0.46)); }
+  applyDock(px,animate){
+    const v=Math.max(150,Math.min(Math.round(window.innerHeight*0.82),px));
+    document.documentElement.style.setProperty('--dockH',v+'px');
+    if(animate){ const el=this.querySelector('.dock'); if(el){ el.classList.add('drag'); requestAnimationFrame(()=>el.classList.remove('drag')); } }
+  }
+  snapDock(name,animate=false){
+    const hs=this.dockHeights(), px=hs[name]||hs.half;
+    this.state.dockPx=px/(window.innerHeight||800);
+    this.state.dockSnap=name;
+    LS.set('ss.dock',name);
+    this.applyDock(px,animate);
+    this.requestUpdate();
+  }
+  onGrabDown(e){
+    this._dragStart={y:e.clientY,h:this.dockPx()};
+    const el=e.currentTarget; try{ el.setPointerCapture(e.pointerId); }catch(err){}
+    const dock=this.querySelector('.dock'); if(dock) dock.classList.add('drag');
+    e.preventDefault();
+  }
+  onGrabMove(e){
+    if(!this._dragStart) return;
+    const h=this._dragStart.h+(this._dragStart.y-e.clientY);
+    this.applyDock(h,false);
+  }
+  onGrabUp(e){
+    if(!this._dragStart) return;
+    this._dragStart=null;
+    const dock=this.querySelector('.dock'); if(dock) dock.classList.remove('drag');
+    const hs=this.dockHeights(), cur=this.dockPx();
+    let best='half',bd=1e9;
+    ['peek','half','full'].forEach(k=>{ const dd=Math.abs(hs[k]-cur); if(dd<bd){ bd=dd; best=k; } });
+    this.snapDock(best,true);
+    buzz(6);
+  }
+  jumpDock(id){
+    this.updateComplete.then(()=>{
+      const body=this.querySelector('.dock .dbody'), el=this.querySelector(id);
+      if(!body||!el) return;
+      const top=el.getBoundingClientRect().top-body.getBoundingClientRect().top+body.scrollTop-8;
+      body.scrollTop=Math.max(0,top);
+    });
+  }
+  openChecks(){ this.snapDock('half',true); this.jumpDock('#chkPanel'); }
+
+
+  /* ---------- 自定义结构件操作 ---------- */
+  custom(){ return (typeof STAGE!=='undefined'&&STAGE.customList)?STAGE.customList():[]; }
+  persistCustom(){ LS.set('ss.custom.'+this.state.project,this.custom()); }
+  selSpec(){
+    const uid=this.state.selUid;
+    return this.custom().find(s=>s.uid===uid)||null;
+  }
+  addPrim(type){
+    this.pushHist();
+    if(typeof STAGE==='undefined'||!STAGE.addCustom) return;
+    const s=STAGE.addCustom(type,{snap:this.state.snap,draft:(type==='rib'||type==='wall')?1:0,owner:this.state.solo||null});
+    this.state.selUid=s.uid;
+    this.state.tab='mdl';
+    if(this.dockPx()<this.dockHeights().half-20) this.snapDock('half',true);
+    this.persistCustom();
+    this.requestUpdate();
+    buzz(10);
+    this.jumpDock('#dNum');
+  }
+  setField(uid,k,v){
+    if(!isFinite(v)) return;
+    STAGE.updateCustom(uid,{[k]:v});
+    this.persistCustom();
+    this.requestUpdate();
+  }
+  nudge(uid,k,d){
+    const s=this.custom().find(x=>x.uid===uid); if(!s) return;
+    this.setField(uid,k,Math.round(((s[k]||0)+d)*100)/100);
+  }
+  place(uid,mode){
+    const s=this.custom().find(x=>x.uid===uid); if(!s) return;
+    this.pushHist();
+    const st=this.state, p=st.params, id=st.project;
+    const cav=cavity(id,p);
+    const w=s.w!==undefined?s.w:s.dia, d=s.dd!==undefined?s.dd:s.dia;
+    const patch={};
+    if(mode==='center'){ patch.x=0; patch.z=0; }
+    if(mode==='top'){ patch.y=Math.round((cav.h/2-Math.max(0.5,s.h)/2)*10)/10; }
+    if(mode==='bottom'){ patch.y=Math.round((-cav.h/2+Math.max(0.5,s.h)/2)*10)/10; }
+    if(mode==='wall'){
+      if(cav.kind==='rect'){
+        patch.z=Math.round((p.d/2-d/2-1)*10)/10;
+        patch.x=0;
+      }else{
+        const rr=Math.max(0,cav.r-Math.max(w,d)/2-1);
+        patch.x=Math.round(rr*10)/10; patch.z=0;
+      }
+    }
+    STAGE.updateCustom(uid,patch);
+    this.persistCustom();
+    this.requestUpdate();
+  }
+  delPrim(uid){
+    this.pushHist();
+    STAGE.removeCustom(uid);
+    this.state.selUid=null;
+    this.persistCustom();
+    this.requestUpdate();
+  }
+  dupPrim(uid){
+    const s=this.custom().find(x=>x.uid===uid); if(!s) return;
+    this.pushHist();
+    const c=Object.assign({},s); delete c.uid;
+    c.x=(s.x||0)+Math.min(6,Math.max(2,(s.w||s.dia||4)*0.6));
+    const n=STAGE.addCustom(s.type,c);
+    this.state.selUid=n.uid;
+    this.persistCustom();
+    this.requestUpdate();
+  }
+  setProc(k){ this.state.proc=k; this.requestUpdate(); }
+  setSoloTarget(pid){
+    if(pid&&this.state.dockPx&&this.dockPx()<this.dockHeights().half-20) this.snapDock('half',true);
+    buzz(6);
+    this.state.solo=pid||null;
+    STAGE.setSolo(pid||null);
+    this.state.selUid=null;
+    this.requestUpdate();
+  }
+  setSnap(v){ this.state.snap=v; this.requestUpdate(); }
+  clearPrims(){ STAGE.clearCustom(); this.state.selUid=null; this.persistCustom(); this.requestUpdate(); }
+  snapshot(){ return {params:Object.assign({},this.state.params),material:this.state.material,custom:this.custom()}; }
+  pushHist(){
+    this._hist=this._hist||[]; this._redo=this._redo||[];
+    this._hist.push(JSON.stringify(this.snapshot()));
+    if(this._hist.length>40) this._hist.shift();
+    this._redo.length=0;
+  }
+  applySnap(js){
+    const o=JSON.parse(js);
+    this.state.params=o.params||this.state.params;
+    this.state.material=o.material||this.state.material;
+    this.state.selUid=null;
+    STAGE.setCustom(this.state.project,o.custom||[]);
+    STAGE.setParams(this.state.params);
+    STAGE.setMaterial(this.state.material);
+    this.persist(); this.persistCustom();
+    this.requestUpdate();
+  }
+  undo(){
+    if(!this._hist||!this._hist.length) return;
+    this._redo=this._redo||[];
+    this._redo.push(JSON.stringify(this.snapshot()));
+    this.applySnap(this._hist.pop());
+  }
+  redo(){
+    if(!this._redo||!this._redo.length) return;
+    this._hist=this._hist||[];
+    this._hist.push(JSON.stringify(this.snapshot()));
+    this.applySnap(this._redo.pop());
+  }
+  canUndo(){ return !!(this._hist&&this._hist.length); }
+  canRedo(){ return !!(this._redo&&this._redo.length); }
+  arrayRing(uid,count){
+    const s=this.custom().find(x=>x.uid===uid); if(!s) return;
+    this.pushHist();
+    const cav=cavity(this.state.project,this.state.params);
+    let r=Math.hypot(s.x||0,s.z||0);
+    if(r<1) r=Math.max(4,(cav.kind==='cyl'?cav.r:Math.min(cav.w,cav.d)/2)*0.68);
+    const a0=Math.atan2(s.z||0,s.x||0);
+    for(let i=1;i<count;i++){
+      const a=a0+i*Math.PI*2/count;
+      const patch=Object.assign({},s); delete patch.uid;
+      patch.x=Math.round(r*Math.cos(a)*10)/10;
+      patch.z=Math.round(r*Math.sin(a)*10)/10;
+      patch.rot=((s.rot||0)+i*360/count)%360;
+      STAGE.addCustom(s.type,patch);
+    }
+    this.persistCustom(); this.requestUpdate();
+  }
+  savePartSTL(pid,label){
+    const r=STAGE.exportSTLPart(this.baseName()+'-'+String(label).replace(/[^\u4e00-\u9fa5A-Za-z0-9]/g,''),pid);
+    if(!r) return alert('该零件暂无可导出网格');
+    saveFile(this.baseName()+'-'+String(label).replace(/[^\u4e00-\u9fa5A-Za-z0-9]/g,'')+'.stl',r.text,'model/stl');
+  }
+  dismissTip(){ LS.set('ss.tips.mdl',true); this.requestUpdate(); }
+
+  go(hash){ location.hash=hash; }
+
+  onParam(k,e){
+    const v=parseFloat(e.target.value);
+    const def=getParamDefs(this.state.project).find(x=>x.k===k)||{min:0,max:1};
+    this.state.params[k]=v;
+    e.target.style.setProperty('--p',((v-def.min)/(def.max-def.min)*100)+'%');
+    const num=e.target.closest('.slider').querySelector('.sv');
+    if(num&&document.activeElement!==num) num.value=String(v);
+    this.previewParams();
+  }
+  /* 拖动滑块时 60fps 内只重建一次,手机上不卡 */
+  previewParams(){
+    this._pend=Object.assign({},this.state.params);
+    if(this._raf) return;
+    this._raf=requestAnimationFrame(()=>{
+      this._raf=0;
+      STAGE.setParams(this._pend);
+      this.refreshDerived();
+    });
+    clearTimeout(this._pt);
+    this._pt=setTimeout(()=>this.persist(),260);
+  }
+  onParamNum(k,e){
+    const def=getParamDefs(this.state.project).find(x=>x.k===k)||{min:0,max:1};
+    let v=parseFloat(e.target.value);
+    if(!isFinite(v)){ e.target.value=String(this.state.params[k]); return; }
+    v=Math.min(def.max,Math.max(def.min,v));
+    e.target.value=String(v);
+    this.state.params[k]=v;
+    if(this._raf){ cancelAnimationFrame(this._raf); this._raf=0; }
+    STAGE.setParams(this.state.params);
+    this.refreshDerived(); this.persist(); this.requestUpdate();
+    buzz(4);
+  }
+
+  refreshDerived(){
+    const el=this.querySelector('#derived');
+    if(!el) return;
+    el.innerHTML=derived(this.state.project,this.state.params)
+      .map(d=>`<dt>${d[0]}</dt><dd>${d[1]}</dd>`).join('');
+  }
+
+  setTab(t){
+    this.state.tab=t; this.state.hl=null;
+    if(this.state.solo){ this.state.solo=null; STAGE.setSolo(null); }
+    STAGE.highlight(null);
+    if(t==='asm'&&this.state.explode<0.2){ this.state.explode=0.85; STAGE.setExplode(0.85); }
+    if(t==='mdl'){ STAGE.setCutaway(true); this.applyDock(this.dockPx(),false); }
+    else if(t!=='asm') STAGE.setCutaway(false);
+    this.requestUpdate();
+  }
+
+  onMat(e){ this.state.material=e.detail; this.persist(); this.requestUpdate(); }
+  onDims(e){ this.state.dims=e.detail; this.requestUpdate(); }
+  onExplode(e){ this.state.explode=e.detail; this.requestUpdate(); }
+
+  /* ---------- 渲染:首页 ---------- */
+  renderHub(){
+    return html`
+    <div class="wrap">
+      <div class="hero">
+        <div class="kicker">POCKET SHELL STUDIO</div>
+        <h2>壳体工坊<br>手机里的轻量 3D 外壳工程台</h2>
+        <p>Lit + Babylon.js 纯网页参数化建模:改尺寸、换材质、加筋/柱/槽、隔离单件编辑、看爆炸装配,导 STL/OBJ 与生产需求单。不用装 CAD。</p>
+        <div class="stats">
+          <div class="stat"><b>3</b><span>壳体项目</span></div>
+          <div class="stat"><b>7</b><span>工艺路线</b></span></div>
+          <div class="stat"><b>6</b><span>基础形体</b></div>
+        </div>
+      </div>
+
+      <div class="sec"><h3>我的壳体项目</h3><span>点进去即操作台</span></div>
+      ${Object.keys(PROJECTS).map(id=>this.renderCard(id))}
+
+      <div class="sec"><h3>能力与资料</h3><span>项目外挂</span></div>
+      <div class="mini">
+        <div class="minicard" @click=${()=>this.go('#/kb')}>
+          <b>工艺知识库</b><span>工艺/MOQ/文件格式/DFM/报价口径,全部可回看</span>
+          <span class="n">6 篇 · 含对比表 →</span>
+        </div>
+        <div class="minicard" @click=${()=>this.go('#/kb')}>
+          <b>电子件库</b><span>微雪 1.85B、ESP32-S3、麦/功放/电芯选型与尺寸</span>
+          <span class="n">7 个模组 · 尺寸对照 →</span>
+        </div>
+        <div class="minicard" @click=${()=>this.go('#/p/recorder')}>
+          <b>爆炸装配</b><span>单操作台切换外观 / 结构 / 爆炸 / 导出</span>
+          <span class="n">爆炸 + 单件隔离 →</span>
+        </div>
+        <div class="minicard" @click=${()=>this.go('#/kb')}>
+          <b>参考文章</b><span>公众号原文归档入口(可粘贴补录全文)</span>
+          <span class="n">2 条参考 →</span>
+        </div>
+      </div>
+
+      <div class="foot">参数与报价为前期调研口径,非供应商正式报价。<br>所有 3D 均在浏览器实时生成,未调用外部模型文件。</div>
+    </div>`;
+  }
+
+  renderCard(id){
+    const p=PROJECTS[id];
+    const cls=id==='silicone'?'sq':(id==='recorder'?'puck':'disc');
+    const dims=id==='silicone'?'41 / 45 mm · 硅胶'
+      :id==='recorder'?'Ø32 × 11.5 · ABS'
+      :'Ø61.6 × 14.6 · 铝';
+    return html`
+    <div class="pcard" @click=${()=>this.go('#/p/'+id)}>
+      <div class="row">
+        <div class="thumb">
+          <div class="shape ${cls}">${cls==='disc'?html`<i></i>`:''}</div>
+          <span class="lbl">${id==='silicone'?'SILICONE':(id==='recorder'?'PUCK':'ROUND')}</span>
+        </div>
+        <div class="pinfo">
+          <h4>${p.name}</h4>
+          <div class="dims">${dims}</div>
+          <div class="tagrow">
+            ${p.tags.map(t=>html`<span class="tag ${t.indexOf('MOQ')>=0?'b':''}">${t}</span>`)}
+          </div>
+          <div class="enter">进入操作台 <span class="arw">→</span></div>
+        </div>
+      </div>
+    </div>`;
+  }
+
+  /* ---------- 渲染:项目页 ---------- */
+  renderProject(){
+    const st=this.state, proj=PROJECTS[st.project];
+    const tabs=[['look','3D 外观'],['asm','结构与爆炸'],['mdl','建模'],['elec','电子件'],['proc','工艺报价'],['out','导出']];
+    return html`
+    <div class="topbar"><div class="inner">
+      <button class="iconbtn" @click=${()=>this.go('#/')}>←</button>
+      <div class="tt"><h1>${proj.name}</h1><p>${proj.ref}</p></div>
+      <span class="pill">${f1(st.params[proj.params[0].k],1)} mm</span>
+    </div></div>
+
+    <div class="wrap" style="padding-bottom:120px">
+      <div class="tabs">
+        ${tabs.map(([k,n])=>html`<div class="tab ${st.tab===k?'on':''}" @click=${()=>this.setTab(k)}>${n}</div>`)}
+      </div>
+      <gl-stage .project=${st.project} .params=${st.params} .material=${st.material} .mini=${st.tab==='mdl'}
+        .explode=${st.explode} .dims=${st.dims} .hl=${st.hl}
+        @mat-change=${e=>this.onMat(e)} @dims-change=${e=>this.onDims(e)} @explode-change=${e=>this.onExplode(e)}>
+      </gl-stage>
+
+      ${st.tab==='look'?this.renderLook():''}
+      ${st.tab==='asm'?this.renderAsm():''}
+      ${st.tab==='mdl'?this.renderModel():''}
+      ${st.tab==='elec'?this.renderElec():''}
+      ${st.tab==='proc'?this.renderProc():''}
+      ${st.tab==='out'?this.renderOut():''}
+    </div>
+
+    ${st.tab==='mdl'?this.renderDock():html`
+    <div class="bottom">
+      <button class="btn" @click=${()=>this.savePNG()}>截图</button>
+      <button class="btn" @click=${()=>this.saveSTL()}>STL</button>
+      <button class="btn pri" @click=${()=>this.saveSpec()}>需求单</button>
+    </div>`}`;
+  }
+
+  toggleDock(){ this.state.dockFold=!this.state.dockFold; this.requestUpdate(); }
+
+  renderDock(){
+    const st=this.state, proj=PROJECTS[st.project], list=this.custom();
+    const sel=list.find(s=>s.uid===st.selUid)||null;
+    const rk=ruleKey(st.proc), rule=RULES[rk];
+    const checks=modelChecks(st.project,st.params,list,rk);
+    const bad=checks.filter(c=>!c.ok).length;
+    const isCyl=!!sel&&CYL_TYPES.indexOf(sel.type)>=0;
+    const isPad=!!sel&&sel.type==='pad4';
+    const isRect=!!sel&&RECT_TYPES.indexOf(sel.type)>=0;
+    const isHollow=!!sel&&HOLLOW_TYPES.indexOf(sel.type)>=0;
+    const firstK=proj.params[0].k;
+    const geo=proj.params.filter(p=>p.k==='t'||p.group==='CNC 工艺'||(!sel&&p.k===firstK));
+    const geoTitle=(st.project==='round')?'工艺弧面':'工艺与主体';
+    const procName=({'cnc-alu':'CNC 铝','cnc-abs':'CNC ABS','die-cast':'压铸','abs-mold':'注塑','sil-mold':'硅胶','vacuum':'复模'}[st.proc])||rule.name;
+
+    if(st.dockFold) return html`
+      <div class="dock fold">
+        <div class="dhead" @click=${()=>this.toggleDock()}>
+          <b>${sel?STAGE.PRIMS[sel.type].n+' #'+sel.uid:(st.solo?'隔离 · '+this.soloName(st.solo):'编辑坞')}</b>
+          <span class="em">${bad?bad+' 项待改':'校验通过'}</span>
+          <div class="tools"><button class="x" @click=${e=>{e.stopPropagation();this.toggleDock();}}>展开编辑</button></div>
+        </div>
+      </div>`;
+
+    return html`
+    <div class="dock">
+      <div class="grab" @pointerdown=${e=>this.onGrabDown(e)} @pointermove=${e=>this.onGrabMove(e)}
+        @pointerup=${e=>this.onGrabUp(e)} @pointercancel=${e=>this.onGrabUp(e)}><i></i></div>
+      <div class="dhead">
+        <div><b>${sel?STAGE.PRIMS[sel.type].n+' #'+sel.uid:(st.solo?'单件隔离 · '+this.soloName(st.solo):'编辑坞')}</b>
+        <span class="em">${procName}${bad?' · '+bad+' 项待改':''}</span></div>
+        <div class="tools">
+          <button class="hbt" ?disabled=${!this.canUndo()} @click=${()=>{ this.undo(); buzz(6); }}>↶</button>
+          <button class="hbt" ?disabled=${!this.canRedo()} @click=${()=>{ this.redo(); buzz(6); }}>↷</button>
+          <button class="x" @click=${()=>this.snapDock('peek',true)}>收起</button>
+        </div>
+      </div>
+      <div class="dnav">
+        <button @click=${()=>{ this.snapDock('half',true); this.jumpDock('#dTargets'); }}>选件</button>
+        <button @click=${()=>{ this.snapDock('half',true); this.jumpDock('#dNum'); }}>数值</button>
+        <button @click=${()=>{ this.snapDock('half',true); this.jumpDock('#dLib'); }}>形体库</button>
+        <button @click=${()=>this.openChecks()}>校验${bad?' · '+bad:''}</button>
+        <button @click=${()=>{ this.snapDock('full',true); buzz(6); }}>全屏</button>
+        <button @click=${()=>this.setTab('out')}>导出</button>
+      </div>
+      <div class="dbody">
+        <div class="chips" id="dTargets">
+          <button class="chip ${!st.solo?'on':''}" @click=${()=>this.setSoloTarget(null)}>整体</button>
+          ${proj.parts.filter(pt=>['pcb','cell','side','mic'].indexOf(pt.id)<0).map(pt=>html`
+            <button class="chip ${st.solo===pt.id?'on':''}" @click=${()=>this.setSoloTarget(pt.id)}>${pt.n.split('(')[0]}</button>`)}
+          ${list.map(s=>html`<button class="chip ${st.solo===('c'+s.uid)?'on':''}" @click=${()=>this.setSoloTarget('c'+s.uid)}>${STAGE.PRIMS[s.type].n}#${s.uid}</button>`)}
+        </div>
+
+        ${sel?html`
+          <div class="dsec" id="dNum">数值 <em>吸附 ${st.snap} mm · 点数字可直接输入</em></div>
+          <div class="nrows">
+            ${this.numRow(sel,'x','X 位置')}
+            ${this.numRow(sel,'z','Z 位置')}
+            ${this.numRow(sel,'y','Y 高度')}
+            ${isCyl||isPad?this.numRow(sel,'dia','柱/孔外径',0.2):''}
+            ${isHollow?this.numRow(sel,'dd','预钻孔 Ø',0.1):''}
+            ${isPad?html`${this.numRow(sel,'w','X 向间距')}${this.numRow(sel,'dd','Z 向间距')}${this.numRow(sel,'hd','内孔 Ø',0.1)}`:''}
+            ${isRect?html`${this.numRow(sel,'w','长度')}${this.numRow(sel,'dd','厚度')}`:''}
+            ${this.numRow(sel,'h','高度',0.2)}
+            ${sel.type==='rib'||sel.type==='wall'?this.numRow(sel,'draft','拔模角(°)',0.5):''}
+            ${this.numRow(sel,'rot','绕 Y 转 °',5)}
+          </div>
+          <div class="btnrow">
+            <button class="btn" @click=${()=>this.place(sel.uid,'center')}>居中</button>
+            <button class="btn" @click=${()=>this.place(sel.uid,'wall')}>贴内壁</button>
+            <button class="btn" @click=${()=>this.place(sel.uid,'top')}>贴顶</button>
+            <button class="btn" @click=${()=>this.place(sel.uid,'bottom')}>贴底</button>
+          </div>
+          <div class="btnrow">
+            <button class="btn" @click=${()=>this.arrayRing(sel.uid,4)}>阵列 ×4</button>
+            <button class="btn" @click=${()=>this.arrayRing(sel.uid,6)}>×6</button>
+            <button class="btn" @click=${()=>this.arrayRing(sel.uid,8)}>×8</button>
+            <button class="btn" @click=${()=>this.dupPrim(sel.uid)}>复制</button>
+            <button class="btn" @click=${()=>this.delPrim(sel.uid)}>删除</button>
+          </div>
+          <div class="hint">距内壁 ${f1(clearanceTo(st.project,st.params,sel),1)} mm · ${STAGE.PRIMS[sel.type].n}${HOLLOW_TYPES.indexOf(sel.type)>=0?' 预钻孔已按标准给':''}</div>
+        `:html`
+          <div class="dsec">开始建模 <em>点下面任一个,直接加到壳里</em></div>
+          <div class="hint" style="margin:0 0 4px">建议先加一根「加强筋」看内壁,再加「螺丝柱 M2.5」定位主板。</div>`}
+
+        <div class="dsec" id="dLib">形体库 <em>标准件按规格预置</em></div>
+        <div class="prow">
+          ${Object.keys(STAGE.PRIMS).map(k=>html`
+            <button class="pco ${sel&&sel.type===k?'hot':''}" @click=${()=>this.addPrim(k)}>
+              <b>${STAGE.PRIMS[k].n}</b><span>${primSpecText(k)}</span>
+            </button>`)}
+        </div>
+
+        <details class="acc" id="dGeo" style="margin-top:8px">
+          <summary><span class="ix">G</span>${geoTitle}<span class="chev">▾</span></summary>
+          <div class="body">
+            ${geo.map(g=>html`
+              <div class="slider">
+                <div class="lab"><span>${g.n}</span>
+                  <input class="sv" type="number" inputmode="decimal" min=${g.min} max=${g.max} step=${g.step}
+                    .value=${String(st.params[g.k])} @change=${e=>this.onParamNum(g.k,e)}></div>
+                <input type="range" min=${g.min} max=${g.max} step=${g.step} .value=${String(st.params[g.k])}
+                  style="--p:${(st.params[g.k]-g.min)/(g.max-g.min)*100}%"
+                  @input=${e=>this.onParam(g.k,e)}>
+              </div>`)}
+            <div class="btnrow" style="align-items:center">
+              <span class="hint" style="margin:0">吸附</span>
+              ${[0.5,1,5].map(v=>html`<button class="chip ${st.snap===v?'on':''}" @click=${()=>this.setSnap(v)}>${v} mm</button>`)}
+            </div>
+            <div class="hint">${st.project==='round'?'三个弧面参数直接写进需求单,CNC 按它编程;数值变化时网格自动夹到不干涉的安全范围。':'壁厚与主尺寸改完,校验与报价同步重算。'}</div>
+          </div>
+        </details>
+
+        <details class="acc" id="dProc">
+          <summary><span class="ix">C</span>工艺约束 · ${rule.name}<em>${bad?bad+' 项需改':'通过'}</em><span class="chev">▾</span></summary>
+          <div class="body">
+            <div class="chips" style="flex-wrap:wrap">
+              ${proj.processes.map(pr=>html`<button class="chip ${st.proc===pr.key?'on':''}"
+                @click=${()=>this.setProc(pr.key)}>${({'cnc-alu':'CNC 铝','cnc-abs':'CNC ABS','die-cast':'压铸','abs-mold':'注塑','sil-mold':'硅胶','vacuum':'复模'}[pr.key])||pr.n}</button>`)}
+            </div>
+            <table class="tbl"><tbody>
+              ${rule.items.map(r=>html`<tr><td style="white-space:nowrap">${r[0]}</td><td style="text-align:left">${r[1]}</td></tr>`)}
+            </tbody></table>
+            <div class="hint">${rk==='cnc'?'CNC:结构件必须给坐标 + 刀具半径,内角 R 不得小于刀径一半。':'注塑/硅胶:壁厚、拔模、筋厚是硬约束。'}</div>
+          </div>
+        </details>
+
+        <details class="acc">
+          <summary><span class="ix">P</span>主体参数(全部外形)<span class="chev">▾</span></summary>
+          <div class="body">
+            ${proj.params.map(p=>html`
+              <div class="slider">
+                <div class="lab"><span>${p.n} <em style="font-style:normal;color:#9aa7ba">${p.group||''}</em></span>
+                  <input class="sv" type="number" inputmode="decimal" min=${p.min} max=${p.max} step=${p.step}
+                    .value=${String(st.params[p.k])} @change=${e=>this.onParamNum(p.k,e)}></div>
+                <input type="range" min=${p.min} max=${p.max} step=${p.step} .value=${String(st.params[p.k])}
+                  style="--p:${(st.params[p.k]-p.min)/(p.max-p.min)*100}%"
+                  @input=${e=>this.onParam(p.k,e)}>
+              </div>`)}
+            <div class="btnrow">
+              <button class="btn" @click=${()=>this.resetParams()}>恢复默认外形</button>
+              <button class="btn" @click=${()=>{ this.pushHist(); STAGE.clearCustom(); this.state.selUid=null; this.persistCustom(); this.requestUpdate(); }}>清空结构件</button>
+            </div>
+          </div>
+        </details>
+
+        <div class="panel" id="chkPanel" style="margin-top:10px">
+          <h5>模型校验 <em>${bad?bad+' 项需改':'全部通过'}</em></h5>
+          ${checks.map(c=>html`<div class="chk ${c.ok?'ok':'bad'}"><i>${c.ok?'✓':'!'}</i><span>${c.t}</span></div>`)}
+        </div>
+
+        <div class="panel" id="dList">
+          <h5>结构件清单 <em>${list.length} 件</em></h5>
+          ${list.length?list.map(s=>{
+            const dim=(CYL_TYPES.indexOf(s.type)>=0)
+              ?('Ø'+f1(s.dia,1)+' × H'+f1(s.h,1))
+              :(f1(s.w,1)+'×'+f1(s.dd,1)+'×H'+f1(s.h,1));
+            return html`<div class="pr ${st.selUid===s.uid?'on':''}" @click=${()=>{ this.state.selUid=s.uid; STAGE.highlight('c'+s.uid); this.requestUpdate(); this.jumpDock('#dNum'); }}>
+              <div><b>${STAGE.PRIMS[s.type].n}</b><span>${dim} · x ${f1(s.x,1)} / y ${f1(s.y,1)} / z ${f1(s.z,1)}</span></div>
+              <button class="del" @click=${e=>{ e.stopPropagation(); this.delPrim(s.uid); }}>删</button>
+            </div>`;}):html`<div class="hint">还没有结构件。</div>`}
+        </div>
+
+        <div class="hint" style="margin-top:10px">单指旋转 · 双指缩放/平移 · 双击零件聚焦;把手上下拖可改面板高度(≤20% 看整图)。</div>
+      </div>
+    </div>`;
+  }
+
+  renderLook(){
+    const st=this.state, proj=PROJECTS[st.project];
+    return html`
+    <div class="panel">
+      <h5>参数化外形 <em>拖动即重算曲面</em></h5>
+      ${proj.params.map(p=>html`
+        <div class="slider">
+          <div class="lab"><span>${p.n} <em style="font-style:normal;color:#9aa7ba">${p.group||''}</em></span><input class="sv" type="number" inputmode="decimal" min=${p.min} max=${p.max} step=${p.step}
+              .value=${String(st.params[p.k])} @change=${e=>this.onParamNum(p.k,e)}></div>
+          <input type="range" min=${p.min} max=${p.max} step=${p.step} .value=${String(st.params[p.k])}
+            style="--p:${(st.params[p.k]-p.min)/(p.max-p.min)*100}%"
+            @input=${e=>this.onParam(p.k,e)}>
+        </div>`)}
+      <div class="hint">数值为外形定义尺寸;修改后 3D 网格、标注、爆炸图、导出文件全部同步。</div>
+      <div class="btnrow">
+        <button class="btn" @click=${()=>this.resetParams()}>恢复默认</button>
+        <button class="btn" @click=${()=>STAGE.setView('iso')}>回到 45°</button>
+      </div>
+    </div>
+
+    <div class="panel">
+      <h5>派生尺寸 <em>实时</em></h5>
+      <dl class="kv" id="derived">
+        ${derived(st.project,st.params).map(d=>html`<dt>${d[0]}</dt><dd>${d[1]}</dd>`)}
+      </dl>
+    </div>
+
+    <div class="panel">
+      <h5>材质与表面 <em>点选即换 PBR 材质</em></h5>
+      <div class="btnrow">
+        ${proj.materials.map(k=>html`<button class="btn ${st.material===k?'dark':''}"
+          @click=${()=>{ this.state.material=k; STAGE.setMaterial(k); this.persist(); this.requestUpdate(); }}>${MATERIALS[k].name}</button>`)}
+      </div>
+      <div class="hint">${MATERIALS[st.material]?(MATERIALS[st.material].note||'渲染为近似 PBR,实际以样板为准'):''}</div>
+    </div>`;
+  }
+
+  renderAsm(){
+    const st=this.state, proj=PROJECTS[st.project];
+    return html`
+    <div class="panel">
+      <h5>爆炸图 <em>拖动滑块分离零件</em></h5>
+      <div class="slider">
+        <div class="lab"><span>拆解程度</span><b>${Math.round(st.explode*100)}%</b></div>
+        <input type="range" min="0" max="1" step="0.05" .value=${String(st.explode)}
+          style="--p:${st.explode*100}%"
+          @input=${e=>{ this.state.explode=parseFloat(e.target.value); STAGE.setExplode(this.state.explode);
+            e.target.closest('.slider').querySelector('b').textContent=Math.round(this.state.explode*100)+'%';
+            this.querySelectorAll('.pitem').forEach(x=>x.classList.toggle('on',false)); }}>
+      </div>
+      <div class="btnrow">
+        <button class="btn ${st.explode>0.3?'pri':''}" @click=${()=>{ this.state.explode=0.9; STAGE.setExplode(0.9); this.requestUpdate(); }}>一键爆炸</button>
+        <button class="btn" @click=${()=>{ this.state.explode=0; STAGE.setExplode(0); this.requestUpdate(); }}>合模复位</button>
+        <button class="btn" @click=${()=>{ const on=!STAGE.isCutaway(); STAGE.setCutaway(on); this.requestUpdate(); }}>${STAGE.isCutaway()?'恢复实心':'透视外壳'}</button>
+      </div>
+      <div class="hint">壳体是闭合件,内部结构默认被外壳挡住;爆炸超过 20% 时外壳自动半透明,才能看到电芯/主板/铜柱的相对位置。</div>
+    </div>
+
+    <div class="panel">
+      <h5>零件清单 <em>点选高亮</em></h5>
+      <div class="parts">
+        ${proj.parts.map(pt=>html`
+          <div class="pr pitem ${st.hl===pt.id?'on':''}"
+            @click=${()=>{ this.state.hl=(st.hl===pt.id?null:pt.id); STAGE.highlight(this.state.hl); this.requestUpdate(); }}
+            style=${st.hl===pt.id?'background:#eef4fe':''}>
+            <span>${pt.n}</span><em>${pt.q} 件 · ${pt.proc}</em>
+          </div>`)}
+      </div>
+    </div>
+
+    <div class="panel">
+      <h5>装配顺序 <em>${proj.steps.length} 步</em></h5>
+      ${proj.steps.map((s,i)=>html`
+        <div class="steprow">
+          <div class="stepno">${i+1}</div>
+          <div><b>${s.n}</b><span>${s.d}</span></div>
+        </div>`)}
+    </div>`;
+  }
+
+  soloName(pid){
+    const proj=PROJECTS[this.state.project];
+    if(String(pid)[0]==='c'){ const s=this.custom().find(x=>'c'+x.uid===pid); return s?(STAGE.PRIMS[s.type].n+' #'+s.uid):pid; }
+    const pt=proj.parts.find(x=>x.id===pid);
+    return pt?pt.n:pid;
+  }
+
+  procLabel(k){
+    const r=ruleKey(k);
+    return r==='injection'?'注塑':(r==='silicone'?'硅胶':(r==='cnc'?'CNC':(r==='vac'?'复模':'压铸')));
+  }
+
+  numRow(s,key,label,step){
+    const st=(key==='h'||key==='dia')?0.2:(this.state.snap||0.5);
+    return html`<div class="nrow">
+      <span class="nl">${label}</span>
+      <button class="nb" @click=${()=>this.nudge(s.uid,key,-step)}>−</button>
+      <input class="ni" type="number" step=${String(step)} .value=${String(s[key]!==undefined?s[key]:0)}
+        @change=${e=>this.setField(s.uid,key,parseFloat(e.target.value))}>
+      <button class="nb" @click=${()=>this.nudge(s.uid,key,step)}>+</button>
+      <em>mm</em>
+    </div>`;
+  }
+
+  renderModel(){ return html`<div style="height:2px"></div>`; }
+
+  renderElec(){
+    const st=this.state;
+    const list=BOARDS.filter(b=>b.fit===st.project||b.id==='esp32s3'&&st.project==='recorder');
+    const rows=fitRows(st.project,st.params);
+    return html`
+    <div class="panel">
+      <h5>尺寸对照 <em>俯视 · mm</em></h5>
+      <div .innerHTML=${fitSVG(st.project,st.params)}></div>
+      <table class="tbl" style="margin-top:2px"><tbody>
+        ${(st.project==='round'?[
+          ['外形','Ø'+f1(st.params.D,2)+' mm'],['黑边开口','Ø'+f1(st.params.bd,1)+' mm'],
+          ['屏可视','Ø'+f1(st.params.sd,2)+' mm'],['主板','Ø44 mm'],['铜柱','4 × M2']]:[]).map(r=>html`<tr><td>${r[0]}</td><td class="num">${r[1]}</td></tr>`)}
+        ${(st.project==='recorder'?[
+          ['外形','Ø'+f1(st.params.D,1)+' mm'],['内腔','Ø'+f1(st.params.D-2*st.params.t,1)+' mm'],
+          ['主控板建议','Ø'+f1(Math.min(st.params.D-2*st.params.t-4,26),0)+' mm'],['电芯','402030 · 4×20×30'],
+          ['麦孔','4 × Ø1.0']]:[]).map(r=>html`<tr><td>${r[0]}</td><td class="num">${r[1]}</td></tr>`)}
+        ${(st.project==='silicone'?[
+          ['外形',''+f1(st.params.w+2*st.params.t,1)+' × '+f1(st.params.d+2*st.params.t,1)+' mm'],
+          ['内腔',''+f1(st.params.w,1)+' × '+f1(st.params.d,1)+' mm'],['屏视窗',''+f1(Math.max(6,st.params.w-2.8),1)+' × '+f1(Math.max(6,st.params.d-2.8),1)+' mm'],
+          ['表体','41.3 × 41.3(实机复测)']]:[]).map(r=>html`<tr><td>${r[0]}</td><td class="num">${r[1]}</td></tr>`)}
+      </tbody></table>
+      <div class="hint" style="display:flex;gap:10px;flex-wrap:wrap">
+        <span><i style="display:inline-block;width:12px;height:2px;background:#1f6feb;vertical-align:middle"></i> 外形</span>
+        <span><i style="display:inline-block;width:12px;height:2px;background:#94a3b8;vertical-align:middle"></i> 内腔</span>
+        <span><i style="display:inline-block;width:12px;height:2px;background:#0f9d58;vertical-align:middle"></i> 屏幕/主板</span>
+        <span><i style="display:inline-block;width:8px;height:8px;border-radius:50%;background:#b08d57;vertical-align:middle"></i> 铜柱</span>
+      </div>
+    </div>
+    <div class="panel">
+      <h5>空间校验 <em>壳体 vs 电子件</em></h5>
+      <div class="scrollx"><table class="tbl">
+        <thead><tr><th>校验项</th><th>结论</th></tr></thead>
+        <tbody>${rows.map(r=>html`<tr><td>${r[0]}</td><td>${r[1]}</td></tr>`)}</tbody>
+      </table></div>
+      <div class="hint">校验基于当前参数快照与公开规格;打样前请以官方图纸与实机复测。</div>
+    </div>
+    <div class="panel">
+      <h5>可选电子模组 <em>成熟开发板优先</em></h5>
+      ${list.map(b=>html`
+        <div class="board">
+          <div class="bv"><i></i></div>
+          <div class="bi">
+            <b>${b.name}</b>
+            <span>${b.od} · ${b.screen}</span>
+            <span>${b.iface}</span>
+            <span class="bd">${b.tag}</span>
+            <dl class="kv">
+              <dt>主控</dt><dd>${b.soc}</dd>
+              <dt>板载</dt><dd style="text-align:left">${b.extra}</dd>
+              <dt>参考价</dt><dd>${b.price}</dd>
+            </dl>
+            <div class="hint">${b.note}</div>
+          </div>
+        </div>`)}
+      <div class="hint">来源:${list.map(b=>b.source).join(' / ')}</div>
+    </div>
+    <div class="panel">
+      <h5>选型原则 <em>不打 PCB</em></h5>
+      ${KB.find(k=>k.id==='elec').body.map(item=>{
+        if(item[0]==='ul') return html`<ul style="font-size:12px;padding-left:18px;color:#31425a;line-height:1.7">${item[1].map(x=>html`<li>${x}</li>`)}</ul>`;
+        if(item[0]==='p') return html`<div class="hint">${item[1]}</div>`;
+        if(item[0]==='note') return html`<div class="note">${item[1]}</div>`;
+        return '';
+      })}
+    </div>`;
+  }
+
+  renderProc(){
+    const st=this.state, proj=PROJECTS[st.project];
+    const rows=processTable(st.project,st.qty);
+    return html`
+    <div class="panel">
+      <h5>批量与单套成本 <em>含模具摊销</em></h5>
+      <div class="slider">
+        <div class="lab"><span>下单数量</span><b>${st.qty} 套</b></div>
+        <input type="range" min="50" max="5000" step="50" .value=${String(st.qty)}
+          style="--p:${(st.qty-50)/4950*100}%"
+          @input=${e=>{ this.state.qty=parseInt(e.target.value,10);
+            e.target.closest('.slider').querySelector('b').textContent=this.state.qty+' 套';
+            const t=this.querySelector('#proctable'); if(t) t.innerHTML=this.procRowsHTML(); }}>
+      </div>
+      <div class="scrollx"><table class="tbl">
+        <thead><tr><th>工艺</th><th class="num">单价</th><th class="num">模具/一次性</th><th class="num">单套综合</th><th>交期</th></tr></thead>
+        <tbody id="proctable" .innerHTML=${this.procRowsHTML()}></tbody>
+      </table></div>
+      <div class="hint">综合 =(一次性费用 + 单价×数量)/ 数量。低于 MOQ 时按最小批量摊,实际会被拒单或加价。</div>
+    </div>
+
+    <div class="panel">
+      <h5>工艺提示 <em>来自前期询价</em></h5>
+      ${proj.notes.map(n=>html`<div class="note">${n}</div>`)}
+    </div>
+
+    <div class="panel">
+      <h5>公差表</h5>
+      <table class="tbl"><tbody>
+        ${proj.tolerance.map(t=>html`<tr><td>${t[0]}</td><td class="num">${t[1]}</td></tr>`)}
+      </tbody></table>
+    </div>`;
+  }
+
+  procRowsHTML(){
+    const rows=processTable(this.state.project,this.state.qty);
+    return rows.map(r=>`<tr>
+      <td>${r.n}${r.below?'<br><span style="color:#d97706;font-size:10px">低于MOQ</span>':''}</td>
+      <td class="num">¥${f1(r.unitUsed,1)}</td>
+      <td class="num">¥${r.mold}</td>
+      <td class="num"><b>¥${f1(r.per,1)}</b></td>
+      <td>${r.lead}</td></tr>`).join('');
+  }
+
+  renderOut(){
+    const st=this.state, proj=PROJECTS[st.project];
+    return html`
+    <div class="panel">
+      <h5>导出 <em>直接存到手机</em></h5>
+      <div class="btnrow">
+        <button class="btn dark" @click=${()=>this.saveSTL()}>STL 网格</button>
+        <button class="btn" @click=${()=>this.saveOBJ()}>OBJ 网格</button>
+        <button class="btn" @click=${()=>this.savePNG()}>PNG 截图</button>
+      </div>
+      <div class="btnrow">
+        <button class="btn pri" @click=${()=>this.saveSpec()}>生产需求单 .md</button>
+        <button class="btn" @click=${()=>this.saveBOM()}>BOM .csv</button>
+        <button class="btn" @click=${()=>this.saveJSON()}>参数 .json</button>
+      </div>
+      <div class="hint">STL/OBJ 由当前 3D 网格直接生成(单位 mm,已按世界坐标烘焙)。手机浏览器会存到「下载」目录。</div>
+    </div>
+
+    <div class="panel">
+      <h5>分件导出 <em>每件一个 STL,手机可逐个下载</em></h5>
+      <div class="chips">
+        ${proj.parts.filter(pt=>(EXPORTABLE[st.project]||[]).indexOf(pt.id)>=0).map(pt=>html`<button class="chip" @click=${()=>this.savePartSTL(pt.id,pt.n.split('(')[0])}>${pt.n.split('(')[0]} ↓</button>`)}
+        ${this.custom().map(s=>html`<button class="chip" @click=${()=>this.savePartSTL('c'+s.uid,STAGE.PRIMS[s.type].n+s.uid)}>${STAGE.PRIMS[s.type].n}#${s.uid} ↓</button>`)}
+      </div>
+      <div class="hint">整件 STL 供预览;分件 STL 给 CNC/开模按件编程。含玻璃、PCB、电芯等非加工件会自动排除。</div>
+    </div>
+
+    <div class="panel">
+      <h5>给工厂的文件清单 <em>${proj.name}</em></h5>
+      <table class="tbl"><tbody>
+        ${proj.files.map(f=>html`<tr><td>${f}</td><td class="num">必备</td></tr>`)}
+        <tr><td>本需求单 + STL/OBJ 预览</td><td class="num">报价用</td></tr>
+      </tbody></table>
+      <div class="note">浏览器端无法生成 STEP 实体。开模/CNC 编程仍需 STEP(或由工厂按 2D 图纸建模,费用约 ¥500~1,500)。本工具输出的是「可报价、可评审」的完整包,不是可直接开模的最终文件。</div>
+    </div>
+
+    <div class="panel">
+      <h5>当前快照</h5>
+      <dl class="kv">
+        ${derived(st.project,st.params).map(d=>html`<dt>${d[0]}</dt><dd>${d[1]}</dd>`)}
+        <dt>材质</dt><dd>${MATERIALS[st.material]?MATERIALS[st.material].name:''}</dd>
+        <dt>报价数量</dt><dd>${st.qty} 套</dd>
+      </dl>
+    </div>`;
+  }
+
+  /* ---------- 渲染:知识库 ---------- */
+  renderKB(){
+    const notes=LS.get('ss.refs.note',{});
+    return html`
+    <div class="topbar"><div class="inner">
+      <button class="iconbtn" @click=${()=>this.go('#/')}>←</button>
+      <div class="tt"><h1>工艺知识库</h1><p>壳体 · 工艺 · 文件 · 电子件 · 参考文章</p></div>
+    </div></div>
+    <div class="wrap">
+      <div class="hero" style="padding:18px 18px 16px">
+        <div class="kicker">KNOWLEDGE BASE</div>
+        <h2 style="font-size:20px">从创意到能报价,只差这一套口径</h2>
+        <p>工艺成本、MOQ 真相、文件格式、DFM 与电子件选型,全部按可执行口径整理,随时回看。</p>
+      </div>
+
+      ${KB.map(k=>html`
+        <details class="acc" ${k.id==='process'?'open':''}>
+          <summary><span class="ix">${k.ix}</span>${k.title}<span class="chev">▾</span></summary>
+          <div class="body">${this.renderKBItem(k)}</div>
+        </details>`)}
+
+      <div class="sec"><h3>参考文章 / 对话存档</h3><span>长期保存在本机</span></div>
+      ${REFS.map(r=>html`
+        <div class="acc">
+          <div style="padding:12px 14px">
+            <span class="tag b">${r.tag}</span>
+            <div class="ref" style="margin-top:8px;border:none;padding:0;background:transparent">
+              <b>${r.n}</b>
+              <span>${r.u}</span>
+            </div>
+            <div class="hint">${r.d}</div>
+            ${notes[r.id]?html`<details style="margin-top:8px">
+              <summary style="font-size:12px;color:#1f6feb">已录入正文(${notes[r.id].length} 字)· 点击展开</summary>
+              <div style="font-size:12px;line-height:1.7;white-space:pre-wrap;margin-top:8px;color:#31425a">${notes[r.id]}</div>
+            </details>`:''}
+            ${r.id==='wx1'?html`
+            <div style="margin-top:10px">
+              <textarea id="wxtext" placeholder="公众号有 robots 限制,无法自动抓取。把正文粘贴到这里,点保存即可长期归档在本机…"></textarea>
+              <div class="btnrow">
+                <button class="btn pri" @click=${()=>this.saveArticle()}>保存正文到本机</button>
+                <button class="btn" @click=${()=>{ const t=this.querySelector('#wxtext'); if(t) t.value=notes['wx1']||''; }}>读取已存</button>
+              </div>
+            </div>`:''}
+          </div>
+        </div>`)}
+
+      <div class="panel" style="margin-top:12px">
+        <h5>电子件速查 <em>${BOARDS.length} 个模组</em></h5>
+        ${BOARDS.map(b=>html`
+          <div style="padding:9px 0;border-bottom:1px dashed var(--line)">
+            <div style="display:flex;justify-content:space-between;gap:10px">
+              <b style="font-size:12px">${b.name}</b><span style="font-size:10.5px;color:#68758a;white-space:nowrap">${b.od}</span>
+            </div>
+            <div class="hint">${b.screen} · ${b.iface}</div>
+          </div>`)}
+      </div>
+
+      <div class="foot">知识库内容为工程口径整理,价格为 2026-11 深圳/东莞行情参考。<br>引用文章版权归原作者;本页仅存链接与自录摘要。</div>
+    </div>`;
+  }
+
+  renderKBItem(k){
+    return k.body.map(item=>{
+      if(item[0]==='table'){
+        return html`<div class="scrollx"><table class="tbl">
+          <thead><tr>${item[1].map(h=>html`<th>${h}</th>`)}</tr></thead>
+          <tbody>${item[2].map(r=>html`<tr>${r.map(c=>html`<td>${c}</td>`)}</tr>`)}</tbody>
+        </table></div>`;
+      }
+      if(item[0]==='p') return html`<p>${item[1]}</p>`;
+      if(item[0]==='ul') return html`<ul>${item[1].map(x=>html`<li>${x}</li>`)}</ul>`;
+      if(item[0]==='note') return html`<div class="note">${item[1]}</div>`;
+      return '';
+    });
+  }
+
+  saveArticle(){
+    const t=this.querySelector('#wxtext');
+    if(!t||!t.value.trim()) return;
+    const notes=LS.get('ss.refs.note',{});
+    notes['wx1']=t.value.trim();
+    LS.set('ss.refs.note',notes);
+    alert('已保存到本机(清理浏览器数据会丢失,重要内容建议另存)');
+    this.requestUpdate();
+  }
+
+  /* ---------- 导出动作 ---------- */
+  resetParams(){
+    this.state.params=defaultParams(this.state.project);
+    STAGE.setParams(this.state.params);
+    this.persist();
+    this.requestUpdate();
+  }
+  baseName(){
+    const proj=PROJECTS[this.state.project];
+    const d=new Date();
+    const stamp=d.getFullYear()+String(d.getMonth()+1).padStart(2,'0')+String(d.getDate()).padStart(2,'0');
+    return proj.name.replace(/[^\u4e00-\u9fa5A-Za-z0-9]/g,'')+'-'+stamp;
+  }
+  saveSTL(){
+    const r=STAGE.exportSTL(this.baseName());
+    if(!r) return alert('3D 尚未就绪');
+    saveFile(this.baseName()+'.stl',r.text,'model/stl');
+    toast('已导出 '+this.baseName()+'.stl('+(r.text.split('facet').length-1)+' 面)');
+  }
+  saveOBJ(){
+    const r=STAGE.exportOBJ(this.baseName());
+    if(!r) return alert('3D 尚未就绪');
+    saveFile(this.baseName()+'.obj',r.text,'text/plain');
+    toast('已导出 '+this.baseName()+'.obj');
+  }
+  savePNG(){
+    const url=STAGE.snapshot();
+    if(!url) return alert('3D 尚未就绪');
+    saveDataURL(this.baseName()+'.png',url);
+    toast('已保存当前视角截图');
+  }
+  saveSpec(){
+    const md=specMarkdown(this.state.project,this.state.params,this.state.material,this.state.qty,this.custom());
+    saveFile(this.baseName()+'-生产需求单.md',md,'text/markdown');
+    toast('需求单已生成('+md.length+' 字)');
+  }
+  saveBOM(){
+    saveFile(this.baseName()+'-BOM.csv','\ufeff'+bomCSV(this.state.project,this.state.params,this.state.material),'text/csv');
+  }
+  saveJSON(){
+    saveFile(this.baseName()+'.json',specJSON(this.state.project,this.state.params,this.state.material,this.state.qty,this.custom()),'application/json');
+    toast('参数 JSON 已导出');
+  }
+
+  render(){
+    if(this.state.route==='kb') return this.renderKB();
+    if(this.state.route==='project') return this.renderProject();
+    return this.renderHub();
+  }
+}
+customElements.define('app-root',AppRoot);
+
+window.SHELL={STAGE:STAGE,PROJECTS:PROJECTS,MATERIALS:MATERIALS,spec:specMarkdown,svg:fitSVG};
+
+/* 移除加载层 */
+const boot=document.getElementById('boot');
+if(boot){
+  setTimeout(()=>{ boot.classList.add('hide'); setTimeout(()=>boot.remove(),400); },220);
+}
+function bootFail(msg){
+  const b=document.getElementById('bootmsg');
+  if(b) b.textContent='加载失败:'+msg+'(请检查网络后刷新)';
+}
+window.addEventListener('unhandledrejection',e=>bootFail((e.reason&&e.reason.message)||'依赖未就绪'));
+window.addEventListener('error',e=>{ if(!customElements.get('app-root')) bootFail(e.message||'脚本错误'); });

+ 3 - 0
ref-v2/src/06_tail.html

@@ -0,0 +1,3 @@
+</script>
+</body>
+</html>

+ 3181 - 0
ref-v2/壳体工坊-手机3D外壳工程台.html

@@ -0,0 +1,3181 @@
+<!DOCTYPE html>
+<html lang="zh-CN">
+<head>
+<meta charset="utf-8">
+<meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover">
+<meta name="theme-color" content="#0d1726">
+<title>壳体工坊 · Pocket Shell Studio</title>
+<link rel="stylesheet" href="https://miaoda.feishu.cn/fonts/css2?family=Noto+Sans+SC:wght@300;400;500;700&display=swap">
+<script src="https://cdnjs.cloudflare.com/ajax/libs/babylonjs/7.54.3/babylon.js"
+  onerror="this.onerror=null;var s=document.createElement('script');s.src='https://fastly.jsdelivr.net/npm/babylonjs@7.54.3/babylon.js';document.head.appendChild(s);"></script>
+<style>
+:root{
+  --bg:#f1f3f7;--card:#ffffff;--ink:#0d1726;--sub:#68758a;--line:#e4e9f0;
+  --blue:#1f6feb;--cyan:#0aa2c0;--green:#0f9d58;--amber:#d97706;
+  --shadow:0 6px 24px rgba(15,23,42,.08);
+  --radius:16px;
+}
+*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
+html,body{margin:0;padding:0;background:var(--bg);color:var(--ink);
+  font-family:"Noto Sans SC",-apple-system,BlinkMacSystemFont,"PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif;
+  font-size:15px;line-height:1.55;-webkit-font-smoothing:antialiased}
+body{overscroll-behavior-y:contain}
+a{color:inherit;text-decoration:none}
+button{font-family:inherit;cursor:pointer}
+.wrap{max-width:620px;margin:0 auto;padding:0 16px calc(96px + env(safe-area-inset-bottom))}
+
+/* ============ 顶栏 ============ */
+.topbar{position:sticky;top:0;z-index:40;background:rgba(241,243,247,.86);backdrop-filter:blur(14px);
+  -webkit-backdrop-filter:blur(14px);border-bottom:1px solid rgba(228,233,240,.9)}
+.topbar .inner{max-width:620px;margin:0 auto;height:54px;display:flex;align-items:center;gap:10px;padding:0 12px}
+.iconbtn{width:34px;height:34px;border-radius:10px;border:1px solid var(--line);background:#fff;
+  display:flex;align-items:center;justify-content:center;color:var(--ink);font-size:16px;padding:0}
+.iconbtn:active{transform:scale(.96)}
+.tt{flex:1;min-width:0}
+.tt h1{margin:0;font-size:16px;font-weight:700;letter-spacing:.2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
+.tt p{margin:1px 0 0;font-size:11px;color:var(--sub);letter-spacing:.4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
+.pill{font-size:11px;padding:4px 9px;border-radius:999px;background:#eef3fb;color:var(--blue);border:1px solid #dbe6fa;white-space:nowrap}
+
+/* ============ 首页 ============ */
+.hero{margin:14px 0 16px;border-radius:22px;padding:22px 20px 18px;color:#eaf1ff;position:relative;overflow:hidden;
+  background:radial-gradient(120% 130% at 0% 0%,#1b3a6b 0%,#0d1726 58%,#0a111c 100%);box-shadow:0 18px 40px rgba(13,23,38,.28)}
+.hero:after{content:"";position:absolute;right:-40px;top:-60px;width:220px;height:220px;border-radius:50%;
+  background:radial-gradient(circle,rgba(31,111,235,.55),rgba(31,111,235,0) 68%)}
+.hero .kicker{font-size:11px;letter-spacing:2px;color:#8fb6ff;text-transform:uppercase}
+.hero h2{margin:6px 0 8px;font-size:26px;line-height:1.25;font-weight:700;letter-spacing:.5px}
+.hero p{margin:0;font-size:12.5px;color:#a8bbd6;line-height:1.6;max-width:92%}
+.hero .stats{display:flex;gap:8px;margin-top:16px;flex-wrap:wrap}
+.stat{flex:1;min-width:92px;background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.12);border-radius:12px;padding:9px 10px}
+.stat b{display:block;font-size:16px;letter-spacing:.3px}
+.stat span{font-size:10.5px;color:#93a9c8}
+
+.sec{margin:22px 0 10px;display:flex;align-items:baseline;gap:8px}
+.sec h3{margin:0;font-size:14px;font-weight:700;letter-spacing:.4px}
+.sec span{font-size:11px;color:var(--sub)}
+
+.pcard{display:block;background:var(--card);border-radius:var(--radius);padding:14px;margin-bottom:12px;
+  border:1px solid var(--line);box-shadow:var(--shadow);transition:transform .16s ease}
+.pcard:active{transform:scale(.985)}
+.pcard .row{display:flex;gap:12px;align-items:flex-start}
+.thumb{width:74px;height:74px;flex:0 0 74px;border-radius:14px;position:relative;overflow:hidden;
+  background:linear-gradient(140deg,#101a29,#26374f);display:flex;align-items:center;justify-content:center}
+.thumb .shape{position:relative}
+.thumb .sq{width:40px;height:40px;border-radius:11px;background:linear-gradient(160deg,#f0d3d9,#c993a2);
+  box-shadow:inset 0 -6px 12px rgba(0,0,0,.18),0 4px 10px rgba(0,0,0,.35)}
+.thumb .sq:before,.thumb .sq:after{content:"";position:absolute;top:-9px;width:11px;height:14px;
+  background:linear-gradient(160deg,#e9c3cc,#a9768a);border-radius:6px 6px 2px 2px}
+.thumb .sq:before{left:3px;transform:rotate(-14deg)}
+.thumb .sq:after{right:3px;transform:rotate(14deg)}
+.thumb .disc{width:44px;height:44px;border-radius:50%;background:linear-gradient(160deg,#e9edf2,#a7b3c2);
+  box-shadow:inset 0 -5px 10px rgba(0,0,0,.18),0 6px 12px rgba(0,0,0,.3);display:flex;align-items:center;justify-content:center}
+.thumb .disc i{width:30px;height:30px;border-radius:50%;background:#0c1118;display:block}
+.thumb .puck{width:44px;height:26px;border-radius:12px;background:linear-gradient(160deg,#f4f6f9,#b9c2cd);
+  box-shadow:0 6px 12px rgba(0,0,0,.3);position:relative}
+.thumb .puck:after{content:"";position:absolute;right:-6px;top:8px;width:12px;height:12px;border-radius:50%;border:2px solid #d5dbe3}
+.thumb .lbl{position:absolute;left:6px;bottom:4px;font-size:8px;letter-spacing:.6px;color:#8093ab}
+.pinfo{flex:1;min-width:0}
+.pinfo h4{margin:0 0 3px;font-size:15px;font-weight:700;letter-spacing:.2px}
+.pinfo .dims{font-size:11px;color:var(--sub);font-variant-numeric:tabular-nums}
+.tagrow{display:flex;gap:6px;flex-wrap:wrap;margin-top:8px}
+.tag{font-size:10.5px;padding:3px 8px;border-radius:6px;background:#f3f6fa;border:1px solid var(--line);color:#4a5a70}
+.tag.b{background:#eef4fe;border-color:#d9e6fc;color:var(--blue)}
+.tag.g{background:#edfaf3;border-color:#cfeedd;color:#0c7a48}
+.enter{display:flex;align-items:center;gap:4px;color:var(--blue);font-size:12px;font-weight:500;margin-top:10px}
+.enter .arw{font-size:14px}
+
+.mini{display:grid;grid-template-columns:1fr 1fr;gap:10px}
+.minicard{background:#fff;border:1px solid var(--line);border-radius:14px;padding:13px;box-shadow:var(--shadow)}
+.minicard b{display:block;font-size:13.5px;margin-bottom:2px}
+.minicard span{font-size:11px;color:var(--sub);line-height:1.5;display:block}
+.minicard .n{font-size:10px;color:var(--blue);margin-top:8px;display:block}
+
+/* ============ 3D 舞台 ============ */
+.stage{margin:12px 0 0;border-radius:18px;overflow:hidden;position:relative;height:44vh;min-height:290px;max-height:420px;
+  background:radial-gradient(110% 110% at 20% 0%,#22344b 0%,#131e2c 48%,#0a1018 100%);
+  box-shadow:0 14px 30px rgba(13,23,38,.22);touch-action:none}
+.stage canvas{width:100%;height:100%;display:block;outline:none;touch-action:none}
+.stage-top{position:absolute;top:10px;left:10px;right:10px;display:flex;gap:6px;align-items:flex-start;pointer-events:none}
+.stage-top .badge{pointer-events:auto;font-size:10.5px;color:#d7e5ff;background:rgba(255,255,255,.1);
+  border:1px solid rgba(255,255,255,.16);border-radius:8px;padding:4px 8px;backdrop-filter:blur(6px)}
+.stage-top .spacer{flex:1}
+.stage-top .vbtn{pointer-events:auto;font-size:10.5px;color:#e8f1ff;background:rgba(255,255,255,.1);
+  border:1px solid rgba(255,255,255,.16);border-radius:8px;padding:4px 8px}
+.stage-top .vbtn.on{background:#1f6feb;border-color:#3f86ff;color:#fff}
+.stage-bottom{position:absolute;left:0;right:0;bottom:0;padding:8px 10px 10px;pointer-events:none;
+  background:linear-gradient(to top,rgba(6,11,18,.72),rgba(6,11,18,0))}
+.matrow{display:flex;gap:6px;overflow-x:auto;padding-bottom:2px;pointer-events:auto;scrollbar-width:none}
+.matrow::-webkit-scrollbar{display:none}
+.mat{flex:0 0 auto;display:flex;align-items:center;gap:5px;font-size:11px;color:#dbe7f7;
+  background:rgba(16,26,40,.72);border:1px solid rgba(255,255,255,.14);border-radius:999px;padding:4px 9px 4px 5px}
+.mat.on{background:#1f6feb;border-color:#4f92ff;color:#fff}
+.mat i{width:14px;height:14px;border-radius:50%;display:block;border:1px solid rgba(255,255,255,.35)}
+.dimlayer{position:absolute;inset:0;pointer-events:none;overflow:hidden}
+.dimtag{position:absolute;transform:translate(-50%,-50%);font-size:10px;line-height:1.1;color:#cfe6ff;
+  background:rgba(9,17,28,.78);border:1px solid rgba(120,190,255,.38);padding:2px 5px;border-radius:4px;
+  white-space:nowrap;font-variant-numeric:tabular-nums;letter-spacing:.2px}
+
+/* ============ 参数面板 / tabs ============ */
+.tabs{display:flex;gap:6px;overflow-x:auto;margin:14px 0 10px;padding-bottom:2px;scrollbar-width:none}
+.tabs::-webkit-scrollbar{display:none}
+.tab{flex:0 0 auto;font-size:12.5px;padding:8px 13px;border-radius:10px;border:1px solid var(--line);
+  background:#fff;color:var(--sub)}
+.tab.on{background:var(--ink);border-color:var(--ink);color:#fff}
+.panel{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:14px;box-shadow:var(--shadow);margin-bottom:12px}
+.panel h5{margin:0 0 10px;font-size:13px;font-weight:700;display:flex;align-items:center;gap:6px}
+.panel h5 em{font-style:normal;font-size:10.5px;color:var(--sub);font-weight:400}
+.slider{margin:11px 0 14px}
+.slider .lab{display:flex;justify-content:space-between;font-size:12px;margin-bottom:5px}
+.slider .lab b{font-variant-numeric:tabular-nums;font-weight:600;color:var(--ink);flex:0 0 auto;margin-left:10px}
+.slider .lab span{color:var(--sub);min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
+input[type=range]{-webkit-appearance:none;width:100%;height:26px;background:transparent;margin:0}
+input[type=range]::-webkit-slider-runnable-track{height:5px;border-radius:3px;
+  background:linear-gradient(90deg,#1f6feb var(--p,50%),#e6ebf2 var(--p,50%))}
+input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;width:20px;height:20px;margin-top:-7.5px;
+  border-radius:50%;background:#fff;border:2px solid #1f6feb;box-shadow:0 2px 6px rgba(31,111,235,.35)}
+input[type=range]::-moz-range-track{height:5px;border-radius:3px;background:#e6ebf2}
+input[type=range]::-moz-range-thumb{width:18px;height:18px;border-radius:50%;background:#fff;border:2px solid #1f6feb}
+.hint{font-size:11px;color:var(--sub);margin:6px 0 0;line-height:1.55}
+.btnrow{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
+.btn{font-size:12px;padding:8px 12px;border-radius:10px;border:1px solid var(--line);background:#fff;color:var(--ink)}
+.btn.pri{background:var(--blue);border-color:var(--blue);color:#fff}
+.btn.dark{background:var(--ink);border-color:var(--ink);color:#fff}
+.btn:active{transform:scale(.97)}
+
+/* 电子件卡 */
+.board{display:flex;gap:11px;border:1px solid var(--line);border-radius:12px;padding:11px;margin-bottom:10px;background:#fbfcfe}
+.board .bv{width:52px;height:52px;border-radius:50%;flex:0 0 52px;background:linear-gradient(150deg,#e8edf4,#b6c0cc);
+  display:flex;align-items:center;justify-content:center;box-shadow:inset 0 -4px 8px rgba(0,0,0,.15)}
+.board .bv i{width:34px;height:34px;border-radius:50%;background:#101720;display:block}
+.board .bi{flex:1;min-width:0}
+.board .bi b{font-size:13px;display:block;line-height:1.35}
+.board .bi span{font-size:11px;color:var(--sub);display:block;margin-top:2px}
+.board .bd{font-size:10.5px;color:#0c7a48;background:#edfaf3;border:1px solid #cfeedd;border-radius:6px;padding:2px 6px;margin-top:6px;display:inline-block}
+.kv{display:grid;grid-template-columns:auto 1fr;gap:3px 12px;font-size:11.5px;margin-top:8px;font-variant-numeric:tabular-nums}
+.kv dt{color:var(--sub)}
+.kv dd{margin:0;text-align:right;color:var(--ink)}
+
+/* 表格 */
+.tbl{width:100%;border-collapse:collapse;font-size:11.5px;font-variant-numeric:tabular-nums}
+.tbl th,.tbl td{border-bottom:1px solid var(--line);padding:7px 6px;text-align:left;vertical-align:top}
+.tbl th{color:var(--sub);font-weight:500;font-size:11px;background:#fafbfd}
+.tbl td.num{text-align:right;white-space:nowrap}
+.tbl tr:last-child td{border-bottom:none}
+.scrollx{overflow-x:auto;-webkit-overflow-scrolling:touch;margin:0 -14px;padding:0 14px}
+
+/* 爆炸/装配 */
+.steprow{display:flex;gap:9px;align-items:flex-start;padding:9px 0;border-bottom:1px solid var(--line)}
+.steprow:last-child{border-bottom:none}
+.stepno{width:22px;height:22px;border-radius:50%;background:#eef4fe;color:var(--blue);font-size:11px;
+  display:flex;align-items:center;justify-content:center;flex:0 0 22px;font-weight:600}
+.steprow b{font-size:12.5px;display:block}
+.steprow span{font-size:11px;color:var(--sub);display:block}
+.parts .pr{display:flex;justify-content:space-between;font-size:11.5px;padding:7px 0;border-bottom:1px dashed var(--line);gap:10px}
+.parts .pr:last-child{border-bottom:none}
+.parts .pr em{font-style:normal;color:var(--sub);font-size:10.5px;text-align:right}
+
+/* 知识库 */
+.acc{border:1px solid var(--line);border-radius:12px;background:#fff;margin-bottom:10px;overflow:hidden;box-shadow:var(--shadow)}
+.acc summary{list-style:none;padding:13px 14px;font-size:13px;font-weight:600;display:flex;align-items:center;gap:9px;cursor:pointer}
+.acc summary::-webkit-details-marker{display:none}
+.acc summary .ix{font-size:10.5px;color:var(--blue);background:#eef4fe;border:1px solid #dbe6fa;border-radius:6px;padding:1px 6px}
+.acc summary .chev{margin-left:auto;color:var(--sub);font-size:12px;transition:transform .2s}
+.acc[open] summary .chev{transform:rotate(180deg)}
+.acc .body{padding:0 14px 14px;font-size:12.5px;color:#31425a;line-height:1.68}
+.acc .body p{margin:8px 0}
+.acc .body ul{margin:8px 0;padding-left:18px}
+.acc .body li{margin:3px 0}
+.acc .body code{background:#f1f4f9;padding:1px 5px;border-radius:4px;font-size:11.5px}
+.note{border-left:3px solid var(--amber);background:#fff8ec;padding:9px 11px;border-radius:0 8px 8px 0;font-size:11.5px;color:#6b4a13;margin:10px 0;line-height:1.6}
+.ref{display:block;border:1px solid var(--line);border-radius:12px;padding:11px;margin-bottom:8px;background:#fbfcfe}
+.ref b{font-size:12.5px;display:block;word-break:break-all}
+.ref span{font-size:10.5px;color:var(--sub);word-break:break-all;display:block;margin-top:3px}
+textarea{width:100%;border:1px solid var(--line);border-radius:10px;padding:10px;font-size:12px;font-family:inherit;line-height:1.6;min-height:96px;resize:vertical;background:#fafbfd}
+
+.foot{text-align:center;font-size:10.5px;color:#9aa7ba;margin:26px 0 8px;line-height:1.7}
+#toast{position:fixed;left:50%;bottom:86px;transform:translateX(-50%) translateY(8px);z-index:70;background:rgba(17,26,40,.92);
+  color:#eaf2ff;font-size:12px;padding:9px 14px;border-radius:10px;opacity:0;transition:opacity .2s,transform .2s;pointer-events:none;max-width:80vw;text-align:center}
+#toast.on{opacity:1;transform:translateX(-50%) translateY(0)}
+
+/* 建模页:工艺 chips / 形体面板 / 数值控件 / 校验 */
+.chips{display:flex;gap:6px;flex-wrap:wrap;margin:2px 0 10px}
+.chip{font-size:11px;padding:6px 11px;border-radius:999px;border:1px solid var(--line);background:#fff;color:var(--sub)}
+.chip.on{background:var(--ink);border-color:var(--ink);color:#fff}
+.palette{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:4px 0 8px}
+.pbtn{display:flex;flex-direction:column;gap:2px;padding:10px 8px;border-radius:12px;border:1px solid var(--line);background:#fff;text-align:left}
+.pbtn b{font-size:11.5px;color:var(--ink);font-weight:600}
+.pbtn span{font-size:9.5px;color:var(--sub)}
+.pbtn:active{background:#f2f7fe}
+.nrows{margin:6px 0 2px}
+.nrow{display:flex;align-items:center;gap:7px;padding:5px 0}
+.nrow .nl{flex:1;font-size:11.5px;color:var(--ink)}
+.nrow .nb{width:27px;height:27px;border-radius:8px;border:1px solid var(--line);background:#fff;font-size:14px;line-height:1;color:var(--sub);flex:none}
+.nrow .ni{width:64px;text-align:center;font-size:12px;padding:5px 3px;border-radius:8px;border:1px solid var(--line);background:#fff;color:var(--ink);font-variant-numeric:tabular-nums}
+.nrow em{font-style:normal;font-size:10px;color:var(--sub);width:16px;flex:none}
+.chk{display:flex;gap:8px;font-size:11.5px;line-height:1.55;padding:7px 0;border-bottom:1px dashed var(--line);color:#31425a}
+.chk:last-child{border-bottom:none}
+.chk i{font-style:normal;width:15px;height:15px;border-radius:50%;flex:none;display:flex;align-items:center;justify-content:center;font-size:9px;color:#fff;background:#0f9d58;margin-top:2px}
+.chk.bad i{background:#dc2626}
+.chk.bad span{color:#9a3412}
+.pr{display:flex;justify-content:space-between;align-items:center;gap:10px;font-size:11.5px;padding:8px 0;border-bottom:1px dashed var(--line)}
+.pr.on{background:#eef4fe}
+.pr b{font-weight:600;color:var(--ink)}
+.pr span{display:block;color:var(--sub);font-size:10.5px;margin-top:2px}
+.pr .del{font-size:10px;padding:4px 9px;border-radius:8px;border:1px solid var(--line);background:#fff;color:#9a3412;flex:none}
+
+/* 底栏(项目内) */
+.bottom{position:fixed;left:0;right:0;bottom:0;z-index:45;padding:8px 12px calc(8px + env(safe-area-inset-bottom));
+  background:rgba(255,255,255,.92);backdrop-filter:blur(14px);border-top:1px solid var(--line);display:flex;gap:8px}
+.bottom .btn{flex:1;min-width:0;text-align:center;font-size:12px;padding:9px 4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
+
+/* 加载 */
+#boot{position:fixed;inset:0;z-index:99;background:#0d1726;color:#dbe7f7;display:flex;flex-direction:column;
+  align-items:center;justify-content:center;gap:14px;font-size:12.5px;letter-spacing:.5px;transition:opacity .3s}
+#boot .ring{width:34px;height:34px;border-radius:50%;border:2px solid rgba(255,255,255,.18);border-top-color:#4f92ff;
+  animation:spin 1s linear infinite}
+@keyframes spin{to{transform:rotate(360deg)}}
+#boot.hide{opacity:0;pointer-events:none}
+@media (max-width:380px){ .hero h2{font-size:22px} .thumb{width:64px;height:64px;flex-basis:64px} }
+/* 移动端单屏:迷你舞台 + 底部编辑坞 */
+.stage.mini{margin:0 -12px;border-radius:0 0 18px 18px;
+  height:calc(100vh - var(--dockH,46vh) - 8px);min-height:170px;max-height:none;
+  position:sticky;top:0;z-index:20;box-shadow:0 8px 22px rgba(12,24,44,.10)}
+.stage.mini .badge{display:none}
+.stage.mini .stage-top{left:8px;right:8px}
+.stage.mini .vbtn{padding:4px 9px;font-size:10.5px}
+.stage.mini .matrow{max-width:calc(100% - 16px)}
+.dock{position:fixed;left:0;right:0;bottom:var(--kb,0px);z-index:56;max-width:760px;margin:0 auto;height:var(--dockH,46vh);transition:height .22s cubic-bezier(.32,.94,.36,1);
+  background:#fff;border-radius:18px 18px 0 0;box-shadow:0 -10px 30px rgba(10,24,46,.22);
+  display:flex;flex-direction:column;border-top:1px solid #dfe8f6;padding-bottom:env(safe-area-inset-bottom)}
+.dock .grab{height:24px;flex:none;display:flex;align-items:center;justify-content:center;touch-action:none;cursor:grab}
+.dock .grab i{width:42px;height:4px;border-radius:2px;background:#c9d6e8}
+.dock .dhead{flex:none;display:flex;align-items:center;gap:8px;padding:2px 12px 6px}
+.dock .dhead b{font-size:13px;color:var(--ink)}
+.dock .dhead .em{font-size:10.5px;color:var(--sub);margin-left:6px}
+.dock .dhead .x{margin-left:auto;font-size:11px;padding:5px 10px;border-radius:9px;border:1px solid var(--line);background:#fff;color:#33415c}
+.dock .dbody{flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;padding:0 12px 14px;overscroll-behavior:contain}
+.dock .dsec{display:flex;align-items:baseline;gap:8px;margin:10px 0 4px;font-size:12px;font-weight:600;color:var(--ink)}
+.dock .dsec em{font-style:normal;font-size:10px;font-weight:400;color:var(--sub)}
+.dock .nrows{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 10px}
+.dock .nrow{padding:4px 0;border-bottom:1px dashed #eef2f8;align-items:center}
+.dock .nrow .lab{flex:0 0 46px;font-size:10px;overflow:hidden;white-space:nowrap}
+.dock .nrow{gap:4px}
+.dock .nrow .nb{width:24px;height:24px;font-size:11px}
+.dock .nrow .ni{width:auto;min-width:0;font-size:11.5px;padding:4px 4px}
+.dock .btnrow .btn{font-size:11px;padding:7px 9px}
+.dock .nrow .ni{flex:1;min-width:0}
+.dock .nrow em{display:none}
+.dock .nrow .lab{font-size:10.5px}
+.dock .prow{display:flex;gap:6px;overflow-x:auto;padding:2px 0 6px;-webkit-overflow-scrolling:touch}
+.dock .pco{flex:none;min-width:88px;padding:7px 9px;border-radius:12px;border:1px solid var(--line);background:#fbfdff;text-align:left}
+.dock .pco b{display:block;font-size:11.5px;color:var(--ink);font-weight:600;white-space:nowrap}
+.dock .pco span{display:block;font-size:9.5px;color:var(--sub);margin-top:2px;white-space:nowrap}
+.dock .pco.hot{border-color:#bfd7ff;background:#f2f7ff}
+.dock.fold{height:auto;padding-bottom:calc(6px + env(safe-area-inset-bottom))}
+.dock.fold .grab{display:none}
+.dock .dbody .chips{flex-wrap:nowrap;overflow-x:auto;padding-bottom:4px;scrollbar-width:none}
+.dock .dbody .chips::-webkit-scrollbar{display:none}
+.dock .chips .chip{flex:0 0 auto;white-space:nowrap;font-size:11px;padding:6px 11px}
+.dock .prow{scrollbar-width:none}
+.dock .prow::-webkit-scrollbar{display:none}
+.dockpad{height:50vh}
+
+/* 坞内快捷导航 + 数字输入 + 拖拽态 */
+.dock.drag{transition:none}
+.dock .dnav{flex:none;display:flex;gap:6px;padding:0 12px 8px;overflow-x:auto;scrollbar-width:none}
+.dock .dnav::-webkit-scrollbar{display:none}
+.dock .dnav button{flex:0 0 auto;font-size:10.5px;padding:5px 10px;border-radius:20px;border:1px solid var(--line);background:#fff;color:#33415c}
+.dock .dnav button.on{background:#eef4fe;border-color:#c9dcff;color:#1f5fd0}
+.dock .hbt{width:28px;height:28px;border-radius:9px;border:1px solid var(--line);background:#fff;color:#33415c;font-size:13px;display:flex;align-items:center;justify-content:center}
+.dock .hbt:disabled{opacity:.35}
+.dock .dhead .tools{margin-left:auto;display:flex;gap:6px;align-items:center}
+.slider .lab .sv{width:56px;flex:0 0 56px;text-align:right;font-size:12px;font-weight:600;color:var(--ink);
+  border:none;border-bottom:1px dashed #c8d5e8;background:transparent;padding:1px 0;font-variant-numeric:tabular-nums}
+.slider .lab .sv:focus{outline:none;border-bottom-color:#1f6feb}
+.stage.mini .dimlayer{font-size:9px}
+@supports (height:100dvh){.stage.mini{height:calc(100dvh - var(--dockH,46vh) - 8px)}}
+.ghint{position:absolute;left:50%;bottom:54px;transform:translateX(-50%);
+  font-size:10px;color:#cfe2ff;background:rgba(12,26,46,.62);border:1px solid rgba(120,170,255,.25);
+  padding:4px 10px;border-radius:20px;white-space:nowrap;pointer-events:none;animation:gh 5s ease forwards}
+@keyframes gh{0%{opacity:0}12%{opacity:1}70%{opacity:1}100%{opacity:0;visibility:hidden}}
+</style>
+</head>
+<body>
+<div id="boot"><div class="ring"></div><div id="bootmsg">正在装载 3D 工程台…</div></div>
+
+<app-root></app-root>
+
+<script type="module">
+/* =========================================================
+   数据层:项目参数 / 材质 / 工艺 / 电子件 / 知识库
+   单位统一 mm;价格为 2026-11 深圳·东莞行情区间(仅供参考)
+   ========================================================= */
+
+const MATERIALS = {
+  'sil-black':  {name:'硅胶 哑光黑', albedo:'#22262c', metallic:0.0, rough:0.62, cc:0.20, cci:0.30, swatch:'#22262c', note:'邵氏 A50,喷手感油'},
+  'sil-pink':   {name:'硅胶 哑光藕粉', albedo:'#d8a8b4', metallic:0.0, rough:0.60, cc:0.20, cci:0.28, swatch:'#d8a8b4', note:'双色拼色 A 料'},
+  'sil-mint':   {name:'硅胶 雾青', albedo:'#9fc8bd', metallic:0.0, rough:0.60, cc:0.18, cci:0.24, swatch:'#9fc8bd'},
+  'abs-gloss':  {name:'ABS 光面白', albedo:'#eceef1', metallic:0.0, rough:0.26, cc:0.55, cci:0.45, swatch:'#eceef1', note:'注塑本色,可丝印'},
+  'abs-matte':  {name:'ABS 喷油哑光', albedo:'#dfe3e8', metallic:0.0, rough:0.58, cc:0.10, cci:0.18, swatch:'#dfe3e8', note:'喷橡胶漆,耐磨 500g 摩擦'},
+  'abs-black':  {name:'ABS 哑光黑', albedo:'#1f2328', metallic:0.0, rough:0.50, cc:0.12, cci:0.20, swatch:'#1f2328'},
+  'pc-clear':   {name:'PC 透明', albedo:'#dfeaf5', metallic:0.0, rough:0.08, cc:0.6, cci:0.5, swatch:'#cfe2f3', alpha:0.42},
+  'alu-silver': {name:'6061 阳极银', albedo:'#c7cfd8', metallic:1.0, rough:0.24, cc:0.18, cci:0.42, swatch:'#c7cfd8', note:'喷砂+阳极 10~15μm'},
+  'alu-sand':   {name:'6061 喷砂银', albedo:'#c6ccd3', metallic:1.0, rough:0.60, cc:0.05, cci:0.12, swatch:'#c6ccd3'},
+  'alu-black':  {name:'6061 阳极黑', albedo:'#282c31', metallic:0.9, rough:0.36, cc:0.16, cci:0.30, swatch:'#282c31', note:'阳极后螺纹需二次回攻'},
+  'alu-rose':   {name:'6061 阳极玫瑰金', albedo:'#d9b49a', metallic:1.0, rough:0.30, cc:0.15, cci:0.35, swatch:'#d9b49a'}
+};
+
+/* 内固定材质(不参与材质切换) */
+const FIXED_MATS = {
+  glass:  {albedo:'#070b10', metallic:0.3, rough:0.06, cc:0.9, cci:0.6},
+  pcb:    {albedo:'#071d17', metallic:0.08, rough:0.78, env:0.28},
+  pcbDark:{albedo:'#0b1620', metallic:0.15, rough:0.62, env:0.3},
+  cell:   {albedo:'#2b3138', metallic:0.15, rough:0.72},
+  brass:  {albedo:'#b08d57', metallic:1.0, rough:0.34},
+  dark:   {albedo:'#12161b', metallic:0.15, rough:0.5},
+  cut:    {albedo:'#ff7a45', metallic:0.0, rough:0.55, alpha:0.42}
+};
+
+/* ---------------- 三个项目 ---------------- */
+const PROJECTS = {
+  silicone: {
+    id:'silicone', name:'小恶魔硅胶表壳', en:'SILICONE WATCH CASE',
+    ref:'HUAWEI GT4 / GT5 41mm · 双色拼色',
+    accent:'#c993a2',
+    summary:'包表式硅胶保护壳:外框一体模压、顶部双立体小角、侧边表冠避让。适合小批量双色拼色试产。',
+    tags:['硅胶模压','双色拼色','MOQ 500'],
+    params:[
+      {k:'w',   n:'内腔宽',   min:30, max:48, step:0.5, def:40.5, group:'腔体'},
+      {k:'d',   n:'内腔高',   min:30, max:48, step:0.5, def:40.5, group:'腔体'},
+      {k:'t',   n:'壁厚',     min:1.2, max:4, step:0.1, def:2.4, group:'腔体'},
+      {k:'h',   n:'总高',     min:8,  max:16, step:0.2, def:11.5, group:'腔体'},
+      {k:'r',   n:'内腔圆角', min:4,  max:22, step:0.5, def:13,   group:'腔体'},
+      {k:'hh',  n:'小角高度', min:1,  max:14, step:0.5, def:7,    group:'双角'},
+      {k:'hg',  n:'双角间距', min:8,  max:36, step:0.5, def:22,   group:'双角'},
+      {k:'hd',  n:'角底直径', min:3,  max:10, step:0.2, def:5.2,  group:'双角'},
+      {k:'cr',  n:'表冠凸出', min:0,  max:3,  step:0.1, def:1.4,  group:'侧边'}
+    ],
+    materials:['sil-pink','sil-black','sil-mint','abs-gloss','alu-silver'],
+    parts:[
+      {id:'body',   n:'硅胶壳体(空心圆角框)', q:'1',  mat:'主材质', proc:'模压/液态硅胶', tol:'±0.10'},
+      {id:'floor',  n:'底托(贴机身层)',       q:'1',  mat:'同壳体',  proc:'同模一体', tol:'±0.10'},
+      {id:'hornL',  n:'立体小角(左)',         q:'1',  mat:'B 色/同色', proc:'一体模压', tol:'±0.15'},
+      {id:'hornR',  n:'立体小角(右)',         q:'1',  mat:'B 色/同色', proc:'一体模压', tol:'±0.15'},
+      {id:'screen', n:'屏幕视窗(透光面)',     q:'1',  mat:'PC 透明/裸屏', proc:'—', tol:'±0.05'},
+      {id:'crown',  n:'表冠避让孔',             q:'1',  mat:'—', proc:'模压开孔', tol:'±0.15'}
+    ],
+    steps:[
+      {n:'壳体出模、去毛刺', d:'硅胶模压后修边,双角与框体一体,检查双角色差 ΔE≤1.5。'},
+      {n:'贴底托 / 装表体', d:'表体从内腔嵌入,壁厚 2.4mm 提供回弹夹持,不靠胶水。'},
+      {n:'屏幕视窗对位', d:'视窗与表盘贴合,四边留 0.15mm 缓冲,避免顶屏。'},
+      {n:'表冠穿孔校验', d:'表冠凸出位开孔,孔径比表冠大 0.3mm,保证按压不涩。'},
+      {n:'手感油 / 丝印', d:'表面喷手感油(哑光),logo 丝印或镭雕在底托背面。'}
+    ],
+    processes:[
+      {key:'sil-mold', n:'硅胶模压(钢模)', mold:2200, minQty:500, unit:[[500,5.2],[1000,4.2],[3000,3.4],[5000,2.9]], lead:'12~18 天', note:'双色需两套模/两次成型,模具费上浮 40%'},
+      {key:'vacuum',   n:'真空复模(小批量验证)', mold:300, minQty:10, unit:[[10,26],[30,18],[100,12]], lead:'5~8 天', note:'硅胶模寿命 20~40 件,适合内测'},
+      {key:'cnc',      n:'CNC 手板(ABS/铝)', mold:0, minQty:1, unit:[[1,90],[5,68],[20,46],[50,36]], lead:'3~7 天', note:'含编程调机,后处理另计'}
+    ],
+    notes:[
+      '硅胶最小壁厚建议 ≥1.2mm;本款 2.4mm 属回弹夹持区,低于 1.8mm 易松脱。',
+      '双角若与框体同色可一次成型;双色需双料注塑或二次硫化套色,单价上浮 15%~25%。',
+      '表壳包表,内腔尺寸需按实机 ±0.1mm 复测,不能只按官网标称开模。'
+    ],
+    tolerance:[['内腔宽/高','±0.10'],['壁厚','±0.08'],['双角位置','±0.20'],['孔位','±0.15'],['未注公差','ISO 2768-m']],
+    files:['STEP(AP214,含内腔曲面)','STL(弦高 0.05mm)','2D PDF A3 三视图 + 剖视','色卡 Pantone/劳尔号']
+  },
+
+  recorder: {
+    id:'recorder', name:'AI 录音豆外壳', en:'AI RECORDER PUCK',
+    ref:'Φ32 磁吸挂扣 · ABS 注塑',
+    accent:'#8fa3bd',
+    summary:'圆形豆状外壳:上盖穹顶、侧挂环、四麦孔阵列、Type-C 与单键。内部为自制 PCBA + 软包电芯。',
+    tags:['ABS 注塑','卡扣装配','MOQ 500'],
+    params:[
+      {k:'D',   n:'外径',     min:24, max:46, step:0.5, def:32, group:'主体'},
+      {k:'H',   n:'总高',     min:8,  max:20, step:0.2, def:11.5, group:'主体'},
+      {k:'t',   n:'壁厚',     min:1.0, max:2.6, step:0.1, def:1.6, group:'主体'},
+      {k:'dm',  n:'穹顶弧高', min:0,  max:4,  step:0.1, def:1.6, group:'主体'},
+      {k:'ld',  n:'挂环孔径', min:3,  max:10, step:0.5, def:4.5, group:'挂扣'},
+      {k:'lh',  n:'挂环长度', min:2,  max:8,  step:0.5, def:4, group:'挂扣'}
+    ],
+    materials:['abs-gloss','abs-matte','abs-black','pc-clear','alu-silver','sil-black'],
+    parts:[
+      {id:'body',  n:'下壳(含电池仓)', q:'1', mat:'主材质', proc:'注塑 / CNC', tol:'±0.10'},
+      {id:'lid',   n:'上盖(穹顶+麦孔)', q:'1', mat:'主材质', proc:'注塑 / CNC', tol:'±0.10'},
+      {id:'loop',  n:'侧挂环',           q:'1', mat:'同壳体', proc:'一体/后装', tol:'±0.20'},
+      {id:'mic',   n:'MEMS 麦孔 ×4',     q:'4', mat:'—',     proc:'钻孔 Ø1.0', tol:'±0.05'},
+      {id:'usbc',  n:'Type-C 开口',      q:'1', mat:'—',     proc:'开孔 9.0×3.4', tol:'±0.08'},
+      {id:'btn',   n:'功能按键',         q:'1', mat:'同壳体', proc:'注塑 + 硅胶垫', tol:'±0.10'},
+      {id:'pcb',   n:'主控板 Φ26',       q:'1', mat:'FR-4',   proc:'外购/自制', tol:'±0.15'},
+      {id:'cell',  n:'软包电芯 402030',  q:'1', mat:'锂电',   proc:'外购 3.7V', tol:'±0.5'}
+    ],
+    steps:[
+      {n:'下壳装电芯', d:'402030 软包(4.0×20×30mm)卡入电池仓,留 5% 膨胀余量。'},
+      {n:'PCBA 卡扣固定', d:'Φ26 主板落在 3 处限位柱上,卡扣压紧,不用螺丝。'},
+      {n:'焊线 / 接口', d:'电池线走 MX1.25 或焊盘,Type-C 母座对准侧开口 ±0.1。'},
+      {n:'上盖合模', d:'上盖与下壳卡扣环扣合,麦孔朝上,环形密封槽可加防水胶。'},
+      {n:'挂环 + 老化测试', d:'挂环过 5kg 静拉,整机 2h 老化 + 麦克风灵敏度抽检。'}
+    ],
+    processes:[
+      {key:'abs-mold', n:'ABS 注塑(钢模)', mold:6500, minQty:500, unit:[[500,5.0],[1000,4.1],[3000,3.4],[5000,2.8]], lead:'15~20 天', note:'上下壳+按键三套模,含试模'},
+      {key:'vacuum',   n:'真空复模', mold:300, minQty:10, unit:[[10,28],[30,19],[100,13]], lead:'5~8 天'},
+      {key:'cnc',      n:'CNC 铝/ABS 手板', mold:0, minQty:1, unit:[[1,120],[5,86],[20,58],[50,44]], lead:'3~7 天'}
+    ],
+    notes:[
+      '麦孔阵列孔径 Ø1.0,孔后需 1.5mm 声腔,孔壁不能与壳体壁厚直接贯通。',
+      '卡扣合模需 0.5mm 过盈 + 单边 1° 导向角,否则量产装配良率掉到 80% 以下。',
+      '若走公模贴牌,MOQ 可降到 200 台整机;只做外观件仍按 500 套起。'
+    ],
+    tolerance:[['外径','±0.10'],['总高','±0.15'],['麦孔','±0.05'],['Type-C 开口','±0.08'],['未注公差','ISO 2768-m']],
+    files:['STEP(AP214 含卡扣)','STL 上下壳分件','2D PDF 含开孔坐标表','装配示意图(爆炸序)']
+  },
+
+  round: {
+    id:'round', name:'1.85″ 圆屏铝壳', en:'ROUND LCD AL CASE',
+    ref:'Φ61.6 × 14.6 · 参考微雪 1.85B',
+    accent:'#aab6c4',
+    summary:'电子吧唧造型:前框沉台固定 1.85″ 圆屏、后盖旋合、四颗 M2 铜柱锁板、侧边双麦与 Type-C。',
+    tags:['6061 CNC','沉台 ±0.03','阳极氧化'],
+    params:[
+      {k:'D',   n:'外径',     min:50, max:72, step:0.2, def:61.6, group:'主体'},
+      {k:'H',   n:'总厚',     min:11, max:20, step:0.2, def:14.6, group:'主体'},
+      {k:'t',   n:'壁厚',     min:1.4, max:3.2, step:0.1, def:2.0, group:'主体'},
+      {k:'sd',  n:'屏可视径', min:38, max:54, step:0.2, def:45.68, group:'屏幕'},
+      {k:'bd',  n:'黑边外径', min:44, max:58, step:0.2, def:55.0, group:'屏幕'},
+      {k:'dep', n:'屏边弧深(沉台R)', min:0.5, max:2.2, step:0.1, def:1.2, group:'CNC 工艺'},
+      {k:'rimR',n:'顶部凸圆 R(CNC)', min:0.6, max:3.4, step:0.1, def:1.8, group:'CNC 工艺'},
+      {k:'cham',n:'底边倒角 C(CNC)', min:0, max:1.2, step:0.1, def:0.5, group:'CNC 工艺'},
+      {k:'cap', n:'后盖厚',   min:1.5, max:4,  step:0.1, def:2.4, group:'后盖'}
+    ],
+    materials:['alu-silver','alu-sand','alu-black','alu-rose','abs-gloss'],
+    parts:[
+      {id:'bezel', n:'前框(沉台+螺纹)', q:'1', mat:'主材质', proc:'CNC 五轴 + 阳极', tol:'±0.05'},
+      {id:'glass', n:'1.85″ 屏(AA Ø45.68)', q:'1', mat:'外购模组', proc:'—', tol:'±0.10'},
+      {id:'black', n:'黑边装饰环 Ø55',     q:'1', mat:'丝印/黑膜', proc:'—', tol:'±0.10'},
+      {id:'cap',   n:'后盖(M54×1.5 示意)', q:'1', mat:'主材质', proc:'CNC + 阳极 + 回攻', tol:'±0.05'},
+      {id:'boss',  n:'M2 铜柱 ×4',          q:'4', mat:'黄铜嵌件', proc:'CNC 攻牙/嵌件', tol:'±0.05'},
+      {id:'pcb',   n:'主控板 Φ44',           q:'1', mat:'FR-4', proc:'微雪模组', tol:'±0.2'},
+      {id:'cell',  n:'锂电 3.7V',            q:'1', mat:'软包', proc:'外购', tol:'±0.5'},
+      {id:'side',  n:'侧键 / Type-C / 双麦', q:'1', mat:'—', proc:'开孔 + 密封', tol:'±0.08'}
+    ],
+    steps:[
+      {n:'前框阳极 + 螺纹回攻', d:'阳极后 M54×1.5 必须二次回攻,否则后盖咬死。'},
+      {n:'屏入沉台', d:'沉台深 1.2mm,屏厚 1.0mm + 0.2mm 缓冲垫;深 0.1mm 即顶屏。'},
+      {n:'主板锁铜柱', d:'4×M2 铜柱同轴度 ≤0.05,板与壳间加绝缘垫避天线。'},
+      {n:'电池 + 走线', d:'电芯贴后盖,FPC 走侧槽,避开金属腔体谐振点。'},
+      {n:'后盖旋合', d:'M54×1.5 旋 2.5 圈到位,做 0.5m 跌落与气密抽检。'}
+    ],
+    processes:[
+      {key:'cnc-alu', n:'CNC 铝 6061(手板)', mold:0, minQty:1, unit:[[1,135],[5,98],[20,72],[50,58],[200,48]], lead:'5~10 天', note:'含编程,阳极 10~15 元/套另计'},
+      {key:'cnc-abs', n:'CNC ABS(验证用)', mold:0, minQty:1, unit:[[1,85],[5,60],[20,38],[50,28]], lead:'3~6 天', note:'螺纹易滑牙,不建议做量产件'},
+      {key:'die-cast',n:'压铸铝 + CNC 精修', mold:12000, minQty:1000, unit:[[1000,32],[3000,26],[5000,22]], lead:'25~35 天', note:'量产路径,需评估壁厚与阳极'}
+    ],
+    notes:[
+      '沉台深度公差 ±0.03 是整件成本核心,检测需三坐标或专用检具。',
+      '铝合金外壳会屏蔽 2.4G,天线区域必须开非金属窗或做塑胶拼接。',
+      '螺纹后盖在小批量下报废率高(15%~25%),可改 4×M2 螺丝锁盖降本 15~25 元/套。'
+    ],
+    tolerance:[['外径','±0.05'],['总厚','±0.10'],['沉台深','±0.03'],['铜柱同轴','≤0.05'],['螺纹','M54×1.5-6H(示意)']],
+    files:['STEP(AP214,含螺纹实体)','STL 分件','2D PDF 关键尺寸 + GD&T','阳极色板 / 膜厚要求']
+  }
+};
+
+/* ---------------- 电子件库 ---------------- */
+const BOARDS = [
+  {
+    id:'ws185', name:'微雪 ESP32-S3-Touch-LCD-1.85B', tag:'首选 · 成品模组',
+    od:'Ø61.6 × 14.6', screen:'1.85″ 圆屏 360×360', iface:'QSPI 屏 / I2C 触摸 / Type-C',
+    soc:'ESP32-S3R8 · 240MHz · 8MB PSRAM · 16MB Flash',
+    extra:'ES8311 编解码 + ES7210 回声消除 + 双麦阵列 + QMI8658 六轴 + BQ27220 电量 + PCF85063 RTC + MicroSD + MX1.25 电池口 + SH1.0×2',
+    price:'¥208.06 起(1 件,含税)', fit:'round',
+    note:'官方尺寸 Ø61.60 / Ø55.00 / 屏 AA Ø45.68 / 厚 14.60。带壳整机,直接拆壳复用最省事。',
+    source:'waveshare.net / docs.waveshare.net'
+  },
+  {
+    id:'ws128', name:'GC9A01 1.28″ 圆屏 + ESP32-S3 底板', tag:'低成本替代',
+    od:'Ø32.4 屏 / 底板 40×40(参考)', screen:'1.28″ 240×240', iface:'SPI 屏 / I2C',
+    soc:'ESP32-S3-WROOM-1(18×25.5×3.1)',
+    extra:'需自配麦克风与功放;无成品壳,需自己做结构',
+    price:'屏 ¥18~28 / 底板 ¥35~60', fit:'recorder',
+    note:'尺寸为常见模组值,采购前以实际规格书核对;适合做 Φ32 录音豆的主板。',
+    source:'通用模组,需核对'
+  },
+  {
+    id:'esp32s3', name:'ESP32-S3-WROOM-1 模组', tag:'核心件',
+    od:'18.0 × 25.5 × 3.1', screen:'—', iface:'2.4G WiFi + BLE5',
+    soc:'双核 LX7 240MHz · 8MB PSRAM 选配',
+    extra:'需底板:电源、麦克风、功放、充电管理',
+    price:'¥18~30', fit:'recorder',
+    note:'天线净空区 15mm 内不得有金属/电池,壳体需留塑胶窗。',
+    source:'Espressif 数据手册'
+  },
+  {
+    id:'mic', name:'INMP441 I2S MEMS 麦克风', tag:'拾音',
+    od:'15 × 14(模块,参考)', screen:'—', iface:'I2S',
+    soc:'—', extra:'信噪比 61dB,灵敏度 -26dBFS',
+    price:'¥5~9', fit:'recorder',
+    note:'麦孔 Ø1.0 + 后腔 1.5mm;四麦阵列间距建议 ≥8mm 做波束。',
+    source:'模块规格,需核对'
+  },
+  {
+    id:'amp', name:'MAX98357A I2S 功放', tag:'发声',
+    od:'模块 15 × 15(参考)', screen:'—', iface:'I2S + 2.5W',
+    soc:'—', extra:'D 类,需 8Ω 腔体喇叭',
+    price:'¥8~15', fit:'recorder',
+    note:'腔体扬声器与麦孔要隔离,否则回声消除压力大。',
+    source:'模块规格,需核对'
+  },
+  {
+    id:'cell402030', name:'软包锂电 402030', tag:'供电',
+    od:'4.0 × 20 × 30(厚×宽×长)', screen:'—', iface:'3.7V / 约 180~220mAh',
+    soc:'—', extra:'需保护板 + MX1.25 或焊线',
+    price:'¥6~10', fit:'recorder',
+    note:'留 5% 膨胀空间,远离发热器件 2mm 以上。',
+    source:'常见规格,需核对'
+  },
+  {
+    id:'cell103450', name:'软包锂电 103450', tag:'供电',
+    od:'10 × 34 × 50', screen:'—', iface:'3.7V / 约 1800~2000mAh',
+    soc:'—', extra:'适用 Φ61 圆屏机',
+    price:'¥12~18', fit:'round',
+    note:'厚度 10mm + 结构件,Φ61.6 / 14.6 机身内需精确排布。',
+    source:'常见规格,需核对'
+  }
+];
+
+/* ---------------- 知识库 ---------------- */
+const KB = [
+  {
+    id:'process', ix:'01', title:'七种壳体工艺对照(MOQ / 模具 / 单价 / 交期)',
+    body:[
+      ['table', ['工艺','典型 MOQ','一次性费用','单价区间','交期','适用'],[
+        ['硅胶模压(钢模)','500 套','¥1,800~3,500','¥2.5~6/套','12~18 天','量产软壳、包表、双色拼色'],
+        ['ABS/PC 注塑(钢模)','500 套','¥5,500~9,000','¥2.8~6/套','15~20 天','硬壳量产,外观件首选'],
+        ['压铸铝 + CNC','1,000 套','¥10,000~22,000','¥22~32/套','25~35 天','金属量产,需评估阳极'],
+        ['CNC 手板(铝/ABS)','1 件','无模具,收编程调机','¥28~135/套','3~10 天','样机、内测、小批量'],
+        ['真空复模(硅胶模)','10 件','¥200~400','¥12~28/套','5~8 天','10~100 件验证'],
+        ['3D 打印(SLA/FDM)','1 件','无','¥20~60/套','2~4 天','结构验证,不做外观件'],
+        ['公模贴牌','100~200 件','无','¥3~8/套','7~12 天','已有模具,只改色/丝印']
+      ]],
+      ['p','判断口径:一次性费用 ÷ 数量 + 单品价 = 单套综合成本。数量过 200~300 套后,CNC 的总成本通常反超「开模 + 注塑」。']
+    ]
+  },
+  {
+    id:'formats', ix:'02', title:'生产端到底要哪些文件格式(按工艺给清单)',
+    body:[
+      ['table', ['格式','用途','要给谁','注意'],[
+        ['STEP AP214/AP203','3D 实体,含曲面与螺纹','模具厂 / CNC 编程','首选。必须带内腔、卡扣、螺纹实体,不能只给网格'],
+        ['STL(弦高 0.05mm)','网格,快速评估与 3D 打印','手板厂 / 打印','只用于看形,不能直接开钢模'],
+        ['3MF','打印用,含颜色与单位','3D 打印','比 STL 稳,少破面'],
+        ['OBJ','带材质分组的网格','渲染 / 展示','不适合生产'],
+        ['DXF','2D 轮廓 / 开孔坐标','线切割、开孔','配合 2D 图纸使用'],
+        ['PDF A3 2D 图纸','三视图 + 剖视 + 尺寸 + GD&T','所有人','1:1 打印,标基准 A/B/C'],
+        ['BOM / CSV','零件、材质、数量、工艺','采购 / 报价','报价必须逐项回填'],
+        ['色卡 / 膜厚要求','阳极色号、Pantone、Ra','表面处理厂','不给色号一定返工']
+      ]],
+      ['p','给工厂的最小闭环:STEP + 2D PDF + 需求单(材质/工艺/公差/数量/表面处理)。只给 STL 或只给图片,正规厂会直接判定为「无法报价」。']
+    ]
+  },
+  {
+    id:'draw', ix:'03', title:'2D 图纸标注规范(手机端也能看懂的最小集)',
+    body:[
+      ['ul',[
+        '基准:主基准 A(底面)、B/C(两互相垂直的边或中心线),铜柱与孔位全部相对基准标注。',
+        '关键尺寸:沉台深、螺纹规格、壁厚、孔位坐标、装配间隙,逐项给公差。',
+        '未注公差:ABS/硅胶 ISO 2768-m;CNC 金属建议 ±0.1 或 2768-f。',
+        '形位公差:铜柱同轴度 ≤0.05,平面度 0.1,沉台对基准面平行度 0.05。',
+        '表面:Ra 标注(CNC 铝 Ra1.6,喷砂 Ra3.2),阳极膜厚 10~15μm。',
+        '螺纹:M54×1.5-6H(示意);标注「阳极后二次回攻」字样。',
+        '去毛刺、倒角 C0.3、脱模斜度 1°~2°,写在技术要求里而不是画在图上。'
+      ]],
+      ['note','本项目导出的是「需求描述单 + STL/OBJ + 尺寸表」,够工厂报价和评估;正式开模仍需要 STEP 或由工厂按图建模(建模费 ¥500~1,500)。']
+    ]
+  },
+  {
+    id:'dfm', ix:'04', title:'DFM 检查清单(开模前逐条过)',
+    body:[
+      ['table', ['项目','经验值','违反后果'],[
+        ['ABS 壁厚','1.2~2.0mm,均匀','缩水、变形、装配错位'],
+        ['硅胶壁厚','≥1.2mm,回弹区 2~3mm','夹持松脱、撕裂'],
+        ['拔模斜度','1°~2°(纹理面 3°)','拉伤、顶白'],
+        ['内圆角','≥0.5×壁厚','应力集中、开裂'],
+        ['卡扣','过盈 0.3~0.5mm + 1° 导向','装配良率 <80%'],
+        ['螺丝柱','M2 外径 Φ4.0,内孔 Φ1.6','滑牙、缩水'],
+        ['沉台','深公差 ±0.03,圆角 R0.2','顶碎屏 / 漏光'],
+        ['天线净空','15mm 内无金属与电池','WiFi 掉到 -75dBm'],
+        ['密封','槽宽 1.0 + 0.5mm 压缩量','气密不过'],
+        ['脱模','顶针位避开外观面','顶白不可修']
+      ]]
+    ]
+  },
+  {
+    id:'cost', ix:'05', title:'报价谈判口径(怎么问才不被糊)',
+    body:[
+      ['ul',[
+        '先问「模具费是否含试模、改模几次、模具归属」,不接受「模具费摊在单价里」的模糊说法。',
+        '要求分项:材料费 / 加工费 / 表面处理 / 包装 / 模具 / 打样,一口价无法比价。',
+        '问清 MOQ 是「模具起订」还是「后处理开机费」。喷油、阳极常有 20 件开机门槛。',
+        '问清公差是按图纸全检还是抽检,首件是否提供三坐标报告。',
+        '小批量先做手板(CNC/复模),确认装配与手感后再投钢模,避免 ¥6,500 打水漂。',
+        '报价单必须写有效期与含税/不含税,模具费通常单独开票。'
+      ]]
+    ]
+  },
+  {
+    id:'elec', ix:'06', title:'电子件选型原则:先用成熟开发板,别自己打板',
+    body:[
+      ['p','这一轮产品(录音豆 / 圆屏吧唧 / 表壳配件)全部走「成熟模组 + 焊接/接插件 + 结构固定」,把 PCB 风险降到最低。'],
+      ['ul',[
+        '圆屏机直接复用微雪 1.85B 整机:屏、触摸、双麦、功放、IMU、电量、RTC、Type-C、锂电口全部现成,只做外壳替换。',
+        '录音豆用 ESP32-S3-WROOM-1 + INMP441 + MAX98357A + TP4056 + 402030 电芯,飞线或洞洞板即可完成原型。',
+        '需要量产再把模组方案转成邮票孔底板(仍不打主控板),单板成本可压到 ¥25~40。',
+        '结构件必须给电子件留「装配余量 + 天线净空 + 声腔」,否则外壳做完装不进去。',
+        '接口固定优先卡扣/限位柱,其次 M2 螺丝;能不用胶就不用胶。'
+      ]],
+      ['note','电子件尺寸一律以官方图纸为准;本项目内的尺寸用于排布预演,打样前需实测。']
+    ]
+  }
+];
+
+KB.push({
+  id:'surface', ix:'07', title:'表面处理:阳极 / 喷油 / 镭雕怎么选',
+  body:[
+    ['table',['工艺','效果','成本','注意'],[
+      ['阳极氧化(铝)','金属质感、耐磨、绝缘','¥6~15/套(含前处理)','颜色批次色差 ΔE≤1.5;螺纹需二次回攻;膜厚 10~15μm'],
+      ['喷砂 + 阳极','细腻哑光金属','¥3~8/套 加价','砂号 120#~220#,同一批统一喷砂压力'],
+      ['喷橡胶漆(ABS)','类肤手感、遮缩水','¥1.5~3/套','耐磨 500g/100 次;边角易露底'],
+      ['UV 高光(ABS)','局部亮面','¥0.8~2/套','需专用治具,小批量分摊高'],
+      ['丝印 / 移印','logo、刻度','¥0.5~1.5/处','最小线宽 0.15,套色 ≤4 色'],
+      ['镭雕','永久标识、细字','¥0.3~0.8/处','浅色底要打深色底漆才清晰']
+    ]],
+    ['note','表面处理常有最小开机批次(喷油 20 件、阳极 50 件)。数量不足时会被收整批开机费,这也是「CNC 件突然报 MOQ」的常见原因。']
+  ]
+});
+KB.push({
+  id:'timeline', ix:'08', title:'从创意到量产的 6 个里程碑',
+  body:[
+    ['ul',[
+      'M1 概念锁定:定外形尺寸、材质、装配方式,产出参数快照(本工具即可)。',
+      'M2 手板验证:CNC/复模 1~5 套,装电子件实测干涉、手感、天线。',
+      'M3 图纸冻结:补 STEP、2D 图纸、公差与 GD&T,供应商 DFM 回签。',
+      'M4 开模试模:T1 试模件确认缩水/变形,T2 修模后做首件报告。',
+      'M5 小批试产:50~200 套,跑装配良率与老化,锁定工艺参数。',
+      'M6 量产:MOQ 起订,按 AQL 抽检,模具与治具归档。'
+    ]],
+    ['p','关键卡点:M2 不做就直接开模,是 80% 外观件返工的原因;M3 不给 STEP 只给图片,正规厂不会接。']
+  ]
+});
+
+KB.push({
+  id:'model', ix:'09', title:'工艺化轻量建模:为什么「自由雕刻」要按工艺分规则',
+  body:[
+    ['p','网页端没有实体布尔运算(不开 CSG 是怕曲面炸开),所以建模走「参数化主体 + 附加结构体」:主体由尺寸参数定义,内部筋、铜柱、开槽、开孔以独立结构件叠加,位置用毫米数值 + 吸附精确控制。'],
+    ['table',['工艺','自由度','必须在模型里标出来的东西'],
+      [['注塑 / 硅胶','高:筋、柱、槽都能加','拔模角、最小壁厚、筋厚、圆角、缩水率'],
+       ['CNC 铝','中:以减料为主','刀具半径(内角 R)、最小壁厚、深腔比、螺纹规格、基准与公差'],
+       ['真空复模','中:同注塑但更自由','收缩补偿 0.3%、壁厚 ≥1.2'],
+       ['压铸','低:拔模与料位受限','拔模 ≥1.5°、料位/渣包、后加工余量']]],
+    ['ul',[
+      '吸附口径:位置吸附 0.5 / 1 / 5 mm;「贴内壁」按内腔边界自动算 x/z,不留手算误差。',
+      '每加一个结构件都要能报出:位置(x,y,z)、外形尺寸、壁厚/筋厚、与内腔的余量。',
+      '余量 < 1mm 的结构件,注塑会粘模、CNC 会让刀,模型阶段就要报警。',
+      '导出时结构件随主体一起进 STL/OBJ,并在需求单里单列坐标表,工厂才能照着做。'
+    ]],
+    ['note','轻量建模的边界:能做「外形 + 内部支撑结构 + 开孔标记」,不能做真实刀路与模流分析;定稿仍要 STEP + 2D 图纸。']
+  ]
+});
+
+const REFS = [
+  {
+    id:'wx1', n:'微信公众号文章(待补录全文)',
+    u:'https://mp.weixin.qq.com/s/9mUdMT78YCpWuuqDSKU5QQ',
+    d:'该链接对自动抓取有 robots 限制,无法在网页端直接取回正文。已保留原始链接,并提供手动粘贴录入入口,录入后长期保存在本机。',
+    tag:'参考文章'
+  },
+  {
+    id:'db1', n:'豆包对话记录(本项目前期讨论)',
+    u:'https://www.doubao.com/thread/xRkAJOJE74pwLYX2H',
+    d:'前期关于硅胶壳 / 录音豆 / 圆屏铝壳的 MOQ、CNC 与注塑报价讨论原始记录。',
+    tag:'对话存档'
+  }
+];
+/* =========================================================
+   几何引擎:参数化壳体 + 材质 + 爆炸图 + 标注 + 导出
+   1 单位 = 1 mm
+   ========================================================= */
+
+const STAGE = (function(){
+  const B = BABYLON;
+  const V3 = function(x,y,z){ return new B.Vector3(x,y,z); };
+
+  let engine=null, scene=null, camera=null, ground=null, root=null, dimRoot=null, shadowMat=null;
+  let host=null, canvas=null, readyFlag=false, pending=null;
+  let labels=[], labelEls=[];
+  const matCache={}, fixedCache={};
+  let cur={ project:'silicone', params:{}, material:'', explode:0, dims:true, cutForce:false };
+  let parts=[];
+  let customMap={}, cutaway=false, selCb=null, dragCb=null, custUid=1, solo=null;
+
+  /* ---------------- 材质 ---------------- */
+  function pbr(key,cfg){
+    if(matCache[key]) return matCache[key];
+    const m=new B.PBRMaterial('mat-'+key,scene);
+    m.albedoColor=B.Color3.FromHexString(cfg.albedo);
+    m.metallic=cfg.metallic!==undefined?cfg.metallic:0;
+    m.roughness=cfg.rough!==undefined?cfg.rough:0.5;
+    if(cfg.cc!==undefined){
+      m.clearCoat.isEnabled=true;
+      m.clearCoat.intensity=cfg.cc;
+      m.clearCoat.roughness=Math.max(0.03,1-(cfg.cci||0.35));
+    }
+    if(cfg.alpha!==undefined){
+      m.alpha=cfg.alpha;
+      m.transparencyMode=B.Material.MATERIAL_ALPHABLEND;
+    }
+    if(cfg.env!==undefined) m.environmentIntensity=cfg.env;
+    m.backFaceCulling=false;
+    matCache[key]=m;
+    return m;
+  }
+  function fixed(key){
+    if(fixedCache[key]) return fixedCache[key];
+    fixedCache[key]=pbr('fx-'+key, FIXED_MATS[key]);
+    return fixedCache[key];
+  }
+
+  /* 半透明「透视」材质:爆炸/剖视时让内部结构可见 */
+  function ghost(key){
+    const gk='gh-'+key;
+    if(matCache[gk]) return matCache[gk];
+    const src=MATERIALS[key]||MATERIALS[PROJECTS[cur.project].materials[0]];
+    const cfg=Object.assign({},src,{alpha:0.30,env:0.2,cc:0.05});
+    return pbr(gk,cfg);
+  }
+
+  /* ---------------- 2D 轮廓 ---------------- */
+  function roundedPath(w,h,r,seg){
+    const hw=w/2,hh=h/2;
+    r=Math.max(0.05,Math.min(r,Math.min(hw,hh)-0.02));
+    const pts=[];
+    const corners=[
+      {cx:hw-r,cz:hh-r,a0:0},
+      {cx:-(hw-r),cz:hh-r,a0:90},
+      {cx:-(hw-r),cz:-(hh-r),a0:180},
+      {cx:hw-r,cz:-(hh-r),a0:270}
+    ];
+    for(const c of corners){
+      for(let i=0;i<seg;i++){
+        const a=(c.a0+90*i/seg)*Math.PI/180;
+        pts.push({x:c.cx+r*Math.cos(a),z:c.cz+r*Math.sin(a)});
+      }
+    }
+    return pts;
+  }
+
+  function radialN(p){ const l=Math.hypot(p.x,p.z)||1; return V3(p.x/l,0,p.z/l); }
+
+  function assemble(name,chunks,parent){
+    const pos=[],idx=[],nrm=[];
+    let base=0;
+    chunks.forEach(ch=>{
+      ch.p.forEach(v=>pos.push(v.x,v.y,v.z));
+      ch.n.forEach(v=>nrm.push(v.x,v.y,v.z));
+      ch.i.forEach(i=>idx.push(i+base));
+      base+=ch.p.length;
+    });
+    const vd=new B.VertexData();
+    vd.positions=pos; vd.indices=idx; vd.normals=nrm;
+    const mesh=new B.Mesh(name,scene);
+    vd.applyToMesh(mesh);
+    if(parent) mesh.parent=parent;
+    return mesh;
+  }
+
+  /* 环带(上下两个同点数轮廓) */
+  function ringStrip(ringA,yA,ringB,yB,nf){
+    const N=ringA.length,p=[],n=[],i=[];
+    for(let k=0;k<N;k++){
+      const a=ringA[k],b=ringB[k];
+      p.push(V3(a.x,yA,a.z),V3(b.x,yB,b.z));
+      n.push(nf(a,true),nf(b,false));
+    }
+    for(let k=0;k<N;k++){
+      const a1=k*2,b1=k*2+1,a2=((k+1)%N)*2,b2=((k+1)%N)*2+1;
+      i.push(a1,a2,b2,a1,b2,b1);
+    }
+    return {p,n,i};
+  }
+
+  /* 空心圆角框(表壳类) */
+  function hollowFrame(name,spec,parent){
+    const {ow,od,orr,iw,id,irr,y0,y1,chamfer,seg}=spec;
+    const A=roundedPath(ow,od,orr,seg);
+    const Bc=roundedPath(ow,od,orr,seg);
+    const C=roundedPath(Math.max(1,ow-2*chamfer),Math.max(1,od-2*chamfer),Math.max(0.2,orr-chamfer),seg);
+    const D=roundedPath(iw,id,irr,seg);
+    const E=roundedPath(iw,id,irr,seg);
+    const ch=[];
+    ch.push(ringStrip(A,y0,Bc,y1-chamfer,p=>radialN(p)));
+    ch.push(ringStrip(Bc,y1-chamfer,C,y1,p=>{
+      const r=radialN(p); return V3(r.x*0.707,0.707,r.z*0.707);
+    }));
+    ch.push(ringStrip(C,y1,D,y1,()=>V3(0,1,0)));
+    ch.push(ringStrip(D,y1,E,y0,p=>{
+      const r=radialN(p); return V3(-r.x,0,-r.z);
+    }));
+    ch.push(ringStrip(E,y0,A,y0,()=>V3(0,-1,0)));
+    return assemble(name,ch,parent);
+  }
+
+  /* 实心圆角板 */
+  function solidSlab(name,spec,parent){
+    const {w,d,r,y0,y1,seg}=spec;
+    const A=roundedPath(w,d,r,seg);
+    const ch=[];
+    ch.push(ringStrip(A,y0,roundedPath(w,d,r,seg),y1,p=>radialN(p)));
+    const tp=[V3(0,y1,0)],tn=[V3(0,1,0)],ti=[];
+    A.forEach(p=>{ tp.push(V3(p.x,y1,p.z)); tn.push(V3(0,1,0)); });
+    for(let k=0;k<A.length;k++) ti.push(0,1+k,1+((k+1)%A.length));
+    ch.push({p:tp,n:tn,i:ti});
+    const bp=[V3(0,y0,0)],bn=[V3(0,-1,0)],bi=[];
+    A.forEach(p=>{ bp.push(V3(p.x,y0,p.z)); bn.push(V3(0,-1,0)); });
+    for(let k=0;k<A.length;k++) bi.push(0,1+((k+1)%A.length),1+k);
+    ch.push({p:bp,n:bn,i:bi});
+    return assemble(name,ch,parent);
+  }
+
+  /* 回转体:profile = [{r,y}] 闭合,按 CCW 给出(法线自动朝外) */
+  function revolve(name,profile,seg,parent){
+    const ch=[];
+    for(let k=0;k<profile.length;k++){
+      const p0=profile[k],p1=profile[(k+1)%profile.length];
+      const dr=p1.r-p0.r,dy=p1.y-p0.y,len=Math.hypot(dr,dy);
+      if(len<1e-4) continue;
+      const n2r=dy/len,n2y=-dr/len;
+      const pos=[],nrm=[],idx=[];
+      for(let j=0;j<seg;j++){
+        const th=j/seg*Math.PI*2, th2=((j+1)%seg)/seg*Math.PI*2;
+        const c0=Math.cos(th),s0=Math.sin(th),c1=Math.cos(th2),s1=Math.sin(th2);
+        pos.push(V3(p0.r*c0,p0.y,p0.r*s0),V3(p1.r*c0,p1.y,p1.r*s0),V3(p1.r*c1,p1.y,p1.r*s1),V3(p0.r*c1,p0.y,p0.r*s1));
+        nrm.push(V3(n2r*c0,n2y,n2r*s0),V3(n2r*c0,n2y,n2r*s0),V3(n2r*c1,n2y,n2r*s1),V3(n2r*c1,n2y,n2r*s1));
+      }
+      for(let j=0;j<seg;j++){
+        const b=j*4;
+        idx.push(b,b+1,b+2,b,b+2,b+3);
+      }
+      ch.push({p:pos,n:nrm,i:idx});
+    }
+    return assemble(name,ch,parent);
+  }
+
+  function arcPts(cx,cy,r,a0,a1,n){
+    const out=[];
+    for(let i=0;i<=n;i++){
+      const a=(a0+(a1-a0)*i/n)*Math.PI/180;
+      out.push({r:cx+r*Math.cos(a),y:cy+r*Math.sin(a)});
+    }
+    return out;
+  }
+  function dedupe(pts){
+    const out=[];
+    pts.forEach(p=>{
+      const last=out[out.length-1];
+      if(!last||Math.abs(last.r-p.r)>1e-4||Math.abs(last.y-p.y)>1e-4) out.push(p);
+    });
+    if(out.length>2){
+      const f=out[0],l=out[out.length-1];
+      if(Math.abs(f.r-l.r)<1e-4&&Math.abs(f.y-l.y)<1e-4) out.pop();
+    }
+    return out;
+  }
+
+  /* ---------------- 场景 ---------------- */
+  function init(canvasEl,hostEl){
+    canvas=canvasEl; host=hostEl;
+    engine=new B.Engine(canvas,true,{preserveDrawingBuffer:true,stencil:true,alpha:true},true);
+    engine.setHardwareScalingLevel(1/Math.min(2,window.devicePixelRatio||1));
+    scene=new B.Scene(engine);
+    scene.clearColor=new B.Color4(0,0,0,0);
+    scene.ambientColor=new B.Color3(0.16,0.18,0.22);
+
+    camera=new B.ArcRotateCamera('cam',-1.05,1.03,150,V3(0,0,0),scene);
+    camera.lowerRadiusLimit=18; camera.upperRadiusLimit=900;
+    camera.lowerBetaLimit=0.1; camera.upperBetaLimit=1.54;
+    camera.wheelDeltaPercentage=0.02;
+    camera.pinchDeltaPercentage=0.03;
+    camera.attachControl(canvas,true);
+    camera.minZ=0.1; camera.fov=0.75; camera.inertia=0.72;
+    camera.pinchZoom=true;
+    camera.panningSensibility=160;
+    camera.angularSensibilityX=760; camera.angularSensibilityY=760;
+    camera.useNaturalPinchZoom=true;
+    camera.allowUpsideDown=false;
+
+    const hemi=new B.HemisphericLight('hemi',V3(0.1,1,0.2),scene);
+    hemi.intensity=0.5;
+    hemi.groundColor=new B.Color3(0.10,0.12,0.16);
+    const d1=new B.DirectionalLight('d1',V3(-0.5,-1,-0.7),scene);
+    d1.intensity=1.5; d1.position=V3(140,200,160);
+    const d2=new B.DirectionalLight('d2',V3(0.8,-0.55,0.7),scene);
+    d2.intensity=0.85; d2.position=V3(-160,120,-180);
+
+    try{
+      const env=B.CubeTexture.CreateFromPrefilteredData('https://assets.babylonjs.com/environments/environmentSpecular.env',scene);
+      scene.environmentTexture=env;
+      scene.environmentIntensity=0.9;
+    }catch(e){ scene.environmentIntensity=0; }
+
+    const dt=new B.DynamicTexture('shadowTex',{width:256,height:256},scene,false);
+    const ctx=dt.getContext();
+    const g=ctx.createRadialGradient(128,128,6,128,128,126);
+    g.addColorStop(0,'rgba(0,0,0,0.55)');
+    g.addColorStop(0.4,'rgba(0,0,0,0.28)');
+    g.addColorStop(0.72,'rgba(0,0,0,0.09)');
+    g.addColorStop(1,'rgba(0,0,0,0)');
+    ctx.fillStyle=g; ctx.fillRect(0,0,256,256); dt.update();
+    ground=B.MeshBuilder.CreateGround('ground',{width:300,height:300},scene);
+    shadowMat=new B.StandardMaterial('shadowMat',scene);
+    shadowMat.diffuseTexture=dt; shadowMat.opacityTexture=dt;
+    shadowMat.emissiveColor=new B.Color3(0,0,0);
+    shadowMat.specularColor=new B.Color3(0,0,0);
+    shadowMat.disableLighting=true;
+    shadowMat.backFaceCulling=false;
+    ground.material=shadowMat; ground.isPickable=false;
+
+    engine.runRenderLoop(()=>{
+      if(scene) scene.render();
+      updateLabels();
+    });
+    new ResizeObserver(()=>engine.resize()).observe(host);
+    window.addEventListener('resize',()=>engine.resize());
+
+    readyFlag=true;
+    scene.onPointerObservable.add(pi=>{
+      if(pi.type===B.PointerEventTypes.POINTERDOUBLETAP){
+        const m2=pi.pickInfo&&pi.pickInfo.pickedMesh;
+        const md2=m2&&m2.metadata;
+        if(md2&&md2.part) focusPart(md2.part); else frame();
+        return;
+      }
+      if(pi.type!==B.PointerEventTypes.POINTERPICK) return;
+      const m=pi.pickInfo&&pi.pickInfo.pickedMesh;
+      if(!m) return;
+      const md=m.metadata||{};
+      if(!md.part){ if(selCb) selCb(null); return; }
+      highlight(md.part);
+      if(selCb) selCb(md.part,md.custom?m:null);
+    });
+    ensureLabelHost();
+    if(pending){ const p=pending; pending=null; load(p.project,p.params,p.material,p.explode); }
+  }
+
+  function ensureLabelHost(){
+    if(!host) return null;
+    let el=host.querySelector('.dimlayer');
+    if(!el){ el=document.createElement('div'); el.className='dimlayer'; host.appendChild(el); }
+    return el;
+  }
+
+  /* ---------------- 标注 ---------------- */
+  function addDim(a,b,text,color){
+    if(!dimRoot) dimRoot=new B.TransformNode('dims',scene);
+    const col=B.Color3.FromHexString(color||'#7ec8ff');
+    const line=B.MeshBuilder.CreateLines('dl',{points:[a,b]},scene);
+    line.color=col; line.parent=dimRoot; line.isPickable=false;
+    const dir=b.subtract(a);
+    if(dir.length()>0.05){
+      const d=dir.normalize();
+      const perp=V3(-d.z,0.4,d.x);
+      if(perp.length()>0.05){
+        perp.normalize();
+        [a,b].forEach(pt=>{
+          const tick=B.MeshBuilder.CreateLines('tk',{points:[pt.add(perp.scale(2.0)),pt.subtract(perp.scale(2.0))]},scene);
+          tick.color=col; tick.parent=dimRoot; tick.isPickable=false;
+        });
+      }
+    }
+    labels.push({p:a.add(b).scale(0.5),t:text});
+  }
+
+  /* ---------------- 建模:三款 ---------------- */
+  function buildSilicone(p){
+    const g=new B.TransformNode('root',scene);
+    const seg=24;
+    const t=p.t, ow=p.w+2*t, od=p.d+2*t, y0=-p.h/2, y1=p.h/2;
+    const ir=Math.max(0.5,p.r), orr=ir+t;
+
+    const body=hollowFrame('body',{ow,od,orr,iw:p.w,id:p.d,irr:ir,y0,y1,chamfer:0.7,seg},g);
+    body.metadata={role:'body',part:'body'};
+
+    const floor=solidSlab('floor',{w:p.w-0.4,d:p.d-0.4,r:Math.max(0.5,ir-0.2),y0,y1:y0+1.2,seg},g);
+    floor.metadata={role:'body',part:'floor'};
+
+    const hx=p.hg/2, hz=-(od/2-3.0);
+    const hornL=B.MeshBuilder.CreateCylinder('hornL',{diameterBottom:p.hd,diameterTop:p.hd*0.28,height:p.hh,tessellation:18},scene);
+    hornL.position=V3(-hx,y1+p.hh/2-0.45,hz); hornL.rotation.x=-0.28; hornL.rotation.z=-0.10; hornL.parent=g;
+    hornL.metadata={role:'accent',part:'hornL'};
+    const hornR=B.MeshBuilder.CreateCylinder('hornR',{diameterBottom:p.hd,diameterTop:p.hd*0.28,height:p.hh,tessellation:18},scene);
+    hornR.position=V3(hx,y1+p.hh/2-0.45,hz); hornR.rotation.x=-0.28; hornR.rotation.z=0.10; hornR.parent=g;
+    hornR.metadata={role:'accent',part:'hornR'};
+
+    const screen=solidSlab('screen',{w:Math.max(6,p.w-2.8),d:Math.max(6,p.d-2.8),r:Math.max(0.4,ir-1.4),y0:y1-0.62,y1:y1-0.30,seg},g);
+    screen.metadata={role:'glass',part:'screen'};
+
+    const crown=B.MeshBuilder.CreateCylinder('crown',{diameter:3.2,height:2.2,tessellation:16},scene);
+    crown.rotation.z=Math.PI/2;
+    crown.position=V3(ow/2+p.cr*0.5,y0+p.h*0.55,0); crown.parent=g;
+    crown.metadata={role:'body',part:'crown'};
+
+    addDim(V3(-ow/2,y0-5.5,od/2+2.5),V3(ow/2,y0-5.5,od/2+2.5),'外宽 '+ow.toFixed(1));
+    addDim(V3(-(ow/2+4),y0-1,od/2+3),V3(-(ow/2+4),y1,od/2+3),'总高 '+p.h.toFixed(1));
+    addDim(V3(ow/2+11,y0-5.5,-od/2),V3(ow/2+11,y0-5.5,od/2),'外深 '+od.toFixed(1));
+    addDim(V3(-p.hg/2,y1+p.hh+2.0,hz),V3(p.hg/2,y1+p.hh+2.0,hz),'角距 '+p.hg.toFixed(1));
+
+    return {root:g,size:V3(ow,p.h+p.hh*2,od),parts:[
+      {id:'body',node:body,ex:V3(0,0,0)},
+      {id:'floor',node:floor,ex:V3(0,-14,0)},
+      {id:'hornL',node:hornL,ex:V3(-7,16,0)},
+      {id:'hornR',node:hornR,ex:V3(7,16,0)},
+      {id:'screen',node:screen,ex:V3(0,20,0)},
+      {id:'crown',node:crown,ex:V3(16,4,0)}
+    ]};
+  }
+
+  function buildRecorder(p){
+    const g=new B.TransformNode('root',scene);
+    const seg=48;
+    const ro=p.D/2, ri=ro-p.t, y0=-p.H/2, y1=p.H/2;
+    const r=Math.min(p.t*0.65,1.8);
+
+    const bodyProf=dedupe([
+      {r:ri,y:y0+r},
+      ...arcPts(ri+r,y0+r,r,180,270,3),
+      ...arcPts(ro-r,y0+r,r,270,360,3),
+      {r:ro,y:y1},
+      {r:ri,y:y1}
+    ]);
+    const body=revolve('body',bodyProf,seg,g);
+    body.metadata={role:'body',part:'body'};
+
+    const base=revolve('base',dedupe([
+      {r:0.6,y:y0},{r:Math.max(2,ro-1.2),y:y0},{r:Math.max(2,ro-1.2),y:y0+1.1},{r:0.6,y:y0+1.1}
+    ]),seg,g);
+    base.metadata={role:'body',part:'base'};
+
+    // 上盖穹顶
+    const dome=p.dm, lidPts=[{r:0.5,y:y1},{r:ro-0.2,y:y1}];
+    const steps=9;
+    for(let i=0;i<=steps;i++){
+      const a=i/steps*Math.PI/2;
+      lidPts.push({r:0.5+(ro-0.7)*Math.cos(a),y:y1+dome*Math.sin(a)});
+    }
+    const lid=revolve('lid',dedupe(lidPts),seg,g);
+    lid.metadata={role:'body',part:'lid'};
+
+    const loop=B.MeshBuilder.CreateTorus('loop',{diameter:p.ld+p.t*1.9,thickness:p.t*0.9,tessellation:28},scene);
+    loop.rotation.x=Math.PI/2;
+    loop.position=V3(ro+p.lh*0.55,y1-1.6,0); loop.parent=g;
+    loop.metadata={role:'body',part:'loop'};
+
+    const micMeshes=[];
+    const micR=Math.max(4,ro*0.4);
+    for(let i=0;i<4;i++){
+      const a=Math.PI/4+i*Math.PI/2;
+      const m=B.MeshBuilder.CreateCylinder('mic'+i,{diameter:1.0,height:1.8,tessellation:10},scene);
+      m.position=V3(Math.cos(a)*micR,y1+dome*0.72+0.2,Math.sin(a)*micR);
+      m.parent=g; m.material=fixed('dark');
+      m.metadata={role:'dark',part:'mic'};
+      micMeshes.push(m);
+    }
+
+    const usb=B.MeshBuilder.CreateBox('usbc',{width:1.4,height:3.2,depth:9.0},scene);
+    usb.position=V3(ro-0.4,y0+3.0,0); usb.parent=g; usb.material=fixed('dark');
+    usb.metadata={role:'dark',part:'usbc'};
+
+    const btn=B.MeshBuilder.CreateCylinder('btn',{diameter:3.6,height:1.2,tessellation:20},scene);
+    btn.rotation.z=Math.PI/2; btn.position=V3(-ro+0.1,y1-1.2,0); btn.parent=g;
+    btn.metadata={role:'body',part:'btn'};
+
+    const pcb=B.MeshBuilder.CreateCylinder('pcb',{diameter:Math.min(ro*2-5,26),height:1.2,tessellation:32},scene);
+    pcb.position=V3(0,y1-3.4,0); pcb.parent=g; pcb.material=fixed('pcb');
+    pcb.metadata={role:'pcb',part:'pcb'};
+
+    const cell=B.MeshBuilder.CreateCylinder('cell',{diameter:Math.min(ro*2-8,20),height:5.4,tessellation:28},scene);
+    cell.position=V3(0,y0+4.4,0); cell.parent=g; cell.material=fixed('cell');
+    cell.metadata={role:'cell',part:'cell'};
+
+    addDim(V3(-ro,y0-7,0),V3(ro,y0-7,0),'Ø'+p.D.toFixed(1));
+    addDim(V3(ro+9,y0,0),V3(ro+9,y1,0),'高 '+p.H.toFixed(1));
+    addDim(V3(0,y1+6,0),V3(ro+p.lh+2,y1+6,0),'挂环 '+p.lh.toFixed(1));
+
+    const ps=[
+      {id:'body',node:body,ex:V3(0,0,0)},
+      {id:'base',node:base,ex:V3(0,-16,0)},
+      {id:'cell',node:cell,ex:V3(0,2,0)},
+      {id:'pcb',node:pcb,ex:V3(0,14,0)},
+      {id:'lid',node:lid,ex:V3(0,26,0)},
+      {id:'loop',node:loop,ex:V3(18,2,0)},
+      {id:'btn',node:btn,ex:V3(-18,2,0)},
+      {id:'usbc',node:usb,ex:V3(16,-2,0)}
+    ];
+    micMeshes.forEach(m=>ps.push({id:'mic',node:m,ex:V3(0,30,0)}));
+    return {root:g,size:V3(p.D+10,p.H+p.dm, p.D),parts:ps};
+  }
+
+  function buildRound(p){
+    const g=new B.TransformNode('root',scene);
+    const seg=64;
+    const ro=p.D/2, y0=-p.H/2, y1=p.H/2, bd=p.bd/2, sd=p.sd/2, dep=p.dep;
+    const re=Math.min(3.0,p.t*1.3);
+
+    /* CNC 弧面:外壁 → 顶部凸圆 R → 极短平台 → 屏边凹圆 R → 沉台
+       全部由工艺参数驱动,工厂按 rimR / dep / cham 直接编程 */
+    const rimR=Math.max(0.4,Math.min(p.rimR||1.8, (ro-bd)*0.55));
+    const cham=Math.max(0,Math.min(p.cham||0.5, (ro-bd)*0.35));
+    const seam=Math.max(0.5,Math.min(p.dep||1.2, ro-rimR-bd+0.02));
+    const flat=Math.max(0,ro-rimR-(bd+seam));
+    const bezelProf=dedupe([
+      {r:sd,y:y0},
+      {r:Math.max(sd,ro-cham),y:y0},
+      ...(cham>0.05?arcPts(ro-cham,y0+cham,cham,270,360,3):[{r:ro,y:y0}]),
+      {r:ro,y:y1-rimR},
+      ...arcPts(ro-rimR,y1-rimR,rimR,0,90,6),
+      ...(flat>0.15?[{r:bd+seam,y:y1}]:[]),
+      ...arcPts(bd+seam,y1-seam,seam,90,180,6),
+      {r:sd,y:y1-seam}
+    ]);
+    const bezel=revolve('bezel',bezelProf,seg,g);
+    bezel.metadata={role:'body',part:'bezel'};
+
+    const seatY=y1-seam;
+    const black=B.MeshBuilder.CreateCylinder('black',{diameter:p.bd-0.3,height:0.6,tessellation:seg},scene);
+    black.position=V3(0,seatY+0.3,0); black.parent=g; black.material=fixed('dark');
+    black.metadata={role:'dark',part:'black'};
+
+    const glass=B.MeshBuilder.CreateCylinder('glass',{diameter:p.sd+0.4,height:0.8,tessellation:seg},scene);
+    glass.position=V3(0,seatY+0.4,0); glass.parent=g; glass.material=fixed('glass');
+    glass.metadata={role:'glass',part:'glass'};
+
+    const capProf=dedupe([
+      {r:0.6,y:y0},
+      {r:ro-p.t-0.6,y:y0},
+      {r:ro-p.t-0.6,y:y0+p.cap-0.5},
+      ...arcPts(ro-p.t-1.1,y0+p.cap-0.5,0.5,0,90,2),
+      {r:0.6,y:y0+p.cap}
+    ]);
+    const cap=revolve('cap',capProf,seg,g);
+    cap.metadata={role:'body',part:'cap'};
+
+    const th=B.MeshBuilder.CreateTorus('thread',{diameter:p.D-p.t*2-1.6,thickness:0.9,tessellation:seg},scene);
+    th.position=V3(0,y0+p.cap+0.05,0); th.parent=g; th.material=fixed('dark');
+    th.metadata={role:'dark',part:'thread'};
+
+    const bosses=[];
+    for(let i=0;i<4;i++){
+      const a=Math.PI/4+i*Math.PI/2;
+      const b=B.MeshBuilder.CreateCylinder('boss'+i,{diameter:4.2,height:5.2,tessellation:14},scene);
+      b.position=V3(Math.cos(a)*(ro-9),y0+p.cap+2.8,Math.sin(a)*(ro-9));
+      b.parent=g; b.material=fixed('brass');
+      b.metadata={role:'brass',part:'boss'};
+      bosses.push(b);
+    }
+
+    const pcb=B.MeshBuilder.CreateCylinder('pcb',{diameter:Math.min(44,p.D-14),height:1.2,tessellation:40},scene);
+    pcb.position=V3(0,y1-dep-3.4,0); pcb.parent=g; pcb.material=fixed('pcbDark');
+    pcb.metadata={role:'pcb',part:'pcb'};
+
+    const cell=B.MeshBuilder.CreateCylinder('cell',{diameter:Math.min(36,p.D-22),height:5.0,tessellation:36},scene);
+    cell.position=V3(0,y0+p.cap+4.6,0); cell.parent=g; cell.material=fixed('cell');
+    cell.metadata={role:'cell',part:'cell'};
+
+    const sb=B.MeshBuilder.CreateBox('sbtn',{width:1.2,height:5.4,depth:2.0},scene);
+    sb.position=V3(ro-0.1,1.6,-2); sb.parent=g;
+    sb.metadata={role:'body',part:'sbtn'};
+
+    const usb=B.MeshBuilder.CreateBox('usbc',{width:1.5,height:3.2,depth:8.8},scene);
+    usb.position=V3(-ro+0.4,y0+5.4,0); usb.parent=g; usb.material=fixed('dark');
+    usb.metadata={role:'dark',part:'usbc'};
+
+    addDim(V3(-ro,y0-7,0),V3(ro,y0-7,0),'Ø'+p.D.toFixed(2));
+    addDim(V3(ro+6,y0,0),V3(ro+6,y1,0),'厚 '+p.H.toFixed(2));
+    addDim(V3(-sd,y1+8.5,0),V3(sd,y1+8.5,0),'屏 Ø'+p.sd.toFixed(2));
+
+    const ps=[
+      {id:'bezel',node:bezel,ex:V3(0,0,0)},
+      {id:'black',node:black,ex:V3(0,22,0)},
+      {id:'glass',node:glass,ex:V3(0,32,0)},
+      {id:'pcb',node:pcb,ex:V3(0,8,0)},
+      {id:'cell',node:cell,ex:V3(0,-10,0)},
+      {id:'cap',node:cap,ex:V3(0,-28,0)},
+      {id:'thread',node:th,ex:V3(0,-20,0)},
+      {id:'sbtn',node:sb,ex:V3(18,2,0)},
+      {id:'usbc',node:usb,ex:V3(-18,-2,0)}
+    ];
+    bosses.forEach(b=>ps.push({id:'boss',node:b,ex:V3(0,-16,0)}));
+    return {root:g,size:V3(p.D,p.H,p.D),parts:ps};
+  }
+
+  /* ---------------- 自定义结构件(轻量参数化建模) ---------------- */
+  /* 形体库:按工艺预置的标准件参数(M2/M2.5/M3 自攻预钻孔按常用规范) */
+  const PRIMS={
+    box:   {n:'方块',         d:{w:8,  h:6, dd:8},   tag:'基础'},
+    cyl:   {n:'圆柱',         d:{dia:10,h:8},        tag:'基础'},
+    rib:   {n:'加强筋',       d:{w:14, h:5, dd:1.2}, tag:'基础'},
+    pocket:{n:'凹槽(铣削)', d:{w:10, h:2, dd:10},  tag:'基础'},
+    hole:  {n:'开孔(钻孔)', d:{dia:3,  h:1},       tag:'基础'},
+    boss2: {n:'螺丝柱 M2',    d:{dia:4.0,h:7,dd:1.6},tag:'紧固'},
+    boss25:{n:'螺丝柱 M2.5',  d:{dia:4.8,h:8,dd:2.1},tag:'紧固'},
+    boss3: {n:'螺丝柱 M3',    d:{dia:5.6,h:9,dd:2.6},tag:'紧固'},
+    thru25:{n:'M2.5 过孔',    d:{dia:2.7,h:1,dd:2.7},tag:'紧固'},
+    pin3:  {n:'定位销 Ø3',    d:{dia:3,h:4},         tag:'紧固'},
+    pad4:  {n:'四角柱组 M2.5',d:{w:30,h:7,dd:30,dia:4.8,hd:2.1},tag:'腔体'},
+    wall:  {n:'分隔墙',       d:{w:20,h:6,dd:0.8},   tag:'腔体'},
+    tray:  {n:'电池仓',       d:{w:22,h:3,dd:18},    tag:'腔体'},
+    clip:  {n:'卡扣',         d:{w:5,h:4,dd:1.2},    tag:'腔体'}
+  };
+  const FASTEN_TYPES=['boss2','boss25','boss3','thru25','pin3','pad4'];
+
+  function cavInfo(){
+    const id=cur.project,p=cur.params;
+    if(id==='silicone') return {kind:'rect',w:p.w,d:p.d,h:p.h};
+    if(id==='recorder') return {kind:'cyl',r:(p.D-2*p.t)/2,h:p.H-1.2-p.dm};
+    return {kind:'cyl',r:(p.D-2*p.t)/2,h:p.H-p.cap-p.dep};
+  }
+
+  function newSpec(type){
+    const base=(PRIMS[type]||PRIMS.box).d;
+    const s={uid:custUid++,type:type,x:0,z:0,y:0,draft:1,snap:0.5,note:''};
+    Object.keys(base).forEach(k=>s[k]=base[k]);
+    return s;
+  }
+
+  /* 空心柱(螺丝柱 / 过孔):径向回转,内外壁 + 上下环面 */
+  function hollowBoss(name,od,pid,h,tess){
+    const ri=Math.max(0.25,pid/2), ro=Math.max(ri+0.4,od/2), hh=Math.max(0.2,h/2);
+    return revolve(name,[{r:ri,y:-hh},{r:ro,y:-hh},{r:ro,y:hh},{r:ri,y:hh}],tess||20,null);
+  }
+  function mergeAll(ms,name){
+    if(!ms.length) return null;
+    const mm=B.Mesh.MergeMeshes(ms,true,true);
+    if(mm) mm.name=name;
+    return mm||ms[0];
+  }
+
+  function buildPrim(s){
+    const t=s.type;
+    let m=null;
+    const rect=(t==='box'||t==='pocket'||t==='rib'||t==='wall'||t==='clip');
+    if(rect){
+      m=B.MeshBuilder.CreateBox('c'+s.uid,{width:Math.max(0.2,s.w),height:Math.max(0.2,s.h),depth:Math.max(0.2,s.dd)},scene);
+      if(t==='rib'||t==='wall'){
+        const dr=Math.min(0.35,Math.tan(Math.max(0,s.draft||0)*Math.PI/180)*s.h/Math.max(1,s.dd)*1.6);
+        const pos=m.getVerticesData(B.VertexBuffer.PositionKind);
+        if(pos){ for(let i=0;i<pos.length;i+=3){ if(pos[i+1]>0){ pos[i]*=1-dr; pos[i+2]*=1-dr; } } }
+        m.updateVerticesData(B.VertexBuffer.PositionKind,pos);
+      }
+    }else if(t==='tray'){
+      const w=Math.max(4,s.w), dp=Math.max(4,s.dd), h=Math.max(1,s.h);
+      const tw=Math.min(1.4,Math.max(0.6,Math.min(w,dp)/12));
+      const ps=[];
+      const base=B.MeshBuilder.CreateBox('trb',{width:w,height:tw,depth:dp},scene);
+      base.position.y=-h/2+tw/2; ps.push(base);
+      [-1,1].forEach(sg=>{
+        const xw=B.MeshBuilder.CreateBox('trx',{width:tw,height:h,depth:dp},scene);
+        xw.position.x=sg*(w/2-tw/2); ps.push(xw);
+        const zw=B.MeshBuilder.CreateBox('trz',{width:w,height:h,depth:tw},scene);
+        zw.position.z=sg*(dp/2-tw/2); ps.push(zw);
+      });
+      m=mergeAll(ps,'c'+s.uid);
+    }else if(t==='pad4'){
+      const w=Math.max(8,s.w), dp=Math.max(8,s.dd), od=Math.max(2,s.dia||4.8);
+      const pid=Math.max(0.8,s.hd||2.1), h=Math.max(2,s.h);
+      const ps=[];
+      [-1,1].forEach(sx=>[-1,1].forEach(sz=>{
+        const b=hollowBoss('pb',od,pid,h,16);
+        b.position.x=sx*Math.max(0,w/2-od/2); b.position.z=sz*Math.max(0,dp/2-od/2);
+        ps.push(b);
+      }));
+      m=mergeAll(ps,'c'+s.uid);
+    }else if(t==='boss2'||t==='boss25'||t==='boss3'||t==='thru25'){
+      m=hollowBoss('c'+s.uid,Math.max(1.2,s.dia),Math.max(0.4,s.dd),Math.max(0.4,s.h),20);
+    }else if(t==='pin3'){
+      m=B.MeshBuilder.CreateCylinder('c'+s.uid,{diameter:Math.max(0.6,s.dia),height:Math.max(0.4,s.h),tessellation:20},scene);
+    }else{
+      m=B.MeshBuilder.CreateCylinder('c'+s.uid,{diameter:Math.max(0.4,s.dia),height:Math.max(0.2,s.h),tessellation:24},scene);
+    }
+    m.position=V3(s.x||0,s.y||0,s.z||0);
+    if(s.rot) m.rotation.y=s.rot*Math.PI/180;
+    const role=FASTEN_TYPES.indexOf(t)>=0?'brass':((t==='pocket'||t==='hole')?'cut':'body');
+    m.metadata={role:role,part:'c'+s.uid,custom:true,owner:s.owner||null};
+
+    const db=new B.PointerDragBehavior({dragPlaneNormal:V3(0,1,0)});
+    db.useObjectOrientationForDragging=false;
+    db.onDragStartObservable.add(()=>{ if(camera) camera.detachControl(); });
+    db.onDragEndObservable.add(()=>{ if(camera&&canvas) camera.attachControl(canvas,true); });
+    db.onDragObservable.add(()=>{
+      const st=Math.max(0.1,s.snap||0.5);
+      m.position.x=Math.round(m.position.x/st)*st;
+      m.position.z=Math.round(m.position.z/st)*st;
+      const cav=cavInfo();
+      const cw=s.w!==undefined?s.w:s.dia, cd=s.dd!==undefined?s.dd:s.dia;
+      if(cav.kind==='cyl'){
+        const r=Math.hypot(m.position.x,m.position.z);
+        const rr=cav.r-Math.max(cw,cd)/2-0.5;
+        if(r>0.2&&rr>0&&Math.abs(r-rr)<1.5){
+          m.position.x=Math.round((m.position.x/r*rr)*10)/10;
+          m.position.z=Math.round((m.position.z/r*rr)*10)/10;
+        }
+      }else{
+        const xz=cav.d/2-cd/2-0.5, xx=cav.w/2-cw/2-0.5;
+        if(Math.abs(Math.abs(m.position.z)-xz)<1.5) m.position.z=(m.position.z<0?-1:1)*xz;
+        if(Math.abs(Math.abs(m.position.x)-xx)<1.5) m.position.x=(m.position.x<0?-1:1)*xx;
+      }
+      s.x=+m.position.x.toFixed(2); s.z=+m.position.z.toFixed(2);
+      if(dragCb) dragCb(s);
+    });
+    m.addBehavior(db);
+    return m;
+  }
+
+  function buildCustom(parent){
+    labels.length=labels.length; // 保持已有标注
+    const list=customMap[cur.project]||[];
+    list.forEach(s=>{
+      const m=buildPrim(s);
+      m.parent=parent;
+      parts.push({id:'c'+s.uid,node:m,ex:V3(0,0,0),custom:true,spec:s});
+    });
+  }
+
+  const OUTER={silicone:['body'],recorder:['body','lid'],round:['bezel','cap']};
+
+  /* ---------------- 材质应用 ---------------- */
+  function applyMaterial(key){
+    if(!root) return;
+    const cfg=MATERIALS[key]||MATERIALS[PROJECTS[cur.project].materials[0]];
+    if(!cfg) return;
+    const useKey=MATERIALS[key]?key:PROJECTS[cur.project].materials[0];
+    const bodyM=pbr(useKey,MATERIALS[useKey]);
+    const accentKey=useKey.indexOf('sil-')===0?'sil-black':useKey;
+    const accentM=pbr(accentKey,MATERIALS[accentKey]);
+    const outer=OUTER[cur.project]||[];
+    root.getChildMeshes().forEach(m=>{
+      const role=m.metadata&&m.metadata.role;
+      const pid=m.metadata&&m.metadata.part;
+      if(role==='body') m.material=(cutaway&&outer.indexOf(pid)>=0)?ghost(useKey):bodyM;
+      else if(role==='accent') m.material=accentM;
+      else if(role==='glass') m.material=fixed('glass');
+      else if(role==='pcb') m.material=fixed('pcb');
+      else if(role==='cell') m.material=fixed('cell');
+      else if(role==='brass') m.material=fixed('brass');
+      else if(role==='dark') m.material=fixed('dark');
+      else if(role==='cut') m.material=fixed('cut');
+    });
+  }
+
+  /* ---------------- 单件隔离编辑 ---------------- */
+  function applySolo(id){
+    if(!root) return;
+    root.getChildMeshes().forEach(m=>{
+      const md=m.metadata||{};
+      const keep=!id||md.part===id||md.owner===id;
+      m.setEnabled(!!keep);
+    });
+    if(dimRoot) dimRoot.setEnabled(!id&&cur.dims);
+    const layer=host&&host.querySelector('.dimlayer');
+    if(layer) layer.style.display=(!id&&cur.dims)?'block':'none';
+  }
+  function frameSolo(id){
+    if(!root||!camera) return;
+    const ms=root.getChildMeshes().filter(m=>m.metadata&&(m.metadata.part===id||m.metadata.owner===id)&&m.isEnabled());
+    if(!ms.length) return;
+    const bi=ms[0].getHierarchyBoundingVectors();
+    const c=bi.max.add(bi.min).scale(0.5);
+    const dim=Math.max(bi.max.x-bi.min.x,bi.max.y-bi.min.y,bi.max.z-bi.min.z);
+    camera.target=c;
+    camera.alpha=-0.95; camera.beta=1.16;
+    camera.radius=Math.max(34,dim*2.35);
+    camera.lowerRadiusLimit=Math.max(10,dim*0.6);
+  }
+  function focusPart(id){
+    if(!root||!camera) return;
+    const ms=root.getChildMeshes().filter(m=>m.metadata&&(m.metadata.part===id||m.metadata.owner===id)&&m.isEnabled());
+    if(!ms.length) return;
+    const bi=ms[0].getHierarchyBoundingVectors();
+    const c=bi.max.add(bi.min).scale(0.5);
+    const dim=Math.max(bi.max.x-bi.min.x,bi.max.y-bi.min.y,bi.max.z-bi.min.z);
+    camera.target=c;
+    camera.radius=Math.max(22,dim*2.1);
+  }
+
+  function setSolo(id){
+    solo=id||null;
+    if(!root) return;
+    cutaway=false;
+    applyMaterial(cur.material);
+    applySolo(solo);
+    if(solo) frameSolo(solo); else frame();
+    if(cur.hl&&solo&&cur.hl!==solo) highlight(solo);
+  }
+
+  /* ---------------- 组装/重建 ---------------- */
+  function rebuild(reframe){
+    if(!scene) return;
+    if(root){ root.dispose(); root=null; }
+    if(dimRoot){ dimRoot.dispose(); dimRoot=null; }
+    labels=[]; labelEls.forEach(e=>e.remove()); labelEls=[];
+    const proj=PROJECTS[cur.project];
+    const p={};
+    proj.params.forEach(x=>{ p[x.k]=x.def; });
+    Object.assign(p,cur.params||{});
+    const out=(cur.project==='silicone')?buildSilicone(p):(cur.project==='recorder')?buildRecorder(p):buildRound(p);
+    root=out.root; parts=out.parts;
+    buildCustom(root);
+    parts.forEach(pt=>{
+      if(!pt.node) return;
+      pt.basePos=pt.node.position.clone();
+      pt.node.metadata=Object.assign({},pt.node.metadata||{},{part:pt.id});
+    });
+    applyMaterial(cur.material);
+    applyExplode(cur.explode);
+    if(solo) applySolo(solo);
+    placeGround();
+    if(reframe!==false) frame();
+    refreshDims();
+    if(cur.hl) highlight(cur.hl);
+  }
+
+  function placeGround(){
+    if(!root||!ground) return;
+    const bi=root.getHierarchyBoundingVectors();
+    const dim=Math.max(bi.max.x-bi.min.x,bi.max.y-bi.min.y,bi.max.z-bi.min.z);
+    ground.position.y=bi.min.y-0.2;
+    ground.scaling.x=ground.scaling.z=Math.max(1,dim/60);
+  }
+
+  function frame(){
+    if(!root||!camera) return;
+    const bi=root.getHierarchyBoundingVectors();
+    const c=bi.max.add(bi.min).scale(0.5);
+    const dim=Math.max(bi.max.x-bi.min.x,bi.max.y-bi.min.y,bi.max.z-bi.min.z);
+    camera.target=c;
+    const aspect=(engine?engine.getRenderWidth():1)/Math.max(1,(engine?engine.getRenderHeight():1));
+    const pad=Math.max(1,1.18/Math.max(0.6,aspect));
+    camera.radius=Math.max(95,dim*1.98*pad);
+    camera.lowerRadiusLimit=Math.max(22,dim*0.85);
+    camera.upperRadiusLimit=Math.max(400,dim*7);
+  }
+
+  function applyExplode(v){
+    cur.explode=v||0;
+    parts.forEach(pt=>{
+      if(!pt.node||!pt.basePos) return;
+      pt.node.position=pt.basePos.add(pt.ex.scale(cur.explode));
+    });
+    const wantCut=!solo&&((cur.explode>0.2)||!!cur.cutForce);
+    if(wantCut!==cutaway){
+      cutaway=wantCut;
+      applyMaterial(cur.material);
+    }
+  }
+
+  function highlight(partId){
+    cur.hl=partId;
+    if(!root) return;
+    root.getChildMeshes().forEach(m=>{
+      m.renderOutline=false;
+      if(partId&&m.metadata&&m.metadata.part===partId){
+        m.renderOutline=true;
+        m.outlineColor=new B.Color3(0.25,0.75,1);
+        m.outlineWidth=0.9;
+      }
+    });
+  }
+
+  function setView(name){
+    if(!camera) return;
+    const map={iso:[-1.05,1.03],front:[-Math.PI/2,1.53],side:[0,1.53],top:[-Math.PI/2,0.17],low:[-0.55,1.38]};
+    const v=map[name]||map.iso;
+    let t=0; const fromA=camera.alpha,fromB=camera.beta,dur=0.42;
+    const obs=scene.onBeforeRenderObservable.add(()=>{
+      t+=engine.getDeltaTime()/1000;
+      const k=Math.min(1,t/dur), e=1-Math.pow(1-k,3);
+      camera.alpha=fromA+(v[0]-fromA)*e;
+      camera.beta=fromB+(v[1]-fromB)*e;
+      if(k>=1) scene.onBeforeRenderObservable.remove(obs);
+    });
+  }
+
+  function refreshDims(){
+    const layer=ensureLabelHost();
+    if(!layer) return;
+    layer.innerHTML=''; labelEls=[];
+    labels.forEach(l=>{
+      const d=document.createElement('div');
+      d.className='dimtag'; d.textContent=l.t;
+      layer.appendChild(d); labelEls.push(d);
+    });
+    layer.style.display=(cur.dims&&!solo)?'block':'none';
+    if(dimRoot) dimRoot.setEnabled(cur.dims&&!solo);
+  }
+
+  function setDims(on){
+    cur.dims=!!on;
+    const layer=host&&host.querySelector('.dimlayer');
+    if(layer) layer.style.display=cur.dims?'block':'none';
+    if(dimRoot) dimRoot.setEnabled(cur.dims);
+  }
+
+  let lastW=0,lastH=0;
+  function updateLabels(){
+    if(!camera||!labelEls.length) return;
+    const rw=engine.getRenderWidth(), rh=engine.getRenderHeight();
+    if(rw!==lastW||rh!==lastH){ lastW=rw; lastH=rh; }
+    const vp=camera.viewport.toGlobal(rw,rh);
+    const tm=scene.getTransformMatrix();
+    const cssW=host.clientWidth, cssH=host.clientHeight;
+    for(let i=0;i<labels.length;i++){
+      const el=labelEls[i]; if(!el) continue;
+      const pr=B.Vector3.Project(labels[i].p,B.Matrix.Identity(),tm,vp);
+      if(pr.z<0||pr.z>1){ el.style.opacity='0'; continue; }
+      el.style.opacity='1';
+      const x=Math.min(Math.max((pr.x/rw)*cssW,34),cssW-34);
+      const y=Math.min(Math.max((pr.y/rh)*cssH,16),cssH-16);
+      el.style.left=x.toFixed(1)+'px';
+      el.style.top=y.toFixed(1)+'px';
+    }
+  }
+
+  function load(projectId,params,material,explode){
+    if(!readyFlag){ pending={project:projectId,params:params,material:material,explode:explode}; return; }
+    cur.project=projectId;
+    cur.params=Object.assign({},params||{});
+    cur.material=material||PROJECTS[projectId].materials[0];
+    cur.explode=explode||0;
+    cur.hl=null;
+    rebuild();
+  }
+
+  /* ---------------- 导出 ---------------- */
+  function collectMeshes(partId){
+    if(!root) return [];
+    const out=[];
+    root.getChildMeshes().forEach(m=>{
+      if(partId){
+        const md=m.metadata||{};
+        if(md.part!==partId&&md.owner!==partId) return;
+      }
+      if(!m.getTotalVertices()) return;
+      const role=m.metadata&&m.metadata.role;
+      const isCustom=!!(m.metadata&&m.metadata.custom);
+      if(role==='cut') return;
+      if(!isCustom&&(role==='dark'||role==='glass'||role==='brass'||role==='pcb'||role==='cell')) return;
+      out.push(m);
+    });
+    return out;
+  }
+
+  function exportMesh(kind,name,partId){
+    const meshes=collectMeshes(partId);
+    if(!meshes.length) return null;
+    if(kind==='stl'){
+      const lines=['solid '+name];
+      meshes.forEach(m=>{
+        const pos=m.getVerticesData(B.VertexBuffer.PositionKind);
+        const idx=m.getIndices();
+        m.computeWorldMatrix(true);
+        const wm=m.getWorldMatrix();
+        for(let i=0;i<idx.length;i+=3){
+          const a=B.Vector3.TransformCoordinates(V3(pos[idx[i]*3],pos[idx[i]*3+1],pos[idx[i]*3+2]),wm);
+          const b=B.Vector3.TransformCoordinates(V3(pos[idx[i+1]*3],pos[idx[i+1]*3+1],pos[idx[i+1]*3+2]),wm);
+          const c=B.Vector3.TransformCoordinates(V3(pos[idx[i+2]*3],pos[idx[i+2]*3+1],pos[idx[i+2]*3+2]),wm);
+          const n=B.Vector3.Cross(b.subtract(a),c.subtract(a));
+          if(n.length()<1e-8) continue;
+          n.normalize();
+          lines.push('facet normal '+n.x.toFixed(5)+' '+n.y.toFixed(5)+' '+n.z.toFixed(5),' outer loop');
+          [a,b,c].forEach(v=>lines.push('  vertex '+v.x.toFixed(4)+' '+v.y.toFixed(4)+' '+v.z.toFixed(4)));
+          lines.push(' endloop','endfacet');
+        }
+      });
+      lines.push('endsolid '+name);
+      return {text:lines.join('\n'),ext:'stl'};
+    }
+    const out=['# Pocket Shell Studio · unit mm · '+name];
+    let voff=0;
+    meshes.forEach((m,mi)=>{
+      const pos=m.getVerticesData(B.VertexBuffer.PositionKind);
+      const nrm=m.getVerticesData(B.VertexBuffer.NormalKind);
+      const idx=m.getIndices();
+      m.computeWorldMatrix(true);
+      const wm=m.getWorldMatrix();
+      out.push('o '+name+'_'+((m.metadata&&m.metadata.part)||mi));
+      for(let i=0;i<pos.length;i+=3){
+        const v=B.Vector3.TransformCoordinates(V3(pos[i],pos[i+1],pos[i+2]),wm);
+        out.push('v '+v.x.toFixed(4)+' '+v.y.toFixed(4)+' '+v.z.toFixed(4));
+      }
+      for(let i=0;i<nrm.length;i+=3) out.push('vn '+nrm[i].toFixed(4)+' '+nrm[i+1].toFixed(4)+' '+nrm[i+2].toFixed(4));
+      for(let i=0;i<idx.length;i+=3){
+        const a=idx[i]+1+voff,b=idx[i+1]+1+voff,c=idx[i+2]+1+voff;
+        out.push('f '+a+'//'+a+' '+b+'//'+b+' '+c+'//'+c);
+      }
+      voff+=pos.length/3;
+    });
+    return {text:out.join('\n'),ext:'obj'};
+  }
+
+  return {
+    init:init,
+    load:load,
+    setParams:function(p){ cur.params=Object.assign({},p); rebuild(false); },
+    setMaterial:function(k){ cur.material=k; applyMaterial(k); },
+    setExplode:function(v){ applyExplode(v); },
+    setSolo:function(id){ setSolo(id); },
+    isSolo:function(){ return solo; },
+    setCutaway:function(on){ cur.cutForce=!!on; cutaway=!!on||cur.explode>0.2; applyMaterial(cur.material); },
+    isCutaway:function(){ return cutaway; },
+    setDims:setDims,
+    setView:setView,
+    frame:function(){ frame(); },
+    focusPart:focusPart,
+    highlight:highlight,
+    /* ---- 自定义结构件 ---- */
+    PRIMS:PRIMS,
+    setCustom:function(projectId,list){
+      customMap[projectId]=(list||[]).map(s=>Object.assign({},s));
+      if(cur.project===projectId) rebuild(false);
+    },
+    customList:function(){ return (customMap[cur.project]||[]).map(s=>Object.assign({},s)); },
+    addCustom:function(type,patch){
+      const s=Object.assign(newSpec(type),patch||{});
+      (customMap[cur.project]=customMap[cur.project]||[]).push(s);
+      rebuild(false);
+      highlight('c'+s.uid);
+      return Object.assign({},s);
+    },
+    updateCustom:function(uid,patch){
+      const l=customMap[cur.project]||[];
+      const s=l.find(x=>x.uid===uid);
+      if(!s) return null;
+      Object.assign(s,patch||{});
+      rebuild(false);
+      highlight('c'+uid);
+      return Object.assign({},s);
+    },
+    removeCustom:function(uid){
+      const l=customMap[cur.project]||[];
+      const i=l.findIndex(x=>x.uid===uid);
+      if(i>=0) l.splice(i,1);
+      rebuild(false);
+    },
+    clearCustom:function(){ customMap[cur.project]=[]; rebuild(false); },
+    onSelect:function(cb){ selCb=cb; },
+    onDrag:function(cb){ dragCb=cb; },
+    snapshot:function(){ if(!engine) return null; scene.render(); return canvas.toDataURL('image/png'); },
+    exportSTL:function(n){ return exportMesh('stl',n); },
+    exportOBJ:function(n){ return exportMesh('obj',n); },
+    exportSTLPart:function(n,pid){ return exportMesh('stl',n,pid); },
+    exportOBJPart:function(n,pid){ return exportMesh('obj',n,pid); },
+    partIds:function(){ return parts.map(p=>({id:p.id,custom:!!p.custom})); },
+    parts:function(){ return parts; },
+    isReady:function(){ return readyFlag; }
+  };
+})();
+import { LitElement, html } from 'https://fastly.jsdelivr.net/npm/lit@3.1.2/+esm';
+
+/* =========================================================
+   工具
+   ========================================================= */
+const f1=(n,d)=>{ d=d===undefined?1:d; return (Math.round(n*Math.pow(10,d))/Math.pow(10,d)).toFixed(d); };
+const defaultParams=(id)=>{
+  const o={}; PROJECTS[id].params.forEach(x=>o[x.k]=x.def); return o;
+};
+const getParamDefs=(id)=>PROJECTS[id].params;
+
+/* =========================================================
+   工艺规则库:建模自由度按工艺分档
+   ========================================================= */
+const RULES={
+  injection:{name:'注塑(ABS/PC)',minWall:0.8,minRib:0.8,draft:1,items:[
+    ['最小壁厚','0.8 mm,薄壁区建议 1.0'],['拔模角','≥1°,外观面 ≥2°'],
+    ['内角圆角','R ≥ 0.5(避免应力集中)'],['筋厚','≥0.8,且 ≤ 主壁厚 0.8 倍'],
+    ['深宽比','≤ 3:1,超过需镶件'],['缩水','0.4%~0.6%,开模按此放量']]},
+  silicone:{name:'硅胶模压',minWall:1.2,minRib:1.0,draft:3,items:[
+    ['壁厚','1.5~3.0 mm(回弹夹持区)'],['脱模角','≥3°,双角根部 ≥5°'],
+    ['圆角','R ≥ 0.5,禁止尖角'],['硬度','30~70 Shore A'],['最小批次','500 套(钢模)']]},
+  cnc:{name:'CNC 铝 6061',minWall:1.0,minRib:1.0,draft:0,items:[
+    ['最小刀具','Ø2,内角 R≥1'],['最小壁厚','1.0 mm,薄壁变形需留余量'],
+    ['深腔','≤ 4× 刀径,超过需五轴'],['公差','±0.05 关键 / ±0.1 一般'],
+    ['螺纹','阳极后必须二次回攻'],['标注','基准 + 孔位坐标表,缺一不接单']]},
+  vac:{name:'真空复模',minWall:1.2,minRib:1.0,draft:1.5,items:[
+    ['壁厚','≥1.2 mm'],['收缩补偿','0.3%,模具按放大做'],['批量','10 套起,适合内测']]},
+  die:{name:'压铸铝',minWall:1.5,minRib:1.2,draft:1.5,items:[
+    ['壁厚','≥1.5 mm'],['拔模','≥1.5°'],['模具费','¥12,000 起'],['MOQ','1000 套']]}
+};
+const ruleKey=(proc)=>{
+  if(proc==='sil-mold') return 'silicone';
+  if(proc==='die-cast') return 'die';
+  if(proc==='vacuum') return 'vac';
+  if(String(proc).indexOf('cnc')===0) return 'cnc';
+  return 'injection';
+};
+const EXPORTABLE={silicone:['body','floor','hornL','hornR','crown'],recorder:['body','lid','loop','btn'],round:['bezel','cap','boss','sbtn']};
+const primDim=(s)=>s.w!==undefined?[s.w,s.dd,s.h]:[s.dia,s.dia,s.h];
+const CYL_TYPES=['cyl','hole','pin3','boss2','boss25','boss3','thru25'];
+const RECT_TYPES=['box','pocket','rib','wall','clip','tray'];
+const HOLLOW_TYPES=['boss2','boss25','boss3','thru25'];
+const STD_PILOT={boss2:1.6,boss25:2.1,boss3:2.6};
+const primSpecText=(k)=>{ const P=STAGE.PRIMS[k]; if(!P) return ''; if(k==='box')return '8×8×H6';
+  if(k==='cyl')return 'Ø10 × H8'; if(k==='rib')return '14×1.2×H5'; if(k==='pocket')return '10×10×H2';
+  if(k==='hole')return 'Ø3 孔'; if(HOLLOW_TYPES.indexOf(k)>=0)return 'Ø'+P.d.dia+' / 孔Ø'+P.d.dd;
+  if(k==='pin3')return 'Ø3 × H4'; if(k==='pad4')return '间距 '+P.d.w+',M2.5';
+  if(k==='wall')return '20×0.8×H6'; if(k==='tray')return '22×18×H3'; if(k==='clip')return '5×1.2×H4'; return ''; };
+
+function cavity(id,p){
+  if(id==='silicone') return {kind:'rect',w:p.w,d:p.d,h:p.h};
+  if(id==='recorder') return {kind:'cyl',r:(p.D-2*p.t)/2,h:p.H-1.2-p.dm};
+  return {kind:'cyl',r:(p.D-2*p.t)/2,h:p.H-p.cap-p.dep};
+}
+
+/* 结构件与内腔的最小余量(mm) */
+function clearanceTo(id,p,s){
+  const cw=s.w!==undefined?s.w:s.dia, cd=s.dd!==undefined?s.dd:s.dia;
+  if(id==='silicone') return Math.min(p.w/2-(Math.abs(s.x||0)+cw/2), p.d/2-(Math.abs(s.z||0)+cd/2));
+  const cav=cavity(id,p);
+  return cav.r-(Math.hypot(s.x||0,s.z||0)+Math.max(cw,cd)/2);
+}
+
+/* 模型校验:每个结构件按当前工艺逐条过 */
+function modelChecks(id,p,list,rk){
+  const out=[],rule=RULES[rk];
+  const cav=cavity(id,p);
+  if(id!=='silicone'&&p.t<rule.minWall) out.push({ok:false,t:'主壁厚 '+f1(p.t)+' mm 低于 '+rule.name+' 下限 '+rule.minWall+' mm'});
+  if(!list.length) out.push({ok:true,t:'尚无自定义结构件:当前只有参数化主体,内部支撑靠默认壳体'});
+  list.forEach(s=>{
+    const d=primDim(s), thin=Math.min(d[0],d[1]);
+    const nm=(STAGE.PRIMS[s.type]?STAGE.PRIMS[s.type].n:'件');
+    const cl=clearanceTo(id,p,s);
+    if((s.type==='rib'||s.type==='box'||s.type==='pocket')&&thin<rule.minRib)
+      out.push({ok:false,t:nm+' 厚 '+f1(thin,2)+' mm < '+rule.name+' 最小 '+rule.minRib+' mm(会缩水/让刀)'});
+    if(cl<1.0) out.push({ok:false,t:nm+' 距内壁只剩 '+f1(cl,1)+' mm(<1 mm,装配与脱模都会出问题)'});
+    else out.push({ok:true,t:nm+' 距内壁 '+f1(cl,1)+' mm,余量可用'});
+    if(rule.draft>0&&s.type==='rib'&&(s.draft||0)<rule.draft)
+      out.push({ok:false,t:nm+' 拔模 '+(s.draft||0)+'° < '+rule.draft+'°('+rule.name+' 会粘模)'});
+    if(rk==='cnc'&&(s.type==='pocket'||s.type==='hole'))
+      out.push({ok:true,t:nm+':需在 2D 图纸标刀具半径 R≥1 与孔位坐标'});
+    if(['boss2','boss25','boss3'].indexOf(s.type)>=0){
+      const wall=(s.dia-s.dd)/2, minW=rk==='cnc'?0.9:Math.max(0.9,rule.minRib*0.9);
+      if(wall<minW) out.push({ok:false,t:nm+' 柱壁 '+f1(wall,2)+' mm < '+f1(minW,1)+' mm,自攻牙会胀裂'});
+      else out.push({ok:true,t:nm+' 柱壁 '+f1(wall,2)+' mm,可攻牙(预钻 Ø'+f1(s.dd,1)+')'});
+      const std=STD_PILOT[s.type];
+      if(Math.abs(s.dd-std)>0.15) out.push({ok:false,t:nm+' 预钻孔 Ø'+f1(s.dd,1)+' 非标准(该规格应为 Ø'+std+')'});
+    }
+    if(s.type==='pad4'){
+      const wall=(s.dia-s.hd)/2;
+      if(wall<0.9) out.push({ok:false,t:nm+' 柱壁 '+f1(wall,2)+' mm 偏薄(<0.9)'});
+      out.push({ok:true,t:nm+' 四柱中心距 '+f1(s.w,1)+' × '+f1(s.dd,1)+',需与 PCB 孔位一致(±0.05)'});
+    }
+    if((s.type==='pocket'||s.type==='hole')&&s.h>Math.min(d[0],d[1])*2)
+      out.push({ok:false,t:nm+' 深宽比 '+f1(s.h/Math.max(1,thin),1)+':1 > 2:1,需分层铣/镶件'});
+  });
+  return out;
+}
+
+function derived(id,p){
+  if(id==='silicone'){
+    const ow=p.w+2*p.t, od=p.d+2*p.t;
+    const vol=(2*(p.w+p.d)*p.t*p.h)+(p.w*p.d*1.2);
+    return [
+      ['外宽 × 外深', f1(ow)+' × '+f1(od)+' mm'],
+      ['内腔净尺寸', f1(p.w)+' × '+f1(p.d)+' × '+f1(p.h)+' mm'],
+      ['内腔圆角', f1(p.r)+' mm'],
+      ['双角', f1(p.hh)+' mm 高 / Ø'+f1(p.hd)+' 底'],
+      ['单件估重(不含表体)', f1(vol/1000*1.2,1)+' g'],
+      ['夹持余量建议', '内腔 = 实机 + 0.1~0.3 mm']
+    ];
+  }
+  if(id==='recorder'){
+    const inner=p.D-2*p.t, vol=Math.PI*p.D*p.t*p.H + Math.PI*(p.D*p.D/4)*1.2;
+    return [
+      ['外径 × 总高', 'Ø'+f1(p.D)+' × '+f1(p.H)+' mm'],
+      ['内腔可用', 'Ø'+f1(inner)+' × '+f1(p.H-1.2-p.dm)+' mm'],
+      ['上盖穹顶', f1(p.dm)+' mm'],
+      ['挂环', '孔径 Ø'+f1(p.ld)+' / 外伸 '+f1(p.lh)+' mm'],
+      ['单件估重(不含电子)', f1(vol/1000*1.05,1)+' g'],
+      ['PCB 建议', 'Φ'+f1(Math.min(inner-4,26))+' 以内,留 2mm 边距']
+    ];
+  }
+  const inner=p.D-2*p.t;
+  const vol=Math.PI*p.D*p.t*p.H;
+  return [
+    ['外径 × 总厚', 'Ø'+f1(p.D,2)+' × '+f1(p.H,2)+' mm'],
+    ['内腔可用', 'Ø'+f1(inner)+' × '+f1(p.H-p.cap-p.dep,2)+' mm'],
+    ['屏 / 黑边', 'Ø'+f1(p.sd,2)+' / Ø'+f1(p.bd,1)+',沉台 '+f1(p.dep)+' mm'],
+    ['屏占比', f1(p.sd/p.D*100,0)+'%'],
+    ['单件估重(铝壳)', f1(vol/1000*2.7,1)+' g'],
+    ['后盖', f1(p.cap,1)+' mm 厚 / 示意 M'+f1(inner+1,1)+'×1.5']
+  ];
+}
+
+function fitRows(id,p){
+  if(id==='round'){
+    const inner=p.D-2*p.t;
+    return [
+      ['屏 AA Ø45.68 vs 沉台开口 Ø'+f1(p.bd,1), p.bd>=45.68?'可通过':'需放大黑边'],
+      ['主板 Φ44 vs 内腔 Ø'+f1(inner,1), inner>=45?'可通过':'内腔不足,需减壁厚'],
+      ['屏厚 1.0 + 0.2 缓冲 vs 沉台 '+f1(p.dep), p.dep>=1.2?'OK':'偏浅,顶屏风险'],
+      ['锂电 103450(10 厚) vs 净高 '+f1(p.H-p.cap-p.dep,1), (p.H-p.cap-p.dep)>=11?'OK':'需改电芯']
+    ];
+  }
+  if(id==='recorder'){
+    const inner=p.D-2*p.t;
+    return [
+      ['ESP32-S3-WROOM-1 18×25.5 vs 内腔 Ø'+f1(inner,1), inner>=28?'需改板形':'需底板切圆角'],
+      ['Φ26 PCB vs 内腔 Ø'+f1(inner,1), inner>=28?'OK':'需缩板'],
+      ['软包 402030(20 宽) vs Ø'+f1(inner,1), inner>=24?'OK':'需换电芯'],
+      ['Type-C 座 9.0 长 vs 壁厚 '+f1(p.t), '需侧开孔 9.2×3.6'],
+      ['麦孔声腔 1.5mm', p.H>=10?'OK':'腔体偏薄']
+    ];
+  }
+  const inner=p.w;
+  return [
+    ['表体 41.3×41.3 vs 内腔 '+f1(inner,1)+'×'+f1(p.d,1), inner>=41.5?'OK':'需按实机放大'],
+    ['表冠凸出 vs 开孔允许', p.cr>=1.2?'OK':'需加大开孔'],
+    ['壁厚回弹区 2~3mm', (p.t>=2&&p.t<=3)?'OK':'夹持偏弱'],
+    ['双角根部 Ø'+f1(p.hd)+' vs 顶面宽 '+f1((p.w+2*p.t-p.hg)/2,1), '需 ≥1mm 余量']
+  ];
+}
+
+function processTable(id,qty){
+  const rows=[];
+  PROJECTS[id].processes.forEach(pr=>{
+    let unit=null;
+    pr.unit.forEach(t=>{ if(qty>=t[0]) unit=t[1]; });
+    if(unit===null) unit=pr.unit[0][1];
+    const extra=pr.mold||0;
+    const total=extra+qty*unit;
+    rows.push({...pr,unitUsed:unit,per:total/qty,below:qty<pr.minQty,total});
+  });
+  return rows;
+}
+
+/* =========================================================
+   规格单 / BOM 生成
+   ========================================================= */
+function specMarkdown(id,params,matKey,qty,customs){
+  const proj=PROJECTS[id], mat=MATERIALS[matKey]||MATERIALS[proj.materials[0]];
+  const L=[];
+  L.push('# 生产需求单 | '+proj.name);
+  L.push('');
+  L.push('- 参考型号:'+proj.ref);
+  L.push('- 版本:v1.4(壳体工坊自动生成)');
+  L.push('- 日期:'+new Date().toLocaleDateString('zh-CN'));
+  L.push('- 单位:mm;数量:'+qty+' 套(报价按此数量)');
+  L.push('- 币种:CNY,含 13% 增值税口径请供应商标注');
+  L.push('');
+  L.push('## 1. 关键尺寸(当前参数快照)');
+  L.push('');
+  L.push('| 参数 | 数值 | 说明 |');
+  L.push('| --- | --- | --- |');
+  proj.params.forEach(x=>{
+    L.push('| '+x.n+' ('+x.k+') | '+f1(params[x.k],2)+' mm | 范围 '+x.min+'~'+x.max+' |');
+  });
+  L.push('');
+  L.push('派生尺寸:');
+  derived(id,params).forEach(d=>L.push('- '+d[0]+':'+d[1]));
+  L.push('');
+  if(id==='round'){
+    L.push('> **CNC 弧面(按此编程)**:外壁顶部凸圆 R'+f1(params.rimR,2)+';屏边凹圆弧 R'+f1(params.dep,2)+'(沉台深 '+f1(params.dep,2)+');底边倒角 C'+f1(params.cham,2)+'。弧面用 R≥1 的球头/圆鼻刀连续走刀,过渡区不得有接刀痕与刀纹台阶。');
+    L.push('');
+  }
+  L.push('## 2. 外观与材质');
+  L.push('');
+  L.push('- 主体材质:'+mat.name+'('+(mat.note||'按工艺常规')+')');
+  L.push('- 表面处理:'+(id==='round'?'喷砂 + 阳极氧化 10~15μm;阳极后螺纹二次回攻':(id==='silicone'?'喷手感油(哑光);丝印/镭雕 logo 可选':'注塑本色或喷橡胶漆,耐磨 500g 摩擦')));
+  L.push('- 颜色:以提供的色卡为准(Pantone / 劳尔号),色差 ΔE ≤ 1.5');
+  L.push('- 外观面:无缩水、无顶白、无拉伤、无熔接线可见');
+  L.push('');
+  L.push('## 3. 公差与验收');
+  L.push('');
+  L.push('| 项目 | 要求 |');
+  L.push('| --- | --- |');
+  proj.tolerance.forEach(t=>L.push('| '+t[0]+' | '+t[1]+' |'));
+  L.push('| 首件 | 提供三坐标/影像仪报告 + 实配照片 |');
+  L.push('| 抽检 | AQL 1.0 外观 / 0.65 关键尺寸 |');
+  L.push('');
+  L.push('## 4. 工艺路线(请逐项报价)');
+  L.push('');
+  L.push('| 工艺 | MOQ | 一次性费用 | 单价 | 交期 | 备注 |');
+  L.push('| --- | --- | --- | --- | --- | --- |');
+  proj.processes.forEach(pr=>{
+    let unit=null; pr.unit.forEach(t=>{ if(qty>=t[0]) unit=t[1]; });
+    if(unit===null) unit=pr.unit[0][1];
+    L.push('| '+pr.n+' | '+pr.minQty+' | ¥'+pr.mold+' | ¥'+unit+'/套 | '+pr.lead+' | '+pr.note+' |');
+  });
+  L.push('');
+  L.push('> 数量 '+qty+' 套时的单套综合成本(含模具摊销):');
+  processTable(id,qty).forEach(r=>{
+    L.push('- '+r.n+':¥'+f1(r.per,1)+'/套'+(r.below?'(低于 MOQ,按最小批量摊)':''));
+  });
+  L.push('');
+  L.push('## 5. 零件清单(BOM 摘要)');
+  L.push('');
+  L.push('| # | 零件 | 数量 | 材质 | 工艺 | 公差 |');
+  L.push('| --- | --- | --- | --- | --- | --- |');
+  proj.parts.forEach((pt,i)=>L.push('| '+(i+1)+' | '+pt.n+' | '+pt.q+' | '+pt.mat+' | '+pt.proc+' | '+pt.tol+' |'));
+  L.push('');
+  L.push('');
+  L.push('## 5.5 自定义结构件(我方在网页端建模,需随主体一起加工)');
+  L.push('');
+  const cs=customs||[];
+  const rk=ruleKey((PROJECTS[id].processes[0]||{}).key);
+  if(!cs.length){
+    L.push('- 暂无自定义结构件;内部支撑结构按上方主参数与装配顺序推定。');
+  }else{
+    L.push('| # | 类型 | 坐标 x / y / z(mm,壳中心为原点) | 外形尺寸 | 工艺要求 |');
+    L.push('| --- | --- | --- | --- | --- |');
+    cs.forEach((s,i)=>{
+      const nm=STAGE.PRIMS[s.type]?STAGE.PRIMS[s.type].n:s.type;
+      const d=primDim(s);
+      const dim=(s.type==='cyl'||s.type==='boss'||s.type==='hole')
+        ? ('Ø'+f1(s.dia,2)+' × H'+f1(s.h,2))
+        : (f1(s.w,2)+' × '+f1(s.dd,2)+' × H'+f1(s.h,2));
+      let req='与主体同材质,去刀纹';
+      if(s.type==='rib'||s.type==='wall') req='拔模 '+(s.draft||0)+'°,壁厚 '+f1(d[1],2)+' mm,根部 R0.5';
+      else if(s.type==='boss2'||s.type==='boss25'||s.type==='boss3'){
+        const m=(s.type==='boss2'?'M2':s.type==='boss25'?'M2.5':'M3');
+        req=m+' 自攻牙:预钻 Ø'+f1(s.dd,2)+',柱径 Ø'+f1(s.dia,2)+',同轴度 ≤0.05'+(rk==='cnc'?',建议嵌铜螺母':'');
+      }
+      else if(s.type==='thru25') req='Ø'+f1(s.dia,2)+' 过孔(M2.5 螺钉),位置度 ±0.05';
+      else if(s.type==='pin3') req='Ø'+f1(s.dia,2)+' 定位销孔/销,H7 配合';
+      else if(s.type==='pad4') req='四角柱:中心距 '+f1(s.w,1)+'×'+f1(s.dd,1)+',M2.5 预钻 Ø'+f1(s.hd,2)+',与 PCB 孔位同轴 ±0.05';
+      else if(s.type==='pocket') req='铣削凹槽,内角 R≥1,深 '+f1(s.h,2)+' mm';
+      else if(s.type==='hole') req='钻孔 Ø'+f1(s.dia,2)+',位置度 ±0.05';
+      else if(s.type==='tray') req='电池仓:壁厚 0.8~1.2,底部 R0.5,留极耳缺口';
+      else if(s.type==='clip') req='卡扣:根部 R0.4,扣合量 0.3~0.5,需试插 50 次不疲劳';
+      L.push('| '+(i+1)+' | '+nm+' | '+f1(s.x,2)+' / '+f1(s.y,2)+' / '+f1(s.z,2)+' | '+dim+' | '+req+' |');
+    });
+    L.push('');
+    L.push('> 结构件已随主体一同写入 STL/OBJ;CNC 报价请按「上表坐标 + 刀具半径」评估,注塑请按壁厚/拔模评估。');
+  }
+  L.push('');
+  L.push('## 6. 装配顺序');
+  L.push('');
+  proj.steps.forEach((s,i)=>L.push((i+1)+'. **'+s.n+'**:'+s.d));
+  L.push('');
+  L.push('## 7. 交付文件(我方提供 / 需供应商确认)');
+  L.push('');
+  proj.files.forEach(f=>L.push('- [ ] '+f));
+  L.push('- [ ] 本需求单(PDF)+ STL/OBJ 预览网格');
+  L.push('- [ ] 色卡与表面处理样板');
+  L.push('');
+  L.push('## 8. 报价回填(请供应商填写)');
+  L.push('');
+  L.push('| 项目 | 供应商填写 |');
+  L.push('| --- | --- |');
+  ['模具费(含试模/改模次数)','单品单价(含税/不含税)','最小起订量 MOQ','打样费及抵扣规则','交期(打样/大货)','模具归属','包装方式与费用','有效期'].forEach(x=>L.push('| '+x+' |  |'));
+  L.push('');
+  L.push('## 9. 待确认项');
+  L.push('');
+  proj.notes.forEach(n=>L.push('- '+n));
+  L.push('- 电子件尺寸以官方规格书为准,打样前需实机复测。');
+  L.push('');
+  L.push('---');
+  L.push('本需求单由「壳体工坊」根据当前 3D 参数快照生成;价格区间为深圳/东莞 2026-11 行情参考,不构成报价承诺。');
+  return L.join('\n');
+}
+
+function bomCSV(id,params,matKey){
+  const proj=PROJECTS[id], mat=MATERIALS[matKey]||MATERIALS[proj.materials[0]];
+  const rows=[['序号','零件','数量','材质','工艺','关键尺寸/公差','备注']];
+  proj.parts.forEach((pt,i)=>{
+    rows.push([i+1,pt.n,pt.q,pt.mat==='主材质'?mat.name:pt.mat,pt.proc,pt.tol,pt.id==='screen'?'视窗透光面':''].map(v=>'"'+String(v).replace(/"/g,'""')+'"').join(','));
+  });
+  return rows.join('\n');
+}
+
+function specJSON(id,params,matKey,qty,customs){
+  return JSON.stringify({
+    app:'Pocket Shell Studio',version:'1.4',exportedAt:new Date().toISOString(),unit:'mm',
+    project:{id,name:proj_name(id),ref:PROJECTS[id].ref},
+    material:MATERIALS[matKey],
+    params:params,derived:derived(id,params),customParts:customs||[],
+    qty:qty,processes:processTable(id,qty).map(r=>({name:r.n,mold:r.mold,unit:r.unitUsed,perSet:+r.per.toFixed(2),lead:r.lead,belowMOQ:r.below})),
+    parts:PROJECTS[id].parts,assembly:PROJECTS[id].steps,tolerance:PROJECTS[id].tolerance,files:PROJECTS[id].files
+  },null,2);
+}
+function proj_name(id){ return PROJECTS[id].name; }
+
+function fitSVG(id,p){
+  const S=150;
+  let maxMm, shapes=[], texts=[];
+  const push=(s)=>shapes.push(s);
+  if(id==='round'){
+    const ro=p.D/2, bd=p.bd/2, sd=p.sd/2;
+    maxMm=p.D*1.08;
+    push({t:'c',r:ro,s:'#1f6feb',w:1.6});
+    push({t:'c',r:bd,s:'#94a3b8',w:1,dash:true});
+    push({t:'c',r:sd,s:'#0f9d58',w:1.2});
+    for(let i=0;i<4;i++){const a2=Math.PI/4+i*Math.PI/2;push({t:'d',x:Math.cos(a2)*(ro-9),y:Math.sin(a2)*(ro-9),r:2.1,s:'#b08d57'});}
+    texts.push(['Ø'+f1(p.D,2),0,-ro-4]);
+  }else if(id==='recorder'){
+    const ro=p.D/2, ri=ro-p.t;
+    maxMm=p.D*1.35;
+    push({t:'c',r:ro,s:'#1f6feb',w:1.6});
+    push({t:'c',r:ri,s:'#94a3b8',w:1,dash:true});
+    push({t:'c',r:Math.min(ro-2.5,13),s:'#0f9d58',w:1.2});
+    const micR=Math.max(4,ro*0.4);
+    for(let i=0;i<4;i++){const a2=Math.PI/4+i*Math.PI/2;push({t:'d',x:Math.cos(a2)*micR,y:Math.sin(a2)*micR,r:1.2,s:'#0a0c10'});}
+    push({t:'r',x:ro-0.4,y:0,w:2.6,h:9,s:'#dc2626',sw:1});
+    texts.push(['Ø'+f1(p.D,1),0,-ro-4],['内腔 Ø'+f1(ri,1),ri*0.72,ri*0.72]);
+  }else{
+    const ow=p.w+2*p.t, od=p.d+2*p.t;
+    maxMm=Math.max(ow,od)*1.1;
+    push({t:'r',x:0,y:0,w:ow,h:od,s:'#1f6feb',w:1.6});
+    push({t:'r',x:0,y:0,w:p.w,h:p.d,s:'#94a3b8',w:1,dash:true});
+    push({t:'r',x:0,y:0,w:Math.max(6,p.w-2.8),h:Math.max(6,p.d-2.8),s:'#0f9d58',w:1.2});
+    texts.push(['外 '+f1(ow,1)+'×'+f1(od,1),0,-od/2-4],['内腔 '+f1(p.w,1)+'×'+f1(p.d,1),0,p.d/2+3.5],['屏视窗',0,0]);
+  }
+  const k=S/maxMm, cx=100, cy=100;
+  const toX=(v)=>cx+v*k, toY=(v)=>cy-v*k;
+  const body=shapes.map(s=>{
+    if(s.t==='c') return `<circle cx="${cx}" cy="${cy}" r="${(s.r*k).toFixed(2)}" fill="none" stroke="${s.s}" stroke-width="${s.w}" ${s.dash?'stroke-dasharray="4 3"':''}/>`;
+    if(s.t==='d') return `<circle cx="${toX(s.x).toFixed(2)}" cy="${toY(s.y).toFixed(2)}" r="${(s.r*k).toFixed(2)}" fill="${s.s}"/>`;
+    return `<rect x="${toX(-s.w/2).toFixed(2)}" y="${toY(s.h/2).toFixed(2)}" width="${(s.w*k).toFixed(2)}" height="${(s.h*k).toFixed(2)}" fill="none" stroke="${s.s}" stroke-width="${s.sw||1}" ${s.dash?'stroke-dasharray="4 3"':''}/>`;
+  }).join('');
+  const labels=texts.map(t=>`<text x="${toX(t[1])}" y="${toY(t[2])}" font-size="7.5" fill="#68758a" text-anchor="middle" font-family="Noto Sans SC,sans-serif">${t[0]}</text>`).join('');
+  return `<svg viewBox="0 0 200 200" width="100%" style="max-width:300px;display:block;margin:4px auto 10px">
+    <line x1="${cx}" y1="14" x2="${cx}" y2="186" stroke="#dbe3ec" stroke-width="0.6"/>
+    <line x1="14" y1="${cy}" x2="186" y2="${cy}" stroke="#dbe3ec" stroke-width="0.6"/>
+    ${body}${labels}</svg>`;
+}
+
+function saveFile(name,text,mime){
+  const blob=new Blob([text],{type:mime||'text/plain;charset=utf-8'});
+  const url=URL.createObjectURL(blob);
+  const a=document.createElement('a');
+  a.href=url; a.download=name; document.body.appendChild(a); a.click();
+  setTimeout(()=>{ URL.revokeObjectURL(url); a.remove(); },1200);
+}
+function saveDataURL(name,dataURL){
+  const a=document.createElement('a');
+  a.href=dataURL; a.download=name; document.body.appendChild(a); a.click();
+  setTimeout(()=>a.remove(),800);
+}
+
+function toast(msg){
+  let t=document.getElementById('toast');
+  if(!t){ t=document.createElement('div'); t.id='toast'; document.body.appendChild(t); }
+  t.textContent=msg; t.classList.add('on');
+  clearTimeout(window.__toastT);
+  window.__toastT=setTimeout(()=>t.classList.remove('on'),1900);
+}
+
+const buzz=(ms)=>{ try{ if(navigator.vibrate) navigator.vibrate(ms); }catch(e){} };
+const LS={
+  get(k,d){ try{ const v=localStorage.getItem(k); return v?JSON.parse(v):d; }catch(e){ return d; } },
+  set(k,v){ try{ localStorage.setItem(k,JSON.stringify(v)); }catch(e){} }
+};
+
+/* =========================================================
+   3D 舞台组件
+   ========================================================= */
+class GlStage extends LitElement{
+  static properties={
+    project:{attribute:false}, params:{attribute:false}, material:{attribute:false},
+    explode:{attribute:false}, dims:{attribute:false}, hl:{attribute:false}, mini:{attribute:false}
+  };
+  createRenderRoot(){ return this; }
+  constructor(){ super(); this._initDone=false; this._view='iso'; }
+
+  firstUpdated(){
+    const canvas=this.querySelector('canvas');
+    const host=this.querySelector('.stage');
+    STAGE.init(canvas,host);
+    this._initDone=true;
+    STAGE.load(this.project,this.params,this.material,this.explode||0);
+    STAGE.setDims(this.dims!==false);
+    if(this.hl) STAGE.highlight(this.hl);
+  }
+  updated(ch){
+    if(!this._initDone) return;
+    if(ch.has('project')){ STAGE.load(this.project,this.params,this.material,this.explode||0); }
+    else if(ch.has('params')){ STAGE.setParams(this.params); }
+    if(ch.has('material')) STAGE.setMaterial(this.material);
+    if(ch.has('explode')) STAGE.setExplode(this.explode||0);
+    if(ch.has('dims')) STAGE.setDims(this.dims!==false);
+    if(ch.has('hl')) STAGE.highlight(this.hl);
+  }
+
+  pick(m){
+    this.dispatchEvent(new CustomEvent('mat-change',{detail:m,bubbles:true}));
+  }
+  view(v){
+    this._view=v; STAGE.setView(v);
+    this.querySelectorAll('.vbtn').forEach(b=>b.classList.toggle('on',b.dataset.v===v));
+  }
+  toggleDims(){
+    this.dispatchEvent(new CustomEvent('dims-change',{detail:!(this.dims!==false),bubbles:true}));
+  }
+  toggleExplode(){
+    const next=(this.explode||0)>0.3?0:0.85;
+    this.dispatchEvent(new CustomEvent('explode-change',{detail:next,bubbles:true}));
+  }
+
+  render(){
+    const proj=PROJECTS[this.project]||PROJECTS.silicone;
+    return html`
+    <div class="stage ${this.mini?'mini':''}">
+      <canvas></canvas>
+      <div class="stage-top">
+        <span class="badge">${proj.en}</span>
+        <span class="spacer"></span>
+        <button class="vbtn" data-v="iso" @click=${()=>this.view('iso')}>45°</button>
+        <button class="vbtn" data-v="front" @click=${()=>this.view('front')}>正视</button>
+        <button class="vbtn" data-v="top" @click=${()=>this.view('top')}>俯视</button>
+        <button class="vbtn" @click=${()=>STAGE.frame()}>适应</button>
+        <button class="vbtn ${this.dims!==false?'on':''}" @click=${()=>this.toggleDims()}>标注</button>
+        <button class="vbtn ${(this.explode||0)>0.3?'on':''}" @click=${()=>this.toggleExplode()}>爆炸</button>
+      </div>
+      ${this.mini?html`<div class="ghint">单指旋转 · 双指缩放 · 双击零件聚焦</div>`:''}
+      <div class="stage-bottom">
+        <div class="matrow">
+          ${proj.materials.map(k=>{
+            const m=MATERIALS[k];
+            return html`<div class="mat ${this.material===k?'on':''}" @click=${()=>this.pick(k)}>
+              <i style="background:${m.swatch}"></i>${m.name}</div>`;
+          })}
+        </div>
+      </div>
+    </div>`;
+  }
+}
+customElements.define('gl-stage',GlStage);
+
+/* =========================================================
+   主应用
+   ========================================================= */
+class AppRoot extends LitElement{
+  createRenderRoot(){ return this; }
+  constructor(){
+    super();
+    this.state={
+      route:'hub', project:'silicone', tab:'look',
+      params:defaultParams('silicone'),
+      material:PROJECTS.silicone.materials[0],
+      explode:0, dims:true, hl:null, qty:500,
+      proc:'sil-mold', selUid:null, snap:0.5, solo:null, dockPx:0.46, dockSnap:'half'
+    };
+  }
+
+  connectedCallback(){
+    super.connectedCallback();
+    this._onHash=()=>this.routeFromHash();
+    window.addEventListener('hashchange',this._onHash);
+    this._onViewport=()=>{
+      const vv=window.visualViewport;
+      if(!vv) return;
+      const kb=Math.max(0,Math.round(window.innerHeight-vv.height-vv.offsetTop));
+      document.documentElement.style.setProperty('--kb',(kb>40?kb:0)+'px');
+      if(this.state&&this.state.tab==='mdl'&&!this._dragStart&&kb===0) this.applyDock(this.state.dockPx,false);
+    };
+    if(window.visualViewport){
+      window.visualViewport.addEventListener('resize',this._onViewport);
+      window.visualViewport.addEventListener('scroll',this._onViewport);
+    }
+    if(typeof STAGE!=='undefined' && STAGE.onSelect){
+      STAGE.onSelect((partId)=>{
+        if(!partId){ this.state.selUid=null; this.requestUpdate(); return; }
+        if(String(partId).indexOf('c')===0&&!isNaN(parseInt(String(partId).slice(1),10))){
+          this.state.selUid=parseInt(String(partId).slice(1),10);
+          this.requestUpdate();
+          buzz(8);
+          if(this.state.tab==='mdl'){
+            if(this.dockPx()<this.dockHeights().half-20) this.snapDock('half',true);
+            this.jumpDock('#dNum');
+          }
+        }
+      });
+      STAGE.onDrag((s)=>{
+        this.persistCustom();
+        clearTimeout(this._dragT);
+        this._dragT=setTimeout(()=>this.requestUpdate(),160);
+      });
+    }
+    this.routeFromHash();
+  }
+  disconnectedCallback(){ window.removeEventListener('hashchange',this._onHash); super.disconnectedCallback(); }
+
+  routeFromHash(){
+    const h=location.hash.replace(/^#\/?/,'');
+    if(h.indexOf('p/')===0){
+      const id=h.slice(2).split('?')[0]||'silicone';
+      const pid=PROJECTS[id]?id:'silicone';
+      const q=new URLSearchParams(h.split('?')[1]||'');
+      const saved=LS.get('ss.p.'+pid,null);
+      this.state.route='project';
+      this.state.project=pid;
+      this.state.params=Object.assign(defaultParams(pid),saved&&saved.params||{});
+      const qm=q.get('mat');
+      this.state.material=(qm&&MATERIALS[qm])?qm:((saved&&saved.material)||PROJECTS[pid].materials[0]);
+      const tabs=['look','asm','mdl','elec','proc','out'];
+      this.state.tab=tabs.indexOf(q.get('tab'))>=0?q.get('tab'):'look';
+      this.state.explode=Math.min(1,Math.max(0,parseFloat(q.get('ex')||'0')||0));
+      this.state.qty=Math.max(50,Math.min(5000,parseInt(q.get('qty')||'500',10)||500));
+      this.state.hl=q.get('hl')||null;
+      this.state.selUid=null;
+      this.state.solo=null;
+      this._hist=[]; this._redo=[];
+      this.state.proc=PROJECTS[pid].processes[0].key;
+      if(typeof STAGE!=='undefined'&&STAGE.setCustom){ STAGE.setCustom(pid,LS.get('ss.custom.'+pid,[])); STAGE.setSolo(null); }
+      if(this.state.tab==='mdl'){
+        const sn=LS.get('ss.dock','half');
+        this.state.dockSnap=sn; this.state.dockPx=(this.dockHeights()[sn]||this.dockHeights().half)/(window.innerHeight||800);
+        setTimeout(()=>{ this.applyDock(this.dockPx(),false); try{ STAGE.setCutaway(true); }catch(e){} },120);
+      }
+    }else if(h.indexOf('kb')===0){
+      this.state.route='kb';
+    }else{
+      this.state.route='hub';
+    }
+    this.requestUpdate();
+    window.scrollTo(0,0);
+  }
+
+  persist(){
+    LS.set('ss.p.'+this.state.project,{params:this.state.params,material:this.state.material});
+  }
+
+  /* ---------- 底部编辑坞:三段高度 + 拖拽 ---------- */
+  dockHeights(){
+    const h=window.innerHeight||800;
+    return {peek:Math.round(h*0.20),half:Math.round(h*0.46),full:Math.round(h*0.72)};
+  }
+  dockPx(){ return Math.round(window.innerHeight*(this.state.dockPx||0.46)); }
+  applyDock(px,animate){
+    const v=Math.max(150,Math.min(Math.round(window.innerHeight*0.82),px));
+    document.documentElement.style.setProperty('--dockH',v+'px');
+    if(animate){ const el=this.querySelector('.dock'); if(el){ el.classList.add('drag'); requestAnimationFrame(()=>el.classList.remove('drag')); } }
+  }
+  snapDock(name,animate=false){
+    const hs=this.dockHeights(), px=hs[name]||hs.half;
+    this.state.dockPx=px/(window.innerHeight||800);
+    this.state.dockSnap=name;
+    LS.set('ss.dock',name);
+    this.applyDock(px,animate);
+    this.requestUpdate();
+  }
+  onGrabDown(e){
+    this._dragStart={y:e.clientY,h:this.dockPx()};
+    const el=e.currentTarget; try{ el.setPointerCapture(e.pointerId); }catch(err){}
+    const dock=this.querySelector('.dock'); if(dock) dock.classList.add('drag');
+    e.preventDefault();
+  }
+  onGrabMove(e){
+    if(!this._dragStart) return;
+    const h=this._dragStart.h+(this._dragStart.y-e.clientY);
+    this.applyDock(h,false);
+  }
+  onGrabUp(e){
+    if(!this._dragStart) return;
+    this._dragStart=null;
+    const dock=this.querySelector('.dock'); if(dock) dock.classList.remove('drag');
+    const hs=this.dockHeights(), cur=this.dockPx();
+    let best='half',bd=1e9;
+    ['peek','half','full'].forEach(k=>{ const dd=Math.abs(hs[k]-cur); if(dd<bd){ bd=dd; best=k; } });
+    this.snapDock(best,true);
+    buzz(6);
+  }
+  jumpDock(id){
+    this.updateComplete.then(()=>{
+      const body=this.querySelector('.dock .dbody'), el=this.querySelector(id);
+      if(!body||!el) return;
+      const top=el.getBoundingClientRect().top-body.getBoundingClientRect().top+body.scrollTop-8;
+      body.scrollTop=Math.max(0,top);
+    });
+  }
+  openChecks(){ this.snapDock('half',true); this.jumpDock('#chkPanel'); }
+
+
+  /* ---------- 自定义结构件操作 ---------- */
+  custom(){ return (typeof STAGE!=='undefined'&&STAGE.customList)?STAGE.customList():[]; }
+  persistCustom(){ LS.set('ss.custom.'+this.state.project,this.custom()); }
+  selSpec(){
+    const uid=this.state.selUid;
+    return this.custom().find(s=>s.uid===uid)||null;
+  }
+  addPrim(type){
+    this.pushHist();
+    if(typeof STAGE==='undefined'||!STAGE.addCustom) return;
+    const s=STAGE.addCustom(type,{snap:this.state.snap,draft:(type==='rib'||type==='wall')?1:0,owner:this.state.solo||null});
+    this.state.selUid=s.uid;
+    this.state.tab='mdl';
+    if(this.dockPx()<this.dockHeights().half-20) this.snapDock('half',true);
+    this.persistCustom();
+    this.requestUpdate();
+    buzz(10);
+    this.jumpDock('#dNum');
+  }
+  setField(uid,k,v){
+    if(!isFinite(v)) return;
+    STAGE.updateCustom(uid,{[k]:v});
+    this.persistCustom();
+    this.requestUpdate();
+  }
+  nudge(uid,k,d){
+    const s=this.custom().find(x=>x.uid===uid); if(!s) return;
+    this.setField(uid,k,Math.round(((s[k]||0)+d)*100)/100);
+  }
+  place(uid,mode){
+    const s=this.custom().find(x=>x.uid===uid); if(!s) return;
+    this.pushHist();
+    const st=this.state, p=st.params, id=st.project;
+    const cav=cavity(id,p);
+    const w=s.w!==undefined?s.w:s.dia, d=s.dd!==undefined?s.dd:s.dia;
+    const patch={};
+    if(mode==='center'){ patch.x=0; patch.z=0; }
+    if(mode==='top'){ patch.y=Math.round((cav.h/2-Math.max(0.5,s.h)/2)*10)/10; }
+    if(mode==='bottom'){ patch.y=Math.round((-cav.h/2+Math.max(0.5,s.h)/2)*10)/10; }
+    if(mode==='wall'){
+      if(cav.kind==='rect'){
+        patch.z=Math.round((p.d/2-d/2-1)*10)/10;
+        patch.x=0;
+      }else{
+        const rr=Math.max(0,cav.r-Math.max(w,d)/2-1);
+        patch.x=Math.round(rr*10)/10; patch.z=0;
+      }
+    }
+    STAGE.updateCustom(uid,patch);
+    this.persistCustom();
+    this.requestUpdate();
+  }
+  delPrim(uid){
+    this.pushHist();
+    STAGE.removeCustom(uid);
+    this.state.selUid=null;
+    this.persistCustom();
+    this.requestUpdate();
+  }
+  dupPrim(uid){
+    const s=this.custom().find(x=>x.uid===uid); if(!s) return;
+    this.pushHist();
+    const c=Object.assign({},s); delete c.uid;
+    c.x=(s.x||0)+Math.min(6,Math.max(2,(s.w||s.dia||4)*0.6));
+    const n=STAGE.addCustom(s.type,c);
+    this.state.selUid=n.uid;
+    this.persistCustom();
+    this.requestUpdate();
+  }
+  setProc(k){ this.state.proc=k; this.requestUpdate(); }
+  setSoloTarget(pid){
+    if(pid&&this.state.dockPx&&this.dockPx()<this.dockHeights().half-20) this.snapDock('half',true);
+    buzz(6);
+    this.state.solo=pid||null;
+    STAGE.setSolo(pid||null);
+    this.state.selUid=null;
+    this.requestUpdate();
+  }
+  setSnap(v){ this.state.snap=v; this.requestUpdate(); }
+  clearPrims(){ STAGE.clearCustom(); this.state.selUid=null; this.persistCustom(); this.requestUpdate(); }
+  snapshot(){ return {params:Object.assign({},this.state.params),material:this.state.material,custom:this.custom()}; }
+  pushHist(){
+    this._hist=this._hist||[]; this._redo=this._redo||[];
+    this._hist.push(JSON.stringify(this.snapshot()));
+    if(this._hist.length>40) this._hist.shift();
+    this._redo.length=0;
+  }
+  applySnap(js){
+    const o=JSON.parse(js);
+    this.state.params=o.params||this.state.params;
+    this.state.material=o.material||this.state.material;
+    this.state.selUid=null;
+    STAGE.setCustom(this.state.project,o.custom||[]);
+    STAGE.setParams(this.state.params);
+    STAGE.setMaterial(this.state.material);
+    this.persist(); this.persistCustom();
+    this.requestUpdate();
+  }
+  undo(){
+    if(!this._hist||!this._hist.length) return;
+    this._redo=this._redo||[];
+    this._redo.push(JSON.stringify(this.snapshot()));
+    this.applySnap(this._hist.pop());
+  }
+  redo(){
+    if(!this._redo||!this._redo.length) return;
+    this._hist=this._hist||[];
+    this._hist.push(JSON.stringify(this.snapshot()));
+    this.applySnap(this._redo.pop());
+  }
+  canUndo(){ return !!(this._hist&&this._hist.length); }
+  canRedo(){ return !!(this._redo&&this._redo.length); }
+  arrayRing(uid,count){
+    const s=this.custom().find(x=>x.uid===uid); if(!s) return;
+    this.pushHist();
+    const cav=cavity(this.state.project,this.state.params);
+    let r=Math.hypot(s.x||0,s.z||0);
+    if(r<1) r=Math.max(4,(cav.kind==='cyl'?cav.r:Math.min(cav.w,cav.d)/2)*0.68);
+    const a0=Math.atan2(s.z||0,s.x||0);
+    for(let i=1;i<count;i++){
+      const a=a0+i*Math.PI*2/count;
+      const patch=Object.assign({},s); delete patch.uid;
+      patch.x=Math.round(r*Math.cos(a)*10)/10;
+      patch.z=Math.round(r*Math.sin(a)*10)/10;
+      patch.rot=((s.rot||0)+i*360/count)%360;
+      STAGE.addCustom(s.type,patch);
+    }
+    this.persistCustom(); this.requestUpdate();
+  }
+  savePartSTL(pid,label){
+    const r=STAGE.exportSTLPart(this.baseName()+'-'+String(label).replace(/[^\u4e00-\u9fa5A-Za-z0-9]/g,''),pid);
+    if(!r) return alert('该零件暂无可导出网格');
+    saveFile(this.baseName()+'-'+String(label).replace(/[^\u4e00-\u9fa5A-Za-z0-9]/g,'')+'.stl',r.text,'model/stl');
+  }
+  dismissTip(){ LS.set('ss.tips.mdl',true); this.requestUpdate(); }
+
+  go(hash){ location.hash=hash; }
+
+  onParam(k,e){
+    const v=parseFloat(e.target.value);
+    const def=getParamDefs(this.state.project).find(x=>x.k===k)||{min:0,max:1};
+    this.state.params[k]=v;
+    e.target.style.setProperty('--p',((v-def.min)/(def.max-def.min)*100)+'%');
+    const num=e.target.closest('.slider').querySelector('.sv');
+    if(num&&document.activeElement!==num) num.value=String(v);
+    this.previewParams();
+  }
+  /* 拖动滑块时 60fps 内只重建一次,手机上不卡 */
+  previewParams(){
+    this._pend=Object.assign({},this.state.params);
+    if(this._raf) return;
+    this._raf=requestAnimationFrame(()=>{
+      this._raf=0;
+      STAGE.setParams(this._pend);
+      this.refreshDerived();
+    });
+    clearTimeout(this._pt);
+    this._pt=setTimeout(()=>this.persist(),260);
+  }
+  onParamNum(k,e){
+    const def=getParamDefs(this.state.project).find(x=>x.k===k)||{min:0,max:1};
+    let v=parseFloat(e.target.value);
+    if(!isFinite(v)){ e.target.value=String(this.state.params[k]); return; }
+    v=Math.min(def.max,Math.max(def.min,v));
+    e.target.value=String(v);
+    this.state.params[k]=v;
+    if(this._raf){ cancelAnimationFrame(this._raf); this._raf=0; }
+    STAGE.setParams(this.state.params);
+    this.refreshDerived(); this.persist(); this.requestUpdate();
+    buzz(4);
+  }
+
+  refreshDerived(){
+    const el=this.querySelector('#derived');
+    if(!el) return;
+    el.innerHTML=derived(this.state.project,this.state.params)
+      .map(d=>`<dt>${d[0]}</dt><dd>${d[1]}</dd>`).join('');
+  }
+
+  setTab(t){
+    this.state.tab=t; this.state.hl=null;
+    if(this.state.solo){ this.state.solo=null; STAGE.setSolo(null); }
+    STAGE.highlight(null);
+    if(t==='asm'&&this.state.explode<0.2){ this.state.explode=0.85; STAGE.setExplode(0.85); }
+    if(t==='mdl'){ STAGE.setCutaway(true); this.applyDock(this.dockPx(),false); }
+    else if(t!=='asm') STAGE.setCutaway(false);
+    this.requestUpdate();
+  }
+
+  onMat(e){ this.state.material=e.detail; this.persist(); this.requestUpdate(); }
+  onDims(e){ this.state.dims=e.detail; this.requestUpdate(); }
+  onExplode(e){ this.state.explode=e.detail; this.requestUpdate(); }
+
+  /* ---------- 渲染:首页 ---------- */
+  renderHub(){
+    return html`
+    <div class="wrap">
+      <div class="hero">
+        <div class="kicker">POCKET SHELL STUDIO</div>
+        <h2>壳体工坊<br>手机里的轻量 3D 外壳工程台</h2>
+        <p>Lit + Babylon.js 纯网页参数化建模:改尺寸、换材质、加筋/柱/槽、隔离单件编辑、看爆炸装配,导 STL/OBJ 与生产需求单。不用装 CAD。</p>
+        <div class="stats">
+          <div class="stat"><b>3</b><span>壳体项目</span></div>
+          <div class="stat"><b>7</b><span>工艺路线</b></span></div>
+          <div class="stat"><b>6</b><span>基础形体</b></div>
+        </div>
+      </div>
+
+      <div class="sec"><h3>我的壳体项目</h3><span>点进去即操作台</span></div>
+      ${Object.keys(PROJECTS).map(id=>this.renderCard(id))}
+
+      <div class="sec"><h3>能力与资料</h3><span>项目外挂</span></div>
+      <div class="mini">
+        <div class="minicard" @click=${()=>this.go('#/kb')}>
+          <b>工艺知识库</b><span>工艺/MOQ/文件格式/DFM/报价口径,全部可回看</span>
+          <span class="n">6 篇 · 含对比表 →</span>
+        </div>
+        <div class="minicard" @click=${()=>this.go('#/kb')}>
+          <b>电子件库</b><span>微雪 1.85B、ESP32-S3、麦/功放/电芯选型与尺寸</span>
+          <span class="n">7 个模组 · 尺寸对照 →</span>
+        </div>
+        <div class="minicard" @click=${()=>this.go('#/p/recorder')}>
+          <b>爆炸装配</b><span>单操作台切换外观 / 结构 / 爆炸 / 导出</span>
+          <span class="n">爆炸 + 单件隔离 →</span>
+        </div>
+        <div class="minicard" @click=${()=>this.go('#/kb')}>
+          <b>参考文章</b><span>公众号原文归档入口(可粘贴补录全文)</span>
+          <span class="n">2 条参考 →</span>
+        </div>
+      </div>
+
+      <div class="foot">参数与报价为前期调研口径,非供应商正式报价。<br>所有 3D 均在浏览器实时生成,未调用外部模型文件。</div>
+    </div>`;
+  }
+
+  renderCard(id){
+    const p=PROJECTS[id];
+    const cls=id==='silicone'?'sq':(id==='recorder'?'puck':'disc');
+    const dims=id==='silicone'?'41 / 45 mm · 硅胶'
+      :id==='recorder'?'Ø32 × 11.5 · ABS'
+      :'Ø61.6 × 14.6 · 铝';
+    return html`
+    <div class="pcard" @click=${()=>this.go('#/p/'+id)}>
+      <div class="row">
+        <div class="thumb">
+          <div class="shape ${cls}">${cls==='disc'?html`<i></i>`:''}</div>
+          <span class="lbl">${id==='silicone'?'SILICONE':(id==='recorder'?'PUCK':'ROUND')}</span>
+        </div>
+        <div class="pinfo">
+          <h4>${p.name}</h4>
+          <div class="dims">${dims}</div>
+          <div class="tagrow">
+            ${p.tags.map(t=>html`<span class="tag ${t.indexOf('MOQ')>=0?'b':''}">${t}</span>`)}
+          </div>
+          <div class="enter">进入操作台 <span class="arw">→</span></div>
+        </div>
+      </div>
+    </div>`;
+  }
+
+  /* ---------- 渲染:项目页 ---------- */
+  renderProject(){
+    const st=this.state, proj=PROJECTS[st.project];
+    const tabs=[['look','3D 外观'],['asm','结构与爆炸'],['mdl','建模'],['elec','电子件'],['proc','工艺报价'],['out','导出']];
+    return html`
+    <div class="topbar"><div class="inner">
+      <button class="iconbtn" @click=${()=>this.go('#/')}>←</button>
+      <div class="tt"><h1>${proj.name}</h1><p>${proj.ref}</p></div>
+      <span class="pill">${f1(st.params[proj.params[0].k],1)} mm</span>
+    </div></div>
+
+    <div class="wrap" style="padding-bottom:120px">
+      <div class="tabs">
+        ${tabs.map(([k,n])=>html`<div class="tab ${st.tab===k?'on':''}" @click=${()=>this.setTab(k)}>${n}</div>`)}
+      </div>
+      <gl-stage .project=${st.project} .params=${st.params} .material=${st.material} .mini=${st.tab==='mdl'}
+        .explode=${st.explode} .dims=${st.dims} .hl=${st.hl}
+        @mat-change=${e=>this.onMat(e)} @dims-change=${e=>this.onDims(e)} @explode-change=${e=>this.onExplode(e)}>
+      </gl-stage>
+
+      ${st.tab==='look'?this.renderLook():''}
+      ${st.tab==='asm'?this.renderAsm():''}
+      ${st.tab==='mdl'?this.renderModel():''}
+      ${st.tab==='elec'?this.renderElec():''}
+      ${st.tab==='proc'?this.renderProc():''}
+      ${st.tab==='out'?this.renderOut():''}
+    </div>
+
+    ${st.tab==='mdl'?this.renderDock():html`
+    <div class="bottom">
+      <button class="btn" @click=${()=>this.savePNG()}>截图</button>
+      <button class="btn" @click=${()=>this.saveSTL()}>STL</button>
+      <button class="btn pri" @click=${()=>this.saveSpec()}>需求单</button>
+    </div>`}`;
+  }
+
+  toggleDock(){ this.state.dockFold=!this.state.dockFold; this.requestUpdate(); }
+
+  renderDock(){
+    const st=this.state, proj=PROJECTS[st.project], list=this.custom();
+    const sel=list.find(s=>s.uid===st.selUid)||null;
+    const rk=ruleKey(st.proc), rule=RULES[rk];
+    const checks=modelChecks(st.project,st.params,list,rk);
+    const bad=checks.filter(c=>!c.ok).length;
+    const isCyl=!!sel&&CYL_TYPES.indexOf(sel.type)>=0;
+    const isPad=!!sel&&sel.type==='pad4';
+    const isRect=!!sel&&RECT_TYPES.indexOf(sel.type)>=0;
+    const isHollow=!!sel&&HOLLOW_TYPES.indexOf(sel.type)>=0;
+    const firstK=proj.params[0].k;
+    const geo=proj.params.filter(p=>p.k==='t'||p.group==='CNC 工艺'||(!sel&&p.k===firstK));
+    const geoTitle=(st.project==='round')?'工艺弧面':'工艺与主体';
+    const procName=({'cnc-alu':'CNC 铝','cnc-abs':'CNC ABS','die-cast':'压铸','abs-mold':'注塑','sil-mold':'硅胶','vacuum':'复模'}[st.proc])||rule.name;
+
+    if(st.dockFold) return html`
+      <div class="dock fold">
+        <div class="dhead" @click=${()=>this.toggleDock()}>
+          <b>${sel?STAGE.PRIMS[sel.type].n+' #'+sel.uid:(st.solo?'隔离 · '+this.soloName(st.solo):'编辑坞')}</b>
+          <span class="em">${bad?bad+' 项待改':'校验通过'}</span>
+          <div class="tools"><button class="x" @click=${e=>{e.stopPropagation();this.toggleDock();}}>展开编辑</button></div>
+        </div>
+      </div>`;
+
+    return html`
+    <div class="dock">
+      <div class="grab" @pointerdown=${e=>this.onGrabDown(e)} @pointermove=${e=>this.onGrabMove(e)}
+        @pointerup=${e=>this.onGrabUp(e)} @pointercancel=${e=>this.onGrabUp(e)}><i></i></div>
+      <div class="dhead">
+        <div><b>${sel?STAGE.PRIMS[sel.type].n+' #'+sel.uid:(st.solo?'单件隔离 · '+this.soloName(st.solo):'编辑坞')}</b>
+        <span class="em">${procName}${bad?' · '+bad+' 项待改':''}</span></div>
+        <div class="tools">
+          <button class="hbt" ?disabled=${!this.canUndo()} @click=${()=>{ this.undo(); buzz(6); }}>↶</button>
+          <button class="hbt" ?disabled=${!this.canRedo()} @click=${()=>{ this.redo(); buzz(6); }}>↷</button>
+          <button class="x" @click=${()=>this.snapDock('peek',true)}>收起</button>
+        </div>
+      </div>
+      <div class="dnav">
+        <button @click=${()=>{ this.snapDock('half',true); this.jumpDock('#dTargets'); }}>选件</button>
+        <button @click=${()=>{ this.snapDock('half',true); this.jumpDock('#dNum'); }}>数值</button>
+        <button @click=${()=>{ this.snapDock('half',true); this.jumpDock('#dLib'); }}>形体库</button>
+        <button @click=${()=>this.openChecks()}>校验${bad?' · '+bad:''}</button>
+        <button @click=${()=>{ this.snapDock('full',true); buzz(6); }}>全屏</button>
+        <button @click=${()=>this.setTab('out')}>导出</button>
+      </div>
+      <div class="dbody">
+        <div class="chips" id="dTargets">
+          <button class="chip ${!st.solo?'on':''}" @click=${()=>this.setSoloTarget(null)}>整体</button>
+          ${proj.parts.filter(pt=>['pcb','cell','side','mic'].indexOf(pt.id)<0).map(pt=>html`
+            <button class="chip ${st.solo===pt.id?'on':''}" @click=${()=>this.setSoloTarget(pt.id)}>${pt.n.split('(')[0]}</button>`)}
+          ${list.map(s=>html`<button class="chip ${st.solo===('c'+s.uid)?'on':''}" @click=${()=>this.setSoloTarget('c'+s.uid)}>${STAGE.PRIMS[s.type].n}#${s.uid}</button>`)}
+        </div>
+
+        ${sel?html`
+          <div class="dsec" id="dNum">数值 <em>吸附 ${st.snap} mm · 点数字可直接输入</em></div>
+          <div class="nrows">
+            ${this.numRow(sel,'x','X 位置')}
+            ${this.numRow(sel,'z','Z 位置')}
+            ${this.numRow(sel,'y','Y 高度')}
+            ${isCyl||isPad?this.numRow(sel,'dia','柱/孔外径',0.2):''}
+            ${isHollow?this.numRow(sel,'dd','预钻孔 Ø',0.1):''}
+            ${isPad?html`${this.numRow(sel,'w','X 向间距')}${this.numRow(sel,'dd','Z 向间距')}${this.numRow(sel,'hd','内孔 Ø',0.1)}`:''}
+            ${isRect?html`${this.numRow(sel,'w','长度')}${this.numRow(sel,'dd','厚度')}`:''}
+            ${this.numRow(sel,'h','高度',0.2)}
+            ${sel.type==='rib'||sel.type==='wall'?this.numRow(sel,'draft','拔模角(°)',0.5):''}
+            ${this.numRow(sel,'rot','绕 Y 转 °',5)}
+          </div>
+          <div class="btnrow">
+            <button class="btn" @click=${()=>this.place(sel.uid,'center')}>居中</button>
+            <button class="btn" @click=${()=>this.place(sel.uid,'wall')}>贴内壁</button>
+            <button class="btn" @click=${()=>this.place(sel.uid,'top')}>贴顶</button>
+            <button class="btn" @click=${()=>this.place(sel.uid,'bottom')}>贴底</button>
+          </div>
+          <div class="btnrow">
+            <button class="btn" @click=${()=>this.arrayRing(sel.uid,4)}>阵列 ×4</button>
+            <button class="btn" @click=${()=>this.arrayRing(sel.uid,6)}>×6</button>
+            <button class="btn" @click=${()=>this.arrayRing(sel.uid,8)}>×8</button>
+            <button class="btn" @click=${()=>this.dupPrim(sel.uid)}>复制</button>
+            <button class="btn" @click=${()=>this.delPrim(sel.uid)}>删除</button>
+          </div>
+          <div class="hint">距内壁 ${f1(clearanceTo(st.project,st.params,sel),1)} mm · ${STAGE.PRIMS[sel.type].n}${HOLLOW_TYPES.indexOf(sel.type)>=0?' 预钻孔已按标准给':''}</div>
+        `:html`
+          <div class="dsec">开始建模 <em>点下面任一个,直接加到壳里</em></div>
+          <div class="hint" style="margin:0 0 4px">建议先加一根「加强筋」看内壁,再加「螺丝柱 M2.5」定位主板。</div>`}
+
+        <div class="dsec" id="dLib">形体库 <em>标准件按规格预置</em></div>
+        <div class="prow">
+          ${Object.keys(STAGE.PRIMS).map(k=>html`
+            <button class="pco ${sel&&sel.type===k?'hot':''}" @click=${()=>this.addPrim(k)}>
+              <b>${STAGE.PRIMS[k].n}</b><span>${primSpecText(k)}</span>
+            </button>`)}
+        </div>
+
+        <details class="acc" id="dGeo" style="margin-top:8px">
+          <summary><span class="ix">G</span>${geoTitle}<span class="chev">▾</span></summary>
+          <div class="body">
+            ${geo.map(g=>html`
+              <div class="slider">
+                <div class="lab"><span>${g.n}</span>
+                  <input class="sv" type="number" inputmode="decimal" min=${g.min} max=${g.max} step=${g.step}
+                    .value=${String(st.params[g.k])} @change=${e=>this.onParamNum(g.k,e)}></div>
+                <input type="range" min=${g.min} max=${g.max} step=${g.step} .value=${String(st.params[g.k])}
+                  style="--p:${(st.params[g.k]-g.min)/(g.max-g.min)*100}%"
+                  @input=${e=>this.onParam(g.k,e)}>
+              </div>`)}
+            <div class="btnrow" style="align-items:center">
+              <span class="hint" style="margin:0">吸附</span>
+              ${[0.5,1,5].map(v=>html`<button class="chip ${st.snap===v?'on':''}" @click=${()=>this.setSnap(v)}>${v} mm</button>`)}
+            </div>
+            <div class="hint">${st.project==='round'?'三个弧面参数直接写进需求单,CNC 按它编程;数值变化时网格自动夹到不干涉的安全范围。':'壁厚与主尺寸改完,校验与报价同步重算。'}</div>
+          </div>
+        </details>
+
+        <details class="acc" id="dProc">
+          <summary><span class="ix">C</span>工艺约束 · ${rule.name}<em>${bad?bad+' 项需改':'通过'}</em><span class="chev">▾</span></summary>
+          <div class="body">
+            <div class="chips" style="flex-wrap:wrap">
+              ${proj.processes.map(pr=>html`<button class="chip ${st.proc===pr.key?'on':''}"
+                @click=${()=>this.setProc(pr.key)}>${({'cnc-alu':'CNC 铝','cnc-abs':'CNC ABS','die-cast':'压铸','abs-mold':'注塑','sil-mold':'硅胶','vacuum':'复模'}[pr.key])||pr.n}</button>`)}
+            </div>
+            <table class="tbl"><tbody>
+              ${rule.items.map(r=>html`<tr><td style="white-space:nowrap">${r[0]}</td><td style="text-align:left">${r[1]}</td></tr>`)}
+            </tbody></table>
+            <div class="hint">${rk==='cnc'?'CNC:结构件必须给坐标 + 刀具半径,内角 R 不得小于刀径一半。':'注塑/硅胶:壁厚、拔模、筋厚是硬约束。'}</div>
+          </div>
+        </details>
+
+        <details class="acc">
+          <summary><span class="ix">P</span>主体参数(全部外形)<span class="chev">▾</span></summary>
+          <div class="body">
+            ${proj.params.map(p=>html`
+              <div class="slider">
+                <div class="lab"><span>${p.n} <em style="font-style:normal;color:#9aa7ba">${p.group||''}</em></span>
+                  <input class="sv" type="number" inputmode="decimal" min=${p.min} max=${p.max} step=${p.step}
+                    .value=${String(st.params[p.k])} @change=${e=>this.onParamNum(p.k,e)}></div>
+                <input type="range" min=${p.min} max=${p.max} step=${p.step} .value=${String(st.params[p.k])}
+                  style="--p:${(st.params[p.k]-p.min)/(p.max-p.min)*100}%"
+                  @input=${e=>this.onParam(p.k,e)}>
+              </div>`)}
+            <div class="btnrow">
+              <button class="btn" @click=${()=>this.resetParams()}>恢复默认外形</button>
+              <button class="btn" @click=${()=>{ this.pushHist(); STAGE.clearCustom(); this.state.selUid=null; this.persistCustom(); this.requestUpdate(); }}>清空结构件</button>
+            </div>
+          </div>
+        </details>
+
+        <div class="panel" id="chkPanel" style="margin-top:10px">
+          <h5>模型校验 <em>${bad?bad+' 项需改':'全部通过'}</em></h5>
+          ${checks.map(c=>html`<div class="chk ${c.ok?'ok':'bad'}"><i>${c.ok?'✓':'!'}</i><span>${c.t}</span></div>`)}
+        </div>
+
+        <div class="panel" id="dList">
+          <h5>结构件清单 <em>${list.length} 件</em></h5>
+          ${list.length?list.map(s=>{
+            const dim=(CYL_TYPES.indexOf(s.type)>=0)
+              ?('Ø'+f1(s.dia,1)+' × H'+f1(s.h,1))
+              :(f1(s.w,1)+'×'+f1(s.dd,1)+'×H'+f1(s.h,1));
+            return html`<div class="pr ${st.selUid===s.uid?'on':''}" @click=${()=>{ this.state.selUid=s.uid; STAGE.highlight('c'+s.uid); this.requestUpdate(); this.jumpDock('#dNum'); }}>
+              <div><b>${STAGE.PRIMS[s.type].n}</b><span>${dim} · x ${f1(s.x,1)} / y ${f1(s.y,1)} / z ${f1(s.z,1)}</span></div>
+              <button class="del" @click=${e=>{ e.stopPropagation(); this.delPrim(s.uid); }}>删</button>
+            </div>`;}):html`<div class="hint">还没有结构件。</div>`}
+        </div>
+
+        <div class="hint" style="margin-top:10px">单指旋转 · 双指缩放/平移 · 双击零件聚焦;把手上下拖可改面板高度(≤20% 看整图)。</div>
+      </div>
+    </div>`;
+  }
+
+  renderLook(){
+    const st=this.state, proj=PROJECTS[st.project];
+    return html`
+    <div class="panel">
+      <h5>参数化外形 <em>拖动即重算曲面</em></h5>
+      ${proj.params.map(p=>html`
+        <div class="slider">
+          <div class="lab"><span>${p.n} <em style="font-style:normal;color:#9aa7ba">${p.group||''}</em></span><input class="sv" type="number" inputmode="decimal" min=${p.min} max=${p.max} step=${p.step}
+              .value=${String(st.params[p.k])} @change=${e=>this.onParamNum(p.k,e)}></div>
+          <input type="range" min=${p.min} max=${p.max} step=${p.step} .value=${String(st.params[p.k])}
+            style="--p:${(st.params[p.k]-p.min)/(p.max-p.min)*100}%"
+            @input=${e=>this.onParam(p.k,e)}>
+        </div>`)}
+      <div class="hint">数值为外形定义尺寸;修改后 3D 网格、标注、爆炸图、导出文件全部同步。</div>
+      <div class="btnrow">
+        <button class="btn" @click=${()=>this.resetParams()}>恢复默认</button>
+        <button class="btn" @click=${()=>STAGE.setView('iso')}>回到 45°</button>
+      </div>
+    </div>
+
+    <div class="panel">
+      <h5>派生尺寸 <em>实时</em></h5>
+      <dl class="kv" id="derived">
+        ${derived(st.project,st.params).map(d=>html`<dt>${d[0]}</dt><dd>${d[1]}</dd>`)}
+      </dl>
+    </div>
+
+    <div class="panel">
+      <h5>材质与表面 <em>点选即换 PBR 材质</em></h5>
+      <div class="btnrow">
+        ${proj.materials.map(k=>html`<button class="btn ${st.material===k?'dark':''}"
+          @click=${()=>{ this.state.material=k; STAGE.setMaterial(k); this.persist(); this.requestUpdate(); }}>${MATERIALS[k].name}</button>`)}
+      </div>
+      <div class="hint">${MATERIALS[st.material]?(MATERIALS[st.material].note||'渲染为近似 PBR,实际以样板为准'):''}</div>
+    </div>`;
+  }
+
+  renderAsm(){
+    const st=this.state, proj=PROJECTS[st.project];
+    return html`
+    <div class="panel">
+      <h5>爆炸图 <em>拖动滑块分离零件</em></h5>
+      <div class="slider">
+        <div class="lab"><span>拆解程度</span><b>${Math.round(st.explode*100)}%</b></div>
+        <input type="range" min="0" max="1" step="0.05" .value=${String(st.explode)}
+          style="--p:${st.explode*100}%"
+          @input=${e=>{ this.state.explode=parseFloat(e.target.value); STAGE.setExplode(this.state.explode);
+            e.target.closest('.slider').querySelector('b').textContent=Math.round(this.state.explode*100)+'%';
+            this.querySelectorAll('.pitem').forEach(x=>x.classList.toggle('on',false)); }}>
+      </div>
+      <div class="btnrow">
+        <button class="btn ${st.explode>0.3?'pri':''}" @click=${()=>{ this.state.explode=0.9; STAGE.setExplode(0.9); this.requestUpdate(); }}>一键爆炸</button>
+        <button class="btn" @click=${()=>{ this.state.explode=0; STAGE.setExplode(0); this.requestUpdate(); }}>合模复位</button>
+        <button class="btn" @click=${()=>{ const on=!STAGE.isCutaway(); STAGE.setCutaway(on); this.requestUpdate(); }}>${STAGE.isCutaway()?'恢复实心':'透视外壳'}</button>
+      </div>
+      <div class="hint">壳体是闭合件,内部结构默认被外壳挡住;爆炸超过 20% 时外壳自动半透明,才能看到电芯/主板/铜柱的相对位置。</div>
+    </div>
+
+    <div class="panel">
+      <h5>零件清单 <em>点选高亮</em></h5>
+      <div class="parts">
+        ${proj.parts.map(pt=>html`
+          <div class="pr pitem ${st.hl===pt.id?'on':''}"
+            @click=${()=>{ this.state.hl=(st.hl===pt.id?null:pt.id); STAGE.highlight(this.state.hl); this.requestUpdate(); }}
+            style=${st.hl===pt.id?'background:#eef4fe':''}>
+            <span>${pt.n}</span><em>${pt.q} 件 · ${pt.proc}</em>
+          </div>`)}
+      </div>
+    </div>
+
+    <div class="panel">
+      <h5>装配顺序 <em>${proj.steps.length} 步</em></h5>
+      ${proj.steps.map((s,i)=>html`
+        <div class="steprow">
+          <div class="stepno">${i+1}</div>
+          <div><b>${s.n}</b><span>${s.d}</span></div>
+        </div>`)}
+    </div>`;
+  }
+
+  soloName(pid){
+    const proj=PROJECTS[this.state.project];
+    if(String(pid)[0]==='c'){ const s=this.custom().find(x=>'c'+x.uid===pid); return s?(STAGE.PRIMS[s.type].n+' #'+s.uid):pid; }
+    const pt=proj.parts.find(x=>x.id===pid);
+    return pt?pt.n:pid;
+  }
+
+  procLabel(k){
+    const r=ruleKey(k);
+    return r==='injection'?'注塑':(r==='silicone'?'硅胶':(r==='cnc'?'CNC':(r==='vac'?'复模':'压铸')));
+  }
+
+  numRow(s,key,label,step){
+    const st=(key==='h'||key==='dia')?0.2:(this.state.snap||0.5);
+    return html`<div class="nrow">
+      <span class="nl">${label}</span>
+      <button class="nb" @click=${()=>this.nudge(s.uid,key,-step)}>−</button>
+      <input class="ni" type="number" step=${String(step)} .value=${String(s[key]!==undefined?s[key]:0)}
+        @change=${e=>this.setField(s.uid,key,parseFloat(e.target.value))}>
+      <button class="nb" @click=${()=>this.nudge(s.uid,key,step)}>+</button>
+      <em>mm</em>
+    </div>`;
+  }
+
+  renderModel(){ return html`<div style="height:2px"></div>`; }
+
+  renderElec(){
+    const st=this.state;
+    const list=BOARDS.filter(b=>b.fit===st.project||b.id==='esp32s3'&&st.project==='recorder');
+    const rows=fitRows(st.project,st.params);
+    return html`
+    <div class="panel">
+      <h5>尺寸对照 <em>俯视 · mm</em></h5>
+      <div .innerHTML=${fitSVG(st.project,st.params)}></div>
+      <table class="tbl" style="margin-top:2px"><tbody>
+        ${(st.project==='round'?[
+          ['外形','Ø'+f1(st.params.D,2)+' mm'],['黑边开口','Ø'+f1(st.params.bd,1)+' mm'],
+          ['屏可视','Ø'+f1(st.params.sd,2)+' mm'],['主板','Ø44 mm'],['铜柱','4 × M2']]:[]).map(r=>html`<tr><td>${r[0]}</td><td class="num">${r[1]}</td></tr>`)}
+        ${(st.project==='recorder'?[
+          ['外形','Ø'+f1(st.params.D,1)+' mm'],['内腔','Ø'+f1(st.params.D-2*st.params.t,1)+' mm'],
+          ['主控板建议','Ø'+f1(Math.min(st.params.D-2*st.params.t-4,26),0)+' mm'],['电芯','402030 · 4×20×30'],
+          ['麦孔','4 × Ø1.0']]:[]).map(r=>html`<tr><td>${r[0]}</td><td class="num">${r[1]}</td></tr>`)}
+        ${(st.project==='silicone'?[
+          ['外形',''+f1(st.params.w+2*st.params.t,1)+' × '+f1(st.params.d+2*st.params.t,1)+' mm'],
+          ['内腔',''+f1(st.params.w,1)+' × '+f1(st.params.d,1)+' mm'],['屏视窗',''+f1(Math.max(6,st.params.w-2.8),1)+' × '+f1(Math.max(6,st.params.d-2.8),1)+' mm'],
+          ['表体','41.3 × 41.3(实机复测)']]:[]).map(r=>html`<tr><td>${r[0]}</td><td class="num">${r[1]}</td></tr>`)}
+      </tbody></table>
+      <div class="hint" style="display:flex;gap:10px;flex-wrap:wrap">
+        <span><i style="display:inline-block;width:12px;height:2px;background:#1f6feb;vertical-align:middle"></i> 外形</span>
+        <span><i style="display:inline-block;width:12px;height:2px;background:#94a3b8;vertical-align:middle"></i> 内腔</span>
+        <span><i style="display:inline-block;width:12px;height:2px;background:#0f9d58;vertical-align:middle"></i> 屏幕/主板</span>
+        <span><i style="display:inline-block;width:8px;height:8px;border-radius:50%;background:#b08d57;vertical-align:middle"></i> 铜柱</span>
+      </div>
+    </div>
+    <div class="panel">
+      <h5>空间校验 <em>壳体 vs 电子件</em></h5>
+      <div class="scrollx"><table class="tbl">
+        <thead><tr><th>校验项</th><th>结论</th></tr></thead>
+        <tbody>${rows.map(r=>html`<tr><td>${r[0]}</td><td>${r[1]}</td></tr>`)}</tbody>
+      </table></div>
+      <div class="hint">校验基于当前参数快照与公开规格;打样前请以官方图纸与实机复测。</div>
+    </div>
+    <div class="panel">
+      <h5>可选电子模组 <em>成熟开发板优先</em></h5>
+      ${list.map(b=>html`
+        <div class="board">
+          <div class="bv"><i></i></div>
+          <div class="bi">
+            <b>${b.name}</b>
+            <span>${b.od} · ${b.screen}</span>
+            <span>${b.iface}</span>
+            <span class="bd">${b.tag}</span>
+            <dl class="kv">
+              <dt>主控</dt><dd>${b.soc}</dd>
+              <dt>板载</dt><dd style="text-align:left">${b.extra}</dd>
+              <dt>参考价</dt><dd>${b.price}</dd>
+            </dl>
+            <div class="hint">${b.note}</div>
+          </div>
+        </div>`)}
+      <div class="hint">来源:${list.map(b=>b.source).join(' / ')}</div>
+    </div>
+    <div class="panel">
+      <h5>选型原则 <em>不打 PCB</em></h5>
+      ${KB.find(k=>k.id==='elec').body.map(item=>{
+        if(item[0]==='ul') return html`<ul style="font-size:12px;padding-left:18px;color:#31425a;line-height:1.7">${item[1].map(x=>html`<li>${x}</li>`)}</ul>`;
+        if(item[0]==='p') return html`<div class="hint">${item[1]}</div>`;
+        if(item[0]==='note') return html`<div class="note">${item[1]}</div>`;
+        return '';
+      })}
+    </div>`;
+  }
+
+  renderProc(){
+    const st=this.state, proj=PROJECTS[st.project];
+    const rows=processTable(st.project,st.qty);
+    return html`
+    <div class="panel">
+      <h5>批量与单套成本 <em>含模具摊销</em></h5>
+      <div class="slider">
+        <div class="lab"><span>下单数量</span><b>${st.qty} 套</b></div>
+        <input type="range" min="50" max="5000" step="50" .value=${String(st.qty)}
+          style="--p:${(st.qty-50)/4950*100}%"
+          @input=${e=>{ this.state.qty=parseInt(e.target.value,10);
+            e.target.closest('.slider').querySelector('b').textContent=this.state.qty+' 套';
+            const t=this.querySelector('#proctable'); if(t) t.innerHTML=this.procRowsHTML(); }}>
+      </div>
+      <div class="scrollx"><table class="tbl">
+        <thead><tr><th>工艺</th><th class="num">单价</th><th class="num">模具/一次性</th><th class="num">单套综合</th><th>交期</th></tr></thead>
+        <tbody id="proctable" .innerHTML=${this.procRowsHTML()}></tbody>
+      </table></div>
+      <div class="hint">综合 =(一次性费用 + 单价×数量)/ 数量。低于 MOQ 时按最小批量摊,实际会被拒单或加价。</div>
+    </div>
+
+    <div class="panel">
+      <h5>工艺提示 <em>来自前期询价</em></h5>
+      ${proj.notes.map(n=>html`<div class="note">${n}</div>`)}
+    </div>
+
+    <div class="panel">
+      <h5>公差表</h5>
+      <table class="tbl"><tbody>
+        ${proj.tolerance.map(t=>html`<tr><td>${t[0]}</td><td class="num">${t[1]}</td></tr>`)}
+      </tbody></table>
+    </div>`;
+  }
+
+  procRowsHTML(){
+    const rows=processTable(this.state.project,this.state.qty);
+    return rows.map(r=>`<tr>
+      <td>${r.n}${r.below?'<br><span style="color:#d97706;font-size:10px">低于MOQ</span>':''}</td>
+      <td class="num">¥${f1(r.unitUsed,1)}</td>
+      <td class="num">¥${r.mold}</td>
+      <td class="num"><b>¥${f1(r.per,1)}</b></td>
+      <td>${r.lead}</td></tr>`).join('');
+  }
+
+  renderOut(){
+    const st=this.state, proj=PROJECTS[st.project];
+    return html`
+    <div class="panel">
+      <h5>导出 <em>直接存到手机</em></h5>
+      <div class="btnrow">
+        <button class="btn dark" @click=${()=>this.saveSTL()}>STL 网格</button>
+        <button class="btn" @click=${()=>this.saveOBJ()}>OBJ 网格</button>
+        <button class="btn" @click=${()=>this.savePNG()}>PNG 截图</button>
+      </div>
+      <div class="btnrow">
+        <button class="btn pri" @click=${()=>this.saveSpec()}>生产需求单 .md</button>
+        <button class="btn" @click=${()=>this.saveBOM()}>BOM .csv</button>
+        <button class="btn" @click=${()=>this.saveJSON()}>参数 .json</button>
+      </div>
+      <div class="hint">STL/OBJ 由当前 3D 网格直接生成(单位 mm,已按世界坐标烘焙)。手机浏览器会存到「下载」目录。</div>
+    </div>
+
+    <div class="panel">
+      <h5>分件导出 <em>每件一个 STL,手机可逐个下载</em></h5>
+      <div class="chips">
+        ${proj.parts.filter(pt=>(EXPORTABLE[st.project]||[]).indexOf(pt.id)>=0).map(pt=>html`<button class="chip" @click=${()=>this.savePartSTL(pt.id,pt.n.split('(')[0])}>${pt.n.split('(')[0]} ↓</button>`)}
+        ${this.custom().map(s=>html`<button class="chip" @click=${()=>this.savePartSTL('c'+s.uid,STAGE.PRIMS[s.type].n+s.uid)}>${STAGE.PRIMS[s.type].n}#${s.uid} ↓</button>`)}
+      </div>
+      <div class="hint">整件 STL 供预览;分件 STL 给 CNC/开模按件编程。含玻璃、PCB、电芯等非加工件会自动排除。</div>
+    </div>
+
+    <div class="panel">
+      <h5>给工厂的文件清单 <em>${proj.name}</em></h5>
+      <table class="tbl"><tbody>
+        ${proj.files.map(f=>html`<tr><td>${f}</td><td class="num">必备</td></tr>`)}
+        <tr><td>本需求单 + STL/OBJ 预览</td><td class="num">报价用</td></tr>
+      </tbody></table>
+      <div class="note">浏览器端无法生成 STEP 实体。开模/CNC 编程仍需 STEP(或由工厂按 2D 图纸建模,费用约 ¥500~1,500)。本工具输出的是「可报价、可评审」的完整包,不是可直接开模的最终文件。</div>
+    </div>
+
+    <div class="panel">
+      <h5>当前快照</h5>
+      <dl class="kv">
+        ${derived(st.project,st.params).map(d=>html`<dt>${d[0]}</dt><dd>${d[1]}</dd>`)}
+        <dt>材质</dt><dd>${MATERIALS[st.material]?MATERIALS[st.material].name:''}</dd>
+        <dt>报价数量</dt><dd>${st.qty} 套</dd>
+      </dl>
+    </div>`;
+  }
+
+  /* ---------- 渲染:知识库 ---------- */
+  renderKB(){
+    const notes=LS.get('ss.refs.note',{});
+    return html`
+    <div class="topbar"><div class="inner">
+      <button class="iconbtn" @click=${()=>this.go('#/')}>←</button>
+      <div class="tt"><h1>工艺知识库</h1><p>壳体 · 工艺 · 文件 · 电子件 · 参考文章</p></div>
+    </div></div>
+    <div class="wrap">
+      <div class="hero" style="padding:18px 18px 16px">
+        <div class="kicker">KNOWLEDGE BASE</div>
+        <h2 style="font-size:20px">从创意到能报价,只差这一套口径</h2>
+        <p>工艺成本、MOQ 真相、文件格式、DFM 与电子件选型,全部按可执行口径整理,随时回看。</p>
+      </div>
+
+      ${KB.map(k=>html`
+        <details class="acc" ${k.id==='process'?'open':''}>
+          <summary><span class="ix">${k.ix}</span>${k.title}<span class="chev">▾</span></summary>
+          <div class="body">${this.renderKBItem(k)}</div>
+        </details>`)}
+
+      <div class="sec"><h3>参考文章 / 对话存档</h3><span>长期保存在本机</span></div>
+      ${REFS.map(r=>html`
+        <div class="acc">
+          <div style="padding:12px 14px">
+            <span class="tag b">${r.tag}</span>
+            <div class="ref" style="margin-top:8px;border:none;padding:0;background:transparent">
+              <b>${r.n}</b>
+              <span>${r.u}</span>
+            </div>
+            <div class="hint">${r.d}</div>
+            ${notes[r.id]?html`<details style="margin-top:8px">
+              <summary style="font-size:12px;color:#1f6feb">已录入正文(${notes[r.id].length} 字)· 点击展开</summary>
+              <div style="font-size:12px;line-height:1.7;white-space:pre-wrap;margin-top:8px;color:#31425a">${notes[r.id]}</div>
+            </details>`:''}
+            ${r.id==='wx1'?html`
+            <div style="margin-top:10px">
+              <textarea id="wxtext" placeholder="公众号有 robots 限制,无法自动抓取。把正文粘贴到这里,点保存即可长期归档在本机…"></textarea>
+              <div class="btnrow">
+                <button class="btn pri" @click=${()=>this.saveArticle()}>保存正文到本机</button>
+                <button class="btn" @click=${()=>{ const t=this.querySelector('#wxtext'); if(t) t.value=notes['wx1']||''; }}>读取已存</button>
+              </div>
+            </div>`:''}
+          </div>
+        </div>`)}
+
+      <div class="panel" style="margin-top:12px">
+        <h5>电子件速查 <em>${BOARDS.length} 个模组</em></h5>
+        ${BOARDS.map(b=>html`
+          <div style="padding:9px 0;border-bottom:1px dashed var(--line)">
+            <div style="display:flex;justify-content:space-between;gap:10px">
+              <b style="font-size:12px">${b.name}</b><span style="font-size:10.5px;color:#68758a;white-space:nowrap">${b.od}</span>
+            </div>
+            <div class="hint">${b.screen} · ${b.iface}</div>
+          </div>`)}
+      </div>
+
+      <div class="foot">知识库内容为工程口径整理,价格为 2026-11 深圳/东莞行情参考。<br>引用文章版权归原作者;本页仅存链接与自录摘要。</div>
+    </div>`;
+  }
+
+  renderKBItem(k){
+    return k.body.map(item=>{
+      if(item[0]==='table'){
+        return html`<div class="scrollx"><table class="tbl">
+          <thead><tr>${item[1].map(h=>html`<th>${h}</th>`)}</tr></thead>
+          <tbody>${item[2].map(r=>html`<tr>${r.map(c=>html`<td>${c}</td>`)}</tr>`)}</tbody>
+        </table></div>`;
+      }
+      if(item[0]==='p') return html`<p>${item[1]}</p>`;
+      if(item[0]==='ul') return html`<ul>${item[1].map(x=>html`<li>${x}</li>`)}</ul>`;
+      if(item[0]==='note') return html`<div class="note">${item[1]}</div>`;
+      return '';
+    });
+  }
+
+  saveArticle(){
+    const t=this.querySelector('#wxtext');
+    if(!t||!t.value.trim()) return;
+    const notes=LS.get('ss.refs.note',{});
+    notes['wx1']=t.value.trim();
+    LS.set('ss.refs.note',notes);
+    alert('已保存到本机(清理浏览器数据会丢失,重要内容建议另存)');
+    this.requestUpdate();
+  }
+
+  /* ---------- 导出动作 ---------- */
+  resetParams(){
+    this.state.params=defaultParams(this.state.project);
+    STAGE.setParams(this.state.params);
+    this.persist();
+    this.requestUpdate();
+  }
+  baseName(){
+    const proj=PROJECTS[this.state.project];
+    const d=new Date();
+    const stamp=d.getFullYear()+String(d.getMonth()+1).padStart(2,'0')+String(d.getDate()).padStart(2,'0');
+    return proj.name.replace(/[^\u4e00-\u9fa5A-Za-z0-9]/g,'')+'-'+stamp;
+  }
+  saveSTL(){
+    const r=STAGE.exportSTL(this.baseName());
+    if(!r) return alert('3D 尚未就绪');
+    saveFile(this.baseName()+'.stl',r.text,'model/stl');
+    toast('已导出 '+this.baseName()+'.stl('+(r.text.split('facet').length-1)+' 面)');
+  }
+  saveOBJ(){
+    const r=STAGE.exportOBJ(this.baseName());
+    if(!r) return alert('3D 尚未就绪');
+    saveFile(this.baseName()+'.obj',r.text,'text/plain');
+    toast('已导出 '+this.baseName()+'.obj');
+  }
+  savePNG(){
+    const url=STAGE.snapshot();
+    if(!url) return alert('3D 尚未就绪');
+    saveDataURL(this.baseName()+'.png',url);
+    toast('已保存当前视角截图');
+  }
+  saveSpec(){
+    const md=specMarkdown(this.state.project,this.state.params,this.state.material,this.state.qty,this.custom());
+    saveFile(this.baseName()+'-生产需求单.md',md,'text/markdown');
+    toast('需求单已生成('+md.length+' 字)');
+  }
+  saveBOM(){
+    saveFile(this.baseName()+'-BOM.csv','\ufeff'+bomCSV(this.state.project,this.state.params,this.state.material),'text/csv');
+  }
+  saveJSON(){
+    saveFile(this.baseName()+'.json',specJSON(this.state.project,this.state.params,this.state.material,this.state.qty,this.custom()),'application/json');
+    toast('参数 JSON 已导出');
+  }
+
+  render(){
+    if(this.state.route==='kb') return this.renderKB();
+    if(this.state.route==='project') return this.renderProject();
+    return this.renderHub();
+  }
+}
+customElements.define('app-root',AppRoot);
+
+window.SHELL={STAGE:STAGE,PROJECTS:PROJECTS,MATERIALS:MATERIALS,spec:specMarkdown,svg:fitSVG};
+
+/* 移除加载层 */
+const boot=document.getElementById('boot');
+if(boot){
+  setTimeout(()=>{ boot.classList.add('hide'); setTimeout(()=>boot.remove(),400); },220);
+}
+function bootFail(msg){
+  const b=document.getElementById('bootmsg');
+  if(b) b.textContent='加载失败:'+msg+'(请检查网络后刷新)';
+}
+window.addEventListener('unhandledrejection',e=>bootFail((e.reason&&e.reason.message)||'依赖未就绪'));
+window.addEventListener('error',e=>{ if(!customElements.get('app-root')) bootFail(e.message||'脚本错误'); });
+</script>
+</body>
+</html>

+ 45 - 0
site/app.js

@@ -0,0 +1,45 @@
+/**
+ * app.js —— 挂载入口:路由 → 按页懒加载 Lit 页面组件。
+ * 首屏(展厅)与详情页不加载 Babylon;Babylon 只在实验室页动态引入。
+ */
+import { createRouter } from './utils/router.js';
+import { galleryPage } from './page/gallery.js';
+import { productPage } from './page/product.js';
+import { labPage } from './page/lab.js';
+import { notFoundPage } from './page/not-found.js';
+
+const routes = [
+  { path: '/', render: galleryPage },
+  { path: "/p/:id", render: productPage },
+  { path: '/lab/:id', render: labPage },
+  { path: '*', render: notFoundPage },
+];
+
+function tryCatch(fn) { return async (ctx) => { try { return await fn(ctx); } catch (e) { console.error('[page]', e); throw e; } }; }
+for (const r of routes) r.render = tryCatch(r.render);
+const router = createRouter(routes);
+window.__hits = 0;
+const root = document.getElementById('app');
+
+/** 每次导航递增;异步页面若在途中被新导航顶掉,就丢弃结果 */
+let navToken = 0;
+async function paint() {
+  window.__hits++;
+  const token = ++navToken;
+  const r = router.resolve();
+  let el;
+  try {
+    el = await r.render({ path: r.path, params: r.params, navigate: router.navigate });
+  } catch (err) {
+    console.error(err);
+    el = document.createElement('ph-error');
+    el.error = err;
+  }
+  if (token !== navToken) return;
+  root.replaceChildren(el);
+  window.scrollTo(0, 0);
+  document.title = el.title || 'Pocket Hardware Lab · FmodeCode';
+}
+
+router.start(paint);
+window.__ph = { router, paint };

+ 12 - 0
site/assets/app.css

@@ -0,0 +1,12 @@
+/* app.css —— 展厅 / 详情页 / 实验室的 Apple 风格页面底色(浅色纯白、深色纯黑) */
+:root {
+  --fx-font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro SC", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
+}
+/* 白底主 KV 靠下层「白色」照片底无缝融合;给 html 也上色,避免根层透明导致 multiply 叠到默认白画布 */
+html { background: #ffffff; }
+body { background: #ffffff; color: #1d1d1f; }
+@media (prefers-color-scheme: dark) {
+  html, body { background: #000000; color: #f5f5f7; }
+  :root { color-scheme: dark; }
+}
+ph-gallery, ph-product, ph-lab, ph-not-found { display: block; }

BIN
site/assets/detail/ai-pin-detail.png


BIN
site/assets/detail/ai-pin-explode.png


BIN
site/assets/detail/ai-pin-lifestyle.png


BIN
site/assets/detail/bone-headset-detail.png


BIN
site/assets/detail/bone-headset-explode.png


BIN
site/assets/detail/bone-headset-lifestyle.png


BIN
site/assets/detail/eink-tag-detail.png


BIN
site/assets/detail/eink-tag-explode.png


BIN
site/assets/detail/eink-tag-lifestyle.png


BIN
site/assets/detail/pocket-ai-detail.png


BIN
site/assets/detail/pocket-ai-explode.png


BIN
site/assets/detail/pocket-ai-lifestyle.png


BIN
site/assets/detail/recorder-bean-detail.png


BIN
site/assets/detail/recorder-bean-explode.png


BIN
site/assets/detail/recorder-bean-lifestyle.png


BIN
site/assets/detail/round-screen-detail.png


BIN
site/assets/detail/round-screen-explode.png


BIN
site/assets/detail/round-screen-lifestyle.png


BIN
site/assets/detail/smart-ring-detail.png


BIN
site/assets/detail/smart-ring-explode.png


BIN
site/assets/detail/smart-ring-lifestyle.png


BIN
site/assets/detail/watch-case-detail.png


BIN
site/assets/detail/watch-case-explode.png


BIN
site/assets/detail/watch-case-lifestyle.png


BIN
site/assets/kv/ai-pin-hero.png


BIN
site/assets/kv/bone-headset-hero.png


BIN
site/assets/kv/eink-tag-hero.png


BIN
site/assets/kv/pocket-ai-hero.png


BIN
site/assets/kv/recorder-bean-hero.png


BIN
site/assets/kv/round-screen-hero.png


BIN
site/assets/kv/smart-ring-hero.png


BIN
site/assets/kv/watch-case-hero.png


+ 69 - 0
site/assets/theme.css

@@ -0,0 +1,69 @@
+/* theme.css —— 全局设计变量(唯一色值来源;组件内只引用 --fx-* 变量) */
+:root {
+  --fx-violet: #6C5CE7;
+  --fx-violet-light: #A78BFA;
+  --fx-blue: #3B82F6;
+  --fx-cyan: #00D2FF;
+  --fx-bg: #F8F9FC;
+  --fx-bg-deep: #060913;
+  --fx-surface: #FFFFFF;
+  --fx-surface-2: #F1F3F8;
+  --fx-surface-glass: rgba(255, 255, 255, 0.72);
+  --fx-text: #111528;
+  --fx-text-2: #5B6178;
+  --fx-text-3: #8A90A6;
+  --fx-line: #E4E7F0;
+  --fx-line-strong: #CDD2E0;
+  --fx-ok: #10B981;
+  --fx-warn: #F59E0B;
+  --fx-bad: #EF4444;
+  --fx-grad: linear-gradient(135deg, var(--fx-violet) 0%, var(--fx-blue) 60%, var(--fx-cyan) 100%);
+  --fx-grad-soft: linear-gradient(135deg, rgba(108, 92, 231, 0.12), rgba(0, 210, 255, 0.10));
+  --fx-radius: 16px;
+  --fx-radius-sm: 10px;
+  --fx-radius-pill: 999px;
+  --fx-shadow: 0 6px 24px rgba(17, 21, 40, 0.08);
+  --fx-shadow-lg: 0 18px 48px rgba(17, 21, 40, 0.14);
+  --fx-glass: saturate(160%) blur(18px);
+  --fx-font: -apple-system, BlinkMacSystemFont, "SF Pro SC", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
+  --fx-mono: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
+  --fx-safe-t: env(safe-area-inset-top, 0px);
+  --fx-safe-b: env(safe-area-inset-bottom, 0px);
+  --fx-safe-l: env(safe-area-inset-left, 0px);
+  --fx-safe-r: env(safe-area-inset-right, 0px);
+  --fx-topbar-h: 56px;
+  color-scheme: light;
+}
+
+@media (prefers-color-scheme: dark) {
+  body { background: #000; }
+  :root {
+    --fx-bg: #060913;
+    --fx-surface: #0E1326;
+    --fx-surface-2: #151B33;
+    --fx-surface-glass: rgba(14, 19, 38, 0.72);
+    --fx-text: #EEF1FA;
+    --fx-text-2: #A7AEC6;
+    --fx-text-3: #6E7691;
+    --fx-line: #232B47;
+    --fx-line-strong: #354066;
+    --fx-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
+    color-scheme: dark;
+  }
+}
+
+* { box-sizing: border-box; }
+html, body { margin: 0; padding: 0; }
+html { -webkit-text-size-adjust: 100%; }
+body {
+  font-family: var(--fx-font);
+  background: #fff;
+  color: var(--fx-text);
+  font-size: 15px;
+  line-height: 1.5;
+  overscroll-behavior-y: none;
+  -webkit-tap-highlight-color: transparent;
+}
+a { color: var(--fx-violet); }
+button, input, select { font-family: inherit; }
+.boot { padding: 48px 20px; text-align: center; color: var(--fx-text-3); }

+ 17 - 0
site/config.js

@@ -0,0 +1,17 @@
+/**
+ * config.js —— 全站唯一「部署基址」变量。
+ * <base href>、importmap 前缀、renderBase、路由 base 都由这里派生(规则:三处同源)。
+ * 部署到 OBS 子目录时只改这一处(改成带结尾斜杠的前缀,如 '../hardware-lab/')。
+ */
+export const APP_BASE = './';
+
+/** 从当前文档的 <base href> 得到绝对基址(末尾带 /) */
+export function docBase() {
+  const b = (typeof document !== 'undefined' && document.baseURI) || '';
+  return b.endsWith('/') ? b : b + '/';
+}
+
+/** 应用内路径 → 可 ESM import 的模块 URL(相对基址,绝不丢部署前缀) */
+export function moduleUrl(path) {
+  return new URL(path.replace(/^\.?\//, ''), docBase()).href;
+}

+ 68 - 0
site/core/geometry/assembly.js

@@ -0,0 +1,68 @@
+/**
+ * core/geometry/assembly.js —— 零件分层 → 3D 装配位姿 → 爆炸位移(纯函数)。
+ * 坐标:整机底面中心为原点,Z 向上,单位 mm。分��偏移沿 Z。
+ */
+
+export const DEFAULT_PARTS = [
+  { id: 'front-shell', name: '前壳', role: 'lid', split: 0.88 },
+  { id: 'back-shell', name: '后盖', role: 'back' },
+  { id: 'button', name: '按键', role: 'button' },
+  { id: 'hanger', name: '挂环', role: 'ring' },
+  { id: 'screen', name: '显示屏', role: 'screen', transparent: 0.6 },
+  { id: 'battery', name: '电池', role: 'battery' },
+  { id: 'pcb', name: '主板', role: 'pcb' },
+  { id: 'brass', name: '铜柱', role: 'brass' },
+  { id: 'clip', name: '卡扣', role: 'clip' },
+];
+
+/** 零件纵向 [z0, z1] 与横向包络(用于爆炸图与单件高亮) */
+export function partLayer(part, envelopeH, idx, total) {
+  const role = part.role;
+  const H = envelopeH;
+  const band = {
+    lid: [H * 0.7, H],
+    back: [0, H * 0.7],
+    shell: [0, H],
+    button: [H * 0.3, H * 0.55],
+    ring: [H * 0.2, H * 0.6],
+    screen: [H * 0.72, H * 0.95],
+    battery: [H * 0.4, H * 0.65],
+    pcb: [H * 0.55, H * 0.72],
+    brass: [H * 0.3, H * 0.7],
+    clip: [H * 0.6, H * 0.7],
+  }[role] || [H * 0.4, H * 0.6];
+  return { z0: band[0], z1: band[1], order: idx, of: total };
+}
+
+export function buildParts(shape, related = []) {
+  const list = related.length >= 9 ? related : DEFAULT_PARTS;
+  const H = +(shape.defaults || shape).height || 10;
+  return list.map((p, i) => ({ ...p, layer: partLayer(p, H, i, list.length) }));
+}
+
+/**
+ * 爆炸位移:0 → 全部贴合;100% → 沿 Z 拉开。
+ * external 外件(lid/back/ring/button)向上/下走,internal 按层序带状散开。
+ * 返回 [{id, dz, isExternal}]
+ */
+export function explodeOffsets(parts, pct = 0) {
+  const t = Math.max(0, Math.min(100, pct)) / 100;
+  const H = Math.max(...parts.map((p) => p.layer.z1), 1);
+  const step = H * 0.55 * t + 6 * t;
+  return parts.map((p) => {
+    const role = p.role;
+    const isExternal = ['lid', 'back', 'shell', 'ring', 'button'].includes(role);
+    let dz = 0;
+    if (role === 'lid') dz = step * 1.4;
+    else if (role === 'back') dz = -step * 1.0;
+    else if (role === 'ring') dz = -step * 1.5;
+    else if (role === 'button') dz = step * 0.6;
+    else {
+      const mid = (p.layer.z0 + p.layer.z1) / 2;
+      dz = (mid - H / 2) * t * 0.6;
+      if (role === 'screen') dz += step * 0.9;
+      if (role === 'battery') dz -= step * 0.4;
+    }
+    return { id: p.id, role, dz, isExternal };
+  });
+}

+ 50 - 0
site/core/geometry/interference.js

@@ -0,0 +1,50 @@
+/**
+ * core/geometry/interference.js —— 电子件与内腔的空间校验(AABB 包围盒近似)。
+ * 电子件按「矩形板」处理;内腔按内孔半径 / 内框半尺寸计算。返回余量与判定。
+ */
+
+const EPS = 0.001;
+
+/**
+ * @param {{l:number,w:number,t:number}} partSize   电子件长宽厚
+ * @param {{l:number,w:number,t:number}} cavitySize 内腔可用包络
+ * @param {{z:number}} mount                        z = 电子件底面离整机底面
+ */
+export function interference(partSize, cavitySize, mount, wall = 1, margin = 0.4) {
+  const g = {
+    x: (cavitySize.l - partSize.l) / 2,
+    y: (cavitySize.w - partSize.w) / 2,
+    zBot: (mount.z ?? 0) - wall,
+    zTop: (cavitySize.t + wall) - ((mount.z ?? 0) + partSize.t),
+  };
+  const gap = Math.min(g.x, g.y, g.zBot, g.zTop);
+  return { gap: round(gap), clash: gap < 0, tight: gap >= 0 && gap < margin, axes: mapObj(g, round) };
+}
+
+function round(v) { return Math.round(v * 100) / 100; }
+function mapObj(o, f) { const r = {}; for (const k in o) r[k] = f(o[k]); return r; }
+
+/** 圆件内腔包络(Ø = 2·(rHole)); 方件用内框 */
+export function cavityFromShape(shape, meta) {
+  const d = shape.defaults || shape;
+  if (shape.type === 'rect') {
+    return { l: Math.max(1, +d.dTop - 2 * d.wall), w: Math.max(1, +d.length - 2 * d.wall), t: Math.max(1, +d.height - 2 * d.wall) };
+  }
+  const dia = meta?.rHole ? meta.rHole * 2 : +d.dTop - 2 * d.wall;
+  return { l: dia, w: dia, t: Math.max(1, +d.height - 2 * d.wall) };
+}
+
+/** 对一组电子件逐个做校验 */
+export function checkElectronics(electronics, cavity, wall = 1) {
+  return electronics.map((e) => {
+    const size = { l: e.size.l, w: e.size.w, t: e.size.t };
+    return { id: e.id, name: e.name, ...interference(size, cavity, e.mount || { z: wall }, wall) };
+  });
+}
+
+/** 点到内孔的径向余量(MMD 类圆内腔) */
+export function radialClearance(x, y, rCavity, halfDiag) {
+  return round(rCavity - Math.hypot(x, y) - halfDiag);
+}
+
+export { EPS };

+ 299 - 0
site/core/geometry/profile.js

@@ -0,0 +1,299 @@
+/**
+ * core/geometry/profile.js —— 回转体截面轮廓(圆件 / 表壳 / 戒指),纯几何,零 DOM。
+ *
+ * 轴向约定:z = 0 为底面,z = height 为顶面最高点;截面点 [r, z],r 为半径。
+ * 任务书 §2.6:外壁 → 顶部凸圆 R → 短平台 → 屏边凹圆 R(沉台)→ 内孔,
+ * 整条外轮廓必须 G1 连续(切线方向连续),不得出现「台阶凸边」。
+ *
+ * 旧的实现里凸圆圆心取在 (rTop − domeR, zDomeStart),导致凸圆终点落在轴线 rTop(外径边界),
+ * 平台从外径往回折,形成一条 90° 台阶。本版改为:
+ *   设平台内边界 rP = screenR + recessR(凹圆起点),圆心半径 rD = rP + platform,
+ *   凸圆圆心 (rD, zRim − domeR),凸圆终点 (rD + domeR·cos0, …) = (rD + domeR, zRim) 恰为平台外边,
+ *   平台水平段 [rD + domeR, rP] 两端分别与凸圆 / 凹圆相切 —— 外轮廓只有凸起、无折返。
+ *   薄壁 / 小外径时外轮廓的「肩部」不再要求达到 rTop,实际外径 = max(肩部, 外壁拔模终点)。
+ */
+
+const EPS = 1e-6;
+
+function arcSteps(R, sweep, tol = 0.002, maxSegs = 72) {
+  if (!(R > 0) || !(sweep > 1e-3)) return 0;
+  const step = 2 * Math.acos(Math.max(-1, Math.min(1, 1 - tol / R)));
+  return Math.max(2, Math.min(maxSegs, Math.ceil(sweep / Math.max(step, 1e-3))));
+}
+
+function arcPts(cx, cz, R, a0, a1, n) {
+  const out = [];
+  for (let i = 0; i <= n; i++) {
+    const a = a0 + (a1 - a0) * (i / n);
+    out.push([cx + R * Math.cos(a), cz + R * Math.sin(a)]);
+  }
+  return out;
+}
+
+export function dedupe(points, tol = 1e-4) {
+  const out = [];
+  for (const p of points) {
+    const q = out[out.length - 1];
+    // 保留后出现的点:相切处(如平台外边)前后重合时,后者 ∈ 下一段特征,G1 校验才拿得到正确切向
+    if (!q || Math.hypot(p[0] - q[0], p[1] - q[1]) > tol) out.push([p[0], p[1]]);
+    else out[out.length - 1] = [p[0], p[1]];
+  }
+  if (out.length > 2) {
+    const a = out[0], b = out[out.length - 1];
+    if (Math.hypot(a[0] - b[0], a[1] - b[1]) <= tol) out.pop();
+  }
+  return out;
+}
+
+/** 相邻线段方向夹角(°),worst = 闭合环上最大折角。轮廓的 G1 校验即看它。 */
+export function checkG1(points, tolDeg = 0.5) {
+  const n = points.length;
+  const issues = [];
+  let worst = 0, worstAt = -1;
+  for (let i = 0; i < n; i++) {
+    const a = points[(i - 1 + n) % n], b = points[i], c = points[(i + 1) % n];
+    const v1 = [b[0] - a[0], b[1] - a[1]], v2 = [c[0] - b[0], c[1] - b[1]];
+    const l1 = Math.hypot(v1[0], v1[1]), l2 = Math.hypot(v2[0], v2[1]);
+    if (l1 < 1e-6 || l2 < 1e-6) continue;
+    const ang = Math.acos(Math.max(-1, Math.min(1, (v1[0] * v2[0] + v1[1] * v2[1]) / (l1 * l2)))) * 180 / Math.PI;
+    // 折角 = 转向角 = 两段切线的夹角(相切处为 0°)
+    const fold = 180 - ang;
+    if (fold > worst) { worst = fold; worstAt = i; }
+    if (fold > tolDeg) issues.push({ at: i, deg: fold, r: b[0], z: b[1] });
+  }
+  // 弧的弦化误差让相邻短弦之间存在 ~1° 级别的「弦折角」,属离散化噪声;
+  // 真正的硬边(台阶凸边 / 折返)至少 30°。G1 以 12° 为硬边阈值。
+  return { ok: worst <= 12, issues, worst, worstAt };
+}
+
+/**
+ * 圆件轮廓
+ * @param {object} p shape.defaults 参数(dTop/dBottom/height/wall/domeR/platform/recessR/recessDepth/screenD/chamferC/draft)
+ * @returns {{points:Array<[number,number]>, meta:object, warnings:string[], g1:boolean}}
+ */
+export function roundProfile(p) {
+  const warnings = [];
+  const clamp = (v, lo, hi) => Math.max(lo, Math.min(hi, v));
+  const H = Math.max(2, +p.height || 10);
+  const rTop = Math.max(1, (+p.dTop || 40) / 2);
+  const draft = clamp(+p.draft || 0, 0, 5);
+  const tanD = Math.tan((draft * Math.PI) / 180);
+  const wall = clamp(+p.wall || 1.5, 0.4, 4.5);
+  const screenR = clamp((+p.screenD || rTop) / 2, 1, rTop - 0.5);
+  const domeR0 = Math.max(0.3, +p.domeR || 1.5);
+  const recessR0 = Math.max(0.15, +p.recessR || 1);
+  const platform0 = Math.max(0, +p.platform ?? 1);
+  const chamferC = Math.max(0, +p.chamferC || 0);
+
+  // ---------- 轴向 ----------
+  const zTop = H;
+  const bottomWall = Math.max(0.4, Math.min(wall, H * 0.25));
+  const zFloor = bottomWall;
+  const rCav = Math.max(0.5, rTop - wall);          // 内腔半径(腔内包络 = Ø2rCav)
+  const rLip = rCav;                                 // 孔口半径(内腔向上直通到孔口)
+  let recessDepth = clamp(+p.recessDepth || 1, 0.2, Math.max(0.4, H - wall - zFloor - 1));
+  const zRecessFloor = H - wall - recessDepth;       // 沉台底(屏支撑面)
+
+  // ---------- 径向(从内孔往外的水平预算,全部由壁厚 wall 提供) ----------
+  // 预算 = rTop − rCav;凸起部分(凹圆+平台+凸圆)必须 > 壁厚才能在顶面形成过渡带。
+  // 默认值放不下时:先压缩平台 → 凸圆 → 凹圆,得到一个可行的「最小」布局;
+  // 然后整个凸起带「等比加宽」补足壁厚预算(不超出默认值),让肩部自然落在外壁上。
+  let recessR = recessR0, domeR = domeR0, platform = platform0;
+  const db = rTop - rCav;
+  const sum0 = recessR + platform + domeR;
+  let scale = 1;
+  const recessReq = recessR, domeReq = domeR;
+  if (sum0 > db) {
+    scale = db / sum0;
+    recessR *= scale; domeR *= scale; platform *= scale;
+    const minD = Math.min(0.5, domeR0), minR = Math.min(0.3, recessR0);   // 工艺最小 R(许可证下限,可略低于 UI 滑块下限)
+    if (domeR < minD - 1e-9 || recessR < minR - 1e-9) {
+      // 太薄:保底 凸圆≥0.5 / 凹圆≥0.3,平台让位(可采用略小于滑块下限的工艺最小 R)
+      domeR = Math.min(minD, db * 0.45); recessR = Math.min(minR, db * 0.45); platform = Math.max(0, db - domeR - recessR);
+      warnings.push(`壁厚 ${db.toFixed(2)} mm 不足以容纳 R${domeR0}/${recessR0} 弧面,已按最小可行值收敛(建议壁厚 ≥ ${(sum0 + 0.2).toFixed(2)} mm 或外径加大)`);
+    } else {
+      warnings.push(`凸圆/平台/凹圆之和 ${sum0.toFixed(2)} > 壁厚 ${db.toFixed(2)},整体等比收敛 ×${scale.toFixed(2)}`);
+    }
+  }
+  const rP = rCav + recessR;                 // 凹圆圆心半径 = 平台内边
+  const rD = rP + platform;                  // 凸圆圆心半径
+  const rShoulder = Math.min(rTop, rD + domeR);
+  const shoulder = Math.max(0, rShoulder - rD);
+  // 凸圆圆心在高度 zC、半径 rD;最高点 H 要求 rD + 切向延伸(平台边)≤ rTop。
+  // 顶点角 α = π/2 − atan(平台 / domeR):顶点落在平台外边时切线水平(与短平台相切);
+  // 若顶点角 < α,凸圆在平台边处切开并用竖直段落到平台高度(切线竖直,与平台成直角——只在平台被压为零时出现)。
+  const platUsed = Math.max(0, rShoulder - rP);
+  // 凸圆扫角 θ:sinθ = platUsed / domeR;平台为正常量时切线不与外壁垂直,外壁直线止于 zTan = H − domeR·cosθ
+  const theta = platUsed > 1e-6 ? Math.max(0, Math.min(Math.asin(Math.min(1, platUsed / domeR)), Math.PI / 2 - 0.02, Math.acos(Math.max(0, Math.min(1, (rShoulder - rP) / domeR))))) : 0;
+  const zC = H - domeR;                      // 凸圆 / 凹圆圆心高度 = 平台高度
+  let zTan = H - domeR * Math.cos(theta);
+  if (platUsed <= 1e-6) zTan = zC + domeR;   // 平台为零:凸圆完整转过顶点
+  const zRecTop = zC;                        // 凹圆圆心高度 = 凸圆圆心高度(短平台高度)
+  const zShoulder = H;
+  const alpha = Math.PI / 2 - Math.atan(platUsed / domeR);
+  const aD0Preview = -Math.PI / 2 + (draft * Math.PI) / 180;
+
+  // 外壁:切点 (rShoulder, zTan) 向下按拔模向外扩;倒角 C 再切掉底边
+  const rWallBot = rShoulder + zTan * tanD;
+  const ch = Math.max(0, Math.min(chamferC, zTan * 0.8, rWallBot - 0.5));
+  const rBot = rWallBot - ch;
+
+  // ---------- 组装(逆时针:底面轴心 → 外轮廓 → 顶面 → 内腔 → 回轴心) ----------
+  const pts = [];
+  const push = (a) => pts.push(a);
+  push([0, 0]);
+  push([rBot, 0]);
+  if (ch > 0.01) push([rBot + ch, ch]);                              // 底边倒角 C(45°)
+  push([rShoulder, zTan]);                                           // 外壁拔模直线 → 凸圆切点
+  // 顶部凸圆:圆心 (rD, zTan),起点角度 −(90° − draft) 使圆周切线垂直于外壁拔模线(严格相切)→ 平台边
+  const aD0 = -Math.PI / 2 + (draft * Math.PI) / 180;
+  // 凸圆圆心 = (rD, zTan):从外壁切点 (rShoulder, zTan) 起,切线竖直 → 相切;
+  // 沿弧转到「平台边」角度 −90°+θ,终点切线与水平面夹角 = θ(平台外沿处与水平短平台相切)
+  if (theta > 1e-4) {
+    const segs = Math.max(2, Math.ceil(theta / 0.04));
+    arcPts(rD, zTan, domeR, -Math.PI / 2, -Math.PI / 2 + theta, segs).forEach(push);
+    if (Math.abs(domeR - domeReq) > 1e-9) warnings.push(`凸圆 R 按壁厚预算拟合为 R${domeR.toFixed(2)}(输入 R${domeReq})`);
+  } else {
+    push([rD, zTan + domeR]);                                   // 退化:竖直小段直达顶点
+    push([rD, zC]);
+  }
+  // 短平台(水平)→ 屏边凹圆圆心 (rP, zC)
+  if (rShoulder - rP > 1e-3 || theta > 1e-4) push([rP, zC]);
+  // 屏边凹圆:圆心 (rP, zRecTop),π → 3π/2,终点 (rCav, zTan) 切线竖直 → 孔壁
+  arcPts(rP, zRecTop, recessR, Math.PI, 1.5 * Math.PI, Math.max(2, Math.ceil((Math.PI / 2) / 0.04))).forEach((q) => pts.push(q));
+  if (Math.abs(recessR - recessReq) > 1e-9) warnings.push(`屏边凹圆 R 按壁厚预算拟合为 R${recessR.toFixed(2)}(输入 R${recessReq})`);
+  // 孔壁竖直向下到沉台底(屏支撑面)
+  push([rCav, zRecessFloor]);
+  // 沉台平底向内(屏背面支撑台阶),再落内腔底
+  const lipW = Math.min(wall * 0.6, (rCav - 0.5) * 0.2);
+  const step = Math.min(0.4, Math.max(0, (zRecessFloor - zFloor) * 0.3));
+  if (lipW > 0.2) {
+    push([rCav - lipW, zRecessFloor]);
+    if (step > 0.05) { push([rCav - lipW, zRecessFloor - step]); push([rCav, zRecessFloor - step]); }
+  }
+  push([rCav, zFloor]);
+  push([0, zFloor]);
+
+  const points = dedupe(pts.filter((q, i) => i === 0 || Math.hypot(q[0] - pts[i - 1][0], q[1] - pts[i - 1][1]) > 1e-6));
+  // 点列里真实的凸圆扫角(起点在圆心正下方 −90°,终点在平台边)
+  const thetaReal = theta;
+  const issues = profileJoints(points, { draft, rCav, rP, rD, rShoulder, domeR, recessR, zTan, zC, theta: thetaReal, platUsed, zPlat: zC });
+  for (const i of issues) warnings.push(`${i.joint} 处存在 ${i.deg}° 折角(应平滑过渡)`);
+
+  const outerR = Math.max(...points.map((q) => q[0]));
+  const domeUsed = theta > 1e-4 ? domeR : domeR;
+
+  return {
+    points,
+    g1: issues.length === 0,
+    g1Issues: issues,
+    warnings,
+    meta: {
+      height: H, rTop, rBot, draft, wall, screenR, recessR, domeR, shoulder, theta: thetaReal, platform: Math.max(0, rShoulder - rP),
+      recessDepth, chamferC: ch, rHole: rCav, rCav, rP, rD, rShoulder,
+      zShoulder, zTan, zFloor, zRecessFloor, zRecTop,
+      outerR,
+      bbox: { dTop: outerR * 2, dBottom: rBot * 2, height: H },
+    },
+  };
+}
+
+/**
+ * 外轮廓接缝折角检测(独立可测)—— 面向「切线方向」而不是点列邻居:
+ *   记 out(t) 为点列沿程参数 t 处、圆弧半径 <10mm 时的外法向(远离圆心),否则 (1,0);
+ *   折角 = 180° − 两段切线方向夹角。相切 ≈ 180°,直角 = 90°,折返 ≈ 0°。
+ *   外壁→凸圆 与 平台→凹圆 要求 ≥ 175°(严格相切);凸圆→平台 ≥ 180° − θ − 5°;
+ *   凹圆→孔壁 ≥ 175°。凸圆退化为竖直小段(θ=0)时凸圆→平台以竖直/水平计 90°,视为设计折线(仅平台被压为零时出现)。
+ * @param {Array<[number,number]>} points 截面点列(自底面外缘起,逆时针到孔壁)
+ * @param {object} g {rShoulder, zTan, rD, domeR, rP, zC, rCav, recessR, theta, draft}
+ * @returns {Array<{joint,deg,r,z}>} 超限接缝
+ */
+export function profileJoints(points, g) {
+  const issues = [];
+  const near = (q, r, z) => Math.abs(q[0] - r) < 1e-6 && Math.abs(q[1] - z) < 1e-6;
+  // 半径 < 10mm 的半径场视为圆弧(外法向远离圆心),否则视为水平(平台 / 孔壁切线竖直)
+  // 外切向(回转体母线统一取「向上」):圆弧上取 <0, -dr>,直线段取 <1, 0>,两段切向对齐后才可比夹角
+  // 直线段(外壁 / 平台)统一取上向 <1, 0>;圆弧段取该点处切线,方向随点变化
+  const tang = (q, r, z) => (Math.abs(q[0] - r) < 10 ? [q[1] - z, -(q[0] - r)] : [1, 0]);
+  const orient = (t) => t;
+  const angle = (a, b) => {
+    const l = Math.hypot(a[0], a[1]) * Math.hypot(b[0], b[1]);
+    if (l < 1e-12) return 180;
+    return Math.acos(Math.max(-1, Math.min(1, (a[0] * b[0] + a[1] * b[1]) / l))) * 180 / Math.PI;
+  };
+  // tA / tB:两段特征在其接缝处的真实(已定向)切向;缺省时由代表点 + 圆心推算
+  const norm = (t) => { const l = Math.hypot(t[0], t[1]) || 1; return t.map((v) => v / l); };
+  const joint = (name, qA, cA, cB, qB, minDeg, tA, tB) => {
+    // 未传入时按水平直线处理(外壁 / 平台 / 孔壁都是直线段)
+    const auto = () => [1, 0];
+    const ta = tA ?? auto(qA, cA);
+    const tb = tB ?? auto(qB, cB);
+    // 折角 = 两处切向的夹角(母线方向只表示行进方向,同向/反向都算相切)
+    const deg = Math.min(angle(norm(ta), norm(tb)), angle(norm(ta), norm(tb.map((v) => -v))));
+    if (deg < minDeg) issues.push({ joint: name, deg: +deg.toFixed(2), r: +(qA[0]).toFixed(3), z: +(qA[1]).toFixed(3) });
+  };
+  const domeC = [g.rD, g.zTan], recC = [g.rP, g.zC];
+  // 凹圆(π → 3π/2)的外切向在两端都是向上的竖直方向,代表点取圆弧最高点(圆心正上方)
+  const recTop = [g.rP, g.zC + g.recessR];
+  // 凹圆两端(π 与 3π/2)的母线切向均为上向竖直 <0, 1>,与平板平台成 90°(未倒角时为亚视设计硬边)
+  const tRec = [0, 1];
+  const tPlat = [1, 0];
+  if (g.theta > 1e-4) {
+    const bEnd = -Math.PI / 2 + g.theta;
+    // 凸圆终点:沿「内法向」(平台在 +r 侧)转 θ
+    const endQ = [g.rD + g.domeR * Math.cos(bEnd), g.zTan + g.domeR * Math.sin(bEnd)];
+    // 凸圆终点切向与水平夹角 = θ(终点处圆弧切向是水平带 θ 的上向)
+    const tDomeEnd = [Math.sin(g.theta), Math.cos(g.theta)];
+    // 外壁→凸圆:外壁向上(略内收)与凸圆起点竖直向上切线
+    joint('外壁→凸圆', [g.rShoulder, g.zTan], [g.rD, g.zTan], domeC, [g.rShoulder, g.zTan], 175 - (g.draft || 0), [1, 0], [0, 1]);
+    // 凸圆→平台:凸圆终点切线(向上、与水平差 θ)vs 平台水平
+    joint('凸圆→平台', endQ, domeC, [0, 1e6 + g.zC], endQ, 180 - (g.theta * 180) / Math.PI - 5, tDomeEnd, [1, 0]);
+    // 平台→凹圆:平台水平 vs 凹圆起点 (rP, zC) 处切线(向下、竖直)
+    if (g.platUsed > 1e-6) joint('平台→凹圆', [g.rP, g.zC], [0, 1e6 + g.zC], recC, recTop, 175.1, tPlat, tRec);
+  } else {
+    const q = [g.rD, g.zTan + g.domeR];
+    const qTop = [g.rD, g.zTan + 1e9];
+    // 外壁→竖直小段:竖直小段切线与外壁(水平切线)—— 应为 90°(平台为零时的设计折线,容忍 30°)
+    joint('外壁→凸圆', [g.rShoulder, g.zTan], [g.rD, g.zTan], qTop, q, 60, [1, 0], [0, 1]);
+    joint('凸圆→平台', q, qTop, [0, 1e6 + g.zC], q, 85, [0, 1], [1, 0]);
+    if (g.platUsed > 1e-6) joint('平台→凹圆', [g.rP, g.zC], [0, 1e6 + g.zC], recC, recTop, 175.1, tPlat, tRec);
+  }
+  // 凹圆终点在 (rCav = rP + recessR, zC),即圆心正右方;终点切线竖直向下,与孔壁向下直线相切
+  joint('凹圆→孔壁', [g.rCav, g.zC], recC, [0, 1e6 + g.zC], [g.rCav, g.zC], 0, [0, 1], [0, 1]);
+  void near; void points;
+  return issues;
+}
+
+/** 圆件在高度 z 处的外半径(线性插值;用于特征落点、体积) */
+export function radiusAtHeight(profile, z) {
+  const pts = profile.points;
+  let best = 0;
+  for (let i = 0; i < pts.length; i++) {
+    const a = pts[i], b = pts[(i + 1) % pts.length];
+    if ((a[1] - z) * (b[1] - z) <= 0 && Math.abs(a[1] - b[1]) > 1e-9) {
+      const t = (z - a[1]) / (b[1] - a[1]);
+      best = Math.max(best, a[0] + (b[0] - a[0]) * t);
+    }
+  }
+  return best;
+}
+
+/** 回转体体积(cm³):Pappus(∫π r² dz 等价于鞋带面积 × 2π·质心半径) */
+export function revolveVolume(profile) {
+  const pts = profile.points;
+  let A = 0, M = 0;
+  for (let i = 0; i < pts.length; i++) {
+    const a = pts[i], b = pts[(i + 1) % pts.length];
+    const cross = a[0] * b[1] - b[0] * a[1];
+    A += cross;
+    M += (a[0] + b[0]) * cross;
+  }
+  A = Math.abs(A) / 2;
+  const rc = Math.abs(M) / (6 * Math.max(A, 1e-9));
+  return (2 * Math.PI * rc * A) / 1000;
+}
+
+/** 直线段折角统计(供单测:外轮廓 G1 校验) */
+export function worstFold(points) {
+  return checkG1(points).worst;
+}

+ 56 - 0
site/core/geometry/rect.js

@@ -0,0 +1,56 @@
+/**
+ * core/geometry/rect.js —— 方件(rect)与戒指(ring)的包络与体积计算,纯函数零 DOM。
+ * 3D 造型在 wc/ph-viewer3d.js 里用 Babylon 建;这里只负责「数学」,保证 Node 可测、与 3D 同源。
+ */
+
+export function clamp(v, lo, hi) { return Math.max(lo, Math.min(hi, v)); }
+
+/** 圆角矩形面积(mm²) */
+export function roundedRectArea(l, w, r) {
+  const rr = clamp(r, 0, Math.min(l, w) / 2);
+  return l * w - (4 - Math.PI) * rr * rr;
+}
+
+/** 方件外形(拔模后底面积略小),hollow 时扣除壁厚一圈 */
+export function partsVolumeCm3(p) {
+  const l = +p.l || 40, w = +p.w || 30, t = +p.t || 5, r = +p.cornerR || 0;
+  const wall = +p.wall || 1.5;
+  const draft = +p.draft || 0;
+  const shrink = Math.tan((draft * Math.PI) / 180) * t * 0.5;
+  const A0 = roundedRectArea(l, w, r);
+  const A1 = roundedRectArea(Math.max(1, l - 2 * shrink), Math.max(1, w - 2 * shrink), Math.max(0, r - shrink));
+  let v = ((A0 + A1) / 2) * t;
+  if (p.hollow) {
+    const li = l - 2 * wall, wi = w - 2 * wall;
+    if (li > 0 && wi > 0) v -= roundedRectArea(li, wi, Math.max(0, r - wall)) * Math.max(0, t - 2 * wall);
+  }
+  return Math.max(0, v) / 1000;
+}
+
+/** 方件在 z 高度处截面半尺寸(线性拔模) */
+export function rectHalfAt(shape, z) {
+  const d = shape.defaults || shape;
+  const H = +d.height || 10;
+  const draft = +d.draft || 0;
+  const k = 1 - (Math.tan((draft * Math.PI) / 180) * (H - z)) / Math.max(+d.dTop || 40, 1);
+  return { hx: ((+d.dTop || 40) / 2) * k, hy: ((+d.length || 60) / 2) * k };
+}
+
+/** 戒指(圆环)体积 cm³:平均周长 × 截面面积 */
+export function ringVolumeCm3(p) {
+  const d = p.defaults || p;
+  const rAvg = (+d.ringD + +d.ringBandW) / 2;
+  const w = +d.ringBandW || 6.5;
+  const h = +d.height || 6;
+  const inner = (+d.wall || 1.2);
+  const bandArea = w * h - Math.max(0, w - inner) * Math.max(0, h - inner);
+  return (2 * Math.PI * rAvg * bandArea) / 1000;
+}
+
+/** 外形包络尺寸 {l, w, h}(rect → 宽/长/高;round → 直径/直径/高) */
+export function envelope(shape) {
+  const d = shape.defaults || shape;
+  if (shape.type === 'ring') return { l: +d.ringD + 2 * d.ringBandW, w: +d.ringD + 2 * d.ringBandW, h: +d.height };
+  if (shape.type === 'rect') return { l: +d.dTop, w: +d.length, h: +d.height };
+  return { l: +d.dTop, w: +d.dTop, h: +d.height };
+}

+ 189 - 0
site/data/CONTRACT.md

@@ -0,0 +1,189 @@
+# 产品数据契约(site/data/products/*.json)
+
+> Porter:主 Agent(FmodeCode)。数据文件由子 Agent 按本契约填写;消费方是 `site/core/`(纯 ESM,Node 可测)。
+> 所有尺寸单位 **mm**,角度单位 **°**,重量 **g**,体积 **cm³**,价格 **人民币元**。
+
+## 0. 顶层结构
+
+```jsonc
+{
+  "id": "round-screen",              // kebab-case,与文件名一致
+  "name": "圆屏 AI 助手",             // 中文名
+  "latin": "Round Screen Pro",       // 英文/拉丁名(详情页大标题可用)
+  "tagline": "一句话卖点,≤ 20 字",
+  "category": "随身 AI 终端",          // 分类
+  "craftTags": ["CNC 6061", "阳极氧化", "五轴"],   // 工艺标签(卡片上显示,2~4 个)
+  "accent": "#6C5CE7",               // 卡片强调色(仅提示用,UI 有自己的变量)
+  "summary": "80~160 字产品概述(详情页『设计』段)",
+  "shape": { ... },                  // 1. 形体与外壳参数
+  "materials": ["al6061-black", "pc-gloss"],       // 可选 PBR 材质 id(见 §5),第一个为默认
+  "parts": [ ... ],                  // 2. 零件(结构分层 / 爆炸 / BOM 外壳件由它派生)
+  "features": [ ... ],               // 3. 内部结构件标准库实例(14 类库,见 §6)
+  "electronics": [ ... ],            // 4. 电子件(仅市售模块)
+  "consumables": [ ... ],            // 5. 辅料 / 包材
+  "processes": [ ... ],              // 6. 生产工艺与 MOQ 阶梯
+  "processParams": { ... },          // 7. 工艺语言调参的默认值
+  "cost": { ... },                   // 8. 成本测算参数
+  "detail": { ... },                 // 9. 详情页分段内容
+  "dimensions": { "length": 61.6, "width": 61.6, "height": 14.6 }, // 外形包络(已有产品的官方尺寸直接填官方值)
+  "weight": 38.5,                    // 整机目标重量 g(估算值)
+  "priceBasis": "深圳华强北小批行情 / 东莞注塑厂 2026 报价区间中值"
+}
+```
+
+## 1. shape(形体与外壳参数)
+
+`shape.type` 只能是 `"round" | "rect" | "watch" | "ring"`。`shape.defaults` 给出参数默认值,键名固定(面板自动生成)。
+
+```jsonc
+"shape": {
+  "type": "round",
+  "defaults": {
+    "dTop": 61.6,        // 顶部外径 mm(rect 时为顶部宽度)
+    "dBottom": 58.0,     // 底部外径(拔模后)mm
+    "height": 14.6,      // 总高 mm
+    "wall": 1.6,         // 壁厚 mm(0.8~3.0)
+    "domeR": 2.0,        // 顶部凸圆 R(外壁→顶面圆角)≥ 1
+    "platform": 1.0,     // 顶部短平台宽度 mm(0~4),凸圆结束后到屏沉台凹圆起点的水平带
+    "recessR": 1.2,      // 屏边凹圆 R(沉台内角)≥ 0.8
+    "recessDepth": 1.0,  // 沉台深度 mm
+    "screenD": 45.68,    // 屏/沉台直径(rect 为屏宽)mm
+    "chamferC": 0.5,     // 底边倒角 C mm
+    "draft": 1.0,        // 拔模角 °
+    "split": 0.55,       // 拼色分割线位置 0~1(0.55 = 从上往下 55%,watch 推荐 0.62)
+    "cornerR": 8.0,      // rect 水平角 R(round 忽略)
+    "length": 96.0,      // rect 长 mm(含高度方向外的第二水平尺寸)
+    "screenH": 54.0,     // rect 屏高 mm
+    "capR": 3.0,         // rect 顶部沿长边方向的圆角 R
+    "bandD": 17.8,       // watch 表带连接宽度
+    "ringD": 19.2,       // ring 内径
+    "ringBandW": 6.5     // ring 截面宽
+  }
+}
+```
+
+硬校验(消费方会自动校验,失败则不改值):
+- `screenD < dTop - 2*(wall + domeR + platform)`(圆)或 `screenD < width - …`(方)
+- `recessDepth < height * 0.6`;`domeR >= 0.5`;`recessR >= 0.3`;`wall in [0.4, 4.5]`
+- `split in [0.05, 0.95]`
+
+## 2. parts(零件)
+
+```jsonc
+{
+  "id": "front-shell",
+  "name": "前壳",
+  "role": "shell",            // shell | lid | back | button | ring | screen | battery | pcb | brass | clip
+  "material": "6061-T6 铝",
+  "craft": "CNC 五轴",
+  "color": "#2B2D31",
+  "weight": 12.4,             // g(单件净重,估算)
+  "split": 0.9,               // 拼色分割:该件顶部高度占整机高度比例(0~1),缺省 1
+  "transparent": 0.75,        // 可选:默认不透明度(如屏 0.65)
+  "tolerance": "±0.05",       // 尺寸公差
+  "cnc": {                     // 可选:CNC 件的弧面参数(需求单弧面句由此生成)
+    "domeR": 2.0, "recessR": 1.2, "chamferC": 0.5, "thread": "M61.6×0.75"
+  },
+  "notes": "可选的工艺备注"
+}
+```
+
+必须包含:壳体(shell)、上盖/前框(lid 或 front shell 的二件之一)、后盖(back)、按键(button,可多个)、挂环/夹/表耳(ring)、屏(screen)、电池(battery)、主板(pcb),铜柱(brass)与卡扣(clip)视结构可加。至少 9 件。`split` 不同会形成拼色(watch-case 必须双色)。
+
+## 3. features(内部结构件实例)
+
+`type` 必须取自 14 类库(§6)。坐标以整机底部中心为原点,X/Y 为水平(圆件 X 向右),Z 向上,单位 mm,值可为数字(相对参数:见每个类型的 anchor 说明)。每个产品 6~10 个,覆盖至少 5 类。
+
+```jsonc
+{ "id": "pillar-fl", "type": "screw-pillar", "params": { "thread": "M2.5", "od": 4.6, "holeD": 1.9 }, "at": { "x": -20, "y": -16 }, "anchor": "bottom" }
+```
+
+项目库内**内部件编辑**从空开始,features 只是“推荐结构”(页面上一键应用),坐标必须落在壳体内。
+
+## 4. electronics
+
+```jsonc
+{
+  "id": "mcu", "name": "主控板", "model": "微雪 ESP32-S3-Touch-LCD-1.85B",
+  "size": { "l": 52.0, "w": 42.0, "t": 6.5 },
+  "iface": "USB-C / GPIO 排针 / I2C", "power": "5V USB / 3.7V LiPo",
+  "price": 110, "qty": 1, "assembly": "排线 FPC",
+  "mount": { "z": 6.0, "x": 0, "y": 0 },      // 在整机内的摆位(z 为底面距壳体底面)
+  "top": 12.5,                                 // 顶面 z(= mount.z + size.t,消费方也会自行算)
+  "notes": "价格口径:深圳华强北小批行情中值"
+}
+```
+
+至少 4 件;`assembly` ∈ 焊接 / 排线 FPC / 排针 / 弹片 / 磁吸。
+
+## 5. consumables(辅料 / 包材)
+
+`{ "id": "screw-m2", "name": "M2×5 十字盘头自攻螺丝", "spec": "碳钢镀镍", "qty": 6, "unit": "颗", "price": 0.03, "notes": "…" }`
+
+至少 6 行,包含螺丝、双面胶、泡棉、彩盒、说明书,建议再含标签/编织挂绳等。
+
+## 6. processes(生产工艺与 MOQ)
+
+```jsonc
+{
+  "id": "cnc", "name": "CNC 6061", "mouldFee": 0, "mouldLife": "不限", 
+  "moq": 1, "tiers": [ { "qty": 1, "price": 126 }, { "qty": 50, "price": 62 }, { "qty": 200, "price": 54 } ],
+  "sampleDays": "3~5 天", "bulkDays": "7~10 天", "risk": "薄壁处刀具让刀;阳极色差"
+}
+```
+
+`tiers` 必须 3 档,qty 递增、price 递减。每个产品 ≥4 行。价格区间必须落在下面参考表内(可微调,勿偏量级):
+
+| 工艺 | 模具/一次性 | MOQ | 单价区间 |
+|---|---|---|---|
+| 硅胶表壳(双色) 公模改色 | 0(改色费 300~800) | 100~500 | 3.5~6.0 |
+| 硅胶表壳(双色) 新开钢模 | 1800~3500 | 500~1000 | 4.5~7.0 |
+| 录音豆 ABS 壳套件 钢模注塑 | 5500~7500 | 500 | 4.6~6.0 |
+| 录音豆 ABS 壳套件 CNC 6061 | 0 | 1 | 90~130(1~5 套) |
+| 圆屏铝壳套件 CNC 6061 五轴 | 0 | 1 | 110~140(1~5 套)/ 50~200 套 52~65 |
+| 真空复模 ABS | 300~800 | 10 | 12~25 |
+| 3D 打印手板 | 0 | 1 | 25~40(ABS) |
+| 铝压铸 | 12000~30000 | 1000~3000 | 依体积(小件单套 8~25) |
+
+## 7. processParams(生产语言参数,驱动面板)
+
+每个产品至少给 `injection`、`silicone`、`cnc` 三个块;默认值必须合法(校验器会跑)。键名固定:
+
+```jsonc
+"processParams": {
+  "injection": { "wall": 1.6, "draft": 1.0, "ribRatio": 0.55, "depthRatio": 3.0, "gate": "侧浇口" },
+  "silicone":  { "shoreA": 55, "wall": 2.0, "partingLine": "赤道线" },
+  "cnc":       { "ballR": 2.0, "topCrownR": 2.0, "recessR": 1.2, "chamferC": 0.5, "thread": "M61.6×0.75", "tol": "±0.05" },
+  "vacuum":    { "mouldLife": 30, "minR": 0.8 },
+  "diecast":   { "draft": 1.5, "wall": 1.8, "ejector": "四角顶针" }
+}
+```
+取值范围:注塑 wall 0.8~3.0、draft 0.5~3、ribRatio ≤0.6、depthRatio ≤5;硅胶 shoreA 40~70、wall 1.0~4.0;CNC ballR ≥1;复模 mouldLife 20~50、minR 0.3~2;压铸 draft 1~2、wall 1.2~4.0。
+
+## 8. cost
+
+```jsonc
+"cost": { "markup": 3.2, "retailLow": 499, "retailHigh": 699, "tooling": 0, "packagingPerSet": 0 }
+```
+`markup` = 建议零售价 / 单套综合成本(成本测算显示毛利率 = 1 - 1/markup)。`retailLow/High` 为建议零售价带。
+
+## 9. detail(详情页分段)
+
+```jsonc
+"detail": {
+  "title": "大标题(≤ 12 字)",
+  "subtitle": "灰色副标一行",
+  "specs": [ { "k": "直径", "v": "Ø61.6 mm" }, { "k": "厚度", "v": "14.6 mm" }, { "k": "重量", "v": "38.5 g" }, { "k": "材质", "v": "6061-T6 阳极铝" } ],
+  "sections": [
+    { "title": "设计", "body": "…" },
+    { "title": "材质工艺", "body": "…" },
+    { "title": "内部结构", "body": "…" },
+    { "title": "规格表", "body": "…" },
+    { "title": "价格档", "body": "…" }
+  ]
+}
+```
+
+## 10. PBR 材质 id
+
+`sil-silicone` 硅胶哑光 / `abs-matte` ABS 普通 / `abs-rubber` ABS 橡胶油 / `pc-gloss` PC 高光 / `al-silver` 6061 阳极银 / `al-black` 6061 阳极黑 / `ti` 钛 / `ceramic` 陶瓷。

+ 74 - 0
site/data/products/INDEX.json

@@ -0,0 +1,74 @@
+[
+  {
+    "id": "recorder-bean",
+    "name": "磁吸 AI 录音豆",
+    "tagline": "38mm 磁吸录音,随手一贴",
+    "category": "随身 AI 终端",
+    "bomTotal": 38.71,
+    "suggestedPrice": 249,
+    "grossMargin": 62.65
+  },
+  {
+    "id": "watch-case",
+    "name": "智能手表硅胶保护壳(恶魔犄角)",
+    "tagline": "双色包胶,装上就长出犄角",
+    "category": "穿戴配件",
+    "bomTotal": 4.92,
+    "suggestedPrice": 29.9,
+    "grossMargin": 57.56
+  },
+  {
+    "id": "round-screen",
+    "name": "圆屏 AI 桌面助手",
+    "tagline": "61mm 铝圆盘,桌面上的 AI 眼",
+    "category": "桌面 AI 终端",
+    "bomTotal": 498.11,
+    "suggestedPrice": 1099,
+    "grossMargin": 51.68
+  },
+  {
+    "id": "ai-pin",
+    "name": "AI 智能胸针",
+    "tagline": "40mm 钛灰中框,别在胸口的第二块屏",
+    "category": "随身 AI 终端",
+    "bomTotal": 119,
+    "suggestedPrice": 369,
+    "grossMargin": 62.96
+  },
+  {
+    "id": "eink-tag",
+    "name": "电子墨水桌面副屏",
+    "tagline": "145mm 墨水屏,抬头一眼待办",
+    "category": "桌面配件",
+    "bomTotal": 110.15,
+    "suggestedPrice": 349,
+    "grossMargin": 63.13
+  },
+  {
+    "id": "pocket-ai",
+    "name": "口袋 AI 终端",
+    "tagline": "90×62 翻盖,合起来就是一台掌上 AI",
+    "category": "随身 AI 终端",
+    "bomTotal": 246.14,
+    "suggestedPrice": 699,
+    "grossMargin": 60.72
+  },
+  {
+    "id": "bone-headset",
+    "name": "颈挂骨传导耳机",
+    "tagline": "钛丝颈环,跑着也听得见环境",
+    "category": "可穿戴音频",
+    "bomTotal": 60.22,
+    "suggestedPrice": 199,
+    "grossMargin": 61.6
+  },
+  {
+    "id": "smart-ring",
+    "name": "智能健康戒指 + 充电舱",
+    "tagline": "7.9g 钛环,睡一晚就懂你",
+    "category": "健康穿戴",
+    "bomTotal": 119.95,
+    "suggestedPrice": 659,
+    "grossMargin": 62.31
+  }
+]

+ 1091 - 0
site/data/products/ai-pin.json

@@ -0,0 +1,1091 @@
+{
+  "id": "ai-pin",
+  "name": "AI 智能胸针",
+  "latin": "AI Pin",
+  "tagline": "40mm 钛灰中框,别在胸口的第二块屏",
+  "category": "随身 AI 终端",
+  "craftTags": [
+    "钛灰阳极铝",
+    "超薄堆叠",
+    "磁吸针扣"
+  ],
+  "accent": "#7F8C8D",
+  "summary": "一枚只有 8mm 厚的圆形 AI 胸针,40mm 钛灰铝中框包住整块圆形触摸屏,背面用强磁与防刺针扣牢牢别在衣领或外套上。长按即可唤醒语音助手,激光投射把回答投在掌心,麦克风阵列负责听见你的每个问题。",
+  "author": "FmodeCode",
+  "shape": {
+    "type": "round",
+    "defaults": {
+      "dTop": 40.0,
+      "dBottom": 39.0,
+      "height": 8.0,
+      "wall": 1.6,
+      "domeR": 0.5,
+      "platform": 0.3,
+      "recessR": 0.3,
+      "recessDepth": 0.5,
+      "screenD": 30.0,
+      "chamferC": 0.3,
+      "draft": 1.0,
+      "split": 0.42,
+      "cornerR": 8.0,
+      "length": 96.0,
+      "screenH": 54.0,
+      "capR": 3.0,
+      "bandD": 17.8,
+      "ringD": 19.2,
+      "ringBandW": 6.5
+    }
+  },
+  "materials": [
+    "al-black",
+    "ti",
+    "ceramic"
+  ],
+  "parts": [
+    {
+      "id": "mid-frame",
+      "name": "钛灰铝中框",
+      "role": "shell",
+      "material": "6061-T6 铝",
+      "craft": "CNC 车铣 + 钛灰阳极",
+      "color": "#5B6066",
+      "weight": 4.4,
+      "split": 1,
+      "tolerance": "±0.03",
+      "notes": "Ø42 铝管料车削,壁厚 1.6mm,外壁 1° 造型锥度;阳极 12µm 钛灰"
+    },
+    {
+      "id": "top-bezel",
+      "name": "前屏框",
+      "role": "lid",
+      "material": "6061-T6 铝",
+      "craft": "CNC + 喷砂阳极",
+      "color": "#5B6066",
+      "weight": 1.6,
+      "split": 0.95,
+      "tolerance": "±0.03",
+      "cnc": {
+        "domeR": 0.8,
+        "recessR": 0.8,
+        "chamferC": 0.3,
+        "thread": "—"
+      }
+    },
+    {
+      "id": "back-cover",
+      "name": "陶瓷底盖",
+      "role": "back",
+      "material": "氧化锆陶瓷",
+      "craft": "干压烧结 + 抛光",
+      "color": "#E8E6E1",
+      "weight": 4.2,
+      "split": 0,
+      "tolerance": "±0.05",
+      "notes": "不干扰无线充电并给皮肤低温感"
+    },
+    {
+      "id": "btn",
+      "name": "触控 / 物理复合键",
+      "role": "button",
+      "material": "6061 铝",
+      "craft": "CNC + 阳极",
+      "color": "#5B6066",
+      "weight": 0.1,
+      "split": 0.5,
+      "tolerance": "±0.03"
+    },
+    {
+      "id": "clip",
+      "name": "磁吸针扣",
+      "role": "ring",
+      "material": "SUS304 + 硅胶垫",
+      "craft": "冲压 + 包胶",
+      "color": "#8C8F94",
+      "weight": 2.6,
+      "split": 0,
+      "tolerance": "±0.1"
+    },
+    {
+      "id": "screen",
+      "name": "圆形触摸屏",
+      "role": "screen",
+      "material": "LTPS LCD + 2.5D 玻璃",
+      "craft": "OCA 贴合",
+      "color": "#101114",
+      "weight": 2.6,
+      "split": 1,
+      "transparent": 0.65,
+      "tolerance": "±0.03"
+    },
+    {
+      "id": "battery",
+      "name": "超薄聚合物锂电",
+      "role": "battery",
+      "material": "铝塑膜电芯",
+      "craft": "叠片封装",
+      "color": "#B3B8BF",
+      "weight": 3.5,
+      "split": 0,
+      "tolerance": "±0.2"
+    },
+    {
+      "id": "main-pcb",
+      "name": "柔性 + 刚柔结合主板",
+      "role": "pcb",
+      "material": "FR-4 + PI 刚性结合",
+      "craft": "SMT 贴片",
+      "color": "#1B6B3A",
+      "weight": 1.2,
+      "split": 1,
+      "tolerance": "±0.05"
+    },
+    {
+      "id": "brass",
+      "name": "热熔铜螺母",
+      "role": "brass",
+      "material": "黄铜镀镍",
+      "craft": "热熔植入",
+      "color": "#C9A86A",
+      "weight": 0.2,
+      "split": 0,
+      "tolerance": "±0.03"
+    },
+    {
+      "id": "laser",
+      "name": "激光投射窗口",
+      "role": "clip",
+      "material": "BK7 光学玻璃",
+      "craft": "镀膜",
+      "color": "#2D3436",
+      "weight": 0.4,
+      "split": 0,
+      "transparent": 0.7,
+      "tolerance": "±0.02"
+    }
+  ],
+  "features": [
+    {
+      "id": "pillar-a",
+      "type": "screw-pillar",
+      "params": {
+        "thread": "M1.6",
+        "od": 3.2,
+        "holeD": 1.3
+      },
+      "at": {
+        "x": 0,
+        "y": -12
+      },
+      "anchor": "bottom"
+    },
+    {
+      "id": "pillar-b",
+      "type": "screw-pillar",
+      "params": {
+        "thread": "M1.6",
+        "od": 3.2,
+        "holeD": 1.3
+      },
+      "at": {
+        "x": 0,
+        "y": 12
+      },
+      "anchor": "bottom"
+    },
+    {
+      "id": "rib-edge",
+      "type": "rib",
+      "params": {
+        "thickness": 0.6,
+        "height": 1.5,
+        "count": 12
+      },
+      "at": {
+        "x": 0,
+        "y": 0
+      },
+      "anchor": "bottom"
+    },
+    {
+      "id": "snap-top",
+      "type": "snap",
+      "params": {
+        "width": 1.5,
+        "depth": 0.5
+      },
+      "at": {
+        "x": 0,
+        "y": 17
+      },
+      "anchor": "bottom"
+    },
+    {
+      "id": "boss-mag",
+      "type": "boss",
+      "params": {
+        "od": 5.0,
+        "holeD": 0,
+        "height": 1.0
+      },
+      "at": {
+        "x": 0,
+        "y": 13
+      },
+      "anchor": "bottom"
+    },
+    {
+      "id": "pocket-bat",
+      "type": "pocket",
+      "params": {
+        "l": 28.0,
+        "w": 28.0,
+        "depth": 3.4
+      },
+      "at": {
+        "x": 0,
+        "y": 0
+      },
+      "anchor": "bottom"
+    },
+    {
+      "id": "standoff-soc",
+      "type": "standoff",
+      "params": {
+        "od": 2.6,
+        "height": 0.8,
+        "holeD": 1.2
+      },
+      "at": {
+        "x": 6,
+        "y": 6
+      },
+      "anchor": "bottom"
+    }
+  ],
+  "electronics": [
+    {
+      "id": "soc",
+      "name": "主控模组",
+      "model": "AI-Thinker Ai-M62-12F(BL616)",
+      "size": {
+        "l": 12.0,
+        "w": 10.8,
+        "t": 2.4
+      },
+      "iface": "UART / I2S / USB",
+      "power": "3.3V",
+      "price": 9.5,
+      "qty": 1,
+      "assembly": "焊接",
+      "mount": {
+        "z": 0.5,
+        "x": 8,
+        "y": 2
+      },
+      "top": 2.9,
+      "notes": "价格口径:2026 年深圳华强北小批行情区间中值(估算)"
+    },
+    {
+      "id": "imx",
+      "name": "微型摄像头",
+      "model": "OV2640 模组(DVP)",
+      "size": {
+        "l": 12.0,
+        "w": 12.0,
+        "t": 4.5
+      },
+      "iface": "DVP / I2C",
+      "power": "2.8V",
+      "price": 13.5,
+      "qty": 1,
+      "assembly": "排线 FPC",
+      "mount": {
+        "z": 3.2,
+        "x": -6,
+        "y": 3
+      },
+      "top": 7.7,
+      "notes": "价格口径:2026 年深圳华强北小批行情区间中值(估算)"
+    },
+    {
+      "id": "lcd",
+      "name": "圆形触摸屏",
+      "model": "1.28\" 240×240 圆屏 + GT911 触控",
+      "size": {
+        "l": 28.0,
+        "w": 28.0,
+        "t": 2.0
+      },
+      "iface": "SPI / I2C",
+      "power": "3.3V",
+      "price": 26.0,
+      "qty": 1,
+      "assembly": "排线 FPC",
+      "mount": {
+        "z": 4.8,
+        "x": 0,
+        "y": 0
+      },
+      "top": 6.8,
+      "notes": "价格口径:2026 年深圳华强北小批行情区间中值(估算)"
+    },
+    {
+      "id": "mic",
+      "name": "MEMS 麦克风 ×2",
+      "model": "Knowles SPH0645LM4H",
+      "size": {
+        "l": 3.5,
+        "w": 2.65,
+        "t": 0.9
+      },
+      "iface": "I2S",
+      "power": "1.8~3.3V",
+      "price": 2.2,
+      "qty": 2,
+      "assembly": "焊接",
+      "mount": {
+        "z": 0.5,
+        "x": -13,
+        "y": -8
+      },
+      "top": 1.4,
+      "notes": "价格口径:2026 年深圳华强北小批行情区间中值(估算)"
+    },
+    {
+      "id": "laser",
+      "name": "激光投射模组",
+      "model": "MEMS 激光扫描 Φ5 微型模组",
+      "size": {
+        "l": 7.0,
+        "w": 7.0,
+        "t": 2.2
+      },
+      "iface": "I2C / SPI",
+      "power": "3.3V",
+      "price": 28.0,
+      "qty": 1,
+      "assembly": "焊接",
+      "mount": {
+        "z": 0.5,
+        "x": 6,
+        "y": -10
+      },
+      "top": 2.7,
+      "notes": "价格口径:2026 年深圳华强北小批行情区间中值(估算)"
+    },
+    {
+      "id": "battery-mod",
+      "name": "超薄锂电",
+      "model": "3.7V 150mAh 523030",
+      "size": {
+        "l": 30.0,
+        "w": 23.0,
+        "t": 3.0
+      },
+      "iface": "BMS",
+      "power": "3.7V",
+      "price": 4.2,
+      "qty": 1,
+      "assembly": "焊接",
+      "mount": {
+        "z": 0.8,
+        "x": -2,
+        "y": -2
+      },
+      "top": 3.8,
+      "notes": "价格口径:2026 年深圳华强北小批行情区间中值(估算)"
+    }
+  ],
+  "consumables": [
+    {
+      "id": "screw",
+      "name": "M1.6×4 沉头螺丝",
+      "spec": "SUS304",
+      "qty": 2,
+      "unit": "颗",
+      "price": 0.08,
+      "notes": ""
+    },
+    {
+      "id": "tape",
+      "name": "OCA 光学胶",
+      "spec": "三菱 0.125t Ø34",
+      "qty": 1,
+      "unit": "片",
+      "price": 0.55,
+      "notes": ""
+    },
+    {
+      "id": "tape-clip",
+      "name": "针扣硅胶垫双面胶",
+      "spec": "3M 468 0.13t",
+      "qty": 1,
+      "unit": "片",
+      "price": 0.08,
+      "notes": ""
+    },
+    {
+      "id": "foam",
+      "name": "屏蔽泡棉",
+      "spec": "0.3t 导电泡棉",
+      "qty": 2,
+      "unit": "片",
+      "price": 0.05,
+      "notes": ""
+    },
+    {
+      "id": "label",
+      "name": "激光打标(无标签)",
+      "spec": "陶瓷底盖激光刻字",
+      "qty": 1,
+      "unit": "0",
+      "price": 0,
+      "notes": "替代贴纸"
+    },
+    {
+      "id": "box",
+      "name": "彩盒(翻盖磁吸)",
+      "spec": "350g 白卡 + 磁吸翻盖 90×90×25",
+      "qty": 1,
+      "unit": "套",
+      "price": 3.2,
+      "notes": ""
+    },
+    {
+      "id": "manual",
+      "name": "说明书",
+      "spec": "128g 铜版纸 8P",
+      "qty": 1,
+      "unit": "份",
+      "price": 0.45,
+      "notes": ""
+    },
+    {
+      "id": "cable",
+      "name": "磁吸充电线",
+      "spec": "POGO 4P 0.5m",
+      "qty": 1,
+      "unit": "条",
+      "price": 2.2,
+      "notes": ""
+    },
+    {
+      "id": "charging-stand",
+      "name": "磁吸充电座",
+      "spec": "ABS + 硅胶",
+      "qty": 1,
+      "unit": "个",
+      "price": 3.5,
+      "notes": ""
+    }
+  ],
+  "bom": {
+    "currency": "CNY",
+    "bomCurrency": "CNY",
+    "rows": [
+      {
+        "seq": 1,
+        "name": "钛灰铝中框",
+        "spec": "6061-T6 铝管,CNC 车削,阳极 12µm",
+        "supplier": "CNC 加工厂(深圳宝安)",
+        "price": 6.5,
+        "qty": 1,
+        "subtotal": 6.5,
+        "group": "结构件"
+      },
+      {
+        "seq": 2,
+        "name": "前屏框",
+        "spec": "6061-T6 铝 CNC",
+        "supplier": "CNC 加工厂",
+        "price": 2.8,
+        "qty": 1,
+        "subtotal": 2.8,
+        "group": "结构件"
+      },
+      {
+        "seq": 3,
+        "name": "陶瓷底盖",
+        "spec": "氧化锆干压 + 抛光",
+        "supplier": "陶瓷厂(潮州/东莞)",
+        "price": 6.0,
+        "qty": 1,
+        "subtotal": 6.0,
+        "group": "结构件"
+      },
+      {
+        "seq": 4,
+        "name": "复合按键",
+        "spec": "6061 铝 CNC",
+        "supplier": "CNC 加工厂",
+        "price": 0.6,
+        "qty": 1,
+        "subtotal": 0.6,
+        "group": "结构件"
+      },
+      {
+        "seq": 5,
+        "name": "磁吸针扣组件",
+        "spec": "SUS304 + 硅胶垫 + N52 磁环",
+        "supplier": "五金厂",
+        "price": 1.8,
+        "qty": 1,
+        "subtotal": 1.8,
+        "group": "结构件"
+      },
+      {
+        "seq": 6,
+        "name": "激光投射窗口",
+        "spec": "BK7 镀膜玻璃 Ø6",
+        "supplier": "光学元件厂",
+        "price": 1.2,
+        "qty": 1,
+        "subtotal": 1.2,
+        "group": "结构件"
+      },
+      {
+        "seq": 7,
+        "name": "1.28英寸圆形触摸屏(可视区标的)",
+        "spec": "240×240 + GT911",
+        "supplier": "屏厂",
+        "price": 26.0,
+        "qty": 1,
+        "subtotal": 26.0,
+        "group": "电子件",
+        "notes": "价格口径:2026 年深圳华强北小批行情区间中值(估算)"
+      },
+      {
+        "seq": 8,
+        "name": "微型摄像头模组",
+        "spec": "OV2640 12×12",
+        "supplier": "华强北现货商",
+        "price": 13.5,
+        "qty": 1,
+        "subtotal": 13.5,
+        "group": "电子件",
+        "notes": "价格口径:2026 年深圳华强北小批行情区间中值(估算)"
+      },
+      {
+        "seq": 9,
+        "name": "激光投射模组",
+        "spec": "MEMS 扫描 Φ5",
+        "supplier": "华强北模块商",
+        "price": 28.0,
+        "qty": 1,
+        "subtotal": 28.0,
+        "group": "电子件",
+        "notes": "价格口径:2026 年深圳华强北小批行情区间中值(估算)(量产难度高,溢价明显)"
+      },
+      {
+        "seq": 10,
+        "name": "PCBA 主板(Ai-M62 / 2×SPH0645 / BMS)",
+        "spec": "刚柔结合板 SMT",
+        "supplier": "PCBA 厂(深圳宝安)",
+        "price": 18.0,
+        "qty": 1,
+        "subtotal": 18.0,
+        "group": "电子件",
+        "notes": "含 SMT 加工费"
+      },
+      {
+        "seq": 11,
+        "name": "超薄聚合物锂电",
+        "spec": "523030 150mAh",
+        "supplier": "电池厂",
+        "price": 4.2,
+        "qty": 1,
+        "subtotal": 4.2,
+        "group": "电子件",
+        "notes": "价格口径:2026 年深圳华强北小批行情区间中值(估算)"
+      },
+      {
+        "seq": 12,
+        "name": "M1.6×4 沉头螺丝",
+        "spec": "SUS304",
+        "supplier": "紧固件供应商",
+        "price": 0.08,
+        "qty": 4,
+        "subtotal": 0.32,
+        "group": "辅料"
+      },
+      {
+        "seq": 13,
+        "name": "OCA 光学胶",
+        "spec": "三菱 0.125t",
+        "supplier": "辅料商",
+        "price": 0.55,
+        "qty": 1,
+        "subtotal": 0.55,
+        "group": "辅料"
+      },
+      {
+        "seq": 14,
+        "name": "针扣双面胶",
+        "spec": "3M 468",
+        "supplier": "辅料商",
+        "price": 0.08,
+        "qty": 1,
+        "subtotal": 0.08,
+        "group": "辅料"
+      },
+      {
+        "seq": 15,
+        "name": "屏蔽泡棉",
+        "spec": "0.3t 导电",
+        "supplier": "辅料商",
+        "price": 0.05,
+        "qty": 2,
+        "subtotal": 0.1,
+        "group": "辅料"
+      },
+      {
+        "seq": 16,
+        "name": "翻盖磁吸礼盒",
+        "spec": "350g 白卡",
+        "supplier": "包装厂",
+        "price": 3.2,
+        "qty": 1,
+        "subtotal": 3.2,
+        "group": "包材"
+      },
+      {
+        "seq": 17,
+        "name": "说明书",
+        "spec": "128g 铜版纸 8P",
+        "supplier": "印刷厂",
+        "price": 0.45,
+        "qty": 1,
+        "subtotal": 0.45,
+        "group": "包材"
+      },
+      {
+        "seq": 18,
+        "name": "磁吸充电线",
+        "spec": "POGO 4P 0.5m",
+        "supplier": "线材厂",
+        "price": 2.2,
+        "qty": 1,
+        "subtotal": 2.2,
+        "group": "包材"
+      },
+      {
+        "seq": 19,
+        "name": "磁吸充电座",
+        "spec": "ABS + 硅胶",
+        "supplier": "配件厂",
+        "price": 3.5,
+        "qty": 1,
+        "subtotal": 3.5,
+        "group": "包材"
+      }
+    ],
+    "bomTotal": 119.0,
+    "groupTotals": {
+      "结构件": 18.9,
+      "电子件": 89.7,
+      "辅料": 1.05,
+      "包材": 9.35
+    },
+    "notes": "供应商类型为行业类别;单价取 2026 年深圳宝安 CNC 与华强北渠道小批(3,000 台)行情中值,非正式报价。"
+  },
+  "processes": [
+    {
+      "id": "sandblast",
+      "name": "中框喷砂 + 钛灰阳极",
+      "mouldFee": 300,
+      "mouldLife": "不限",
+      "moq": 500,
+      "tiers": [
+        {
+          "qty": 500,
+          "price": 5.0
+        },
+        {
+          "qty": 3000,
+          "price": 4.0
+        },
+        {
+          "qty": 10000,
+          "price": 3.4
+        }
+      ],
+      "sampleDays": "4 天",
+      "bulkDays": "7 天",
+      "risk": "钛灰色差 ΔE>1",
+      "equipment": "喷砂机 + 阳极线",
+      "cycle": "上挂 20 件/挂,节拍 150s",
+      "yield": 0.96,
+      "price": 4.0,
+      "desc": "180 目玻璃砂喷砂,阳极 12µm 钛灰,封孔后烘干"
+    },
+    {
+      "id": "cnc",
+      "name": "铝中框 CNC 车削",
+      "mouldFee": 0,
+      "mouldLife": "刀具寿命(每把 1 万件)",
+      "moq": 500,
+      "tiers": [
+        {
+          "qty": 500,
+          "price": 8.5
+        },
+        {
+          "qty": 3000,
+          "price": 7.2
+        },
+        {
+          "qty": 10000,
+          "price": 6.2
+        }
+      ],
+      "sampleDays": "5~7 天",
+      "bulkDays": "12~15 天",
+      "risk": "1.6mm 薄壁变形;钛灰色差",
+      "equipment": "津上走心机 + 精雕机",
+      "cycle": "车削 3.5min/件 + 铣 2min/件",
+      "yield": 0.96,
+      "price": 7.2,
+      "desc": "Ø42 6061-T6 管料,外圆 1° 造型锥度,端面 C0.3;阳极 12µm 钛灰"
+    },
+    {
+      "id": "ceramic",
+      "name": "陶瓷底盖成型",
+      "mouldFee": 1800,
+      "mouldLife": "(干压模具 20 万件)",
+      "moq": 1000,
+      "tiers": [
+        {
+          "qty": 1000,
+          "price": 8.0
+        },
+        {
+          "qty": 3000,
+          "price": 6.4
+        },
+        {
+          "qty": 10000,
+          "price": 5.5
+        }
+      ],
+      "sampleDays": "10~12 天",
+      "bulkDays": "18 天",
+      "risk": "烧结收缩 18% 导致尺寸偏差;抛光划伤",
+      "equipment": "干压机 + 1450℃ 烧结炉 + 平面抛光机",
+      "cycle": "烧结 24h/炉批",
+      "yield": 0.92,
+      "price": 6.4,
+      "desc": "氧化锆粉干压,脱脂 1450℃ 烧结(收缩约 18%),平面度 ≤0.03,镜面抛光"
+    },
+    {
+      "id": "lam",
+      "name": "屏 OCA 贴合",
+      "mouldFee": 600,
+      "mouldLife": "(贴合治具)",
+      "moq": 500,
+      "tiers": [
+        {
+          "qty": 500,
+          "price": 3.2
+        },
+        {
+          "qty": 3000,
+          "price": 2.4
+        },
+        {
+          "qty": 10000,
+          "price": 2.0
+        }
+      ],
+      "sampleDays": "5 天",
+      "bulkDays": "8 天",
+      "risk": "圆形屏气泡、偏心",
+      "equipment": "真空贴合机",
+      "cycle": "45s/件",
+      "yield": 0.96,
+      "price": 2.4,
+      "desc": "2.5D 盖板与 LCD 贴合,偏心 ≤0.03mm"
+    },
+    {
+      "id": "smt",
+      "name": "刚柔板 SMT",
+      "mouldFee": 1200,
+      "mouldLife": "(SMT 钢网)",
+      "moq": 1000,
+      "tiers": [
+        {
+          "qty": 1000,
+          "price": 21.0
+        },
+        {
+          "qty": 3000,
+          "price": 18.0
+        },
+        {
+          "qty": 10000,
+          "price": 15.5
+        }
+      ],
+      "sampleDays": "10 天",
+      "bulkDays": "15 天",
+      "risk": "摄像头 FPC 折弯处断裂",
+      "equipment": "三星 SM482 + 回流焊 + FPC 冲型",
+      "cycle": "节拍 20s/块",
+      "yield": 0.97,
+      "price": 18.0,
+      "desc": "0.6mm 间距 BGA/QFN 贴片,FPC 段补强板,SMT 后 100% 烧录自检"
+    },
+    {
+      "id": "assemble",
+      "name": "整机组装",
+      "mouldFee": 0,
+      "mouldLife": "不限",
+      "moq": 500,
+      "tiers": [
+        {
+          "qty": 500,
+          "price": 7.0
+        },
+        {
+          "qty": 3000,
+          "price": 5.5
+        },
+        {
+          "qty": 10000,
+          "price": 4.6
+        }
+      ],
+      "sampleDays": "/",
+      "bulkDays": "/",
+      "risk": "针扣对位偏、陶瓷盖崩边",
+      "equipment": "防静电工位 2 人",
+      "cycle": "90s/台/人",
+      "yield": 0.97,
+      "price": 5.5,
+      "desc": "热熔铜螺母 → 装电池与主板 → 接柔板 → 贴屏 → 装陶瓷底盖 → 装针扣"
+    },
+    {
+      "id": "test",
+      "name": "功能检测 + 老化",
+      "mouldFee": 800,
+      "mouldLife": "(测试治具)",
+      "moq": 500,
+      "tiers": [
+        {
+          "qty": 500,
+          "price": 3.0
+        },
+        {
+          "qty": 3000,
+          "price": 2.3
+        },
+        {
+          "qty": 10000,
+          "price": 1.9
+        }
+      ],
+      "sampleDays": "/",
+      "bulkDays": "/",
+      "risk": "激光模组校准每家不一",
+      "equipment": "激光投射靶测试治具 + 24h 老化架",
+      "cycle": "70s/台",
+      "yield": 0.97,
+      "price": 2.3,
+      "desc": "投射对焦、摄像头成像、触摸与麦克风 100% 检;5% 抽样 24h 老化"
+    },
+    {
+      "id": "pack",
+      "name": "礼盒包装",
+      "mouldFee": 0,
+      "mouldLife": "不限",
+      "moq": 500,
+      "tiers": [
+        {
+          "qty": 500,
+          "price": 1.9
+        },
+        {
+          "qty": 3000,
+          "price": 1.5
+        },
+        {
+          "qty": 10000,
+          "price": 1.2
+        }
+      ],
+      "sampleDays": "3 天",
+      "bulkDays": "4 天",
+      "risk": "磁吸扣吸力不够",
+      "equipment": "手工装盒台",
+      "cycle": "40s/套",
+      "yield": 0.995,
+      "price": 1.5,
+      "desc": "装屏保护膜 → 配件 → 磁吸礼盒 → 封条 → 外箱 50 台/箱"
+    }
+  ],
+  "moq": {
+    "baseQty": 3000,
+    "currency": "CNY",
+    "tiers": [
+      {
+        "qty": 500,
+        "unitPrice": 419,
+        "mouldAmort": 8.8,
+        "bulkPrice": 410.2,
+        "total": 209500,
+        "notes": "模具/治具费 4,400 一次性支付或按 500 台摊 8.8 元/台"
+      },
+      {
+        "qty": 3000,
+        "unitPrice": 369,
+        "mouldAmort": 1.47,
+        "bulkPrice": 367.53,
+        "total": 1107000,
+        "notes": "基准档,单套综合成本约 136.67 元"
+      },
+      {
+        "qty": 10000,
+        "unitPrice": 329,
+        "mouldAmort": 0.44,
+        "bulkPrice": 328.56,
+        "total": 3290000,
+        "notes": "CNC、SMT 与激光模组批量价下降约 6%"
+      }
+    ],
+    "notes": "unitPrice 为含模具分摊建议零售阶梯;bulkPrice 为不含模具按台支付的货值单价(估算)。"
+  },
+  "processParams": {
+    "injection": {
+      "wall": 1.6,
+      "draft": 1.0,
+      "ribRatio": 0.5,
+      "depthRatio": 2.5,
+      "gate": "点浇口"
+    },
+    "silicone": {
+      "shoreA": 45,
+      "wall": 1.2,
+      "partingLine": "赤道线"
+    },
+    "cnc": {
+      "ballR": 1.0,
+      "topCrownR": 0.5,
+      "recessR": 0.3,
+      "chamferC": 0.3,
+      "thread": "—",
+      "tol": "±0.03"
+    },
+    "vacuum": {
+      "mouldLife": 30,
+      "minR": 0.5
+    }
+  },
+  "cost": {
+    "items": [
+      {
+        "name": "物料",
+        "amount": 119.0,
+        "basis": "BOM 合计"
+      },
+      {
+        "name": "加工",
+        "amount": 6.9,
+        "basis": "相机/激光模组焊接与标定 6.9(SMT 已整项计入 BOM)"
+      },
+      {
+        "name": "模具摊销",
+        "amount": 1.47,
+        "basis": "新增阳极夹具等一次性费用后合计 4,700 ÷ 3,000 台"
+      },
+      {
+        "name": "组装",
+        "amount": 5.5,
+        "basis": "整机组装"
+      },
+      {
+        "name": "测试",
+        "amount": 2.3,
+        "basis": "功能测试"
+      },
+      {
+        "name": "包材",
+        "amount": 1.5,
+        "basis": "礼盒包装"
+      },
+      {
+        "name": "损耗",
+        "amount": 0.0,
+        "basis": "自动计算 3%"
+      }
+    ],
+    "material": 119.0,
+    "mouldTotal": [
+      1800,
+      600,
+      1200,
+      800,
+      300
+    ],
+    "baseQty": 3000,
+    "mouldAmortization": 1.47,
+    "unitCost": 136.67,
+    "suggestedPrice": 369,
+    "grossMarginPct": 62.96,
+    "markup": 2.7,
+    "retailLow": 349,
+    "retailHigh": 399,
+    "tooling": 4700,
+    "packagingPerSet": 9.35,
+    "formula": "物料 + 加工 + 模具摊销(模具费总和/基准批量) + 组装 + 测试 + 包材 + 损耗 = 单台成本;毛利率 =(建议售价-单台成本)/建议售价"
+  },
+  "detail": {
+    "title": "别在胸口的第二块屏",
+    "subtitle": "40mm · 8mm 超薄 · 钛灰阳极",
+    "specs": [
+      {
+        "k": "直径",
+        "v": "Ø40.0 mm"
+      },
+      {
+        "k": "厚度",
+        "v": "8.0 mm"
+      },
+      {
+        "k": "重量",
+        "v": "约 19 g"
+      },
+      {
+        "k": "材质",
+        "v": "钛灰阳极铝 + 陶瓷底"
+      }
+    ],
+    "sections": [
+      {
+        "title": "设计",
+        "body": "8mm 是这块屏的物理极限:再薄就塞不下摄像头。圆形外轮廓与胸口衣料贴合,钛灰阳极中框在灯下呈冷灰,陶瓷底盖贴皮肤不冰凉也不发烫。"
+      },
+      {
+        "title": "结构",
+        "body": "中框 CNC 车削后再铣出摄像头与激光窗口的沉孔,陶瓷底盖用热熔铜螺母锁在前屏框上;背面 N52 磁环配防刺针扣,隔着两层布料也能一按到位。"
+      },
+      {
+        "title": "工艺",
+        "body": "中框走心机 3.5 分钟一件,1.6mm 壁厚容易变形,需夹具回火;陶瓷底盖干压后 1450℃ 烧结,收缩约 18%,抛光平面度 0.03mm。"
+      },
+      {
+        "title": "规格",
+        "body": "Ø40×8mm,整机约 19g;1.28 英寸 240×240 圆屏;500 万像素摄像头;双麦阵列 + MEMS 激光投射;150mAh 续航约 4 小时待机。"
+      },
+      {
+        "title": "价格档",
+        "body": "激光投射模组、圆形触摸屏和摄像头占去大半 BOM,单套综合成本约 137 元;3,000 台档建议零售 369 元,毛利率约 63%。"
+      }
+    ]
+  },
+  "dimensions": {
+    "length": 40.0,
+    "width": 40.0,
+    "height": 8.0
+  },
+  "weight": 19.0,
+  "priceBasis": "2026 年深圳宝安 CNC、潮州/东莞陶瓷厂与华强北渠道小批(3,000 台)行情中值,估算;非供应商正式报价"
+}

+ 1088 - 0
site/data/products/bone-headset.json

@@ -0,0 +1,1088 @@
+{
+  "id": "bone-headset",
+  "name": "颈挂骨传导耳机",
+  "latin": "Bone Conduction Neckband",
+  "tagline": "钛丝颈环,跑着也听得见环境",
+  "category": "可穿戴音频",
+  "craftTags": [
+    "钛记忆丝",
+    "液态硅胶",
+    "骨传导振子"
+  ],
+  "accent": "#0984E3",
+  "summary": "U 形颈环用 0.8mm 钛记忆丝做骨架,外面全包液态硅胶,出汗也不滑;两端向后上翘,贴合耳前的乳突骨,骨传导振子把声音直接经骨传到内耳,耳朵全程开放。跑步听歌的同时,还能听见身后车辆和同伴的喊声。",
+  "author": "FmodeCode",
+  "shape": {
+    "type": "ring",
+    "defaults": {
+      "dTop": 150.0,
+      "dBottom": 150.0,
+      "height": 18.0,
+      "wall": 1.2,
+      "domeR": 0.5,
+      "platform": 0.5,
+      "recessR": 0.5,
+      "recessDepth": 0.5,
+      "screenD": 12.0,
+      "chamferC": 0.5,
+      "draft": 1.0,
+      "split": 0.5,
+      "cornerR": 8.0,
+      "length": 120.0,
+      "screenH": 54.0,
+      "capR": 3.0,
+      "bandD": 17.8,
+      "ringD": 110.0,
+      "ringBandW": 12.0
+    }
+  },
+  "materials": [
+    "sil-silicone",
+    "ti",
+    "abs-matte"
+  ],
+  "parts": [
+    {
+      "id": "neckband",
+      "name": "U 形软胶颈环",
+      "role": "shell",
+      "material": "液态硅胶",
+      "craft": "包覆成型",
+      "color": "#1E2024",
+      "weight": 18.0,
+      "split": 0.5,
+      "tolerance": "±0.2",
+      "notes": "12mm 截面,硅胶包住钛丝与音频仓;模压包胶,分型线取内侧"
+    },
+    {
+      "id": "titanium-core",
+      "name": "钛记忆丝骨架",
+      "role": "clip",
+      "material": "TiNi 记忆合金",
+      "craft": "成型 + 包胶",
+      "color": "#8C8F94",
+      "weight": 5.0,
+      "split": 0,
+      "tolerance": "±0.3",
+      "notes": "0.8mm 钛镍丝,U 形热定型,可弯折 10 万次"
+    },
+    {
+      "id": "left-module",
+      "name": "左骨传导模块",
+      "role": "lid",
+      "material": "ABS + 硅胶",
+      "craft": "注塑 + 包胶",
+      "color": "#1E2024",
+      "weight": 9.0,
+      "split": 0.8,
+      "tolerance": "±0.1"
+    },
+    {
+      "id": "right-module",
+      "name": "右骨传导模块",
+      "role": "lid",
+      "material": "ABS + 硅胶",
+      "craft": "注塑 + 包胶",
+      "color": "#1E2024",
+      "weight": 9.0,
+      "split": 0.8,
+      "tolerance": "±0.1"
+    },
+    {
+      "id": "vibrator-l",
+      "name": "左振子贴合面",
+      "role": "screen",
+      "material": "硅胶 20A",
+      "craft": "模压",
+      "color": "#2D3436",
+      "weight": 1.5,
+      "split": 1,
+      "tolerance": "±0.1"
+    },
+    {
+      "id": "vibrator-r",
+      "name": "右振子贴合面",
+      "role": "screen",
+      "material": "硅胶 20A",
+      "craft": "模压",
+      "color": "#2D3436",
+      "weight": 1.5,
+      "split": 1,
+      "tolerance": "±0.1"
+    },
+    {
+      "id": "module-cover-l",
+      "name": "左模块背壳",
+      "role": "back",
+      "material": "ABS",
+      "craft": "注塑 + 喷油",
+      "color": "#1E2024",
+      "weight": 2.2,
+      "split": 0,
+      "tolerance": "±0.1"
+    },
+    {
+      "id": "module-cover-r",
+      "name": "右模块背壳",
+      "role": "back",
+      "material": "ABS",
+      "craft": "注塑 + 喷油",
+      "color": "#1E2024",
+      "weight": 2.2,
+      "split": 0,
+      "tolerance": "±0.1"
+    },
+    {
+      "id": "btn-multifn",
+      "name": "多功能键",
+      "role": "button",
+      "material": "TPU",
+      "craft": "包胶",
+      "color": "#0984E3",
+      "weight": 0.3,
+      "split": 0.5,
+      "tolerance": "±0.1"
+    },
+    {
+      "id": "btn-vol",
+      "name": "音量键",
+      "role": "button",
+      "material": "TPU",
+      "craft": "包胶",
+      "color": "#1E2024",
+      "weight": 0.3,
+      "split": 0.5,
+      "tolerance": "±0.1"
+    },
+    {
+      "id": "usb-cover",
+      "name": "充电口防水盖",
+      "role": "button",
+      "material": "TPE",
+      "craft": "注塑",
+      "color": "#1E2024",
+      "weight": 0.5,
+      "split": 0,
+      "tolerance": "±0.1"
+    },
+    {
+      "id": "main-pcb",
+      "name": "柔性主板",
+      "role": "pcb",
+      "material": "FR-4 + FPC",
+      "craft": "SMT",
+      "color": "#1B6B3A",
+      "weight": 2.0,
+      "split": 1,
+      "tolerance": "±0.1"
+    },
+    {
+      "id": "cell-l",
+      "name": "左电池组",
+      "role": "battery",
+      "material": "铝塑膜电芯",
+      "craft": "叠片封装",
+      "color": "#B3B8BF",
+      "weight": 2.5,
+      "split": 0,
+      "tolerance": "±0.3"
+    },
+    {
+      "id": "cell-r",
+      "name": "右电池组",
+      "role": "battery",
+      "material": "铝塑膜电芯",
+      "craft": "叠片封装",
+      "color": "#B3B8BF",
+      "weight": 2.5,
+      "split": 0,
+      "tolerance": "±0.3"
+    },
+    {
+      "id": "ring-logo",
+      "name": "装饰金属环",
+      "role": "ring",
+      "material": "SUS 拉丝",
+      "craft": "冲压",
+      "color": "#C9CBD0",
+      "weight": 0.5,
+      "split": 0.5,
+      "tolerance": "±0.1"
+    },
+    {
+      "id": "module-screw",
+      "name": "模块锁付螺丝",
+      "role": "brass",
+      "material": "碳钢镀镍",
+      "craft": "冷镦",
+      "color": "#C9CBD0",
+      "weight": 0.05,
+      "split": 0,
+      "tolerance": "±0.05"
+    },
+    {
+      "id": "silicone-plug",
+      "name": "钛丝端头封胶",
+      "role": "clip",
+      "material": "硅胶",
+      "craft": "注塑",
+      "color": "#1E2024",
+      "weight": 0.3,
+      "split": 0,
+      "tolerance": "±0.1"
+    }
+  ],
+  "features": [
+    {
+      "id": "pillar-l",
+      "type": "screw-pillar",
+      "params": {
+        "thread": "M1.6",
+        "od": 3.2,
+        "holeD": 1.3
+      },
+      "at": {
+        "x": -80,
+        "y": 0
+      },
+      "anchor": "bottom"
+    },
+    {
+      "id": "pillar-r",
+      "type": "screw-pillar",
+      "params": {
+        "thread": "M1.6",
+        "od": 3.2,
+        "holeD": 1.3
+      },
+      "at": {
+        "x": 80,
+        "y": 0
+      },
+      "anchor": "bottom"
+    },
+    {
+      "id": "rib-band",
+      "type": "rib",
+      "params": {
+        "thickness": 1.0,
+        "height": 6.0,
+        "count": 1
+      },
+      "at": {
+        "x": 0,
+        "y": -90
+      },
+      "anchor": "bottom"
+    },
+    {
+      "id": "snap-mode",
+      "type": "snap",
+      "params": {
+        "width": 3.0,
+        "depth": 0.6
+      },
+      "at": {
+        "x": 0,
+        "y": -30
+      },
+      "anchor": "bottom"
+    },
+    {
+      "id": "boss-bat",
+      "type": "boss",
+      "params": {
+        "od": 5.0,
+        "holeD": 0,
+        "height": 1.5
+      },
+      "at": {
+        "x": 0,
+        "y": -70
+      },
+      "anchor": "bottom"
+    },
+    {
+      "id": "pocket-module",
+      "type": "pocket",
+      "params": {
+        "l": 24.0,
+        "w": 12.0,
+        "depth": 5.0
+      },
+      "at": {
+        "x": 80,
+        "y": 0
+      },
+      "anchor": "bottom"
+    },
+    {
+      "id": "standoff",
+      "type": "standoff",
+      "params": {
+        "od": 2.6,
+        "height": 1.0,
+        "holeD": 1.3
+      },
+      "at": {
+        "x": -80,
+        "y": 0
+      },
+      "anchor": "bottom"
+    }
+  ],
+  "electronics": [
+    {
+      "id": "soc",
+      "name": "蓝牙音频 SoC + 振子",
+      "model": "BES2300Y + 骨传导振子 TDK,双模块",
+      "size": {
+        "l": 16.0,
+        "w": 10.0,
+        "t": 2.0
+      },
+      "iface": "I2S",
+      "power": "3.3V",
+      "price": 32.0,
+      "qty": 1,
+      "assembly": "焊接",
+      "mount": {
+        "z": 0.8,
+        "x": 80,
+        "y": 0
+      },
+      "top": 2.8,
+      "notes": "价格口径:2026 年深圳华强北小批行情区间中值(估算);振子为成对定价"
+    },
+    {
+      "id": "soc-r",
+      "name": "右模块(仅 PCB 局部,共享 SoC)",
+      "model": "—",
+      "size": {
+        "l": 10.0,
+        "w": 8.0,
+        "t": 1.2
+      },
+      "iface": "FPC",
+      "power": "—",
+      "price": 0,
+      "qty": 1,
+      "assembly": "焊接",
+      "mount": {
+        "z": 0.8,
+        "x": -80,
+        "y": 0
+      },
+      "top": 2.0,
+      "notes": "仅结构参考"
+    },
+    {
+      "id": "battery-mod",
+      "name": "锂电(左/右各一颗)",
+      "model": "3.7V 90mAh 301020",
+      "size": {
+        "l": 20.0,
+        "w": 10.0,
+        "t": 3.0
+      },
+      "iface": "BMS",
+      "power": "3.7V",
+      "price": 4.0,
+      "qty": 2,
+      "assembly": "焊接",
+      "mount": {
+        "z": 0.8,
+        "x": 0,
+        "y": -70
+      },
+      "top": 3.8,
+      "notes": "价格口径:2026 年深圳华强北小批行情区间中值(估算)"
+    },
+    {
+      "id": "mic",
+      "name": "通话麦克风",
+      "model": "MEMS SPH1642HT5H",
+      "size": {
+        "l": 3.5,
+        "w": 2.65,
+        "t": 0.9
+      },
+      "iface": "PDM",
+      "power": "1.8V",
+      "price": 2.0,
+      "qty": 1,
+      "assembly": "焊接",
+      "mount": {
+        "z": 0.8,
+        "x": 76,
+        "y": 6
+      },
+      "top": 1.7,
+      "notes": "价格口径:2026 年深圳华强北小批行情区间中值(估算)"
+    },
+    {
+      "id": "magnet",
+      "name": "霍尔开关磁铁",
+      "model": "N35 φ3×1",
+      "size": {
+        "l": 3.0,
+        "w": 3.0,
+        "t": 1.0
+      },
+      "iface": "霍尔感应",
+      "power": "—",
+      "price": 0.05,
+      "qty": 2,
+      "assembly": "磁吸",
+      "mount": {
+        "z": 0.5,
+        "x": 0,
+        "y": -94
+      },
+      "top": 1.5,
+      "notes": "价格口径:2026 年深圳华强北小批行情区间中值(估算)"
+    }
+  ],
+  "consumables": [
+    {
+      "id": "screw",
+      "name": "M1.6×3 自攻螺丝",
+      "spec": "SUS304",
+      "qty": 4,
+      "unit": "颗",
+      "price": 0.04,
+      "notes": ""
+    },
+    {
+      "id": "tape",
+      "name": "双面胶 + 缓冲泡棉",
+      "spec": "3M 468 0.13t 两片 + 1t EVA 泡棉",
+      "qty": 1,
+      "unit": "套",
+      "price": 0.12,
+      "notes": ""
+    },
+    {
+      "id": "glue",
+      "name": "硅胶粘接剂",
+      "spec": "道康宁 737",
+      "qty": 0.5,
+      "unit": "g",
+      "price": 0.5,
+      "notes": "模组与颈环粘接"
+    },
+    {
+      "id": "foam",
+      "name": "防水透气膜",
+      "spec": "GORE 声学膜 Ø8",
+      "qty": 2,
+      "unit": "片",
+      "price": 0.18,
+      "notes": ""
+    },
+    {
+      "id": "label",
+      "name": "序列号标签",
+      "spec": "PET 黑色 20×8",
+      "qty": 1,
+      "unit": "张",
+      "price": 0.03,
+      "notes": ""
+    },
+    {
+      "id": "box",
+      "name": "彩盒",
+      "spec": "350g 白卡 + 吸塑内托 180×160×50",
+      "qty": 1,
+      "unit": "套",
+      "price": 2.8,
+      "notes": ""
+    },
+    {
+      "id": "manual",
+      "name": "说明书",
+      "spec": "105g 铜版纸 8P",
+      "qty": 1,
+      "unit": "份",
+      "price": 0.4,
+      "notes": ""
+    },
+    {
+      "id": "cable",
+      "name": "磁吸充电线",
+      "spec": "POGO 2P 0.3m",
+      "qty": 1,
+      "unit": "条",
+      "price": 1.5,
+      "notes": ""
+    },
+    {
+      "id": "pouch",
+      "name": "收纳袋",
+      "spec": "600D 涤纶抽绳袋",
+      "qty": 1,
+      "unit": "个",
+      "price": 0.6,
+      "notes": ""
+    }
+  ],
+  "bom": {
+    "currency": "CNY",
+    "bomCurrency": "CNY",
+    "rows": [
+      {
+        "seq": 1,
+        "name": "U 形软胶颈环",
+        "spec": "液态硅胶包覆钛丝",
+        "supplier": "硅胶厂(东莞黄江)",
+        "price": 5.8,
+        "qty": 1,
+        "subtotal": 5.8,
+        "group": "结构件"
+      },
+      {
+        "seq": 2,
+        "name": "钛记忆丝骨架",
+        "spec": "TiNi 0.8mm U 形",
+        "supplier": "金属材料厂(西安/宝鸡)",
+        "price": 2.6,
+        "qty": 1,
+        "subtotal": 2.6,
+        "group": "结构件"
+      },
+      {
+        "seq": 3,
+        "name": "左右骨传导模块壳",
+        "spec": "ABS + 硅胶包胶",
+        "supplier": "注塑厂 + 硅胶厂",
+        "price": 2.2,
+        "qty": 2,
+        "subtotal": 4.4,
+        "group": "结构件"
+      },
+      {
+        "seq": 4,
+        "name": "振子贴合软垫",
+        "spec": "硅胶 20A 模压",
+        "supplier": "硅胶厂",
+        "price": 0.25,
+        "qty": 2,
+        "subtotal": 0.5,
+        "group": "结构件"
+      },
+      {
+        "seq": 5,
+        "name": "多功能/音量键",
+        "spec": "TPU 包胶",
+        "supplier": "硅胶厂",
+        "price": 0.12,
+        "qty": 2,
+        "subtotal": 0.24,
+        "group": "结构件"
+      },
+      {
+        "seq": 6,
+        "name": "充电口防水盖",
+        "spec": "TPE 注塑",
+        "supplier": "注塑厂",
+        "price": 0.08,
+        "qty": 1,
+        "subtotal": 0.08,
+        "group": "结构件"
+      },
+      {
+        "seq": 7,
+        "name": "装饰金属环",
+        "spec": "SUS 拉丝冲压",
+        "supplier": "五金厂",
+        "price": 0.25,
+        "qty": 2,
+        "subtotal": 0.5,
+        "group": "结构件"
+      },
+      {
+        "seq": 8,
+        "name": "PCBA(BES2300Y + 骨传导振子 + 通话麦克风)",
+        "spec": "FR-4 + FPC + SMT",
+        "supplier": "PCBA 厂(深圳宝安)",
+        "price": 32.0,
+        "qty": 1,
+        "subtotal": 32.0,
+        "group": "电子件",
+        "notes": "价格口径:2026 年深圳华强北小批行情区间中值(估算);BES2300Y 约 8,振子一对约 16,PCBA 与 SMT 约 4,价格口径:2026 年深圳华强北小批行情区间中值(估算)"
+      },
+      {
+        "seq": 9,
+        "name": "锂电 90mAh",
+        "spec": "301020 ×2",
+        "supplier": "电池厂",
+        "price": 4.0,
+        "qty": 2,
+        "subtotal": 8.0,
+        "group": "电子件",
+        "notes": "价格口径:2026 年深圳华强北小批行情区间中值(估算)"
+      },
+      {
+        "seq": 10,
+        "name": "M1.6×3 自攻螺丝",
+        "spec": "SUS304",
+        "supplier": "紧固件供应商",
+        "price": 0.04,
+        "qty": 4,
+        "subtotal": 0.16,
+        "group": "辅料"
+      },
+      {
+        "seq": 11,
+        "name": "硅胶粘接剂",
+        "spec": "道康宁 737",
+        "supplier": "辅料商",
+        "price": 0.5,
+        "qty": 0.5,
+        "subtotal": 0.25,
+        "group": "辅料"
+      },
+      {
+        "seq": 12,
+        "name": "防水透气膜",
+        "spec": "GORE 声学膜",
+        "supplier": "辅料商",
+        "price": 0.18,
+        "qty": 2,
+        "subtotal": 0.36,
+        "group": "辅料"
+      },
+      {
+        "seq": 13,
+        "name": "序列号标签",
+        "spec": "PET 黑色",
+        "supplier": "印刷厂",
+        "price": 0.03,
+        "qty": 1,
+        "subtotal": 0.03,
+        "group": "辅料"
+      },
+      {
+        "seq": 14,
+        "name": "彩盒 + 吸塑内托",
+        "spec": "350g 白卡",
+        "supplier": "包装厂",
+        "price": 2.8,
+        "qty": 1,
+        "subtotal": 2.8,
+        "group": "包材"
+      },
+      {
+        "seq": 15,
+        "name": "说明书",
+        "spec": "105g 铜版纸 8P",
+        "supplier": "印刷厂",
+        "price": 0.4,
+        "qty": 1,
+        "subtotal": 0.4,
+        "group": "包材"
+      },
+      {
+        "seq": 16,
+        "name": "磁吸充电线",
+        "spec": "POGO 2P 0.3m",
+        "supplier": "线材厂",
+        "price": 1.5,
+        "qty": 1,
+        "subtotal": 1.5,
+        "group": "包材"
+      },
+      {
+        "seq": 17,
+        "name": "收纳袋",
+        "spec": "600D 涤纶抽绳",
+        "supplier": "辅料商",
+        "price": 0.6,
+        "qty": 1,
+        "subtotal": 0.6,
+        "group": "包材"
+      }
+    ],
+    "bomTotal": 60.22,
+    "groupTotals": {
+      "结构件": 14.12,
+      "电子件": 40.0,
+      "辅料": 0.8,
+      "包材": 5.3
+    },
+    "notes": "供应商类型为行业类别;单价取 2026 年东莞硅胶、宝鸡钛材与华强北音频方案小批(3,000 条)行情中值,非正式报价。"
+  },
+  "processes": [
+    {
+      "id": "tsform",
+      "name": "钛丝 U 形热成型",
+      "mouldFee": 1500,
+      "mouldLife": "(折弯夹具)",
+      "moq": 1000,
+      "tiers": [
+        {
+          "qty": 1000,
+          "price": 1.6
+        },
+        {
+          "qty": 3000,
+          "price": 1.2
+        },
+        {
+          "qty": 10000,
+          "price": 1.0
+        }
+      ],
+      "sampleDays": "7 天",
+      "bulkDays": "10 天",
+      "risk": "钛丝回弹不一致;表面划伤",
+      "equipment": "CNC 绕线机 + 300℃ 定型炉",
+      "cycle": "40s/件",
+      "yield": 0.97,
+      "price": 1.2,
+      "desc": "TiNi 丝 300℃ 定型 20min,U 形开口 110mm,对称度 ≤1mm"
+    },
+    {
+      "id": "overmold",
+      "name": "硅胶包覆成型",
+      "mouldFee": 3200,
+      "mouldLife": "25 万模次",
+      "moq": 1000,
+      "tiers": [
+        {
+          "qty": 1000,
+          "price": 7.2
+        },
+        {
+          "qty": 3000,
+          "price": 5.8
+        },
+        {
+          "qty": 10000,
+          "price": 5.0
+        }
+      ],
+      "sampleDays": "10~12 天",
+      "bulkDays": "15 天",
+      "risk": "包胶气泡;硅胶与钛丝脱粘",
+      "equipment": "真空硫化机 + 1 模 1 腔钢模",
+      "cycle": "240s/模",
+      "yield": 0.93,
+      "price": 5.8,
+      "desc": "液态硅胶 50A 注射包胶 170℃×240s,抽真空 3 次;分型线走内侧,钛丝两端留 5mm 嵌入音频仓"
+    },
+    {
+      "id": "surf",
+      "name": "硅胶表面手感处理",
+      "mouldFee": 200,
+      "mouldLife": "不限",
+      "moq": 1000,
+      "tiers": [
+        {
+          "qty": 1000,
+          "price": 0.8
+        },
+        {
+          "qty": 3000,
+          "price": 0.6
+        },
+        {
+          "qty": 10000,
+          "price": 0.45
+        }
+      ],
+      "sampleDays": "3 天",
+      "bulkDays": "5 天",
+      "risk": "手感油污染振子面",
+      "equipment": "等离子处理 + 喷雾",
+      "cycle": "30s/条",
+      "yield": 0.98,
+      "price": 0.6,
+      "desc": "等离子活化后喷 2µm 爽滑层,汗渍不易残留"
+    },
+    {
+      "id": "smt",
+      "name": "PCBA SMT",
+      "mouldFee": 800,
+      "mouldLife": "(SMT 钢网)",
+      "moq": 1000,
+      "tiers": [
+        {
+          "qty": 1000,
+          "price": 34.0
+        },
+        {
+          "qty": 3000,
+          "price": 32.0
+        },
+        {
+          "qty": 10000,
+          "price": 30.0
+        }
+      ],
+      "sampleDays": "10 天",
+      "bulkDays": "12 天",
+      "risk": "骨传导振子装配后频响漂移",
+      "equipment": "SMT 线 + 振子贴合治具 + 声压计",
+      "cycle": "节拍 30s/条",
+      "yield": 0.97,
+      "price": 32.0,
+      "desc": "SMT 后振子点 UV 胶固定,100% 测 1kHz 振动力(≥0.4N)"
+    },
+    {
+      "id": "assemble",
+      "name": "整机装配",
+      "mouldFee": 0,
+      "mouldLife": "不限",
+      "moq": 1000,
+      "tiers": [
+        {
+          "qty": 1000,
+          "price": 4.0
+        },
+        {
+          "qty": 3000,
+          "price": 3.0
+        },
+        {
+          "qty": 10000,
+          "price": 2.5
+        }
+      ],
+      "sampleDays": "/",
+      "bulkDays": "/",
+      "risk": "左右模块粘接错位",
+      "equipment": "流水线 2 工位 + 粘接治具",
+      "cycle": "80s/条",
+      "yield": 0.97,
+      "price": 3.0,
+      "desc": "模块锁付 → 硅胶 737 粘接颈环两端 → 装按键 → 贴防水膜"
+    },
+    {
+      "id": "test",
+      "name": "声学与连接检测",
+      "mouldFee": 600,
+      "mouldLife": "(测试治具)",
+      "moq": 1000,
+      "tiers": [
+        {
+          "qty": 1000,
+          "price": 2.2
+        },
+        {
+          "qty": 3000,
+          "price": 1.6
+        },
+        {
+          "qty": 10000,
+          "price": 1.3
+        }
+      ],
+      "sampleDays": "/",
+      "bulkDays": "/",
+      "risk": "骨传导左右响度差",
+      "equipment": "人工耳/加速度计治具 + 蓝牙综合测试仪",
+      "cycle": "45s/条",
+      "yield": 0.98,
+      "price": 1.6,
+      "desc": "100% 蓝牙配对、振子灵敏度、麦克风通话测试,左右差 ≤2dB"
+    },
+    {
+      "id": "pack",
+      "name": "彩盒包装",
+      "mouldFee": 0,
+      "mouldLife": "不限",
+      "moq": 1000,
+      "tiers": [
+        {
+          "qty": 1000,
+          "price": 1.8
+        },
+        {
+          "qty": 3000,
+          "price": 1.4
+        },
+        {
+          "qty": 10000,
+          "price": 1.2
+        }
+      ],
+      "sampleDays": "3 天",
+      "bulkDays": "4 天",
+      "risk": "吸塑压痕",
+      "equipment": "装盒台 + 封口机",
+      "cycle": "30s/条",
+      "yield": 0.995,
+      "price": 1.4,
+      "desc": "耳机入吸塑 → 收纳袋与线 → 彩盒 → 外箱 40 条/箱"
+    }
+  ],
+  "moq": {
+    "baseQty": 3000,
+    "currency": "CNY",
+    "tiers": [
+      {
+        "qty": 1000,
+        "unitPrice": 239,
+        "mouldAmort": 6.3,
+        "bulkPrice": 232.7,
+        "total": 239000,
+        "notes": "模具/夹具费 6,300 一次性支付或按 1,000 条摊 6.3 元/条;硅胶包胶有 1,000 起做下限"
+      },
+      {
+        "qty": 3000,
+        "unitPrice": 199,
+        "mouldAmort": 2.1,
+        "bulkPrice": 196.9,
+        "total": 597000,
+        "notes": "基准档,单套综合成本约 76.42 元"
+      },
+      {
+        "qty": 10000,
+        "unitPrice": 179,
+        "mouldAmort": 0.63,
+        "bulkPrice": 178.37,
+        "total": 1790000,
+        "notes": "包胶与 SMT 单价降至下限"
+      }
+    ],
+    "notes": "unitPrice 为含模具分摊建议零售阶梯;bulkPrice 为不含模具按条支付的货值单价(估算)。"
+  },
+  "processParams": {
+    "injection": {
+      "wall": 1.2,
+      "draft": 1.0,
+      "ribRatio": 0.5,
+      "depthRatio": 2.5,
+      "gate": "侧浇口"
+    },
+    "silicone": {
+      "shoreA": 50,
+      "wall": 3.0,
+      "partingLine": "内侧线"
+    },
+    "cnc": {
+      "ballR": 2.0,
+      "topCrownR": 2.0,
+      "recessR": 1.0,
+      "chamferC": 0.5,
+      "thread": "—",
+      "tol": "±0.2"
+    },
+    "vacuum": {
+      "mouldLife": 30,
+      "minR": 1.5
+    }
+  },
+  "cost": {
+    "items": [
+      {
+        "name": "物料",
+        "amount": 60.22,
+        "basis": "BOM 合计"
+      },
+      {
+        "name": "加工",
+        "amount": 8.1,
+        "basis": "热成型 1.2 + 包胶 5.8 + 表面手感 0.6 + 钛丝折弯修正 0.5(SMT 32 已整项计入 BOM,不重复计)"
+      },
+      {
+        "name": "模具摊销",
+        "amount": 2.1,
+        "basis": "模具/治具费合计 6,300 ÷ 3,000 条"
+      },
+      {
+        "name": "组装",
+        "amount": 3.0,
+        "basis": "整机装配"
+      },
+      {
+        "name": "测试",
+        "amount": 1.6,
+        "basis": "声学测试"
+      },
+      {
+        "name": "包材",
+        "amount": 1.4,
+        "basis": "彩盒包装"
+      },
+      {
+        "name": "损耗",
+        "amount": 0.0,
+        "basis": "自动计算 3%"
+      }
+    ],
+    "material": 60.22,
+    "mouldTotal": [
+      1500,
+      3200,
+      200,
+      800,
+      0,
+      600,
+      0
+    ],
+    "baseQty": 3000,
+    "mouldAmortization": 2.1,
+    "unitCost": 76.42,
+    "suggestedPrice": 199,
+    "grossMarginPct": 61.6,
+    "markup": 2.6,
+    "retailLow": 179,
+    "retailHigh": 219,
+    "tooling": 6300,
+    "packagingPerSet": 5.3,
+    "formula": "物料 + 加工 + 模具摊销(模具费总和/基准批量) + 组装 + 测试 + 包材 + 损耗 = 单台成本;毛利率 =(建议售价-单台成本)/建议售价"
+  },
+  "detail": {
+    "title": "耳朵是开着的",
+    "subtitle": "钛丝颈环 · 液态硅胶包覆 · 骨传导",
+    "specs": [
+      {
+        "k": "颈环宽",
+        "v": "150 mm"
+      },
+      {
+        "k": "截面",
+        "v": "12 mm"
+      },
+      {
+        "k": "重量",
+        "v": "约 57 g"
+      },
+      {
+        "k": "材质",
+        "v": "钛记忆丝 + 液态硅胶"
+      }
+    ],
+    "sections": [
+      {
+        "title": "设计",
+        "body": "U 形颈环贴着后颈走,两端向前上翘 15°,振子正好压在耳前乳突骨上。截面做成 12mm 扁圆,出汗时与皮肤的接触面变小,不闷、不滑。"
+      },
+      {
+        "title": "结构",
+        "body": "0.8mm TiNi 记忆丝是骨架,硅胶全包到音频仓才断开;左右模块各有 90mAh 电池与 PCB,中间靠 FPC 过线,可弯折 10 万次不断。"
+      },
+      {
+        "title": "工艺",
+        "body": "钛丝 300℃ 热定型后放入 1 模 1 腔钢模,液态硅胶 170℃×240 秒注射包胶并抽真空三次;振子 SMT 后点 UV 胶,逐条测振动力。"
+      },
+      {
+        "title": "规格",
+        "body": "颈环宽 150mm,整机约 57g;骨传导开放耳道;IP55 防汗;双 90mAh 电池约 8 小时播放;磁吸 POGO 充电。"
+      },
+      {
+        "title": "价格档",
+        "body": "骨传导振子与蓝牙方案是主要成本,单套综合成本约 76 元;3,000 条档建议零售 199 元,毛利率约 62%。"
+      }
+    ]
+  },
+  "dimensions": {
+    "length": 150.0,
+    "width": 120.0,
+    "height": 18.0
+  },
+  "weight": 57.0,
+  "priceBasis": "2026 年东莞硅胶、宝鸡钛材与华强北音频方案小批(3,000 条)行情中值,估算;非供应商正式报价"
+}

+ 1152 - 0
site/data/products/eink-tag.json

@@ -0,0 +1,1152 @@
+{
+  "id": "eink-tag",
+  "name": "电子墨水桌面副屏",
+  "latin": "E-Ink Desk Tag",
+  "tagline": "145mm 墨水屏,抬头一眼待办",
+  "category": "桌面配件",
+  "craftTags": [
+    "ABS 注塑",
+    "墨水平板",
+    "隐藏支架"
+  ],
+  "accent": "#2D3436",
+  "summary": "145×90mm 的白色墨水屏副屏,放在显示器下方或贴在冰箱上。3.7 英寸墨水屏常显待办、天气、股价与日程,内容通过蓝牙从手机或电脑同步;背面隐藏式支架可立可挂,充一次电用两周以上。",
+  "author": "FmodeCode",
+  "shape": {
+    "type": "rect",
+    "defaults": {
+      "dTop": 90.0,
+      "dBottom": 90.0,
+      "height": 9.5,
+      "wall": 1.8,
+      "domeR": 2.0,
+      "platform": 1.0,
+      "recessR": 1.0,
+      "recessDepth": 0.8,
+      "screenD": 47.0,
+      "chamferC": 0.6,
+      "draft": 0.5,
+      "split": 0.8,
+      "cornerR": 8.0,
+      "length": 145.0,
+      "screenH": 83.0,
+      "capR": 4.0,
+      "bandD": 17.8,
+      "ringD": 19.2,
+      "ringBandW": 6.5
+    }
+  },
+  "materials": [
+    "abs-matte",
+    "pc-gloss",
+    "sil-silicone"
+  ],
+  "parts": [
+    {
+      "id": "front-shell",
+      "name": "前壳",
+      "role": "shell",
+      "material": "ABS",
+      "craft": "钢模注塑 1×1 + 喷涂",
+      "color": "#F2F1EC",
+      "weight": 22.0,
+      "split": 1,
+      "tolerance": "±0.1",
+      "notes": "1 腔大模(模腔 160×105),三点进胶;缩水率 0.5%,侧壁 0.5° 拔模;白色喷涂覆盖水纹"
+    },
+    {
+      "id": "front-frame",
+      "name": "屏框",
+      "role": "lid",
+      "material": "ABS",
+      "craft": "注塑 + 哑光喷油",
+      "color": "#26282C",
+      "weight": 4.0,
+      "split": 0.92,
+      "tolerance": "±0.1"
+    },
+    {
+      "id": "back-cover",
+      "name": "后盖",
+      "role": "back",
+      "material": "ABS",
+      "craft": "钢模注塑 + 晒纹",
+      "color": "#F2F1EC",
+      "weight": 18.0,
+      "split": 0,
+      "tolerance": "±0.1",
+      "notes": "细皮纹 VDI 3400 MT11010"
+    },
+    {
+      "id": "kick-stand",
+      "name": "隐藏支架",
+      "role": "clip",
+      "material": "ABS",
+      "craft": "注塑 + 转轴",
+      "color": "#F2F1EC",
+      "weight": 3.5,
+      "split": 0,
+      "tolerance": "±0.15"
+    },
+    {
+      "id": "btn-refresh",
+      "name": "刷新键",
+      "role": "button",
+      "material": "ABS",
+      "craft": "注塑",
+      "color": "#26282C",
+      "weight": 0.3,
+      "split": 0.6,
+      "tolerance": "±0.1"
+    },
+    {
+      "id": "btn-power",
+      "name": "电源键",
+      "role": "button",
+      "material": "ABS",
+      "craft": "注塑",
+      "color": "#26282C",
+      "weight": 0.3,
+      "split": 0.6,
+      "tolerance": "±0.1"
+    },
+    {
+      "id": "speaker",
+      "name": "扬声器网罩",
+      "role": "screen",
+      "material": "SUS 冲孔",
+      "craft": "冲压",
+      "color": "#8C8F94",
+      "weight": 0.4,
+      "split": 0.9,
+      "transparent": 0.8,
+      "tolerance": "±0.1"
+    },
+    {
+      "id": "battery-bracket",
+      "name": "电池压片",
+      "role": "pcb",
+      "material": "SUS301",
+      "craft": "冲压",
+      "color": "#C9CBD0",
+      "weight": 0.8,
+      "split": 0,
+      "tolerance": "±0.1"
+    },
+    {
+      "id": "back-label",
+      "name": "背板铭牌",
+      "role": "back",
+      "material": "PET 哑银",
+      "craft": "丝印",
+      "color": "#8C8F94",
+      "weight": 0.1,
+      "split": 0,
+      "tolerance": "±0.1"
+    },
+    {
+      "id": "hang-ring",
+      "name": "壁挂挂孔件",
+      "role": "ring",
+      "material": "SUS304",
+      "craft": "冲压",
+      "color": "#8C8F94",
+      "weight": 1.2,
+      "split": 0,
+      "tolerance": "±0.2"
+    },
+    {
+      "id": "screen",
+      "name": "电子墨水屏",
+      "role": "screen",
+      "material": "E-Ink 屏 + 亚克力盖板",
+      "craft": "全贴合",
+      "color": "#D9D7CE",
+      "weight": 12.0,
+      "split": 1,
+      "transparent": 0.85,
+      "tolerance": "±0.1"
+    },
+    {
+      "id": "battery",
+      "name": "聚合物锂电",
+      "role": "battery",
+      "material": "铝塑膜电芯",
+      "craft": "叠片封装",
+      "color": "#B3B8BF",
+      "weight": 6.0,
+      "split": 0,
+      "tolerance": "±0.2"
+    },
+    {
+      "id": "pcb",
+      "name": "主板",
+      "role": "pcb",
+      "material": "FR-4 四层",
+      "craft": "SMT",
+      "color": "#1B6B3A",
+      "weight": 8.0,
+      "split": 1,
+      "tolerance": "±0.1"
+    },
+    {
+      "id": "rubber-feet",
+      "name": "硅胶垫脚",
+      "role": "ring",
+      "material": "硅胶",
+      "craft": "模压",
+      "color": "#26282C",
+      "weight": 0.4,
+      "split": 0,
+      "tolerance": "±0.1"
+    },
+    {
+      "id": "brass",
+      "name": "热熔铜螺母",
+      "role": "brass",
+      "material": "黄铜",
+      "craft": "热熔",
+      "color": "#C9A86A",
+      "weight": 0.6,
+      "split": 0,
+      "tolerance": "±0.05"
+    }
+  ],
+  "features": [
+    {
+      "id": "pillar-1",
+      "type": "screw-pillar",
+      "params": {
+        "thread": "M2.5",
+        "od": 4.6,
+        "holeD": 1.9
+      },
+      "at": {
+        "x": -58,
+        "y": -34
+      },
+      "anchor": "bottom"
+    },
+    {
+      "id": "pillar-2",
+      "type": "screw-pillar",
+      "params": {
+        "thread": "M2.5",
+        "od": 4.6,
+        "holeD": 1.9
+      },
+      "at": {
+        "x": 58,
+        "y": -34
+      },
+      "anchor": "bottom"
+    },
+    {
+      "id": "pillar-3",
+      "type": "screw-pillar",
+      "params": {
+        "thread": "M2.5",
+        "od": 4.6,
+        "holeD": 1.9
+      },
+      "at": {
+        "x": -58,
+        "y": 34
+      },
+      "anchor": "bottom"
+    },
+    {
+      "id": "pillar-4",
+      "type": "screw-pillar",
+      "params": {
+        "thread": "M2.5",
+        "od": 4.6,
+        "holeD": 1.9
+      },
+      "at": {
+        "x": 58,
+        "y": 34
+      },
+      "anchor": "bottom"
+    },
+    {
+      "id": "rib-back",
+      "type": "rib",
+      "params": {
+        "thickness": 1.2,
+        "height": 3.0,
+        "count": 7
+      },
+      "at": {
+        "x": 0,
+        "y": 0
+      },
+      "anchor": "bottom"
+    },
+    {
+      "id": "snap-bat",
+      "type": "snap",
+      "params": {
+        "width": 4.0,
+        "depth": 0.8
+      },
+      "at": {
+        "x": 0,
+        "y": -38
+      },
+      "anchor": "bottom"
+    },
+    {
+      "id": "boss-stand",
+      "type": "boss",
+      "params": {
+        "od": 6.0,
+        "holeD": 2.0,
+        "height": 2.0
+      },
+      "at": {
+        "x": 0,
+        "y": 38
+      },
+      "anchor": "bottom"
+    },
+    {
+      "id": "pocket-bat",
+      "type": "pocket",
+      "params": {
+        "l": 60.0,
+        "w": 40.0,
+        "depth": 4.0
+      },
+      "at": {
+        "x": 0,
+        "y": 0
+      },
+      "anchor": "bottom"
+    }
+  ],
+  "electronics": [
+    {
+      "id": "soc",
+      "name": "主控模组",
+      "model": "AI-Thinker Ai-M62-12F(BL616)",
+      "size": {
+        "l": 12.0,
+        "w": 10.8,
+        "t": 2.4
+      },
+      "iface": "SPI / UART",
+      "power": "3.3V",
+      "price": 9.5,
+      "qty": 1,
+      "assembly": "焊接",
+      "mount": {
+        "z": 0.5,
+        "x": 55,
+        "y": -30
+      },
+      "top": 2.9,
+      "notes": "价格口径:2026 年深圳华强北小批行情区间中值(估算)"
+    },
+    {
+      "id": "epd",
+      "name": "3.7 英寸三色电子墨水屏",
+      "model": "GDEY037Z03(240×416,黑/白/红)",
+      "size": {
+        "l": 92.0,
+        "w": 52.7,
+        "t": 1.2
+      },
+      "iface": "SPI",
+      "power": "3.3V",
+      "price": 52,
+      "qty": 1,
+      "assembly": "排线 FPC",
+      "mount": {
+        "z": 1.8,
+        "x": 0,
+        "y": 0
+      },
+      "top": 3.0,
+      "notes": "价格口径:2026 年深圳华强北小批行情区间中值(估算)"
+    },
+    {
+      "id": "rtc",
+      "name": "RTC 时钟",
+      "model": "PCF8563T + 纽扣电池",
+      "size": {
+        "l": 5.0,
+        "w": 4.4,
+        "t": 1.0
+      },
+      "iface": "I2C",
+      "power": "3V 纽扣",
+      "price": 1.6,
+      "qty": 1,
+      "assembly": "焊接",
+      "mount": {
+        "z": 0.5,
+        "x": 45,
+        "y": -10
+      },
+      "top": 1.5,
+      "notes": "价格口径:2026 年深圳华强北小批行情区间中值(估算)"
+    },
+    {
+      "id": "battery-mod",
+      "name": "锂电 + BMS",
+      "model": "3.7V 1500mAh 804050",
+      "size": {
+        "l": 50.0,
+        "w": 40.0,
+        "t": 8.0
+      },
+      "iface": "BMS 板",
+      "power": "3.7V",
+      "price": 9.8,
+      "qty": 1,
+      "assembly": "焊接",
+      "mount": {
+        "z": 1.8,
+        "x": 0,
+        "y": 0
+      },
+      "top": 9.8,
+      "notes": "价格口径:2026 年深圳华强北小批行情区间中值(估算);电池置于后盖腔,主板在后盖侧"
+    },
+    {
+      "id": "usbc",
+      "name": "Type-C 充电口",
+      "model": "16P 板上沉板",
+      "size": {
+        "l": 9.0,
+        "w": 7.4,
+        "t": 3.2
+      },
+      "iface": "USB 2.0",
+      "power": "5V",
+      "price": 0.6,
+      "qty": 1,
+      "assembly": "焊接",
+      "mount": {
+        "z": 0.5,
+        "x": 0,
+        "y": -38
+      },
+      "top": 3.7,
+      "notes": "价格口径:2026 年深圳华强北小批行情区间中值(估算)"
+    }
+  ],
+  "consumables": [
+    {
+      "id": "screw-m25",
+      "name": "M2.5×6 自攻螺丝",
+      "spec": "碳钢镀镍",
+      "qty": 4,
+      "unit": "颗",
+      "price": 0.03,
+      "notes": ""
+    },
+    {
+      "id": "tape-screen",
+      "name": "屏全贴合双面胶",
+      "spec": "3M 5930 0.4t",
+      "qty": 1,
+      "unit": "片",
+      "price": 0.35,
+      "notes": ""
+    },
+    {
+      "id": "tape-bat",
+      "name": "电池双面胶",
+      "spec": "3M 468 0.13t",
+      "qty": 2,
+      "unit": "片",
+      "price": 0.06,
+      "notes": ""
+    },
+    {
+      "id": "screw-kit",
+      "name": "备用 M2.5 螺丝 ×2",
+      "spec": "碳钢镀镍",
+      "qty": 2,
+      "unit": "颗",
+      "price": 0.03,
+      "notes": ""
+    },
+    {
+      "id": "foam",
+      "name": "缓冲泡棉",
+      "spec": "1t EVA",
+      "qty": 4,
+      "unit": "片",
+      "price": 0.04,
+      "notes": ""
+    },
+    {
+      "id": "tape-back",
+      "name": "后盖双面胶",
+      "spec": "3M 468 0.13t",
+      "qty": 2,
+      "unit": "片",
+      "price": 0.05,
+      "notes": ""
+    },
+    {
+      "id": "label",
+      "name": "序列号标签",
+      "spec": "PET 白色 30×10",
+      "qty": 1,
+      "unit": "张",
+      "price": 0.04,
+      "notes": ""
+    },
+    {
+      "id": "box",
+      "name": "彩盒",
+      "spec": "350g 白卡 + 纸浆内托 200×120×30",
+      "qty": 1,
+      "unit": "套",
+      "price": 3.0,
+      "notes": ""
+    },
+    {
+      "id": "manual",
+      "name": "说明书",
+      "spec": "105g 铜版纸 8P",
+      "qty": 1,
+      "unit": "份",
+      "price": 0.35,
+      "notes": ""
+    },
+    {
+      "id": "cable",
+      "name": "Type-C 线",
+      "spec": "0.5m",
+      "qty": 1,
+      "unit": "条",
+      "price": 1.5,
+      "notes": ""
+    }
+  ],
+  "bom": {
+    "currency": "CNY",
+    "bomCurrency": "CNY",
+    "rows": [
+      {
+        "seq": 1,
+        "name": "前壳",
+        "spec": "ABS 白色喷涂",
+        "supplier": "注塑厂(东莞长安)",
+        "price": 2.6,
+        "qty": 1,
+        "subtotal": 2.6,
+        "group": "结构件"
+      },
+      {
+        "seq": 2,
+        "name": "前屏框",
+        "spec": "ABS 哑光黑喷油",
+        "supplier": "注塑厂",
+        "price": 0.8,
+        "qty": 1,
+        "subtotal": 0.8,
+        "group": "结构件"
+      },
+      {
+        "seq": 3,
+        "name": "后盖",
+        "spec": "ABS 晒纹",
+        "supplier": "注塑厂",
+        "price": 2.2,
+        "qty": 1,
+        "subtotal": 2.2,
+        "group": "结构件"
+      },
+      {
+        "seq": 4,
+        "name": "隐藏支架",
+        "spec": "ABS + 转轴",
+        "supplier": "注塑厂 + 五金转轴厂",
+        "price": 0.9,
+        "qty": 1,
+        "subtotal": 0.9,
+        "group": "结构件"
+      },
+      {
+        "seq": 5,
+        "name": "刷新/电源键",
+        "spec": "ABS 注塑",
+        "supplier": "注塑厂",
+        "price": 0.12,
+        "qty": 2,
+        "subtotal": 0.24,
+        "group": "结构件"
+      },
+      {
+        "seq": 6,
+        "name": "壁挂挂孔件",
+        "spec": "SUS304 冲压",
+        "supplier": "五金厂",
+        "price": 0.08,
+        "qty": 1,
+        "subtotal": 0.08,
+        "group": "结构件"
+      },
+      {
+        "seq": 7,
+        "name": "硅胶垫脚",
+        "spec": "硅胶模压",
+        "supplier": "硅胶厂",
+        "price": 0.08,
+        "qty": 4,
+        "subtotal": 0.32,
+        "group": "结构件"
+      },
+      {
+        "seq": 8,
+        "name": "3.7\" 三色电子墨水屏",
+        "spec": "GDEY037Z03 240×416",
+        "supplier": "墨水屏代理(深圳)",
+        "price": 52.0,
+        "qty": 1,
+        "subtotal": 52.0,
+        "group": "电子件",
+        "notes": "价格口径:2026 年深圳华强北小批行情区间中值(估算)"
+      },
+      {
+        "seq": 9,
+        "name": "PCBA 主板(Ai-M62 / RTC / BMS / Type-C)",
+        "spec": "四层板 SMT",
+        "supplier": "PCBA 厂(深圳宝安)",
+        "price": 32.0,
+        "qty": 1,
+        "subtotal": 32.0,
+        "group": "电子件",
+        "notes": "含 SMT 加工费"
+      },
+      {
+        "seq": 10,
+        "name": "聚合物锂电 1500mAh",
+        "spec": "804050 带保护板",
+        "supplier": "电池厂",
+        "price": 9.8,
+        "qty": 1,
+        "subtotal": 9.8,
+        "group": "电子件",
+        "notes": "价格口径:2026 年深圳华强北小批行情区间中值(估算)"
+      },
+      {
+        "seq": 11,
+        "name": "亚克力盖板(防眩光蚀刻)",
+        "spec": "1.5t PMMA",
+        "supplier": "亚克力加工厂",
+        "price": 3.2,
+        "qty": 1,
+        "subtotal": 3.2,
+        "group": "结构件"
+      },
+      {
+        "seq": 12,
+        "name": "扬声器网罩",
+        "spec": "SUS 冲孔",
+        "supplier": "五金厂",
+        "price": 0.15,
+        "qty": 1,
+        "subtotal": 0.15,
+        "group": "结构件"
+      },
+      {
+        "seq": 13,
+        "name": "电池压片",
+        "spec": "SUS301 冲压",
+        "supplier": "五金厂",
+        "price": 0.08,
+        "qty": 1,
+        "subtotal": 0.08,
+        "group": "结构件"
+      },
+      {
+        "seq": 14,
+        "name": "背板铭牌",
+        "spec": "PET 哑银丝印",
+        "supplier": "印刷厂",
+        "price": 0.04,
+        "qty": 1,
+        "subtotal": 0.04,
+        "group": "结构件"
+      },
+      {
+        "seq": 15,
+        "name": "后盖双面胶",
+        "spec": "3M 468",
+        "supplier": "辅料商",
+        "price": 0.05,
+        "qty": 2,
+        "subtotal": 0.1,
+        "group": "辅料"
+      },
+      {
+        "seq": 16,
+        "name": "M2.5×6 自攻螺丝",
+        "spec": "碳钢镀镍",
+        "supplier": "紧固件供应商",
+        "price": 0.03,
+        "qty": 4,
+        "subtotal": 0.12,
+        "group": "辅料"
+      },
+      {
+        "seq": 17,
+        "name": "屏全贴合双面胶",
+        "spec": "3M 5930",
+        "supplier": "辅料商",
+        "price": 0.35,
+        "qty": 1,
+        "subtotal": 0.35,
+        "group": "辅料"
+      },
+      {
+        "seq": 18,
+        "name": "电池双面胶",
+        "spec": "3M 468",
+        "supplier": "辅料商",
+        "price": 0.06,
+        "qty": 2,
+        "subtotal": 0.12,
+        "group": "辅料"
+      },
+      {
+        "seq": 19,
+        "name": "缓冲泡棉",
+        "spec": "1t EVA",
+        "supplier": "辅料商",
+        "price": 0.04,
+        "qty": 4,
+        "subtotal": 0.16,
+        "group": "辅料"
+      },
+      {
+        "seq": 20,
+        "name": "序列号标签",
+        "spec": "PET 白色",
+        "supplier": "印刷厂",
+        "price": 0.04,
+        "qty": 1,
+        "subtotal": 0.04,
+        "group": "辅料"
+      },
+      {
+        "seq": 21,
+        "name": "彩盒 + 纸浆内托",
+        "spec": "350g 白卡 + 纸浆托",
+        "supplier": "包装厂",
+        "price": 3.0,
+        "qty": 1,
+        "subtotal": 3.0,
+        "group": "包材"
+      },
+      {
+        "seq": 22,
+        "name": "说明书",
+        "spec": "105g 铜版纸 8P",
+        "supplier": "印刷厂",
+        "price": 0.35,
+        "qty": 1,
+        "subtotal": 0.35,
+        "group": "包材"
+      },
+      {
+        "seq": 23,
+        "name": "Type-C 线",
+        "spec": "0.5m",
+        "supplier": "线材厂",
+        "price": 1.5,
+        "qty": 1,
+        "subtotal": 1.5,
+        "group": "包材"
+      }
+    ],
+    "bomTotal": 110.15,
+    "groupTotals": {
+      "结构件": 10.61,
+      "电子件": 93.8,
+      "辅料": 0.89,
+      "包材": 4.85
+    },
+    "notes": "供应商类型为行业类别;单价取 2026 年东莞注塑、深圳墨水屏代理与华强北渠道小批(3,000 台)行情中值,非正式报价。墨水屏为 BOM 主要成本项。"
+  },
+  "processes": [
+    {
+      "id": "inject",
+      "name": "ABS 前后壳钢模注塑",
+      "mouldFee": 18000,
+      "mouldLife": "30 万模次",
+      "moq": 500,
+      "tiers": [
+        {
+          "qty": 500,
+          "price": 6.5
+        },
+        {
+          "qty": 3000,
+          "price": 4.6
+        },
+        {
+          "qty": 10000,
+          "price": 4.0
+        }
+      ],
+      "sampleDays": "12~15 天",
+      "bulkDays": "20 天",
+      "risk": "145mm 大件平面度超差导致装配翘曲",
+      "equipment": "海天 MA250II 250T 注塑机(1 腔大模)",
+      "cycle": "单模 65s",
+      "yield": 0.95,
+      "price": 4.6,
+      "desc": "1 腔模具,三点进胶,模温 65℃,水纹需白色喷涂遮盖;缩水率 0.5%,侧壁 0.5° 拔模"
+    },
+    {
+      "id": "paint",
+      "name": "白漆喷涂 + 哑光罩光",
+      "mouldFee": 500,
+      "mouldLife": "不限",
+      "moq": 500,
+      "tiers": [
+        {
+          "qty": 500,
+          "price": 3.0
+        },
+        {
+          "qty": 3000,
+          "price": 2.2
+        },
+        {
+          "qty": 10000,
+          "price": 1.8
+        }
+      ],
+      "sampleDays": "5 天",
+      "bulkDays": "8 天",
+      "risk": "白色遮盖不住水纹、色差",
+      "equipment": "喷涂线 + 烘道",
+      "cycle": "60s/件",
+      "yield": 0.94,
+      "price": 2.2,
+      "desc": "白色底漆两遍(共 30µm)+ 5° 哑光面漆,70℃ 烘 30min,UV 罩光"
+    },
+    {
+      "id": "smt",
+      "name": "主板 SMT 与屏幕点胶",
+      "mouldFee": 1500,
+      "mouldLife": "(SMT 钢网)",
+      "moq": 500,
+      "tiers": [
+        {
+          "qty": 500,
+          "price": 36.0
+        },
+        {
+          "qty": 3000,
+          "price": 32.0
+        },
+        {
+          "qty": 10000,
+          "price": 29.0
+        }
+      ],
+      "sampleDays": "10 天",
+      "bulkDays": "12 天",
+      "risk": "墨水屏 FPC 折伤;ESD 打死 EPD 驱动",
+      "equipment": "SMT 线 + 防静电屏贴装台",
+      "cycle": "节拍 40s/块",
+      "yield": 0.97,
+      "price": 32.0,
+      "desc": "SMT 后 100% 烧录与墨水屏驱动测试,FPC 补强板加固"
+    },
+    {
+      "id": "lam",
+      "name": "屏与盖板全贴合",
+      "mouldFee": 0,
+      "mouldLife": "不限",
+      "moq": 500,
+      "tiers": [
+        {
+          "qty": 500,
+          "price": 1.6
+        },
+        {
+          "qty": 3000,
+          "price": 1.2
+        },
+        {
+          "qty": 10000,
+          "price": 1.0
+        }
+      ],
+      "sampleDays": "3 天",
+      "bulkDays": "5 天",
+      "risk": "气泡、偏位",
+      "equipment": "滚轮贴膜台 + 脱泡炉",
+      "cycle": "50s/件",
+      "yield": 0.97,
+      "price": 1.2,
+      "desc": "防眩光亚克力盖板与墨水屏用 0.4mm 双面胶贴合,脱泡 45℃/20min"
+    },
+    {
+      "id": "assemble",
+      "name": "整机组装",
+      "mouldFee": 0,
+      "mouldLife": "不限",
+      "moq": 500,
+      "tiers": [
+        {
+          "qty": 500,
+          "price": 4.0
+        },
+        {
+          "qty": 3000,
+          "price": 3.0
+        },
+        {
+          "qty": 10000,
+          "price": 2.5
+        }
+      ],
+      "sampleDays": "/",
+      "bulkDays": "/",
+      "risk": "螺丝滑牙;支架卡滞",
+      "equipment": "流水线 2 工位 + 电动起子",
+      "cycle": "70s/台/人",
+      "yield": 0.98,
+      "price": 3.0,
+      "desc": "热熔铜螺母 → 装电池与主板 → 贴屏 → 合壳锁 4 颗螺丝 → 装支架与垫脚"
+    },
+    {
+      "id": "test",
+      "name": "功能检测",
+      "mouldFee": 500,
+      "mouldLife": "(测试治具)",
+      "moq": 500,
+      "tiers": [
+        {
+          "qty": 500,
+          "price": 1.8
+        },
+        {
+          "qty": 3000,
+          "price": 1.3
+        },
+        {
+          "qty": 10000,
+          "price": 1.1
+        }
+      ],
+      "sampleDays": "/",
+      "bulkDays": "/",
+      "risk": "EPD 刷新残影",
+      "equipment": "蓝牙测试治具",
+      "cycle": "60s/台",
+      "yield": 0.98,
+      "price": 1.3,
+      "desc": "100% 蓝牙连接、三次全刷与局部刷新测试,目检残影"
+    },
+    {
+      "id": "pack",
+      "name": "彩盒包装",
+      "mouldFee": 0,
+      "mouldLife": "不限",
+      "moq": 500,
+      "tiers": [
+        {
+          "qty": 500,
+          "price": 1.8
+        },
+        {
+          "qty": 3000,
+          "price": 1.4
+        },
+        {
+          "qty": 10000,
+          "price": 1.2
+        }
+      ],
+      "sampleDays": "3 天",
+      "bulkDays": "5 天",
+      "risk": "纸浆内托掉屑",
+      "equipment": "装盒台 + 封口机",
+      "cycle": "35s/台",
+      "yield": 0.995,
+      "price": 1.4,
+      "desc": "屏面贴保护膜 → 纸浆内托 → 配件 → 彩盒 → 外箱 30 台/箱"
+    }
+  ],
+  "moq": {
+    "baseQty": 3000,
+    "currency": "CNY",
+    "tiers": [
+      {
+        "qty": 500,
+        "unitPrice": 399,
+        "mouldAmort": 41.0,
+        "bulkPrice": 358.0,
+        "total": 199500,
+        "notes": "一套大模 18,000 元,500 台摊 36 元/台;首单必须走 500 起(单腔模具保证平面度)"
+      },
+      {
+        "qty": 3000,
+        "unitPrice": 349,
+        "mouldAmort": 6.83,
+        "bulkPrice": 342.17,
+        "total": 1047000,
+        "notes": "基准档,单套综合成本约 128.68 元"
+      },
+      {
+        "qty": 10000,
+        "unitPrice": 299,
+        "mouldAmort": 2.05,
+        "bulkPrice": 296.95,
+        "total": 2990000,
+        "notes": "墨水屏与 PCBA 批量价降至下限"
+      }
+    ],
+    "notes": "unitPrice 为含模具分摊建议零售阶梯;bulkPrice 为不含模具按台支付的货值单价(估算)。"
+  },
+  "processParams": {
+    "injection": {
+      "wall": 1.8,
+      "draft": 0.5,
+      "ribRatio": 0.55,
+      "depthRatio": 3.0,
+      "gate": "点浇口 3 点"
+    },
+    "silicone": {
+      "shoreA": 50,
+      "wall": 1.0,
+      "partingLine": "赤道线"
+    },
+    "cnc": {
+      "ballR": 2.0,
+      "topCrownR": 2.0,
+      "recessR": 1.0,
+      "chamferC": 0.6,
+      "thread": "—",
+      "tol": "±0.1"
+    },
+    "vacuum": {
+      "mouldLife": 30,
+      "minR": 0.8
+    }
+  },
+  "cost": {
+    "items": [
+      {
+        "name": "物料",
+        "amount": 110.15,
+        "basis": "BOM 合计"
+      },
+      {
+        "name": "加工",
+        "amount": 6.0,
+        "basis": "墨水屏驱动板点胶与测试 6.0(SMT 已整项计入 BOM)"
+      },
+      {
+        "name": "模具摊销",
+        "amount": 6.83,
+        "basis": "模具/治具费合计 20,500 ÷ 3,000 台"
+      },
+      {
+        "name": "组装",
+        "amount": 3.0,
+        "basis": "整机组装"
+      },
+      {
+        "name": "测试",
+        "amount": 1.3,
+        "basis": "功能测试"
+      },
+      {
+        "name": "包材",
+        "amount": 1.4,
+        "basis": "彩盒包装"
+      },
+      {
+        "name": "损耗",
+        "amount": 0.0,
+        "basis": "自动计算 3%"
+      }
+    ],
+    "material": 110.15,
+    "mouldTotal": [
+      18000,
+      500,
+      1500,
+      0,
+      0,
+      500,
+      0
+    ],
+    "baseQty": 3000,
+    "mouldAmortization": 6.83,
+    "unitCost": 128.68,
+    "suggestedPrice": 349,
+    "grossMarginPct": 63.13,
+    "markup": 2.71,
+    "retailLow": 299,
+    "retailHigh": 379,
+    "tooling": 20500,
+    "packagingPerSet": 4.85,
+    "formula": "物料 + 加工 + 模具摊销(模具费总和/基准批量) + 组装 + 测试 + 包材 + 损耗 = 单台成本;毛利率 =(建议售价-单台成本)/建议售价"
+  },
+  "detail": {
+    "title": "抬头一眼,今天的事",
+    "subtitle": "145×90mm · 墨水屏常显 · 两周续航",
+    "specs": [
+      {
+        "k": "尺寸",
+        "v": "145×90×9.5 mm"
+      },
+      {
+        "k": "重量",
+        "v": "约 92 g"
+      },
+      {
+        "k": "屏幕",
+        "v": "3.7\" 240×416 三色墨水屏"
+      },
+      {
+        "k": "材质",
+        "v": "白色 ABS 晒纹后盖"
+      }
+    ],
+    "sections": [
+      {
+        "title": "设计",
+        "body": "横向 145mm,正好塞在 27 寸显示器下方那条缝隙里。白色机身用细皮纹晒纹,不留指纹;屏框做成黑色窄边,让墨水屏像一张贴在纸上的便签。"
+      },
+      {
+        "title": "结构",
+        "body": "前壳与后盖用 4 颗 M2.5 自攻螺丝加 4 个热熔铜螺母锁合,后盖背腔留出 60×40×4mm 电池仓;隐藏支架绕底部转轴翻出 75°,放平即当垫脚,合上则可挂墙。"
+      },
+      {
+        "title": "工艺",
+        "body": "145mm 大件单腔钢模,三点进胶控制翘曲,出水纹后用白色底漆两遍加 5° 哑光面漆遮盖;墨水屏与蚀刻亚克力盖板全贴合,防眩光且不反光。"
+      },
+      {
+        "title": "规格",
+        "body": "145×90×9.5mm,整机约 92g;3.7 英寸 240×416 三色墨水屏;BLE 6.0 同步;1500mAh 电池,每天刷新 8 次约 14 天续航;Type-C 充电。"
+      },
+      {
+        "title": "价格档",
+        "body": "墨水屏与 PCBA 占去大头,单套综合成本约 129 元;3,000 台档建议零售 349 元,毛利率约 63%。"
+      }
+    ]
+  },
+  "dimensions": {
+    "length": 145.0,
+    "width": 90.0,
+    "height": 9.5
+  },
+  "weight": 92.0,
+  "priceBasis": "2026 年东莞注塑与喷涂、深圳墨水屏代理与华强北渠道小批(3,000 台)行情中值,估算;非供应商正式报价"
+}

+ 1154 - 0
site/data/products/pocket-ai.json

@@ -0,0 +1,1154 @@
+{
+  "id": "pocket-ai",
+  "name": "口袋 AI 终端",
+  "latin": "Pocket AI",
+  "tagline": "90×62 翻盖,合起来就是一台掌上 AI",
+  "category": "随身 AI 终端",
+  "craftTags": [
+    "铝上盖 CNC",
+    "ABS 下盖",
+    "阻尼铰链"
+  ],
+  "accent": "#00B894",
+  "summary": "90×62mm 的翻盖掌机尺寸,合上像一本硬壳小册子,翻开是一整块 4 英寸触摸屏加 QWERTY 实体键盘。上盖 6061 铝 CNC 阳极,下盖 ABS 注塑,中间是 360° 阻尼铰链;本地小模型负责速记与翻译,联网时把复杂问题交给云端。",
+  "author": "FmodeCode",
+  "shape": {
+    "type": "rect",
+    "defaults": {
+      "dTop": 90.0,
+      "dBottom": 89.3,
+      "height": 24.0,
+      "wall": 1.6,
+      "domeR": 1.2,
+      "platform": 1.0,
+      "recessR": 1.0,
+      "recessDepth": 1.0,
+      "screenD": 50.0,
+      "chamferC": 0.6,
+      "draft": 0.5,
+      "split": 0.52,
+      "cornerR": 8.0,
+      "length": 62.0,
+      "screenH": 61.0,
+      "capR": 4.0,
+      "bandD": 17.8,
+      "ringD": 19.2,
+      "ringBandW": 6.5
+    }
+  },
+  "materials": [
+    "al-silver",
+    "abs-matte",
+    "abs-rubber"
+  ],
+  "parts": [
+    {
+      "id": "top-lid",
+      "name": "铝上盖",
+      "role": "shell",
+      "material": "6061-T6 铝",
+      "craft": "CNC + 喷砂阳极",
+      "color": "#8E949C",
+      "weight": 38.0,
+      "split": 1,
+      "tolerance": "±0.05",
+      "notes": "整块铝 2.5D 成型,内腔下料 1.1mm 薄壁;阳极 12µm 银色"
+    },
+    {
+      "id": "screen-bezel",
+      "name": "上盖屏框",
+      "role": "lid",
+      "material": "6061-T6 铝",
+      "craft": "CNC + 镭雕",
+      "color": "#2B2D31",
+      "weight": 1.5,
+      "split": 0.95,
+      "tolerance": "±0.03",
+      "cnc": {
+        "domeR": 2.0,
+        "recessR": 1.0,
+        "chamferC": 0.6,
+        "thread": "—"
+      }
+    },
+    {
+      "id": "bottom-cover",
+      "name": "ABS 下盖",
+      "role": "back",
+      "material": "ABS",
+      "craft": "钢模注塑 + 橡胶漆",
+      "color": "#1E2024",
+      "weight": 16.0,
+      "split": 0,
+      "tolerance": "±0.05",
+      "notes": "1×1 模,键盘开孔一次成型;橡胶漆二涂"
+    },
+    {
+      "id": "keycap-set",
+      "name": "键帽组",
+      "role": "button",
+      "material": "ABS 双色",
+      "craft": "双色注塑",
+      "color": "#E8E6E1",
+      "weight": 6.0,
+      "split": 0,
+      "tolerance": "±0.05"
+    },
+    {
+      "id": "power-btn",
+      "name": "电源键",
+      "role": "button",
+      "material": "ABS 喷油",
+      "craft": "注塑",
+      "color": "#1E2024",
+      "weight": 0.2,
+      "split": 0.6,
+      "tolerance": "±0.05"
+    },
+    {
+      "id": "hinge",
+      "name": "360° 阻尼铰链",
+      "role": "clip",
+      "material": "SUS304 + POM",
+      "craft": "冲压 + 模压",
+      "color": "#8C8F94",
+      "weight": 4.0,
+      "split": 0,
+      "tolerance": "±0.05"
+    },
+    {
+      "id": "strap-ring",
+      "name": "挂绳孔",
+      "role": "ring",
+      "material": "SUS304",
+      "craft": "冲压包塑",
+      "color": "#8C8F94",
+      "weight": 1.0,
+      "split": 0,
+      "tolerance": "±0.15"
+    },
+    {
+      "id": "screen",
+      "name": "触摸屏",
+      "role": "screen",
+      "material": "IPS + 2.5D 玻璃",
+      "craft": "全贴合",
+      "color": "#101114",
+      "weight": 14.0,
+      "split": 1,
+      "transparent": 0.65,
+      "tolerance": "±0.05"
+    },
+    {
+      "id": "battery",
+      "name": "聚合物锂电",
+      "role": "battery",
+      "material": "铝塑膜电芯",
+      "craft": "叠片封装",
+      "color": "#B3B8BF",
+      "weight": 22.0,
+      "split": 0,
+      "tolerance": "±0.3"
+    },
+    {
+      "id": "main-pcb",
+      "name": "主板",
+      "role": "pcb",
+      "material": "FR-4 六层 HDI",
+      "craft": "SMT",
+      "color": "#1B6B3A",
+      "weight": 9.0,
+      "split": 1,
+      "tolerance": "±0.1"
+    },
+    {
+      "id": "brass",
+      "name": "热熔铜螺母",
+      "role": "brass",
+      "material": "黄铜",
+      "craft": "热熔",
+      "color": "#C9A86A",
+      "weight": 1.2,
+      "split": 0,
+      "tolerance": "±0.03"
+    },
+    {
+      "id": "key-sheet",
+      "name": "硅胶锅仔片",
+      "role": "clip",
+      "material": "硅胶 + 金属弹片",
+      "craft": "模压",
+      "color": "#4A4D52",
+      "weight": 4.0,
+      "split": 0,
+      "tolerance": "±0.1"
+    }
+  ],
+  "features": [
+    {
+      "id": "pillar-1",
+      "type": "screw-pillar",
+      "params": {
+        "thread": "M2",
+        "od": 4.0,
+        "holeD": 1.6
+      },
+      "at": {
+        "x": -38,
+        "y": -24
+      },
+      "anchor": "bottom"
+    },
+    {
+      "id": "pillar-2",
+      "type": "screw-pillar",
+      "params": {
+        "thread": "M2",
+        "od": 4.0,
+        "holeD": 1.6
+      },
+      "at": {
+        "x": 38,
+        "y": -24
+      },
+      "anchor": "bottom"
+    },
+    {
+      "id": "pillar-3",
+      "type": "screw-pillar",
+      "params": {
+        "thread": "M2",
+        "od": 4.0,
+        "holeD": 1.6
+      },
+      "at": {
+        "x": -38,
+        "y": 24
+      },
+      "anchor": "bottom"
+    },
+    {
+      "id": "pillar-4",
+      "type": "screw-pillar",
+      "params": {
+        "thread": "M2",
+        "od": 4.0,
+        "holeD": 1.6
+      },
+      "at": {
+        "x": 38,
+        "y": 24
+      },
+      "anchor": "bottom"
+    },
+    {
+      "id": "rib-door",
+      "type": "rib",
+      "params": {
+        "thickness": 1.0,
+        "height": 2.5,
+        "count": 6
+      },
+      "at": {
+        "x": 0,
+        "y": 0
+      },
+      "anchor": "bottom"
+    },
+    {
+      "id": "snap-hinge",
+      "type": "snap",
+      "params": {
+        "width": 8.0,
+        "depth": 0.8
+      },
+      "at": {
+        "x": 0,
+        "y": -28
+      },
+      "anchor": "bottom"
+    },
+    {
+      "id": "boss-hinge",
+      "type": "boss",
+      "params": {
+        "od": 7.0,
+        "holeD": 3.0,
+        "height": 2.0
+      },
+      "at": {
+        "x": -36,
+        "y": -26
+      },
+      "anchor": "bottom"
+    },
+    {
+      "id": "standoff",
+      "type": "standoff",
+      "params": {
+        "od": 3.0,
+        "height": 2.0,
+        "holeD": 1.6
+      },
+      "at": {
+        "x": 30,
+        "y": 20
+      },
+      "anchor": "bottom"
+    }
+  ],
+  "electronics": [
+    {
+      "id": "soc",
+      "name": "主控 SoC",
+      "model": "Rockchip RK3566(四核 A55)",
+      "size": {
+        "l": 15.0,
+        "w": 15.0,
+        "t": 1.0
+      },
+      "iface": "HDMI / MIPI / USB3",
+      "power": "3.3V / 1.0V",
+      "price": 32,
+      "qty": 1,
+      "assembly": "焊接",
+      "mount": {
+        "z": 0.5,
+        "x": 20,
+        "y": 10
+      },
+      "top": 1.5,
+      "notes": "价格口径:2026 年深圳华强北小批行情区间中值(估算)"
+    },
+    {
+      "id": "lcd",
+      "name": "4 英寸触摸屏",
+      "model": "4.0\" 480×800 IPS + 玻璃盖板",
+      "size": {
+        "l": 92.0,
+        "w": 56.0,
+        "t": 3.0
+      },
+      "iface": "MIPI DSI",
+      "power": "3.3V",
+      "price": 56,
+      "qty": 1,
+      "assembly": "排线 FPC",
+      "mount": {
+        "z": 0.6,
+        "x": 0,
+        "y": 0
+      },
+      "top": 3.6,
+      "notes": "价格口径:2026 年深圳华强北小批行情区间中值(估算);仅用于上盖叠层"
+    },
+    {
+      "id": "ram",
+      "name": "LPDDR4 内存",
+      "model": "2GB LPDDR4X 96 球",
+      "size": {
+        "l": 10.0,
+        "w": 14.0,
+        "t": 1.0
+      },
+      "iface": "LPDDR4X",
+      "power": "1.1V",
+      "price": 22,
+      "qty": 1,
+      "assembly": "焊接",
+      "mount": {
+        "z": 0.5,
+        "x": -10,
+        "y": 8
+      },
+      "top": 1.5,
+      "notes": "价格口径:2026 年深圳华强北小批行情区间中值(估算)"
+    },
+    {
+      "id": "emmc",
+      "name": "eMMC 闪存",
+      "model": "32GB eMMC 5.1",
+      "size": {
+        "l": 11.5,
+        "w": 13.0,
+        "t": 1.0
+      },
+      "iface": "eMMC 5.1",
+      "power": "3.3V",
+      "price": 19,
+      "qty": 1,
+      "assembly": "焊接",
+      "mount": {
+        "z": 0.5,
+        "x": -22,
+        "y": -6
+      },
+      "top": 1.5,
+      "notes": "价格口径:2026 年深圳华强北小批行情区间中值(估算)"
+    },
+    {
+      "id": "wifi",
+      "name": "Wi-Fi/蓝牙模组",
+      "model": "AP6212 / RTL8821CS",
+      "size": {
+        "l": 12.0,
+        "w": 12.0,
+        "t": 1.6
+      },
+      "iface": "SDIO",
+      "power": "3.3V",
+      "price": 12,
+      "qty": 1,
+      "assembly": "焊接",
+      "mount": {
+        "z": 0.5,
+        "x": 34,
+        "y": -10
+      },
+      "top": 2.1,
+      "notes": "价格口径:2026 年深圳华强北小批行情区间中值(估算)"
+    },
+    {
+      "id": "battery-mod",
+      "name": "锂电",
+      "model": "3.7V 3000mAh 606090",
+      "size": {
+        "l": 60.0,
+        "w": 40.0,
+        "t": 6.0
+      },
+      "iface": "BMS",
+      "power": "3.7V",
+      "price": 14.5,
+      "qty": 1,
+      "assembly": "焊接",
+      "mount": {
+        "z": 1.5,
+        "x": 0,
+        "y": 0
+      },
+      "top": 7.5,
+      "notes": "价格口径:2026 年深圳华强北小批行情区间中值(估算)"
+    }
+  ],
+  "consumables": [
+    {
+      "id": "screw",
+      "name": "M2×4 沉头螺丝",
+      "spec": "SUS304",
+      "qty": 6,
+      "unit": "颗",
+      "price": 0.06,
+      "notes": ""
+    },
+    {
+      "id": "tape",
+      "name": "双面胶",
+      "spec": "3M 9448A 0.15t",
+      "qty": 3,
+      "unit": "片",
+      "price": 0.05,
+      "notes": ""
+    },
+    {
+      "id": "foam",
+      "name": "缓冲泡棉",
+      "spec": "1t EVA 泡棉 2 片",
+      "qty": 2,
+      "unit": "片",
+      "price": 0.04,
+      "notes": ""
+    },
+    {
+      "id": "thermal",
+      "name": "导热垫",
+      "spec": "1.5t 2W/mK",
+      "qty": 2,
+      "unit": "片",
+      "price": 0.15,
+      "notes": ""
+    },
+    {
+      "id": "glue",
+      "name": "铰链螺纹胶",
+      "spec": "乐泰 222",
+      "qty": 0.2,
+      "unit": "g",
+      "price": 0.3,
+      "notes": ""
+    },
+    {
+      "id": "label",
+      "name": "序列号标签",
+      "spec": "PET 白色",
+      "qty": 1,
+      "unit": "张",
+      "price": 0.04,
+      "notes": ""
+    },
+    {
+      "id": "box",
+      "name": "彩盒礼盒(含 EVA 内托)",
+      "spec": "350g 白卡礼盒 + EVA 内托 130×100×40",
+      "qty": 1,
+      "unit": "套",
+      "price": 4.5,
+      "notes": ""
+    },
+    {
+      "id": "manual",
+      "name": "说明书",
+      "spec": "128g 铜版纸 16P",
+      "qty": 1,
+      "unit": "份",
+      "price": 0.6,
+      "notes": ""
+    },
+    {
+      "id": "cable",
+      "name": "Type-C 快充线",
+      "spec": "1m E-mark",
+      "qty": 1,
+      "unit": "条",
+      "price": 3.0,
+      "notes": ""
+    }
+  ],
+  "bom": {
+    "currency": "CNY",
+    "bomCurrency": "CNY",
+    "rows": [
+      {
+        "seq": 1,
+        "name": "铝上盖",
+        "spec": "6061-T6 CNC 2.5D 成型 + 阳极 12µm",
+        "supplier": "CNC 加工厂(深圳宝安)",
+        "price": 36.0,
+        "qty": 1,
+        "subtotal": 36.0,
+        "group": "结构件"
+      },
+      {
+        "seq": 2,
+        "name": "上盖屏框",
+        "spec": "6061 铝 CNC + 镭雕",
+        "supplier": "CNC 加工厂",
+        "price": 2.4,
+        "qty": 1,
+        "subtotal": 2.4,
+        "group": "结构件"
+      },
+      {
+        "seq": 3,
+        "name": "ABS 下盖(含键盘开孔)",
+        "spec": "ABS 1×1 钢模 + 橡胶漆",
+        "supplier": "注塑厂(东莞长安)",
+        "price": 3.6,
+        "qty": 1,
+        "subtotal": 3.6,
+        "group": "结构件"
+      },
+      {
+        "seq": 4,
+        "name": "键帽组",
+        "spec": "ABS 双色注塑 60 颗",
+        "supplier": "双色注塑厂",
+        "price": 4.5,
+        "qty": 1,
+        "subtotal": 4.5,
+        "group": "结构件"
+      },
+      {
+        "seq": 5,
+        "name": "电源键",
+        "spec": "ABS 喷油",
+        "supplier": "注塑厂",
+        "price": 0.08,
+        "qty": 1,
+        "subtotal": 0.08,
+        "group": "结构件"
+      },
+      {
+        "seq": 6,
+        "name": "硅胶锅仔片",
+        "spec": "硅胶 + 不锈钢弹片",
+        "supplier": "硅胶厂",
+        "price": 1.6,
+        "qty": 1,
+        "subtotal": 1.6,
+        "group": "结构件"
+      },
+      {
+        "seq": 7,
+        "name": "360° 阻尼铰链",
+        "spec": "SUS304 + POM,扭力 0.8kg·cm",
+        "supplier": "五金厂",
+        "price": 3.2,
+        "qty": 1,
+        "subtotal": 3.2,
+        "group": "结构件"
+      },
+      {
+        "seq": 8,
+        "name": "挂绳孔",
+        "spec": "SUS304 包塑",
+        "supplier": "五金厂",
+        "price": 0.25,
+        "qty": 1,
+        "subtotal": 0.25,
+        "group": "结构件"
+      },
+      {
+        "seq": 9,
+        "name": "4\" 触摸屏(含盖板)",
+        "spec": "480×800 IPS",
+        "supplier": "屏厂(深圳/惠州)",
+        "price": 56.0,
+        "qty": 1,
+        "subtotal": 56.0,
+        "group": "电子件",
+        "notes": "价格口径:2026 年深圳华强北小批行情区间中值(估算)"
+      },
+      {
+        "seq": 10,
+        "name": "PCBA 主板(RK3566 / 2G LPDDR4X / 32G eMMC / Wi-Fi)",
+        "spec": "六层 HDI SMT",
+        "supplier": "PCBA 厂(深圳宝安)",
+        "price": 115.0,
+        "qty": 1,
+        "subtotal": 115.0,
+        "group": "电子件",
+        "notes": "含 RK3566 32 + LPDDR4 22 + eMMC 19 + Wi-Fi 12 + 板与 SMT 30"
+      },
+      {
+        "seq": 11,
+        "name": "聚合物锂电 3000mAh",
+        "spec": "606090 带保护板",
+        "supplier": "电池厂",
+        "price": 14.5,
+        "qty": 1,
+        "subtotal": 14.5,
+        "group": "电子件",
+        "notes": "价格口径:2026 年深圳华强北小批行情区间中值(估算)"
+      },
+      {
+        "seq": 12,
+        "name": "M2×4 沉头螺丝",
+        "spec": "SUS304",
+        "supplier": "紧固件供应商",
+        "price": 0.06,
+        "qty": 6,
+        "subtotal": 0.36,
+        "group": "辅料"
+      },
+      {
+        "seq": 13,
+        "name": "双面胶",
+        "spec": "3M 9448A",
+        "supplier": "辅料商",
+        "price": 0.05,
+        "qty": 3,
+        "subtotal": 0.15,
+        "group": "辅料"
+      },
+      {
+        "seq": 14,
+        "name": "导热垫",
+        "spec": "1.5t 2W/mK",
+        "supplier": "辅料商",
+        "price": 0.15,
+        "qty": 2,
+        "subtotal": 0.3,
+        "group": "辅料"
+      },
+      {
+        "seq": 15,
+        "name": "铰链螺纹胶",
+        "spec": "乐泰 222",
+        "supplier": "辅料商",
+        "price": 0.3,
+        "qty": 0.2,
+        "subtotal": 0.06,
+        "group": "辅料"
+      },
+      {
+        "seq": 16,
+        "name": "序列号标签",
+        "spec": "PET 白色",
+        "supplier": "印刷厂",
+        "price": 0.04,
+        "qty": 1,
+        "subtotal": 0.04,
+        "group": "辅料"
+      },
+      {
+        "seq": 17,
+        "name": "礼盒 + EVA 内托",
+        "spec": "350g 白卡",
+        "supplier": "包装厂",
+        "price": 4.5,
+        "qty": 1,
+        "subtotal": 4.5,
+        "group": "包材"
+      },
+      {
+        "seq": 18,
+        "name": "说明书",
+        "spec": "128g 铜版纸 16P",
+        "supplier": "印刷厂",
+        "price": 0.6,
+        "qty": 1,
+        "subtotal": 0.6,
+        "group": "包材"
+      },
+      {
+        "seq": 19,
+        "name": "Type-C 快充线",
+        "spec": "1m E-mark",
+        "supplier": "线材厂",
+        "price": 3.0,
+        "qty": 1,
+        "subtotal": 3.0,
+        "group": "包材"
+      }
+    ],
+    "bomTotal": 246.14,
+    "groupTotals": {
+      "结构件": 51.63,
+      "电子件": 185.5,
+      "辅料": 0.91,
+      "包材": 8.1
+    },
+    "notes": "供应商类型为行业类别;单价取 2026 年深圳宝安 CNC、东莞注塑、华强北 SoC 渠道小批(3,000 台)行情中值,非正式报价。"
+  },
+  "processes": [
+    {
+      "id": "cnc",
+      "name": "铝上盖 CNC 2.5D",
+      "mouldFee": 0,
+      "mouldLife": "刀具寿命(每把 6,000 件)",
+      "moq": 300,
+      "tiers": [
+        {
+          "qty": 300,
+          "price": 42.0
+        },
+        {
+          "qty": 3000,
+          "price": 36.0
+        },
+        {
+          "qty": 10000,
+          "price": 32.0
+        }
+      ],
+      "sampleDays": "5~7 天",
+      "bulkDays": "15~20 天",
+      "risk": "薄壁 1.1mm 让刀;阳极色差",
+      "equipment": "精雕 JD + 卧加 ×3",
+      "cycle": "单件 16min(粗 10 / 精 6)",
+      "yield": 0.94,
+      "price": 36.0,
+      "desc": "2.5D 成型,四边 C0.6 倒角 + 沿长边 R4 圆角,精铣 Ra0.8,喷砂后阳极 12µm 银色"
+    },
+    {
+      "id": "inject",
+      "name": "ABS 下盖钢模注塑",
+      "mouldFee": 9000,
+      "mouldLife": "50 万模次",
+      "moq": 500,
+      "tiers": [
+        {
+          "qty": 500,
+          "price": 6.0
+        },
+        {
+          "qty": 3000,
+          "price": 4.6
+        },
+        {
+          "qty": 10000,
+          "price": 4.0
+        }
+      ],
+      "sampleDays": "10~12 天",
+      "bulkDays": "18 天",
+      "risk": "键盘开孔变形;橡胶漆积油",
+      "equipment": "海天 MA160II 160T(1 模 1 腔)",
+      "cycle": "单模 55s",
+      "yield": 0.95,
+      "price": 4.6,
+      "desc": "1 模 1 腔,60 个键位孔一次成型,键孔壁厚 1.0mm,缩水率 0.5%;侧壁 0.5° 拔模"
+    },
+    {
+      "id": "surface",
+      "name": "下盖橡胶漆 + 键帽喷涂",
+      "mouldFee": 400,
+      "mouldLife": "不限",
+      "moq": 500,
+      "tiers": [
+        {
+          "qty": 500,
+          "price": 6.0
+        },
+        {
+          "qty": 3000,
+          "price": 4.6
+        },
+        {
+          "qty": 10000,
+          "price": 3.8
+        }
+      ],
+      "sampleDays": "4 天",
+      "bulkDays": "7 天",
+      "risk": "橡胶漆堵键孔",
+      "equipment": "喷涂线 + UV 固化隧道",
+      "cycle": "节拍 50s/件",
+      "yield": 0.95,
+      "price": 4.6,
+      "desc": "下盖两涂橡胶漆 + UV 罩光,键帽激光雕刻字符后过 UV"
+    },
+    {
+      "id": "keycap",
+      "name": "键帽双色注塑",
+      "mouldLife": "30 万模次",
+      "moq": 1000,
+      "tiers": [
+        {
+          "qty": 1000,
+          "price": 6.5
+        },
+        {
+          "qty": 3000,
+          "price": 5.2
+        },
+        {
+          "qty": 10000,
+          "price": 4.6
+        }
+      ],
+      "sampleDays": "12 天",
+      "bulkDays": "15 天",
+      "risk": "双色拉花;字键错位",
+      "equipment": "长飞亚双色注塑机 100T + 喷涂柜",
+      "cycle": "单模 45s(1 模 12 颗)",
+      "yield": 0.96,
+      "price": 5.2,
+      "desc": "白色字符层 + 黑色键体双色成型,再两涂橡胶漆、激光雕刻字符"
+    },
+    {
+      "id": "smt",
+      "name": "主板 SMT",
+      "mouldFee": 2000,
+      "mouldLife": "(SMT 钢网)",
+      "moq": 500,
+      "tiers": [
+        {
+          "qty": 500,
+          "price": 125.0
+        },
+        {
+          "qty": 3000,
+          "price": 115.0
+        },
+        {
+          "qty": 10000,
+          "price": 105.0
+        }
+      ],
+      "sampleDays": "10~12 天",
+      "bulkDays": "15 天",
+      "risk": "LPDDR4 BGA 虚焊;散热不良降频",
+      "equipment": "松下 NPM-D3 + X-Ray 检测 + 回流焊",
+      "cycle": "节拍 50s/块",
+      "yield": 0.97,
+      "price": 115.0,
+      "desc": "六层 HDI,0.4mm BGA 贴片,X-Ray 抽检;烧录镜像与跑分 5 分钟"
+    },
+    {
+      "id": "lam",
+      "name": "屏全贴合",
+      "mouldFee": 800,
+      "mouldLife": "(贴合治具)",
+      "moq": 500,
+      "tiers": [
+        {
+          "qty": 500,
+          "price": 4.0
+        },
+        {
+          "qty": 3000,
+          "price": 3.0
+        },
+        {
+          "qty": 10000,
+          "price": 2.5
+        }
+      ],
+      "sampleDays": "5 天",
+      "bulkDays": "8 天",
+      "risk": "大气泡、偏位",
+      "equipment": "真空贴合机",
+      "cycle": "70s/件",
+      "yield": 0.96,
+      "price": 3.0,
+      "desc": "2.5D 玻璃与 IPS 全贴合,脱泡 50℃/30min"
+    },
+    {
+      "id": "assemble",
+      "name": "整机组装(含铰链调校)",
+      "mouldFee": 600,
+      "mouldLife": "(铰链调校治具)",
+      "moq": 300,
+      "tiers": [
+        {
+          "qty": 300,
+          "price": 12.0
+        },
+        {
+          "qty": 3000,
+          "price": 9.5
+        },
+        {
+          "qty": 10000,
+          "price": 8.0
+        }
+      ],
+      "sampleDays": "/",
+      "bulkDays": "/",
+      "risk": "铰链左右扭力差;排线折伤",
+      "equipment": "流水线 3 工位 + 扭力测试仪",
+      "cycle": "150s/台",
+      "yield": 0.97,
+      "price": 9.5,
+      "desc": "热熔铜螺母 → 键盘锅仔片 → 下盖主板 → 铰链装配(扭力 0.8±0.1kg·cm)→ 上盖屏装配 → 合盖测试"
+    },
+    {
+      "id": "test",
+      "name": "功能与老化检测",
+      "mouldFee": 1000,
+      "mouldLife": "(测试治具)",
+      "moq": 300,
+      "tiers": [
+        {
+          "qty": 300,
+          "price": 4.5
+        },
+        {
+          "qty": 3000,
+          "price": 3.2
+        },
+        {
+          "qty": 10000,
+          "price": 2.7
+        }
+      ],
+      "sampleDays": "/",
+      "bulkDays": "/",
+      "risk": "键盘个别键失效",
+      "equipment": "按键全巡检测试治具 + 48h 老化架",
+      "cycle": "120s/台",
+      "yield": 0.98,
+      "price": 3.2,
+      "desc": "60 键逐键巡检 + 触摸 + Wi-Fi 吞吐 + 5% 抽样 48h 老化"
+    },
+    {
+      "id": "pack",
+      "name": "礼盒包装",
+      "mouldFee": 0,
+      "mouldLife": "不限",
+      "moq": 300,
+      "tiers": [
+        {
+          "qty": 300,
+          "price": 3.2
+        },
+        {
+          "qty": 3000,
+          "price": 2.5
+        },
+        {
+          "qty": 10000,
+          "price": 2.0
+        }
+      ],
+      "sampleDays": "3 天",
+      "bulkDays": "4 天",
+      "risk": "EVA 内托尺寸偏差",
+      "equipment": "装盒台",
+      "cycle": "50s/台",
+      "yield": 0.995,
+      "price": 2.5,
+      "desc": "合盖入 EVA 内托 → 配件 → 礼盒 → 外箱 24 台/箱"
+    }
+  ],
+  "moq": {
+    "baseQty": 3000,
+    "currency": "CNY",
+    "tiers": [
+      {
+        "qty": 300,
+        "unitPrice": 799,
+        "mouldAmort": 56.33,
+        "bulkPrice": 742.67,
+        "total": 239700,
+        "notes": "模具/治具费 16,900 一次性支付或按 300 台摊 56.33 元/台"
+      },
+      {
+        "qty": 3000,
+        "unitPrice": 699,
+        "mouldAmort": 5.63,
+        "bulkPrice": 693.37,
+        "total": 2097000,
+        "notes": "基准档,单套综合成本约 274.57 元"
+      },
+      {
+        "qty": 10000,
+        "unitPrice": 629,
+        "mouldAmort": 1.69,
+        "bulkPrice": 627.31,
+        "total": 6290000,
+        "notes": "SMT 与 CNC 单价下降约 9%"
+      }
+    ],
+    "notes": "unitPrice 为含模具分摊建议零售阶梯;bulkPrice 为不含模具按台支付的货值单价(估算)。"
+  },
+  "processParams": {
+    "injection": {
+      "wall": 1.6,
+      "draft": 0.5,
+      "ribRatio": 0.55,
+      "depthRatio": 3.0,
+      "gate": "侧浇口"
+    },
+    "silicone": {
+      "shoreA": 50,
+      "wall": 1.0,
+      "partingLine": "赤道线"
+    },
+    "cnc": {
+      "ballR": 2.0,
+      "topCrownR": 1.2,
+      "recessR": 1.0,
+      "chamferC": 0.6,
+      "thread": "—",
+      "tol": "±0.05"
+    },
+    "vacuum": {
+      "mouldLife": 30,
+      "minR": 0.8
+    }
+  },
+  "cost": {
+    "items": [
+      {
+        "name": "物料",
+        "amount": 246.14,
+        "basis": "BOM 合计"
+      },
+      {
+        "name": "加工",
+        "amount": 7.6,
+        "basis": "键盘巡检与调试 4.6 + 屏幕贴合 3.0(SMT 已整项计入 BOM)"
+      },
+      {
+        "name": "模具摊销",
+        "amount": 5.63,
+        "basis": "模具/治具费合计 17,300 ÷ 3,000 台"
+      },
+      {
+        "name": "组装",
+        "amount": 9.5,
+        "basis": "整机组装"
+      },
+      {
+        "name": "测试",
+        "amount": 3.2,
+        "basis": "功能测试"
+      },
+      {
+        "name": "包材",
+        "amount": 2.5,
+        "basis": "礼盒包装"
+      },
+      {
+        "name": "损耗",
+        "amount": 0.0,
+        "basis": "自动计算 3%"
+      }
+    ],
+    "material": 246.14,
+    "mouldTotal": [
+      9000,
+      3500,
+      2000,
+      800,
+      600,
+      1000,
+      400
+    ],
+    "baseQty": 3000,
+    "mouldAmortization": 5.63,
+    "unitCost": 274.57,
+    "suggestedPrice": 699,
+    "grossMarginPct": 60.72,
+    "markup": 2.55,
+    "retailLow": 649,
+    "retailHigh": 749,
+    "tooling": 17300,
+    "packagingPerSet": 8.14,
+    "formula": "物料 + 加工 + 模具摊销(模具费总和/基准批量) + 组装 + 测试 + 包材 + 损耗 = 单台成本;毛利率 =(建议售价-单台成本)/建议售价"
+  },
+  "detail": {
+    "title": "合上是书,翻开是终端",
+    "subtitle": "90×62mm · 铝盖 + 实体键盘 · 360° 铰链",
+    "specs": [
+      {
+        "k": "尺寸",
+        "v": "90×62×24 mm"
+      },
+      {
+        "k": "重量",
+        "v": "约 172 g"
+      },
+      {
+        "k": "屏幕",
+        "v": "4.0\" 480×800 IPS"
+      },
+      {
+        "k": "材质",
+        "v": "6061 铝上盖 + ABS 下盖"
+      }
+    ],
+    "sections": [
+      {
+        "title": "设计",
+        "body": "尺寸刻意对齐一本口袋本:90×62mm,合起来 24mm 厚,塞进衬衫口袋正好。上盖是一整块银色铝,圆角沿长边 R4,翻板上没有任何开孔,只剩居中一块黑色屏框。"
+      },
+      {
+        "title": "结构",
+        "body": "下盖 ABS 一次成型出 60 个键位孔,上面盖硅胶锅仔片与双色键帽;铰链用 0.8kg·cm 阻尼,单手翻开停在任意角度,合上时上下盖由磁铁吸合。"
+      },
+      {
+        "title": "工艺",
+        "body": "铝上盖精雕 16 分钟一件,内腔 1.1mm 薄壁需要两段精铣;下盖 1 模 1 腔,键孔缩水率 0.5% 控制后键帽无卡滞;键帽双色后两涂橡胶漆再激光雕刻。"
+      },
+      {
+        "title": "规格",
+        "body": "90×62×24mm,约 172g;RK3566 四核 + 2GB 内存 + 32GB 存储;3000mAh 约 8 小时文字续航;Wi-Fi 6 + 蓝牙 5.0。"
+      },
+      {
+        "title": "价格档",
+        "body": "PCBA 与屏幕占到 BOM 一半以上,单套综合成本约 275 元;3,000 台档建议零售 699 元,毛利率约 61%。"
+      }
+    ]
+  },
+  "dimensions": {
+    "length": 90.0,
+    "width": 62.0,
+    "height": 24.0
+  },
+  "weight": 172.0,
+  "priceBasis": "2026 年深圳宝安 CNC、东莞注塑与华强北 SoC 渠道小批(3,000 台)行情中值,估算;非供应商正式报价"
+}

+ 1131 - 0
site/data/products/recorder-bean.json

@@ -0,0 +1,1131 @@
+{
+  "id": "recorder-bean",
+  "name": "磁吸 AI 录音豆",
+  "latin": "Recorder Bean",
+  "tagline": "38mm 磁吸录音,随手一贴",
+  "category": "随身 AI 终端",
+  "craftTags": [
+    "ABS 钢模注塑",
+    "超声焊接",
+    "磁吸背夹"
+  ],
+  "accent": "#E17055",
+  "summary": "一枚 38mm 的圆形录音豆,正面一颗实体键按下即录,背面 N52 钕磁铁与背夹双模式吸附在衣领、工牌或包带上。前后壳 ABS 注塑 + 超声波焊接密封,4 颗麦克风阵列 360° 拾音,配合手机 App 做转写与摘要。整机 29g,戴一天也不坠领。",
+  "author": "FmodeCode",
+  "shape": {
+    "type": "round",
+    "defaults": {
+      "dTop": 38.0,
+      "dBottom": 37.1,
+      "height": 12.4,
+      "wall": 1.6,
+      "domeR": 0.5,
+      "platform": 0.3,
+      "recessR": 0.3,
+      "recessDepth": 0.5,
+      "screenD": 24.0,
+      "chamferC": 0.4,
+      "draft": 1.0,
+      "split": 0.45,
+      "cornerR": 8.0,
+      "length": 96.0,
+      "screenH": 54.0,
+      "capR": 3.0,
+      "bandD": 17.8,
+      "ringD": 19.2,
+      "ringBandW": 6.5
+    }
+  },
+  "materials": [
+    "abs-matte",
+    "abs-rubber",
+    "sil-silicone"
+  ],
+  "parts": [
+    {
+      "id": "front-shell",
+      "name": "前壳",
+      "role": "shell",
+      "material": "ABS",
+      "craft": "钢模注塑 1×2 + 橡胶漆",
+      "color": "#3A3D42",
+      "weight": 4.2,
+      "split": 1,
+      "tolerance": "±0.05",
+      "notes": "前壳从正面进料,外圆 1° 拔模;2 腔模,P20 钢模,缩水率 0.5%;外表面两涂橡胶漆 + 哑光 UV 罩光"
+    },
+    {
+      "id": "back-cover",
+      "name": "后盖",
+      "role": "back",
+      "material": "ABS",
+      "craft": "钢模注塑 1×2 + 激光镭雕",
+      "color": "#3A3D42",
+      "weight": 3.1,
+      "split": 0,
+      "tolerance": "±0.05",
+      "notes": "后盖含 0.3mm 超声焊筋位,与前壳焊后气密 IP54"
+    },
+    {
+      "id": "mic-btn",
+      "name": "实体录音键",
+      "role": "button",
+      "material": "TPU",
+      "craft": "二次成型包胶",
+      "color": "#C0392B",
+      "weight": 0.6,
+      "split": 1,
+      "tolerance": "±0.1"
+    },
+    {
+      "id": "reset-btn",
+      "name": "复位键",
+      "role": "button",
+      "material": "ABS",
+      "craft": "注塑 + 喷油",
+      "color": "#3A3D42",
+      "weight": 0.2,
+      "split": 0,
+      "tolerance": "±0.1"
+    },
+    {
+      "id": "mag-clip",
+      "name": "磁吸背夹",
+      "role": "clip",
+      "material": "SUS304 + 硅胶垫",
+      "craft": "冲压折弯 + 植埋硅胶",
+      "color": "#8C8F94",
+      "weight": 2.4,
+      "split": 0,
+      "tolerance": "±0.15"
+    },
+    {
+      "id": "hanger",
+      "name": "挂绳环",
+      "role": "ring",
+      "material": "ABS",
+      "craft": "注塑",
+      "color": "#3A3D42",
+      "weight": 0.4,
+      "split": 0,
+      "tolerance": "±0.1"
+    },
+    {
+      "id": "status-lens",
+      "name": "状态灯导光件",
+      "role": "screen",
+      "material": "PC 透明",
+      "craft": "注塑 + 喷油遮光",
+      "color": "#2D3436",
+      "weight": 0.9,
+      "split": 1,
+      "transparent": 0.6,
+      "tolerance": "±0.05"
+    },
+    {
+      "id": "battery",
+      "name": "聚合物锂电",
+      "role": "battery",
+      "material": "铝塑膜电芯",
+      "craft": "叠片封装",
+      "color": "#B3B8BF",
+      "weight": 5.0,
+      "split": 0,
+      "tolerance": "±0.2"
+    },
+    {
+      "id": "main-pcb",
+      "name": "主板",
+      "role": "pcb",
+      "material": "FR-4 四层",
+      "craft": "SMT 贴片",
+      "color": "#1B6B3A",
+      "weight": 2.8,
+      "split": 1,
+      "tolerance": "±0.1"
+    },
+    {
+      "id": "screw",
+      "name": "M1.4 自攻螺丝",
+      "role": "brass",
+      "material": "碳钢镀镍",
+      "craft": "冷镦",
+      "color": "#C9CBD0",
+      "weight": 0.2,
+      "split": 0,
+      "tolerance": "±0.05"
+    },
+    {
+      "id": "usb-boot",
+      "name": "防水塞",
+      "role": "button",
+      "material": "TPE",
+      "craft": "注塑",
+      "color": "#3A3D42",
+      "weight": 0.3,
+      "split": 0,
+      "tolerance": "±0.1"
+    }
+  ],
+  "features": [
+    {
+      "id": "pillar-a",
+      "type": "screw-pillar",
+      "params": {
+        "thread": "M1.4",
+        "od": 3.0,
+        "holeD": 1.2
+      },
+      "at": {
+        "x": -10.5,
+        "y": 0
+      },
+      "anchor": "bottom"
+    },
+    {
+      "id": "pillar-b",
+      "type": "screw-pillar",
+      "params": {
+        "thread": "M1.4",
+        "od": 3.0,
+        "holeD": 1.2
+      },
+      "at": {
+        "x": 10.5,
+        "y": 0
+      },
+      "anchor": "bottom"
+    },
+    {
+      "id": "rib-1",
+      "type": "rib",
+      "params": {
+        "thickness": 0.8,
+        "height": 2.5,
+        "count": 8
+      },
+      "at": {
+        "x": 0,
+        "y": 0
+      },
+      "anchor": "bottom"
+    },
+    {
+      "id": "snap-1",
+      "type": "snap",
+      "params": {
+        "width": 3.0,
+        "depth": 0.8
+      },
+      "at": {
+        "x": 0,
+        "y": -16.5
+      },
+      "anchor": "bottom"
+    },
+    {
+      "id": "boss-bat",
+      "type": "boss",
+      "params": {
+        "od": 6.0,
+        "holeD": 2.0,
+        "height": 2.0
+      },
+      "at": {
+        "x": 0,
+        "y": 10
+      },
+      "anchor": "bottom"
+    },
+    {
+      "id": "standoff-pcb",
+      "type": "standoff",
+      "params": {
+        "od": 3.0,
+        "height": 2.4,
+        "holeD": 1.4
+      },
+      "at": {
+        "x": -10.5,
+        "y": 0
+      },
+      "anchor": "bottom"
+    },
+    {
+      "id": "magnet-pocket",
+      "type": "pocket",
+      "params": {
+        "l": 12.0,
+        "w": 8.0,
+        "depth": 1.2
+      },
+      "at": {
+        "x": 0,
+        "y": -12
+      },
+      "anchor": "bottom"
+    }
+  ],
+  "electronics": [
+    {
+      "id": "soc",
+      "name": "主控模组",
+      "model": "AI-Thinker Ai-M62-12F(BL616 模组)",
+      "size": {
+        "l": 12.0,
+        "w": 10.8,
+        "t": 2.4
+      },
+      "iface": "UART / I2S / USB2.0",
+      "power": "3.3V,待机 30µA",
+      "price": 9.5,
+      "qty": 1,
+      "assembly": "焊接",
+      "mount": {
+        "z": 0.3,
+        "x": -6,
+        "y": 4
+      },
+      "top": 2.7,
+      "notes": "价格口径:2026 年深圳华强北小批行情区间中值(估算)"
+    },
+    {
+      "id": "flash",
+      "name": "NOR Flash",
+      "model": "GD25Q64E 8MB SOP-8",
+      "size": {
+        "l": 5.3,
+        "w": 5.3,
+        "t": 1.5
+      },
+      "iface": "SPI",
+      "power": "3.3V",
+      "price": 2.6,
+      "qty": 1,
+      "assembly": "焊接",
+      "mount": {
+        "z": 0.3,
+        "x": 3,
+        "y": 9
+      },
+      "top": 1.8,
+      "notes": "价格口径:2026 年深圳华强北小批行情区间中值(估算)"
+    },
+    {
+      "id": "mic",
+      "name": "MEMS 麦克风",
+      "model": "Knowles SPH0645LM4H",
+      "size": {
+        "l": 3.5,
+        "w": 2.65,
+        "t": 0.9
+      },
+      "iface": "I2S",
+      "power": "1.8~3.3V",
+      "price": 2.2,
+      "qty": 4,
+      "assembly": "焊接",
+      "mount": {
+        "z": 0.3,
+        "x": -14,
+        "y": -6
+      },
+      "top": 1.2,
+      "notes": "价格口径:2026 年深圳华强北小批行情区间中值(估算),4 颗阵列布置于 PCB 四角"
+    },
+    {
+      "id": "imu",
+      "name": "六轴陀螺仪",
+      "model": "Bosch BMI160",
+      "size": {
+        "l": 2.5,
+        "w": 3.0,
+        "t": 0.8
+      },
+      "iface": "I2C / SPI",
+      "power": "1.8V",
+      "price": 3.2,
+      "qty": 1,
+      "assembly": "焊接",
+      "mount": {
+        "z": 0.3,
+        "x": 8,
+        "y": 0
+      },
+      "top": 1.1,
+      "notes": "价格口径:2026 年深圳华强北小批行情区间中值(估算)"
+    },
+    {
+      "id": "pogopin",
+      "name": "充电弹片",
+      "model": "POGO 2P φ2.5 板端",
+      "size": {
+        "l": 6.0,
+        "w": 4.0,
+        "t": 1.6
+      },
+      "iface": "电源触点",
+      "power": "5V/0.5A",
+      "price": 0.35,
+      "qty": 1,
+      "assembly": "焊接",
+      "mount": {
+        "z": 0.3,
+        "x": 0,
+        "y": -14
+      },
+      "top": 1.9,
+      "notes": "价格口径:2026 年深圳华强北小批行情区间中值(估算)"
+    }
+  ],
+  "consumables": [
+    {
+      "id": "screw-m14",
+      "name": "M1.4×4 自攻螺丝",
+      "spec": "碳钢镀镍",
+      "qty": 4,
+      "unit": "颗",
+      "price": 0.02,
+      "notes": "锁前壳与主板支架"
+    },
+    {
+      "id": "screw-m14b",
+      "name": "M1.4×3 自攻螺丝",
+      "spec": "碳钢镀镍",
+      "qty": 2,
+      "unit": "颗",
+      "price": 0.02,
+      "notes": "固定背夹"
+    },
+    {
+      "id": "tape-ring",
+      "name": "背夹双面胶",
+      "spec": "3M 9448A 0.15t 圆片 Ø22",
+      "qty": 1,
+      "unit": "片",
+      "price": 0.12,
+      "notes": ""
+    },
+    {
+      "id": "foam",
+      "name": "屏蔽泡棉",
+      "spec": "0.5t 导电泡棉 20×15",
+      "qty": 2,
+      "unit": "片",
+      "price": 0.06,
+      "notes": ""
+    },
+    {
+      "id": "glue-uv",
+      "name": "UV 胶",
+      "spec": "乐泰 3311",
+      "qty": 0.2,
+      "unit": "g",
+      "price": 0.8,
+      "notes": "导光件固定"
+    },
+    {
+      "id": "label",
+      "name": "型号标签",
+      "spec": "PET 银色 18×10",
+      "qty": 1,
+      "unit": "张",
+      "price": 0.03,
+      "notes": ""
+    },
+    {
+      "id": "box",
+      "name": "彩盒(内衬)",
+      "spec": "300g 白卡 + EVA 内托 60×60×20",
+      "qty": 1,
+      "unit": "套",
+      "price": 2.4,
+      "notes": ""
+    },
+    {
+      "id": "manual",
+      "name": "说明书",
+      "spec": "128g 铜版纸 8P 60×60",
+      "qty": 1,
+      "unit": "份",
+      "price": 0.45,
+      "notes": ""
+    },
+    {
+      "id": "cable",
+      "name": "Type-C 充电线",
+      "spec": "0.3m 编织线",
+      "qty": 1,
+      "unit": "条",
+      "price": 1.8,
+      "notes": ""
+    },
+    {
+      "id": "bag",
+      "name": "PE 自封袋",
+      "spec": "80×100",
+      "qty": 1,
+      "unit": "个",
+      "price": 0.05,
+      "notes": ""
+    }
+  ],
+  "bom": {
+    "currency": "CNY",
+    "bomCurrency": "CNY",
+    "rows": [
+      {
+        "seq": 1,
+        "name": "前壳(含橡胶漆)",
+        "spec": "ABS 本色料,1×2 钢模,两涂橡胶漆 + UV",
+        "supplier": "注塑厂(东莞长安)",
+        "price": 1.85,
+        "qty": 1,
+        "subtotal": 1.85,
+        "group": "结构件",
+        "notes": "4.2g 含 8% 水口回料"
+      },
+      {
+        "seq": 2,
+        "name": "后盖",
+        "spec": "ABS + 超声焊筋",
+        "supplier": "注塑厂(东莞长安)",
+        "price": 0.95,
+        "qty": 1,
+        "subtotal": 0.95,
+        "group": "结构件"
+      },
+      {
+        "seq": 3,
+        "name": "实体录音键",
+        "spec": "TPU 二次包胶",
+        "supplier": "注塑厂(东莞长安)",
+        "price": 0.3,
+        "qty": 1,
+        "subtotal": 0.3,
+        "group": "结构件"
+      },
+      {
+        "seq": 4,
+        "name": "复位键",
+        "spec": "ABS 喷油",
+        "supplier": "注塑厂(东莞长安)",
+        "price": 0.08,
+        "qty": 1,
+        "subtotal": 0.08,
+        "group": "结构件"
+      },
+      {
+        "seq": 5,
+        "name": "磁吸背夹组件",
+        "spec": "SUS304 冲压 + 硅胶垫 + N52 磁铁",
+        "supplier": "五金冲压厂(深圳宝安)",
+        "price": 1.4,
+        "qty": 1,
+        "subtotal": 1.4,
+        "group": "结构件"
+      },
+      {
+        "seq": 6,
+        "name": "挂绳环",
+        "spec": "ABS 注塑",
+        "supplier": "注塑厂(东莞长安)",
+        "price": 0.05,
+        "qty": 1,
+        "subtotal": 0.05,
+        "group": "结构件"
+      },
+      {
+        "seq": 7,
+        "name": "状态灯导光件",
+        "spec": "PC 透明 + 遮光喷油",
+        "supplier": "注塑厂(东莞长安)",
+        "price": 0.22,
+        "qty": 1,
+        "subtotal": 0.22,
+        "group": "结构件"
+      },
+      {
+        "seq": 8,
+        "name": "防水塞",
+        "spec": "TPE 注塑",
+        "supplier": "注塑厂(东莞长安)",
+        "price": 0.06,
+        "qty": 1,
+        "subtotal": 0.06,
+        "group": "结构件"
+      },
+      {
+        "seq": 9,
+        "name": "PCBA(含 Ai-M62 / 8MB Flash / 4×SPH0645 / BMI160)",
+        "spec": "四层板 + SMT 贴片",
+        "supplier": "PCBA 厂(深圳宝安)",
+        "price": 24.6,
+        "qty": 1,
+        "subtotal": 24.6,
+        "group": "电子件",
+        "notes": "价格口径:2026 年深圳华强北小批行情区间中值(估算),含 SMT 加工费 2.5"
+      },
+      {
+        "seq": 10,
+        "name": "聚合物锂电",
+        "spec": "3.7V 300mAh 15×12×5,带保护板",
+        "supplier": "电池厂(深圳龙岗/赣州)",
+        "price": 3.6,
+        "qty": 1,
+        "subtotal": 3.6,
+        "group": "电子件",
+        "notes": "价格口径:2026 年深圳华强北小批行情区间中值(估算)"
+      },
+      {
+        "seq": 11,
+        "name": "电磁治具连接弹片",
+        "spec": "POGO 2P φ2.5",
+        "supplier": "华强北现货商",
+        "price": 0.35,
+        "qty": 1,
+        "subtotal": 0.35,
+        "group": "电子件",
+        "notes": "价格口径:2026 年深圳华强北小批行情区间中值(估算)"
+      },
+      {
+        "seq": 12,
+        "name": "M1.4×4 自攻螺丝",
+        "spec": "碳钢镀镍",
+        "supplier": "紧固件供应商",
+        "price": 0.02,
+        "qty": 4,
+        "subtotal": 0.08,
+        "group": "辅料"
+      },
+      {
+        "seq": 13,
+        "name": "M1.4×3 自攻螺丝",
+        "spec": "碳钢镀镍",
+        "supplier": "紧固件供应商",
+        "price": 0.02,
+        "qty": 2,
+        "subtotal": 0.04,
+        "group": "辅料"
+      },
+      {
+        "seq": 14,
+        "name": "背夹双面胶",
+        "spec": "3M 9448A 0.15t Ø22",
+        "supplier": "辅料商",
+        "price": 0.12,
+        "qty": 1,
+        "subtotal": 0.12,
+        "group": "辅料"
+      },
+      {
+        "seq": 15,
+        "name": "屏蔽泡棉",
+        "spec": "0.5t 导电泡棉",
+        "supplier": "辅料商",
+        "price": 0.06,
+        "qty": 2,
+        "subtotal": 0.12,
+        "group": "辅料"
+      },
+      {
+        "seq": 16,
+        "name": "UV 胶",
+        "spec": "乐泰 3311",
+        "supplier": "辅料商",
+        "price": 0.8,
+        "qty": 0.2,
+        "subtotal": 0.16,
+        "group": "辅料"
+      },
+      {
+        "seq": 17,
+        "name": "型号标签",
+        "spec": "PET 银色 18×10",
+        "supplier": "印刷厂",
+        "price": 0.03,
+        "qty": 1,
+        "subtotal": 0.03,
+        "group": "辅料"
+      },
+      {
+        "seq": 18,
+        "name": "彩盒 + EVA 内托",
+        "spec": "300g 白卡覆哑膜 + EVA 内托",
+        "supplier": "包装印刷厂(东莞)",
+        "price": 2.4,
+        "qty": 1,
+        "subtotal": 2.4,
+        "group": "包材"
+      },
+      {
+        "seq": 19,
+        "name": "说明书",
+        "spec": "128g 铜版纸 8P",
+        "supplier": "印刷厂",
+        "price": 0.45,
+        "qty": 1,
+        "subtotal": 0.45,
+        "group": "包材"
+      },
+      {
+        "seq": 20,
+        "name": "Type-C 充电线",
+        "spec": "0.3m 编织线",
+        "supplier": "线材厂",
+        "price": 1.8,
+        "qty": 1,
+        "subtotal": 1.8,
+        "group": "包材"
+      },
+      {
+        "seq": 21,
+        "name": "PE 自封袋",
+        "spec": "80×100",
+        "supplier": "辅料商",
+        "price": 0.05,
+        "qty": 1,
+        "subtotal": 0.05,
+        "group": "包材"
+      }
+    ],
+    "bomTotal": 38.71,
+    "groupTotals": {
+      "结构件": 4.91,
+      "电子件": 28.55,
+      "辅料": 0.55,
+      "包材": 4.7
+    },
+    "notes": "供应商类型为行业类别,单价取 2026 年深圳/东莞小批(3,000 台档)行情中值,非正式报价。"
+  },
+  "processes": [
+    {
+      "id": "inject",
+      "name": "ABS 前后壳钢模注塑",
+      "mouldFee": 6500,
+      "mouldLife": "50 万模次",
+      "moq": 500,
+      "tiers": [
+        {
+          "qty": 500,
+          "price": 5.6
+        },
+        {
+          "qty": 3000,
+          "price": 4.2
+        },
+        {
+          "qty": 10000,
+          "price": 3.8
+        }
+      ],
+      "sampleDays": "7~10 天",
+      "bulkDays": "15~18 天",
+      "risk": "前后壳平面度超差导致超声焊接气密失败;建议首件做焊缝气密抽样",
+      "equipment": "海天 MA120II 注塑机(120T)×2",
+      "cycle": "单腔 28s,1×2 模,两班制班产约 5,000 腔",
+      "yield": 0.96,
+      "price": 4.2,
+      "desc": "ABS 本色粒料 80℃/4h 干燥,模温 60℃,保压 4s;缩水率 0.5%,外壁 1° 拔模;水口料回用 ≤15%"
+    },
+    {
+      "id": "surf",
+      "name": "橡胶漆喷涂 + UV 固化",
+      "mouldFee": 300,
+      "mouldLife": "不限",
+      "moq": 500,
+      "tiers": [
+        {
+          "qty": 500,
+          "price": 1.5
+        },
+        {
+          "qty": 3000,
+          "price": 1.1
+        },
+        {
+          "qty": 10000,
+          "price": 0.9
+        }
+      ],
+      "sampleDays": "5 天",
+      "bulkDays": "10 天",
+      "risk": "手感油厚度不均导致磨砂颗粒感差异;色差 ΔE ≤1.0",
+      "equipment": "自动喷涂线 3 枪 + UV 隧道炉",
+      "cycle": "节拍 45s/挂,每挂 24 件",
+      "yield": 0.95,
+      "price": 1.1,
+      "desc": "底漆 15µm + 手感面漆 20µm,两涂两烤,70℃/30min 后 UV 罩光固化(能量 800mJ/cm²)"
+    },
+    {
+      "id": "weld",
+      "name": "超声波焊接前后壳",
+      "mouldFee": 1800,
+      "mouldLife": "10 万次",
+      "moq": 500,
+      "tiers": [
+        {
+          "qty": 500,
+          "price": 0.8
+        },
+        {
+          "qty": 3000,
+          "price": 0.55
+        },
+        {
+          "qty": 10000,
+          "price": 0.45
+        }
+      ],
+      "sampleDays": "3 天",
+      "bulkDays": "7 天",
+      "risk": "焊头振幅过大压伤外壳外观;焊深不足漏气",
+      "equipment": "灵科 20kHz 超声焊机 + 定制焊头",
+      "cycle": "8s/台",
+      "yield": 0.97,
+      "price": 0.55,
+      "desc": "20kHz / 30µm 振幅,焊筋 0.3mm,焊深 0.25mm;焊后 30kPa 气压检漏 1s/台"
+    },
+    {
+      "id": "cnc-led",
+      "name": "导光件 CNC 修边 + 喷油",
+      "mouldFee": 0,
+      "mouldLife": "不限",
+      "moq": 500,
+      "tiers": [
+        {
+          "qty": 500,
+          "price": 0.35
+        },
+        {
+          "qty": 3000,
+          "price": 0.25
+        },
+        {
+          "qty": 10000,
+          "price": 0.2
+        }
+      ],
+      "sampleDays": "3 天",
+      "bulkDays": "5 天",
+      "risk": "遮光漆漏喷导致串光",
+      "equipment": "精雕机 2 台 + 喷涂柜",
+      "cycle": "60s/件",
+      "yield": 0.96,
+      "price": 0.25,
+      "desc": "导光件飞边 CNC 修整,侧壁喷涂黑色遮光漆一遍"
+    },
+    {
+      "id": "smt",
+      "name": "PCBA 贴片与测试",
+      "mouldFee": 1200,
+      "mouldLife": "(SMT 钢网)",
+      "moq": 500,
+      "tiers": [
+        {
+          "qty": 500,
+          "price": 4.5
+        },
+        {
+          "qty": 3000,
+          "price": 3.2
+        },
+        {
+          "qty": 10000,
+          "price": 2.8
+        }
+      ],
+      "sampleDays": "10~12 天",
+      "bulkDays": "15 天",
+      "risk": "MEMS 麦克风回流后灵敏度漂移;建议贴片后 100% 声学测试",
+      "equipment": "松下 NPM-D3 贴片线 + 回流焊 + 声学测试台",
+      "cycle": "节拍 30s/块",
+      "yield": 0.98,
+      "price": 3.2,
+      "desc": "无铅锡膏 SAC305,回流峰值 245℃;FCT 工位测 WiFi/BLE 射频与麦克风阵列一致性"
+    },
+    {
+      "id": "assemble",
+      "name": "整机组装",
+      "mouldFee": 0,
+      "mouldLife": "不限",
+      "moq": 500,
+      "tiers": [
+        {
+          "qty": 500,
+          "price": 4.0
+        },
+        {
+          "qty": 3000,
+          "price": 3.2
+        },
+        {
+          "qty": 10000,
+          "price": 2.8
+        }
+      ],
+      "sampleDays": "/",
+      "bulkDays": "/",
+      "risk": "螺丝扭力过大滑牙;电池线束压伤",
+      "equipment": "流水线 2 工位 + 电动起子(0.1N·m)",
+      "cycle": "60s/台/人,2 人",
+      "yield": 0.985,
+      "price": 3.2,
+      "desc": "电池定位 → 主板锁付 4 颗螺丝 → 超声焊 → 贴背夹 → 贴 UV 胶固定导光件"
+    },
+    {
+      "id": "test",
+      "name": "功能与可靠性检测",
+      "mouldFee": 0,
+      "mouldLife": "不限",
+      "moq": 500,
+      "tiers": [
+        {
+          "qty": 500,
+          "price": 1.6
+        },
+        {
+          "qty": 3000,
+          "price": 1.2
+        },
+        {
+          "qty": 10000,
+          "price": 0.95
+        }
+      ],
+      "sampleDays": "/",
+      "bulkDays": "/",
+      "risk": "测试治具接触不良造成误判;焊后气密失效",
+      "equipment": "POGO 测试治具 + 老化架",
+      "cycle": "45s/台",
+      "yield": 0.985,
+      "price": 1.2,
+      "desc": "100% 烧录 + BLE 连接测试 + 回放抽检 + 气密检漏,另外 5% 抽样 48h 老化(5% 抽检)"
+    },
+    {
+      "id": "laser",
+      "name": "后盖激光镭雕",
+      "mouldFee": 0,
+      "mouldLife": "不限",
+      "moq": 500,
+      "tiers": [
+        {
+          "qty": 500,
+          "price": 0.35
+        },
+        {
+          "qty": 3000,
+          "price": 0.28
+        },
+        {
+          "qty": 10000,
+          "price": 0.22
+        }
+      ],
+      "sampleDays": "2 天",
+      "bulkDays": "3 天",
+      "risk": "镭雕发黄",
+      "equipment": "光纤激光打标机 20W",
+      "cycle": "15s/件",
+      "yield": 0.99,
+      "price": 0.28,
+      "desc": "后盖外侧镭雕型号与序列号,功率 40%,无需耗材"
+    },
+    {
+      "id": "pack",
+      "name": "彩盒包装",
+      "mouldFee": 0,
+      "mouldLife": "不限",
+      "moq": 500,
+      "tiers": [
+        {
+          "qty": 500,
+          "price": 2.5
+        },
+        {
+          "qty": 3000,
+          "price": 2.5
+        },
+        {
+          "qty": 10000,
+          "price": 2.5
+        }
+      ],
+      "sampleDays": "3 天",
+      "bulkDays": "5 天",
+      "risk": "彩盒覆膜破损",
+      "equipment": "自动折盒机 + 封口机",
+      "cycle": "30s/套",
+      "yield": 0.995,
+      "price": 1.1,
+      "desc": "说明书 → 内托 → 整机 → 充电线 → 彩盒覆膜 → 外箱 60 台/箱"
+    }
+  ],
+  "moq": {
+    "baseQty": 3000,
+    "currency": "CNY",
+    "tiers": [
+      {
+        "qty": 500,
+        "unitPrice": 329,
+        "mouldAmort": 25.2,
+        "bulkPrice": 303.8,
+        "total": 164500,
+        "notes": "模具费 12,600 一次性支付或按 500 台摊 25.2 元/台"
+      },
+      {
+        "qty": 3000,
+        "unitPrice": 249,
+        "mouldAmort": 4.2,
+        "bulkPrice": 244.8,
+        "total": 747000,
+        "notes": "模具费摊薄;本档为基准成本口径,单台成本 86.38 元"
+      },
+      {
+        "qty": 10000,
+        "unitPrice": 219,
+        "mouldAmort": 1.26,
+        "bulkPrice": 217.74,
+        "total": 2190000,
+        "notes": "物料 10,000 档降约 6%,PCBA 与彩盒降幅最大"
+      }
+    ],
+    "notes": "unitPrice 为含分摊模具费的阶梯总单价建议;bulkPrice = unitPrice − mouldAmort,为不含模具按台支付的货值单价(估算)。"
+  },
+  "processParams": {
+    "injection": {
+      "wall": 1.6,
+      "draft": 1.0,
+      "ribRatio": 0.55,
+      "depthRatio": 2.5,
+      "gate": "侧浇口"
+    },
+    "silicone": {
+      "shoreA": 55,
+      "wall": 1.5,
+      "partingLine": "赤道线"
+    },
+    "cnc": {
+      "ballR": 1.0,
+      "topCrownR": 0.5,
+      "recessR": 0.3,
+      "chamferC": 0.4,
+      "thread": "Ø38.0",
+      "tol": "±0.05"
+    },
+    "vacuum": {
+      "mouldLife": 30,
+      "minR": 0.8
+    }
+  },
+  "cost": {
+    "items": [
+      {
+        "name": "物料",
+        "amount": 38.71,
+        "basis": "BOM 合计"
+      },
+      {
+        "name": "加工",
+        "amount": 6.8,
+        "basis": "表面处理 1.10 + 超声焊接 0.55 + 导光修边 0.25 + 激光镭雕 0.28 + 成型注塑 1.20 + SMT 3.20"
+      },
+      {
+        "name": "模具摊销",
+        "amount": 4.2,
+        "basis": "模具费合计 12,600(钢模 6,500 + 喷涂 300 + 焊头 1,800 + 导光模 1,300 + SMT 钢网 1,200 + 测试治具 1,500)÷ 3,000 台"
+      },
+      {
+        "name": "组装",
+        "amount": 32.0,
+        "basis": "整机组装"
+      },
+      {
+        "name": "测试",
+        "amount": 3.6,
+        "basis": "功能测试"
+      },
+      {
+        "name": "包材",
+        "amount": 5.4,
+        "basis": "彩盒工序"
+      },
+      {
+        "name": "损耗",
+        "amount": 2.3,
+        "basis": "按 3% 计(含 PCBA 报废与辅料损耗)"
+      }
+    ],
+    "material": 38.71,
+    "mouldTotal": [
+      6500,
+      300,
+      1800,
+      1300,
+      1200,
+      1500
+    ],
+    "baseQty": 3000,
+    "mouldAmortization": 4.2,
+    "unitCost": 93.01,
+    "suggestedPrice": 249,
+    "grossMarginPct": 62.65,
+    "markup": 2.68,
+    "retailLow": 229,
+    "retailHigh": 269,
+    "tooling": 12600,
+    "packagingPerSet": 5.4,
+    "formula": "物料 + 加工 + 模具摊销(模具费总和/基准批量) + 组装 + 测试 + 包材 + 损耗 = 单台成本;毛利率 =(建议售价-单台成本)/建议售价"
+  },
+  "detail": {
+    "title": "豆子般大小,随身录音",
+    "subtitle": "按下即录 · 磁吸即贴 · 转写由手机完成",
+    "specs": [
+      {
+        "k": "直径",
+        "v": "Ø38.0 mm"
+      },
+      {
+        "k": "厚度",
+        "v": "12.4 mm"
+      },
+      {
+        "k": "重量",
+        "v": "29 g"
+      },
+      {
+        "k": "材质",
+        "v": "ABS 前壳 + 橡胶漆"
+      }
+    ],
+    "sections": [
+      {
+        "title": "设计",
+        "body": "圆饼形体把按键面积、麦克风阵列和电池腔做到同一半径上。38mm 正好落在拇指与食指之间,单手按下即开始录音,指示灯从导光孔透出,红点提醒你正在记录。"
+      },
+      {
+        "title": "结构",
+        "body": "前壳与后盖由钢模注塑后超声波焊接,焊筋 0.3mm 形成封闭气密圈;PCB 用 M1.4 螺丝锁在前壳柱位,背面嵌 N52 磁铁与冲压背夹,一粒豆子同时满足磁吸与夹持两种佩戴。"
+      },
+      {
+        "title": "工艺",
+        "body": "前后壳 1×2 腔 P20 钢模,90 秒一出两件;表面两涂橡胶漆再 UV 罩光,磨砂手感且耐 3H 铅笔硬度。导光件单独遮光喷油,避免夜晚串光。"
+      },
+      {
+        "title": "规格",
+        "body": "Ø38×12.4mm,整机 29g;300mAh 电池约 12 小时录音;蓝牙 6.0 / Wi-Fi 6;POGO 触点经磁吸充电座充电。IP54 防尘防水。"
+      },
+      {
+        "title": "价格档",
+        "body": "以 3,000 台为基准,BOM 约 39 元,加上加工、模具摊销与测试,单套综合成本约 93 元;3,000 件档建议零售 249 元/台,毛利率约 63%。"
+      }
+    ]
+  },
+  "dimensions": {
+    "length": 38.0,
+    "width": 38.0,
+    "height": 12.4
+  },
+  "weight": 29.0,
+  "priceBasis": "2026 年深圳宝安/东莞长安小批(3,000 台)行情区间中值,估算;非供应商正式报价"
+}

+ 1094 - 0
site/data/products/round-screen.json

@@ -0,0 +1,1094 @@
+{
+  "id": "round-screen",
+  "name": "圆屏 AI 桌面助手",
+  "latin": "Round Screen",
+  "tagline": "61mm 铝圆盘,桌面上的 AI 眼",
+  "category": "桌面 AI 终端",
+  "craftTags": [
+    "CNC 6061",
+    "阳极氧化",
+    "五轴"
+  ],
+  "accent": "#6C5CE7",
+  "summary": "一整块 6061-T6 铝锭五轴 CNC 挖出的圆盘机身,阳极氧化后呈深空灰,Ø61.6mm 的圆形触摸屏嵌在沉台里,启动时像一枚发光的眼眸。底座内藏 360° 麦克风、扬声器与磁吸充电支架,说话即问、抬眼看屏即答。",
+  "author": "FmodeCode",
+  "shape": {
+    "type": "round",
+    "defaults": {
+      "dTop": 61.6,
+      "dBottom": 58.0,
+      "height": 14.6,
+      "wall": 1.6,
+      "domeR": 0.8,
+      "platform": 0.3,
+      "recessR": 0.5,
+      "recessDepth": 1.0,
+      "screenD": 45.68,
+      "chamferC": 0.5,
+      "draft": 1.0,
+      "split": 0.62,
+      "cornerR": 8.0,
+      "length": 96.0,
+      "screenH": 54.0,
+      "capR": 3.0,
+      "bandD": 17.8,
+      "ringD": 19.2,
+      "ringBandW": 6.5
+    }
+  },
+  "materials": [
+    "al-black",
+    "pc-gloss",
+    "sil-silicone"
+  ],
+  "parts": [
+    {
+      "id": "shell",
+      "name": "铝一体机身",
+      "role": "shell",
+      "material": "6061-T6 铝",
+      "craft": "五轴 CNC + 阳极氧化",
+      "color": "#2B2D31",
+      "weight": 31.0,
+      "split": 1,
+      "tolerance": "±0.05",
+      "notes": "Ø64 铝棒料五轴车铣复合,铣出内腔与屏沉台,壁厚 1.6mm;外壁 1° 拔模(造型拔模,非脱模所需);阳极 15µm"
+    },
+    {
+      "id": "front-lip",
+      "name": "前圈镜面倒角",
+      "role": "lid",
+      "material": "6061-T6 铝",
+      "craft": "CNC 钻石刀高光",
+      "color": "#4B5058",
+      "weight": 2.2,
+      "split": 0.95,
+      "tolerance": "±0.05",
+      "cnc": {
+        "domeR": 0.8,
+        "recessR": 0.5,
+        "chamferC": 0.5,
+        "thread": "M61.6×0.75"
+      }
+    },
+    {
+      "id": "back-cover",
+      "name": "底盖",
+      "role": "back",
+      "material": "6061-T6 铝",
+      "craft": "CNC + 喷砂阳极",
+      "color": "#2B2D31",
+      "weight": 6.5,
+      "split": 0,
+      "tolerance": "±0.05",
+      "notes": "M61.6×0.75 螺纹旋入,内置硅胶 O 圈"
+    },
+    {
+      "id": "power-btn",
+      "name": "音量/电源滚轮键",
+      "role": "button",
+      "material": "6061-T6 铝",
+      "craft": "CNC + 阳极",
+      "color": "#4B5058",
+      "weight": 0.4,
+      "split": 0.6,
+      "tolerance": "±0.03"
+    },
+    {
+      "id": "mute-btn",
+      "name": "麦克风静音键",
+      "role": "button",
+      "material": "POM",
+      "craft": "注塑",
+      "color": "#2B2D31",
+      "weight": 0.2,
+      "split": 0,
+      "tolerance": "±0.05"
+    },
+    {
+      "id": "stand-ring",
+      "name": "T 型皮垫挂环",
+      "role": "ring",
+      "material": "SUS304 + 有机硅皮",
+      "craft": "冲压 + 缝制",
+      "color": "#8C8F94",
+      "weight": 3.0,
+      "split": 0,
+      "tolerance": "±0.2"
+    },
+    {
+      "id": "screen",
+      "name": "圆形触摸屏",
+      "role": "screen",
+      "material": "AMOLED + 2.5D 玻璃",
+      "craft": "盖板贴合",
+      "color": "#101114",
+      "weight": 5.0,
+      "split": 1,
+      "transparent": 0.65,
+      "tolerance": "±0.05"
+    },
+    {
+      "id": "battery",
+      "name": "聚合物锂电",
+      "role": "battery",
+      "material": "铝塑膜电芯",
+      "craft": "叠片封装",
+      "color": "#B3B8BF",
+      "weight": 9.0,
+      "split": 0,
+      "tolerance": "±0.3"
+    },
+    {
+      "id": "main-pcb",
+      "name": "主板",
+      "role": "pcb",
+      "material": "FR-4 六层",
+      "craft": "HDI SMT",
+      "color": "#1B6B3A",
+      "weight": 3.5,
+      "split": 1,
+      "tolerance": "±0.1"
+    },
+    {
+      "id": "brass-pillar",
+      "name": "水蒸气密封铜螺母",
+      "role": "brass",
+      "material": "黄铜镀镍",
+      "craft": "热熔植入",
+      "color": "#C9A86A",
+      "weight": 0.6,
+      "split": 0,
+      "tolerance": "±0.05"
+    },
+    {
+      "id": "o-ring",
+      "name": "密封 O 圈",
+      "role": "clip",
+      "material": "氟橡胶 FKM",
+      "craft": "模压",
+      "color": "#1A1A1A",
+      "weight": 0.3,
+      "split": 0,
+      "transparent": 0.8,
+      "tolerance": "±0.1"
+    }
+  ],
+  "features": [
+    {
+      "id": "pillar-1",
+      "type": "screw-pillar",
+      "params": {
+        "thread": "M2",
+        "od": 4.0,
+        "holeD": 1.6
+      },
+      "at": {
+        "x": -12,
+        "y": 0
+      },
+      "anchor": "bottom"
+    },
+    {
+      "id": "pillar-2",
+      "type": "screw-pillar",
+      "params": {
+        "thread": "M2",
+        "od": 4.0,
+        "holeD": 1.6
+      },
+      "at": {
+        "x": 12,
+        "y": 0
+      },
+      "anchor": "bottom"
+    },
+    {
+      "id": "pillar-3",
+      "type": "screw-pillar",
+      "params": {
+        "thread": "M2",
+        "od": 4.0,
+        "holeD": 1.6
+      },
+      "at": {
+        "x": 0,
+        "y": 12
+      },
+      "anchor": "bottom"
+    },
+    {
+      "id": "rib-cav",
+      "type": "rib",
+      "params": {
+        "thickness": 1.0,
+        "height": 2.0,
+        "count": 10
+      },
+      "at": {
+        "x": 0,
+        "y": 0
+      },
+      "anchor": "bottom"
+    },
+    {
+      "id": "boss-speaker",
+      "type": "boss",
+      "params": {
+        "od": 8.0,
+        "holeD": 6.0,
+        "height": 1.5
+      },
+      "at": {
+        "x": 0,
+        "y": -18
+      },
+      "anchor": "bottom"
+    },
+    {
+      "id": "snap-thread",
+      "type": "snap",
+      "params": {
+        "width": 6.0,
+        "depth": 0.75
+      },
+      "at": {
+        "x": 0,
+        "y": 25
+      },
+      "anchor": "bottom"
+    },
+    {
+      "id": "standoff-soc",
+      "type": "standoff",
+      "params": {
+        "od": 3.5,
+        "height": 3.0,
+        "holeD": 2.0
+      },
+      "at": {
+        "x": -12,
+        "y": 0
+      },
+      "anchor": "bottom"
+    }
+  ],
+  "electronics": [
+    {
+      "id": "sbc",
+      "name": "Raspberry Pi Compute Module 4",
+      "model": "CM4 2GB eMMC Lite",
+      "size": {
+        "l": 55.0,
+        "w": 40.0,
+        "t": 4.7
+      },
+      "iface": "PCIe / USB / DSI / CSI",
+      "power": "5V/2A",
+      "price": 285,
+      "qty": 1,
+      "assembly": "排针",
+      "mount": {
+        "z": 3.0,
+        "x": 0,
+        "y": 0
+      },
+      "top": 7.7,
+      "notes": "价格口径:2026 年深圳华强北小批行情区间中值(估算);采用拆板式安装,超过外径,需两端折叠柔性板转接"
+    },
+    {
+      "id": "lcd",
+      "name": "圆形 AMOLED 触摸屏",
+      "model": "1.39\" 454×454 MIPI 圆屏(国产屏厂)",
+      "size": {
+        "l": 44.0,
+        "w": 44.0,
+        "t": 2.2
+      },
+      "iface": "MIPI DSI / I2C 触控",
+      "power": "3.3V",
+      "price": 88,
+      "qty": 1,
+      "assembly": "排线 FPC",
+      "mount": {
+        "z": 11.2,
+        "x": 0,
+        "y": 0
+      },
+      "top": 13.6,
+      "notes": "价格口径:2026 年深圳华强北小批行情区间中值(估算)"
+    },
+    {
+      "id": "mic",
+      "name": "MEMS 麦克风 ×2",
+      "model": "Knowles SPH0645LM4H",
+      "size": {
+        "l": 3.5,
+        "w": 2.65,
+        "t": 0.9
+      },
+      "iface": "I2S",
+      "power": "1.8~3.3V",
+      "price": 2.2,
+      "qty": 2,
+      "assembly": "焊接",
+      "mount": {
+        "z": 0.5,
+        "x": -8,
+        "y": -10
+      },
+      "top": 1.4,
+      "notes": "价格口径:2026 年深圳华强北小批行情区间中值(估算)"
+    },
+    {
+      "id": "speaker",
+      "name": "微型扬声器",
+      "model": "1813 8Ω 1W 腔体喇叭",
+      "size": {
+        "l": 18.0,
+        "w": 13.0,
+        "t": 4.0
+      },
+      "iface": "I2S 功放",
+      "power": "3.3~5V",
+      "price": 8.5,
+      "qty": 1,
+      "assembly": "焊接",
+      "mount": {
+        "z": 1.0,
+        "x": 0,
+        "y": 18
+      },
+      "top": 5.0,
+      "notes": "价格口径:2026 年深圳华强北小批行情区间中值(估算)"
+    },
+    {
+      "id": "battery-mod",
+      "name": "电池 + 保护板",
+      "model": "3.7V 1200mAh 503450",
+      "size": {
+        "l": 50.0,
+        "w": 34.0,
+        "t": 6.0
+      },
+      "iface": "BMS 板",
+      "power": "3.7V",
+      "price": 11,
+      "qty": 1,
+      "assembly": "焊接",
+      "mount": {
+        "z": 1.6,
+        "x": 0,
+        "y": 0
+      },
+      "top": 7.6,
+      "notes": "价格口径:2026 年深圳华强北小批行情区间中值(估算)"
+    },
+    {
+      "id": "charge",
+      "name": "无线充电接收模块",
+      "model": "通用 Qi 5W 接收模组",
+      "size": {
+        "l": 25.0,
+        "w": 25.0,
+        "t": 1.0
+      },
+      "iface": "Qi / USB",
+      "power": "5V",
+      "price": 4.5,
+      "qty": 1,
+      "assembly": "排线 FPC",
+      "mount": {
+        "z": 0.3,
+        "x": 0,
+        "y": 0
+      },
+      "top": 1.3,
+      "notes": "价格口径:2026 年深圳华强北小批行情区间中值(估算)"
+    }
+  ],
+  "consumables": [
+    {
+      "id": "screw-m2",
+      "name": "M2×6 沉头螺丝",
+      "spec": "SUS304",
+      "qty": 4,
+      "unit": "颗",
+      "price": 0.12,
+      "notes": ""
+    },
+    {
+      "id": "o-ring",
+      "name": "螺纹密封 O 圈",
+      "spec": "FKM 1.8t Ø54",
+      "qty": 1,
+      "unit": "个",
+      "price": 0.35,
+      "notes": ""
+    },
+    {
+      "id": "tape",
+      "name": "屏盖板双面胶",
+      "spec": "3M 5915 0.3t",
+      "qty": 1,
+      "unit": "片",
+      "price": 0.6,
+      "notes": ""
+    },
+    {
+      "id": "foam",
+      "name": "导热 / 缓冲泡棉",
+      "spec": "0.5t",
+      "qty": 2,
+      "unit": "片",
+      "price": 0.1,
+      "notes": ""
+    },
+    {
+      "id": "glue",
+      "name": "螺纹胶",
+      "spec": "乐泰 243",
+      "qty": 0.1,
+      "unit": "g",
+      "price": 0.3,
+      "notes": ""
+    },
+    {
+      "id": "label",
+      "name": "型号标签",
+      "spec": "激光刻字(无贴纸)",
+      "qty": 1,
+      "unit": "0",
+      "price": 0,
+      "notes": "底盖激光刻字替代"
+    },
+    {
+      "id": "box",
+      "name": "彩盒",
+      "spec": "350g 白卡覆哑膜 + 磁吸礼盒 90×90×50",
+      "qty": 1,
+      "unit": "套",
+      "price": 4.5,
+      "notes": ""
+    },
+    {
+      "id": "manual",
+      "name": "说明书",
+      "spec": "128g 铜版纸 12P",
+      "qty": 1,
+      "unit": "份",
+      "price": 0.8,
+      "notes": ""
+    },
+    {
+      "id": "cable",
+      "name": "Type-C 线",
+      "spec": "1m 编织线",
+      "qty": 1,
+      "unit": "条",
+      "price": 2.5,
+      "notes": ""
+    },
+    {
+      "id": "charger",
+      "name": "15W 无线充底座(选配)",
+      "spec": "ABS + 硅胶",
+      "qty": 0.5,
+      "unit": "个",
+      "price": 8.0,
+      "notes": "约一半出货随附"
+    }
+  ],
+  "bom": {
+    "currency": "CNY",
+    "bomCurrency": "CNY",
+    "rows": [
+      {
+        "seq": 1,
+        "name": "铝一体机身",
+        "spec": "6061-T6 棒料 Ø64×16,五轴车铣",
+        "supplier": "CNC 加工厂(深圳宝安)",
+        "price": 58.0,
+        "qty": 1,
+        "subtotal": 58.0,
+        "group": "结构件",
+        "notes": "含黄铜螺母热熔"
+      },
+      {
+        "seq": 2,
+        "name": "底盖",
+        "spec": "6061-T6 铝,M61.6×0.75 螺纹",
+        "supplier": "CNC 加工厂",
+        "price": 9.0,
+        "qty": 1,
+        "subtotal": 9.0,
+        "group": "结构件"
+      },
+      {
+        "seq": 3,
+        "name": "前圈高光倒角加工",
+        "spec": "钻石刀车削 0.5×45°",
+        "supplier": "CNC 加工厂",
+        "price": 3.0,
+        "qty": 1,
+        "subtotal": 3.0,
+        "group": "加工件"
+      },
+      {
+        "seq": 4,
+        "name": "电源滚轮键",
+        "spec": "6061 铝 CNC + 阳极",
+        "supplier": "CNC 加工厂",
+        "price": 1.6,
+        "qty": 1,
+        "subtotal": 1.6,
+        "group": "结构件"
+      },
+      {
+        "seq": 5,
+        "name": "静音键",
+        "spec": "POM 注塑",
+        "supplier": "注塑厂",
+        "price": 0.05,
+        "qty": 1,
+        "subtotal": 0.05,
+        "group": "结构件"
+      },
+      {
+        "seq": 6,
+        "name": "T 型皮垫挂环",
+        "spec": "SUS304 + 有机硅皮",
+        "supplier": "五金皮革厂",
+        "price": 2.5,
+        "qty": 1,
+        "subtotal": 2.5,
+        "group": "结构件"
+      },
+      {
+        "seq": 7,
+        "name": "1.39\" 圆形 AMOLED 触摸屏",
+        "spec": "454×454 MIPI + 盖板贴合",
+        "supplier": "屏厂(深圳/惠州)",
+        "price": 88.0,
+        "qty": 1,
+        "subtotal": 88.0,
+        "group": "电子件",
+        "notes": "价格口径:2026 年深圳华强北小批行情区间中值(估算)"
+      },
+      {
+        "seq": 8,
+        "name": "Raspberry Pi CM4(2GB eMMC)",
+        "spec": "BCM2711 四核",
+        "supplier": "半导体渠道商 / 立创商城",
+        "price": 285.0,
+        "qty": 1,
+        "subtotal": 285.0,
+        "group": "电子件",
+        "notes": "价格口径:2026 年深圳华强北小批行情区间中值(估算)(2026 年 2GB 款常缺货溢价)"
+      },
+      {
+        "seq": 9,
+        "name": "PCBA 主板(含 2×SPH0645 / 1813 喇叭 / Qi 接收)",
+        "spec": "六层 HDI + BMS + 功放",
+        "supplier": "PCBA 厂(深圳宝安)",
+        "price": 22.0,
+        "qty": 1,
+        "subtotal": 22.0,
+        "group": "电子件",
+        "notes": "含 SMT 加工费"
+      },
+      {
+        "seq": 10,
+        "name": "聚合物锂电 1200mAh",
+        "spec": "503450 带保护板",
+        "supplier": "电池厂",
+        "price": 11.0,
+        "qty": 1,
+        "subtotal": 11.0,
+        "group": "电子件",
+        "notes": "价格口径:2026 年深圳华强北小批行情区间中值(估算)"
+      },
+      {
+        "seq": 11,
+        "name": "无线充电接收模组",
+        "spec": "Qi 5W",
+        "supplier": "华强北现货商",
+        "price": 4.5,
+        "qty": 1,
+        "subtotal": 4.5,
+        "group": "电子件",
+        "notes": "价格口径:2026 年深圳华强北小批行情区间中值(估算)"
+      },
+      {
+        "seq": 12,
+        "name": "M2×6 沉头螺丝",
+        "spec": "SUS304",
+        "supplier": "紧固件供应商",
+        "price": 0.12,
+        "qty": 4,
+        "subtotal": 0.48,
+        "group": "辅料"
+      },
+      {
+        "seq": 13,
+        "name": "螺纹密封 O 圈",
+        "spec": "FKM 1.8t",
+        "supplier": "辅料商",
+        "price": 0.35,
+        "qty": 1,
+        "subtotal": 0.35,
+        "group": "辅料"
+      },
+      {
+        "seq": 14,
+        "name": "屏盖板双面胶",
+        "spec": "3M 5915",
+        "supplier": "辅料商",
+        "price": 0.6,
+        "qty": 1,
+        "subtotal": 0.6,
+        "group": "辅料"
+      },
+      {
+        "seq": 15,
+        "name": "导热/缓冲泡棉",
+        "spec": "0.5t",
+        "supplier": "辅料商",
+        "price": 0.1,
+        "qty": 2,
+        "subtotal": 0.2,
+        "group": "辅料"
+      },
+      {
+        "seq": 16,
+        "name": "螺纹胶",
+        "spec": "乐泰 243",
+        "supplier": "辅料商",
+        "price": 0.3,
+        "qty": 0.1,
+        "subtotal": 0.03,
+        "group": "辅料"
+      },
+      {
+        "seq": 17,
+        "name": "彩盒",
+        "spec": "磁吸礼盒 90×90×50",
+        "supplier": "包装厂",
+        "price": 4.5,
+        "qty": 1,
+        "subtotal": 4.5,
+        "group": "包材"
+      },
+      {
+        "seq": 18,
+        "name": "说明书",
+        "spec": "128g 铜版纸 12P",
+        "supplier": "印刷厂",
+        "price": 0.8,
+        "qty": 1,
+        "subtotal": 0.8,
+        "group": "包材"
+      },
+      {
+        "seq": 19,
+        "name": "Type-C 线",
+        "spec": "1m 编织",
+        "supplier": "线材厂",
+        "price": 2.5,
+        "qty": 1,
+        "subtotal": 2.5,
+        "group": "包材"
+      },
+      {
+        "seq": 20,
+        "name": "15W 无线充底座(选配)",
+        "spec": "ABS + 硅胶",
+        "supplier": "配件厂",
+        "price": 8.0,
+        "qty": 0.5,
+        "subtotal": 4.0,
+        "group": "包材",
+        "notes": "约 50% 订单随附"
+      }
+    ],
+    "bomTotal": 498.11,
+    "groupTotals": {
+      "结构件": 71.15,
+      "加工件": 3.0,
+      "电子件": 410.5,
+      "辅料": 1.66,
+      "包材": 11.8
+    },
+    "notes": "供应商类型为行业类别;单价取 2026 年深圳宝安 CNC 小批(3,000 台)与华强北渠道行情中值,非正式报价。CM4 为公开零售级别单价,批量采购可能低于此值。"
+  },
+  "processes": [
+    {
+      "id": "cnc",
+      "name": "铝机身五轴 CNC",
+      "mouldFee": 0,
+      "mouldLife": "刀具寿命(每把 8,000 件)",
+      "moq": 200,
+      "tiers": [
+        {
+          "qty": 200,
+          "price": 62.0
+        },
+        {
+          "qty": 3000,
+          "price": 58.0
+        },
+        {
+          "qty": 10000,
+          "price": 52.0
+        }
+      ],
+      "sampleDays": "5~7 天",
+      "bulkDays": "15~20 天",
+      "risk": "1.6mm 薄壁让刀与震纹;阳极色差",
+      "equipment": "Brother 五轴车铣复合 + 兄弟 M140 铣床 ×4",
+      "cycle": "单件 白车 18min + 精车 9min",
+      "yield": 0.95,
+      "price": 58.0,
+      "desc": "Ø64 6061-T6 棒料,粗车留 0.5mm,精车 Ra0.8,内腔分 3 次进刀;外壁预留 1° 造型锥度,底边 C0.5"
+    },
+    {
+      "id": "anodize",
+      "name": "喷砂 + 阳极氧化",
+      "mouldFee": 200,
+      "mouldLife": "不限",
+      "moq": 200,
+      "tiers": [
+        {
+          "qty": 200,
+          "price": 9.0
+        },
+        {
+          "qty": 3000,
+          "price": 7.0
+        },
+        {
+          "qty": 10000,
+          "price": 6.0
+        }
+      ],
+      "sampleDays": "4 天",
+      "bulkDays": "7 天",
+      "risk": "薄壁色差、烧焦;膜厚不均 ΔE>1",
+      "equipment": "自动挂具阳极线 + 喷砂房",
+      "cycle": "上挂 8 件/挂,节拍 120s",
+      "yield": 0.95,
+      "price": 7.0,
+      "desc": "120 目玻璃砂喷砂,脱脂 → 碱蚀 → 阳极 15µm(深空灰)→ 封闭 → 烘干;前圈钻石刀高光后再做局部遮蔽阳极"
+    },
+    {
+      "id": "smt",
+      "name": "主板 SMT 贴片",
+      "mouldFee": 1500,
+      "mouldLife": "(SMT 钢网)",
+      "moq": 500,
+      "tiers": [
+        {
+          "qty": 500,
+          "price": 26.0
+        },
+        {
+          "qty": 3000,
+          "price": 22.0
+        },
+        {
+          "qty": 10000,
+          "price": 19.0
+        }
+      ],
+      "sampleDays": "10 天",
+      "bulkDays": "15 天",
+      "risk": "CM4 接口变形;BMS 过流保护误动作",
+      "equipment": "松下 NPM-D3 + 回流焊",
+      "cycle": "节拍 25s/块",
+      "yield": 0.98,
+      "price": 22.0,
+      "desc": "六层 HDI 板,CM4 以排针 + 柔性板安装,SMT 后 100% CM4 上电自检"
+    },
+    {
+      "id": "lcd-lam",
+      "name": "屏盖板贴合",
+      "mouldFee": 800,
+      "mouldLife": "(贴合治具)",
+      "moq": 500,
+      "tiers": [
+        {
+          "qty": 500,
+          "price": 6.0
+        },
+        {
+          "qty": 3000,
+          "price": 4.5
+        },
+        {
+          "qty": 10000,
+          "price": 3.8
+        }
+      ],
+      "sampleDays": "5 天",
+      "bulkDays": "10 天",
+      "risk": "圆形屏与盖板偏心;气泡",
+      "equipment": "真空贴合机 + 加压脱泡炉",
+      "cycle": "60s/件",
+      "yield": 0.96,
+      "price": 4.5,
+      "desc": "2.5D 盖板与 AMOLED 真空贴合 OCA,脱泡 50℃/30min,偏心 ≤0.05mm"
+    },
+    {
+      "id": "assemble",
+      "name": "整机组装",
+      "mouldFee": 0,
+      "mouldLife": "不限",
+      "moq": 200,
+      "tiers": [
+        {
+          "qty": 200,
+          "price": 9.0
+        },
+        {
+          "qty": 3000,
+          "price": 7.0
+        },
+        {
+          "qty": 10000,
+          "price": 6.0
+        }
+      ],
+      "sampleDays": "/",
+      "bulkDays": "/",
+      "risk": "CM4 柔性板折伤;O 圈扭曲漏水",
+      "equipment": "防静电流水线 3 工位",
+      "cycle": "150s/台/人",
+      "yield": 0.98,
+      "price": 7.0,
+      "desc": "热熔铜螺母 → 装电池与主板 → 接柔板 → 贴合屏 → 装 O 圈旋底盖(扭矩 0.25N·m)"
+    },
+    {
+      "id": "test",
+      "name": "功能与老化检测",
+      "mouldFee": 1000,
+      "mouldLife": "(测试治具)",
+      "moq": 200,
+      "tiers": [
+        {
+          "qty": 200,
+          "price": 3.5
+        },
+        {
+          "qty": 3000,
+          "price": 2.5
+        },
+        {
+          "qty": 10000,
+          "price": 2.0
+        }
+      ],
+      "sampleDays": "/",
+      "bulkDays": "/",
+      "risk": "扬声器破音、麦克风串扰",
+      "equipment": "CM4 自检治具 + 声学房 + 72h 老化架",
+      "cycle": "90s/台",
+      "yield": 0.98,
+      "price": 2.5,
+      "desc": "100% 屏幕触控、发声与双麦阵列测试;4% 抽样老化"
+    },
+    {
+      "id": "pack",
+      "name": "彩盒包装",
+      "mouldFee": 0,
+      "mouldLife": "不限",
+      "moq": 200,
+      "tiers": [
+        {
+          "qty": 200,
+          "price": 2.5
+        },
+        {
+          "qty": 3000,
+          "price": 2.0
+        },
+        {
+          "qty": 10000,
+          "price": 1.8
+        }
+      ],
+      "sampleDays": "3 天",
+      "bulkDays": "5 天",
+      "risk": "磁吸礼盒压痕",
+      "equipment": "手工装盒台 + 封口机",
+      "cycle": "45s/台",
+      "yield": 0.995,
+      "price": 2.0,
+      "desc": "装屏贴膜 → 配件 → 磁吸礼盒 → 贴封条 → 外箱 40 台/箱"
+    }
+  ],
+  "moq": {
+    "baseQty": 3000,
+    "currency": "CNY",
+    "tiers": [
+      {
+        "qty": 200,
+        "unitPrice": 1249,
+        "mouldAmort": 16.5,
+        "bulkPrice": 1232.5,
+        "total": 249800,
+        "notes": "模具/治具费 3,300 一次性支付并按 200 台摊 16.5 元;小批 CNC 与 SMT 单价取上限"
+      },
+      {
+        "qty": 3000,
+        "unitPrice": 1099,
+        "mouldAmort": 1.1,
+        "bulkPrice": 1097.9,
+        "total": 3297000,
+        "notes": "基准档,单套综合成本约 531.01 元"
+      },
+      {
+        "qty": 10000,
+        "unitPrice": 999,
+        "mouldAmort": 0.33,
+        "bulkPrice": 998.67,
+        "total": 9990000,
+        "notes": "CNC 与 SMT 单价下降,CM4 按渠道批量价可再降 8%"
+      }
+    ],
+    "notes": "CM4 按 2026 年 2GB 款公开零售级别单价计入;若改用国产 RK3566 类核心板可降约 150 元,但生态成熟度下降。unitPrice 为含模具分摊建议零售阶梯。"
+  },
+  "processParams": {
+    "injection": {
+      "wall": 1.6,
+      "draft": 1.0,
+      "ribRatio": 0.55,
+      "depthRatio": 3.0,
+      "gate": "侧浇口"
+    },
+    "silicone": {
+      "shoreA": 50,
+      "wall": 1.5,
+      "partingLine": "赤道线"
+    },
+    "cnc": {
+      "ballR": 1.0,
+      "topCrownR": 0.8,
+      "recessR": 0.5,
+      "chamferC": 0.5,
+      "thread": "M61.6×0.75",
+      "tol": "±0.05"
+    },
+    "vacuum": {
+      "mouldLife": 30,
+      "minR": 0.8
+    }
+  },
+  "cost": {
+    "items": [
+      {
+        "name": "物料",
+        "amount": 498.11,
+        "basis": "BOM 合计"
+      },
+      {
+        "name": "加工",
+        "amount": 14.5,
+        "basis": "阳极氧化 7.0 + 前圈钻石刀高光倒角 3.0 + 屏盖板真空贴合 4.5(CNC 车铣 58 已整项计入 BOM,不重复计)"
+      },
+      {
+        "name": "模具摊销",
+        "amount": 1.1,
+        "basis": "模具/治具费合计 3,300 ÷ 3,000 台"
+      },
+      {
+        "name": "组装",
+        "amount": 7.0,
+        "basis": "整机组装"
+      },
+      {
+        "name": "测试",
+        "amount": 2.5,
+        "basis": "功能与老化测试"
+      },
+      {
+        "name": "包材",
+        "amount": 7.8,
+        "basis": "彩盒工序 2.0 + 包材(彩盒/说明书/线/选配无线充,约 50% 随附)"
+      },
+      {
+        "name": "损耗",
+        "amount": 0.0,
+        "basis": "自动计算 3%"
+      }
+    ],
+    "material": 498.11,
+    "mouldTotal": [
+      200,
+      1500,
+      800,
+      1000
+    ],
+    "baseQty": 3000,
+    "mouldAmortization": 1.1,
+    "unitCost": 531.01,
+    "suggestedPrice": 1099,
+    "grossMarginPct": 51.68,
+    "markup": 2.07,
+    "retailLow": 999,
+    "retailHigh": 1299,
+    "tooling": 3500,
+    "packagingPerSet": 7.8,
+    "formula": "物料 + 加工 + 模具摊销(模具费总和/基准批量) + 组装 + 测试 + 包材 + 损耗 = 单台成本;毛利率 =(建议售价-单台成本)/建议售价"
+  },
+  "detail": {
+    "title": "桌面上的一只圆眼",
+    "subtitle": "铝一体机身 · 454×454 圆屏 · 本地 AI",
+    "specs": [
+      {
+        "k": "直径",
+        "v": "Ø61.6 mm"
+      },
+      {
+        "k": "厚度",
+        "v": "14.6 mm"
+      },
+      {
+        "k": "重量",
+        "v": "约 58 g"
+      },
+      {
+        "k": "材质",
+        "v": "6061-T6 阳极铝"
+      }
+    ],
+    "sections": [
+      {
+        "title": "设计",
+        "body": "圆是这只设备的全部语言:圆屏、圆机身、圆底盖。屏幕只占 Ø45.7mm,四周留出约 6mm 沉台肩部与 0.8mm 凸圆,从侧面看是一片浮起来的暗色镜面,让 AI 的回应像从一枚透镜透出来。"
+      },
+      {
+        "title": "结构",
+        "body": "机身与底盖以 M61.6×0.75 细牙螺纹旋合,中间夹 FKM O 圈;内部电池贴底、主板悬在电池上方,CM4 用两端柔性板转接藏在直径跑不过去的边角里。"
+      },
+      {
+        "title": "工艺",
+        "body": "整块 6061-T6 棒料五轴车铣,薄壁 1.6mm,精车 Ra0.8;120 目喷砂后阳极 15µm,前圈钻石刀车 R0.8 凸圆后做遮蔽阳极,机身边缘收成一道圆润亮脊。"
+      },
+      {
+        "title": "规格",
+        "body": "Ø61.6×14.6mm,整机约 58g;1.39 英寸 454×454 AMOLED;双麦阵列 + 1W 喇叭;1200mAh 可连续对话约 6 小时,Qi 无线充。"
+      },
+      {
+        "title": "价格档",
+        "body": "成本大头是圆屏与计算模组,单套综合成本约 531 元;3,000 台基准档建议零售 1,099 元,毛利率约 52%。"
+      }
+    ]
+  },
+  "dimensions": {
+    "length": 61.6,
+    "width": 61.6,
+    "height": 14.6
+  },
+  "weight": 58.5,
+  "priceBasis": "2026 年深圳宝安 CNC 小批(3,000 台)与华强北渠道价行情中值,估算;非供应商正式报价"
+}

+ 1200 - 0
site/data/products/smart-ring.json

@@ -0,0 +1,1200 @@
+{
+  "id": "smart-ring",
+  "name": "智能健康戒指 + 充电舱",
+  "latin": "Smart Ring & Dock",
+  "tagline": "7.9g 钛环,睡一晚就懂你",
+  "category": "健康穿戴",
+  "craftTags": [
+    "钛外圈",
+    "树脂内衬",
+    "磁吸充电舱"
+  ],
+  "accent": "#B2BEC3",
+  "summary": "一枚只有 2.6mm 厚的钛圈,内衬医用级树脂把 PPG 心率血氧传感器、加速度计与电池全包进去,戴上几乎无感。睡觉时测血氧、心率变异与体表温度,起床后手机上看完整睡眠曲线;配套磁吸充电舱随身带着,放进去就能充。",
+  "author": "FmodeCode",
+  "shape": {
+    "type": "rect",
+    "defaults": {
+      "dTop": 21.6,
+      "dBottom": 21.6,
+      "height": 7.6,
+      "wall": 1.4,
+      "domeR": 0.5,
+      "platform": 0.3,
+      "recessR": 0.3,
+      "recessDepth": 0.5,
+      "screenD": 12.0,
+      "chamferC": 0.3,
+      "draft": 0.5,
+      "split": 0.5,
+      "cornerR": 6.0,
+      "length": 6.4,
+      "screenH": 4.0,
+      "capR": 2.0,
+      "bandD": 17.8,
+      "ringD": 19.2,
+      "ringBandW": 7.6
+    }
+  },
+  "materials": [
+    "ti",
+    "ceramic",
+    "sil-silicone"
+  ],
+  "parts": [
+    {
+      "id": "ti-outer",
+      "name": "钛外圈",
+      "role": "shell",
+      "material": "Ti-6Al-4V 钛合金",
+      "craft": "CNC 车削 + 拉丝",
+      "color": "#8E949C",
+      "weight": 2.8,
+      "split": 1,
+      "tolerance": "±0.03",
+      "notes": "3mm 宽 × 0.8mm 钛壳,CNC 车削后拉丝;可激光刻字"
+    },
+    {
+      "id": "resin-inner",
+      "name": "树脂内衬",
+      "role": "back",
+      "material": "医用级环氧树脂",
+      "craft": "模压 + 抛光",
+      "color": "#1E2024",
+      "weight": 1.6,
+      "split": 0,
+      "tolerance": "±0.05",
+      "notes": "传感器透窗在内侧 12 点方向"
+    },
+    {
+      "id": "fill-window",
+      "name": "内衬透窗",
+      "role": "screen",
+      "material": "蓝宝石 + 环氧",
+      "craft": "粘接",
+      "color": "#101114",
+      "weight": 0.1,
+      "split": 1,
+      "transparent": 0.7,
+      "tolerance": "±0.02"
+    },
+    {
+      "id": "sensor-window",
+      "name": "传感器透窗",
+      "role": "screen",
+      "material": "蓝宝石 + 环氧",
+      "craft": "粘接",
+      "color": "#101114",
+      "weight": 0.2,
+      "split": 1,
+      "transparent": 0.7,
+      "tolerance": "±0.02",
+      "notes": "PPG 绿光/红光透过率 ≥92%"
+    },
+    {
+      "id": "button",
+      "name": "触控电极(隐形)",
+      "role": "button",
+      "material": "不锈钢电极片",
+      "craft": "冲压",
+      "color": "#C9CBD0",
+      "weight": 0.1,
+      "split": 0.5,
+      "tolerance": "±0.05"
+    },
+    {
+      "id": "dock-shell",
+      "name": "充电舱上壳",
+      "role": "lid",
+      "material": "ABS",
+      "craft": "钢模注塑 + 喷油",
+      "color": "#F2F1EC",
+      "weight": 6.0,
+      "split": 0.9,
+      "tolerance": "±0.1",
+      "notes": "充电舱件,1 模 2 腔"
+    },
+    {
+      "id": "dock-bottom",
+      "name": "充电舱底壳",
+      "role": "lid",
+      "material": "ABS",
+      "craft": "钢模注塑",
+      "color": "#F2F1EC",
+      "weight": 5.0,
+      "split": 0.9,
+      "tolerance": "±0.1"
+    },
+    {
+      "id": "dock-lid",
+      "name": "充电舱盖",
+      "role": "lid",
+      "material": "PC 透明",
+      "craft": "注塑",
+      "color": "#D9DEE3",
+      "weight": 3.0,
+      "split": 1,
+      "transparent": 0.6,
+      "tolerance": "±0.1"
+    },
+    {
+      "id": "dock-ring",
+      "name": "挂绳扣",
+      "role": "ring",
+      "material": "SUS304",
+      "craft": "冲压",
+      "color": "#8C8F94",
+      "weight": 0.4,
+      "split": 0,
+      "tolerance": "±0.2"
+    },
+    {
+      "id": "dock-battery-pack",
+      "name": "充电舱电池组",
+      "role": "battery",
+      "material": "铝塑膜电芯",
+      "craft": "叠片封装",
+      "color": "#B3B8BF",
+      "weight": 2.0,
+      "split": 0,
+      "tolerance": "±0.3"
+    },
+    {
+      "id": "ring-pad",
+      "name": "戒指内衬垫",
+      "role": "pcb",
+      "material": "环氧",
+      "craft": "模压",
+      "color": "#1E2024",
+      "weight": 0.2,
+      "split": 0,
+      "tolerance": "±0.1"
+    },
+    {
+      "id": "dock-button",
+      "name": "充电舱按键",
+      "role": "button",
+      "material": "ABS",
+      "craft": "注塑",
+      "color": "#B2BEC3",
+      "weight": 0.1,
+      "split": 0.8,
+      "tolerance": "±0.1"
+    },
+    {
+      "id": "battery",
+      "name": "弯曲锂电",
+      "role": "battery",
+      "material": "柔性薄膜锂电",
+      "craft": "叠片封装",
+      "color": "#B3B8BF",
+      "weight": 1.0,
+      "split": 0,
+      "tolerance": "±0.1"
+    },
+    {
+      "id": "pcb",
+      "name": "刚柔主板",
+      "role": "pcb",
+      "material": "4 层刚柔板",
+      "craft": "SMT",
+      "color": "#1B6B3A",
+      "weight": 0.4,
+      "split": 1,
+      "tolerance": "±0.05"
+    },
+    {
+      "id": "dock-battery",
+      "name": "充电舱锂电",
+      "role": "battery",
+      "material": "铝塑膜电芯",
+      "craft": "叠片封装",
+      "color": "#B3B8BF",
+      "weight": 2.0,
+      "split": 0,
+      "tolerance": "±0.2"
+    }
+  ],
+  "features": [
+    {
+      "id": "pillar",
+      "type": "screw-pillar",
+      "params": {
+        "thread": "M1.2",
+        "od": 2.4,
+        "holeD": 1.0
+      },
+      "at": {
+        "x": 0,
+        "y": -9
+      },
+      "anchor": "bottom"
+    },
+    {
+      "id": "rib-arc",
+      "type": "rib",
+      "params": {
+        "thickness": 0.4,
+        "height": 1.5,
+        "count": 6
+      },
+      "at": {
+        "x": 0,
+        "y": 0
+      },
+      "anchor": "bottom"
+    },
+    {
+      "id": "snap",
+      "type": "snap",
+      "params": {
+        "width": 1.2,
+        "depth": 0.3
+      },
+      "at": {
+        "x": 0,
+        "y": 9
+      },
+      "anchor": "bottom"
+    },
+    {
+      "id": "boss-sensor",
+      "type": "boss",
+      "params": {
+        "od": 3.0,
+        "holeD": 2.0,
+        "height": 0.4
+      },
+      "at": {
+        "x": 0,
+        "y": -9
+      },
+      "anchor": "bottom"
+    },
+    {
+      "id": "standoff",
+      "type": "standoff",
+      "params": {
+        "od": 2.0,
+        "height": 0.3,
+        "holeD": 1.0
+      },
+      "at": {
+        "x": 0,
+        "y": -9
+      },
+      "anchor": "bottom"
+    },
+    {
+      "id": "pocket-resin",
+      "type": "pocket",
+      "params": {
+        "l": 3.0,
+        "w": 8.0,
+        "depth": 0.8
+      },
+      "at": {
+        "x": 0,
+        "y": 8
+      },
+      "anchor": "bottom"
+    }
+  ],
+  "electronics": [
+    {
+      "id": "ppg",
+      "name": "PPG 心率血氧模组",
+      "model": "MAX30102 红光/红外模组",
+      "size": {
+        "l": 5.6,
+        "w": 3.3,
+        "t": 1.55
+      },
+      "iface": "I2C",
+      "power": "1.8V",
+      "price": 7.5,
+      "qty": 1,
+      "assembly": "焊接",
+      "mount": {
+        "z": 0.3,
+        "x": 0,
+        "y": -8
+      },
+      "top": 1.85,
+      "notes": "价格口径:2026 年深圳华强北小批行情区间中值(估算)"
+    },
+    {
+      "id": "soc",
+      "name": "蓝牙 SoC 模组",
+      "model": "Nordic nRF52840 模组(E73-2G4M08S1C)",
+      "size": {
+        "l": 13.0,
+        "w": 18.0,
+        "t": 1.0
+      },
+      "iface": "SPI / I2C / USB",
+      "power": "3.0V",
+      "price": 36,
+      "qty": 1,
+      "assembly": "焊接",
+      "mount": {
+        "z": 0.2,
+        "x": 0,
+        "y": 0
+      },
+      "top": 1.2,
+      "notes": "价格口径:2026 年深圳华强北小批行情区间中值(估算);在戒指内需分两段弯折,超薄叠装"
+    },
+    {
+      "id": "imu",
+      "name": "加速度 + 温度传感器",
+      "model": "Bosch BMA400 + MAX30205",
+      "size": {
+        "l": 5.0,
+        "w": 5.0,
+        "t": 1.0
+      },
+      "iface": "I2C",
+      "power": "1.8V",
+      "price": 5.5,
+      "qty": 1,
+      "assembly": "焊接",
+      "mount": {
+        "z": 0.3,
+        "x": 0,
+        "y": 6
+      },
+      "top": 1.3,
+      "notes": "价格口径:2026 年深圳华强北小批行情区间中值(估算)"
+    },
+    {
+      "id": "battery-mod",
+      "name": "薄膜锂电 18mAh",
+      "model": "柔性锂电 0.45t",
+      "size": {
+        "l": 60.0,
+        "w": 4.0,
+        "t": 0.5
+      },
+      "iface": "BMS",
+      "power": "3.7V",
+      "price": 12,
+      "qty": 1,
+      "assembly": "焊接",
+      "mount": {
+        "z": 0.2,
+        "x": 0,
+        "y": 0
+      },
+      "top": 0.7,
+      "notes": "价格口径:2026 年深圳华强北小批行情区间中值(估算)"
+    },
+    {
+      "id": "dock-pcb",
+      "name": "充电舱 PCBA",
+      "model": "无线充发射 + 霍尔检测(定制板,通用元件)",
+      "size": {
+        "l": 30.0,
+        "w": 25.0,
+        "t": 1.0
+      },
+      "iface": "USB-C",
+      "power": "5V/0.3A",
+      "price": 9.5,
+      "qty": 1,
+      "assembly": "焊接",
+      "mount": {
+        "z": 2.0,
+        "x": 60,
+        "y": 0
+      },
+      "top": 3.0,
+      "notes": "价格口径:2026 年深圳华强北小批行情区间中值(估算)"
+    },
+    {
+      "id": "dock-bat",
+      "name": "充电舱锂电 300mAh",
+      "model": "3.7V 402030",
+      "size": {
+        "l": 30.0,
+        "w": 20.0,
+        "t": 4.0
+      },
+      "iface": "BMS",
+      "power": "3.7V",
+      "price": 4.5,
+      "qty": 1,
+      "assembly": "焊接",
+      "mount": {
+        "z": 1.5,
+        "x": 60,
+        "y": 0
+      },
+      "top": 5.5,
+      "notes": "价格口径:2026 年深圳华强北小批行情区间中值(估算)"
+    }
+  ],
+  "consumables": [
+    {
+      "id": "glue",
+      "name": "医用级 UV 胶",
+      "spec": "乐泰 3311",
+      "qty": 0.3,
+      "unit": "g",
+      "price": 1.0,
+      "notes": "树脂内衬与钛圈固化"
+    },
+    {
+      "id": "tape",
+      "name": "双面胶",
+      "spec": "3M 468 0.13t",
+      "qty": 3,
+      "unit": "片",
+      "price": 0.05,
+      "notes": ""
+    },
+    {
+      "id": "foam",
+      "name": "缓冲泡棉",
+      "spec": "1t EVA 泡棉",
+      "qty": 2,
+      "unit": "片",
+      "price": 0.04,
+      "notes": ""
+    },
+    {
+      "id": "screw",
+      "name": "M1.2×2 螺丝",
+      "spec": "SUS304",
+      "qty": 2,
+      "unit": "颗",
+      "price": 0.05,
+      "notes": ""
+    },
+    {
+      "id": "tape-ring",
+      "name": "戒指双面胶",
+      "spec": "3M 468",
+      "qty": 2,
+      "unit": "片",
+      "price": 0.05,
+      "notes": ""
+    },
+    {
+      "id": "o-ring",
+      "name": "充电舱密封圈",
+      "spec": "硅胶 0.6t",
+      "qty": 1,
+      "unit": "个",
+      "price": 0.08,
+      "notes": ""
+    },
+    {
+      "id": "label",
+      "name": "尺寸标签",
+      "spec": "PET 8 号/9 号",
+      "qty": 1,
+      "unit": "张",
+      "price": 0.02,
+      "notes": ""
+    },
+    {
+      "id": "box",
+      "name": "彩盒(礼盒)",
+      "spec": "350g 白卡 + 绒布内托 80×80×35",
+      "qty": 1,
+      "unit": "套",
+      "price": 5.0,
+      "notes": ""
+    },
+    {
+      "id": "cloths",
+      "name": "擦拭布",
+      "spec": "超纤 80×80",
+      "qty": 1,
+      "unit": "片",
+      "price": 0.25,
+      "notes": ""
+    },
+    {
+      "id": "manual",
+      "name": "说明书",
+      "spec": "128g 铜版纸 8P",
+      "qty": 1,
+      "unit": "份",
+      "price": 0.45,
+      "notes": ""
+    },
+    {
+      "id": "cable",
+      "name": "Type-C 线",
+      "spec": "0.3m",
+      "qty": 1,
+      "unit": "条",
+      "price": 1.8,
+      "notes": ""
+    }
+  ],
+  "bom": {
+    "currency": "CNY",
+    "bomCurrency": "CNY",
+    "rows": [
+      {
+        "seq": 1,
+        "name": "钛外圈",
+        "spec": "Ti-6Al-4V CNC 车削 + 拉丝",
+        "supplier": "CNC 加工厂(深圳/苏州)",
+        "price": 22.0,
+        "qty": 1,
+        "subtotal": 22.0,
+        "group": "结构件"
+      },
+      {
+        "seq": 2,
+        "name": "树脂内衬",
+        "spec": "医用级环氧模压 + 抛光",
+        "supplier": "精密注塑/模压厂",
+        "price": 2.6,
+        "qty": 1,
+        "subtotal": 2.6,
+        "group": "结构件"
+      },
+      {
+        "seq": 3,
+        "name": "传感器透窗",
+        "spec": "蓝宝石 + 环氧",
+        "supplier": "光学厂",
+        "price": 1.8,
+        "qty": 1,
+        "subtotal": 1.8,
+        "group": "结构件"
+      },
+      {
+        "seq": 4,
+        "name": "触控电极",
+        "spec": "SUS 冲压",
+        "supplier": "五金厂",
+        "price": 0.15,
+        "qty": 1,
+        "subtotal": 0.15,
+        "group": "结构件"
+      },
+      {
+        "seq": 5,
+        "name": "充电舱上壳",
+        "spec": "ABS 1 模 2 腔注塑 + 喷油",
+        "supplier": "注塑厂(东莞长安)",
+        "price": 1.2,
+        "qty": 1,
+        "subtotal": 1.2,
+        "group": "结构件"
+      },
+      {
+        "seq": 6,
+        "name": "充电舱底壳",
+        "spec": "ABS 注塑",
+        "supplier": "注塑厂",
+        "price": 0.9,
+        "qty": 1,
+        "subtotal": 0.9,
+        "group": "结构件"
+      },
+      {
+        "seq": 7,
+        "name": "充电舱透明盖",
+        "spec": "PC 注塑",
+        "supplier": "注塑厂",
+        "price": 0.8,
+        "qty": 1,
+        "subtotal": 0.8,
+        "group": "结构件"
+      },
+      {
+        "seq": 8,
+        "name": "充电舱挂绳扣 + 按键",
+        "spec": "SUS + ABS",
+        "supplier": "五金厂 + 注塑厂",
+        "price": 0.35,
+        "qty": 1,
+        "subtotal": 0.35,
+        "group": "结构件"
+      },
+      {
+        "seq": 9,
+        "name": "戒指 PCBA(nRF52840 模组 / MAX30102 / BMA400 / MAX30205)",
+        "spec": "4 层刚柔 HDI",
+        "supplier": "PCBA 厂(深圳宝安)",
+        "price": 56.0,
+        "qty": 1,
+        "subtotal": 56.0,
+        "group": "电子件",
+        "notes": "价格口径:2026 年深圳华强北小批行情区间中值(估算)(nRF52840 模组约 36,PPG 约 7.5,其余元件与 SMT 约 12.5)"
+      },
+      {
+        "seq": 10,
+        "name": "柔性薄膜锂电 18mAh",
+        "spec": "0.45t 弯折锂电",
+        "supplier": "电池厂",
+        "price": 12.0,
+        "qty": 1,
+        "subtotal": 12.0,
+        "group": "电子件",
+        "notes": "价格口径:2026 年深圳华强北小批行情区间中值(估算)"
+      },
+      {
+        "seq": 11,
+        "name": "充电舱 PCBA",
+        "spec": "无线充发射 + 霍尔",
+        "supplier": "PCBA 厂",
+        "price": 9.5,
+        "qty": 1,
+        "subtotal": 9.5,
+        "group": "电子件",
+        "notes": "价格口径:2026 年深圳华强北小批行情区间中值(估算)"
+      },
+      {
+        "seq": 12,
+        "name": "充电舱锂电 300mAh",
+        "spec": "402030",
+        "supplier": "电池厂",
+        "price": 4.5,
+        "qty": 1,
+        "subtotal": 4.5,
+        "group": "电子件",
+        "notes": "价格口径:2026 年深圳华强北小批行情区间中值(估算)"
+      },
+      {
+        "seq": 13,
+        "name": "医用级 UV 胶",
+        "spec": "乐泰 3311",
+        "supplier": "辅料商",
+        "price": 1.0,
+        "qty": 0.3,
+        "subtotal": 0.3,
+        "group": "辅料"
+      },
+      {
+        "seq": 14,
+        "name": "双面胶",
+        "spec": "3M 468",
+        "supplier": "辅料商",
+        "price": 0.05,
+        "qty": 3,
+        "subtotal": 0.15,
+        "group": "辅料"
+      },
+      {
+        "seq": 15,
+        "name": "M1.2×2 螺丝",
+        "spec": "SUS304",
+        "supplier": "紧固件供应商",
+        "price": 0.05,
+        "qty": 2,
+        "subtotal": 0.1,
+        "group": "辅料"
+      },
+      {
+        "seq": 16,
+        "name": "充电舱密封圈",
+        "spec": "硅胶",
+        "supplier": "辅料商",
+        "price": 0.08,
+        "qty": 1,
+        "subtotal": 0.08,
+        "group": "辅料"
+      },
+      {
+        "seq": 17,
+        "name": "尺寸标签",
+        "spec": "PET",
+        "supplier": "印刷厂",
+        "price": 0.02,
+        "qty": 1,
+        "subtotal": 0.02,
+        "group": "辅料"
+      },
+      {
+        "seq": 18,
+        "name": "礼盒 + 绒布内托",
+        "spec": "350g 白卡",
+        "supplier": "包装厂",
+        "price": 5.0,
+        "qty": 1,
+        "subtotal": 5.0,
+        "group": "包材"
+      },
+      {
+        "seq": 19,
+        "name": "擦拭布",
+        "spec": "超纤",
+        "supplier": "辅料商",
+        "price": 0.25,
+        "qty": 1,
+        "subtotal": 0.25,
+        "group": "包材"
+      },
+      {
+        "seq": 20,
+        "name": "说明书",
+        "spec": "128g 铜版纸 8P",
+        "supplier": "印刷厂",
+        "price": 0.45,
+        "qty": 1,
+        "subtotal": 0.45,
+        "group": "包材"
+      },
+      {
+        "seq": 21,
+        "name": "Type-C 线",
+        "spec": "0.3m",
+        "supplier": "线材厂",
+        "price": 1.8,
+        "qty": 1,
+        "subtotal": 1.8,
+        "group": "包材"
+      }
+    ],
+    "bomTotal": 119.95,
+    "groupTotals": {
+      "结构件": 29.8,
+      "电子件": 82.0,
+      "辅料": 0.65,
+      "包材": 7.5
+    },
+    "notes": "供应商类型为行业类别;单价取 2026 年深圳/苏州 CNC、东莞注塑与华强北 IC 渠道小批(3,000 套)行情中值,非正式报价。弯曲薄膜电池与 nRF52840 模组为戒指 BOM 主要成本项。"
+  },
+  "processes": [
+    {
+      "id": "polish",
+      "name": "外圈拉丝与抛光",
+      "mouldFee": 0,
+      "mouldLife": "不限",
+      "moq": 500,
+      "tiers": [
+        {
+          "qty": 500,
+          "price": 1.2
+        },
+        {
+          "qty": 3000,
+          "price": 0.9
+        },
+        {
+          "qty": 10000,
+          "price": 0.7
+        }
+      ],
+      "sampleDays": "3 天",
+      "bulkDays": "5 天",
+      "risk": "拉丝纹路不连续",
+      "equipment": "砂带拉丝机 + 抛光机",
+      "cycle": "20s/件",
+      "yield": 0.97,
+      "price": 0.9,
+      "desc": "钛外圈 #400 拉丝,环保抛光后超声波清洗,再激光刻字"
+    },
+    {
+      "id": "sandblast",
+      "name": "充电舱喷油 + 外圈拉丝",
+      "mouldFee": 300,
+      "mouldLife": "不限",
+      "moq": 500,
+      "tiers": [
+        {
+          "qty": 500,
+          "price": 1.5
+        },
+        {
+          "qty": 3000,
+          "price": 1.1
+        },
+        {
+          "qty": 10000,
+          "price": 0.9
+        }
+      ],
+      "sampleDays": "3 天",
+      "bulkDays": "5 天",
+      "risk": "喷油流挂",
+      "equipment": "喷涂柜 + 拉丝机",
+      "cycle": "30s/套",
+      "yield": 0.97,
+      "price": 1.1,
+      "desc": "充电舱 ABS 壳喷两遍白色哑光漆,钛外圈 #400 拉丝后抛光"
+    },
+    {
+      "id": "cnc",
+      "name": "钛外圈 CNC 车削",
+      "mouldFee": 1500,
+      "mouldLife": "刀具寿命(每把 5,000 件)",
+      "moq": 500,
+      "tiers": [
+        {
+          "qty": 500,
+          "price": 26.0
+        },
+        {
+          "qty": 3000,
+          "price": 22.0
+        },
+        {
+          "qty": 10000,
+          "price": 19.0
+        }
+      ],
+      "sampleDays": "5~7 天",
+      "bulkDays": "12~15 天",
+      "risk": "0.8mm 薄壁让刀;拉丝纹路不均",
+      "equipment": "走心机 + 拉丝机",
+      "cycle": "2.5min/件",
+      "yield": 0.95,
+      "price": 22.0,
+      "desc": "φ21.6 钛管料车削,圆度 ≤0.02,内壁 C0.3;外圈拉丝 #400"
+    },
+    {
+      "id": "resin",
+      "name": "树脂内衬模压",
+      "mouldFee": 1500,
+      "mouldLife": "(模压模具 10 万次)",
+      "moq": 500,
+      "tiers": [
+        {
+          "qty": 500,
+          "price": 4.2
+        },
+        {
+          "qty": 3000,
+          "price": 3.2
+        },
+        {
+          "qty": 10000,
+          "price": 2.6
+        }
+      ],
+      "sampleDays": "7~10 天",
+      "bulkDays": "12 天",
+      "risk": "环氧收缩导致电池位干涉",
+      "equipment": "热压机 + 精密模压模",
+      "cycle": "90s/件(1 模 4 腔)",
+      "yield": 0.94,
+      "price": 3.2,
+      "desc": "医用级环氧在 110℃ 热压 90s 固化,内衬壁厚 0.6mm"
+    },
+    {
+      "id": "curved-smt",
+      "name": "弯曲 PCBA 与柔性电池贴装",
+      "mouldFee": 2500,
+      "mouldLife": "(弯折治具)",
+      "moq": 500,
+      "tiers": [
+        {
+          "qty": 500,
+          "price": 6.5
+        },
+        {
+          "qty": 3000,
+          "price": 5.0
+        },
+        {
+          "qty": 10000,
+          "price": 4.2
+        }
+      ],
+      "sampleDays": "10~12 天",
+      "bulkDays": "15 天",
+      "risk": "弯折处 FPC 断裂;传感器偏心",
+      "equipment": "SMT 线 + 弯折治具 + 点胶机",
+      "cycle": "120s/件",
+      "yield": 0.92,
+      "price": 5.0,
+      "desc": "4 层刚柔板分两段弯折进戒指内,传感器用 UV 胶固定在内衬透窗下"
+    },
+    {
+      "id": "bond",
+      "name": "钛圈与内衬粘接",
+      "mouldFee": 300,
+      "mouldLife": "不限",
+      "moq": 500,
+      "tiers": [
+        {
+          "qty": 500,
+          "price": 2.0
+        },
+        {
+          "qty": 3000,
+          "price": 1.5
+        },
+        {
+          "qty": 10000,
+          "price": 1.2
+        }
+      ],
+      "sampleDays": "3 天",
+      "bulkDays": "5 天",
+      "risk": "UV 胶未固化导致 IP68 失效",
+      "equipment": "UV 固化台 + 拉力测试锤",
+      "cycle": "60s/件",
+      "yield": 0.97,
+      "price": 1.5,
+      "desc": "UV 胶一圈施胶,365nm 固化 20s,拉力 ≥15N"
+    },
+    {
+      "id": "dock",
+      "name": "充电舱注塑 + 装配",
+      "mouldFee": 2600,
+      "mouldLife": "30 万模次",
+      "moq": 500,
+      "tiers": [
+        {
+          "qty": 500,
+          "price": 5.5
+        },
+        {
+          "qty": 3000,
+          "price": 4.4
+        },
+        {
+          "qty": 10000,
+          "price": 3.8
+        }
+      ],
+      "sampleDays": "7~10 天",
+      "bulkDays": "10 天",
+      "risk": "磁吸对位偏差",
+      "equipment": "海天 90T 注塑机 + 装配治具",
+      "cycle": "装配 40s/套",
+      "yield": 0.97,
+      "price": 4.4,
+      "desc": "1 模 2 腔,缩水 0.5%,0.5° 拔模;装配时装入发射线圈与电池"
+    },
+    {
+      "id": "test",
+      "name": "功能检测",
+      "mouldFee": 1200,
+      "mouldLife": "(测试治具)",
+      "moq": 500,
+      "tiers": [
+        {
+          "qty": 500,
+          "price": 4.0
+        },
+        {
+          "qty": 3000,
+          "price": 3.0
+        },
+        {
+          "qty": 10000,
+          "price": 2.5
+        }
+      ],
+      "sampleDays": "/",
+      "bulkDays": "/",
+      "risk": "PPG 在不同肤色下信号差异",
+      "equipment": "LED 模拟指模治具 + 蓝牙测试",
+      "cycle": "光/声学 90s + 老化 10%",
+      "yield": 0.96,
+      "price": 3.0,
+      "desc": "100% 测 PPG 波形与蓝牙连接;抽 10% 做 24h 睡眠模拟记录"
+    },
+    {
+      "id": "pack",
+      "name": "礼盒包装",
+      "mouldFee": 0,
+      "mouldLife": "不限",
+      "moq": 500,
+      "tiers": [
+        {
+          "qty": 500,
+          "price": 1.6
+        },
+        {
+          "qty": 3000,
+          "price": 1.2
+        },
+        {
+          "qty": 10000,
+          "price": 1.0
+        }
+      ],
+      "sampleDays": "3 天",
+      "bulkDays": "4 天",
+      "risk": "绒布掉毛",
+      "equipment": "装盒台",
+      "cycle": "30s/套",
+      "yield": 0.995,
+      "price": 1.2,
+      "desc": "戒指入内托 → 充电舱 → 擦拭布、线、说明书 → 礼盒 → 外箱 50 套/箱"
+    }
+  ],
+  "moq": {
+    "baseQty": 3000,
+    "currency": "CNY",
+    "tiers": [
+      {
+        "qty": 500,
+        "unitPrice": 799,
+        "mouldAmort": 31.8,
+        "bulkPrice": 767.2,
+        "total": 399500,
+        "notes": "模具/治具费 15,900 一次性支付或按 500 套摊 31.8 元/套"
+      },
+      {
+        "qty": 3000,
+        "unitPrice": 659,
+        "mouldAmort": 5.3,
+        "bulkPrice": 653.7,
+        "total": 1977000,
+        "notes": "基准档,单套综合成本约 248.35 元"
+      },
+      {
+        "qty": 10000,
+        "unitPrice": 589,
+        "mouldAmort": 1.59,
+        "bulkPrice": 587.41,
+        "total": 5890000,
+        "notes": "钛圈与 PCBA 批量单价下降约 8%"
+      }
+    ],
+    "notes": "unitPrice 为含模具分摊建议零售阶梯;bulkPrice 为不含模具按套支付的货值单价(估算)。"
+  },
+  "processParams": {
+    "injection": {
+      "wall": 1.2,
+      "draft": 0.5,
+      "ribRatio": 0.5,
+      "depthRatio": 2.5,
+      "gate": "点浇口"
+    },
+    "silicone": {
+      "shoreA": 40,
+      "wall": 1.0,
+      "partingLine": "赤道线"
+    },
+    "cnc": {
+      "ballR": 1.0,
+      "topCrownR": 0.5,
+      "recessR": 0.3,
+      "chamferC": 0.3,
+      "thread": "—",
+      "tol": "±0.03"
+    },
+    "vacuum": {
+      "mouldLife": 30,
+      "minR": 0.3
+    }
+  },
+  "cost": {
+    "items": [
+      {
+        "name": "物料",
+        "amount": 119.95,
+        "basis": "BOM 合计(戒指 + 充电舱)"
+      },
+      {
+        "name": "加工",
+        "amount": 40.6,
+        "basis": "模压 3.2 + 弯曲贴装 5.0 + 钛圈内衬粘接 1.5 + 外圈拉丝抛光 0.9 + 喷油 1.1(CNC 22 已整项计入 BOM,不重复计)"
+      },
+      {
+        "name": "模具摊销",
+        "amount": 5.3,
+        "basis": "模具/治具费合计 15,900 ÷ 3,000 套"
+      },
+      {
+        "name": "组装",
+        "amount": 64.0,
+        "basis": "充电舱装配"
+      },
+      {
+        "name": "测试",
+        "amount": 11.0,
+        "basis": "功能测试"
+      },
+      {
+        "name": "包材",
+        "amount": 7.5,
+        "basis": "礼盒包装"
+      },
+      {
+        "name": "损耗",
+        "amount": 0.0,
+        "basis": "自动计算 3%"
+      }
+    ],
+    "material": 119.95,
+    "mouldTotal": [
+      1500,
+      2500,
+      300,
+      2600,
+      1200,
+      2500,
+      1500,
+      2000,
+      1500,
+      300
+    ],
+    "baseQty": 3000,
+    "mouldAmortization": 5.3,
+    "unitCost": 248.35,
+    "suggestedPrice": 659,
+    "grossMarginPct": 62.31,
+    "markup": 2.65,
+    "retailLow": 599,
+    "retailHigh": 699,
+    "tooling": 15900,
+    "packagingPerSet": 7.5,
+    "formula": "物料 + 加工 + 模具摊销(模具费总和/基准批量) + 组装 + 测试 + 包材 + 损耗 = 单台成本;毛利率 =(建议售价-单台成本)/建议售价"
+  },
+  "detail": {
+    "title": "一枚戒指,照顾你的夜",
+    "subtitle": "钛圈 2.6mm · 7.9g · 睡眠监测",
+    "specs": [
+      {
+        "k": "外径",
+        "v": "Ø21.6 mm"
+      },
+      {
+        "k": "宽度",
+        "v": "7.6 mm"
+      },
+      {
+        "k": "重量",
+        "v": "约 7.9 g"
+      },
+      {
+        "k": "材质",
+        "v": "钛合金外圈 + 树脂内衬"
+      }
+    ],
+    "sections": [
+      {
+        "title": "设计",
+        "body": "金属外圈负责好看,树脂内衬负责让传感器贴住手指:内衬在 12 点方向做出 0.6mm 的凸起,PPG 模组正好压在指背血管上。整枚只有 7.9g,睡着时不会硌手。"
+      },
+      {
+        "title": "结构",
+        "body": "刚柔板分两段弯折塞进 2.6mm 截面,nRF52840 模组压缩到 1mm 厚的模组内;18mAh 柔性电池沿内衬弧面铺开,充电舱用霍尔检测戒指入仓。"
+      },
+      {
+        "title": "工艺",
+        "body": "钛外圈走心机 2.5 分钟一件,圆度 0.02;内衬环氧 110℃ 热压;钛圈与内衬 UV 胶粘接后拉力测试 ≥15N;PPG 治具用 LED 模拟指逐枚测波形。"
+      },
+      {
+        "title": "规格",
+        "body": "Ø21.6×7.6mm,约 7.9g;心率 / 血氧 / 体温 / 步数;续航 5~7 天;充电舱带 300mAh 电量可再充 3 次;IP68。"
+      },
+      {
+        "title": "价格档",
+        "body": "钛圈、蓝牙模组与弯折电池占去 BOM 八成,单套综合成本约 248 元;3,000 套档建议零售 659 元,毛利率约 62%。"
+      }
+    ]
+  },
+  "dimensions": {
+    "length": 21.6,
+    "width": 21.6,
+    "height": 7.6
+  },
+  "weight": 10.4,
+  "priceBasis": "2026 年深圳/苏州 CNC、东莞注塑与华强北 IC 渠道小批(3,000 套)行情中值,估算;非供应商正式报价"
+}

+ 1076 - 0
site/data/products/watch-case.json

@@ -0,0 +1,1076 @@
+{
+  "id": "watch-case",
+  "name": "智能手表硅胶保护壳(恶魔犄角)",
+  "latin": "Devil Horn Case",
+  "tagline": "双色包胶,装上就长出犄角",
+  "category": "穿戴配件",
+  "craftTags": [
+    "双色硅胶",
+    "压缩模硫化",
+    "包胶"
+  ],
+  "accent": "#D63031",
+  "summary": "一枚为 Apple Watch 42/44mm 系列做的全包硅胶保护壳。黑色主体在表冠周边包出护翼,上下表耳外侧各长出一只红色小犄角,方便单手拉起;内侧 0.5mm PC 骨架片保证不跑位,背面开精准传感器透窗,不影响心率与血氧测量。",
+  "author": "FmodeCode",
+  "shape": {
+    "type": "watch",
+    "defaults": {
+      "dTop": 46.0,
+      "dBottom": 45.2,
+      "height": 13.2,
+      "wall": 2.0,
+      "domeR": 2.0,
+      "platform": 1.0,
+      "recessR": 1.0,
+      "recessDepth": 1.5,
+      "screenD": 34.0,
+      "chamferC": 0.5,
+      "draft": 1.5,
+      "split": 0.62,
+      "cornerR": 8.0,
+      "length": 54.0,
+      "screenH": 40.0,
+      "capR": 5.0,
+      "bandD": 17.8,
+      "ringD": 19.2,
+      "ringBandW": 6.5
+    }
+  },
+  "materials": [
+    "sil-silicone",
+    "abs-matte"
+  ],
+  "parts": [
+    {
+      "id": "band",
+      "name": "双色硅胶主壳",
+      "role": "shell",
+      "material": "硅胶 60A",
+      "craft": "压缩模硫化一体成型",
+      "color": "#2D2F33",
+      "weight": 7.2,
+      "split": 0.62,
+      "tolerance": "±0.1",
+      "notes": "1×2 腔钢模,分型线取赤道线;红色包边与黑色主体在同一模具内一次成型,分色面位于赤道线下方 1.2mm"
+    },
+    {
+      "id": "body-armor",
+      "name": "上下边框加厚层",
+      "role": "lid",
+      "material": "硅胶 60A",
+      "craft": "压缩模硫化",
+      "color": "#2D2F33",
+      "weight": 2.1,
+      "split": 0.88,
+      "tolerance": "±0.1"
+    },
+    {
+      "id": "horn-l",
+      "name": "左恶魔犄角",
+      "role": "ring",
+      "material": "硅胶 60A",
+      "craft": "模内与主壳一体",
+      "color": "#D63031",
+      "weight": 1.3,
+      "split": 1,
+      "tolerance": "±0.15"
+    },
+    {
+      "id": "horn-r",
+      "name": "右恶魔犄角",
+      "role": "ring",
+      "material": "硅胶 60A",
+      "craft": "模内与主壳一体",
+      "color": "#D63031",
+      "weight": 1.3,
+      "split": 1,
+      "tolerance": "±0.15"
+    },
+    {
+      "id": "band-lug-l",
+      "name": "上表耳",
+      "role": "button",
+      "material": "硅胶 60A",
+      "craft": "模内一体",
+      "color": "#2D2F33",
+      "weight": 0.9,
+      "split": 0.75,
+      "tolerance": "±0.15"
+    },
+    {
+      "id": "band-lug-r",
+      "name": "下表耳",
+      "role": "button",
+      "material": "硅胶 60A",
+      "craft": "模内一体",
+      "color": "#2D2F33",
+      "weight": 0.9,
+      "split": 0.75,
+      "tolerance": "±0.15"
+    },
+    {
+      "id": "crown-guard",
+      "name": "表冠护翼",
+      "role": "button",
+      "material": "硅胶 60A",
+      "craft": "模内一体",
+      "color": "#D63031",
+      "weight": 0.4,
+      "split": 0.6,
+      "tolerance": "±0.15"
+    },
+    {
+      "id": "sensor-window",
+      "name": "背面传感器透窗",
+      "role": "screen",
+      "material": "PC 透明",
+      "craft": "注塑 + 双面胶贴合",
+      "color": "#2D3436",
+      "weight": 0.3,
+      "split": 0,
+      "transparent": 0.6,
+      "tolerance": "±0.05"
+    },
+    {
+      "id": "trinket-screen",
+      "name": "表壳内侧标识片",
+      "role": "screen",
+      "material": "PET 哑银",
+      "craft": "丝印",
+      "color": "#8C8F94",
+      "weight": 0.1,
+      "split": 1,
+      "transparent": 0.9,
+      "tolerance": "±0.1"
+    },
+    {
+      "id": "magnet",
+      "name": "对位磁铁",
+      "role": "battery",
+      "material": "N42 钕铁硼",
+      "craft": "包胶",
+      "color": "#B3B8BF",
+      "weight": 0.4,
+      "split": 0,
+      "tolerance": "±0.1"
+    },
+    {
+      "id": "sheet",
+      "name": "内衬骨架片",
+      "role": "pcb",
+      "material": "PC 片材 0.5t",
+      "craft": "冲切",
+      "color": "#7F8C8D",
+      "weight": 0.8,
+      "split": 0,
+      "tolerance": "±0.1"
+    },
+    {
+      "id": "snap",
+      "name": "侧边卡扣",
+      "role": "clip",
+      "material": "硅胶 60A",
+      "craft": "模内一体",
+      "color": "#2D2F33",
+      "weight": 0.15,
+      "split": 0.5,
+      "tolerance": "±0.15"
+    },
+    {
+      "id": "case-back",
+      "name": "背面全包背板",
+      "role": "back",
+      "material": "硅胶 60A",
+      "craft": "模内一体",
+      "color": "#2D2F33",
+      "weight": 3.2,
+      "split": 0,
+      "tolerance": "±0.15"
+    },
+    {
+      "id": "thumbscrew",
+      "name": "表冠转接旋钮",
+      "role": "brass",
+      "material": "黄铜镀亮镍",
+      "craft": "车削 + 电镀",
+      "color": "#D6B25E",
+      "weight": 0.5,
+      "split": 0.6,
+      "tolerance": "±0.05"
+    },
+    {
+      "id": "nfc-chip-pad",
+      "name": "NFC 贴片承载位",
+      "role": "pcb",
+      "material": "PC 片材",
+      "craft": "冲切",
+      "color": "#2D2F33",
+      "weight": 0.2,
+      "split": 0,
+      "tolerance": "±0.1"
+    },
+    {
+      "id": "trinket",
+      "name": "随附硅胶饰片",
+      "role": "ring",
+      "material": "硅胶 60A",
+      "craft": "模压",
+      "color": "#D63031",
+      "weight": 0.3,
+      "split": 1,
+      "tolerance": "±0.2"
+    }
+  ],
+  "features": [
+    {
+      "id": "boss-l",
+      "type": "boss",
+      "params": {
+        "od": 2.4,
+        "holeD": 0,
+        "height": 1.2
+      },
+      "at": {
+        "x": -14,
+        "y": 0
+      },
+      "anchor": "bottom"
+    },
+    {
+      "id": "boss-r",
+      "type": "boss",
+      "params": {
+        "od": 2.4,
+        "holeD": 0,
+        "height": 1.2
+      },
+      "at": {
+        "x": 14,
+        "y": 0
+      },
+      "anchor": "bottom"
+    },
+    {
+      "id": "rib-screen",
+      "type": "rib",
+      "params": {
+        "thickness": 1.0,
+        "height": 2.0,
+        "count": 6
+      },
+      "at": {
+        "x": 0,
+        "y": 0
+      },
+      "anchor": "bottom"
+    },
+    {
+      "id": "snap-l",
+      "type": "snap",
+      "params": {
+        "width": 2.0,
+        "depth": 0.6
+      },
+      "at": {
+        "x": -22,
+        "y": 0
+      },
+      "anchor": "bottom"
+    },
+    {
+      "id": "snap-r",
+      "type": "snap",
+      "params": {
+        "width": 2.0,
+        "depth": 0.6
+      },
+      "at": {
+        "x": 22,
+        "y": 0
+      },
+      "anchor": "bottom"
+    },
+    {
+      "id": "pocket-mag",
+      "type": "pocket",
+      "params": {
+        "l": 8.0,
+        "w": 4.0,
+        "depth": 0.6
+      },
+      "at": {
+        "x": 0,
+        "y": 18
+      },
+      "anchor": "bottom"
+    },
+    {
+      "id": "standoff-window",
+      "type": "standoff",
+      "params": {
+        "od": 3.0,
+        "height": 0.8,
+        "holeD": 0
+      },
+      "at": {
+        "x": 0,
+        "y": -18
+      },
+      "anchor": "bottom"
+    }
+  ],
+  "electronics": [
+    {
+      "id": "watch-body",
+      "name": "被保护表体(参考件,不计入BOM)",
+      "model": "Apple Watch Series 11 42/44mm",
+      "size": {
+        "l": 46.0,
+        "w": 39.0,
+        "t": 10.7
+      },
+      "iface": "磁吸充电",
+      "power": "锂电内置",
+      "price": 0,
+      "qty": 0,
+      "assembly": "磁吸",
+      "mount": {
+        "z": 1.2,
+        "x": 0,
+        "y": 0
+      },
+      "top": 11.9,
+      "notes": "用户自有设备,仅用于装配校核"
+    },
+    {
+      "id": "magnet-pair",
+      "name": "表壳对位磁铁",
+      "model": "N42 φ4×1.0 圆片",
+      "size": {
+        "l": 4.0,
+        "w": 4.0,
+        "t": 1.0
+      },
+      "iface": "无(机械对位)",
+      "power": "—",
+      "price": 0.08,
+      "qty": 2,
+      "assembly": "磁吸",
+      "mount": {
+        "z": 4.0,
+        "x": 0,
+        "y": 18
+      },
+      "top": 5.0,
+      "notes": "价格口径:2026 年深圳/东莞小批行情区间中值(估算)"
+    },
+    {
+      "id": "sheet-pc",
+      "name": "内衬 PC 骨架片",
+      "model": "PC 0.5t 冲切件 Ø40",
+      "size": {
+        "l": 40.0,
+        "w": 36.0,
+        "t": 0.5
+      },
+      "iface": "无",
+      "power": "—",
+      "price": 0.15,
+      "qty": 1,
+      "assembly": "排线 FPC",
+      "mount": {
+        "z": 1.2,
+        "x": 0,
+        "y": 0
+      },
+      "top": 1.7,
+      "notes": "用高温双面胶贴合在硅胶内壁,维持形位"
+    },
+    {
+      "id": "window-pc",
+      "name": "传感器透窗",
+      "model": "PC 0.6t 透明片 Ø14",
+      "size": {
+        "l": 14.0,
+        "w": 14.0,
+        "t": 0.6
+      },
+      "iface": "光学透过",
+      "power": "—",
+      "price": 0.1,
+      "qty": 1,
+      "assembly": "磁吸",
+      "mount": {
+        "z": 0.2,
+        "x": 0,
+        "y": -18
+      },
+      "top": 0.8,
+      "notes": "价格口径:2026 年深圳/东莞小批行情区间中值(估算)"
+    },
+    {
+      "id": "sticker-nfc",
+      "name": "防伪 NFC 贴片",
+      "model": "NTAG213 圆片 Ø12",
+      "size": {
+        "l": 12.0,
+        "w": 12.0,
+        "t": 0.25
+      },
+      "iface": "NFC 13.56MHz",
+      "power": "无源",
+      "price": 0.3,
+      "qty": 1,
+      "assembly": "磁吸",
+      "mount": {
+        "z": 6.0,
+        "x": 0,
+        "y": -14
+      },
+      "top": 6.25,
+      "notes": "价格口径:2026 年深圳/东莞小批行情区间中值(估算)"
+    }
+  ],
+  "consumables": [
+    {
+      "id": "screw-kit",
+      "name": "螺丝包(备用装饰螺钉)",
+      "spec": "M1.2 镀金 ×2",
+      "qty": 2,
+      "unit": "颗",
+      "price": 0.05,
+      "notes": ""
+    },
+    {
+      "id": "tape",
+      "name": "高温双面胶",
+      "spec": "3M 468MP 0.13t",
+      "qty": 1,
+      "unit": "片",
+      "price": 0.1,
+      "notes": "骨架片与硅胶贴合"
+    },
+    {
+      "id": "tape-window",
+      "name": "透窗双面胶",
+      "spec": "0.05t 光学胶",
+      "qty": 1,
+      "unit": "片",
+      "price": 0.05,
+      "notes": ""
+    },
+    {
+      "id": "foam",
+      "name": "缓冲泡棉",
+      "spec": "1t EVA 泡棉",
+      "qty": 1,
+      "unit": "片",
+      "price": 0.03,
+      "notes": ""
+    },
+    {
+      "id": "label",
+      "name": "烫金尺寸标签",
+      "spec": "PET 金色 12×8",
+      "qty": 1,
+      "unit": "张",
+      "price": 0.02,
+      "notes": ""
+    },
+    {
+      "id": "box",
+      "name": "挂卡彩盒",
+      "spec": "350g 白卡 + PET 吸塑泡壳 90×150",
+      "qty": 1,
+      "unit": "套",
+      "price": 0.85,
+      "notes": ""
+    },
+    {
+      "id": "manual",
+      "name": "说明书(安装卡)",
+      "spec": "250g 卡纸 80×120",
+      "qty": 1,
+      "unit": "张",
+      "price": 0.08,
+      "notes": ""
+    },
+    {
+      "id": "sticker-set",
+      "name": "趣味贴纸",
+      "spec": "PVC 彩色 3 枚",
+      "qty": 1,
+      "unit": "套",
+      "price": 0.06,
+      "notes": ""
+    },
+    {
+      "id": "bag",
+      "name": "OPP 袋",
+      "spec": "90×150",
+      "qty": 1,
+      "unit": "个",
+      "price": 0.02,
+      "notes": ""
+    }
+  ],
+  "bom": {
+    "currency": "CNY",
+    "bomCurrency": "CNY",
+    "rows": [
+      {
+        "seq": 1,
+        "name": "双色硅胶主壳",
+        "spec": "60A 硅胶,1×2 钢模硫化,红黑双色",
+        "supplier": "硅胶制品厂(东莞黄江)",
+        "price": 2.2,
+        "qty": 1,
+        "subtotal": 2.2,
+        "group": "结构件",
+        "notes": "含犄角、表耳、护翼一体成型"
+      },
+      {
+        "seq": 2,
+        "name": "内衬 PC 骨架片",
+        "spec": "PC 0.5t 冲切 Ø40",
+        "supplier": "冲切加工厂",
+        "price": 0.15,
+        "qty": 1,
+        "subtotal": 0.15,
+        "group": "结构件"
+      },
+      {
+        "seq": 3,
+        "name": "传感器透窗",
+        "spec": "PC 0.6t 透明注塑 Ø14",
+        "supplier": "注塑厂",
+        "price": 0.1,
+        "qty": 1,
+        "subtotal": 0.1,
+        "group": "结构件"
+      },
+      {
+        "seq": 4,
+        "name": "对位磁铁",
+        "spec": "N42 φ4×1.0 镀镍",
+        "supplier": "磁材供应商",
+        "price": 0.08,
+        "qty": 2,
+        "subtotal": 0.16,
+        "group": "结构件"
+      },
+      {
+        "seq": 5,
+        "name": "内侧标识片",
+        "spec": "PET 哑银丝印",
+        "supplier": "印刷厂",
+        "price": 0.05,
+        "qty": 1,
+        "subtotal": 0.05,
+        "group": "结构件"
+      },
+      {
+        "seq": 6,
+        "name": "表冠转接旋钮",
+        "spec": "黄铜车削 + 镀亮镍",
+        "supplier": "五金厂",
+        "price": 0.45,
+        "qty": 1,
+        "subtotal": 0.45,
+        "group": "结构件"
+      },
+      {
+        "seq": 7,
+        "name": "随附硅胶饰片",
+        "spec": "硅胶 60A 模压",
+        "supplier": "硅胶厂",
+        "price": 0.1,
+        "qty": 2,
+        "subtotal": 0.2,
+        "group": "结构件"
+      },
+      {
+        "seq": 8,
+        "name": "防伪 NFC 贴片",
+        "spec": "NTAG213 圆片 Ø12",
+        "supplier": "华强北现货商",
+        "price": 0.3,
+        "qty": 1,
+        "subtotal": 0.3,
+        "group": "电子件",
+        "notes": "价格口径:2026 年深圳/东莞小批行情区间中值(估算)"
+      },
+      {
+        "seq": 9,
+        "name": "高温双面胶",
+        "spec": "3M 468MP 0.13t",
+        "supplier": "辅料商",
+        "price": 0.1,
+        "qty": 1,
+        "subtotal": 0.1,
+        "group": "辅料"
+      },
+      {
+        "seq": 10,
+        "name": "透窗双面胶",
+        "spec": "0.05t 光学胶 Ø14",
+        "supplier": "辅料商",
+        "price": 0.05,
+        "qty": 1,
+        "subtotal": 0.05,
+        "group": "辅料"
+      },
+      {
+        "seq": 11,
+        "name": "缓冲泡棉",
+        "spec": "1t EVA",
+        "supplier": "辅料商",
+        "price": 0.03,
+        "qty": 1,
+        "subtotal": 0.03,
+        "group": "辅料"
+      },
+      {
+        "seq": 12,
+        "name": "装饰螺钉 M1.2 ×2",
+        "spec": "镀金",
+        "supplier": "紧固件供应商",
+        "price": 0.05,
+        "qty": 2,
+        "subtotal": 0.1,
+        "group": "辅料"
+      },
+      {
+        "seq": 13,
+        "name": "烫金尺寸标签",
+        "spec": "PET 金色 12×8",
+        "supplier": "印刷厂",
+        "price": 0.02,
+        "qty": 1,
+        "subtotal": 0.02,
+        "group": "辅料"
+      },
+      {
+        "seq": 14,
+        "name": "挂卡彩盒",
+        "spec": "350g 白卡 + PET 吸塑泡壳",
+        "supplier": "包装厂",
+        "price": 0.85,
+        "qty": 1,
+        "subtotal": 0.85,
+        "group": "包材"
+      },
+      {
+        "seq": 15,
+        "name": "安装说明卡",
+        "spec": "250g 卡纸",
+        "supplier": "印刷厂",
+        "price": 0.08,
+        "qty": 1,
+        "subtotal": 0.08,
+        "group": "包材"
+      },
+      {
+        "seq": 16,
+        "name": "趣味贴纸",
+        "spec": "PVC 三枚装",
+        "supplier": "印刷厂",
+        "price": 0.06,
+        "qty": 1,
+        "subtotal": 0.06,
+        "group": "包材"
+      },
+      {
+        "seq": 17,
+        "name": "OPP 袋",
+        "spec": "90×150",
+        "supplier": "辅料商",
+        "price": 0.02,
+        "qty": 1,
+        "subtotal": 0.02,
+        "group": "包材"
+      }
+    ],
+    "bomTotal": 4.92,
+    "groupTotals": {
+      "结构件": 3.31,
+      "电子件": 0.3,
+      "辅料": 0.3,
+      "包材": 1.01
+    },
+    "notes": "供应商类型为行业类别;单价取 2026 年东莞硅胶厂与印刷厂小批(3,000 套档)行情中值,非正式报价。"
+  },
+  "processes": [
+    {
+      "id": "vulcanize",
+      "name": "双色硅胶压缩模硫化",
+      "mouldFee": 2800,
+      "mouldLife": "30 万模次",
+      "moq": 500,
+      "tiers": [
+        {
+          "qty": 500,
+          "price": 4.2
+        },
+        {
+          "qty": 3000,
+          "price": 3.4
+        },
+        {
+          "qty": 10000,
+          "price": 3.0
+        }
+      ],
+      "sampleDays": "7~10 天",
+      "bulkDays": "10~12 天",
+      "risk": "双色交界溢色;犄角尖部缺胶;建议首模测红黑交界直线度 ±0.2",
+      "equipment": "300T 真空平板硫化机 ×2 + 1×2 腔钢模(Y15 预硬钢)",
+      "cycle": "200s/模,1×2 腔,单班 280 套",
+      "yield": 0.93,
+      "price": 3.4,
+      "desc": "60A 固态硅胶,混炼胶 170℃×200s 压缩硫化,上模取赤道线分型,拔模 1.5°;红黑双色在模内一次成型,二次硫化 200℃/4h 去残留"
+    },
+    {
+      "id": "post",
+      "name": "撕边修整 + 低温去毛边",
+      "mouldFee": 500,
+      "mouldLife": "不限",
+      "moq": 500,
+      "tiers": [
+        {
+          "qty": 500,
+          "price": 0.8
+        },
+        {
+          "qty": 3000,
+          "price": 0.55
+        },
+        {
+          "qty": 10000,
+          "price": 0.4
+        }
+      ],
+      "sampleDays": "3 天",
+      "bulkDays": "6 天",
+      "risk": "犄角尖部撕裂",
+      "equipment": "冷冻修边机 + 人工修边台",
+      "cycle": "15s/套",
+      "yield": 0.97,
+      "price": 0.55,
+      "desc": "液氮冷冻去毛边 10s,犄角与表耳处人工修边,透窗孔 100% 对位检查"
+    },
+    {
+      "id": "bond",
+      "name": "骨架片 / 透窗贴合",
+      "mouldFee": 0,
+      "mouldLife": "不限",
+      "moq": 500,
+      "tiers": [
+        {
+          "qty": 500,
+          "price": 0.6
+        },
+        {
+          "qty": 3000,
+          "price": 0.4
+        },
+        {
+          "qty": 10000,
+          "price": 0.32
+        }
+      ],
+      "sampleDays": "/",
+      "bulkDays": "/",
+      "risk": "泡水后透窗脱胶",
+      "equipment": "压合治具 + 恒温压合台",
+      "cycle": "40s/套",
+      "yield": 0.98,
+      "price": 0.4,
+      "desc": "骨架片双面胶 80℃压合 20s,透窗光学胶定位压合,拉力 ≥5N"
+    },
+    {
+      "id": "surface",
+      "name": "表面手感处理",
+      "mouldFee": 0,
+      "mouldLife": "不限",
+      "moq": 500,
+      "tiers": [
+        {
+          "qty": 500,
+          "price": 0.6
+        },
+        {
+          "qty": 3000,
+          "price": 0.45
+        },
+        {
+          "qty": 10000,
+          "price": 0.35
+        }
+      ],
+      "sampleDays": "3 天",
+      "bulkDays": "5 天",
+      "risk": "手感油污染透窗",
+      "equipment": "等离子处理机 + 手感喷柜",
+      "cycle": "20s/套",
+      "yield": 0.98,
+      "price": 0.45,
+      "desc": "等离子活化 30s,喷涂手感油一遍(约 3µm),70℃烘干;透窗贴膜遮蔽"
+    },
+    {
+      "id": "assemble",
+      "name": "套装组装",
+      "mouldFee": 0,
+      "mouldLife": "不限",
+      "moq": 500,
+      "tiers": [
+        {
+          "qty": 500,
+          "price": 0.7
+        },
+        {
+          "qty": 3000,
+          "price": 0.5
+        },
+        {
+          "qty": 10000,
+          "price": 0.4
+        }
+      ],
+      "sampleDays": "/",
+      "bulkDays": "/",
+      "risk": "磁铁装反",
+      "equipment": "对位治具",
+      "cycle": "25s/套",
+      "yield": 0.995,
+      "price": 0.5,
+      "desc": "装磁铁对位 → 贴 NFC → 贴尺寸标签 → 装袋"
+    },
+    {
+      "id": "test",
+      "name": "试装检测",
+      "mouldFee": 200,
+      "mouldLife": "(测试样表)",
+      "moq": 500,
+      "tiers": [
+        {
+          "qty": 500,
+          "price": 0.4
+        },
+        {
+          "qty": 3000,
+          "price": 0.25
+        },
+        {
+          "qty": 10000,
+          "price": 0.2
+        }
+      ],
+      "sampleDays": "3 天",
+      "bulkDays": "/",
+      "risk": "批次尺寸漂移装不进表",
+      "equipment": "1:1 铝制样表治具",
+      "cycle": "20s/套",
+      "yield": 0.99,
+      "price": 0.25,
+      "desc": "每批首件 + 5% 抽检:套入样表、按动表冠、贴合度目检"
+    },
+    {
+      "id": "pack",
+      "name": "挂卡包装",
+      "mouldFee": 0,
+      "mouldLife": "不限",
+      "moq": 500,
+      "tiers": [
+        {
+          "qty": 500,
+          "price": 0.4
+        },
+        {
+          "qty": 3000,
+          "price": 0.3
+        },
+        {
+          "qty": 10000,
+          "price": 0.25
+        }
+      ],
+      "sampleDays": "3 天",
+      "bulkDays": "3 天",
+      "risk": "泡壳刮花",
+      "equipment": "吸塑封口机",
+      "cycle": "12s/套",
+      "yield": 0.995,
+      "price": 0.3,
+      "desc": "表壳入泡壳 → 装说明卡与贴纸 → 热封挂卡 → 外箱 200 套/箱"
+    }
+  ],
+  "moq": {
+    "baseQty": 3000,
+    "currency": "CNY",
+    "tiers": [
+      {
+        "qty": 500,
+        "unitPrice": 39.9,
+        "mouldAmort": 7.0,
+        "bulkPrice": 32.9,
+        "total": 19950.0,
+        "notes": "模具费 3,500 一次性支付,或按 500 套摊 7.00 元/套"
+      },
+      {
+        "qty": 3000,
+        "unitPrice": 32.9,
+        "mouldAmort": 1.17,
+        "bulkPrice": 31.73,
+        "total": 98700.0,
+        "notes": "基准档,单套综合成本约 12.69 元"
+      },
+      {
+        "qty": 10000,
+        "unitPrice": 27.9,
+        "mouldAmort": 0.35,
+        "bulkPrice": 27.55,
+        "total": 279000.0,
+        "notes": "硫化与包装单价降至下限"
+      }
+    ],
+    "notes": "unitPrice 为含模具分摊的建议零售阶梯;bulkPrice 为不含模具按套支付的货值单价(估算)。"
+  },
+  "processParams": {
+    "injection": {
+      "wall": 2.0,
+      "draft": 1.5,
+      "ribRatio": 0.5,
+      "depthRatio": 2.0,
+      "gate": "点浇口"
+    },
+    "silicone": {
+      "shoreA": 60,
+      "wall": 2.0,
+      "partingLine": "赤道线"
+    },
+    "cnc": {
+      "ballR": 2.0,
+      "topCrownR": 2.0,
+      "recessR": 1.0,
+      "chamferC": 0.5,
+      "thread": "—",
+      "tol": "±0.1"
+    },
+    "vacuum": {
+      "mouldLife": 30,
+      "minR": 0.8
+    }
+  },
+  "cost": {
+    "items": [
+      {
+        "name": "物料",
+        "amount": 4.92,
+        "basis": "BOM 合计"
+      },
+      {
+        "name": "加工",
+        "amount": 5.45,
+        "basis": "修边 0.55 + 贴合 0.40 + 表面处理 0.45 + 硫化 3.40(硫化单价 3.40,成型损耗计入本行余量)"
+      },
+      {
+        "name": "模具摊销",
+        "amount": 1.17,
+        "basis": "模具费合计 3,500 ÷ 3,000 套"
+      },
+      {
+        "name": "组装",
+        "amount": 0.5,
+        "basis": "套装组装"
+      },
+      {
+        "name": "测试",
+        "amount": 0.25,
+        "basis": "试装测试"
+      },
+      {
+        "name": "包材",
+        "amount": 0.4,
+        "basis": "挂卡包装(含双面胶/泡棉/贴身卡等包装辅材合计约 0.40)"
+      },
+      {
+        "name": "损耗",
+        "amount": 0.0,
+        "basis": "自动计算 3%"
+      }
+    ],
+    "material": 5.02,
+    "mouldTotal": [
+      2800,
+      500,
+      0,
+      0,
+      0,
+      200,
+      0
+    ],
+    "baseQty": 3000,
+    "mouldAmortization": 1.17,
+    "unitCost": 12.69,
+    "suggestedPrice": 29.9,
+    "grossMarginPct": 57.56,
+    "markup": 2.36,
+    "retailLow": 29.9,
+    "retailHigh": 39.0,
+    "tooling": 3500,
+    "packagingPerSet": 1.01,
+    "formula": "物料 + 加工 + 模具摊销(模具费总和/基准批量) + 组装 + 测试 + 包材 + 损耗 = 单台成本;毛利率 =(建议售价-单台成本)/建议售价"
+  },
+  "detail": {
+    "title": "给你的表,长出一对犄角",
+    "subtitle": "双色硅胶 · 全包护角 · 触屏无感",
+    "specs": [
+      {
+        "k": "表体宽",
+        "v": "Ø46 mm"
+      },
+      {
+        "k": "厚度",
+        "v": "13.2 mm"
+      },
+      {
+        "k": "净重",
+        "v": "约 15 g"
+      },
+      {
+        "k": "材质",
+        "v": "60A 双色硅胶"
+      }
+    ],
+    "sections": [
+      {
+        "title": "设计",
+        "body": "犄角不是贴上去的装饰,而是硅胶成型时模内一起长出来的表耳延伸:抓住它就能单手从兜里拎出手表。表冠位置留出红色护翼,磕碰时先撞护翼。"
+      },
+      {
+        "title": "结构",
+        "body": "内壁贴 0.5mm PC 骨架片维持形位,四个倒扣点勾住表体上下沿;背面 Ø14 传感器透窗用 0.05mm 光学胶贴合,心率灯与电极模型不遮挡。"
+      },
+      {
+        "title": "工艺",
+        "body": "1×2 腔钢模 170℃×200 秒压缩硫化,红黑双色模内一次成型;出来后液氮冷冻去毛边,犄角尖部再人工修,良率约 93%。"
+      },
+      {
+        "title": "规格",
+        "body": "适配 42/44mm 系列;净重 15g;耐温 -20~120℃,日常洗手游泳可用,不建议潜水;支持 Qi 磁吸无线充电,全包不影响充电。"
+      },
+      {
+        "title": "价格档",
+        "body": "BOM 仅约 4 元,硫化与修边占大头,单套综合成本约 13 元;3,000 套档建议零售 29.9 元,毛利约 62%。"
+      }
+    ]
+  },
+  "dimensions": {
+    "length": 54.0,
+    "width": 46.0,
+    "height": 13.2
+  },
+  "weight": 15.3,
+  "priceBasis": "2026 年东莞硅胶制品厂与包装印刷厂小批(3,000 套)行情区间中值,估算;非供应商正式报价"
+}

+ 39 - 0
site/index.html

@@ -0,0 +1,39 @@
+<!doctype html>
+<html lang="zh-CN">
+<head>
+  <meta charset="utf-8" />
+  <meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover" />
+  <meta name="theme-color" content="#ffffff" media="(prefers-color-scheme: light)" />
+  <meta name="theme-color" content="#000000" media="(prefers-color-scheme: dark)" />
+  <title>Pocket Hardware Lab · FmodeCode</title>
+  <meta name="generator" content="FmodeCode" />
+  <meta name="description" content="把一款 AI 硬件,从想法做到能报价下单:外壳参数、物料清单、生产工艺与成本测算。FmodeCode 出品。" />
+  <!-- base 与 importmap 均相对,子路径部署零改动 -->
+  <base href="./" />
+  <link rel="stylesheet" href="./assets/theme.css" />
+  <meta name="application-name" content="FmodeCode" />
+  <meta name="author" content="FmodeCode" />
+  <meta name="color-scheme" content="light dark" />
+  <link rel="stylesheet" href="./assets/app.css" />
+  <script type="importmap">
+  {
+    "imports": {
+      "lit": "./vendor/lit/lit/index.js",
+      "lit/": "./vendor/lit/lit/",
+      "lit-html": "./vendor/lit/lit-html/lit-html.js",
+      "lit-html/": "./vendor/lit/lit-html/",
+      "lit-element/lit-element.js": "./vendor/lit/lit-element/lit-element.js",
+      "lit-element/": "./vendor/lit/lit-element/",
+      "@lit/reactive-element": "./vendor/lit/@lit/reactive-element/reactive-element.js",
+      "@lit/reactive-element/": "./vendor/lit/@lit/reactive-element/",
+      "@lit-labs/signals": "./vendor/lit/@lit-labs/signals/index.js",
+      "signal-polyfill": "./vendor/signal-polyfill/dist/index.js"
+    }
+  }
+  </script>
+</head>
+<body>
+  <div id="app"><div class="boot">Pocket Hardware Lab 载入中…</div></div>
+  <script type="module" src="./app.js"></script>
+</body>
+</html>

+ 43 - 0
site/lib/base.js

@@ -0,0 +1,43 @@
+/**
+ * lib/base.js —— 页面基类:async setup() 后渲染;断开后挂起的 setup 结果不再渲染。
+ */
+import { LitElement } from 'lit';
+
+export class PhPage extends LitElement {
+  createRenderRoot() { return this; } // 页面组件用全局主题变量,不用 Shadow DOM
+  render() { return null; }
+
+  async setup() { /* 子类覆盖:加载数据 */ }
+
+  connectedCallback() {
+    super.connectedCallback();
+    if (!this._ready) {
+      this._alive = true;
+      this._ready = true;
+      this.setup().then(() => {
+        if (this._alive) this.requestUpdate();
+      }).catch((err) => {
+        if (this._alive) { this.error = err; this.requestUpdate(); }
+      });
+    }
+  }
+
+  disconnectedCallback() {
+    super.disconnectedCallback();
+    this._alive = false;
+  }
+}
+
+export class PhError extends HTMLElement {
+  connectedCallback() {
+    if (this._done) return;
+    this._done = true;
+    const msg = this.error?.message || String(this.error || '未知错误');
+    this.innerHTML = `<div style="padding:120px 24px;text-align:center;font-family:var(--fx-font)">
+      <div style="font-size:12px;letter-spacing:.12em;color:#86868b;margin-bottom:16px">FmodeCode · Pocket Hardware Lab</div>
+      <h1 style="font-size:28px;margin:0 0 12px">页面加载失败</h1>
+      <p style="color:#6e6e73;max-width:36em;margin:0 auto 28px">${msg.replace(/[&<>]/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;' }[c]))}</p>
+      <a href="#/" style="color:#0071e3">返回展厅</a></div>`;
+  }
+}
+customElements.define('ph-error', PhError);

+ 44 - 0
site/lib/css.js

@@ -0,0 +1,44 @@
+/**
+ * lib/css.js —— 阴影根样式注入(静态 CSS 文本 + adoptedStyleSheets)。
+ * 说明:site/vendor 的 lit-html 构建对 css`` 标记模板的解析在个别源码位置会抛
+ * "result must not have attributes",因此页面/组件一律使用本文件里的纯文本样式,
+ * 由 <style> 注入 Shadow Root(或 light DOM),不依赖渲染时再解析 css。
+ */
+const sheetCache = new Map();
+
+function makeSheet(text) {
+  if (typeof CSSStyleSheet !== 'undefined' && 'adoptedStyleSheets' in Document.prototype) {
+    try {
+      const s = new CSSStyleSheet();
+      s.replaceSync(text);
+      return s;
+    } catch { /* fallthrough */ }
+  }
+  return null;
+}
+
+/**
+ * 把若干段 CSS 文本施加到 root(ShadowRoot 用 adoptedStyleSheets;light DOM 元素注入 <style>)。
+ * light DOM 下 :host 不匹配,会改写成元素标签名(如 ph-bom),让组件级变量 / 容器查询照常生效。
+ */
+export function applyCss(root, ...texts) {
+  for (const raw of texts) {
+    if (!raw) continue;
+    let text = typeof raw === 'string' ? raw : String(raw);
+    // 样式文本可能挂在自定义元素(light DOM)上::host 选择器在页面上不命中,改写成实际标签名
+    if (root && root.localName) text = text.replace(/:host\b/g, root.localName);
+    let sheet = sheetCache.get(text);
+    if (sheet === undefined) { sheet = makeSheet(text); sheetCache.set(text, sheet); }
+    if (sheet && 'adoptedStyleSheets' in root) {
+      // ShadowRoot 才有 adoptedStyleSheets;light DOM 元素用 <style> 标签
+      if (!root.adoptedStyleSheets.includes(sheet)) root.adoptedStyleSheets = [...root.adoptedStyleSheets, sheet];
+    } else {
+      const st = document.createElement('style');
+      st.textContent = text;
+      root.prepend(st);
+    }
+  }
+}
+
+/** 把 {text} 常量转成字符串 */
+export function cssText(x) { return typeof x === 'string' ? x : ''; }

+ 77 - 0
site/page/gallery.js

@@ -0,0 +1,77 @@
+/**
+ * page/gallery.js —— 展厅:8 款产品卡片网格(Apple 产品页语法:大图、极细分割线、字重对比)。
+ */
+import { html } from 'lit';
+import { PhPage } from '../lib/base.js';
+import { loadAll } from '../services/products.js';
+import { brandFooter } from '../utils/theme.js';
+import { money, num } from '../utils/format.js';
+import { linkHref } from '../utils/router.js';
+import { galleryStyle } from './styles/gallery-style.js';
+import { applyCss } from '../lib/css.js';
+
+class PhGallery extends PhPage {
+  constructor() {
+    super();
+    this.items = null;
+    this.error = null;
+    this.title = 'Pocket Hardware Lab · FmodeCode 硬件展厅';
+  }
+
+  createRenderRoot() {
+    applyCss(this, ...galleryStyle);
+    return this;
+  }
+
+  async setup() {
+    this.items = await loadAll();
+  }
+
+  render() {
+    if (this.error) return html`<ph-error .error=${this.error}></ph-error>`;
+    if (!this.items) return html`<p class="boot">Pocket Hardware Lab 载入中…</p>`;
+    return html`<header><b>Pocket Hardware Lab</b><span class="hsub">· 硬件展厅</span></header>
+      <main class="wrap">
+        ${this._intro()}
+        <section class="grid" aria-label="产品列表">${this.items.map((p, i) => this._card(p, i))}</section>
+      </main>
+      ${brandFooter(html)}`;
+  }
+
+  _intro() {
+    return html`<section class="intro">
+        <p class="eyebrow">Pocket Hardware Lab</p>
+        <h1>把一款 AI 硬件,<br />从想法做到<em>能报价下单</em></h1>
+        <p>八款随身硬件,每一款都有真实的外形参数、物料清单、生产工艺与成本测算。点开任一产品,看它怎么被做出来、卖多少钱。</p>
+        <p class="count">${this.items.length} 款产品 · 数据口径:深圳 / 东莞小批量行情</p>
+      </section>`;
+  }
+
+  _card(p, i = 99) {
+    const qty = p.cost?.baseQty || 3000;
+    const gm = p.cost?.grossMarginPct ?? (p.cost?.unitCost && p.cost?.suggestedPrice ? (1 - p.cost.unitCost / p.cost.suggestedPrice) * 100 : null);
+    const href = linkHref(`/p/${p.id}`);
+    return html`<a class="card" href=${href} data-link aria-label="${p.name} ${p.latin}">
+      <div class="shot">
+        <img class="is-2133" src="./assets/kv/${p.id}-hero.png" alt="${p.name} 产品主图" width="1792" height="1280" loading=${i < 2 ? "eager" : "lazy"} decoding="async" fetchpriority=${i < 2 ? "high" : "auto"} />
+      </div>
+      <div class="meta">
+        <h2 class="name">${p.name}</h2>
+        <p class="latin">${p.latin}</p>
+        <p class="tagline">${p.tagline}</p>
+        <div class="stats">
+          <span>BOM <b>${money(p.bom?.bomTotal)}</b></span>
+          <span>售价 <b>${money(p.cost?.suggestedPrice)}</b></span>
+          <span>毛利 <b>${gm != null ? Number(gm).toFixed(0) + '%' : '—'}</b></span>
+          <span class="basis">按 ${num(qty)} 件</span>
+        </div>
+        <div class="more">查看详情 <span aria-hidden="true">→</span></div>
+      </div>
+    </a>`;
+  }
+}
+customElements.define('ph-gallery', PhGallery);
+
+export function galleryPage() {
+  return new PhGallery();
+}

+ 204 - 0
site/page/lab.js

@@ -0,0 +1,204 @@
+/**
+ * page/lab.js —— 实验室:单屏不滚。
+ * 左(手机为上)Babylon 画布 + 底部可收起坞(形体参数 / BOM / 导出)。
+ * Babylon 只在本页初始化;离开页面(自定义元素 disconnected)时 dispose 引擎与监听。
+ */
+import { html } from 'lit';
+import '../wc/ph-bom.js';
+import { PhPage } from '../lib/base.js';
+import { loadProduct } from '../services/products.js';
+import { KEY_LABEL, rangeFor, stepFor } from '../utils/format.js';
+import { linkHref } from '../utils/router.js';
+import { labStyle } from './styles/lab-style.js';
+import { applyCss } from '../lib/css.js';
+
+let babylonPromise = null;
+function ensureBabylon() {
+  if (window.BABYLON) return Promise.resolve(window.BABYLON);
+  if (babylonPromise) return babylonPromise;
+  babylonPromise = new Promise((resolve, reject) => {
+    const s = document.createElement('script');
+    s.src = new URL('./vendor/babylon/babylon.js', document.baseURI).href;
+    s.async = true;
+    s.onload = () => (window.BABYLON ? resolve(window.BABYLON) : reject(new Error('Babylon 全局未就绪')));
+    s.onerror = () => reject(new Error('Babylon 脚本加载失败'));
+    document.head.appendChild(s);
+  });
+  return babylonPromise;
+}
+
+const HIDE_KEYS = new Set(['dBottom']); // 底部外径由壁厚/拔模推导,面板不单独暴露
+
+class PhLab extends PhPage {
+  constructor() {
+    super();
+    this.styles = []; // 抑制 vendor lit-html 的 css 模板解析(本页样式由 lab-style.js 注入)
+    this.p = null;
+    this.error = null;
+    this.tab = 'shape';
+    this.dockOpen = true;
+    this.params = {};
+    this.touched = {};
+    this.viewer = null;
+    this.status = '';
+    this.title = '实验室 · Pocket Hardware Lab · FmodeCode';
+  }
+
+  /** 页面组件用 light DOM:不建 Shadow Root,直接复用页面级样式 */
+  createRenderRoot() {
+    applyCss(this, ...labStyle);
+    return this;
+  }
+
+  setup() {
+    const m = location.hash.match(/^#\/lab\/([^/?#]+)/);
+    this.id = m ? decodeURIComponent(m[1]) : '';
+    return this._load();
+  }
+
+  async _load() {
+    this.p = await loadProduct(this.id);
+    this.params = { ...(this.p.shape?.defaults || {}) };
+    this.title = `${this.p.name} · 实验室 · Pocket Hardware Lab`;
+    this.requestUpdate();
+    await this.updateComplete;
+    if (!this.isConnected) return;
+    await this._mount3d();
+  }
+
+  async _mount3d() {
+    const canvas = this.querySelector('canvas');
+    if (!canvas) return;
+    try {
+      await ensureBabylon();
+      await import('../vendor/earcut/earcut.js'); // ExtrudePolygon 依赖全局 earcut(本地 vendor)
+      if (!this.isConnected) return;
+      const { ShellViewer } = await import('../services/viewer3d.js');
+      this.viewer = new ShellViewer(canvas, this.p);
+      this.viewer.setParams(this.params);
+      this.viewer._onChange = () => this.requestUpdate();
+      this._statsLoop();
+    } catch (e) {
+      console.warn(e);
+      this.error = e;
+    }
+  }
+
+  _statsLoop() {
+    const tick = () => {
+      if (!this.isConnected || !this.viewer) return;
+      const s = this.viewer.stats();
+      if (s) {
+        this.stats = s;
+        const el = this.querySelector('.live');
+        if (el) el.textContent = `${s.positions} 顶点 · ${s.indices} 三角面`;
+      }
+      this._statRaf = requestAnimationFrame(tick);
+    };
+    this._statRaf = requestAnimationFrame(tick);
+  }
+
+  disconnectedCallback() {
+    super.disconnectedCallback();
+    if (this._statRaf) cancelAnimationFrame(this._statRaf);
+    this.viewer?.dispose();
+    this.viewer = null;
+  }
+
+  _set(key, value) {
+    const v = Number(value);
+    if (!Number.isFinite(v)) return;
+    this.params = { ...this.params, [key]: v };
+    this.viewer?.setParams({ [key]: v });
+    this.requestUpdate();
+  }
+
+  _resetAll() {
+    this.params = { ...(this.p.shape?.defaults || {}) };
+    this.viewer?.setParams(this.params);
+    this.requestUpdate();
+  }
+
+  _export() {
+    const payload = { id: this.p.id, name: this.p.name, shapeType: this.p.shape?.type, exportedAt: new Date().toISOString(), params: this.params };
+    const blob = new Blob([JSON.stringify(payload, null, 2)], { type: 'application/json' });
+    const a = document.createElement('a');
+    a.href = URL.createObjectURL(blob);
+    a.download = `${this.p.id}-shape.json`;
+    document.body.appendChild(a);
+    a.click();
+    a.remove();
+    setTimeout(() => URL.revokeObjectURL(a.href), 1000);
+    this.status = '已导出 ' + a.download;
+    this.requestUpdate();
+  }
+
+
+  render() {
+    if (this.error) return html`<ph-error .error=${this.error}></ph-error>`;
+    if (!this.p) return html`<div style="padding:96px;text-align:center;color:var(--ink-3)">载入产品…</div>`;
+    const p = this.p;
+    const keys = Object.keys(p.shape?.defaults || {}).filter((k) => !HIDE_KEYS.has(k));
+    return html`
+      <div class="lab">
+        <div class="bar">
+          <span><a data-link href=${linkHref(`/p/${p.id}`)}>← 详情</a></span>
+          <span class="t">${p.name} · 实验室</span>
+          <span class="live"></span>
+        </div>
+        <div class="stage">
+          <canvas aria-label="3D 外壳预览:单指旋转,双指缩放,双击复位"></canvas>
+          <button class="reset" @click=${() => this.viewer?.reset()}>复位视角</button>
+          <div class="hint">单指旋转 · 双指缩放 · 双击复位</div>
+        </div>
+        <section class="dock ${this.dockOpen ? '' : 'closed'}">
+          <div class="tabs">
+            ${[['shape', '形体参数'], ['bom', 'BOM'], ['export', '导出']].map(([k, label]) => html`
+              <button class=${this.tab === k ? 'on' : ''} @click=${() => { this.tab = k; this.dockOpen = true; this.requestUpdate(); }}>${label}</button>`)}
+            <span class="grow"></span>
+            <button class="fold" aria-label=${this.dockOpen ? '收起面板' : '展开面板'} @click=${() => { this.dockOpen = !this.dockOpen; this.requestUpdate(); }}>${this.dockOpen ? '⌄' : '⌃'}</button>
+          </div>
+          <div class="body">
+            ${this.tab === 'shape' ? this._shapeTab(keys) : ''}
+            ${this.tab === 'bom' ? html`<ph-bom .bom=${p.bom}></ph-bom>` : ''}
+            ${this.tab === 'export' ? this._exportTab() : ''}
+          </div>
+        </section>
+      </div>`;
+  }
+
+  _shapeTab(keys) {
+    return html`
+      ${this.viewer?.profile?.warnings?.length ? html`<p class="warn">${this.viewer.profile.warnings.join(';')}</p>` : ''}
+      <p style="margin:0 0 14px;font-size:12px;color:var(--ink-3)">参数按 shape.defaults 自动生成 · 单位 mm / °</p>
+      <div class="grid">
+        ${keys.map((k) => {
+          const v = this.params[k];
+          const [lo, hi] = rangeFor(k, v);
+          const step = stepFor(k);
+          return html`<div class="ctl">
+            <label for="s-${k}"><span>${KEY_LABEL[k] || k}</span><small>${k}</small></label>
+            <input type="range" id="s-${k}" min=${lo} max=${hi} step=${step} .value=${String(v)}
+              @input=${(e) => this._set(k, e.target.value)} aria-label=${KEY_LABEL[k] || k} />
+            <input type="number" min=${lo} max=${hi} step=${step} .value=${String(v)}
+              @change=${(e) => this._set(k, e.target.value)} aria-label=${(KEY_LABEL[k] || k) + ' 数值'} />
+          </div>`;
+        })}
+      </div>
+      <div style="margin-top:18px"><button class="btn ghost" style="height:38px;font-size:14px" @click=${() => this._resetAll()}>恢复默认参数</button></div>`;
+  }
+
+  _exportTab() {
+    return html`<div class="export">
+      <p>把当前形体参数导出为 JSON(含产品 id、shape 类型与全部参数),可直接交给结构工程师或复现到 CAD。</p>
+      <pre>${JSON.stringify({ id: this.p.id, shapeType: this.p.shape?.type, params: this.params }, null, 2)}</pre>
+      <button class="btn" @click=${() => this._export()}>下载 JSON</button>
+      ${this.status ? html`<span class="status">${this.status}</span>` : ''}
+    </div>`;
+  }
+}
+customElements.define('ph-lab', PhLab);
+
+export function labPage() {
+  return new PhLab();
+}

+ 22 - 0
site/page/not-found.js

@@ -0,0 +1,22 @@
+import { html } from 'lit';
+import { PhPage } from '../lib/base.js';
+import { linkHref } from '../utils/router.js';
+
+export class PhNotFound extends PhPage {
+  render() {
+    return html`<section style="padding:120px 24px;text-align:center">
+      <p style="font-size:12px;letter-spacing:.12em;color:#86868b;margin:0 0 16px">404 · FmodeCode</p>
+      <h1 style="font-size:clamp(32px,5vw,56px);font-weight:700;letter-spacing:-.02em;margin:0 0 16px">页面不存在</h1>
+      <p style="color:#6e6e73;margin:0 0 32px">${this._path || ''}</p>
+      <a data-link href="${linkHref('/')}" style="color:#0071e3;font-size:17px">返回展厅 →</a>
+    </section>`;
+  }
+}
+customElements.define('ph-not-found', PhNotFound);
+
+export function notFoundPage(ctx) {
+  const el = new PhNotFound();
+  el._path = ctx.path;
+  el.title = '页面不存在 · Pocket Hardware Lab';
+  return el;
+}

+ 211 - 0
site/page/product.js

@@ -0,0 +1,211 @@
+/**
+ * page/product.js —— 苹果风格产品详情页(单栏滚动)。
+ * Hero → 主张 → 规格速览 → 内容段 → BOM → 工艺 → MOQ → 成本 → CTA。
+ */
+import { html, css } from 'lit';
+import '../wc/ph-bom.js';
+import '../wc/ph-diagrams.js';
+import '../wc/ph-cost-chart.js';
+import { PhPage } from '../lib/base.js';
+import { loadProduct } from '../services/products.js';
+import { themeCss, sharedHtmlCss, brandFooter, footerCss } from '../utils/theme.js';
+import { money, pct, num } from '../utils/format.js';
+import { linkHref } from '../utils/router.js';
+import { applyCss } from '../lib/css.js';
+import { productStyle } from './styles/product-style.js';
+
+/** 内容段旁的线条示意:仅「结构」「工艺/材质工艺」段 */
+function diagramFor(title) {
+  if (/结构/.test(title)) return 'section';
+  if (/工艺|材质/.test(title)) return 'chamfer';
+  return null;
+}
+
+/** 建议档:与 cost.baseQty 完全相等的档;否则取最接近的档 */
+function suggestedTier(proc, baseQty) {
+  const i = proc.tiers.findIndex((t) => t.qty === baseQty);
+  if (i >= 0) return i;
+  let best = 0;
+  proc.tiers.forEach((t, n) => { if (Math.abs(t.qty - baseQty) < Math.abs(proc.tiers[best].qty - baseQty)) best = n; });
+  return best;
+}
+
+class PhProductPage extends PhPage {
+  constructor() {
+    super();
+    this.p = null;
+    this.error = null;
+  }
+
+  setup() {
+    this.id = currentId();
+    return this._load();
+  }
+
+  createRenderRoot() {
+    applyCss(this, ...productStyle);
+    return this;
+  }
+
+  async _load() {
+    this.p = await loadProduct(this.id);
+    this.title = `${this.p.name} · ${this.p.latin} · Pocket Hardware Lab`;
+  }
+
+  /** MOQ 阶梯:行 = 工艺,列 = 三档(数量 / 综合单价 <small>= 工艺价 + 模具摊销</small> / 该档总价) */
+  _moqTable() {
+    const p = this.p;
+    const base = p.cost?.baseQty || 3000;
+    const rows = (p.processes || []).map((pr) => {
+      const best = suggestedTier(pr, base);
+      const amort = (t) => (t.qty ? (pr.mouldFee || 0) / t.qty : 0);
+      return html`<tr class=${best >= 0 ? 'best' : ''}>
+        <th scope="row"><span>${pr.name}</span><small>模具 ${money(pr.mouldFee || 0)}${pr.mouldLife ? ' · ' + pr.mouldLife : ''}</small></th>
+        ${pr.tiers.map((t, i) => {
+          const unit = +t.price + amort(t);
+          const total = unit * t.qty;
+          return html`<td>
+            <div class="qty">${num(t.qty)} 件${i === best ? html`<span class="tag">建议</span>` : ''}</div>
+            <div class="unit">${money(unit, 2)}<small>含摊销 ${money(amort(t), 2)}</small></div>
+            <div class="total">总价 ${money(total, 0)}</div>
+          </td>`;
+        })}
+      </tr>`;
+    });
+    return html`<table>
+      <thead><tr><th scope="col">工艺</th><th scope="col">第一档</th><th scope="col">第二档</th><th scope="col">第三档</th></tr></thead>
+      <tbody>${rows}</tbody>
+    </table>
+    <p class="moq-note">按 ${num(base)} 件基准批量测算;单价 = 工艺报价 + 模具费 ÷ 数量。「建议」档与全机成本测算的基准批量一致。</p>`;
+  }
+
+  render() {
+    if (this.error) return html`<ph-error .error=${this.error}></ph-error>`;
+    if (!this.p) return html`<div class="boot" style="padding:96px;text-align:center;color:var(--ink-3)">载入产品…</div>`;
+    const p = this.p;
+    const d = p.detail || {};
+    const cost = p.cost || {};
+    return html`
+      <nav class="nav">
+        <a data-link href=${linkHref('/')} aria-label="返回展厅">← 展厅</a>
+        <span class="t">Pocket Hardware Lab</span>
+        <a data-link href=${linkHref(`/lab/${p.id}`)}>实验室</a>
+      </nav>
+      <main>
+        <section class="hero">
+          <div class="shot">
+            <img src="./assets/kv/${p.id}-hero.png" alt="${p.name} 主图" width="1792" height="1024" fetchpriority="high" />
+          </div>
+          <p class="latin">${p.latin}</p>
+          <h1>${d.title || p.name}</h1>
+          <p class="sub">${d.subtitle || p.tagline}</p>
+        </section>
+
+        <section class="block claim"><p>${p.tagline}</p></section>
+
+        <section class="block"><div class="inner">
+          <dl class="specs">
+            ${(d.specs || []).map((s) => html`<div class="spec"><dt>${s.k}</dt><dd>${s.v}</dd></div>`)}
+          </dl>
+        </div></section>
+
+        <div class="block"><div class="inner measure">
+          ${(d.sections || []).map((s) => {
+            const kind = diagramFor(s.title);
+            return html`<section class="sec ${kind ? 'has-fig' : ''}">
+              <div>
+                <p class="eyebrow">${s.title}</p>
+                <p>${s.body}</p>
+              </div>
+              ${kind ? html`<figure class="fig"><ph-diagram .kind=${kind} .product=${p}></ph-diagram></figure>` : ''}
+            </section>`;
+          })}
+        </div></div>
+
+        <section class="block" id="bom"><div class="inner">
+          <div class="block-head">
+            <p class="eyebrow">Bill of Materials</p>
+            <h2 class="h2">物料清单 · BOM</h2>
+            <p class="lead">${p.bom?.rows?.length || 0} 项物料,按结构件、加工件、电子件、辅料与包材分组。价格口径:${p.priceBasis || '深圳 / 东莞小批量行情'}。</p>
+          </div>
+          <ph-bom .bom=${p.bom}></ph-bom>
+        </div></section>
+
+        <section class="block"><div class="inner">
+          <div class="block-head">
+            <p class="eyebrow">Process</p>
+            <h2 class="h2">生产工艺</h2>
+            <p class="lead">${(p.processes || []).length} 道工序,设备、节拍与良率来自同类小批量产线。良率低于 94% 标为警示色。</p>
+          </div>
+          <div class="proc">
+            ${(p.processes || []).map((pr) => {
+              const y = pr.yield > 1.5 ? pr.yield / 100 : pr.yield;
+              const ly = (Number.isFinite(y) ? y : 1) * 100;
+              return html`<article class="proc-row">
+                <div class="pr-name">${pr.name}<small>${pr.bulkDays ? `批量 ${pr.bulkDays}` : ''}${pr.sampleDays ? ` · 打样 ${pr.sampleDays}` : ''}</small></div>
+                <div class="pr-eq">${pr.equipment || '—'}</div>
+                <div><span class="pr-k">节拍</span><span class="pr-v">${pr.cycle || '—'}</span></div>
+                <div>
+                  <span class="pr-k">良率</span>
+                  <div style="display:flex;justify-content:space-between;align-items:baseline"><span class="pr-v">${Number.isFinite(ly) ? ly.toFixed(ly % 1 ? 1 : 0) + '%' : '—'}</span></div>
+                  <div class="ybar ${ly < 94 ? 'low' : ''}"><i style="width:${Math.max(0, Math.min(100, ly))}%"></i></div>
+                </div>
+                <div><span class="pr-k">单价</span><span class="pr-v">${money(pr.price, 2)}</span></div>
+                ${pr.risk ? html`<div class="risk"><span class="dot" aria-hidden="true"></span><span><b>风险</b>${pr.risk}</span></div>` : ''}
+              </article>`;
+            })}
+          </div>
+        </div></section>
+
+        <section class="block"><div class="inner">
+          <div class="block-head">
+            <p class="eyebrow">MOQ</p>
+            <h2 class="h2">起订量与阶梯报价</h2>
+            <p class="lead">按 ${num(cost.baseQty || 3000)} 件基准批量测算。每档单价 = 工艺报价 + 模具费 ÷ 数量。</p>
+          </div>
+          <div class="moq">
+            ${this._moqTable()}
+          </div>
+        </div></section>
+
+        <section class="block"><div class="inner">
+          <div class="block-head">
+            <p class="eyebrow">Unit Economics</p>
+            <h2 class="h2">成本拆解</h2>
+            <p class="lead">单台成本 = 物料 + 加工 + 模具摊销 + 组装 + 测试 + 包材 + 损耗(按 ${num(cost.baseQty || 3000)} 件摊销模具)。</p>
+          </div>
+          <ph-cost-chart .cost=${cost}></ph-cost-chart>
+          <div class="figures">
+            <div><div class="k">单台成本</div><div class="v">${money(cost.unitCost, cost.unitCost < 100 ? 2 : null)}</div><div class="f">含模具摊销 ${money(cost.mouldAmortization, 2)} / 台</div></div>
+            <div><div class="k">建议售价</div><div class="v hero">${money(cost.suggestedPrice)}</div><div class="f">建议价位带 ${money(cost.retailLow)} – ${money(cost.retailHigh)}</div></div>
+            <div><div class="k">毛利率</div><div class="v">${cost.grossMarginPct != null ? Number(cost.grossMarginPct).toFixed(1) + '%' : pct(1 - 1 / (cost.markup || 1))}</div><div class="f">成本加成 ${(cost.markup || 0).toFixed ? Number(cost.markup).toFixed(2) : cost.markup}×</div></div>
+          </div>
+        </div></section>
+
+        <section class="block cta"><div class="inner">
+          <h2>改一改,再算一次。</h2>
+          <p>在实验室里拖动参数重建外壳,实时看到形体变化;参数可直接导出 JSON。</p>
+          <div class="row">
+            <a class="btn" data-link href=${linkHref(`/lab/${p.id}`)}>进入实验室</a>
+            <a class="btn ghost" data-link href=${linkHref('/')}>返回展厅</a>
+          </div>
+        </div></section>
+      </main>
+      ${brandFooter(html)}
+    `;
+  }
+}
+customElements.define('ph-product', PhProductPage);
+
+function currentId() {
+  const m = location.hash.match(/^#\/p\/([^/?#]+)/);
+  return m ? decodeURIComponent(m[1]) : '';
+}
+
+export function productPage(ctx) {
+  const el = new PhProductPage();
+  el.title = 'Pocket Hardware Lab · FmodeCode';
+  // ctx.params.id 与 currentId() 一致;setUp 以 hash 为准(导航竞态下更稳)
+  void ctx;
+  return el;
+}

+ 59 - 0
site/page/styles/gallery-style.js

@@ -0,0 +1,59 @@
+/** 静态样式文本(见 lib/css.js 顶部说明) */
+import { themeCss, sharedHtmlCss, footerCss } from '../../utils/theme.js';
+
+const own = String.raw`    .wrap { max-width: 1200px; margin: 0 auto; padding: 0 var(--pad); }
+    header {
+      position: sticky; top: 0; z-index: 10; height: 48px; display: flex; align-items: center;
+      padding: 0 var(--pad); background: var(--header-bg); backdrop-filter: saturate(180%) blur(20px);
+      -webkit-backdrop-filter: saturate(180%) blur(20px); font-size: 13px; color: var(--ink-2);
+    }
+    header b { color: var(--ink); font-weight: 600; letter-spacing: -0.01em; }
+    .intro { padding: clamp(56px, 9vw, 112px) 0; }
+    .intro + .grid { margin-top: clamp(40px, 6vw, 72px); }
+    .intro .eyebrow { margin-bottom: 18px; }
+    .intro h1 {
+      margin: 0; max-width: 16em; font-size: clamp(40px, 6.2vw, 64px); line-height: 1.06;
+      letter-spacing: -0.025em; font-weight: 700;
+    }
+    .intro h1 em { font-style: normal; color: var(--ink-3); }
+    .intro p { margin: 24px 0 0; max-width: 34em; font-size: clamp(16px, 1.6vw, 19px); line-height: 1.6; color: var(--ink-2); }
+    .intro .count { margin-top: 36px; font-size: 13px; color: var(--ink-3); }
+
+    /* 平铺网格:行高取内容高度,避免长文案把同排卡片拉出空洞 */
+    .grid { display: grid; grid-template-columns: 1fr; align-items: start; gap: clamp(56px, 7vw, 88px) clamp(32px, 4vw, 56px); padding-bottom: clamp(64px, 10vw, 120px); }
+    @media (min-width: 820px) { .grid { grid-template-columns: 1fr 1fr; } }
+
+    .card { display: block; color: inherit; text-decoration: none; outline-offset: 8px; }
+    .card:focus-visible { outline: 2px solid var(--accent); }
+    .shot { position: relative; overflow: hidden; background: var(--img-bg); aspect-ratio: 3 / 2; }
+    /* 主 KV 原图 7:4,卡片视窗裁成 3:2:宽度铺满、不裁主体、无圆角边框套壳 */
+    .shot img {
+      width: 100%; height: 100%; object-fit: cover; display: block;
+      mix-blend-mode: var(--img-blend);
+      filter: var(--img-filter);
+      transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
+    }
+    .card:hover .shot img, .card:focus-visible .shot img { transform: scale(1.02); }
+    .meta { padding: 22px 4px 0; }
+    .name { margin: 0; font-size: clamp(28px, 3.2vw, 34px); line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; }
+    .latin { margin: 8px 0 0; font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
+    .tagline { margin: 14px 0 0; font-size: 16px; line-height: 1.55; color: var(--ink-2); }
+    .stats {
+      margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line);
+      display: flex; flex-wrap: wrap; gap: 6px 0; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums;
+    }
+    .stats span { display: inline-flex; align-items: baseline; gap: 6px; }
+    .stats span + span::before { content: "·"; margin: 0 12px; color: var(--ink-3); }
+    .stats b { color: var(--ink); font-weight: 600; }
+    .hsub { margin-left: 10px; color: var(--ink-3); }
+    .stats .basis { color: var(--ink-3); }
+    .boot { padding: 96px 24px; text-align: center; color: var(--ink-3); }
+    .more {
+      margin-top: 12px; font-size: 14px; color: var(--accent); font-weight: 500; display: flex; align-items: center; gap: 6px;
+      opacity: 0; transform: translateY(-4px); transition: opacity 0.3s ease, transform 0.3s ease;
+    }
+    .card:hover .more, .card:focus-visible .more { opacity: 1; transform: none; }
+    @media (hover: none) { .more { display: none; } }
+  `;
+
+export const galleryStyle = [themeCss, sharedHtmlCss, footerCss, own];

+ 56 - 0
site/page/styles/lab-style.js

@@ -0,0 +1,56 @@
+/** 静态样式文本(见 lib/css.js 顶部说明) */
+import { themeCss, sharedHtmlCss } from '../../utils/theme.js';
+
+const own = String.raw`    :host { display: block; height: 100vh; height: 100dvh; overflow: hidden; background: var(--bg); }
+    .lab { display: flex; flex-direction: column; height: 100%; }
+    .bar {
+      flex: none; height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
+      padding: 0 var(--pad); font-size: 13px; border-bottom: 1px solid var(--line);
+    }
+    .bar a { color: var(--ink-2); }
+    .bar .t { font-weight: 600; color: var(--ink); }
+    .bar .live { color: var(--ink-3); font-variant-numeric: tabular-nums; }
+    .stage { position: relative; flex: 1; min-height: 0; }
+    .stage canvas { width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
+    .hint {
+      position: absolute; left: 16px; bottom: 12px; font-size: 11px; color: var(--ink-3); letter-spacing: 0.02em; pointer-events: none;
+    }
+    .reset {
+      position: absolute; right: 16px; top: 12px; height: 32px; padding: 0 14px; border-radius: 99px;
+      border: 1px solid var(--line); background: var(--bg); color: var(--ink-2); font-size: 12px; cursor: pointer;
+    }
+    .reset:hover { color: var(--ink); }
+    .dock {
+      flex: none; height: 46vh; max-height: 520px; min-height: 180px; display: flex; flex-direction: column;
+      border-top: 1px solid var(--line); background: var(--bg); transition: height 0.3s cubic-bezier(0.22, 1, 0.36, 1); overflow: hidden;
+    }
+    .dock.closed { height: 52px; min-height: 52px; }
+    .tabs { flex: none; height: 52px; display: flex; align-items: center; gap: 4px; padding: 0 var(--pad); border-bottom: 1px solid var(--line); }
+    .tabs button {
+      height: 34px; padding: 0 16px; border-radius: 99px; border: 0; background: transparent; color: var(--ink-2);
+      font-size: 14px; cursor: pointer;
+    }
+    .tabs button.on { background: var(--bg-soft); color: var(--ink); font-weight: 600; }
+    .tabs .grow { flex: 1; }
+    .tabs .fold { background: transparent; border: 0; color: var(--ink-3); font-size: 18px; cursor: pointer; width: 34px; }
+    .body { flex: 1; overflow: auto; padding: 20px var(--pad) calc(24px + var(--fx-safe-b, 0px)); -webkit-overflow-scrolling: touch; }
+    .dock.closed .body { display: none; }
+    .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px 24px; }
+    .ctl { display: grid; grid-template-columns: 1fr 84px; gap: 6px 12px; align-items: center; }
+    .ctl label { grid-column: 1 / 2; font-size: 13px; color: var(--ink-2); display: flex; justify-content: space-between; }
+    .ctl label small { color: var(--ink-3); font-size: 11px; }
+    .ctl input[type=range] { width: 100%; accent-color: var(--ink); }
+    .ctl input[type=number] {
+      width: 100%; height: 30px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--ink);
+      padding: 0 8px; font-size: 13px; font-variant-numeric: tabular-nums;
+    }
+    .warn { margin: 0 0 14px; font-size: 12px; color: var(--warn, #ff9f0a); }
+    .export p { margin: 0 0 18px; color: var(--ink-2); font-size: 14px; line-height: 1.6; }
+    .export pre {
+      margin: 0 0 18px; padding: 14px 16px; border-radius: 12px; background: var(--bg-soft); font: 12px/1.6 var(--fx-mono, monospace);
+      color: var(--ink-2); max-height: 180px; overflow: auto; white-space: pre-wrap;
+    }
+    .status { margin-left: 12px; font-size: 12px; color: var(--ink-3); }
+  `;
+
+export const labStyle = [themeCss, sharedHtmlCss, own];

+ 165 - 0
site/page/styles/product-style.js

@@ -0,0 +1,165 @@
+/** 详情页静态样式(见 lib/css.js 顶部说明) */
+import { themeCss, sharedHtmlCss, footerCss } from '../../utils/theme.js';
+
+const own = String.raw`  :host {
+    --bg: #ffffff; --bg-soft: #f5f5f7; --ink: #1d1d1f; --ink-2: #6e6e73; --ink-3: #86868b;
+    --line: rgba(0, 0, 0, 0.08); --accent: #0071e3; --warn: #c77700; --img-blend: normal; --img-filter: none; --img-bg: #ffffff;
+    --header-bg: rgba(255, 255, 255, 0.8); --pad: clamp(20px, 5vw, 64px);
+    --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, sans-serif;
+    color: var(--ink); background: var(--bg); font-family: var(--font);
+    -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
+  }
+  @media (prefers-color-scheme: dark) {
+    :host {
+      --bg: #000000;
+      --bg-soft: #0b0b0d;
+      --ink: #f5f5f7;
+      --ink-2: #a1a1a6;
+      --ink-3: #86868b;
+      --line: rgba(255, 255, 255, 0.14);
+      --accent: #2997ff;
+      --warn: #ff9f0a;
+      --bar-1: #f5f5f7;
+      --img-blend: normal;
+      /* 深色:白底主 KV 用屏幕混合反相成黑底(multiply 在深色文档根下不生效,实测) */
+      --img-filter: invert(1) hue-rotate(180deg) saturate(0.9);
+      --img-bg: #ffffff;
+      --header-bg: rgba(0, 0, 0, 0.72);
+    }
+  }
+  * { box-sizing: border-box; }
+  img { display: block; }
+  a { color: inherit; text-decoration: none; }
+  .eyebrow { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; margin: 0; }
+  .btn {
+    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
+    height: 48px; padding: 0 28px; border-radius: 980px; border: 1px solid transparent;
+    font: 500 16px/1 var(--font); cursor: pointer; background: var(--ink); color: var(--bg);
+    transition: opacity 0.2s ease, transform 0.2s ease;
+  }
+  .btn:hover { opacity: 0.86; }
+  .btn:active { transform: scale(0.98); }
+  .btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
+  .btn:focus-visible, a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
+  .brand-foot {
+    padding: 40px var(--pad) 56px; color: var(--ink-3); font-size: 12px;
+    border-top: 1px solid var(--line); letter-spacing: 0.02em;
+  }
+    :host { --section-gap: clamp(80px, 9vw, 128px); display: block; }
+    .nav {
+      position: sticky; top: 0; z-index: 20; height: 48px; display: flex; align-items: center; justify-content: space-between;
+      padding: 0 var(--pad); font-size: 13px; background: var(--header-bg);
+      backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
+    }
+    .nav a { color: var(--ink-2); }
+    .nav a:hover { color: var(--ink); }
+    .nav .t { color: var(--ink); font-weight: 600; letter-spacing: -0.01em; }
+    main { overflow: hidden; }
+    .block { padding: 0 var(--pad); margin-top: var(--section-gap); text-align: center; }
+    .block > * { text-align: left; }
+    .block.first { margin-top: 0; }
+    .inner { max-width: 1100px; margin: 0 auto; }
+    .measure { max-width: 42em; margin-left: auto; margin-right: auto; }
+
+    /* 1. Hero */
+    .hero { padding: clamp(40px, 6vw, 80px) var(--pad) 0; text-align: center; }
+    .hero .shot { max-width: 1000px; margin: 0 auto clamp(32px, 4vw, 56px); }
+    /* 深色下:白底主 KV 用 multiply 融进纯黑页;浅色下不加任何套壳 */
+    .hero .shot { background: transparent; }
+    .hero .shot img { width: 100%; height: auto; mix-blend-mode: var(--img-blend); filter: var(--img-filter); }
+    .hero .latin { font-size: 13px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; margin: 0 0 16px; }
+    .hero h1 { margin: 0 auto; max-width: 14em; font-size: clamp(40px, 6.4vw, 72px); line-height: 1.05; font-weight: 700; letter-spacing: -0.03em; }
+    .hero .sub { margin: 20px auto 0; max-width: 30em; font-size: clamp(17px, 2vw, 21px); line-height: 1.45; color: var(--ink-2); }
+
+    /* 2. 主张 */
+    .claim { text-align: center; }
+    .claim p { margin: 0 auto; max-width: 22em; font-size: clamp(22px, 3vw, 28px); line-height: 1.45; font-weight: 500; letter-spacing: -0.01em; }
+
+    /* 3. 规格速览 */
+    .specs { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
+    .spec { padding: 32px 20px; text-align: center; border-left: 1px solid var(--line); }
+    .spec:first-child { border-left: 0; }
+    .spec dt { font-size: 12px; color: var(--ink-3); margin-bottom: 10px; letter-spacing: 0.04em; }
+    .spec dd { margin: 0; font-size: clamp(18px, 2.2vw, 26px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; }
+    @media (max-width: 720px) {
+      .specs { grid-template-columns: 1fr 1fr; }
+      .spec { padding: 24px 12px; }
+      .spec:nth-child(odd) { border-left: 0; }
+      .spec:nth-child(n + 3) { border-top: 1px solid var(--line); }
+    }
+
+    /* 4. 内容段 */
+    .sec { display: grid; grid-template-columns: 1fr; gap: 32px; align-items: center; }
+    .sec + .sec { margin-top: clamp(64px, 8vw, 120px); }
+    .sec.has-fig { grid-template-columns: minmax(0, 1fr) minmax(0, 360px); }
+    @media (max-width: 860px) { .sec.has-fig { grid-template-columns: 1fr; } }
+    .sec .eyebrow { margin-bottom: 18px; }
+    .sec p { margin: 0; font-size: clamp(18px, 1.8vw, 20px); line-height: 1.75; color: var(--ink); letter-spacing: 0.002em; }
+    .fig { margin: 0; }
+
+    /* 5. BOM */
+    .h2 { font-size: clamp(32px, 4.4vw, 48px); line-height: 1.1; letter-spacing: -0.025em; font-weight: 700; margin: 0; }
+    .lead { margin: 16px 0 48px; font-size: clamp(16px, 1.8vw, 19px); line-height: 1.6; color: var(--ink-2); max-width: 34em; }
+    .block-head { margin-bottom: 40px; }
+
+    /* 6. 工艺 */
+    .proc { border-top: 1px solid var(--line); }
+    .proc-row {
+      display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.4fr) 110px 150px 90px;
+      gap: 24px; align-items: center; padding: 26px 0; border-bottom: 1px solid var(--line);
+    }
+    .pr-name { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
+    .pr-name small { display: block; margin-top: 6px; font-size: 13px; font-weight: 400; color: var(--ink-3); letter-spacing: 0; }
+    .pr-eq { font-size: 14px; color: var(--ink-2); line-height: 1.5; }
+    .pr-k { display: block; font-size: 11px; color: var(--ink-3); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 6px; }
+    .pr-v { font-size: 15px; font-variant-numeric: tabular-nums; }
+    .ybar { height: 3px; border-radius: 2px; background: var(--line); margin-top: 8px; overflow: hidden; }
+    .ybar i { display: block; height: 100%; background: var(--ink); border-radius: 2px; }
+    .ybar.low i { background: var(--warn); }
+    .risk { grid-column: 1 / -1; display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.55; color: var(--ink-2); margin-top: -6px; }
+    .risk .dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); margin-top: 6px; }
+    .risk b { color: var(--ink); font-weight: 600; margin-right: 6px; }
+    @media (max-width: 900px) {
+      .proc-row { grid-template-columns: 1fr 1fr; gap: 18px; }
+      .pr-name, .pr-eq { grid-column: 1 / -1; }
+    }
+
+    /* 7. MOQ 阶梯 */
+    .moq table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
+    .moq thead th { font-size: 12px; font-weight: 400; color: var(--ink-3); text-align: left; padding: 0 12px 12px; border-bottom: 1px solid var(--line); }
+    .moq tbody th { text-align: left; font-weight: 500; font-size: 15px; padding: 20px 12px; border-bottom: 1px solid var(--line); vertical-align: top; width: 26%; }
+    .moq tbody th span { display: block; line-height: 1.35; }
+    .moq tbody th small { display: block; margin-top: 6px; font-size: 12px; font-weight: 400; color: var(--ink-3); }
+    .moq td { padding: 20px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
+    .moq .qty { font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
+    .moq .tag { background: var(--ink); color: var(--bg); font-size: 10px; padding: 1px 7px; border-radius: 99px; letter-spacing: 0.02em; }
+    .moq .unit { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin: 6px 0 4px; line-height: 1.1; }
+    .moq .unit small { display: block; font-size: 11px; font-weight: 400; color: var(--ink-3); letter-spacing: 0; margin-top: 2px; }
+    .moq .total { font-size: 12px; color: var(--ink-2); }
+    .moq tr.best td { background: var(--bg-soft); }
+    .moq tr.best th { box-shadow: inset 3px 0 0 var(--ink); }
+    .moq-note { margin: 20px 0 0; font-size: 12px; color: var(--ink-3); line-height: 1.6; }
+    @media (max-width: 720px) {
+      .moq thead { display: none; }
+      .moq tbody th { width: auto; }
+      .moq tr { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
+      .moq tr th { grid-column: 1 / -1; border-bottom: 0; padding-bottom: 4px; }
+      .moq tr td { border-bottom: 0; padding: 8px 12px 16px; }
+      .moq tr.best th { box-shadow: inset 3px 0 0 var(--ink); }
+    }
+
+    /* 8. 成本 */
+    .figures { margin-top: clamp(48px, 6vw, 72px); display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; border-top: 1px solid var(--line); padding-top: 40px; }
+    @media (max-width: 720px) { .figures { grid-template-columns: 1fr; gap: 32px; } }
+    .figures .k { font-size: 13px; color: var(--ink-3); margin-bottom: 10px; }
+    .figures .v { font-size: clamp(32px, 4vw, 48px); font-weight: 700; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
+    .figures .v.hero { color: var(--ink); }
+    .figures .f { margin-top: 10px; font-size: 13px; color: var(--ink-3); }
+
+    /* 9. CTA */
+    .cta { text-align: center; padding-bottom: 40px; }
+    .cta h2 { margin: 0 0 14px; font-size: clamp(30px, 4vw, 44px); font-weight: 700; letter-spacing: -0.025em; }
+    .cta p { margin: 0 0 32px; color: var(--ink-2); font-size: 17px; }
+    .cta .row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }`;
+
+export const productStyle = [themeCss, sharedHtmlCss, footerCss, own];

+ 40 - 0
site/services/products.js

@@ -0,0 +1,40 @@
+/**
+ * services/products.js —— 产品数据加载(相对路径 fetch + 内存缓存)。
+ */
+const IDS = ['recorder-bean', 'watch-case', 'round-screen', 'ai-pin', 'eink-tag', 'pocket-ai', 'bone-headset', 'smart-ring'];
+export { IDS };
+
+const cache = new Map();
+
+export function loadProduct(id) {
+  if (cache.has(id)) return cache.get(id);
+  const url = new URL(`./data/products/${encodeURIComponent(id)}.json`, document.baseURI).href;
+  const p = fetch(url).then((r) => {
+    if (!r.ok) throw new Error(`产品 ${id} 加载失败(HTTP ${r.status})`);
+    return r.json();
+  }).catch((e) => { cache.delete(id); throw e; });
+  cache.set(id, p);
+  return p;
+}
+
+/** 展厅顺序:列表顺序 + 预加载全部(8 个 JSON 很小) */
+export function loadAll() {
+  return Promise.all(IDS.map((id) => loadProduct(id)));
+}
+
+/** BOM 分组:固定顺序,组内按 seq */
+export const GROUP_ORDER = ['结构件', '加工件', '电子件', '辅料', '包材'];
+export const GROUP_LABEL = { 结构件: '结构件', 加工件: '加工件', 电子件: '电子件', 辅料: '辅料', 包材: '包材' };
+
+export function bomGroups(bom) {
+  const map = new Map();
+  for (const r of bom?.rows || []) {
+    const g = r.group || '其他';
+    if (!map.has(g)) map.set(g, []);
+    map.get(g).push(r);
+  }
+  const rank = (g) => { const i = GROUP_ORDER.indexOf(g); return i < 0 ? GROUP_ORDER.length : i; };
+  return [...map.entries()]
+    .sort((a, b) => rank(a[0]) - rank(b[0]))
+    .map(([g, rows]) => ({ group: g, rows: rows.sort((x, y) => x.seq - y.seq), subtotal: rows.reduce((s, r) => s + r.subtotal, 0) }));
+}

+ 320 - 0
site/services/viewer3d.js

@@ -0,0 +1,320 @@
+/**
+ * services/viewer3d.js —— Babylon 3D 外壳查看器(实验室专用,只在 /lab 页面初始化)。
+ * - 用 core/geometry/profile.js 的回转母线把圆件/表壳/戒指的「壳体」绕 Z 轴旋转成型
+ * - 方件(rect)用圆角矩形挤出 + 布尔减(内腔 + 屏沉台)
+ * - 相机:单指旋转(ArcRotate 默认)、双指缩放、双击复位
+ * - rebuild(params) 合并到 requestAnimationFrame;dispose 释放引擎 / 场景 / 画布监听
+ * Babylon 由调用方动态 import(window.BABYLON),见 page/lab.js 的 ensureBabylon()。
+ */
+import { roundProfile } from '../core/geometry/profile.js';
+import { radiusAtHeight } from '../core/geometry/profile.js';
+
+/** 整数化顶点,用于 C1(位置重合)去重 */
+const key = (x, y, z) => `${x.toFixed(4)},${y.toFixed(4)},${z.toFixed(4)}`;
+
+/** 截面点抽样:与前一点过近的中间点省掉,保证顶点连续、不孤悬末点 */
+function simplify(points, minStep = 0.06) {
+  const out = [];
+  for (const p of points) {
+    const q = out[out.length - 1];
+    if (q && Math.hypot(p[0] - q[0], p[1] - q[1]) < minStep) {
+      out[out.length - 1] = p; // 用后点替换前点:末点永远保留
+      continue;
+    }
+    out.push(p);
+  }
+  return out;
+}
+
+/**
+ * 把闭合母线 [r,z] 绕 Z 轴旋转成网格数据并做顶点缝合(去掉接缝重复顶点)。
+ * 圆件只有右半母线 → 整圈;这里统一处理任意闭合环(含轴线段 r=0)。
+ */
+export function latheMesh(BABYLON, points, segments = 96) {
+  const positions = [], indices = [];
+  // 每一段母线点生成一圈
+  const cols = points.length;
+  const grid = [];
+  for (let i = 0; i < cols; i++) {
+    const [r, z] = points[i];
+    const row = [];
+    for (let s = 0; s < segments; s++) {
+      const a = (s / segments) * Math.PI * 2;
+      row.push([r * Math.cos(a), r * Math.sin(a), z]);
+    }
+    grid.push(row);
+  }
+  const map = new Map();
+  const vid = (p) => {
+    const k = key(p[0], p[1], p[2]);
+    let id = map.get(k);
+    if (id === undefined) { id = positions.length / 3; positions.push(p[0], p[1], p[2]); map.set(k, id); }
+    return id;
+  };
+  for (let i = 0; i < cols; i++) {
+    const i2 = (i + 1) % cols;
+    for (let s = 0; s < segments; s++) {
+      const s2 = (s + 1) % segments;
+      const a = vid(grid[i][s]), b = vid(grid[i2][s]), c = vid(grid[i2][s2]), d = vid(grid[i][s2]);
+      // 退化三角形跳过(轴上缝合产生的重合顶点)
+      if (a !== b && b !== c && a !== c) indices.push(a, b, c);
+      if (a !== c && c !== d && a !== d) indices.push(a, c, d);
+    }
+  }
+  const normals = [];
+  BABYLON.VertexData.ComputeNormals(positions, indices, normals);
+  const vd = new BABYLON.VertexData();
+  vd.positions = positions; vd.indices = indices; vd.normals = normals;
+  return vd;
+}
+
+export class ShellViewer {
+  /**
+   * @param {HTMLCanvasElement} canvas
+   * @param {object} product 产品 json(shape.type / materials)
+   */
+  constructor(canvas, product) {
+    const B = (this.B = window.BABYLON);
+    if (!B) throw new Error('Babylon 未加载');
+    this.canvas = canvas;
+    this.product = product;
+    this.params = { ...(product.shape?.defaults || {}) };
+    this._raf = 0;
+    this._disp = null;
+    this._onUnload = () => this.dispose();
+
+    const engine = (this.engine = new B.Engine(canvas, true, {
+      preserveDrawingBuffer: false, stencil: true, antialias: true,
+      powerPreference: 'high-performance',
+    }, true));
+    const scene = (this.scene = new B.Scene(engine));
+    scene.clearColor = new B.Color4(0, 0, 0, 0); // 透明,露出页面底色(浅白 / 深黑)
+
+    const cam = (this.camera = new B.ArcRotateCamera('cam', -Math.PI / 2 + 0.6, Math.PI / 3.1, 120, B.Vector3.Zero(), scene));
+    cam.attachControl(canvas, true);
+    cam.lowerRadiusLimit = 5;
+    cam.upperRadiusLimit = 1500;
+    cam.wheelPrecision = 3;
+    cam.pinchPrecision = 30;
+    cam.pinchDeltaPercentage = 0.02;
+    cam.panningSensibility = 0;         // 单指旋转,不平移(双指缩放)
+    cam.minZ = 0.5;
+    cam.maxZ = 4000;
+    this._home = { alpha: cam.alpha, beta: cam.beta, radius: cam.radius, target: cam.target.clone() };
+
+    // 双击复位(触屏没有 dblclick:自行识别 300ms 内两次 tap)
+    this._tapT = 0;
+    this._pd = (e) => {
+      if (e.pointerType !== 'touch') return;
+      const now = performance.now();
+      if (now - this._tapT < 300) this.reset();
+      this._tapT = now;
+    };
+    canvas.addEventListener('pointerdown', this._pd);
+    this._dbl = () => this.reset();
+    canvas.addEventListener('dblclick', this._dbl);
+
+    const hemi = new B.HemisphericLight('hemi', new B.Vector3(0.2, 1, 0.15), scene);
+    hemi.intensity = 0.75;
+    hemi.groundColor = new B.Color3(0.3, 0.3, 0.33);
+    const key = new B.DirectionalLight('key', new B.Vector3(-0.7, -1, 0.6), scene);
+    key.intensity = 0.85;
+    const rim = new B.DirectionalLight('rim', new B.Vector3(0.8, -0.2, -0.8), scene);
+    rim.intensity = 0.35;
+
+
+    this.engine.runRenderLoop(() => scene.render());
+    this._resize = () => engine.resize();
+    addEventListener('resize', this._resize);
+    addEventListener('pagehide', this._onUnload, { once: true });
+    if (typeof ResizeObserver !== 'undefined') {
+      this._ro = new ResizeObserver(() => engine.resize());
+      this._ro.observe(canvas.parentElement || canvas);
+    }
+
+    this.build();
+  }
+
+  /** 当前网格顶点/索引统计(验收用) */
+  stats() {
+    const m = this.mesh;
+    return m ? { positions: m.getTotalVertices(), indices: m.getTotalIndices(), params: { ...this.params } } : null;
+  }
+
+  setParams(patch) {
+    Object.assign(this.params, patch);
+    if (!this._raf) {
+      this._raf = requestAnimationFrame(() => {
+        this._raf = 0;
+        this.build();
+        this._onChange?.();
+      });
+    }
+  }
+
+  build() {
+    const B = this.B;
+    if (this.mesh) { this.mesh.dispose(); this.mesh = null; }
+    try {
+      this.mesh = this.product.shape?.type === 'rect' ? this._buildRect() : this._buildLathe();
+    } catch (e) {
+      console.warn('[viewer] 重建失败', e);
+      return;
+    }
+    this.mesh.material = this._material();
+    // 把模型放到地台上:包围盒最小 z → 0,水平居中
+    const bb = this.mesh.getBoundingInfo().boundingBox;
+    const min = bb.minimumWorld, max = bb.maximumWorld;
+    this.mesh.position = new B.Vector3(-(min.x + max.x) / 2, -(min.y + max.y) / 2, -min.z);
+    const size = Math.max(max.x - min.x, max.y - min.y, max.z - min.z);
+    if (!this._framed) {
+      this.camera.radius = size * 1.9;
+      this.camera.target = new B.Vector3(0, 0, (max.z - min.z) / 2);
+      camSnapshot(this.camera, this._home);
+      this._framed = true;
+    }
+    return this.mesh;
+  }
+
+  _rectMaterial() {
+    const B = this.B;
+    const m = new B.StandardMaterial('rectMat', this.scene);
+    m.diffuseColor = new B.Color3(0.68, 0.69, 0.71);
+    m.specularColor = new B.Color3(0.35, 0.35, 0.35);
+    m.specularPower = 64;
+    m.backFaceCulling = false;
+    return m;
+  }
+
+  _material() {
+    const B = this.B;
+    // StandardMaterial:漫反射 + 高光 + 边缘 Fresnel,无外部环境贴图也能看出曲面明暗
+    const mat = new B.StandardMaterial('shellMat', this.scene);
+    const id = this.product.materials?.[0];
+    const alu = /^al-|^ti$/.test(id || '');
+    mat.diffuseColor = alu ? new B.Color3(0.72, 0.73, 0.75) : new B.Color3(0.8, 0.8, 0.82);
+    mat.specularColor = alu ? new B.Color3(0.65, 0.65, 0.68) : new B.Color3(0.22, 0.22, 0.24);
+    mat.specularPower = alu ? 96 : 24;
+    mat.emissiveColor = new B.Color3(0.12, 0.12, 0.13);
+    mat.backFaceCulling = false; // 截面开放处也能看到内壁
+    return mat;
+  }
+
+  _buildLathe() {
+    const B = this.B;
+    const prof = roundProfile(this.params);
+    this.profile = prof;
+    let pts = simplify(prof.points.filter((p) => p[0] > 1e-4));
+    // 母线是「右半截面」,首尾都在轴上 → 首尾各补一个轴点闭合外表面
+    if (pts.length > 2) pts = [[0, pts[0][1]], ...pts, [0, pts[pts.length - 1][1]]];
+    const vd = latheMesh(B, pts, 112);
+    const mesh = new B.Mesh('shell', this.scene);
+    vd.applyToMesh(mesh, true);
+    try {
+      // 法线统一朝外(回转体逐段朝外法向 = 指向远离轴线的凸侧)
+      mesh.flipFaces(latheWinding(pts) > 0);
+      const normals = [];
+      B.VertexData.ComputeNormals(mesh.getVerticesData(B.VertexBuffer.PositionKind), mesh.getIndices(), normals);
+      mesh.setVerticesData(B.VertexBuffer.NormalKind, normals);
+    } catch (e) { console.warn('[viewer] 法线修正跳过', e); }
+    return mesh;
+  }
+
+  _buildRect() {
+    const B = this.B;
+    const p = this.params;
+    const L = Math.max(4, +p.length || 40), W = Math.max(4, +p.dTop || 30), H = Math.max(2, +p.height || 8);
+    const wall = Math.max(0.4, +p.wall || 1.5);
+    const cap = Math.min(Math.max(0, +p.capR || 0), H / 2 - 0.3);
+
+    // 圆角矩形闭合轮廓(逆时针,中心在原点)
+    const loop = (l, w, r) => {
+      const hw = l / 2, hh = w / 2, rr = Math.max(0.05, Math.min(r, hw - 0.05, hh - 0.05));
+      const pts = [];
+      const arc = (cx, cy, a0, a1) => { for (let i = 0; i <= 6; i++) { const a = a0 + (a1 - a0) * (i / 6); pts.push([cx + rr * Math.cos(a), cy + rr * Math.sin(a)]); } };
+      arc(hw - rr, -hh + rr, -Math.PI / 2, 0);
+      arc(hw - rr, hh - rr, 0, Math.PI / 2);
+      arc(-hw + rr, hh - rr, Math.PI / 2, Math.PI);
+      arc(-hw + rr, -hh + rr, Math.PI, 1.5 * Math.PI);
+      return pts;
+    };
+    const outer = loop(L, W, Math.max(0, +p.cornerR || 0));
+    const inner = loop(L - 2 * wall, W - 2 * wall, Math.max(0.5, (+p.cornerR || 0) - wall));
+    const n = outer.length;
+    const zTop = Math.max(0.6, H - Math.max(0.6, wall)); // 内腔顶(壳底)
+    const zCap = zTop - cap;                               // 顶部圆角起点
+
+    // 水平剖面 = 一串「圆角矩形环」,相邻环之间拉出面:外壁 ↑ → 顶面环带 → 内壁 ↓;底环带封底
+    const rings = [
+      outer.map(([x, y]) => [x, y, 0]),
+      outer.map(([x, y]) => [x, y, zCap]),
+      outer.map(([x, y]) => [x, y, zTop]),
+      inner.map(([x, y]) => [x, y, zTop]),
+      inner.map(([x, y]) => [x, y, 0]),
+    ];
+    const positions = [], indices = [];
+    const add = (x, y, z) => { positions.push(x, y, z); return positions.length / 3 - 1; };
+    const ids = rings.map((ring) => ring.map(([x, y, z]) => add(x, y, z)));
+    void zTop;
+    for (let r = 0; r < ids.length - 1; r++) {
+      const A = ids[r], Bn = ids[r + 1];
+      for (let i = 0; i < n; i++) {
+        const j = (i + 1) % n;
+        indices.push(A[i], A[j], Bn[j], A[i], Bn[j], Bn[i]);
+      }
+    }
+    // 底环带(底面:从内环到外环)
+    const ob = outer.map(([x, y]) => add(x, y, 0));
+    const ib = inner.map(([x, y]) => add(x, y, 0));
+    for (let i = 0; i < n; i++) { const j = (i + 1) % n; indices.push(ob[j], ob[i], ib[i], ob[j], ib[i], ib[j]); }
+    const vd = new B.VertexData();
+    vd.positions = positions; vd.indices = indices;
+    const normals = []; B.VertexData.ComputeNormals(positions, indices, normals); vd.normals = normals;
+    const mesh = new B.Mesh('shell', this.scene);
+    vd.applyToMesh(mesh, true);
+    mesh.material = this._rectMaterial();
+    mesh.refreshBoundingInfo();
+    return mesh;
+  }
+
+  reset() {
+    const c = this.camera;
+    c.alpha = this._home.alpha; c.beta = this._home.beta; c.radius = this._home.radius;
+    c.target.copyFrom(this._home.target);
+  }
+
+  dispose() {
+    this._alive = false;
+    if (this._raf) { cancelAnimationFrame(this._raf); this._raf = 0; }
+    removeEventListener('resize', this._resize);
+    removeEventListener('pagehide', this._onUnload);
+    if (this._ro) { this._ro.disconnect(); this._ro = null; }
+    if (this._dbl) this.canvas.removeEventListener('dblclick', this._dbl);
+    if (this._pd) this.canvas.removeEventListener('pointerdown', this._pd);
+    try { this.camera?.dispose(); } catch { /* noop */ }
+    try { this.scene?.dispose(); } catch { /* noop */ }
+    try { this.engine?.stopRenderLoop(); this.engine?.dispose(); } catch { /* noop */ }
+    this.mesh = null;
+    this.scene = null;
+    this.engine = null;
+    this.camera = null;
+  }
+}
+
+/** 母线绕轴旋转后按右手系判断三角形绕向(鞋带和 > 0 表示需翻转) */
+function latheWinding(pts) {
+  let area = 0;
+  for (let i = 0; i < pts.length; i++) {
+    const [r0, z0] = pts[i], [r1, z1] = pts[(i + 1) % pts.length];
+    area += r0 * z1 - r1 * z0;
+  }
+  return area;
+}
+
+function camSnapshot(cam, into) {
+  into.alpha = cam.alpha; into.beta = cam.beta; into.radius = cam.radius;
+  if (into.target) into.target.copyFrom(cam.target); else into.target = cam.target.clone();
+}
+
+/** 只用于测试半径插值导出的薄封装(避免循环依赖告警) */
+export { radiusAtHeight };

+ 78 - 0
site/tests/t-geometry.test.js

@@ -0,0 +1,78 @@
+import { test } from 'node:test';
+import assert from 'node:assert/strict';
+import { roundProfile, revolveVolume, radiusAtHeight, checkG1 } from '../core/geometry/profile.js';
+import { partsVolumeCm3 } from '../core/geometry/rect.js';
+import { buildParts, explodeOffsets } from '../core/geometry/assembly.js';
+import { interference } from '../core/geometry/interference.js';
+
+const round = { dTop: 61.6, dBottom: 58.0, height: 14.6, wall: 1.8, domeR: 2.0, platform: 1.0, recessR: 1.2, recessDepth: 1.0, screenD: 45.68, chamferC: 0.5, draft: 1.0 };
+
+test('圆件轮廓 G1 连续:无硬边台阶', () => {
+  const pr = roundProfile(round);
+  assert.equal(pr.g1, true, pr.warnings.join(';'));
+  assert.ok(checkG1(pr.points).worst < 12);
+});
+
+test('圆件轮廓极值符合包络', () => {
+  const pr = roundProfile(round);
+  assert.ok(Math.abs(pr.meta.bbox.height - 14.6) < 1e-6);
+  assert.ok(pr.meta.outerR <= 61.6 / 2 + 1e-6);
+  assert.ok(pr.meta.outerR > 27, '外径应接近 Ø61.6');
+  assert.ok(Math.abs(pr.meta.screenR - 45.68 / 2) < 1e-9);
+});
+
+test('极端参数仍不产生 >30° 外轮廓硬边', () => {
+  const cases = [];
+  for (const wall of [0.8, 3.0, 4.0]) for (const domeR of [0.5, 2, 5]) for (const platform of [0, 1, 4])
+    for (const screenD of [30, 45, 52]) for (const draft of [0, 1, 3])
+      cases.push({ ...round, wall, domeR, platform, screenD, draft });
+  for (const c of cases) {
+    const pr = roundProfile(c);
+    const bad = pr.points.filter((_, i, a) => {
+      const p = a[(i - 1 + a.length) % a.length], q = a[i], r = a[(i + 1) % a.length];
+      const v1 = [q[0] - p[0], q[1] - p[1]], v2 = [r[0] - q[0], r[1] - q[1]];
+      const l1 = Math.hypot(...v1), l2 = Math.hypot(...v2);
+      if (l1 < 1e-6 || l2 < 1e-6) return false;
+      return Math.acos(Math.max(-1, Math.min(1, (v1[0] * v2[0] + v1[1] * v2[1]) / (l1 * l2)))) * 180 / Math.PI > 30;
+    });
+    assert.equal(bad.length, 0, JSON.stringify(c));
+  }
+});
+
+test('拔模角增大 → 底半径减小', () => {
+  const a = roundProfile({ ...round, draft: 0 }).meta.rBot;
+  const b = roundProfile({ ...round, draft: 3 }).meta.rBot;
+  assert.ok(b < a);
+  assert.ok(Math.abs(a - b - 14.6 * Math.tan(Math.PI / 180 / 0.5773) ) > 0);
+});
+
+test('体积为正且随壁厚增大而增大', () => {
+  const v1 = revolveVolume(roundProfile(round));
+  const v2 = revolveVolume(roundProfile({ ...round, wall: 3 }));
+  assert.ok(v1 > 0 && v2 > v1);
+});
+
+test('radiusAtHeight 外壁单调', () => {
+  const pr = roundProfile(round);
+  assert.ok(radiusAtHeight(pr, 10) >= radiusAtHeight(pr, 2));
+});
+
+test('方件体积', () => {
+  const v = partsVolumeCm3({ l: 40, w: 30, t: 5, hollow: true, wall: 1.5 });
+  assert.ok(v > 0 && v < 40 * 30 * 5 / 1000);
+});
+
+test('装配分层与爆炸位移', () => {
+  const parts = buildParts({ type: 'round', defaults: round }, [{ id: 'back', role: 'back' }, { id: 'front', role: 'lid' }]);
+  assert.ok(parts.length >= 9);
+  const offs = explodeOffsets(parts, 100);
+  assert.ok(offs.some((o) => o.dist > 0));
+});
+
+test('干涉检测', () => {
+  const r = interference({ l: 10, w: 10, t: 5 }, { l: 10, w: 10, t: 5 }, { z: 0 }, 1, 1, 0.4);
+  assert.equal(r.clash, true);
+  assert.ok(r.gap < 0);
+  const r2 = interference({ l: 10, w: 10, t: 5 }, { l: 10, w: 10, t: 5 }, { z: 8 }, 1, 1, 0.4);
+  assert.ok(r2.gap > 0);
+});

+ 50 - 0
site/utils/format.js

@@ -0,0 +1,50 @@
+/**
+ * utils/format.js —— 数字/价格/百分比格式化(详情页、实验室共用)。
+ */
+export function money(v, digits) {
+  const n = Number(v) || 0;
+  if (digits != null) return '¥' + n.toFixed(digits);
+  if (Math.abs(n) >= 1000) return '¥' + n.toLocaleString('zh-CN', { maximumFractionDigits: 0 });
+  if (Number.isInteger(n)) return '¥' + n;
+  return '¥' + n.toFixed(2).replace(/\.?0+$/, '');
+}
+
+/** 0.965 → '96.5%';入参若已是百分数(>1.5)则原样 */
+export function pct(v, digits = 1) {
+  const n = Number(v) || 0;
+  const p = n > 1.5 ? n : n * 100;
+  return p.toFixed(digits).replace(/\.0$/, '') + '%';
+}
+
+export function num(v) {
+  const n = Number(v) || 0;
+  return n.toLocaleString('zh-CN');
+}
+
+export function esc(s) {
+  return String(s ?? '').replace(/[&<>"]/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;' }[c]));
+}
+
+/** 实验室滑块的合理范围(按键名 + 默认值推断) */
+const RANGE = {
+  dTop: [10, 200], dBottom: [10, 200], height: [3, 60], wall: [0.4, 4.5], domeR: [0.3, 6],
+  platform: [0, 4], recessR: [0.2, 4], recessDepth: [0.1, 8], screenD: [4, 180], chamferC: [0, 3],
+  draft: [0, 5], split: [0, 1], cornerR: [0, 24], length: [10, 220], screenH: [4, 160], capR: [0.5, 12],
+  bandD: [8, 40], ringD: [12, 140], ringBandW: [3, 20],
+};
+export function rangeFor(key, def) {
+  const r = RANGE[key];
+  if (r) return r;
+  const d = Math.abs(Number(def) || 1);
+  return [0, Math.max(1, Math.round(d * 4))];
+}
+export const STEP = { split: 0.01, draft: 0.1, wall: 0.1, domeR: 0.1, recessR: 0.1, chamferC: 0.1, capR: 0.1, platform: 0.1 };
+export function stepFor(key) { return STEP[key] ?? 0.1; }
+
+/** 形参键名的中文标签 */
+export const KEY_LABEL = {
+  dTop: '顶部外径 / 宽', dBottom: '底部外径', height: '总高', wall: '壁厚', domeR: '顶部凸圆 R',
+  platform: '顶部平台', recessR: '屏边凹圆 R', recessDepth: '沉台深度', screenD: '屏 / 沉台直径',
+  chamferC: '底边倒角 C', draft: '拔模角', split: '拼色分割', cornerR: '水平角 R', length: '长度',
+  screenH: '屏高', capR: '长边圆角 R', bandD: '表带连接宽', ringD: '内径', ringBandW: '截面宽',
+};

+ 82 - 0
site/utils/router.js

@@ -0,0 +1,82 @@
+/**
+ * utils/router.js —— hash 路由(#/、#/p/<id>、#/lab/<id>)。
+ * 原生 hashchange 驱动;子路径部署安全(hash 与部署前缀无关)。链接用 <a data-link href="#/...">,
+ * 全局统一拦截,只改 hash,不整页刷新。
+ */
+
+/** '/p/ai-pin' → '#/p/ai-pin' */
+export function linkHref(path) {
+  const clean = String(path || '/').replace(/^#/, '');
+  return '#' + (clean.startsWith('/') ? clean : '/' + clean);
+}
+
+/** 当前 hash → 应用内路径('#/' → '/', '' → '/') */
+export function currentPath() {
+  const h = location.hash.replace(/^#/, '');
+  if (!h) return '/';
+  return '/' + h.replace(/^\/+/, '');
+}
+
+/** 路由匹配:支持 :param;'*' 为兜底 */
+export function matchRoute(pattern, path) {
+  if (pattern === '*') return {};
+  const pp = pattern.split('/').filter(Boolean);
+  const ap = path.split('/').filter(Boolean);
+  if (pp.length !== ap.length) return null;
+  const params = {};
+  for (let i = 0; i < pp.length; i++) {
+    const seg = pp[i];
+    let v = ap[i];
+    try { v = decodeURIComponent(v); } catch { /* 保留原文 */ }
+    if (seg.startsWith(':')) params[seg.slice(1)] = v;
+    else if (seg !== v) return null;
+  }
+  return params;
+}
+
+export function createRouter(routes) {
+  const listeners = new Set();
+  const router = {
+    navigate(path, { replace = false } = {}) {
+      const hash = linkHref(path);
+      if (location.hash === hash) { for (const fn of listeners) fn(); return; }
+      if (replace) {
+        const url = location.pathname + location.search + hash;
+        history.replaceState({}, '', url);
+        for (const fn of listeners) fn();
+      } else {
+        location.hash = hash; // 触发 hashchange → notify
+      }
+    },
+    resolve() {
+      const path = currentPath();
+      for (const r of routes) {
+        const params = matchRoute(r.path, path);
+        if (params) return { path, params, route: r.path, render: r.render };
+      }
+      const last = routes[routes.length - 1];
+      return { path, params: {}, route: '*', render: last.render };
+    },
+    subscribe(fn) { listeners.add(fn); return () => listeners.delete(fn); },
+    start(paint) {
+      try { paint(); } catch (e) { console.error('[router] paint initial', e); }
+      addEventListener('hashchange', paint);
+      history.scrollRestoration = 'manual';
+      listeners.add(paint);
+      // composedPath 穿透 Shadow DOM;无修饰键左键才算导航
+      document.addEventListener('click', (e) => {
+        if (e.defaultPrevented || e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) return;
+        const a = e.composedPath().find((n) => n instanceof HTMLAnchorElement && n.hasAttribute('data-link'));
+        if (!a || a.target === '_blank') return;
+        e.preventDefault();
+        const href = a.getAttribute('href');
+        if (!href.startsWith('#')) return;
+        if (location.hash === href) { for (const fn of listeners) fn(); return; }
+        location.hash = href;
+      });
+      if (!location.hash) history.replaceState({}, '', location.pathname + location.search + '#/');
+      return router;
+    },
+  };
+  return router;
+}

+ 20 - 0
site/utils/storage.js

@@ -0,0 +1,20 @@
+/**
+ * utils/storage.js —— localStorage 薄封装:带前缀、JSON、异常静默(隐私模式 / 配额满)。
+ */
+const PREFIX = 'phl:';
+
+export function lsGet(key, fallback = null) {
+  try {
+    const raw = localStorage.getItem(PREFIX + key);
+    return raw == null ? fallback : JSON.parse(raw);
+  } catch { return fallback; }
+}
+
+export function lsSet(key, value) {
+  try { localStorage.setItem(PREFIX + key, JSON.stringify(value)); return true; }
+  catch { return false; }
+}
+
+export function lsDel(key) {
+  try { localStorage.removeItem(PREFIX + key); } catch { /* noop */ }
+}

+ 80 - 0
site/utils/theme.js

@@ -0,0 +1,80 @@
+/**
+ * utils/theme.js —— Apple 风格浅/深色令牌(阶段 C 展厅 + 详情页 + 实验室)。
+ * 主 KV 是纯白底照片:浅色下底色纯白,图片无边框阴影直接融进页面;
+ * 深色下页面转纯黑,图片用 multiply 混色把白底压成黑底(黑底 × 任何色不变,只显示产品本身)。
+ */
+
+export const themeCss = `
+  :host {
+    --bg: #ffffff;
+    --bg-soft: #f5f5f7;
+    --ink: #1d1d1f;
+    --ink-2: #6e6e73;
+    --ink-3: #86868b;
+    --line: rgba(0, 0, 0, 0.08);
+    --accent: #0071e3;
+    --warn: #ff9f0a;
+    --bar-1: #1d1d1f;
+    --img-blend: normal;
+    --img-filter: none;
+    --img-bg: #ffffff;
+    --header-bg: rgba(255, 255, 255, 0.8);
+    --pad: clamp(20px, 5vw, 64px);
+    --gap-block: clamp(72px, 10vw, 140px);
+    --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro SC", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
+    color: var(--ink);
+    background: var(--bg);
+    font-family: var(--font);
+    -webkit-font-smoothing: antialiased;
+    text-rendering: optimizeLegibility;
+  }
+  @media (prefers-color-scheme: dark) {
+    :host {
+      --bg: #000000;
+      --bg-soft: #0b0b0d;
+      --ink: #f5f5f7;
+      --ink-2: #a1a1a6;
+      --ink-3: #86868b;
+      --line: rgba(255, 255, 255, 0.14);
+      --accent: #2997ff;
+      --bar-1: #f5f5f7;
+      --img-blend: normal;
+      /* 白底主 KV → 屏幕混合:白色变透明,产品本体反相后仍保持中性灰 */
+      --img-filter: invert(1) hue-rotate(180deg) saturate(0.9);
+      --img-bg: #ffffff;
+      --header-bg: rgba(0, 0, 0, 0.72);
+    }
+  }
+  * { box-sizing: border-box; }
+  img { display: block; }
+  a { color: inherit; text-decoration: none; }
+`;
+
+export const sharedHtmlCss = `
+  .eyebrow { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; margin: 0; }
+  .kv { width: 100%; height: auto; mix-blend-mode: var(--img-blend); background: transparent; }
+  .link { color: var(--accent); }
+  .btn {
+    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
+    height: 48px; padding: 0 28px; border-radius: 980px; border: 1px solid transparent;
+    font: 500 16px/1 var(--font); cursor: pointer; background: var(--ink); color: var(--bg);
+    transition: opacity 0.2s ease, transform 0.2s ease;
+  }
+  .btn:hover { opacity: 0.86; }
+  .btn:active { transform: scale(0.98); }
+  .btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
+  .btn:focus-visible, a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
+  .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
+`;
+
+/** 品牌页脚 */
+export function brandFooter(html) {
+  return html`<footer class="brand-foot">FmodeCode · Pocket Hardware Lab</footer>`;
+}
+
+export const footerCss = `
+  .brand-foot {
+    padding: 40px var(--pad) 56px; color: var(--ink-3); font-size: 12px;
+    border-top: 1px solid var(--line); letter-spacing: 0.02em;
+  }
+`;

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
site/vendor/babylon/babylon.js


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
site/vendor/babylon/loaders.js


+ 693 - 0
site/vendor/earcut/earcut.js

@@ -0,0 +1,693 @@
+/*!
+ * earcut v3.0.1 —— mapbox/earcut(ISC License, © 2016 Mapbox)
+ * 本地副本:@babylonjs/core 的 ExtrudePolygon / PolygonMeshBuilder 需要全局 earcut。
+ * 原样取自 three.js 的 r-extras(`src/extras/lib/earcut.js`,同样是 mapbox/earcut 拷贝),仅补一行挂到 window。
+ */
+/* eslint-disable */
+// copy of mapbox/earcut version 3.0.1
+// https://github.com/mapbox/earcut/tree/v3.0.1
+
+export default function earcut(data, holeIndices, dim = 2) {
+
+    const hasHoles = holeIndices && holeIndices.length;
+    const outerLen = hasHoles ? holeIndices[0] * dim : data.length;
+    let outerNode = linkedList(data, 0, outerLen, dim, true);
+    const triangles = [];
+
+    if (!outerNode || outerNode.next === outerNode.prev) return triangles;
+
+    let minX, minY, invSize;
+
+    if (hasHoles) outerNode = eliminateHoles(data, holeIndices, outerNode, dim);
+
+    // if the shape is not too simple, we'll use z-order curve hash later; calculate polygon bbox
+    if (data.length > 80 * dim) {
+        minX = Infinity;
+        minY = Infinity;
+        let maxX = -Infinity;
+        let maxY = -Infinity;
+
+        for (let i = dim; i < outerLen; i += dim) {
+            const x = data[i];
+            const y = data[i + 1];
+            if (x < minX) minX = x;
+            if (y < minY) minY = y;
+            if (x > maxX) maxX = x;
+            if (y > maxY) maxY = y;
+        }
+
+        // minX, minY and invSize are later used to transform coords into integers for z-order calculation
+        invSize = Math.max(maxX - minX, maxY - minY);
+        invSize = invSize !== 0 ? 32767 / invSize : 0;
+    }
+
+    earcutLinked(outerNode, triangles, dim, minX, minY, invSize, 0);
+
+    return triangles;
+}
+
+// create a circular doubly linked list from polygon points in the specified winding order
+function linkedList(data, start, end, dim, clockwise) {
+    let last;
+
+    if (clockwise === (signedArea(data, start, end, dim) > 0)) {
+        for (let i = start; i < end; i += dim) last = insertNode(i / dim | 0, data[i], data[i + 1], last);
+    } else {
+        for (let i = end - dim; i >= start; i -= dim) last = insertNode(i / dim | 0, data[i], data[i + 1], last);
+    }
+
+    if (last && equals(last, last.next)) {
+        removeNode(last);
+        last = last.next;
+    }
+
+    return last;
+}
+
+// eliminate colinear or duplicate points
+function filterPoints(start, end) {
+    if (!start) return start;
+    if (!end) end = start;
+
+    let p = start,
+        again;
+    do {
+        again = false;
+
+        if (!p.steiner && (equals(p, p.next) || area(p.prev, p, p.next) === 0)) {
+            removeNode(p);
+            p = end = p.prev;
+            if (p === p.next) break;
+            again = true;
+
+        } else {
+            p = p.next;
+        }
+    } while (again || p !== end);
+
+    return end;
+}
+
+// main ear slicing loop which triangulates a polygon (given as a linked list)
+function earcutLinked(ear, triangles, dim, minX, minY, invSize, pass) {
+    if (!ear) return;
+
+    // interlink polygon nodes in z-order
+    if (!pass && invSize) indexCurve(ear, minX, minY, invSize);
+
+    let stop = ear;
+
+    // iterate through ears, slicing them one by one
+    while (ear.prev !== ear.next) {
+        const prev = ear.prev;
+        const next = ear.next;
+
+        if (invSize ? isEarHashed(ear, minX, minY, invSize) : isEar(ear)) {
+            triangles.push(prev.i, ear.i, next.i); // cut off the triangle
+
+            removeNode(ear);
+
+            // skipping the next vertex leads to less sliver triangles
+            ear = next.next;
+            stop = next.next;
+
+            continue;
+        }
+
+        ear = next;
+
+        // if we looped through the whole remaining polygon and can't find any more ears
+        if (ear === stop) {
+            // try filtering points and slicing again
+            if (!pass) {
+                earcutLinked(filterPoints(ear), triangles, dim, minX, minY, invSize, 1);
+
+            // if this didn't work, try curing all small self-intersections locally
+            } else if (pass === 1) {
+                ear = cureLocalIntersections(filterPoints(ear), triangles);
+                earcutLinked(ear, triangles, dim, minX, minY, invSize, 2);
+
+            // as a last resort, try splitting the remaining polygon into two
+            } else if (pass === 2) {
+                splitEarcut(ear, triangles, dim, minX, minY, invSize);
+            }
+
+            break;
+        }
+    }
+}
+
+// check whether a polygon node forms a valid ear with adjacent nodes
+function isEar(ear) {
+    const a = ear.prev,
+        b = ear,
+        c = ear.next;
+
+    if (area(a, b, c) >= 0) return false; // reflex, can't be an ear
+
+    // now make sure we don't have other points inside the potential ear
+    const ax = a.x, bx = b.x, cx = c.x, ay = a.y, by = b.y, cy = c.y;
+
+    // triangle bbox
+    const x0 = Math.min(ax, bx, cx),
+        y0 = Math.min(ay, by, cy),
+        x1 = Math.max(ax, bx, cx),
+        y1 = Math.max(ay, by, cy);
+
+    let p = c.next;
+    while (p !== a) {
+        if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 &&
+            pointInTriangleExceptFirst(ax, ay, bx, by, cx, cy, p.x, p.y) &&
+            area(p.prev, p, p.next) >= 0) return false;
+        p = p.next;
+    }
+
+    return true;
+}
+
+function isEarHashed(ear, minX, minY, invSize) {
+    const a = ear.prev,
+        b = ear,
+        c = ear.next;
+
+    if (area(a, b, c) >= 0) return false; // reflex, can't be an ear
+
+    const ax = a.x, bx = b.x, cx = c.x, ay = a.y, by = b.y, cy = c.y;
+
+    // triangle bbox
+    const x0 = Math.min(ax, bx, cx),
+        y0 = Math.min(ay, by, cy),
+        x1 = Math.max(ax, bx, cx),
+        y1 = Math.max(ay, by, cy);
+
+    // z-order range for the current triangle bbox;
+    const minZ = zOrder(x0, y0, minX, minY, invSize),
+        maxZ = zOrder(x1, y1, minX, minY, invSize);
+
+    let p = ear.prevZ,
+        n = ear.nextZ;
+
+    // look for points inside the triangle in both directions
+    while (p && p.z >= minZ && n && n.z <= maxZ) {
+        if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && p !== a && p !== c &&
+            pointInTriangleExceptFirst(ax, ay, bx, by, cx, cy, p.x, p.y) && area(p.prev, p, p.next) >= 0) return false;
+        p = p.prevZ;
+
+        if (n.x >= x0 && n.x <= x1 && n.y >= y0 && n.y <= y1 && n !== a && n !== c &&
+            pointInTriangleExceptFirst(ax, ay, bx, by, cx, cy, n.x, n.y) && area(n.prev, n, n.next) >= 0) return false;
+        n = n.nextZ;
+    }
+
+    // look for remaining points in decreasing z-order
+    while (p && p.z >= minZ) {
+        if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && p !== a && p !== c &&
+            pointInTriangleExceptFirst(ax, ay, bx, by, cx, cy, p.x, p.y) && area(p.prev, p, p.next) >= 0) return false;
+        p = p.prevZ;
+    }
+
+    // look for remaining points in increasing z-order
+    while (n && n.z <= maxZ) {
+        if (n.x >= x0 && n.x <= x1 && n.y >= y0 && n.y <= y1 && n !== a && n !== c &&
+            pointInTriangleExceptFirst(ax, ay, bx, by, cx, cy, n.x, n.y) && area(n.prev, n, n.next) >= 0) return false;
+        n = n.nextZ;
+    }
+
+    return true;
+}
+
+// go through all polygon nodes and cure small local self-intersections
+function cureLocalIntersections(start, triangles) {
+    let p = start;
+    do {
+        const a = p.prev,
+            b = p.next.next;
+
+        if (!equals(a, b) && intersects(a, p, p.next, b) && locallyInside(a, b) && locallyInside(b, a)) {
+
+            triangles.push(a.i, p.i, b.i);
+
+            // remove two nodes involved
+            removeNode(p);
+            removeNode(p.next);
+
+            p = start = b;
+        }
+        p = p.next;
+    } while (p !== start);
+
+    return filterPoints(p);
+}
+
+// try splitting polygon into two and triangulate them independently
+function splitEarcut(start, triangles, dim, minX, minY, invSize) {
+    // look for a valid diagonal that divides the polygon into two
+    let a = start;
+    do {
+        let b = a.next.next;
+        while (b !== a.prev) {
+            if (a.i !== b.i && isValidDiagonal(a, b)) {
+                // split the polygon in two by the diagonal
+                let c = splitPolygon(a, b);
+
+                // filter colinear points around the cuts
+                a = filterPoints(a, a.next);
+                c = filterPoints(c, c.next);
+
+                // run earcut on each half
+                earcutLinked(a, triangles, dim, minX, minY, invSize, 0);
+                earcutLinked(c, triangles, dim, minX, minY, invSize, 0);
+                return;
+            }
+            b = b.next;
+        }
+        a = a.next;
+    } while (a !== start);
+}
+
+// link every hole into the outer loop, producing a single-ring polygon without holes
+function eliminateHoles(data, holeIndices, outerNode, dim) {
+    const queue = [];
+
+    for (let i = 0, len = holeIndices.length; i < len; i++) {
+        const start = holeIndices[i] * dim;
+        const end = i < len - 1 ? holeIndices[i + 1] * dim : data.length;
+        const list = linkedList(data, start, end, dim, false);
+        if (list === list.next) list.steiner = true;
+        queue.push(getLeftmost(list));
+    }
+
+    queue.sort(compareXYSlope);
+
+    // process holes from left to right
+    for (let i = 0; i < queue.length; i++) {
+        outerNode = eliminateHole(queue[i], outerNode);
+    }
+
+    return outerNode;
+}
+
+function compareXYSlope(a, b) {
+    let result = a.x - b.x;
+    // when the left-most point of 2 holes meet at a vertex, sort the holes counterclockwise so that when we find
+    // the bridge to the outer shell is always the point that they meet at.
+    if (result === 0) {
+        result = a.y - b.y;
+        if (result === 0) {
+            const aSlope = (a.next.y - a.y) / (a.next.x - a.x);
+            const bSlope = (b.next.y - b.y) / (b.next.x - b.x);
+            result = aSlope - bSlope;
+        }
+    }
+    return result;
+}
+
+// find a bridge between vertices that connects hole with an outer ring and and link it
+function eliminateHole(hole, outerNode) {
+    const bridge = findHoleBridge(hole, outerNode);
+    if (!bridge) {
+        return outerNode;
+    }
+
+    const bridgeReverse = splitPolygon(bridge, hole);
+
+    // filter collinear points around the cuts
+    filterPoints(bridgeReverse, bridgeReverse.next);
+    return filterPoints(bridge, bridge.next);
+}
+
+// David Eberly's algorithm for finding a bridge between hole and outer polygon
+function findHoleBridge(hole, outerNode) {
+    let p = outerNode;
+    const hx = hole.x;
+    const hy = hole.y;
+    let qx = -Infinity;
+    let m;
+
+    // find a segment intersected by a ray from the hole's leftmost point to the left;
+    // segment's endpoint with lesser x will be potential connection point
+    // unless they intersect at a vertex, then choose the vertex
+    if (equals(hole, p)) return p;
+    do {
+        if (equals(hole, p.next)) return p.next;
+        else if (hy <= p.y && hy >= p.next.y && p.next.y !== p.y) {
+            const x = p.x + (hy - p.y) * (p.next.x - p.x) / (p.next.y - p.y);
+            if (x <= hx && x > qx) {
+                qx = x;
+                m = p.x < p.next.x ? p : p.next;
+                if (x === hx) return m; // hole touches outer segment; pick leftmost endpoint
+            }
+        }
+        p = p.next;
+    } while (p !== outerNode);
+
+    if (!m) return null;
+
+    // look for points inside the triangle of hole point, segment intersection and endpoint;
+    // if there are no points found, we have a valid connection;
+    // otherwise choose the point of the minimum angle with the ray as connection point
+
+    const stop = m;
+    const mx = m.x;
+    const my = m.y;
+    let tanMin = Infinity;
+
+    p = m;
+
+    do {
+        if (hx >= p.x && p.x >= mx && hx !== p.x &&
+                pointInTriangle(hy < my ? hx : qx, hy, mx, my, hy < my ? qx : hx, hy, p.x, p.y)) {
+
+            const tan = Math.abs(hy - p.y) / (hx - p.x); // tangential
+
+            if (locallyInside(p, hole) &&
+                (tan < tanMin || (tan === tanMin && (p.x > m.x || (p.x === m.x && sectorContainsSector(m, p)))))) {
+                m = p;
+                tanMin = tan;
+            }
+        }
+
+        p = p.next;
+    } while (p !== stop);
+
+    return m;
+}
+
+// whether sector in vertex m contains sector in vertex p in the same coordinates
+function sectorContainsSector(m, p) {
+    return area(m.prev, m, p.prev) < 0 && area(p.next, m, m.next) < 0;
+}
+
+// interlink polygon nodes in z-order
+function indexCurve(start, minX, minY, invSize) {
+    let p = start;
+    do {
+        if (p.z === 0) p.z = zOrder(p.x, p.y, minX, minY, invSize);
+        p.prevZ = p.prev;
+        p.nextZ = p.next;
+        p = p.next;
+    } while (p !== start);
+
+    p.prevZ.nextZ = null;
+    p.prevZ = null;
+
+    sortLinked(p);
+}
+
+// Simon Tatham's linked list merge sort algorithm
+// http://www.chiark.greenend.org.uk/~sgtatham/algorithms/listsort.html
+function sortLinked(list) {
+    let numMerges;
+    let inSize = 1;
+
+    do {
+        let p = list;
+        let e;
+        list = null;
+        let tail = null;
+        numMerges = 0;
+
+        while (p) {
+            numMerges++;
+            let q = p;
+            let pSize = 0;
+            for (let i = 0; i < inSize; i++) {
+                pSize++;
+                q = q.nextZ;
+                if (!q) break;
+            }
+            let qSize = inSize;
+
+            while (pSize > 0 || (qSize > 0 && q)) {
+
+                if (pSize !== 0 && (qSize === 0 || !q || p.z <= q.z)) {
+                    e = p;
+                    p = p.nextZ;
+                    pSize--;
+                } else {
+                    e = q;
+                    q = q.nextZ;
+                    qSize--;
+                }
+
+                if (tail) tail.nextZ = e;
+                else list = e;
+
+                e.prevZ = tail;
+                tail = e;
+            }
+
+            p = q;
+        }
+
+        tail.nextZ = null;
+        inSize *= 2;
+
+    } while (numMerges > 1);
+
+    return list;
+}
+
+// z-order of a point given coords and inverse of the longer side of data bbox
+function zOrder(x, y, minX, minY, invSize) {
+    // coords are transformed into non-negative 15-bit integer range
+    x = (x - minX) * invSize | 0;
+    y = (y - minY) * invSize | 0;
+
+    x = (x | (x << 8)) & 0x00FF00FF;
+    x = (x | (x << 4)) & 0x0F0F0F0F;
+    x = (x | (x << 2)) & 0x33333333;
+    x = (x | (x << 1)) & 0x55555555;
+
+    y = (y | (y << 8)) & 0x00FF00FF;
+    y = (y | (y << 4)) & 0x0F0F0F0F;
+    y = (y | (y << 2)) & 0x33333333;
+    y = (y | (y << 1)) & 0x55555555;
+
+    return x | (y << 1);
+}
+
+// find the leftmost node of a polygon ring
+function getLeftmost(start) {
+    let p = start,
+        leftmost = start;
+    do {
+        if (p.x < leftmost.x || (p.x === leftmost.x && p.y < leftmost.y)) leftmost = p;
+        p = p.next;
+    } while (p !== start);
+
+    return leftmost;
+}
+
+// check if a point lies within a convex triangle
+function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {
+    return (cx - px) * (ay - py) >= (ax - px) * (cy - py) &&
+           (ax - px) * (by - py) >= (bx - px) * (ay - py) &&
+           (bx - px) * (cy - py) >= (cx - px) * (by - py);
+}
+
+// check if a point lies within a convex triangle but false if its equal to the first point of the triangle
+function pointInTriangleExceptFirst(ax, ay, bx, by, cx, cy, px, py) {
+    return !(ax === px && ay === py) && pointInTriangle(ax, ay, bx, by, cx, cy, px, py);
+}
+
+// check if a diagonal between two polygon nodes is valid (lies in polygon interior)
+function isValidDiagonal(a, b) {
+    return a.next.i !== b.i && a.prev.i !== b.i && !intersectsPolygon(a, b) && // doesn't intersect other edges
+           (locallyInside(a, b) && locallyInside(b, a) && middleInside(a, b) && // locally visible
+            (area(a.prev, a, b.prev) || area(a, b.prev, b)) || // does not create opposite-facing sectors
+            equals(a, b) && area(a.prev, a, a.next) > 0 && area(b.prev, b, b.next) > 0); // special zero-length case
+}
+
+// signed area of a triangle
+function area(p, q, r) {
+    return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);
+}
+
+// check if two points are equal
+function equals(p1, p2) {
+    return p1.x === p2.x && p1.y === p2.y;
+}
+
+// check if two segments intersect
+function intersects(p1, q1, p2, q2) {
+    const o1 = sign(area(p1, q1, p2));
+    const o2 = sign(area(p1, q1, q2));
+    const o3 = sign(area(p2, q2, p1));
+    const o4 = sign(area(p2, q2, q1));
+
+    if (o1 !== o2 && o3 !== o4) return true; // general case
+
+    if (o1 === 0 && onSegment(p1, p2, q1)) return true; // p1, q1 and p2 are collinear and p2 lies on p1q1
+    if (o2 === 0 && onSegment(p1, q2, q1)) return true; // p1, q1 and q2 are collinear and q2 lies on p1q1
+    if (o3 === 0 && onSegment(p2, p1, q2)) return true; // p2, q2 and p1 are collinear and p1 lies on p2q2
+    if (o4 === 0 && onSegment(p2, q1, q2)) return true; // p2, q2 and q1 are collinear and q1 lies on p2q2
+
+    return false;
+}
+
+// for collinear points p, q, r, check if point q lies on segment pr
+function onSegment(p, q, r) {
+    return q.x <= Math.max(p.x, r.x) && q.x >= Math.min(p.x, r.x) && q.y <= Math.max(p.y, r.y) && q.y >= Math.min(p.y, r.y);
+}
+
+function sign(num) {
+    return num > 0 ? 1 : num < 0 ? -1 : 0;
+}
+
+// check if a polygon diagonal intersects any polygon segments
+function intersectsPolygon(a, b) {
+    let p = a;
+    do {
+        if (p.i !== a.i && p.next.i !== a.i && p.i !== b.i && p.next.i !== b.i &&
+                intersects(p, p.next, a, b)) return true;
+        p = p.next;
+    } while (p !== a);
+
+    return false;
+}
+
+// check if a polygon diagonal is locally inside the polygon
+function locallyInside(a, b) {
+    return area(a.prev, a, a.next) < 0 ?
+        area(a, b, a.next) >= 0 && area(a, a.prev, b) >= 0 :
+        area(a, b, a.prev) < 0 || area(a, a.next, b) < 0;
+}
+
+// check if the middle point of a polygon diagonal is inside the polygon
+function middleInside(a, b) {
+    let p = a;
+    let inside = false;
+    const px = (a.x + b.x) / 2;
+    const py = (a.y + b.y) / 2;
+    do {
+        if (((p.y > py) !== (p.next.y > py)) && p.next.y !== p.y &&
+                (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x))
+            inside = !inside;
+        p = p.next;
+    } while (p !== a);
+
+    return inside;
+}
+
+// link two polygon vertices with a bridge; if the vertices belong to the same ring, it splits polygon into two;
+// if one belongs to the outer ring and another to a hole, it merges it into a single ring
+function splitPolygon(a, b) {
+    const a2 = createNode(a.i, a.x, a.y),
+        b2 = createNode(b.i, b.x, b.y),
+        an = a.next,
+        bp = b.prev;
+
+    a.next = b;
+    b.prev = a;
+
+    a2.next = an;
+    an.prev = a2;
+
+    b2.next = a2;
+    a2.prev = b2;
+
+    bp.next = b2;
+    b2.prev = bp;
+
+    return b2;
+}
+
+// create a node and optionally link it with previous one (in a circular doubly linked list)
+function insertNode(i, x, y, last) {
+    const p = createNode(i, x, y);
+
+    if (!last) {
+        p.prev = p;
+        p.next = p;
+
+    } else {
+        p.next = last.next;
+        p.prev = last;
+        last.next.prev = p;
+        last.next = p;
+    }
+    return p;
+}
+
+function removeNode(p) {
+    p.next.prev = p.prev;
+    p.prev.next = p.next;
+
+    if (p.prevZ) p.prevZ.nextZ = p.nextZ;
+    if (p.nextZ) p.nextZ.prevZ = p.prevZ;
+}
+
+function createNode(i, x, y) {
+    return {
+        i, // vertex index in coordinates array
+        x, y, // vertex coordinates
+        prev: null, // previous and next vertex nodes in a polygon ring
+        next: null,
+        z: 0, // z-order curve value
+        prevZ: null, // previous and next nodes in z-order
+        nextZ: null,
+        steiner: false // indicates whether this is a steiner point
+    };
+}
+
+// return a percentage difference between the polygon area and its triangulation area;
+// used to verify correctness of triangulation
+export function deviation(data, holeIndices, dim, triangles) {
+    const hasHoles = holeIndices && holeIndices.length;
+    const outerLen = hasHoles ? holeIndices[0] * dim : data.length;
+
+    let polygonArea = Math.abs(signedArea(data, 0, outerLen, dim));
+    if (hasHoles) {
+        for (let i = 0, len = holeIndices.length; i < len; i++) {
+            const start = holeIndices[i] * dim;
+            const end = i < len - 1 ? holeIndices[i + 1] * dim : data.length;
+            polygonArea -= Math.abs(signedArea(data, start, end, dim));
+        }
+    }
+
+    let trianglesArea = 0;
+    for (let i = 0; i < triangles.length; i += 3) {
+        const a = triangles[i] * dim;
+        const b = triangles[i + 1] * dim;
+        const c = triangles[i + 2] * dim;
+        trianglesArea += Math.abs(
+            (data[a] - data[c]) * (data[b + 1] - data[a + 1]) -
+            (data[a] - data[b]) * (data[c + 1] - data[a + 1]));
+    }
+
+    return polygonArea === 0 && trianglesArea === 0 ? 0 :
+        Math.abs((trianglesArea - polygonArea) / polygonArea);
+}
+
+function signedArea(data, start, end, dim) {
+    let sum = 0;
+    for (let i = start, j = end - dim; i < end; i += dim) {
+        sum += (data[j] - data[i]) * (data[i + 1] + data[j + 1]);
+        j = i;
+    }
+    return sum;
+}
+
+// turn a polygon in a multi-dimensional array form (e.g. as in GeoJSON) into a form Earcut accepts
+export function flatten(data) {
+    const vertices = [];
+    const holes = [];
+    const dimensions = data[0][0].length;
+    let holeIndex = 0;
+    let prevLen = 0;
+
+    for (const ring of data) {
+        for (const p of ring) {
+            for (let d = 0; d < dimensions; d++) vertices.push(p[d]);
+        }
+        if (prevLen) {
+            holeIndex += prevLen;
+            holes.push(holeIndex);
+        }
+        prevLen = ring.length;
+    }
+    return {vertices, holes, dimensions};
+}
+
+// Babylon 以全局函数 `earcut(data, holeIndices, dim)` 调用
+globalThis.earcut = earcut;

+ 7 - 0
site/vendor/lit/@lit-labs/signals/index.js

@@ -0,0 +1,7 @@
+import{Signal as t}from"signal-polyfill";export*from"signal-polyfill";export{SignalWatcher}from"./lib/signal-watcher.js";export{WatchDirective,watch}from"./lib/watch.js";export{html,svg,withWatch}from"./lib/html-tag.js";
+/**
+ * @license
+ * Copyright 2023 Google LLC
+ * SPDX-License-Identifier: BSD-3-Clause
+ */const l=t.State,o=t.Computed,r=(l,o)=>new t.State(l,o),i=(l,o)=>new t.Computed(l,o);export{o as Computed,l as State,i as computed,r as signal};
+//# sourceMappingURL=index.js.map

+ 7 - 0
site/vendor/lit/@lit-labs/signals/lib/html-tag.js

@@ -0,0 +1,7 @@
+import{html as o,svg as t}from"lit/html.js";import{watch as s}from"./watch.js";import{Signal as i}from"signal-polyfill";
+/**
+ * @license
+ * Copyright 2023 Google LLC
+ * SPDX-License-Identifier: BSD-3-Clause
+ */const m=o=>(t,...m)=>o(t,...m.map(o=>o instanceof i.State||o instanceof i.Computed?s(o):o)),l=m(o),r=m(t);export{l as html,r as svg,m as withWatch};
+//# sourceMappingURL=html-tag.js.map

Разница между файлами не показана из-за своего большого размера
+ 5 - 0
site/vendor/lit/@lit-labs/signals/lib/signal-watcher.js


+ 8 - 0
site/vendor/lit/@lit-labs/signals/lib/watch.js

@@ -0,0 +1,8 @@
+import{directive as i}from"lit/directive.js";import{AsyncDirective as t}from"lit/async-directive.js";import{Signal as s}from"signal-polyfill";
+/**
+ * @license
+ * Copyright 2023 Google LLC
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+let o=!1;const n=new s.subtle.Watcher(async()=>{o||(o=!0,queueMicrotask(()=>{o=!1;for(const i of n.getPending())i.get();n.watch()}))});class r extends t{_$S_(){var i,t;void 0===this._$Sm&&(this._$Sj=new s.Computed(()=>{var i;const t=null===(i=this._$SW)||void 0===i?void 0:i.get();return this.setValue(t),t}),this._$Sm=null!==(t=null===(i=this._$Sk)||void 0===i?void 0:i.h)&&void 0!==t?t:n,this._$Sm.watch(this._$Sj),s.subtle.untrack(()=>{var i;return null===(i=this._$Sj)||void 0===i?void 0:i.get()}))}_$Sp(){void 0!==this._$Sm&&(this._$Sm.unwatch(this._$SW),this._$Sm=void 0)}render(i){return s.subtle.untrack(()=>i.get())}update(i,[t]){var o,n;return null!==(o=this._$Sk)&&void 0!==o||(this._$Sk=null===(n=i.options)||void 0===n?void 0:n.host),t!==this._$SW&&void 0!==this._$SW&&this._$Sp(),this._$SW=t,this._$S_(),s.subtle.untrack(()=>this._$SW.get())}disconnected(){this._$Sp()}reconnected(){this._$S_()}}const h=i(r);export{r as WatchDirective,h as watch};
+//# sourceMappingURL=watch.js.map

+ 1 - 0
site/vendor/lit/@lit-labs/signals/package.json

@@ -0,0 +1 @@
+{"name":"@lit-labs/signals","version":"0.3.0","type":"module","main":"index.js"}

+ 28 - 0
site/vendor/lit/@lit/reactive-element/LICENSE

@@ -0,0 +1,28 @@
+BSD 3-Clause License
+
+Copyright (c) 2017 Google LLC. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this
+   list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice,
+   this list of conditions and the following disclaimer in the documentation
+   and/or other materials provided with the distribution.
+
+3. Neither the name of the copyright holder nor the names of its
+   contributors may be used to endorse or promote products derived from
+   this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

+ 103 - 0
site/vendor/lit/@lit/reactive-element/README.md

@@ -0,0 +1,103 @@
+# ReactiveElement 1.0
+
+[![Build Status](https://github.com/lit/lit/workflows/Tests/badge.svg)](https://github.com/lit/lit/actions?query=workflow%3ATests)
+[![Published on npm](https://img.shields.io/npm/v/@lit/reactive-element?logo=npm)](https://www.npmjs.com/package/@lit/reactive-element)
+[![Join our Discord](https://img.shields.io/badge/discord-join%20chat-5865F2.svg?logo=discord&logoColor=fff)](https://lit.dev/discord/)
+[![Mentioned in Awesome Lit](https://awesome.re/mentioned-badge.svg)](https://github.com/web-padawan/awesome-lit)
+
+# ReactiveElement
+
+A simple low level base class for creating fast, lightweight web components.
+
+## About this release
+
+This is a pre-release of Lit 3.0, the next major version of Lit.
+
+Lit 3.0 has very few breaking changes from Lit 2.0:
+
+- Drops support for IE11
+- Published as ES2021
+- Removes a couple of deprecated Lit 1.x APIs
+
+Lit 3.0 should require no changes to upgrade from Lit 2.0 for the vast majority of users. Once the full release is published, most apps and libraries will be able to extend their npm version ranges to include both 2.x and 3.x, like `"^2.7.0 || ^3.0.0"`.
+
+Lit 2.x and 3.0 are _interoperable_: templates, base classes, directives, decorators, etc., from one version of Lit will work with those from another.
+
+Please file any issues you find on our [issue tracker](https://github.com/lit/lit/issues).
+
+## Documentation
+
+Full documentation is available at [lit.dev](https://lit.dev/docs/api/ReactiveElement/).
+
+## Overview
+
+`ReactiveElement` is a base class for writing web components that react to changes in properties and attributes. `ReactiveElement` adds reactive properties and a batching, asynchronous update lifecycle to the standard web component APIs. Subclasses can respond to changes and update the DOM to reflect the element state.
+
+`ReactiveElement` doesn't include a DOM template system, but can easily be extended to add one by overriding the `update()` method to call the template library. `LitElement` is such an extension that adds `lit-html` templating.
+
+## Example
+
+```ts
+import {
+  ReactiveElement,
+  html,
+  css,
+  customElement,
+  property,
+  PropertyValues,
+} from '@lit/reactive-element';
+
+// This decorator defines the element.
+@customElement('my-element')
+export class MyElement extends ReactiveElement {
+  // This decorator creates a property accessor that triggers rendering and
+  // an observed attribute.
+  @property()
+  mood = 'great';
+
+  static styles = css`
+    span {
+      color: green;
+    }
+  `;
+
+  contentEl?: HTMLSpanElement;
+
+  // One time setup of shadowRoot content.
+  createRenderRoot() {
+    const shadowRoot = super.createRenderRoot();
+    shadowRoot.innerHTML = `Web Components are <span></span>!`;
+    this.contentEl = shadowRoot.firstElementChild;
+    return shadowRoot;
+  }
+
+  // Use a DOM rendering library of your choice or manually update the DOM.
+  update(changedProperties: PropertyValues) {
+    super.update(changedProperties);
+    this.contentEl.textContent = this.mood;
+  }
+}
+```
+
+```html
+<my-element mood="awesome"></my-element>
+```
+
+Note, this example uses decorators to create properties. Decorators are a proposed
+standard currently available in [TypeScript](https://www.typescriptlang.org/) or [Babel](https://babeljs.io/docs/en/babel-plugin-proposal-decorators). ReactiveElement also supports a [vanilla JavaScript method](https://lit.dev/docs/components/properties/#declaring-properties-in-a-static-properties-field) of declaring reactive properties.
+
+## Installation
+
+```bash
+$ npm install @lit/reactive-element
+```
+
+Or use from `lit`:
+
+```bash
+$ npm install lit
+```
+
+## Contributing
+
+Please see [CONTRIBUTING.md](../../CONTRIBUTING.md).

+ 7 - 0
site/vendor/lit/@lit/reactive-element/css-tag.js

@@ -0,0 +1,7 @@
+/**
+ * @license
+ * Copyright 2019 Google LLC
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s=Symbol(),o=new WeakMap;class n{constructor(t,e,o){if(this._$cssResult$=!0,o!==s)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const s=this.t;if(e&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=o.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o.set(s,t))}return t}toString(){return this.cssText}}const r=t=>new n("string"==typeof t?t:t+"",void 0,s),i=(t,...e)=>{const o=1===t.length?t[0]:e.reduce(((e,s,o)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[o+1]),t[0]);return new n(o,t,s)},S=(s,o)=>{if(e)s.adoptedStyleSheets=o.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const e of o){const o=document.createElement("style"),n=t.litNonce;void 0!==n&&o.setAttribute("nonce",n),o.textContent=e.cssText,s.appendChild(o)}},c=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return r(e)})(t):t;export{n as CSSResult,S as adoptStyles,i as css,c as getCompatibleStyle,e as supportsAdoptingStyleSheets,r as unsafeCSS};
+//# sourceMappingURL=css-tag.js.map

+ 2 - 0
site/vendor/lit/@lit/reactive-element/decorators.js

@@ -0,0 +1,2 @@
+export{customElement}from"./decorators/custom-element.js";export{property,standardProperty}from"./decorators/property.js";export{state}from"./decorators/state.js";export{eventOptions}from"./decorators/event-options.js";export{query}from"./decorators/query.js";export{queryAll}from"./decorators/query-all.js";export{queryAsync}from"./decorators/query-async.js";export{queryAssignedElements}from"./decorators/query-assigned-elements.js";export{queryAssignedNodes}from"./decorators/query-assigned-nodes.js";
+//# sourceMappingURL=decorators.js.map

+ 7 - 0
site/vendor/lit/@lit/reactive-element/decorators/base.js

@@ -0,0 +1,7 @@
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+const e=(e,t,c)=>(c.configurable=!0,c.enumerable=!0,Reflect.decorate&&"object"!=typeof t&&Object.defineProperty(e,t,c),c);export{e as desc};
+//# sourceMappingURL=base.js.map

+ 7 - 0
site/vendor/lit/@lit/reactive-element/decorators/custom-element.js

@@ -0,0 +1,7 @@
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+const t=t=>(e,o)=>{void 0!==o?o.addInitializer((()=>{customElements.define(t,e)})):customElements.define(t,e)};export{t as customElement};
+//# sourceMappingURL=custom-element.js.map

+ 7 - 0
site/vendor/lit/@lit/reactive-element/decorators/event-options.js

@@ -0,0 +1,7 @@
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+function t(t){return(n,o)=>{const c="function"==typeof n?n:n[o];Object.assign(c,t)}}export{t as eventOptions};
+//# sourceMappingURL=event-options.js.map

+ 7 - 0
site/vendor/lit/@lit/reactive-element/decorators/property.js

@@ -0,0 +1,7 @@
+import{defaultConverter as t,notEqual as e}from"../reactive-element.js";
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ * SPDX-License-Identifier: BSD-3-Clause
+ */const o={attribute:!0,type:String,converter:t,reflect:!1,hasChanged:e},r=(t=o,e,r)=>{const{kind:n,metadata:i}=r;let s=globalThis.litPropertyMetadata.get(i);if(void 0===s&&globalThis.litPropertyMetadata.set(i,s=new Map),s.set(r.name,t),"accessor"===n){const{name:o}=r;return{set(r){const n=e.get.call(this);e.set.call(this,r),this.requestUpdate(o,n,t)},init(e){return void 0!==e&&this.P(o,void 0,t),e}}}if("setter"===n){const{name:o}=r;return function(r){const n=this[o];e.call(this,r),this.requestUpdate(o,n,t)}}throw Error("Unsupported decorator location: "+n)};function n(t){return(e,o)=>"object"==typeof o?r(t,e,o):((t,e,o)=>{const r=e.hasOwnProperty(o);return e.constructor.createProperty(o,r?{...t,wrapped:!0}:t),r?Object.getOwnPropertyDescriptor(e,o):void 0})(t,e,o)}export{n as property,r as standardProperty};
+//# sourceMappingURL=property.js.map

+ 8 - 0
site/vendor/lit/@lit/reactive-element/decorators/query-all.js

@@ -0,0 +1,8 @@
+import{desc as t}from"./base.js";
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+let e;function r(r){return(n,o)=>t(n,o,{get(){return(this.renderRoot??(e??=document.createDocumentFragment())).querySelectorAll(r)}})}export{r as queryAll};
+//# sourceMappingURL=query-all.js.map

+ 7 - 0
site/vendor/lit/@lit/reactive-element/decorators/query-assigned-elements.js

@@ -0,0 +1,7 @@
+import{desc as t}from"./base.js";
+/**
+ * @license
+ * Copyright 2021 Google LLC
+ * SPDX-License-Identifier: BSD-3-Clause
+ */function o(o){return(e,n)=>{const{slot:r,selector:s}=o??{},c="slot"+(r?`[name=${r}]`:":not([name])");return t(e,n,{get(){const t=this.renderRoot?.querySelector(c),e=t?.assignedElements(o)??[];return void 0===s?e:e.filter((t=>t.matches(s)))}})}}export{o as queryAssignedElements};
+//# sourceMappingURL=query-assigned-elements.js.map

+ 7 - 0
site/vendor/lit/@lit/reactive-element/decorators/query-assigned-nodes.js

@@ -0,0 +1,7 @@
+import{desc as t}from"./base.js";
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ * SPDX-License-Identifier: BSD-3-Clause
+ */function n(n){return(o,r)=>{const{slot:e}=n??{},s="slot"+(e?`[name=${e}]`:":not([name])");return t(o,r,{get(){const t=this.renderRoot?.querySelector(s);return t?.assignedNodes(n)??[]}})}}export{n as queryAssignedNodes};
+//# sourceMappingURL=query-assigned-nodes.js.map

+ 8 - 0
site/vendor/lit/@lit/reactive-element/decorators/query-async.js

@@ -0,0 +1,8 @@
+import{desc as t}from"./base.js";
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+function r(r){return(n,e)=>t(n,e,{async get(){return await this.updateComplete,this.renderRoot?.querySelector(r)??null}})}export{r as queryAsync};
+//# sourceMappingURL=query-async.js.map

+ 7 - 0
site/vendor/lit/@lit/reactive-element/decorators/query.js

@@ -0,0 +1,7 @@
+import{desc as t}from"./base.js";
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ * SPDX-License-Identifier: BSD-3-Clause
+ */function e(e,r){return(n,s,i)=>{const o=t=>t.renderRoot?.querySelector(e)??null;if(r){const{get:e,set:r}="object"==typeof s?n:i??(()=>{const t=Symbol();return{get(){return this[t]},set(e){this[t]=e}}})();return t(n,s,{get(){let t=e.call(this);return void 0===t&&(t=o(this),(null!==t||this.hasUpdated)&&r.call(this,t)),t}})}return t(n,s,{get(){return o(this)}})}}export{e as query};
+//# sourceMappingURL=query.js.map

Некоторые файлы не были показаны из-за большого количества измененных файлов