tagword-codeagent 1.1.6__py3-none-any.whl

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 (173) hide show
  1. codeagent/__init__.py +10 -0
  2. codeagent/__main__.py +13 -0
  3. codeagent/cli/__init__.py +13 -0
  4. codeagent/cli/entrypoint.py +161 -0
  5. codeagent/cli/main.py +979 -0
  6. codeagent/core/__init__.py +2 -0
  7. codeagent/core/attachments.py +342 -0
  8. codeagent/core/audio_models.py +50 -0
  9. codeagent/core/bootstrap.py +178 -0
  10. codeagent/core/default_presets.py +159 -0
  11. codeagent/core/env.py +106 -0
  12. codeagent/core/folder_picker.py +151 -0
  13. codeagent/core/image_understanding.py +90 -0
  14. codeagent/core/models.py +6 -0
  15. codeagent/core/paths.py +238 -0
  16. codeagent/core/pricing.py +107 -0
  17. codeagent/core/process_ports.py +258 -0
  18. codeagent/core/seed_bridge.py +21 -0
  19. codeagent/core/settings.py +98 -0
  20. codeagent/core/speech_synth.py +330 -0
  21. codeagent/core/team_config.py +247 -0
  22. codeagent/core/team_manager.py +245 -0
  23. codeagent/core/token_counter.py +41 -0
  24. codeagent/core/tts_voices.py +103 -0
  25. codeagent/core/usage_billing.py +72 -0
  26. codeagent/core/vision_models.py +93 -0
  27. codeagent/memory/diary.py +144 -0
  28. codeagent/persona_defaults/README.md +12 -0
  29. codeagent/persona_defaults/agent.md +352 -0
  30. codeagent/persona_defaults/identity.md +29 -0
  31. codeagent/persona_defaults/memory.md +4 -0
  32. codeagent/persona_defaults/skills.md +325 -0
  33. codeagent/persona_defaults/soul.md +38 -0
  34. codeagent/persona_defaults/tools.md +41 -0
  35. codeagent/persona_defaults/user.md +18 -0
  36. codeagent/runtime/__init__.py +11 -0
  37. codeagent/runtime/agent_context.py +6 -0
  38. codeagent/runtime/agent_runtime.py +21 -0
  39. codeagent/runtime/compact_prompt.py +9 -0
  40. codeagent/runtime/compact_state.py +40 -0
  41. codeagent/runtime/llm_worker.py +132 -0
  42. codeagent/runtime/orchestrator.py +161 -0
  43. codeagent/runtime/prompt_enrichment.py +324 -0
  44. codeagent/runtime/session_manager.py +30 -0
  45. codeagent/runtime/task_split.py +38 -0
  46. codeagent/runtime/turn_loop.py +13 -0
  47. codeagent/runtime/worker.py +48 -0
  48. codeagent/server/__init__.py +505 -0
  49. codeagent/server/app_factory.py +1292 -0
  50. codeagent/server/attachment_api.py +261 -0
  51. codeagent/server/hub.py +175 -0
  52. codeagent/server/icon.png +0 -0
  53. codeagent/server/self_healing.py +143 -0
  54. codeagent/server/team_engine.py +243 -0
  55. codeagent/server/tts_api.py +51 -0
  56. codeagent/server/webui_api_app.py +3180 -0
  57. codeagent/skills/__init__.py +2 -0
  58. codeagent/skills/select.py +144 -0
  59. codeagent/tools/__init__.py +6 -0
  60. codeagent/tools/agent_tools.py +10 -0
  61. codeagent/web/__init__.py +1 -0
  62. codeagent/web/__pycache__/__init__.cpython-313.pyc +0 -0
  63. codeagent/web/__pycache__/app.cpython-313.pyc +0 -0
  64. codeagent/web/__pycache__/auth_impl.cpython-313.pyc +0 -0
  65. codeagent/web/auth_impl.py +326 -0
  66. codeagent/web/static/00-marked.min.js +6 -0
  67. codeagent/web/static/00-mermaid.min.js +2314 -0
  68. codeagent/web/static/00-purify.min.js +3 -0
  69. codeagent/web/static/00-storage.js +83 -0
  70. codeagent/web/static/00-utils.js +51 -0
  71. codeagent/web/static/01-theme.css +96 -0
  72. codeagent/web/static/01a-scroll.js +86 -0
  73. codeagent/web/static/01b-think.js +62 -0
  74. codeagent/web/static/01c-session-identity.js +81 -0
  75. codeagent/web/static/01c-session-thinking.js +61 -0
  76. codeagent/web/static/01c-session-tree-menus.js +349 -0
  77. codeagent/web/static/01c-session-tree.js +531 -0
  78. codeagent/web/static/01c-session-utilities.js +83 -0
  79. codeagent/web/static/01c-vision-model.js +132 -0
  80. codeagent/web/static/01d-image-gen-model.js +84 -0
  81. codeagent/web/static/01e-audio-model.js +97 -0
  82. codeagent/web/static/01f-compose-ui.js +88 -0
  83. codeagent/web/static/01g-tts-settings.js +128 -0
  84. codeagent/web/static/01h-music-model.js +85 -0
  85. codeagent/web/static/01i-model-stack.js +291 -0
  86. codeagent/web/static/01j-video-gen-model.js +85 -0
  87. codeagent/web/static/01k-model-stack-bootstrap.js +66 -0
  88. codeagent/web/static/01k-model-stack-state.js +209 -0
  89. codeagent/web/static/01q-inflight.js +195 -0
  90. codeagent/web/static/02-reset.css +22 -0
  91. codeagent/web/static/02-session-ui.js +201 -0
  92. codeagent/web/static/03-layout-p1.css +2 -0
  93. codeagent/web/static/03-layout-p2.css +2 -0
  94. codeagent/web/static/03a-links-stream.js +88 -0
  95. codeagent/web/static/03b-stream-text.js +119 -0
  96. codeagent/web/static/03c-render-bubble.js +520 -0
  97. codeagent/web/static/03d-agent-bubble.js +126 -0
  98. codeagent/web/static/03e-tool-trace.js +182 -0
  99. codeagent/web/static/03f-timeline.js +54 -0
  100. codeagent/web/static/03g-bubble-tts.js +292 -0
  101. codeagent/web/static/04-components-p1.css +1 -0
  102. codeagent/web/static/04-components-p2b.css +1 -0
  103. codeagent/web/static/04-components-p3.css +2 -0
  104. codeagent/web/static/04-components-p4.css +1 -0
  105. codeagent/web/static/04-components-p5.css +1 -0
  106. codeagent/web/static/04-components-p6.css +58 -0
  107. codeagent/web/static/04-components-p7.css +4 -0
  108. codeagent/web/static/04-components-p8.css +1 -0
  109. codeagent/web/static/04-components-p9.css +1 -0
  110. codeagent/web/static/04-ws-connect.js +351 -0
  111. codeagent/web/static/04-ws-helpers.js +116 -0
  112. codeagent/web/static/05-chat-p1.css +1058 -0
  113. codeagent/web/static/05-chat-p2.css +1 -0
  114. codeagent/web/static/05-chat-p3.css +295 -0
  115. codeagent/web/static/05a-session-history.js +176 -0
  116. codeagent/web/static/05b-session-list.js +114 -0
  117. codeagent/web/static/05c-dialog.js +123 -0
  118. codeagent/web/static/05d-project-create.js +172 -0
  119. codeagent/web/static/05e-project-remote.js +143 -0
  120. codeagent/web/static/06-chat.js +552 -0
  121. codeagent/web/static/06-utilities.css +181 -0
  122. codeagent/web/static/06b-attachments.js +304 -0
  123. codeagent/web/static/06c-camera.js +488 -0
  124. codeagent/web/static/07-activity-bar.css +127 -0
  125. codeagent/web/static/09-git-p1.css +1 -0
  126. codeagent/web/static/09-git-p2.css +1 -0
  127. codeagent/web/static/09a-init-bind.js +110 -0
  128. codeagent/web/static/09b-panel-toggle.js +80 -0
  129. codeagent/web/static/09c-api-refresh.js +100 -0
  130. codeagent/web/static/09d-status-log.js +80 -0
  131. codeagent/web/static/09e-commit.js +80 -0
  132. codeagent/web/static/09f-remote.js +93 -0
  133. codeagent/web/static/11a-cron-parse.js +117 -0
  134. codeagent/web/static/11b-cron-panel.js +100 -0
  135. codeagent/web/static/11c-cron-card.js +133 -0
  136. codeagent/web/static/11d-cron-form.js +105 -0
  137. codeagent/web/static/11e-env-config.js +168 -0
  138. codeagent/web/static/11f-env-llm-a-state.js +136 -0
  139. codeagent/web/static/11f-env-llm-b-form.js +409 -0
  140. codeagent/web/static/11f-env-llm-c-board.js +322 -0
  141. codeagent/web/static/11g-env-paths-git.js +973 -0
  142. codeagent/web/static/11h-env-mcp-a-state.js +161 -0
  143. codeagent/web/static/11h-env-mcp-b-form.js +229 -0
  144. codeagent/web/static/11h-env-mcp-c-board.js +565 -0
  145. codeagent/web/static/12-plugins.js +127 -0
  146. codeagent/web/static/13a-skills.js +156 -0
  147. codeagent/web/static/13a-todo-utils.js +140 -0
  148. codeagent/web/static/13b-todo-fetch.js +106 -0
  149. codeagent/web/static/13b-tools.js +127 -0
  150. codeagent/web/static/13c-todo-crud.js +92 -0
  151. codeagent/web/static/14-activity-bar.js +177 -0
  152. codeagent/web/static/15-plans.css +194 -0
  153. codeagent/web/static/15-plans.js +219 -0
  154. codeagent/web/static/16-mobile.css +612 -0
  155. codeagent/web/static/16-mobile.js +178 -0
  156. codeagent/web/static/17-preset-ux.css +287 -0
  157. codeagent/web/static/18-agent-mgr.css +616 -0
  158. codeagent/web/static/18-agent-mgr.js +204 -0
  159. codeagent/web/static/24-health-dashboard.js +68 -0
  160. codeagent/web/static/99-brand-polish.css +152 -0
  161. codeagent/web/static/body.html +824 -0
  162. codeagent/web/static/setup/setup_form.html +171 -0
  163. codeagent/web/static/setup/setup_head.html +100 -0
  164. codeagent/web/static/setup/setup_tail.html +264 -0
  165. codeagent/web/static/setup/setup_test.html +38 -0
  166. codeagent/web/web_login.html +265 -0
  167. codeagent/web/webui.html +35 -0
  168. tagword_codeagent-1.1.6.dist-info/METADATA +273 -0
  169. tagword_codeagent-1.1.6.dist-info/RECORD +173 -0
  170. tagword_codeagent-1.1.6.dist-info/WHEEL +5 -0
  171. tagword_codeagent-1.1.6.dist-info/entry_points.txt +3 -0
  172. tagword_codeagent-1.1.6.dist-info/licenses/LICENSE +21 -0
  173. tagword_codeagent-1.1.6.dist-info/top_level.txt +1 -0
