modelstage 0.0.0-stage → 0.5.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (286) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +267 -2
  3. package/THIRD_PARTY_NOTICES.md +90 -0
  4. package/bin/modelstage.mjs +101 -0
  5. package/config/diag-upload.example.json +7 -0
  6. package/config/models/live2d.assetbundls.json +1 -0
  7. package/config/models/live2d.azurlane.json +1 -0
  8. package/config/models/live2d.azurlane_bundle.json +1 -0
  9. package/config/models/live2d.azurlane_spine.json +1 -0
  10. package/config/models/live2d.bd2.json +1 -0
  11. package/config/models/live2d.bluearchive.json +1 -0
  12. package/config/models/live2d.live2d.json +1 -0
  13. package/config/models/live2d.nikke.json +1 -0
  14. package/config/models/live2d.nikke_2.json +1 -0
  15. package/config/models/live2d.npc.json +1 -0
  16. package/config/models/spine.assetbundls.json +1 -0
  17. package/config/models/spine.azurlane.json +1 -0
  18. package/config/models/spine.azurlane_bundle.json +1 -0
  19. package/config/models/spine.azurlane_spine.json +1 -0
  20. package/config/models/spine.bd2.json +1 -0
  21. package/config/models/spine.bluearchive.json +1 -0
  22. package/config/models/spine.live2d.json +1 -0
  23. package/config/models/spine.nikke.json +1 -0
  24. package/config/models/spine.nikke_2.json +1 -0
  25. package/config/models/spine.npc.json +1 -0
  26. package/config/names/NIKKE.json +1058 -0
  27. package/config/names/README.md +47 -0
  28. package/config/names//345/244/251/345/221/275/344/271/213/345/255/220.json +42897 -0
  29. package/config/names//346/243/225/350/211/262/345/260/230/345/237/2032.json +4016 -0
  30. package/config/names//347/242/247/350/223/235/350/210/252/347/272/277.json +38342 -0
  31. package/config/plugins.json +13 -0
  32. package/config/resources.example.json +40 -0
  33. package/package.json +58 -4
  34. package/plugins/unity-live2d-bundle/README.md +98 -0
  35. package/plugins/unity-live2d-bundle/index.js +891 -0
  36. package/plugins/unity-live2d-bundle/lib/anim-to-motion.js +402 -0
  37. package/plugins/unity-live2d-bundle/lib/bundle-probe.js +244 -0
  38. package/plugins/unity-live2d-bundle/lib/bytes.js +189 -0
  39. package/plugins/unity-live2d-bundle/lib/common-strings.js +46 -0
  40. package/plugins/unity-live2d-bundle/lib/dxt.js +197 -0
  41. package/plugins/unity-live2d-bundle/lib/errors.js +71 -0
  42. package/plugins/unity-live2d-bundle/lib/etc2.js +371 -0
  43. package/plugins/unity-live2d-bundle/lib/extract.js +242 -0
  44. package/plugins/unity-live2d-bundle/lib/lzma-d-min.LICENSE.txt +21 -0
  45. package/plugins/unity-live2d-bundle/lib/lzma-d-min.js +34 -0
  46. package/plugins/unity-live2d-bundle/lib/model3.js +137 -0
  47. package/plugins/unity-live2d-bundle/lib/png.js +424 -0
  48. package/plugins/unity-live2d-bundle/lib/serialized.js +233 -0
  49. package/plugins/unity-live2d-bundle/lib/texdecode.js +190 -0
  50. package/plugins/unity-live2d-bundle/lib/typetree.js +215 -0
  51. package/plugins/unity-live2d-bundle/lib/unityfs.js +396 -0
  52. package/plugins/unity-live2d-bundle/plugin.json +81 -0
  53. package/plugins/unity-live2d-bundle/profiles/unityfs-live2d.json +26 -0
  54. package/plugins/unity-spine-bundle/index.js +535 -0
  55. package/plugins/unity-spine-bundle/lib/bytes.js +189 -0
  56. package/plugins/unity-spine-bundle/lib/common-strings.js +46 -0
  57. package/plugins/unity-spine-bundle/lib/dxt.js +197 -0
  58. package/plugins/unity-spine-bundle/lib/errors.js +79 -0
  59. package/plugins/unity-spine-bundle/lib/etc2.js +371 -0
  60. package/plugins/unity-spine-bundle/lib/extract.js +242 -0
  61. package/plugins/unity-spine-bundle/lib/lzma-d-min.LICENSE.txt +21 -0
  62. package/plugins/unity-spine-bundle/lib/lzma-d-min.js +34 -0
  63. package/plugins/unity-spine-bundle/lib/png.js +424 -0
  64. package/plugins/unity-spine-bundle/lib/serialized.js +233 -0
  65. package/plugins/unity-spine-bundle/lib/texdecode.js +190 -0
  66. package/plugins/unity-spine-bundle/lib/typetree.js +215 -0
  67. package/plugins/unity-spine-bundle/lib/unityfs.js +396 -0
  68. package/plugins/unity-spine-bundle/plugin.json +75 -0
  69. package/src/server/README.md +69 -0
  70. package/src/server/assets/browse.mjs +56 -0
  71. package/src/server/assets/bundle-probe.mjs +94 -0
  72. package/src/server/assets/probe.mjs +184 -0
  73. package/src/server/core/config.mjs +173 -0
  74. package/src/server/core/env-num.mjs +60 -0
  75. package/src/server/core/env.mjs +49 -0
  76. package/src/server/core/fs-portable.mjs +37 -0
  77. package/src/server/core/log.mjs +107 -0
  78. package/src/server/core/paths.mjs +44 -0
  79. package/src/server/data/catalog.mjs +1091 -0
  80. package/src/server/data/entry-states.mjs +499 -0
  81. package/src/server/data/live2d.mjs +272 -0
  82. package/src/server/data/manifest-cache.mjs +58 -0
  83. package/src/server/data/manifest-stamp.mjs +135 -0
  84. package/src/server/data/model-meta.mjs +114 -0
  85. package/src/server/data/names.mjs +106 -0
  86. package/src/server/data/shape-probe-worker.mjs +33 -0
  87. package/src/server/data/shape-probe.mjs +626 -0
  88. package/src/server/data/spine.mjs +336 -0
  89. package/src/server/data/tree.mjs +126 -0
  90. package/src/server/http/atomic-json.mjs +145 -0
  91. package/src/server/http/background-solids.mjs +270 -0
  92. package/src/server/http/backgrounds.mjs +388 -0
  93. package/src/server/http/diag-upload.mjs +264 -0
  94. package/src/server/http/diag.mjs +173 -0
  95. package/src/server/http/ready.mjs +167 -0
  96. package/src/server/http/static.mjs +312 -0
  97. package/src/server/http/write.mjs +647 -0
  98. package/src/server/index.mjs +114 -0
  99. package/src/server/plugins/builtin-providers.json +30 -0
  100. package/src/server/plugins/registry.mjs +650 -0
  101. package/src/server/plugins/slot-catalog.mjs +286 -0
  102. package/src/server/routes/background-solids.mjs +56 -0
  103. package/src/server/routes/backgrounds.mjs +77 -0
  104. package/src/server/routes/config.mjs +38 -0
  105. package/src/server/routes/data.mjs +313 -0
  106. package/src/server/routes/diag.mjs +37 -0
  107. package/src/server/routes/entries.mjs +170 -0
  108. package/src/server/routes/ready.mjs +122 -0
  109. package/src/server/serve.mjs +334 -0
  110. package/src/server/unpack/capacity.mjs +217 -0
  111. package/src/server/unpack/mem-probe.mjs +27 -0
  112. package/src/server/unpack/plugin-runner.mjs +529 -0
  113. package/src/server/unpack/plugin-store.mjs +736 -0
  114. package/src/server/unpack/probe-store.mjs +73 -0
  115. package/src/server/unpack/routes.mjs +359 -0
  116. package/src/server/unpack/runtime/exec.mjs +558 -0
  117. package/src/server/unpack/runtime/index.mjs +141 -0
  118. package/src/server/unpack/runtime/node-vm.mjs +111 -0
  119. package/src/server/unpack/unpack-worker.mjs +105 -0
  120. package/src/server/unpack/worker-client.mjs +184 -0
  121. package/src/server/unpack/write-result.mjs +84 -0
  122. package/src/shared/bundle-shape.mjs +83 -0
  123. package/src/shared/entry-reasons.mjs +119 -0
  124. package/src/shared/names.mjs +45 -0
  125. package/src/web/README.md +193 -0
  126. package/src/web/app/anim-list.js +222 -0
  127. package/src/web/app/background-solids.js +150 -0
  128. package/src/web/app/backgrounds.js +152 -0
  129. package/src/web/app/camera-log.js +28 -0
  130. package/src/web/app/context.js +72 -0
  131. package/src/web/app/dir-picker.js +242 -0
  132. package/src/web/app/entry-report.js +71 -0
  133. package/src/web/app/memory-bars.js +91 -0
  134. package/src/web/app/memory-budget.js +228 -0
  135. package/src/web/app/memory-guard.js +204 -0
  136. package/src/web/app/model-actions.js +682 -0
  137. package/src/web/app/renderer-setting.js +70 -0
  138. package/src/web/app/root-manager.js +254 -0
  139. package/src/web/app/status.js +138 -0
  140. package/src/web/app/topbar-actions.js +357 -0
  141. package/src/web/app/transport-actions.js +297 -0
  142. package/src/web/app/ui-state.js +559 -0
  143. package/src/web/app/url-params.js +171 -0
  144. package/src/web/app/view-settings.js +186 -0
  145. package/src/web/components.css +465 -0
  146. package/src/web/debug/diag-hud.js +95 -0
  147. package/src/web/debug/drag.js +369 -0
  148. package/src/web/debug/log.js +320 -0
  149. package/src/web/debug/model-cmp.js +292 -0
  150. package/src/web/debug/panel.css +474 -0
  151. package/src/web/debug/panel.js +712 -0
  152. package/src/web/debug/race-probe.js +82 -0
  153. package/src/web/debug/upload.js +130 -0
  154. package/src/web/engine/adapters/atlas.js +47 -0
  155. package/src/web/engine/adapters/index.js +22 -0
  156. package/src/web/engine/adapters/renderer.js +223 -0
  157. package/src/web/engine/adapters/skeleton.js +105 -0
  158. package/src/web/engine/adapters/texture.js +64 -0
  159. package/src/web/engine/animation.js +181 -0
  160. package/src/web/engine/appearance.js +136 -0
  161. package/src/web/engine/camera-adapter.js +212 -0
  162. package/src/web/engine/effect-chain.js +138 -0
  163. package/src/web/engine/engine-state.js +120 -0
  164. package/src/web/engine/filters.js +224 -0
  165. package/src/web/engine/fit.js +197 -0
  166. package/src/web/engine/frame-gate.js +33 -0
  167. package/src/web/engine/gl-driver.js +56 -0
  168. package/src/web/engine/gl.js +77 -0
  169. package/src/web/engine/index.js +20 -0
  170. package/src/web/engine/loader.js +55 -0
  171. package/src/web/engine/model-info.js +26 -0
  172. package/src/web/engine/pipeline.js +200 -0
  173. package/src/web/engine/player.js +427 -0
  174. package/src/web/engine/pma/blend.js +76 -0
  175. package/src/web/engine/pma/detect.js +118 -0
  176. package/src/web/engine/pma/index.js +8 -0
  177. package/src/web/engine/pma/resolve.js +112 -0
  178. package/src/web/engine/pma/upload.js +127 -0
  179. package/src/web/engine/pma.js +5 -0
  180. package/src/web/engine/render-frame.js +93 -0
  181. package/src/web/engine/runtime-capabilities.js +209 -0
  182. package/src/web/engine/runtime.js +37 -0
  183. package/src/web/engine/skins.js +165 -0
  184. package/src/web/engine/textures.js +174 -0
  185. package/src/web/index.html +115 -0
  186. package/src/web/infra/api.js +531 -0
  187. package/src/web/infra/diag.js +509 -0
  188. package/src/web/infra/document.js +269 -0
  189. package/src/web/infra/dom.js +31 -0
  190. package/src/web/infra/events.mjs +27 -0
  191. package/src/web/infra/log.js +153 -0
  192. package/src/web/infra/mem-stats.js +112 -0
  193. package/src/web/infra/plugin-host-registration.mjs +285 -0
  194. package/src/web/infra/plugin-host-report.mjs +32 -0
  195. package/src/web/infra/plugin-host-unload.mjs +79 -0
  196. package/src/web/infra/plugin-host-unpack.mjs +899 -0
  197. package/src/web/infra/plugin-host-warmup.mjs +180 -0
  198. package/src/web/infra/plugin-host.js +628 -0
  199. package/src/web/infra/ready.js +461 -0
  200. package/src/web/infra/schedule.js +51 -0
  201. package/src/web/infra/shortcuts.js +129 -0
  202. package/src/web/infra/slot-registry.js +402 -0
  203. package/src/web/infra/vfs.js +247 -0
  204. package/src/web/live2d/bridge.js +400 -0
  205. package/src/web/live2d/model.js +321 -0
  206. package/src/web/live2d/overlay.js +142 -0
  207. package/src/web/live2d/pixi-app.js +111 -0
  208. package/src/web/live2d/playback-probe.js +92 -0
  209. package/src/web/live2d/probe-geometry.js +329 -0
  210. package/src/web/live2d/probe.js +119 -0
  211. package/src/web/live2d/release.js +66 -0
  212. package/src/web/live2d/runtime-adapter.js +289 -0
  213. package/src/web/live2d/stage-ctx.js +152 -0
  214. package/src/web/live2d/stage.js +204 -0
  215. package/src/web/live2d/vfs-settings.js +174 -0
  216. package/src/web/live2d/view.js +89 -0
  217. package/src/web/main.js +629 -0
  218. package/src/web/panel/background-list.js +373 -0
  219. package/src/web/panel/bg-source.js +291 -0
  220. package/src/web/panel/color-picker.css +199 -0
  221. package/src/web/panel/color-picker.js +278 -0
  222. package/src/web/panel/dialog.css +116 -0
  223. package/src/web/panel/dialog.js +173 -0
  224. package/src/web/panel/dom.js +35 -0
  225. package/src/web/panel/icons.js +58 -0
  226. package/src/web/panel/memory-bar.js +195 -0
  227. package/src/web/panel/panel-settings.js +1263 -0
  228. package/src/web/panel/panel.css +1304 -0
  229. package/src/web/panel/render-choice.js +104 -0
  230. package/src/web/panel/schema.js +784 -0
  231. package/src/web/panel/settings-io.js +291 -0
  232. package/src/web/panel/shell-controls.js +274 -0
  233. package/src/web/panel/slider.js +210 -0
  234. package/src/web/panel/toolbar-schema.js +111 -0
  235. package/src/web/panel/toolbar.js +195 -0
  236. package/src/web/panel/transport-picker.js +375 -0
  237. package/src/web/panel/transport.js +321 -0
  238. package/src/web/panel/view.js +553 -0
  239. package/src/web/plugin/unpack-worker.js +185 -0
  240. package/src/web/render/camera/constants.js +60 -0
  241. package/src/web/render/camera/index.js +123 -0
  242. package/src/web/render/camera/spine.js +124 -0
  243. package/src/web/render/capture.js +30 -0
  244. package/src/web/render/interaction.js +527 -0
  245. package/src/web/render/live2d.js +627 -0
  246. package/src/web/render/playback.js +47 -0
  247. package/src/web/render/reset-view.js +29 -0
  248. package/src/web/render/spine.js +386 -0
  249. package/src/web/render/surface-switch.js +176 -0
  250. package/src/web/render/surface.js +571 -0
  251. package/src/web/render/surfaces.js +70 -0
  252. package/src/web/roster/filter.js +31 -0
  253. package/src/web/roster/list.js +276 -0
  254. package/src/web/roster/persist.js +52 -0
  255. package/src/web/roster/reveal.js +77 -0
  256. package/src/web/roster/rows.js +248 -0
  257. package/src/web/roster/snapshot.js +37 -0
  258. package/src/web/roster/view.js +670 -0
  259. package/src/web/spine/canvas-api-groups.js +267 -0
  260. package/src/web/spine/canvas-api.js +97 -0
  261. package/src/web/spine/canvas-document.js +80 -0
  262. package/src/web/spine/canvas-engine.js +193 -0
  263. package/src/web/spine/canvas-entry.js +28 -0
  264. package/src/web/spine/canvas-pixels.js +36 -0
  265. package/src/web/spine/canvas-runtime.js +127 -0
  266. package/src/web/spine/canvas-view.js +108 -0
  267. package/src/web/spine/canvas.js +7 -0
  268. package/src/web/spine/runtime-hint.js +73 -0
  269. package/src/web/spine/runtimes.js +212 -0
  270. package/src/web/style.css +493 -0
  271. package/tool/lib/bundle-probe-node.mjs +121 -0
  272. package/tool/lib/check-perms.mjs +114 -0
  273. package/tool/lib/contract-checks.mjs +582 -0
  274. package/tool/lib/cubism-core.mjs +122 -0
  275. package/tool/lib/export-bundle.mjs +328 -0
  276. package/tool/lib/paths.mjs +20 -0
  277. package/tool/lib/runtime-guides.mjs +65 -0
  278. package/tool/lib/runtime-package.mjs +403 -0
  279. package/tool/lib/spine-meta.mjs +227 -0
  280. package/tool/lib/spine-motions.mjs +104 -0
  281. package/tool/lib/spine-runtime.mjs +131 -0
  282. package/tool/lib/test-lock.mjs +178 -0
  283. package/tool/lib/test-report.mjs +133 -0
  284. package/tool/parse-jsonc.mjs +86 -0
  285. package/tool/resolve-live2d-runtimes.mjs +276 -0
  286. package/tool/spine-motion-rules.json +101 -0