@@ -0,0 +1,1058 @@
1
+ /* ================================================================
2
+ * 05-chat.css — Chat log, bubbles, compose, tool traces, live tool
3
+ * ================================================================ */
4
+
5
+ /* ============ Chat page layout ============ */
6
+ .chat-workspace {
7
+ flex: 1;
8
+ min-width: 0;
9
+ min-height: 0;
10
+ display: flex;
11
+ flex-direction: column;
12
+ }
13
+ #page-chat.active { flex-direction: row; }
14
+ .chat-log {
15
+ flex: 1;
16
+ min-height: 0;
17
+ overflow-y: auto;
18
+ padding: var(--sp-6) var(--sp-8);
19
+ display: flex;
20
+ flex-direction: column;
21
+ gap: var(--sp-5);
22
+ scroll-behavior: auto;
23
+ scrollbar-width: thin;
24
+ scrollbar-color: var(--border-strong) transparent;
25
+ }
26
+ .chat-log::-webkit-scrollbar { width: 8px; }
27
+ .chat-log::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
28
+ .chat-log::-webkit-scrollbar-thumb:hover { background: var(--text-subtle); }
29
+
30
+ /* ============ Message bubbles ============ */
31
+ .msg-row {
32
+ display: flex;
33
+ width: 100%;
34
+ max-width: 820px;
35
+ margin: 0 auto;
36
+ align-items: flex-end;
37
+ }
38
+ .msg-row.msg-agent { justify-content: flex-start; padding-right: 8%; }
39
+ .msg-row.msg-user { justify-content: flex-end; padding-left: 12%; }
40
+ .msg-col { display: flex; flex-direction: column; max-width: min(92%, 680px); }
41
+ .bubble {
42
+ padding: 10px 14px;
43
+ border-radius: var(--r-xl);
44
+ line-height: 1.55;
45
+ word-break: break-word;
46
+ font-size: 13.5px;
47
+ }
48
+ .bubble-agent {
49
+ background: var(--bubble-agent-bg);
50
+ border: 1px solid var(--bubble-agent-border);
51
+ color: var(--text);
52
+ box-shadow: var(--shadow-xs);
53
+ border-bottom-left-radius: var(--r-sm);
54
+ }
55
+ .bubble-user {
56
+ background: var(--bubble-user-bg);
57
+ color: var(--bubble-user-text);
58
+ border: none;
59
+ border-bottom-right-radius: var(--r-sm);
60
+ box-shadow: 0 2px 12px rgba(79, 70, 229, 0.22);
61
+ }
62
+ .msg-meta {
63
+ font-size: 10.5px;
64
+ font-weight: 500;
65
+ color: var(--text-muted);
66
+ margin-bottom: 4px;
67
+ padding: 0 2px;
68
+ font-variant-numeric: tabular-nums;
69
+ letter-spacing: 0.01em;
70
+ }
71
+ .msg-row.msg-agent .msg-meta { text-align: left; }
72
+ .msg-row.msg-user .msg-meta { text-align: right; }
73
+
74
+ /* ============ Bubble TTS play control ============ */
75
+ .bubble-tts-bar {
76
+ display: flex;
77
+ align-items: center;
78
+ gap: 2px;
79
+ padding: 0 2px;
80
+ margin-top: 3px;
81
+ }
82
+ .msg-row.msg-agent .bubble-tts-bar { justify-content: flex-end; padding-right: 4px; }
83
+ .msg-row.msg-user .bubble-tts-bar { justify-content: flex-end; padding-left: 4px; }
84
+ .bubble-tts-btn,
85
+ .bubble-copy-btn {
86
+ display: inline-flex;
87
+ align-items: center;
88
+ justify-content: center;
89
+ width: 26px;
90
+ height: 26px;
91
+ padding: 0;
92
+ border: 1px solid transparent;
93
+ border-radius: var(--r-full);
94
+ background: transparent;
95
+ color: var(--text-muted);
96
+ cursor: pointer;
97
+ transition: color 0.12s ease, background 0.12s ease, border-color 0.12s ease;
98
+ }
99
+ .bubble-tts-btn:hover,
100
+ .bubble-copy-btn:hover {
101
+ color: var(--text-secondary);
102
+ background: var(--bg-subtle);
103
+ border-color: var(--border);
104
+ }
105
+ .bubble-tts-btn.is-playing {
106
+ color: var(--accent);
107
+ background: var(--accent-softer);
108
+ border-color: var(--accent-soft);
109
+ }
110
+ .bubble-copy-btn.is-copied {
111
+ color: var(--accent);
112
+ background: var(--accent-softer);
113
+ border-color: var(--accent-soft);
114
+ }
115
+ .bubble-tts-btn:focus-visible,
116
+ .bubble-copy-btn:focus-visible {
117
+ outline: none;
118
+ box-shadow: var(--shadow-focus);
119
+ }
120
+
121
+ /* ============ Rollback button ============ */
122
+ .rollback-btn {
123
+ display: inline;
124
+ cursor: pointer;
125
+ color: var(--accent);
126
+ opacity: 0.4;
127
+ font-size: 10.5px;
128
+ font-weight: 400;
129
+ margin-left: 4px;
130
+ transition: opacity 0.15s ease;
131
+ user-select: none;
132
+ }
133
+ .rollback-btn:hover { opacity: 1; text-decoration: underline; }
134
+
135
+ .system-msg {
136
+ font-size: 12px;
137
+ text-align: center;
138
+ color: var(--text-muted);
139
+ padding: var(--sp-2) var(--sp-4);
140
+ margin: 0 auto;
141
+ max-width: 620px;
142
+ line-height: 1.5;
143
+ }
144
+ .system-msg.system-err { color: var(--danger); font-weight: 500; }
145
+ .system-msg.system-info { opacity: 0.95; }
146
+ .system-msg.system-tools {
147
+ text-align: left;
148
+ max-width: 820px;
149
+ width: 100%;
150
+ font-size: 12px;
151
+ padding: 10px 12px;
152
+ background: var(--bg-subtle);
153
+ border-radius: var(--r-md);
154
+ border: 1px solid var(--border);
155
+ margin: 0 auto;
156
+ box-shadow: var(--shadow-xs);
157
+ }
158
+ .system-msg.system-tools .oa-live-tool-title {
159
+ font-weight: 600;
160
+ color: var(--text-secondary);
161
+ font-size: 11.5px;
162
+ letter-spacing: 0.01em;
163
+ }
164
+ .system-msg.system-tools .oa-tool-trace-pre {
165
+ background: var(--bg-panel);
166
+ border: 1px solid var(--border);
167
+ border-radius: var(--r-sm);
168
+ padding: 8px 10px;
169
+ font-family: var(--font-mono);
170
+ font-size: 11.5px;
171
+ line-height: 1.45;
172
+ white-space: pre-wrap;
173
+ word-break: break-word;
174
+ margin: 6px 0 0;
175
+ max-height: 40vh;
176
+ overflow: auto;
177
+ }
178
+
179
+ /* ============ Markdown in bubble ============ */
180
+ .bubble .md-content { font-size: inherit; line-height: 1.6; word-break: break-word; }
181
+ .bubble .md-content > :first-child { margin-top: 0; }
182
+ .bubble .md-content > :last-child { margin-bottom: 0; }
183
+ .bubble .md-content p { margin: 0.4em 0; }
184
+ .bubble .md-content ul, .bubble .md-content ol { margin: 0.3em 0 0.3em 1.2em; padding-left: 0.2em; }
185
+ .bubble .md-content li { margin: 0.15em 0; }
186
+ .bubble .md-content h1, .bubble .md-content h2, .bubble .md-content h3, .bubble .md-content h4 {
187
+ font-size: 1.05em;
188
+ margin: 0.6em 0 0.3em;
189
+ font-weight: 650;
190
+ line-height: 1.3;
191
+ }
192
+ .bubble .md-content pre {
193
+ overflow-x: auto;
194
+ padding: 10px 12px;
195
+ border-radius: var(--r-sm);
196
+ font-size: 12px;
197
+ line-height: 1.5;
198
+ margin: 0.5em 0;
199
+ }
200
+ .bubble-agent .md-content pre { background: var(--bg-subtle); border: 1px solid var(--border); }
201
+ .bubble-user .md-content pre { background: rgba(0, 0, 0, 0.25); border: 1px solid rgba(255, 255, 255, 0.12); }
202
+ .bubble .md-content code { font-family: var(--font-mono); font-size: 0.9em; }
203
+ .bubble-agent .md-content :not(pre) > code {
204
+ padding: 1px 5px;
205
+ border-radius: 4px;
206
+ background: var(--bg-subtle);
207
+ border: 1px solid var(--border);
208
+ }
209
+ .bubble-user .md-content :not(pre) > code {
210
+ padding: 1px 5px;
211
+ border-radius: 4px;
212
+ background: rgba(0, 0, 0, 0.22);
213
+ }
214
+ .bubble-user .md-content a { color: #e0e7ff; text-decoration: underline; }
215
+ .bubble-agent .md-content a { color: var(--accent); }
216
+ .bubble .md-content blockquote {
217
+ margin: 0.4em 0;
218
+ padding-left: 0.8em;
219
+ border-left: 2px solid var(--border);
220
+ color: var(--text-secondary);
221
+ }
222
+ .bubble .md-content table { border-collapse: collapse; font-size: 0.93em; margin: 0.5em 0; }
223
+ .bubble .md-content th, .bubble .md-content td { border: 1px solid var(--border); padding: 4px 8px; }
224
+ .bubble .md-content hr { border: none; border-top: 1px solid var(--border); margin: 0.7em 0; }
225
+ .bubble .md-content--plain { white-space: pre-wrap; }
226
+
227
+ /* ============ Compose — premium composer ============ */
228
+ .compose__head {
229
+ display: flex;
230
+ flex-direction: column;
231
+ gap: var(--sp-2);
232
+ padding: 10px 12px 0;
233
+ }
234
+ .compose__head[hidden] { display: none !important; }
235
+ .compose__attachments {
236
+ display: flex;
237
+ flex-wrap: nowrap;
238
+ gap: var(--sp-2);
239
+ overflow-x: auto;
240
+ padding-bottom: 2px;
241
+ scrollbar-width: none;
242
+ }
243
+ .compose__attachments::-webkit-scrollbar { display: none; }
244
+ .compose-attach-chip {
245
+ display: inline-flex;
246
+ flex-direction: column;
247
+ align-items: stretch;
248
+ flex-shrink: 0;
249
+ width: 68px;
250
+ padding: 0;
251
+ border-radius: var(--r-md);
252
+ background: var(--bg-subtle);
253
+ border: 1px solid var(--border);
254
+ font-size: 10px;
255
+ overflow: hidden;
256
+ position: relative;
257
+ }
258
+ .compose-attach-chip img {
259
+ width: 68px;
260
+ height: 52px;
261
+ object-fit: cover;
262
+ border-radius: 0;
263
+ }
264
+ .compose-attach-chip > span:not(.compose-attach-rm) {
265
+ padding: 3px 6px;
266
+ overflow: hidden;
267
+ text-overflow: ellipsis;
268
+ white-space: nowrap;
269
+ color: var(--text-muted);
270
+ }
271
+ .compose-attach-rm {
272
+ position: absolute;
273
+ top: 3px;
274
+ right: 3px;
275
+ width: 18px;
276
+ height: 18px;
277
+ border: none;
278
+ border-radius: var(--r-full);
279
+ background: rgba(0, 0, 0, 0.55);
280
+ color: #fff;
281
+ cursor: pointer;
282
+ padding: 0;
283
+ line-height: 16px;
284
+ font-size: 13px;
285
+ opacity: 0;
286
+ transition: opacity 0.15s ease;
287
+ }
288
+ .compose-attach-chip:hover .compose-attach-rm { opacity: 1; }
289
+ .compose-attach-rm:hover { background: rgba(0, 0, 0, 0.75); }
290
+ .compose__editor { min-width: 0; }
291
+ .compose__editor #msg,
292
+ .compose__box > #msg {
293
+ width: 100%;
294
+ min-height: 48px;
295
+ max-height: 220px;
296
+ padding: 12px 14px;
297
+ border: none;
298
+ background: transparent;
299
+ resize: none;
300
+ outline: none;
301
+ }
302
+ .compose__sheet[hidden] { display: none !important; }
303
+ .compose__sheet {
304
+ border-top: 1px solid var(--border);
305
+ background: var(--bg-subtle);
306
+ animation: compose-sheet-in 0.18s ease;
307
+ }
308
+ @keyframes compose-sheet-in {
309
+ from { opacity: 0; transform: translateY(4px); }
310
+ to { opacity: 1; transform: translateY(0); }
311
+ }
312
+ .compose__sheet-head {
313
+ display: flex;
314
+ align-items: center;
315
+ justify-content: space-between;
316
+ padding: 8px 12px 6px;
317
+ }
318
+ .compose__sheet-title {
319
+ font-size: 11px;
320
+ font-weight: 650;
321
+ letter-spacing: 0.06em;
322
+ text-transform: uppercase;
323
+ color: var(--text-muted);
324
+ }
325
+ .compose__sheet-close {
326
+ width: 24px;
327
+ height: 24px;
328
+ border: none;
329
+ border-radius: var(--r-sm);
330
+ background: transparent;
331
+ color: var(--text-muted);
332
+ cursor: pointer;
333
+ font-size: 16px;
334
+ line-height: 1;
335
+ padding: 0;
336
+ }
337
+ .compose__sheet-close:hover {
338
+ background: var(--bg-hover);
339
+ color: var(--text);
340
+ }
341
+ .compose__sheet-grid {
342
+ display: grid;
343
+ grid-template-columns: repeat(2, minmax(0, 1fr));
344
+ gap: 10px 12px;
345
+ padding: 2px 12px 12px;
346
+ }
347
+ .compose__field {
348
+ display: flex;
349
+ flex-direction: column;
350
+ gap: 4px;
351
+ min-width: 0;
352
+ }
353
+ .compose__field--wide { grid-column: 1 / -1; }
354
+ .compose__field-label {
355
+ font-size: 10px;
356
+ font-weight: 600;
357
+ letter-spacing: 0.04em;
358
+ text-transform: uppercase;
359
+ color: var(--text-subtle);
360
+ }
361
+ .compose__field-select {
362
+ width: 100%;
363
+ padding: 6px 8px;
364
+ border: 1px solid var(--border);
365
+ border-radius: var(--r-sm);
366
+ background: var(--bg-panel);
367
+ font-size: 12px;
368
+ font-family: inherit;
369
+ color: var(--text);
370
+ cursor: pointer;
371
+ transition: border-color 0.12s ease, box-shadow 0.12s ease;
372
+ }
373
+ .compose__field-select:hover { border-color: var(--border-strong); }
374
+ .compose__field-select:focus {
375
+ outline: none;
376
+ border-color: var(--accent);
377
+ box-shadow: var(--shadow-focus);
378
+ }
379
+ .compose__field-select:disabled {
380
+ opacity: 0.5;
381
+ cursor: not-allowed;
382
+ }
383
+ .compose__field-hint {
384
+ margin: 0;
385
+ font-size: 10.5px;
386
+ line-height: 1.45;
387
+ color: var(--text-subtle);
388
+ }
389
+ .compose__field-hint a { color: var(--accent); }
390
+
391
+ /* ── Compose dock — unified chip tray ── */
392
+ .compose__box:focus-within {
393
+ border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
394
+ box-shadow:
395
+ var(--shadow-sm),
396
+ 0 0 0 1px color-mix(in srgb, var(--accent) 10%, transparent);
397
+ }
398
+ .compose__dock {
399
+ display: grid;
400
+ grid-template-columns: auto minmax(0, 1fr) auto;
401
+ align-items: center;
402
+ gap: 10px;
403
+ padding: 8px 10px 10px;
404
+ background: linear-gradient(180deg, transparent 0%, var(--bg-subtle) 100%);
405
+ border-top: 1px solid var(--border);
406
+ min-height: 52px;
407
+ }
408
+ .compose__dock-tools { flex-shrink: 0; }
409
+ .compose__dock-chips {
410
+ display: flex;
411
+ align-items: center;
412
+ gap: 6px;
413
+ min-width: 0;
414
+ overflow-x: auto;
415
+ scrollbar-width: none;
416
+ }
417
+ .compose__dock-chips::-webkit-scrollbar { display: none; }
418
+ .compose__dock-actions {
419
+ flex-shrink: 0;
420
+ display: flex;
421
+ align-items: center;
422
+ gap: 8px;
423
+ }
424
+ .compose__tool-btn {
425
+ display: inline-flex;
426
+ align-items: center;
427
+ justify-content: center;
428
+ width: 36px;
429
+ height: 36px;
430
+ padding: 0;
431
+ border: 1px solid var(--border);
432
+ border-radius: var(--r-md);
433
+ background: var(--bg-panel);
434
+ color: var(--text-muted);
435
+ cursor: pointer;
436
+ transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
437
+ }
438
+ .compose__tool-btn:hover:not(:disabled) {
439
+ color: var(--text);
440
+ background: var(--bg-hover);
441
+ border-color: var(--border-strong);
442
+ }
443
+ .compose__tool-btn:active:not(:disabled) { transform: scale(0.96); }
444
+ .compose__tool-btn:focus-visible {
445
+ outline: none;
446
+ box-shadow: var(--shadow-focus);
447
+ }
448
+
449
+ .compose__chip {
450
+ display: inline-flex;
451
+ align-items: center;
452
+ gap: 6px;
453
+ flex-shrink: 0;
454
+ height: 32px;
455
+ max-width: min(280px, 100%);
456
+ padding: 0 10px 0 8px;
457
+ border: 1px solid var(--border);
458
+ border-radius: var(--r-full);
459
+ background: var(--bg-panel);
460
+ color: var(--text-secondary);
461
+ font-size: 12px;
462
+ font-weight: 500;
463
+ font-family: inherit;
464
+ line-height: 1;
465
+ cursor: pointer;
466
+ white-space: nowrap;
467
+ transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
468
+ }
469
+ .compose__chip:hover {
470
+ border-color: var(--border-strong);
471
+ background: var(--bg-hover);
472
+ color: var(--text);
473
+ }
474
+ .compose__chip:focus-visible {
475
+ outline: none;
476
+ box-shadow: var(--shadow-focus);
477
+ }
478
+ .compose__chip-leading {
479
+ display: inline-flex;
480
+ flex-shrink: 0;
481
+ opacity: 0.72;
482
+ transition: opacity 0.18s ease, color 0.18s ease;
483
+ }
484
+ .compose__chip-label {
485
+ overflow: hidden;
486
+ text-overflow: ellipsis;
487
+ white-space: nowrap;
488
+ }
489
+ .compose__chip-chevron {
490
+ flex-shrink: 0;
491
+ opacity: 0.45;
492
+ transition: transform 0.18s ease, opacity 0.18s ease;
493
+ }
494
+ .compose__chip-badge {
495
+ flex-shrink: 0;
496
+ width: 6px;
497
+ height: 6px;
498
+ border-radius: 50%;
499
+ background: var(--accent);
500
+ box-shadow: 0 0 0 2px var(--accent-softer);
501
+ }
502
+ .compose__chip-badge[hidden] { display: none; }
503
+ .compose__chip-extra {
504
+ flex-shrink: 0;
505
+ font-size: 10px;
506
+ font-weight: 650;
507
+ line-height: 1;
508
+ color: var(--text-subtle);
509
+ padding: 1px 4px;
510
+ border-radius: var(--r-xs);
511
+ background: var(--bg-subtle);
512
+ }
513
+ .compose__chip-extra[hidden] { display: none; }
514
+ .compose__chip--model[aria-expanded="true"] .compose__chip-extra {
515
+ background: color-mix(in srgb, var(--accent) 12%, var(--bg-panel));
516
+ color: var(--accent);
517
+ }
518
+
519
+ /* Think — mini switch, no global strikethrough */
520
+ .compose__dock .think-toggle[aria-pressed="false"] {
521
+ opacity: 1;
522
+ }
523
+ .compose__dock .think-toggle[aria-pressed="false"] .think-toggle__label {
524
+ text-decoration: none;
525
+ color: var(--text-subtle);
526
+ }
527
+ .compose__chip--think {
528
+ padding-right: 8px;
529
+ }
530
+ .compose__chip--think[aria-pressed="true"] {
531
+ border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
532
+ background: var(--accent-softer);
533
+ color: var(--accent);
534
+ }
535
+ .compose__chip--think[aria-pressed="true"] .compose__chip-leading {
536
+ opacity: 1;
537
+ color: var(--accent);
538
+ }
539
+ .compose__chip--think[aria-pressed="false"] .compose__chip-leading {
540
+ opacity: 0.45;
541
+ }
542
+ .compose__switch {
543
+ display: inline-flex;
544
+ flex-shrink: 0;
545
+ margin-left: 2px;
546
+ }
547
+ .compose__switch-track {
548
+ position: relative;
549
+ width: 30px;
550
+ height: 17px;
551
+ border-radius: var(--r-full);
552
+ background: color-mix(in srgb, var(--border-strong) 85%, var(--text-subtle));
553
+ transition: background 0.22s cubic-bezier(0.4, 0, 0.2, 1);
554
+ }
555
+ .compose__chip--think[aria-pressed="true"] .compose__switch-track {
556
+ background: var(--accent);
557
+ box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12);
558
+ }
559
+ .compose__switch-thumb {
560
+ position: absolute;
561
+ top: 2px;
562
+ left: 2px;
563
+ width: 13px;
564
+ height: 13px;
565
+ border-radius: 50%;
566
+ background: #fff;
567
+ box-shadow: 0 1px 3px rgba(15, 23, 42, 0.22);
568
+ transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
569
+ }
570
+ .compose__chip--think[aria-pressed="true"] .compose__switch-thumb {
571
+ transform: translateX(13px);
572
+ }
573
+
574
+ /* Model pill */
575
+ .compose__chip--model {
576
+ max-width: min(300px, 55vw);
577
+ }
578
+ .compose__chip--model.is-open,
579
+ .compose__chip--model[aria-expanded="true"] {
580
+ border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
581
+ background: var(--accent-softer);
582
+ color: var(--accent);
583
+ }
584
+ .compose__chip--model.is-open .compose__chip-leading,
585
+ .compose__chip--model[aria-expanded="true"] .compose__chip-leading {
586
+ opacity: 1;
587
+ color: var(--accent);
588
+ }
589
+ .compose__chip--model[aria-expanded="true"] .compose__chip-chevron {
590
+ transform: rotate(180deg);
591
+ opacity: 0.75;
592
+ }
593
+
594
+ .compose__attach-popup {
595
+ position: fixed;
596
+ z-index: 200;
597
+ display: none;
598
+ flex-direction: column;
599
+ min-width: 148px;
600
+ padding: 4px;
601
+ border: 1px solid var(--border);
602
+ border-radius: var(--r-md);
603
+ background: var(--bg-panel);
604
+ box-shadow: var(--shadow-md);
605
+ }
606
+ .compose__attach-option {
607
+ display: flex;
608
+ align-items: center;
609
+ gap: 8px;
610
+ width: 100%;
611
+ padding: 8px 10px;
612
+ border: none;
613
+ border-radius: calc(var(--r-md) - 2px);
614
+ background: transparent;
615
+ color: var(--text-secondary);
616
+ font-size: 12.5px;
617
+ font-family: inherit;
618
+ text-align: left;
619
+ cursor: pointer;
620
+ }
621
+ .compose__attach-option:hover {
622
+ background: var(--bg-hover);
623
+ color: var(--text);
624
+ }
625
+ .compose__tool-group {
626
+ display: inline-flex;
627
+ align-items: center;
628
+ gap: 1px;
629
+ padding: 2px;
630
+ border-radius: var(--r-md);
631
+ background: var(--bg-subtle);
632
+ border: 1px solid var(--border);
633
+ }
634
+ .compose__tool-group .btn--icon {
635
+ width: 30px;
636
+ height: 30px;
637
+ padding: 0;
638
+ border-radius: calc(var(--r-md) - 2px);
639
+ color: var(--text-muted);
640
+ }
641
+ .compose__tool-group .btn--icon:hover:not(:disabled) {
642
+ background: var(--bg-panel);
643
+ color: var(--text);
644
+ }
645
+ .btn--icon {
646
+ width: 32px;
647
+ height: 32px;
648
+ padding: 0;
649
+ flex-shrink: 0;
650
+ }
651
+ .compose__stop:disabled { display: none; }
652
+ .compose__stop:not(:disabled) {
653
+ height: 28px;
654
+ padding: 0 10px;
655
+ font-size: 12px;
656
+ }
657
+ .btn--send {
658
+ width: 34px;
659
+ height: 34px;
660
+ border-radius: var(--r-full);
661
+ box-shadow: 0 2px 8px rgba(79, 70, 229, 0.28);
662
+ }
663
+ .btn--send .btn__send-label { display: none; }
664
+ .btn--send:hover:not(:disabled) {
665
+ transform: translateY(-1px);
666
+ box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
667
+ }
668
+ .btn--send.is-stop {
669
+ box-shadow: 0 2px 8px rgba(220, 38, 38, 0.28);
670
+ }
671
+ .btn--send.is-stop:hover:not(:disabled) {
672
+ box-shadow: 0 4px 12px rgba(220, 38, 38, 0.35);
673
+ }
674
+ .token-usage--compact {
675
+ padding: 2px 6px 2px 4px;
676
+ gap: 4px;
677
+ }
678
+ .token-usage--compact .token-usage__pct {
679
+ min-width: 24px;
680
+ font-size: 10px;
681
+ }
682
+ .compose-attach-chip--file::before {
683
+ content: '';
684
+ display: block;
685
+ width: 100%;
686
+ height: 52px;
687
+ border-bottom: 1px solid var(--border);
688
+ background: var(--bg-hover) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 2v6h6'/%3E%3C/svg%3E") center / 22px no-repeat;
689
+ }
690
+ .compose__box--sheet-open .compose__dock {
691
+ border-top-color: transparent;
692
+ }
693
+ .bubble-user__attachments {
694
+ display: flex;
695
+ flex-wrap: wrap;
696
+ gap: var(--sp-2);
697
+ margin-bottom: var(--sp-2);
698
+ }
699
+
700
+ /* 会话内图片:按气泡/会话区宽度等比缩放,不撑出消息列 */
701
+ .bubble .md-content img,
702
+ .chat-inline-img,
703
+ .bubble-user__img,
704
+ .oa-tool-gen-images img {
705
+ display: block;
706
+ max-width: 100%;
707
+ width: auto;
708
+ height: auto;
709
+ max-height: min(50vh, 420px);
710
+ object-fit: contain;
711
+ border-radius: 8px;
712
+ }
713
+ .bubble-user__img,
714
+ .oa-tool-gen-images img {
715
+ border: 1px solid var(--border);
716
+ background: var(--bg-subtle);
717
+ }
718
+ .bubble-user .bubble-user__img {
719
+ border-color: rgba(255, 255, 255, 0.15);
720
+ background: rgba(0, 0, 0, 0.2);
721
+ }
722
+ .oa-tool-gen-images {
723
+ display: flex;
724
+ flex-wrap: wrap;
725
+ gap: var(--sp-2);
726
+ padding: var(--sp-2) var(--sp-3) var(--sp-3);
727
+ }
728
+
729
+ /* 会话图片:悬停显示放大 / 下载(按钮在右上角) */
730
+ .chat-img-wrap {
731
+ position: relative;
732
+ display: block;
733
+ width: fit-content;
734
+ max-width: 100%;
735
+ margin: 0.25em 0;
736
+ }
737
+ .chat-img-wrap > img {
738
+ display: block;
739
+ width: auto;
740
+ max-width: 100%;
741
+ height: auto;
742
+ max-height: min(50vh, 420px);
743
+ object-fit: contain;
744
+ cursor: zoom-in;
745
+ }
746
+ .chat-img-wrap__actions {
747
+ position: absolute;
748
+ top: 6px;
749
+ right: 6px;
750
+ display: flex;
751
+ flex-direction: row-reverse;
752
+ gap: 4px;
753
+ opacity: 0;
754
+ pointer-events: none;
755
+ transition: opacity 0.15s ease;
756
+ z-index: 1;
757
+ }
758
+ .chat-img-wrap:hover .chat-img-wrap__actions,
759
+ .chat-img-wrap:focus-within .chat-img-wrap__actions {
760
+ opacity: 1;
761
+ pointer-events: auto;
762
+ }
763
+ .chat-img-btn {
764
+ display: inline-flex;
765
+ align-items: center;
766
+ justify-content: center;
767
+ width: 28px;
768
+ height: 28px;
769
+ min-height: 28px;
770
+ padding: 0;
771
+ border-radius: 6px;
772
+ border: 1px solid rgba(255, 255, 255, 0.35);
773
+ background: rgba(15, 15, 20, 0.72);
774
+ color: #fff;
775
+ font-size: 15px;
776
+ font-weight: 600;
777
+ line-height: 1;
778
+ cursor: pointer;
779
+ text-decoration: none;
780
+ font-family: inherit;
781
+ backdrop-filter: blur(4px);
782
+ }
783
+ .chat-img-btn--zoom {
784
+ font-size: 14px;
785
+ }
786
+ .chat-img-btn--dl,
787
+ a.chat-img-btn--dl,
788
+ .bubble .md-content a.chat-img-btn,
789
+ .bubble-user a.chat-img-btn,
790
+ .bubble-agent .md-content a.chat-img-btn {
791
+ color: #fff;
792
+ text-decoration: none;
793
+ }
794
+ .chat-img-btn:hover {
795
+ background: rgba(15, 15, 20, 0.88);
796
+ }
797
+ .chat-img-btn--dl:hover,
798
+ a.chat-img-btn--dl:hover {
799
+ color: #fff;
800
+ }
801
+ .bubble-user .chat-img-btn {
802
+ border-color: rgba(255, 255, 255, 0.4);
803
+ }
804
+
805
+ /* 全屏预览 */
806
+ .chat-img-lightbox {
807
+ position: fixed;
808
+ inset: 0;
809
+ z-index: 1300;
810
+ display: none;
811
+ align-items: center;
812
+ justify-content: center;
813
+ padding: var(--sp-4);
814
+ }
815
+ .chat-img-lightbox.is-open {
816
+ display: flex;
817
+ }
818
+ .chat-img-lightbox__backdrop {
819
+ position: absolute;
820
+ inset: 0;
821
+ background: rgba(0, 0, 0, 0.72);
822
+ cursor: zoom-out;
823
+ }
824
+ .chat-img-lightbox__panel {
825
+ position: relative;
826
+ z-index: 1;
827
+ display: flex;
828
+ align-items: center;
829
+ justify-content: center;
830
+ max-width: 96vw;
831
+ max-height: 92vh;
832
+ }
833
+ .chat-img-lightbox__stage {
834
+ position: relative;
835
+ width: fit-content;
836
+ max-width: 96vw;
837
+ max-height: 92vh;
838
+ }
839
+ .chat-img-lightbox__img {
840
+ display: block;
841
+ max-width: 96vw;
842
+ max-height: 92vh;
843
+ width: auto;
844
+ height: auto;
845
+ object-fit: contain;
846
+ border-radius: 8px;
847
+ box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
848
+ }
849
+ .chat-img-lightbox__actions {
850
+ position: absolute;
851
+ top: 8px;
852
+ right: 8px;
853
+ display: flex;
854
+ flex-direction: row-reverse;
855
+ gap: 6px;
856
+ z-index: 2;
857
+ }
858
+ .chat-img-lightbox__close.chat-img-btn {
859
+ width: 32px;
860
+ height: 32px;
861
+ min-height: 32px;
862
+ font-size: 20px;
863
+ line-height: 1;
864
+ border-radius: 6px;
865
+ color: #fff;
866
+ background: rgba(15, 15, 20, 0.72);
867
+ border: 1px solid rgba(255, 255, 255, 0.35);
868
+ cursor: pointer;
869
+ }
870
+ .chat-img-lightbox__close.chat-img-btn:hover {
871
+ color: #fff;
872
+ background: rgba(15, 15, 20, 0.88);
873
+ }
874
+ .chat-img-lightbox__dl.chat-img-btn {
875
+ width: 32px;
876
+ height: 32px;
877
+ min-height: 32px;
878
+ font-size: 17px;
879
+ color: #fff;
880
+ background: rgba(15, 15, 20, 0.72);
881
+ border-color: rgba(255, 255, 255, 0.35);
882
+ }
883
+ .chat-img-lightbox__dl.chat-img-btn:hover {
884
+ color: #fff;
885
+ background: rgba(15, 15, 20, 0.88);
886
+ }
887
+ body.chat-img-lightbox-open {
888
+ overflow: hidden;
889
+ }
890
+
891
+ .mcp-status-list .mcp-status-row {
892
+ padding: 2px 0;
893
+ }
894
+ .mcp-status-list .mcp-status-row--minimax {
895
+ font-weight: 550;
896
+ }
897
+ .mcp-status-list .mcp-status-row__err {
898
+ color: var(--danger, #dc2626);
899
+ font-size: 11px;
900
+ font-weight: 400;
901
+ word-break: break-word;
902
+ }
903
+
904
+ /* ============ Camera modal ============ */
905
+ .camera-modal {
906
+ align-items: center;
907
+ justify-content: center;
908
+ z-index: 1200;
909
+ }
910
+ .camera-modal__dialog {
911
+ max-width: min(640px, 96vw);
912
+ width: 100%;
913
+ }
914
+ .camera-modal__body {
915
+ padding: 0;
916
+ background: #000;
917
+ }
918
+ .camera-modal__video {
919
+ display: block;
920
+ width: 100%;
921
+ max-height: min(60vh, 480px);
922
+ object-fit: contain;
923
+ background: #000;
924
+ }
925
+ .camera-modal__status {
926
+ margin: 0;
927
+ padding: var(--sp-2) var(--sp-3);
928
+ font-size: 0.82em;
929
+ color: var(--text-secondary);
930
+ background: var(--bg-subtle);
931
+ border-top: 1px solid var(--border);
932
+ }
933
+ .camera-modal__footer {
934
+ display: flex;
935
+ flex-wrap: wrap;
936
+ gap: var(--sp-2);
937
+ justify-content: flex-end;
938
+ }
939
+ #cameraToggleInterval.is-active {
940
+ color: var(--accent);
941
+ border-color: var(--accent);
942
+ }
943
+
944
+ /* ============ Code block copy button ============ */
945
+ .code-block-wrap {
946
+ position: relative;
947
+ margin: var(--sp-3) 0;
948
+ border: 1px solid var(--border);
949
+ border-radius: var(--r-md);
950
+ overflow: hidden;
951
+ background: var(--bg-subtle);
952
+ }
953
+ .code-copy-btn {
954
+ position: absolute;
955
+ top: 6px;
956
+ right: 6px;
957
+ z-index: 2;
958
+ display: inline-flex;
959
+ align-items: center;
960
+ justify-content: center;
961
+ width: 28px;
962
+ height: 28px;
963
+ padding: 0;
964
+ border: 1px solid var(--border);
965
+ border-radius: var(--r-xs);
966
+ background: var(--bg-panel);
967
+ color: var(--text-muted);
968
+ cursor: pointer;
969
+ opacity: 0;
970
+ transition: opacity 0.18s, color 0.12s, background 0.12s;
971
+ }
972
+ .code-block-wrap:hover .code-copy-btn,
973
+ .code-copy-btn:focus-visible {
974
+ opacity: 0.85;
975
+ }
976
+ .code-copy-btn:hover {
977
+ opacity: 1 !important;
978
+ color: var(--text);
979
+ background: var(--bg-hover);
980
+ }
981
+ .code-copy-btn.is-copied {
982
+ opacity: 1 !important;
983
+ color: var(--success, #16a34a);
984
+ border-color: var(--success, #16a34a);
985
+ background: var(--bg-panel);
986
+ }
987
+ .code-block-wrap pre {
988
+ margin: 0;
989
+ padding: 14px 16px;
990
+ border: none;
991
+ border-radius: 0;
992
+ overflow-x: auto;
993
+ font-size: 12.5px;
994
+ line-height: 1.55;
995
+ background: transparent;
996
+ }
997
+ .code-block-wrap code {
998
+ background: none;
999
+ padding: 0;
1000
+ font-family: var(--font-mono);
1001
+ }
1002
+
1003
+ /* ============================================================
1004
+ * Mermaid diagrams
1005
+ * 渲染流程:03c-render-bubble.js renderMarkdown 把 ```mermaid 块
1006
+ * 替换为 <pre class="mermaid">,再由 renderMermaidInBubble() 异步
1007
+ * 调 mermaid.render() 输出 SVG 到 .mermaid-host。
1008
+ * ============================================================ */
1009
+ .mermaid-host {
1010
+ display: flex;
1011
+ justify-content: center;
1012
+ align-items: center;
1013
+ margin: 12px 0;
1014
+ padding: 14px 12px;
1015
+ background: var(--bg-subtle, #f7f7f9);
1016
+ border: 1px solid var(--border, #e5e7eb);
1017
+ border-radius: 10px;
1018
+ overflow-x: auto;
1019
+ position: relative; /* 给 .mermaid-host__actions 提供定位基准 */
1020
+ }
1021
+ .mermaid-host svg {
1022
+ max-width: 100%;
1023
+ height: auto;
1024
+ display: block;
1025
+ }
1026
+ .mermaid-error {
1027
+ margin: 12px 0;
1028
+ padding: 10px 12px;
1029
+ background: #fef2f2;
1030
+ border: 1px solid #fecaca;
1031
+ border-radius: 8px;
1032
+ color: #b91c1c;
1033
+ font-size: 12.5px;
1034
+ font-family: var(--font-mono, ui-monospace, monospace);
1035
+ white-space: pre-wrap;
1036
+ word-break: break-word;
1037
+ }
1038
+
1039
+ /* mermaid 图右上角悬浮操作按钮(hover/focus 时显示) */
1040
+ .mermaid-host__actions {
1041
+ position: absolute;
1042
+ top: 8px;
1043
+ right: 8px;
1044
+ display: flex;
1045
+ gap: 6px;
1046
+ opacity: 0;
1047
+ transition: opacity 120ms ease-in-out;
1048
+ pointer-events: none; /* 避免透明时挡住 svg */
1049
+ }
1050
+ .mermaid-host:hover .mermaid-host__actions,
1051
+ .mermaid-host:focus-within .mermaid-host__actions {
1052
+ opacity: 1;
1053
+ pointer-events: auto;
1054
+ }
1055
+ /* 小屏(触屏)始终显示,避免无法点击 */
1056
+ @media (hover: none) {
1057
+ .mermaid-host__actions { opacity: 1; pointer-events: auto; }
1058
+ }