@@ -0,0 +1,474 @@
1
+ /* ============================================================================
2
+ debug-panel.css —— 调试日志浮层面板样式
3
+ 布局:两行标题(第1行 标题+收起 / 第2行 四档+上传+清空)+ 列表。
4
+ 结构对齐 docs/设计/调试日志面板.md:288px 宽 / 最高 320px / 圆角 12px /
5
+ 卡片底 + 边框 + 阴影;头部 图标+标题+条数+两个图标按钮;列表最高 256px 可滚动;
6
+ 条目 = 级别图标 + 元信息(时间 + [tag])+ 正文;级别用底色 10% + 文字着色。
7
+ 颜色全部走 token(在 .dbg-panel 作用域内定义,优先级:站点既有 CSS 变量 → 兜底值),
8
+ 换主题时只需要改这一处。
9
+ ========================================================================== */
10
+
11
+ /* ── 尺寸常量(改这里就够,别在别处写死)──
12
+ 高度**只在一个地方定义**:下面 .dbg-shell-inner 的 height: var(--dbg-h)。
13
+ 曾经的坑:.dbg-panel 自己写死 max-height:320 + overflow:hidden,而列表按另一套算出 353,
14
+ 两个高度源不一致 ⇒ 列表底部 34px 被外层裁掉,滚到底也看不见最后一条的尾行。
15
+ 所以外层容器只负责定位,既不写死高度也不加 overflow:hidden。 */
16
+ :root {
17
+ --dbg-w: 320px; /* 面板宽度 */
18
+ --dbg-h: 420px; /* 面板总高 */
19
+ --dbg-h-head: 36px; /* 第 1 行高 */
20
+ --dbg-h-bar: 34px; /* 第 2 行高 */
21
+ /* 列表可视高度 = --dbg-h − --dbg-h-head − --dbg-h-bar(自动算,不用手改) */
22
+ --dbg-row-pad: 4px 8px;
23
+ --dbg-row-gap: 4px;
24
+ --dbg-pill-h: 28px;
25
+ --dbg-pill-offset: 16px;
26
+ /* 收起态的**盒子**尺寸(含边框):定位时按它算,不用等 220ms 宽度过渡结束。
27
+ 114 = 胶囊实测宽 112 + 左右边框各 1;不留余量,避免"锚点与视觉差 8px"。 */
28
+ --dbg-pill-w: 114px;
29
+ --dbg-pill-hbox: 30px;
30
+ }
31
+
32
+ .dbg-panel {
33
+ --dbg-card: var(--color-card, #1f2326);
34
+ --dbg-border: var(--color-border, #353a3e);
35
+ --dbg-fg: var(--color-foreground, #e9ebed);
36
+ --dbg-muted: var(--color-muted-foreground, #9ca3af);
37
+ --dbg-primary: var(--color-primary, #1fc0c5);
38
+ --dbg-warn: var(--color-warning, #f59e0b);
39
+ --dbg-error: var(--color-destructive, #e06c75);
40
+ --dbg-radius: 12px;
41
+ --dbg-accent: 10%;
42
+
43
+ position: fixed;
44
+ right: 16px;
45
+ /* 抬到播放条上方:播放条高 42px + 距底 15px,再留 19px 间隙 */
46
+ bottom: 76px;
47
+ z-index: 60;
48
+ /* 宽度跟常量;高度交给 .dbg-shell-inner(唯一高度源) */
49
+ width: var(--dbg-w);
50
+ display: flex;
51
+ flex-direction: column;
52
+ /* 关键:外层不能裁切,否则会把列表底部切掉(顶部定位靠 right/bottom,不靠 overflow) */
53
+ overflow: visible;
54
+ border: 1px solid var(--dbg-border);
55
+ border-radius: var(--dbg-radius);
56
+ background: var(--dbg-card);
57
+ color: var(--dbg-fg);
58
+ box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
59
+ font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
60
+ transform-origin: right bottom;
61
+ /* 收起/展开时宽度一并过渡:收起后只剩胶囊,宽度要跟着收(否则 width:auto 会被
62
+ 仍在布局里的列表内容撑到 600+,胶囊看着像一条长条)。fixed 元素动 width 不影响页面布局。 */
63
+ transition: width 220ms cubic-bezier(0.16, 1, 0.3, 1);
64
+ }
65
+
66
+ /* 关闭调试日志时只是隐藏(实例保留),作者样式里的 display:flex 会盖掉 [hidden],故显式声明 */
67
+ .dbg-panel[hidden] {
68
+ display: none;
69
+ }
70
+
71
+ /* ---------------------------------------------------------------- 收起 / 展开
72
+ 收起后由右下角一颗胶囊按钮承载:info 图标 + 「日志」 + 计数徽标 + chevron-up。
73
+ 动画口径(契约 docs/契约/交互与实现约束.md:只用 CSS transition,不写 element.style):
74
+ · 高度用 grid 的 0fr ↔ 1fr(height:auto 不能 transition,也不必猜固定高度)
75
+ · 配合 opacity + 轻微位移/缩放,从右下角"长出来"(transform-origin: right bottom)
76
+ · 收起态 pointer-events:none,防止对着空气点
77
+ 曲线 cubic-bezier(.16,1,.3,1) 是这类"先快后缓、不过冲"手感的标准值。 */
78
+ .dbg-panel[data-collapsed='true'] {
79
+ width: var(--dbg-pill-w);
80
+ border-color: transparent;
81
+ background: transparent;
82
+ box-shadow: none;
83
+ }
84
+
85
+ .dbg-shell {
86
+ /* 动画外壳:只负责裁切 + 透明度 + 位移。
87
+ 高度动画放在内层(见 .dbg-shell-inner):内层是**固定高度**的,
88
+ grid 轨道 0fr 在"子项有明确 height"时压不下去(实测轨道仍是 420px),
89
+ 所以直接过渡 height 更可靠,也不影响"高度只有一个常量源"这条约束。 */
90
+ overflow: hidden;
91
+ transition: opacity 180ms ease, transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
92
+ transform-origin: right bottom;
93
+ }
94
+
95
+ /* 唯一子项:既是**唯一高度源**(height: var(--dbg-h)),也是三行网格。
96
+ min-height:0 让外层动画外壳的 0fr 轨道能压下去;overflow:hidden 只裁"收起动画过程",
97
+ 不与外层裁切冲突(外层 .dbg-panel 已改成 overflow:visible)。 */
98
+ .dbg-shell-inner {
99
+ display: grid;
100
+ grid-template-rows: var(--dbg-h-head) var(--dbg-h-bar) 1fr;
101
+ height: var(--dbg-h);
102
+ min-height: 0;
103
+ overflow: hidden;
104
+ transition: height 220ms cubic-bezier(0.16, 1, 0.3, 1);
105
+ }
106
+
107
+ .dbg-panel[data-collapsed='true'] .dbg-shell {
108
+ opacity: 0;
109
+ transform: translateY(8px) scale(0.98);
110
+ pointer-events: none;
111
+ }
112
+
113
+ /* 收起 = 高度归零(高度源仍是 --dbg-h,这里只是把它压到 0 做过渡) */
114
+ .dbg-panel[data-collapsed='true'] .dbg-shell-inner {
115
+ height: 0;
116
+ }
117
+
118
+ /* ---- 收起态胶囊 ---- */
119
+ .dbg-pill {
120
+ display: none;
121
+ align-items: center;
122
+ gap: 6px;
123
+ padding: 5px 12px;
124
+ border: 1px solid var(--dbg-border);
125
+ border-radius: 999px;
126
+ background: var(--dbg-card);
127
+ color: var(--dbg-fg);
128
+ box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
129
+ font-size: 12px;
130
+ line-height: 1.2;
131
+ cursor: pointer;
132
+ /* 胶囊本身就是拖拽手柄:触屏上别让浏览器把拖动手势解释成滚页面 */
133
+ touch-action: none;
134
+ user-select: none;
135
+ transition: background-color 150ms ease, border-color 150ms ease;
136
+ }
137
+
138
+ .dbg-panel[data-collapsed='true'] .dbg-pill {
139
+ display: inline-flex;
140
+ width: fit-content;
141
+ /* 默认贴右(向左长 ⇒ 胶囊贴在面板右边缘)。向右长时由下面的 data-open-dir 改贴左,
142
+ 保证"胶囊留在原处、面板朝视口中心长"。 */
143
+ margin-left: auto;
144
+ white-space: nowrap;
145
+ }
146
+
147
+ /* 展开方向 → 胶囊贴在面板的哪条边(位置不变的关键) */
148
+ .dbg-panel[data-open-dir$='right'] .dbg-pill {
149
+ margin-left: 0;
150
+ margin-right: auto;
151
+ }
152
+
153
+ /* 向上长 ⇒ 收起态胶囊贴面板下边缘(展开时 root 无多余空间,此规则无副作用) */
154
+ .dbg-panel[data-open-dir^='up'] {
155
+ justify-content: flex-end;
156
+ }
157
+
158
+ .dbg-pill:hover {
159
+
160
+ background: color-mix(in srgb, var(--dbg-fg) 8%, var(--dbg-card));
161
+ }
162
+
163
+ /* 胶囊里的 info 图标用主色 */
164
+ .dbg-pill .dbg-icon-info {
165
+ width: 14px;
166
+ height: 14px;
167
+ color: var(--dbg-primary);
168
+ }
169
+
170
+ .dbg-pill-text { color: var(--dbg-fg); }
171
+
172
+ /* 计数徽标:主色 10% 底 + 主色字 + 10px */
173
+ .dbg-pill-count {
174
+ padding: 0 6px;
175
+ border-radius: 999px;
176
+ background: color-mix(in srgb, var(--dbg-primary) 12%, transparent);
177
+ color: var(--dbg-primary);
178
+ font-size: 10px;
179
+ line-height: 16px;
180
+ }
181
+
182
+ .dbg-pill .dbg-icon-chevron { width: 12px; height: 12px; color: var(--dbg-muted); }
183
+
184
+ /* ---------------------------------------------------------------- 头部 */
185
+
186
+ .dbg-head {
187
+ flex: 0 0 auto;
188
+ display: flex;
189
+ align-items: center;
190
+ justify-content: space-between;
191
+ gap: 8px;
192
+ /* 行高由 --dbg-h-head 决定,所以这里不写上下内边距(写了会把行撑高、与常量不一致) */
193
+ padding: 0 8px;
194
+ min-width: 0;
195
+ border-bottom: 1px solid var(--dbg-border);
196
+ /* 标题栏是拖动抓手:给抓取光标,拖动时禁用文本选中(否则会选中标题文字) */
197
+ cursor: grab;
198
+ user-select: none;
199
+ }
200
+
201
+ .dbg-panel.is-dragging,
202
+ .dbg-panel.is-dragging * { cursor: grabbing !important; }
203
+
204
+ /* 拖动期间:提到合成层(改 transform 不重排),并关掉过渡避免跟手出现"追帧"延迟 */
205
+ .dbg-panel.is-dragging {
206
+ transition: none;
207
+ will-change: transform;
208
+ }
209
+
210
+ /* 标题栏是抓手:触屏上不让浏览器把拖动解释成滚页面,否则手感会"跟不上" */
211
+ .dbg-head { touch-action: none; }
212
+
213
+ /* 第 1 行左侧:可压缩(min-width:0 才能缩,否则内容会把右侧按钮挤出去) */
214
+ .dbg-head-left {
215
+ display: flex;
216
+ align-items: center;
217
+ gap: 8px;
218
+ flex: 1 1 auto;
219
+ min-width: 0;
220
+ }
221
+
222
+ .dbg-head-left .dbg-icon {
223
+ width: 16px;
224
+ height: 16px;
225
+ color: var(--dbg-primary);
226
+ }
227
+
228
+ .dbg-title {
229
+ font-size: 14px;
230
+ font-weight: 500;
231
+ }
232
+
233
+ .dbg-count {
234
+ font-size: 12px;
235
+ color: var(--dbg-muted);
236
+ }
237
+
238
+ /* 收起按钮:flex:none ⇒ 永远不被挤出右边界(曾经溢出 6px 点不到) */
239
+ .dbg-collapse {
240
+ flex: none;
241
+ width: 24px;
242
+ height: 24px;
243
+ padding: 0;
244
+ display: inline-flex;
245
+ align-items: center;
246
+ justify-content: center;
247
+ border: 0;
248
+ border-radius: 6px;
249
+ background: transparent;
250
+ color: var(--dbg-muted);
251
+ cursor: pointer;
252
+ }
253
+
254
+ .dbg-collapse:hover {
255
+ background: color-mix(in srgb, var(--dbg-fg) 8%, transparent);
256
+ color: var(--dbg-fg);
257
+ }
258
+
259
+ .dbg-collapse .dbg-icon { width: 14px; height: 14px; }
260
+
261
+ /* ---------------------------------------------------------------- 第 2 行:四档 + 操作 */
262
+
263
+ .dbg-bar {
264
+ display: flex;
265
+ align-items: center;
266
+ justify-content: space-between;
267
+ gap: 8px;
268
+ padding: 0 8px 6px;
269
+ min-width: 0;
270
+ }
271
+
272
+ /* 四档:横排小按钮(不是下拉)。下拉只能表达"某档及以上",而人要的是任意组合。 */
273
+ .dbg-levels,
274
+ .dbg-acts {
275
+ display: flex;
276
+ align-items: center;
277
+ gap: 4px;
278
+ min-width: 0;
279
+ }
280
+
281
+ .dbg-acts { flex: none; }
282
+
283
+ .dbg-lv,
284
+ .dbg-act {
285
+ display: inline-flex;
286
+ align-items: center;
287
+ gap: 4px;
288
+ height: 24px;
289
+ padding: 0 8px;
290
+ border: 1px solid var(--dbg-border);
291
+ border-radius: 6px;
292
+ background: transparent;
293
+ color: var(--dbg-muted);
294
+ font-size: 11px;
295
+ line-height: 1;
296
+ white-space: nowrap;
297
+ cursor: pointer;
298
+ transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
299
+ }
300
+
301
+ .dbg-lv .dbg-icon,
302
+ .dbg-act .dbg-icon { width: 12px; height: 12px; }
303
+
304
+ /* 激活态:与右边栏同款(主色描边 + 主色淡底 + 主色字) */
305
+ .dbg-lv.is-on {
306
+ border-color: var(--dbg-primary);
307
+ background: color-mix(in srgb, var(--dbg-primary) 12%, transparent);
308
+ color: var(--dbg-primary);
309
+ }
310
+
311
+ .dbg-lv:hover,
312
+ .dbg-act:hover {
313
+ background: color-mix(in srgb, var(--dbg-fg) 8%, transparent);
314
+ color: var(--dbg-fg);
315
+ }
316
+
317
+ .dbg-lv.is-on:hover {
318
+ background: color-mix(in srgb, var(--dbg-primary) 18%, transparent);
319
+ }
320
+
321
+ .dbg-act:disabled {
322
+ opacity: 0.5;
323
+ cursor: default;
324
+ }
325
+
326
+ /* ---------------------------------------------------------------- 列表 */
327
+
328
+ .dbg-list {
329
+ /* grid 子项默认 min-height:auto 会撑破轨道 ⇒ 必须显式 0,滚动才发生在列表自己身上 */
330
+ min-height: 0;
331
+ overflow-y: auto;
332
+ padding: 8px;
333
+ /* 底部留一点:最后一条不贴边(可视高度由 --dbg-h 三个常量算出,不在这里写死) */
334
+ padding-bottom: calc(var(--dbg-row-gap) * 2);
335
+ display: flex;
336
+ flex-direction: column;
337
+ gap: 4px;
338
+ font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
339
+ font-size: 12px;
340
+ }
341
+
342
+ .dbg-list[hidden] {
343
+ display: none;
344
+ }
345
+
346
+ /* 单条:横向 flex、圆角、内边距,级别底色 10% */
347
+ .dbg-row {
348
+ display: flex;
349
+ gap: 8px;
350
+ padding: var(--dbg-row-pad);
351
+ border-radius: 4px;
352
+ }
353
+
354
+ .dbg-row-info {
355
+ background: color-mix(in srgb, var(--dbg-primary) var(--dbg-accent), transparent);
356
+ }
357
+
358
+ .dbg-row-warn {
359
+ background: color-mix(in srgb, var(--dbg-warn) var(--dbg-accent), transparent);
360
+ }
361
+
362
+ .dbg-row-error {
363
+ background: color-mix(in srgb, var(--dbg-error) var(--dbg-accent), transparent);
364
+ }
365
+
366
+ /* 级别图标:14px、顶部对齐 */
367
+ .dbg-level-icon {
368
+ width: 14px;
369
+ height: 14px;
370
+ flex: 0 0 14px;
371
+ margin-top: 2px;
372
+ }
373
+
374
+ .dbg-row-info .dbg-level-icon { color: var(--dbg-primary); }
375
+ .dbg-row-warn .dbg-level-icon { color: var(--dbg-warn); }
376
+ .dbg-row-error .dbg-level-icon { color: var(--dbg-error); }
377
+
378
+ .dbg-body {
379
+ min-width: 0;
380
+ flex: 1 1 auto;
381
+ }
382
+
383
+ /* 元信息行:时间(等宽数字)+ [tag](小写存储,靠 CSS 转大写) */
384
+ .dbg-meta {
385
+ display: flex;
386
+ align-items: center;
387
+ gap: 8px;
388
+ font-size: 10px;
389
+ color: var(--dbg-muted);
390
+ }
391
+
392
+ .dbg-time {
393
+ font-variant-numeric: tabular-nums;
394
+ }
395
+
396
+ .dbg-tag {
397
+ text-transform: uppercase;
398
+ letter-spacing: 0.03em;
399
+ opacity: 0.8;
400
+ }
401
+
402
+ /* 正文:按级别着色,长文本换行 */
403
+ .dbg-text {
404
+ font-size: 12px;
405
+ line-height: 1.45;
406
+ word-break: break-word;
407
+ overflow-wrap: anywhere;
408
+ }
409
+
410
+ .dbg-text-info { color: var(--dbg-primary); }
411
+ .dbg-text-warn { color: var(--dbg-warn); }
412
+ .dbg-text-error { color: var(--dbg-error); }
413
+
414
+ /* ---------------------------------------------------------------- 来源徽标 / 级别过滤 */
415
+
416
+ /* 来源:应用(app) / 异常(error) / 网络(net) / 资源(resource) / 其它原样 */
417
+ .dbg-src {
418
+ display: inline-block;
419
+ min-width: 44px;
420
+ padding: 0 4px;
421
+ border-radius: 3px;
422
+ font-size: 10px;
423
+ line-height: 14px;
424
+ text-align: center;
425
+ text-transform: lowercase;
426
+ background: rgba(255, 255, 255, 0.08);
427
+ color: var(--dbg-muted);
428
+ }
429
+ .dbg-src-app { background: rgba(120, 200, 255, 0.16); color: #9fd4ff; }
430
+ .dbg-src-error { background: rgba(255, 120, 120, 0.18); color: #ff9d9d; }
431
+ .dbg-src-net { background: rgba(255, 200, 90, 0.18); color: #ffd08a; }
432
+ .dbg-src-resource { background: rgba(200, 150, 255, 0.18); color: #d3b3ff; }
433
+
434
+ /* 级别过滤:与头部按钮同高,避免撑开面板 */
435
+ /* ---------------------------------------------------------------- 空态 */
436
+
437
+ .dbg-empty {
438
+ padding: 32px 8px;
439
+ text-align: center;
440
+ color: var(--dbg-muted);
441
+ opacity: 0.6;
442
+ font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
443
+ }
444
+
445
+ /* ---- 上传日志按钮与三态反馈 ----
446
+ 与其它头部按钮并排,但带文字:这个动作会产生服务端文件,需要让人一眼看懂。
447
+ uploading 时禁用(aria-busy),成功/失败文案写在 .dbg-upload-status 里,失败可再点重试。 */
448
+ .dbg-upload-status {
449
+ max-width: 42ch;
450
+ overflow: hidden;
451
+ font-size: 12px;
452
+ color: var(--dbg-muted);
453
+ text-overflow: ellipsis;
454
+ white-space: nowrap;
455
+ }
456
+
457
+ /* 失败态用错误色,成功态保持弱化文字(不抢条数的视觉位置) */
458
+ .dbg-upload-status[data-state='fail'] {
459
+ color: var(--color-danger);
460
+ }
461
+
462
+ /* ---- chevron 朝向与旋转 ----
463
+ 展开态向下(点它会收起)、收起态向上(点它会展开)。
464
+ 两处都带 transition,折叠瞬间能看到箭头"转过去",而不是瞬切。 */
465
+ .dbg-chevron {
466
+ transform-origin: center;
467
+ transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
468
+ }
469
+
470
+ .dbg-chevron-head { transform: rotate(0deg); }
471
+ .dbg-chevron-pill { transform: rotate(180deg); }
472
+
473
+ /* 展开过程中胶囊淡出,同时它的箭头转回向下 —— 视觉上是"同一个箭头翻了个面" */
474
+ .dbg-panel[data-collapsed='false'] .dbg-chevron-pill { transform: rotate(0deg); }