@yezack/dsh-remote-mobile 1.9.2 → 1.10.0
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.
- package/CHANGELOG.md +64 -2
- package/README.md +109 -34
- package/README_EN.md +115 -40
- package/lib/auth/crypto.js +3 -1
- package/lib/auth/gate.d.ts +39 -9
- package/lib/auth/gate.js +231 -33
- package/lib/auth/tailscale.d.ts +24 -2
- package/lib/auth/tailscale.js +38 -3
- package/lib/auth/token.d.ts +22 -0
- package/lib/auth/token.js +58 -2
- package/lib/bridge/compat.d.ts +22 -2
- package/lib/bridge/compat.js +579 -336
- package/lib/client.js +67 -14
- package/lib/gateway/detector.d.ts +42 -0
- package/lib/gateway/detector.js +88 -0
- package/lib/gateway/secret.d.ts +23 -0
- package/lib/gateway/secret.js +65 -0
- package/lib/gateway/server.d.ts +108 -0
- package/lib/gateway/server.js +568 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +143 -15
- package/lib/routes/api.js +16 -10
- package/lib/routes/login-page.js +399 -398
- package/lib/styles/style-snippets.js +639 -639
- package/package.json +3 -3
|
@@ -30,649 +30,649 @@ export const MAX_NAME_LENGTH = 80;
|
|
|
30
30
|
/** 内置预设 id 保留前缀(自定义片段不得占用) */
|
|
31
31
|
export const BUILTIN_ID_PREFIX = 'preset-';
|
|
32
32
|
/** 侧边栏预设:抽屉式导航 + 整体布局(overscroll / 三栏 0 占位 / 悬浮把手) */
|
|
33
|
-
const PRESET_SIDEBAR_CSS = `
|
|
34
|
-
/* ===== dsh-remote-mobile · 侧边栏抽屉导航与整体布局 ===== */
|
|
35
|
-
/* 注:窄屏媒体查询由注入层按端包裹(移动端包 @media (max-width:900px),PC 端原样生效) */
|
|
36
|
-
/* 0. 禁用浏览器原生橡皮筋下拉刷新与链式溢出滚动,彻底杜绝上下滑动误刷新页面 */
|
|
37
|
-
html,
|
|
38
|
-
body,
|
|
39
|
-
[class*="_frame"],
|
|
40
|
-
[role="dialog"],
|
|
41
|
-
[class*="_dialog"],
|
|
42
|
-
[class*="_modalContent"],
|
|
43
|
-
[class*="_overlay"],
|
|
44
|
-
[class*="_conversationArea"],
|
|
45
|
-
[class*="_centerCol"] {
|
|
46
|
-
overscroll-behavior-y: contain !important;
|
|
47
|
-
overscroll-behavior-x: none !important;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/* 1. 最外层三栏布局:在移动端主工作区占满 100% 全宽,消除侧边栏强制占位。
|
|
51
|
-
选择器全部基于官方 CSS Modules 稳定后缀(_frame/_sidebarCol/_centerCol,
|
|
52
|
-
前缀 hash 随机、后缀稳定),不依赖 @linxin666/dsh-web-ui-all 注入的
|
|
53
|
-
data-pane / data-dsh-frame 属性,安装与否均生效。
|
|
54
|
-
注意:_frame 后缀同样命中「提问卡片」(Mbwy4a_frame 等非三栏布局元素),
|
|
55
|
-
故用 :has([class*="_sidebarCol"]) 把规则精确锁定到真正承载三栏布局的
|
|
56
|
-
外层 frame,避免提问弹窗被强制 100vw 撑满、被遮罩盖住。 */
|
|
57
|
-
[class*="_frame"]:has([class*="_sidebarCol"]) {
|
|
58
|
-
grid-template-columns: 0px minmax(0px, 1fr) 0px !important;
|
|
59
|
-
width: 100vw !important;
|
|
60
|
-
max-width: 100vw !important;
|
|
61
|
-
overflow-x: hidden !important;
|
|
62
|
-
position: relative !important;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/* 核心修复:显式将三列锁定到各自的 Grid 轨道!
|
|
66
|
-
官方 AppFrame 为三栏 CSS Grid 布局(sidebarCol + centerCol + rightbarCol)。
|
|
67
|
-
当 sidebarCol 设为 position: fixed 后脱离 Grid 自动流,会导致后续两列前移:
|
|
68
|
-
centerCol 移入第 1 列(0px),rightbarCol 移入第 2 列(1fr 全宽) 并全屏覆盖在
|
|
69
|
-
对话区上方,其透明容器拦截全部点击与触摸手势(Issue #6)。
|
|
70
|
-
通过显式指定 grid-column,确保每列始终位于设计轨道,杜绝错位覆盖。 */
|
|
71
|
-
[class*="_frame"]:has([class*="_sidebarCol"]) > [class*="_sidebarCol"] {
|
|
72
|
-
grid-column: 1 !important;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
[class*="_frame"]:has([class*="_sidebarCol"]) [class*="_centerCol"],
|
|
76
|
-
[class*="_frame"]:has([class*="_sidebarCol"]) > [class*="_centerCol"] {
|
|
77
|
-
grid-column: 2 !important;
|
|
78
|
-
width: 100vw !important;
|
|
79
|
-
max-width: 100vw !important;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
[class*="_frame"]:has([class*="_sidebarCol"]) > [class*="_rightbarCol"] {
|
|
83
|
-
grid-column: 3 !important;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/* 右侧栏折叠态穿透防御:折叠时宽度清零并禁用指针事件,杜绝透明层与边缘手柄拦截触摸 */
|
|
87
|
-
[class*="_frame"][data-rightbar-collapsed] [class*="_rightbarCol"],
|
|
88
|
-
[class*="_rightbarCol"]:not(:has([data-sidebar-right-open])) {
|
|
89
|
-
width: 0px !important;
|
|
90
|
-
min-width: 0px !important;
|
|
91
|
-
pointer-events: none !important;
|
|
92
|
-
}
|
|
93
|
-
[class*="_rightbarCol"]:has([data-sidebar-right-open]),
|
|
94
|
-
[class*="_frame"]:not([data-rightbar-collapsed]) [class*="_rightbarCol"] {
|
|
95
|
-
pointer-events: auto !important;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/* 2. 侧边栏最外层容器:作为整体抽屉浮层(阴影仅加在最外层,严禁污染内部列表) */
|
|
99
|
-
[class*="_sidebarCol"] {
|
|
100
|
-
position: fixed !important;
|
|
101
|
-
top: 0 !important;
|
|
102
|
-
bottom: 0 !important;
|
|
103
|
-
left: 0 !important;
|
|
104
|
-
height: 100vh !important;
|
|
105
|
-
height: 100dvh !important;
|
|
106
|
-
/* 层级守卫:抽屉必须低于官方弹层体系(模态弹窗 z=1000、下拉/弹出菜单 z=1100),
|
|
107
|
-
否则设置面板的操作菜单(portal 到 body)会被抽屉盖住无法交互。
|
|
108
|
-
官方内容区元素均在 100 层级以下,900 足以保证抽屉覆盖正文。
|
|
109
|
-
展开态宽度:装了 web-ui 时由它接管(min(88vw,320px));未装时沿用官方
|
|
110
|
-
内联 width(280px 左右),宽度差由下方内层铺满规则消除。 */
|
|
111
|
-
min-width: 0 !important;
|
|
112
|
-
z-index: 900 !important;
|
|
113
|
-
background: var(--dsw-alias-bg-layer-1, #ffffff) !important;
|
|
114
|
-
box-shadow: 6px 0 30px rgba(0, 0, 0, 0.25) !important;
|
|
115
|
-
border-right: 1px solid var(--dsw-alias-border-l2, rgba(128, 128, 128, 0.15)) !important;
|
|
116
|
-
/* 关键守卫:官方会在侧边栏列上留下恒等 transform(matrix(1,0,0,1,0,0)),
|
|
117
|
-
任何 transform/filter 等都会把 position:fixed 后代的包含块「困」在本列内,
|
|
118
|
-
叠加官方 overflow:hidden 后,设置弹窗(内联渲染于侧边栏 DOM)会被裁剪成
|
|
119
|
-
抽屉宽度、表现为「弹窗出现在侧边栏里面」。显式清除全部包含块触发属性。 */
|
|
120
|
-
transform: none !important;
|
|
121
|
-
filter: none !important;
|
|
122
|
-
backdrop-filter: none !important;
|
|
123
|
-
perspective: none !important;
|
|
124
|
-
will-change: auto !important;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
/* 遮罩:抽屉外全屏黑纱必须压在抽屉(900)之下,否则抽屉内容会被黑纱罩住并
|
|
128
|
-
拦截全部点击。压到 899:低于抽屉、仍高于正文(≤100),「点抽屉外暗处
|
|
129
|
-
自动收回」的能力保留。
|
|
130
|
-
- 装了 web-ui 时:它生成 [data-dsh-frame]:not([data-sidebar-collapsed])::after
|
|
131
|
-
(z-index:1050),由下方 :has 锁定布局帧的 ::after 的 !important 统一压到 899。
|
|
132
|
-
- 未装 web-ui 时:官方无遮罩,由下方 :not([data-sidebar-collapsed]) 规则补齐。
|
|
133
|
-
遮罩必须挂在三栏布局帧上(:has([class*="_sidebarCol"])),否则 _frame 后缀
|
|
134
|
-
也会命中提问卡片等内层元素,把全屏黑纱盖到弹窗上面。 */
|
|
135
|
-
[class*="_frame"]:has([class*="_sidebarCol"])::after {
|
|
136
|
-
z-index: 899 !important;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
[class*="_frame"]:has([class*="_sidebarCol"]):not([data-sidebar-collapsed])::after {
|
|
140
|
-
content: "";
|
|
141
|
-
position: fixed;
|
|
142
|
-
inset: 0;
|
|
143
|
-
z-index: 899;
|
|
144
|
-
background: rgb(0 0 0 / 24%);
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
/* 兜底防御:当左侧栏实际处于折叠状态(内部含 _collapsed 类,如官方仅收起内部但 frame
|
|
148
|
-
未及时打上 data-sidebar-collapsed)时,严禁渲染遮罩,彻底杜绝黑纱常驻与点击拦截 */
|
|
149
|
-
[class*="_frame"]:has([class*="_sidebarCol"]:has([class*="_collapsed"]))::after,
|
|
150
|
-
[class*="_frame"][data-sidebar-collapsed]::after {
|
|
151
|
-
content: none !important;
|
|
152
|
-
display: none !important;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
/* 展开态自适应宽度:支持 360px 窄屏与大屏手机灵活伸缩,覆盖官方内联 280px */
|
|
156
|
-
[class*="_sidebarCol"]:not(:has([class*="_collapsed"])) {
|
|
157
|
-
width: min(85vw, 320px) !important;
|
|
158
|
-
max-width: 85vw !important;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
/* 条目触控热区友好化:行高 44px + 次级操作按钮 36px,防误触相邻会话并易于点击更多操作 */
|
|
162
|
-
[class*="_sidebarCol"] [role="treeitem"],
|
|
163
|
-
[class*="_sidebarCol"] [data-dsh-part="sidebar-entry"] {
|
|
164
|
-
min-height: 44px !important;
|
|
165
|
-
}
|
|
166
|
-
[class*="_sidebarCol"] [role="treeitem"] button,
|
|
167
|
-
[class*="_sidebarCol"] [role="treeitem"] [role="button"] {
|
|
168
|
-
min-width: 36px !important;
|
|
169
|
-
min-height: 36px !important;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
/* 触屏设备没有 hover:工作区/会话右侧操作按钮(更多操作 ⋯、新建会话 + 等)
|
|
173
|
-
在 PC 依赖鼠标悬停显现,移动端必须常显,保证触屏用户可随时直接交互 */
|
|
174
|
-
[class*="_sidebarCol"] [class*="_rowActions"] {
|
|
175
|
-
opacity: 1 !important;
|
|
176
|
-
visibility: visible !important;
|
|
177
|
-
display: flex !important;
|
|
178
|
-
align-items: center !important;
|
|
179
|
-
flex-shrink: 0 !important;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
/* 标题容器弹性自适应并防文字挤出视野,超长文本自然截断不破坏按钮布局 */
|
|
183
|
-
[class*="_sidebarCol"] [class*="_projectText"],
|
|
184
|
-
[class*="_sidebarCol"] [class*="_sessionText"] {
|
|
185
|
-
min-width: 0 !important;
|
|
186
|
-
flex: 1 1 auto !important;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
/* 内层根节点铺满抽屉:覆盖官方响应式脚本写入的内联 width,
|
|
190
|
-
消除「外层 ~320 / 内层内联 280」的宽度差与右缘空白条 */
|
|
191
|
-
[class*="_sidebarCol"] > [data-slot="sidebar"] > div {
|
|
192
|
-
width: 100% !important;
|
|
193
|
-
min-width: 0 !important;
|
|
194
|
-
max-width: none !important;
|
|
195
|
-
height: 100% !important;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
/* 3. 折叠状态:侧边栏收起为 0px 并隐藏整体阴影和多余按钮。
|
|
199
|
-
data-sidebar-collapsed 属性与 _collapsed class 均由官方 sidebar 插件写入,
|
|
200
|
-
两种环境(装/不装 web-ui)行为一致,这里用无值匹配 [data-sidebar-collapsed]
|
|
201
|
-
保证属性不带值也能命中。 */
|
|
202
|
-
[class*="_sidebarCol"]:has([class*="_collapsed"]),
|
|
203
|
-
[class*="_frame"][data-sidebar-collapsed] [class*="_sidebarCol"] {
|
|
204
|
-
width: 0px !important;
|
|
205
|
-
min-width: 0px !important;
|
|
206
|
-
border: none !important;
|
|
207
|
-
box-shadow: none !important;
|
|
208
|
-
background: transparent !important;
|
|
209
|
-
pointer-events: none !important;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
[class*="_sidebarCol"] [class*="_collapsed"] > :not([class*="_logoRow"]),
|
|
213
|
-
[class*="_frame"][data-sidebar-collapsed] [class*="_sidebarCol"] > div > div > :not([class*="_logoRow"]) {
|
|
214
|
-
display: none !important;
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
/* 折叠状态下,Logo 按钮悬浮在屏幕左上角作为展开把手(与 dsh-draggable-nav 拖拽脚本联动)
|
|
218
|
-
放大到 44px 触控尺寸,并避让刘海屏/灵动岛顶部安全区 */
|
|
219
|
-
[class*="_sidebarCol"] [class*="_collapsed"] [class*="_logoRow"],
|
|
220
|
-
[class*="_frame"][data-sidebar-collapsed] [class*="_sidebarCol"] [class*="_logoRow"] {
|
|
221
|
-
position: fixed !important;
|
|
222
|
-
top: max(12px, env(safe-area-inset-top)) !important;
|
|
223
|
-
left: 12px !important;
|
|
224
|
-
width: 44px !important;
|
|
225
|
-
height: 44px !important;
|
|
226
|
-
border-radius: 12px !important;
|
|
227
|
-
background: var(--dsw-alias-bg-layer-1, rgba(255, 255, 255, 0.95)) !important;
|
|
228
|
-
backdrop-filter: blur(12px) !important;
|
|
229
|
-
-webkit-backdrop-filter: blur(12px) !important;
|
|
230
|
-
border: 1px solid var(--dsw-alias-border-l2, rgba(128, 128, 128, 0.2)) !important;
|
|
231
|
-
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
|
|
232
|
-
display: flex !important;
|
|
233
|
-
align-items: center !important;
|
|
234
|
-
justify-content: center !important;
|
|
235
|
-
pointer-events: auto !important;
|
|
236
|
-
/* 与抽屉(900)同层体系:高于正文内容,低于官方弹窗(1000)/菜单(1100) */
|
|
237
|
-
z-index: 901 !important;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
/* 4. 触屏设备没有 hover:官方 Tooltip 气泡(黑底,如折叠把手的「收起侧边栏」)
|
|
241
|
-
显示依赖 mouseenter/focus,而消失只认 mouseleave/blur —— 触摸点击后这两个
|
|
242
|
-
事件永远不会到来,气泡会永久滞留在屏幕上。移动端 UA 下整体隐藏官方气泡
|
|
243
|
-
(按钮均保留 aria-label,可访问性不受影响);PC 窄窗口仍保留悬停提示。 */
|
|
244
|
-
html[data-dsh-mobile="1"] [role="tooltip"] {
|
|
245
|
-
display: none !important;
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
/* 5. 窄屏隐藏官方详情(details)列:官方会把未折叠的详情面板做成全屏浮层
|
|
249
|
-
盖在 conversation 顶部(web-ui 窄屏折叠态也是 display:none),这里直接隐藏,
|
|
250
|
-
彻底杜绝缩小窗口时详情面板与顶部 header 重叠。 */
|
|
251
|
-
[class*="_detailsCol"] {
|
|
252
|
-
display: none !important;
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
/* 6. 已装 web-ui 时,其移动端 conversation-header 为折叠 rail 预留 60px 左内边距;
|
|
256
|
-
本插件折叠为 0px + 悬浮把手,header 无需让位,覆盖为 8px。
|
|
257
|
-
用更高特异性((0,2,1) > web-ui 的 (0,2,0))保证无论加载顺序都压过 web-ui;
|
|
258
|
-
仅在与 web-ui 相同的 ≤768px 断点生效,避免干扰 769-900px 的官方 header。 */
|
|
259
|
-
@media (max-width: 768px) {
|
|
260
|
-
[class*="_frame"] header[data-dsh-responsive-part="conversation-header"] {
|
|
261
|
-
padding-left: 8px !important;
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
/* 7. 覆盖 web-ui 给 session-utilities 按钮强制的 min-height: 44px(min-width 保留)。
|
|
265
|
-
该规则特异性与 web-ui 同为 (0,3,0),故补一个重复属性选择器抬到 (0,4,0)
|
|
266
|
-
确保无论加载顺序都压过 web-ui;仅在同断点 ≤768px 生效。 */
|
|
267
|
-
[class*="_frame"] [data-dsh-responsive-part="session-utilities"][data-dsh-responsive-part] :is(button, [role="button"]) {
|
|
268
|
-
min-height: 0 !important;
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
/* 8. 兼容处理:隐藏生态插件中重复挂载的小鲸鱼悬浮按钮 (#dshRemoteWhale) 避免入口与手势冲突 */
|
|
273
|
-
#dshRemoteWhale,
|
|
274
|
-
button[id="dshRemoteWhale"],
|
|
275
|
-
[data-dsh-plugin="remote-web-ui"] {
|
|
276
|
-
display: none !important;
|
|
277
|
-
pointer-events: none !important;
|
|
278
|
-
visibility: hidden !important;
|
|
279
|
-
}
|
|
33
|
+
const PRESET_SIDEBAR_CSS = `
|
|
34
|
+
/* ===== dsh-remote-mobile · 侧边栏抽屉导航与整体布局 ===== */
|
|
35
|
+
/* 注:窄屏媒体查询由注入层按端包裹(移动端包 @media (max-width:900px),PC 端原样生效) */
|
|
36
|
+
/* 0. 禁用浏览器原生橡皮筋下拉刷新与链式溢出滚动,彻底杜绝上下滑动误刷新页面 */
|
|
37
|
+
html,
|
|
38
|
+
body,
|
|
39
|
+
[class*="_frame"],
|
|
40
|
+
[role="dialog"],
|
|
41
|
+
[class*="_dialog"],
|
|
42
|
+
[class*="_modalContent"],
|
|
43
|
+
[class*="_overlay"],
|
|
44
|
+
[class*="_conversationArea"],
|
|
45
|
+
[class*="_centerCol"] {
|
|
46
|
+
overscroll-behavior-y: contain !important;
|
|
47
|
+
overscroll-behavior-x: none !important;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* 1. 最外层三栏布局:在移动端主工作区占满 100% 全宽,消除侧边栏强制占位。
|
|
51
|
+
选择器全部基于官方 CSS Modules 稳定后缀(_frame/_sidebarCol/_centerCol,
|
|
52
|
+
前缀 hash 随机、后缀稳定),不依赖 @linxin666/dsh-web-ui-all 注入的
|
|
53
|
+
data-pane / data-dsh-frame 属性,安装与否均生效。
|
|
54
|
+
注意:_frame 后缀同样命中「提问卡片」(Mbwy4a_frame 等非三栏布局元素),
|
|
55
|
+
故用 :has([class*="_sidebarCol"]) 把规则精确锁定到真正承载三栏布局的
|
|
56
|
+
外层 frame,避免提问弹窗被强制 100vw 撑满、被遮罩盖住。 */
|
|
57
|
+
[class*="_frame"]:has([class*="_sidebarCol"]) {
|
|
58
|
+
grid-template-columns: 0px minmax(0px, 1fr) 0px !important;
|
|
59
|
+
width: 100vw !important;
|
|
60
|
+
max-width: 100vw !important;
|
|
61
|
+
overflow-x: hidden !important;
|
|
62
|
+
position: relative !important;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/* 核心修复:显式将三列锁定到各自的 Grid 轨道!
|
|
66
|
+
官方 AppFrame 为三栏 CSS Grid 布局(sidebarCol + centerCol + rightbarCol)。
|
|
67
|
+
当 sidebarCol 设为 position: fixed 后脱离 Grid 自动流,会导致后续两列前移:
|
|
68
|
+
centerCol 移入第 1 列(0px),rightbarCol 移入第 2 列(1fr 全宽) 并全屏覆盖在
|
|
69
|
+
对话区上方,其透明容器拦截全部点击与触摸手势(Issue #6)。
|
|
70
|
+
通过显式指定 grid-column,确保每列始终位于设计轨道,杜绝错位覆盖。 */
|
|
71
|
+
[class*="_frame"]:has([class*="_sidebarCol"]) > [class*="_sidebarCol"] {
|
|
72
|
+
grid-column: 1 !important;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
[class*="_frame"]:has([class*="_sidebarCol"]) [class*="_centerCol"],
|
|
76
|
+
[class*="_frame"]:has([class*="_sidebarCol"]) > [class*="_centerCol"] {
|
|
77
|
+
grid-column: 2 !important;
|
|
78
|
+
width: 100vw !important;
|
|
79
|
+
max-width: 100vw !important;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
[class*="_frame"]:has([class*="_sidebarCol"]) > [class*="_rightbarCol"] {
|
|
83
|
+
grid-column: 3 !important;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/* 右侧栏折叠态穿透防御:折叠时宽度清零并禁用指针事件,杜绝透明层与边缘手柄拦截触摸 */
|
|
87
|
+
[class*="_frame"][data-rightbar-collapsed] [class*="_rightbarCol"],
|
|
88
|
+
[class*="_rightbarCol"]:not(:has([data-sidebar-right-open])) {
|
|
89
|
+
width: 0px !important;
|
|
90
|
+
min-width: 0px !important;
|
|
91
|
+
pointer-events: none !important;
|
|
92
|
+
}
|
|
93
|
+
[class*="_rightbarCol"]:has([data-sidebar-right-open]),
|
|
94
|
+
[class*="_frame"]:not([data-rightbar-collapsed]) [class*="_rightbarCol"] {
|
|
95
|
+
pointer-events: auto !important;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/* 2. 侧边栏最外层容器:作为整体抽屉浮层(阴影仅加在最外层,严禁污染内部列表) */
|
|
99
|
+
[class*="_sidebarCol"] {
|
|
100
|
+
position: fixed !important;
|
|
101
|
+
top: 0 !important;
|
|
102
|
+
bottom: 0 !important;
|
|
103
|
+
left: 0 !important;
|
|
104
|
+
height: 100vh !important;
|
|
105
|
+
height: 100dvh !important;
|
|
106
|
+
/* 层级守卫:抽屉必须低于官方弹层体系(模态弹窗 z=1000、下拉/弹出菜单 z=1100),
|
|
107
|
+
否则设置面板的操作菜单(portal 到 body)会被抽屉盖住无法交互。
|
|
108
|
+
官方内容区元素均在 100 层级以下,900 足以保证抽屉覆盖正文。
|
|
109
|
+
展开态宽度:装了 web-ui 时由它接管(min(88vw,320px));未装时沿用官方
|
|
110
|
+
内联 width(280px 左右),宽度差由下方内层铺满规则消除。 */
|
|
111
|
+
min-width: 0 !important;
|
|
112
|
+
z-index: 900 !important;
|
|
113
|
+
background: var(--dsw-alias-bg-layer-1, #ffffff) !important;
|
|
114
|
+
box-shadow: 6px 0 30px rgba(0, 0, 0, 0.25) !important;
|
|
115
|
+
border-right: 1px solid var(--dsw-alias-border-l2, rgba(128, 128, 128, 0.15)) !important;
|
|
116
|
+
/* 关键守卫:官方会在侧边栏列上留下恒等 transform(matrix(1,0,0,1,0,0)),
|
|
117
|
+
任何 transform/filter 等都会把 position:fixed 后代的包含块「困」在本列内,
|
|
118
|
+
叠加官方 overflow:hidden 后,设置弹窗(内联渲染于侧边栏 DOM)会被裁剪成
|
|
119
|
+
抽屉宽度、表现为「弹窗出现在侧边栏里面」。显式清除全部包含块触发属性。 */
|
|
120
|
+
transform: none !important;
|
|
121
|
+
filter: none !important;
|
|
122
|
+
backdrop-filter: none !important;
|
|
123
|
+
perspective: none !important;
|
|
124
|
+
will-change: auto !important;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/* 遮罩:抽屉外全屏黑纱必须压在抽屉(900)之下,否则抽屉内容会被黑纱罩住并
|
|
128
|
+
拦截全部点击。压到 899:低于抽屉、仍高于正文(≤100),「点抽屉外暗处
|
|
129
|
+
自动收回」的能力保留。
|
|
130
|
+
- 装了 web-ui 时:它生成 [data-dsh-frame]:not([data-sidebar-collapsed])::after
|
|
131
|
+
(z-index:1050),由下方 :has 锁定布局帧的 ::after 的 !important 统一压到 899。
|
|
132
|
+
- 未装 web-ui 时:官方无遮罩,由下方 :not([data-sidebar-collapsed]) 规则补齐。
|
|
133
|
+
遮罩必须挂在三栏布局帧上(:has([class*="_sidebarCol"])),否则 _frame 后缀
|
|
134
|
+
也会命中提问卡片等内层元素,把全屏黑纱盖到弹窗上面。 */
|
|
135
|
+
[class*="_frame"]:has([class*="_sidebarCol"])::after {
|
|
136
|
+
z-index: 899 !important;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
[class*="_frame"]:has([class*="_sidebarCol"]):not([data-sidebar-collapsed])::after {
|
|
140
|
+
content: "";
|
|
141
|
+
position: fixed;
|
|
142
|
+
inset: 0;
|
|
143
|
+
z-index: 899;
|
|
144
|
+
background: rgb(0 0 0 / 24%);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/* 兜底防御:当左侧栏实际处于折叠状态(内部含 _collapsed 类,如官方仅收起内部但 frame
|
|
148
|
+
未及时打上 data-sidebar-collapsed)时,严禁渲染遮罩,彻底杜绝黑纱常驻与点击拦截 */
|
|
149
|
+
[class*="_frame"]:has([class*="_sidebarCol"]:has([class*="_collapsed"]))::after,
|
|
150
|
+
[class*="_frame"][data-sidebar-collapsed]::after {
|
|
151
|
+
content: none !important;
|
|
152
|
+
display: none !important;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/* 展开态自适应宽度:支持 360px 窄屏与大屏手机灵活伸缩,覆盖官方内联 280px */
|
|
156
|
+
[class*="_sidebarCol"]:not(:has([class*="_collapsed"])) {
|
|
157
|
+
width: min(85vw, 320px) !important;
|
|
158
|
+
max-width: 85vw !important;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/* 条目触控热区友好化:行高 44px + 次级操作按钮 36px,防误触相邻会话并易于点击更多操作 */
|
|
162
|
+
[class*="_sidebarCol"] [role="treeitem"],
|
|
163
|
+
[class*="_sidebarCol"] [data-dsh-part="sidebar-entry"] {
|
|
164
|
+
min-height: 44px !important;
|
|
165
|
+
}
|
|
166
|
+
[class*="_sidebarCol"] [role="treeitem"] button,
|
|
167
|
+
[class*="_sidebarCol"] [role="treeitem"] [role="button"] {
|
|
168
|
+
min-width: 36px !important;
|
|
169
|
+
min-height: 36px !important;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/* 触屏设备没有 hover:工作区/会话右侧操作按钮(更多操作 ⋯、新建会话 + 等)
|
|
173
|
+
在 PC 依赖鼠标悬停显现,移动端必须常显,保证触屏用户可随时直接交互 */
|
|
174
|
+
[class*="_sidebarCol"] [class*="_rowActions"] {
|
|
175
|
+
opacity: 1 !important;
|
|
176
|
+
visibility: visible !important;
|
|
177
|
+
display: flex !important;
|
|
178
|
+
align-items: center !important;
|
|
179
|
+
flex-shrink: 0 !important;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/* 标题容器弹性自适应并防文字挤出视野,超长文本自然截断不破坏按钮布局 */
|
|
183
|
+
[class*="_sidebarCol"] [class*="_projectText"],
|
|
184
|
+
[class*="_sidebarCol"] [class*="_sessionText"] {
|
|
185
|
+
min-width: 0 !important;
|
|
186
|
+
flex: 1 1 auto !important;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/* 内层根节点铺满抽屉:覆盖官方响应式脚本写入的内联 width,
|
|
190
|
+
消除「外层 ~320 / 内层内联 280」的宽度差与右缘空白条 */
|
|
191
|
+
[class*="_sidebarCol"] > [data-slot="sidebar"] > div {
|
|
192
|
+
width: 100% !important;
|
|
193
|
+
min-width: 0 !important;
|
|
194
|
+
max-width: none !important;
|
|
195
|
+
height: 100% !important;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/* 3. 折叠状态:侧边栏收起为 0px 并隐藏整体阴影和多余按钮。
|
|
199
|
+
data-sidebar-collapsed 属性与 _collapsed class 均由官方 sidebar 插件写入,
|
|
200
|
+
两种环境(装/不装 web-ui)行为一致,这里用无值匹配 [data-sidebar-collapsed]
|
|
201
|
+
保证属性不带值也能命中。 */
|
|
202
|
+
[class*="_sidebarCol"]:has([class*="_collapsed"]),
|
|
203
|
+
[class*="_frame"][data-sidebar-collapsed] [class*="_sidebarCol"] {
|
|
204
|
+
width: 0px !important;
|
|
205
|
+
min-width: 0px !important;
|
|
206
|
+
border: none !important;
|
|
207
|
+
box-shadow: none !important;
|
|
208
|
+
background: transparent !important;
|
|
209
|
+
pointer-events: none !important;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
[class*="_sidebarCol"] [class*="_collapsed"] > :not([class*="_logoRow"]),
|
|
213
|
+
[class*="_frame"][data-sidebar-collapsed] [class*="_sidebarCol"] > div > div > :not([class*="_logoRow"]) {
|
|
214
|
+
display: none !important;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/* 折叠状态下,Logo 按钮悬浮在屏幕左上角作为展开把手(与 dsh-draggable-nav 拖拽脚本联动)
|
|
218
|
+
放大到 44px 触控尺寸,并避让刘海屏/灵动岛顶部安全区 */
|
|
219
|
+
[class*="_sidebarCol"] [class*="_collapsed"] [class*="_logoRow"],
|
|
220
|
+
[class*="_frame"][data-sidebar-collapsed] [class*="_sidebarCol"] [class*="_logoRow"] {
|
|
221
|
+
position: fixed !important;
|
|
222
|
+
top: max(12px, env(safe-area-inset-top)) !important;
|
|
223
|
+
left: 12px !important;
|
|
224
|
+
width: 44px !important;
|
|
225
|
+
height: 44px !important;
|
|
226
|
+
border-radius: 12px !important;
|
|
227
|
+
background: var(--dsw-alias-bg-layer-1, rgba(255, 255, 255, 0.95)) !important;
|
|
228
|
+
backdrop-filter: blur(12px) !important;
|
|
229
|
+
-webkit-backdrop-filter: blur(12px) !important;
|
|
230
|
+
border: 1px solid var(--dsw-alias-border-l2, rgba(128, 128, 128, 0.2)) !important;
|
|
231
|
+
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
|
|
232
|
+
display: flex !important;
|
|
233
|
+
align-items: center !important;
|
|
234
|
+
justify-content: center !important;
|
|
235
|
+
pointer-events: auto !important;
|
|
236
|
+
/* 与抽屉(900)同层体系:高于正文内容,低于官方弹窗(1000)/菜单(1100) */
|
|
237
|
+
z-index: 901 !important;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/* 4. 触屏设备没有 hover:官方 Tooltip 气泡(黑底,如折叠把手的「收起侧边栏」)
|
|
241
|
+
显示依赖 mouseenter/focus,而消失只认 mouseleave/blur —— 触摸点击后这两个
|
|
242
|
+
事件永远不会到来,气泡会永久滞留在屏幕上。移动端 UA 下整体隐藏官方气泡
|
|
243
|
+
(按钮均保留 aria-label,可访问性不受影响);PC 窄窗口仍保留悬停提示。 */
|
|
244
|
+
html[data-dsh-mobile="1"] [role="tooltip"] {
|
|
245
|
+
display: none !important;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/* 5. 窄屏隐藏官方详情(details)列:官方会把未折叠的详情面板做成全屏浮层
|
|
249
|
+
盖在 conversation 顶部(web-ui 窄屏折叠态也是 display:none),这里直接隐藏,
|
|
250
|
+
彻底杜绝缩小窗口时详情面板与顶部 header 重叠。 */
|
|
251
|
+
[class*="_detailsCol"] {
|
|
252
|
+
display: none !important;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/* 6. 已装 web-ui 时,其移动端 conversation-header 为折叠 rail 预留 60px 左内边距;
|
|
256
|
+
本插件折叠为 0px + 悬浮把手,header 无需让位,覆盖为 8px。
|
|
257
|
+
用更高特异性((0,2,1) > web-ui 的 (0,2,0))保证无论加载顺序都压过 web-ui;
|
|
258
|
+
仅在与 web-ui 相同的 ≤768px 断点生效,避免干扰 769-900px 的官方 header。 */
|
|
259
|
+
@media (max-width: 768px) {
|
|
260
|
+
[class*="_frame"] header[data-dsh-responsive-part="conversation-header"] {
|
|
261
|
+
padding-left: 8px !important;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/* 7. 覆盖 web-ui 给 session-utilities 按钮强制的 min-height: 44px(min-width 保留)。
|
|
265
|
+
该规则特异性与 web-ui 同为 (0,3,0),故补一个重复属性选择器抬到 (0,4,0)
|
|
266
|
+
确保无论加载顺序都压过 web-ui;仅在同断点 ≤768px 生效。 */
|
|
267
|
+
[class*="_frame"] [data-dsh-responsive-part="session-utilities"][data-dsh-responsive-part] :is(button, [role="button"]) {
|
|
268
|
+
min-height: 0 !important;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/* 8. 兼容处理:隐藏生态插件中重复挂载的小鲸鱼悬浮按钮 (#dshRemoteWhale) 避免入口与手势冲突 */
|
|
273
|
+
#dshRemoteWhale,
|
|
274
|
+
button[id="dshRemoteWhale"],
|
|
275
|
+
[data-dsh-plugin="remote-web-ui"] {
|
|
276
|
+
display: none !important;
|
|
277
|
+
pointer-events: none !important;
|
|
278
|
+
visibility: hidden !important;
|
|
279
|
+
}
|
|
280
280
|
`;
|
|
281
281
|
/** 设置面板预设:官方设置弹窗上下堆叠 + 顶部导航横滑 + 内容纵向自然滚览 */
|
|
282
|
-
const PRESET_SETTINGS_CSS = `
|
|
283
|
-
/* ===== dsh-remote-mobile · 设置面板适配 ===== */
|
|
284
|
-
/* 注:窄屏媒体查询由注入层按端包裹 */
|
|
285
|
-
/* 遮罩彻底锁死防漏底,弹窗整体居中 */
|
|
286
|
-
[data-slot*="overlay"]:has([role="dialog"]),
|
|
287
|
-
[class*="_overlay"]:has([role="dialog"]),
|
|
288
|
-
[class*="_modalWrapper"]:has([role="dialog"]) {
|
|
289
|
-
position: fixed !important;
|
|
290
|
-
inset: 0 !important;
|
|
291
|
-
display: flex !important;
|
|
292
|
-
align-items: center !important;
|
|
293
|
-
justify-content: center !important;
|
|
294
|
-
overflow: hidden !important;
|
|
295
|
-
z-index: 100005 !important;
|
|
296
|
-
background: rgba(0, 0, 0, 0.5) !important;
|
|
297
|
-
overscroll-behavior: contain !important;
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
/* 弹窗卡片:仅命中设置弹窗——外层 overlay 容器内含 role=dialog(设置弹窗由
|
|
301
|
-
data-slot overlay / overlay 类包裹)。内测声明等通用 Modal 直接挂在 body、
|
|
302
|
-
无 data-slot overlay,天然排除。卡片设为纵向滚动,取消横向滑动。 */
|
|
303
|
-
[data-slot*="overlay"]:has([role="dialog"]) [role="dialog"],
|
|
304
|
-
[data-slot*="overlay"]:has([role="dialog"]) [class*="_dialog"],
|
|
305
|
-
[data-slot*="overlay"]:has([role="dialog"]) [class*="_modalContent"],
|
|
306
|
-
[class*="_overlay"]:has([role="dialog"]) [role="dialog"],
|
|
307
|
-
[class*="_overlay"]:has([role="dialog"]) [class*="_dialog"],
|
|
308
|
-
[class*="_overlay"]:has([role="dialog"]) [class*="_modalContent"],
|
|
309
|
-
[class*="_modalWrapper"]:has([role="dialog"]) [role="dialog"],
|
|
310
|
-
[class*="_modalWrapper"]:has([role="dialog"]) [class*="_dialog"],
|
|
311
|
-
[class*="_modalWrapper"]:has([role="dialog"]) [class*="_modalContent"],
|
|
312
|
-
[class*="_settingsModal"] {
|
|
313
|
-
position: relative !important;
|
|
314
|
-
width: 96vw !important;
|
|
315
|
-
max-width: 96vw !important;
|
|
316
|
-
height: 86dvh !important;
|
|
317
|
-
max-height: 86dvh !important;
|
|
318
|
-
margin: auto !important;
|
|
319
|
-
box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4) !important;
|
|
320
|
-
border-radius: 14px !important;
|
|
321
|
-
background: var(--dsw-alias-bg-layer-1, #ffffff) !important;
|
|
322
|
-
overflow-x: hidden !important;
|
|
323
|
-
overflow-y: auto !important;
|
|
324
|
-
-webkit-overflow-scrolling: touch !important;
|
|
325
|
-
overscroll-behavior: contain !important;
|
|
326
|
-
font-size: 14px !important;
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
/* 取消 zoom 微缩,恢复正常比例 */
|
|
330
|
-
[data-slot*="overlay"]:has([role="dialog"]) [role="dialog"] > *,
|
|
331
|
-
[data-slot*="overlay"]:has([role="dialog"]) [class*="_dialog"] > *,
|
|
332
|
-
[data-slot*="overlay"]:has([role="dialog"]) [class*="_modalContent"] > *,
|
|
333
|
-
[class*="_overlay"]:has([role="dialog"]) [role="dialog"] > *,
|
|
334
|
-
[class*="_overlay"]:has([role="dialog"]) [class*="_dialog"] > *,
|
|
335
|
-
[class*="_overlay"]:has([role="dialog"]) [class*="_modalContent"] > *,
|
|
336
|
-
[class*="_modalWrapper"]:has([role="dialog"]) [role="dialog"] > *,
|
|
337
|
-
[class*="_modalWrapper"]:has([role="dialog"]) [class*="_dialog"] > *,
|
|
338
|
-
[class*="_modalWrapper"]:has([role="dialog"]) [class*="_modalContent"] > *,
|
|
339
|
-
[class*="_settingsModal"] > * {
|
|
340
|
-
zoom: 1 !important;
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
/* 取消 530px 定宽:主体内容 div 铺满宽度,高度自然自适应 */
|
|
344
|
-
[data-slot*="overlay"]:has([role="dialog"]) [role="dialog"] > div,
|
|
345
|
-
[data-slot*="overlay"]:has([role="dialog"]) [class*="_dialog"] > div,
|
|
346
|
-
[data-slot*="overlay"]:has([role="dialog"]) [class*="_modalContent"] > div,
|
|
347
|
-
[class*="_overlay"]:has([role="dialog"]) [role="dialog"] > div,
|
|
348
|
-
[class*="_overlay"]:has([role="dialog"]) [class*="_dialog"] > div,
|
|
349
|
-
[class*="_overlay"]:has([role="dialog"]) [class*="_modalContent"] > div,
|
|
350
|
-
[class*="_modalWrapper"]:has([role="dialog"]) [role="dialog"] > div,
|
|
351
|
-
[class*="_modalWrapper"]:has([role="dialog"]) [class*="_dialog"] > div,
|
|
352
|
-
[class*="_modalWrapper"]:has([role="dialog"]) [class*="_modalContent"] > div,
|
|
353
|
-
[class*="_settingsModal"] > div {
|
|
354
|
-
min-width: 0 !important;
|
|
355
|
-
width: 100% !important;
|
|
356
|
-
height: auto !important;
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
/* 上下堆叠:只命中带 nav 的设置类弹窗,通用 Modal 不受影响 */
|
|
360
|
-
[role="dialog"]:has(nav) {
|
|
361
|
-
flex-direction: column !important;
|
|
362
|
-
}
|
|
363
|
-
[role="dialog"]:has(nav) > nav {
|
|
364
|
-
width: 100% !important;
|
|
365
|
-
flex: none !important;
|
|
366
|
-
}
|
|
367
|
-
[role="dialog"] [class*="_navTitle"] {
|
|
368
|
-
display: none !important;
|
|
369
|
-
}
|
|
370
|
-
[role="dialog"] [class*="_navList"] {
|
|
371
|
-
display: flex !important;
|
|
372
|
-
flex-direction: row !important;
|
|
373
|
-
overflow-x: auto !important;
|
|
374
|
-
overflow-y: hidden !important;
|
|
375
|
-
gap: 4px !important;
|
|
376
|
-
padding: 4px 2px !important;
|
|
377
|
-
-webkit-overflow-scrolling: touch !important;
|
|
378
|
-
}
|
|
379
|
-
[role="dialog"] [class*="_navList"] > * {
|
|
380
|
-
flex: none !important;
|
|
381
|
-
white-space: nowrap !important;
|
|
382
|
-
}
|
|
383
|
-
/* 移动端收紧官方内容区的厚 padding(原 24px/32px),释放横向显示空间 */
|
|
384
|
-
[role="dialog"] [class*="_content"] {
|
|
385
|
-
width: 100% !important;
|
|
386
|
-
min-width: 0 !important;
|
|
387
|
-
flex: 1 1 auto !important;
|
|
388
|
-
padding: 10px 4px !important;
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
/* 重置插件市场等弹窗在窄屏隐藏左侧 nav 的行为:保持导航列表可见。
|
|
392
|
-
该插件规则(@media max-width:560px 隐藏)无 !important,
|
|
393
|
-
我们同选择器加 !important 即可稳压。 */
|
|
394
|
-
@media (max-width: 560px) {
|
|
395
|
-
[role="dialog"]:has([data-dsh-market-root]) > nav {
|
|
396
|
-
display: block !important;
|
|
397
|
-
}
|
|
398
|
-
}
|
|
282
|
+
const PRESET_SETTINGS_CSS = `
|
|
283
|
+
/* ===== dsh-remote-mobile · 设置面板适配 ===== */
|
|
284
|
+
/* 注:窄屏媒体查询由注入层按端包裹 */
|
|
285
|
+
/* 遮罩彻底锁死防漏底,弹窗整体居中 */
|
|
286
|
+
[data-slot*="overlay"]:has([role="dialog"]),
|
|
287
|
+
[class*="_overlay"]:has([role="dialog"]),
|
|
288
|
+
[class*="_modalWrapper"]:has([role="dialog"]) {
|
|
289
|
+
position: fixed !important;
|
|
290
|
+
inset: 0 !important;
|
|
291
|
+
display: flex !important;
|
|
292
|
+
align-items: center !important;
|
|
293
|
+
justify-content: center !important;
|
|
294
|
+
overflow: hidden !important;
|
|
295
|
+
z-index: 100005 !important;
|
|
296
|
+
background: rgba(0, 0, 0, 0.5) !important;
|
|
297
|
+
overscroll-behavior: contain !important;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
/* 弹窗卡片:仅命中设置弹窗——外层 overlay 容器内含 role=dialog(设置弹窗由
|
|
301
|
+
data-slot overlay / overlay 类包裹)。内测声明等通用 Modal 直接挂在 body、
|
|
302
|
+
无 data-slot overlay,天然排除。卡片设为纵向滚动,取消横向滑动。 */
|
|
303
|
+
[data-slot*="overlay"]:has([role="dialog"]) [role="dialog"],
|
|
304
|
+
[data-slot*="overlay"]:has([role="dialog"]) [class*="_dialog"],
|
|
305
|
+
[data-slot*="overlay"]:has([role="dialog"]) [class*="_modalContent"],
|
|
306
|
+
[class*="_overlay"]:has([role="dialog"]) [role="dialog"],
|
|
307
|
+
[class*="_overlay"]:has([role="dialog"]) [class*="_dialog"],
|
|
308
|
+
[class*="_overlay"]:has([role="dialog"]) [class*="_modalContent"],
|
|
309
|
+
[class*="_modalWrapper"]:has([role="dialog"]) [role="dialog"],
|
|
310
|
+
[class*="_modalWrapper"]:has([role="dialog"]) [class*="_dialog"],
|
|
311
|
+
[class*="_modalWrapper"]:has([role="dialog"]) [class*="_modalContent"],
|
|
312
|
+
[class*="_settingsModal"] {
|
|
313
|
+
position: relative !important;
|
|
314
|
+
width: 96vw !important;
|
|
315
|
+
max-width: 96vw !important;
|
|
316
|
+
height: 86dvh !important;
|
|
317
|
+
max-height: 86dvh !important;
|
|
318
|
+
margin: auto !important;
|
|
319
|
+
box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4) !important;
|
|
320
|
+
border-radius: 14px !important;
|
|
321
|
+
background: var(--dsw-alias-bg-layer-1, #ffffff) !important;
|
|
322
|
+
overflow-x: hidden !important;
|
|
323
|
+
overflow-y: auto !important;
|
|
324
|
+
-webkit-overflow-scrolling: touch !important;
|
|
325
|
+
overscroll-behavior: contain !important;
|
|
326
|
+
font-size: 14px !important;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
/* 取消 zoom 微缩,恢复正常比例 */
|
|
330
|
+
[data-slot*="overlay"]:has([role="dialog"]) [role="dialog"] > *,
|
|
331
|
+
[data-slot*="overlay"]:has([role="dialog"]) [class*="_dialog"] > *,
|
|
332
|
+
[data-slot*="overlay"]:has([role="dialog"]) [class*="_modalContent"] > *,
|
|
333
|
+
[class*="_overlay"]:has([role="dialog"]) [role="dialog"] > *,
|
|
334
|
+
[class*="_overlay"]:has([role="dialog"]) [class*="_dialog"] > *,
|
|
335
|
+
[class*="_overlay"]:has([role="dialog"]) [class*="_modalContent"] > *,
|
|
336
|
+
[class*="_modalWrapper"]:has([role="dialog"]) [role="dialog"] > *,
|
|
337
|
+
[class*="_modalWrapper"]:has([role="dialog"]) [class*="_dialog"] > *,
|
|
338
|
+
[class*="_modalWrapper"]:has([role="dialog"]) [class*="_modalContent"] > *,
|
|
339
|
+
[class*="_settingsModal"] > * {
|
|
340
|
+
zoom: 1 !important;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
/* 取消 530px 定宽:主体内容 div 铺满宽度,高度自然自适应 */
|
|
344
|
+
[data-slot*="overlay"]:has([role="dialog"]) [role="dialog"] > div,
|
|
345
|
+
[data-slot*="overlay"]:has([role="dialog"]) [class*="_dialog"] > div,
|
|
346
|
+
[data-slot*="overlay"]:has([role="dialog"]) [class*="_modalContent"] > div,
|
|
347
|
+
[class*="_overlay"]:has([role="dialog"]) [role="dialog"] > div,
|
|
348
|
+
[class*="_overlay"]:has([role="dialog"]) [class*="_dialog"] > div,
|
|
349
|
+
[class*="_overlay"]:has([role="dialog"]) [class*="_modalContent"] > div,
|
|
350
|
+
[class*="_modalWrapper"]:has([role="dialog"]) [role="dialog"] > div,
|
|
351
|
+
[class*="_modalWrapper"]:has([role="dialog"]) [class*="_dialog"] > div,
|
|
352
|
+
[class*="_modalWrapper"]:has([role="dialog"]) [class*="_modalContent"] > div,
|
|
353
|
+
[class*="_settingsModal"] > div {
|
|
354
|
+
min-width: 0 !important;
|
|
355
|
+
width: 100% !important;
|
|
356
|
+
height: auto !important;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
/* 上下堆叠:只命中带 nav 的设置类弹窗,通用 Modal 不受影响 */
|
|
360
|
+
[role="dialog"]:has(nav) {
|
|
361
|
+
flex-direction: column !important;
|
|
362
|
+
}
|
|
363
|
+
[role="dialog"]:has(nav) > nav {
|
|
364
|
+
width: 100% !important;
|
|
365
|
+
flex: none !important;
|
|
366
|
+
}
|
|
367
|
+
[role="dialog"] [class*="_navTitle"] {
|
|
368
|
+
display: none !important;
|
|
369
|
+
}
|
|
370
|
+
[role="dialog"] [class*="_navList"] {
|
|
371
|
+
display: flex !important;
|
|
372
|
+
flex-direction: row !important;
|
|
373
|
+
overflow-x: auto !important;
|
|
374
|
+
overflow-y: hidden !important;
|
|
375
|
+
gap: 4px !important;
|
|
376
|
+
padding: 4px 2px !important;
|
|
377
|
+
-webkit-overflow-scrolling: touch !important;
|
|
378
|
+
}
|
|
379
|
+
[role="dialog"] [class*="_navList"] > * {
|
|
380
|
+
flex: none !important;
|
|
381
|
+
white-space: nowrap !important;
|
|
382
|
+
}
|
|
383
|
+
/* 移动端收紧官方内容区的厚 padding(原 24px/32px),释放横向显示空间 */
|
|
384
|
+
[role="dialog"] [class*="_content"] {
|
|
385
|
+
width: 100% !important;
|
|
386
|
+
min-width: 0 !important;
|
|
387
|
+
flex: 1 1 auto !important;
|
|
388
|
+
padding: 10px 4px !important;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
/* 重置插件市场等弹窗在窄屏隐藏左侧 nav 的行为:保持导航列表可见。
|
|
392
|
+
该插件规则(@media max-width:560px 隐藏)无 !important,
|
|
393
|
+
我们同选择器加 !important 即可稳压。 */
|
|
394
|
+
@media (max-width: 560px) {
|
|
395
|
+
[role="dialog"]:has([data-dsh-market-root]) > nav {
|
|
396
|
+
display: block !important;
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
399
|
`;
|
|
400
400
|
/** 正文预设:对话区紧凑高密度排版(小字号/紧凑行距/等宽代码/防溢出) */
|
|
401
|
-
const PRESET_MAIN_CSS = `
|
|
402
|
-
/* ===== dsh-remote-mobile · 对话正文高密度排版 ===== */
|
|
403
|
-
/* 注:窄屏媒体查询由注入层按端包裹 */
|
|
404
|
-
/* 目标:小字号 + 紧凑行距 + 收紧边距,让每行展示更多内容。
|
|
405
|
-
不做布局缩放(zoom 会挤压 1fr 网格轨道、产生右侧空白并使页面破版);
|
|
406
|
-
字号规则主要基于稳定 HTML 元素(p/h1/li/pre/code 不随 hash 变化),
|
|
407
|
-
内容容器用 CSS Modules localName 后缀(只有前缀 hash 随机,后缀稳定)。 */
|
|
408
|
-
|
|
409
|
-
/* 1. 消息内容容器:紧凑字号与行距 */
|
|
410
|
-
[class*="_centerCol"],
|
|
411
|
-
[data-slot^="conversation.chat"],
|
|
412
|
-
[class*="_markdown"],
|
|
413
|
-
[class*="_message"],
|
|
414
|
-
[class*="_bubble"],
|
|
415
|
-
[class*="_text"] {
|
|
416
|
-
font-size: 12.5px !important;
|
|
417
|
-
line-height: 1.45 !important;
|
|
418
|
-
letter-spacing: -0.01em !important;
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
/* 2. HTML 元素级(稳定):段落与标题层级 */
|
|
422
|
-
[class*="_centerCol"] p,
|
|
423
|
-
[data-slot^="conversation.chat"] p,
|
|
424
|
-
[class*="_markdown"] p,
|
|
425
|
-
[class*="_message"] p,
|
|
426
|
-
[class*="_bubble"] p {
|
|
427
|
-
font-size: 12.5px !important;
|
|
428
|
-
line-height: 1.45 !important;
|
|
429
|
-
margin: 0 0 0.4em 0 !important;
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
[class*="_centerCol"] h1,
|
|
433
|
-
[class*="_centerCol"] h2,
|
|
434
|
-
[class*="_centerCol"] h3,
|
|
435
|
-
[class*="_centerCol"] h4,
|
|
436
|
-
[data-slot^="conversation.chat"] h1,
|
|
437
|
-
[data-slot^="conversation.chat"] h2,
|
|
438
|
-
[data-slot^="conversation.chat"] h3,
|
|
439
|
-
[class*="_markdown"] h1,
|
|
440
|
-
[class*="_markdown"] h2,
|
|
441
|
-
[class*="_markdown"] h3 {
|
|
442
|
-
font-size: 13.5px !important;
|
|
443
|
-
font-weight: 700 !important;
|
|
444
|
-
margin: 0.5em 0 0.25em 0 !important;
|
|
445
|
-
line-height: 1.3 !important;
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
[class*="_centerCol"] ul,
|
|
449
|
-
[class*="_centerCol"] ol,
|
|
450
|
-
[class*="_markdown"] ul,
|
|
451
|
-
[class*="_markdown"] ol {
|
|
452
|
-
margin: 0.2em 0 0.4em 0 !important;
|
|
453
|
-
padding-left: 1.2em !important;
|
|
454
|
-
}
|
|
455
|
-
[class*="_centerCol"] li,
|
|
456
|
-
[class*="_markdown"] li {
|
|
457
|
-
font-size: 12.5px !important;
|
|
458
|
-
line-height: 1.45 !important;
|
|
459
|
-
margin-bottom: 0.15em !important;
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
/* 3. 行内代码与代码块:小等宽 + 防横向溢出 */
|
|
463
|
-
[class*="_centerCol"] code,
|
|
464
|
-
[data-slot^="conversation.chat"] code,
|
|
465
|
-
[class*="_markdown"] code {
|
|
466
|
-
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
|
|
467
|
-
font-size: 11.5px !important;
|
|
468
|
-
}
|
|
469
|
-
[class*="_centerCol"] pre,
|
|
470
|
-
[data-slot^="conversation.chat"] pre,
|
|
471
|
-
[class*="_markdown"] pre {
|
|
472
|
-
font-size: 11.5px !important;
|
|
473
|
-
line-height: 1.4 !important;
|
|
474
|
-
max-width: 100% !important;
|
|
475
|
-
overflow-x: auto !important;
|
|
476
|
-
-webkit-overflow-scrolling: touch !important;
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
/* 表格:紧凑字号/内边距 + 窄屏横向滚动防撑破(display:block 让表格宽度受容器约束) */
|
|
480
|
-
[class*="_centerCol"] table,
|
|
481
|
-
[data-slot^="conversation.chat"] table,
|
|
482
|
-
[class*="_markdown"] table {
|
|
483
|
-
font-size: 11.5px !important;
|
|
484
|
-
line-height: 1.4 !important;
|
|
485
|
-
display: block !important;
|
|
486
|
-
max-width: 100% !important;
|
|
487
|
-
overflow-x: auto !important;
|
|
488
|
-
-webkit-overflow-scrolling: touch !important;
|
|
489
|
-
}
|
|
490
|
-
[class*="_centerCol"] table th,
|
|
491
|
-
[class*="_centerCol"] table td,
|
|
492
|
-
[data-slot^="conversation.chat"] table th,
|
|
493
|
-
[data-slot^="conversation.chat"] table td,
|
|
494
|
-
[class*="_markdown"] table th,
|
|
495
|
-
[class*="_markdown"] table td {
|
|
496
|
-
font-size: 11.5px !important;
|
|
497
|
-
line-height: 1.4 !important;
|
|
498
|
-
padding: 3px 7px !important;
|
|
499
|
-
}
|
|
500
|
-
|
|
501
|
-
/* 3.5 可折叠披露行(data-disclosure-row,如“Code/思考”等行):标题与摘要跟随紧凑字号 */
|
|
502
|
-
[class*="_centerCol"] [data-disclosure-row],
|
|
503
|
-
[data-slot^="conversation.chat"] [data-disclosure-row] {
|
|
504
|
-
font-size: 12.5px !important;
|
|
505
|
-
line-height: 1.45 !important;
|
|
506
|
-
}
|
|
507
|
-
[class*="_centerCol"] [data-disclosure-row] [class*="_title"],
|
|
508
|
-
[class*="_centerCol"] [data-disclosure-row] [class*="_summary"],
|
|
509
|
-
[data-slot^="conversation.chat"] [data-disclosure-row] [class*="_title"],
|
|
510
|
-
[data-slot^="conversation.chat"] [data-disclosure-row] [class*="_summary"] {
|
|
511
|
-
font-size: 12.5px !important;
|
|
512
|
-
line-height: 1.45 !important;
|
|
513
|
-
letter-spacing: -0.01em !important;
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
/* 3.7 消息列表双层滚动容器(wSkVaW_scrollBody + Md3f7G_scroll)padding 叠加:
|
|
517
|
-
官方各带 12~16px(合计每侧最多 28px),统一每层压到 8px(每侧合计 16px)。
|
|
518
|
-
均排除输入区滚动容器,避免误伤 composer。 */
|
|
519
|
-
[class*="_centerCol"] [class*="_scrollBody"],
|
|
520
|
-
[class*="_centerCol"] [class*="_scroll"]:not([data-composer-card] [class*="_scroll"]) {
|
|
521
|
-
padding: 8px 8px !important;
|
|
522
|
-
}
|
|
523
|
-
|
|
524
|
-
/* 4. 消息操作条(时间戳/复制等)与内行图标:显式收敛(SVG 不随字号缩放,需显式尺寸) */
|
|
525
|
-
[class*="_centerCol"] [class*="_actions"],
|
|
526
|
-
[data-slot^="conversation.chat"] [class*="_actions"] {
|
|
527
|
-
font-size: 11px !important;
|
|
528
|
-
line-height: 1.2 !important;
|
|
529
|
-
}
|
|
530
|
-
[class*="_centerCol"] [class*="_actions"] [class*="_timeStart"],
|
|
531
|
-
[class*="_centerCol"] [class*="_actions"] [class*="_timeEnd"],
|
|
532
|
-
[class*="_centerCol"] [class*="_actions"] [class*="_time"],
|
|
533
|
-
[data-slot^="conversation.chat"] [class*="_actions"] [class*="_timeStart"],
|
|
534
|
-
[data-slot^="conversation.chat"] [class*="_actions"] [class*="_timeEnd"],
|
|
535
|
-
[data-slot^="conversation.chat"] [class*="_actions"] [class*="_time"] {
|
|
536
|
-
font-size: 11px !important;
|
|
537
|
-
}
|
|
538
|
-
/* 用时统计内各指标/分隔点间距收紧(margin: 0) */
|
|
539
|
-
[class*="_centerCol"] [class*="_actions"] [class*="_timeEnd"] span,
|
|
540
|
-
[data-slot^="conversation.chat"] [class*="_actions"] [class*="_timeEnd"] span {
|
|
541
|
-
margin: 0 !important;
|
|
542
|
-
}
|
|
543
|
-
/* 统计行:单行优先,空间不足才折行(不再强制独占整行);折行后与消息左缘对齐(margin-left 清零) */
|
|
544
|
-
[class*="_centerCol"] [class*="_actions"] [class*="_timeEnd"],
|
|
545
|
-
[data-slot^="conversation.chat"] [class*="_actions"] [class*="_timeEnd"] {
|
|
546
|
-
flex: 0 1 auto !important;
|
|
547
|
-
min-width: 0 !important;
|
|
548
|
-
height: auto !important;
|
|
549
|
-
white-space: normal !important;
|
|
550
|
-
overflow: visible !important;
|
|
551
|
-
text-overflow: clip !important;
|
|
552
|
-
padding-left: 6px !important; /* 折行时也保留 6px 缩进,与上方内容区分 */
|
|
553
|
-
}
|
|
554
|
-
[class*="_centerCol"] [class*="_actions"],
|
|
555
|
-
[data-slot^="conversation.chat"] [class*="_actions"] {
|
|
556
|
-
flex-wrap: wrap !important;
|
|
557
|
-
height: auto !important;
|
|
558
|
-
overflow: visible !important;
|
|
559
|
-
}
|
|
560
|
-
[class*="_centerCol"] [class*="_actions"] svg,
|
|
561
|
-
[data-slot^="conversation.chat"] [class*="_actions"] svg,
|
|
562
|
-
[class*="_centerCol"] [class*="_leading"] svg,
|
|
563
|
-
[data-slot^="conversation.chat"] [class*="_leading"] svg {
|
|
564
|
-
width: 13px !important;
|
|
565
|
-
height: 13px !important;
|
|
566
|
-
max-width: 13px !important;
|
|
567
|
-
max-height: 13px !important;
|
|
568
|
-
vertical-align: middle !important;
|
|
569
|
-
flex: none !important;
|
|
570
|
-
}
|
|
571
|
-
|
|
572
|
-
/* 5. 聊天输入区(composer)紧凑:ghost-textarea 三元件(backdrop 文字层 / input 输入层 / mirror 撑高层)
|
|
573
|
-
官方共用同一排版:card 16px/24px,三层皆 inherit,且官方 JS 读 mirror 的 lineHeight 做光标滚动定位。
|
|
574
|
-
因此必须整体改 card 一个基准让三层同步,绝不能只改其中一两层,否则光标随行数错位、高度不撑开。
|
|
575
|
-
注:插件已设 user-scalable=no,iOS 聚焦不会放大,14px 安全。 */
|
|
576
|
-
[data-composer-card="true"] {
|
|
577
|
-
font-size: 14px !important;
|
|
578
|
-
line-height: 20px !important;
|
|
579
|
-
}
|
|
580
|
-
/* ghost-textarea 三件套(backdrop 文字层 / input 输入层 / mirror 撑高层)全参数锁定:
|
|
581
|
-
与官方共享样式基准一致(仅字号行高改小),根除继承链差异 → 光标/高度/滚动定位同步 */
|
|
582
|
-
[data-composer-card="true"] textarea,
|
|
583
|
-
[data-composer-card="true"] [data-dsh-part="composer-input"],
|
|
584
|
-
[data-composer-card="true"] [data-input-mirror="true"],
|
|
585
|
-
[data-composer-card="true"] [data-input-backdrop="true"] {
|
|
586
|
-
font-family: var(--dsw-font-family, inherit) !important;
|
|
587
|
-
font-size: 14px !important;
|
|
588
|
-
line-height: 20px !important;
|
|
589
|
-
letter-spacing: 0 !important;
|
|
590
|
-
white-space: pre-wrap !important;
|
|
591
|
-
word-break: break-word !important;
|
|
592
|
-
overflow-wrap: anywhere !important;
|
|
593
|
-
padding: 4px 12px 0 16px !important;
|
|
594
|
-
}
|
|
595
|
-
[data-composer-card="true"] button,
|
|
596
|
-
[data-composer-card="true"] [role="button"],
|
|
597
|
-
[data-composer-card="true"] [class*="_triggerLabel"] {
|
|
598
|
-
font-size: 13px !important;
|
|
599
|
-
}
|
|
600
|
-
/* 输入框整体加宽:composer 外层容器左右留白 16px → 8px(:has 精准定位 card 的直接父,避免误伤其它 _root) */
|
|
601
|
-
[class*="_root"]:has(> [data-composer-card="true"]) {
|
|
602
|
-
padding: 0 8px 8px !important;
|
|
603
|
-
}
|
|
604
|
-
[data-composer-card="true"] svg {
|
|
605
|
-
width: 13px !important;
|
|
606
|
-
height: 13px !important;
|
|
607
|
-
max-width: 13px !important;
|
|
608
|
-
max-height: 13px !important;
|
|
609
|
-
flex: none !important;
|
|
610
|
-
}
|
|
611
|
-
/* composer 工具栏紧凑:保持两行布局不变,仅缩小控件尺寸。
|
|
612
|
-
以工具栏行(_row,即 uV2eYG_row)为锚点,避免误伤输入文本区内的
|
|
613
|
-
文本引用 / chip 等行内元素。特异性 (0,2,0)~ (0,3,0) 均高于官方单类 (0,1,0)。 */
|
|
614
|
-
[data-composer-card="true"] [class*="_row"] {
|
|
615
|
-
gap: 6px !important;
|
|
616
|
-
padding: 2px 6px 4px !important;
|
|
617
|
-
}
|
|
618
|
-
[data-composer-card="true"] [class*="_row"] [class*="_tools"],
|
|
619
|
-
[data-composer-card="true"] [class*="_row"] [class*="_modes"],
|
|
620
|
-
[data-composer-card="true"] [class*="_row"] [class*="_trailing"] {
|
|
621
|
-
gap: 6px !important;
|
|
622
|
-
}
|
|
623
|
-
[data-composer-card="true"] [class*="_row"] [class*="_add"],
|
|
624
|
-
[data-composer-card="true"] [class*="_row"] [class*="_trigger"] {
|
|
625
|
-
padding: 0 4px !important;
|
|
626
|
-
gap: 2px !important;
|
|
627
|
-
}
|
|
628
|
-
[data-composer-card="true"] [class*="_row"] [class*="_add"] {
|
|
629
|
-
width: 26px !important;
|
|
630
|
-
min-width: 26px !important;
|
|
631
|
-
height: 26px !important;
|
|
632
|
-
min-height: 26px !important;
|
|
633
|
-
}
|
|
634
|
-
[data-composer-card="true"] [class*="_row"] [class*="_triggerLabel"],
|
|
635
|
-
[data-composer-card="true"] [class*="_row"] [class*="_triggerEffort"] {
|
|
636
|
-
font-size: 12px !important;
|
|
637
|
-
line-height: 16px !important;
|
|
638
|
-
}
|
|
639
|
-
[data-composer-card="true"] [class*="_row"] [class*="_primary"] {
|
|
640
|
-
width: 30px !important;
|
|
641
|
-
height: 30px !important;
|
|
642
|
-
min-width: 30px !important;
|
|
643
|
-
min-height: 30px !important;
|
|
644
|
-
}
|
|
645
|
-
[data-composer-card="true"] [class*="_row"] svg {
|
|
646
|
-
width: 12px !important;
|
|
647
|
-
height: 12px !important;
|
|
648
|
-
max-width: 12px !important;
|
|
649
|
-
max-height: 12px !important;
|
|
650
|
-
flex: none !important;
|
|
651
|
-
}
|
|
652
|
-
|
|
653
|
-
/* 6. 提问卡片(Mbwy4a_frame,data-question-key 为官方稳定属性锚点):
|
|
654
|
-
收窄左右外边距(官方 padding: calc(composer-side-clearance + 16px) 偏大),
|
|
655
|
-
选项文案字号跟随正文(正文 12.5px,选项标题 13px、说明 12.5px),
|
|
656
|
-
行高同步收敛,保持卡片整体与对话紧凑排版一致。 */
|
|
657
|
-
[data-question-key] {
|
|
658
|
-
padding-left: 8px !important;
|
|
659
|
-
padding-right: 8px !important;
|
|
660
|
-
}
|
|
661
|
-
|
|
662
|
-
[data-question-key] [class*="_optionLabel"] {
|
|
663
|
-
font-size: 13px !important;
|
|
664
|
-
line-height: 20px !important;
|
|
665
|
-
}
|
|
666
|
-
|
|
667
|
-
[data-question-key] [class*="_description"] {
|
|
668
|
-
font-size: 12.5px !important;
|
|
669
|
-
line-height: 20px !important;
|
|
670
|
-
}
|
|
671
|
-
|
|
672
|
-
[data-question-key] [class*="_title"] {
|
|
673
|
-
font-size: 15px !important;
|
|
674
|
-
line-height: 21px !important;
|
|
675
|
-
}
|
|
401
|
+
const PRESET_MAIN_CSS = `
|
|
402
|
+
/* ===== dsh-remote-mobile · 对话正文高密度排版 ===== */
|
|
403
|
+
/* 注:窄屏媒体查询由注入层按端包裹 */
|
|
404
|
+
/* 目标:小字号 + 紧凑行距 + 收紧边距,让每行展示更多内容。
|
|
405
|
+
不做布局缩放(zoom 会挤压 1fr 网格轨道、产生右侧空白并使页面破版);
|
|
406
|
+
字号规则主要基于稳定 HTML 元素(p/h1/li/pre/code 不随 hash 变化),
|
|
407
|
+
内容容器用 CSS Modules localName 后缀(只有前缀 hash 随机,后缀稳定)。 */
|
|
408
|
+
|
|
409
|
+
/* 1. 消息内容容器:紧凑字号与行距 */
|
|
410
|
+
[class*="_centerCol"],
|
|
411
|
+
[data-slot^="conversation.chat"],
|
|
412
|
+
[class*="_markdown"],
|
|
413
|
+
[class*="_message"],
|
|
414
|
+
[class*="_bubble"],
|
|
415
|
+
[class*="_text"] {
|
|
416
|
+
font-size: 12.5px !important;
|
|
417
|
+
line-height: 1.45 !important;
|
|
418
|
+
letter-spacing: -0.01em !important;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
/* 2. HTML 元素级(稳定):段落与标题层级 */
|
|
422
|
+
[class*="_centerCol"] p,
|
|
423
|
+
[data-slot^="conversation.chat"] p,
|
|
424
|
+
[class*="_markdown"] p,
|
|
425
|
+
[class*="_message"] p,
|
|
426
|
+
[class*="_bubble"] p {
|
|
427
|
+
font-size: 12.5px !important;
|
|
428
|
+
line-height: 1.45 !important;
|
|
429
|
+
margin: 0 0 0.4em 0 !important;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
[class*="_centerCol"] h1,
|
|
433
|
+
[class*="_centerCol"] h2,
|
|
434
|
+
[class*="_centerCol"] h3,
|
|
435
|
+
[class*="_centerCol"] h4,
|
|
436
|
+
[data-slot^="conversation.chat"] h1,
|
|
437
|
+
[data-slot^="conversation.chat"] h2,
|
|
438
|
+
[data-slot^="conversation.chat"] h3,
|
|
439
|
+
[class*="_markdown"] h1,
|
|
440
|
+
[class*="_markdown"] h2,
|
|
441
|
+
[class*="_markdown"] h3 {
|
|
442
|
+
font-size: 13.5px !important;
|
|
443
|
+
font-weight: 700 !important;
|
|
444
|
+
margin: 0.5em 0 0.25em 0 !important;
|
|
445
|
+
line-height: 1.3 !important;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
[class*="_centerCol"] ul,
|
|
449
|
+
[class*="_centerCol"] ol,
|
|
450
|
+
[class*="_markdown"] ul,
|
|
451
|
+
[class*="_markdown"] ol {
|
|
452
|
+
margin: 0.2em 0 0.4em 0 !important;
|
|
453
|
+
padding-left: 1.2em !important;
|
|
454
|
+
}
|
|
455
|
+
[class*="_centerCol"] li,
|
|
456
|
+
[class*="_markdown"] li {
|
|
457
|
+
font-size: 12.5px !important;
|
|
458
|
+
line-height: 1.45 !important;
|
|
459
|
+
margin-bottom: 0.15em !important;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
/* 3. 行内代码与代码块:小等宽 + 防横向溢出 */
|
|
463
|
+
[class*="_centerCol"] code,
|
|
464
|
+
[data-slot^="conversation.chat"] code,
|
|
465
|
+
[class*="_markdown"] code {
|
|
466
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
|
|
467
|
+
font-size: 11.5px !important;
|
|
468
|
+
}
|
|
469
|
+
[class*="_centerCol"] pre,
|
|
470
|
+
[data-slot^="conversation.chat"] pre,
|
|
471
|
+
[class*="_markdown"] pre {
|
|
472
|
+
font-size: 11.5px !important;
|
|
473
|
+
line-height: 1.4 !important;
|
|
474
|
+
max-width: 100% !important;
|
|
475
|
+
overflow-x: auto !important;
|
|
476
|
+
-webkit-overflow-scrolling: touch !important;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
/* 表格:紧凑字号/内边距 + 窄屏横向滚动防撑破(display:block 让表格宽度受容器约束) */
|
|
480
|
+
[class*="_centerCol"] table,
|
|
481
|
+
[data-slot^="conversation.chat"] table,
|
|
482
|
+
[class*="_markdown"] table {
|
|
483
|
+
font-size: 11.5px !important;
|
|
484
|
+
line-height: 1.4 !important;
|
|
485
|
+
display: block !important;
|
|
486
|
+
max-width: 100% !important;
|
|
487
|
+
overflow-x: auto !important;
|
|
488
|
+
-webkit-overflow-scrolling: touch !important;
|
|
489
|
+
}
|
|
490
|
+
[class*="_centerCol"] table th,
|
|
491
|
+
[class*="_centerCol"] table td,
|
|
492
|
+
[data-slot^="conversation.chat"] table th,
|
|
493
|
+
[data-slot^="conversation.chat"] table td,
|
|
494
|
+
[class*="_markdown"] table th,
|
|
495
|
+
[class*="_markdown"] table td {
|
|
496
|
+
font-size: 11.5px !important;
|
|
497
|
+
line-height: 1.4 !important;
|
|
498
|
+
padding: 3px 7px !important;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
/* 3.5 可折叠披露行(data-disclosure-row,如“Code/思考”等行):标题与摘要跟随紧凑字号 */
|
|
502
|
+
[class*="_centerCol"] [data-disclosure-row],
|
|
503
|
+
[data-slot^="conversation.chat"] [data-disclosure-row] {
|
|
504
|
+
font-size: 12.5px !important;
|
|
505
|
+
line-height: 1.45 !important;
|
|
506
|
+
}
|
|
507
|
+
[class*="_centerCol"] [data-disclosure-row] [class*="_title"],
|
|
508
|
+
[class*="_centerCol"] [data-disclosure-row] [class*="_summary"],
|
|
509
|
+
[data-slot^="conversation.chat"] [data-disclosure-row] [class*="_title"],
|
|
510
|
+
[data-slot^="conversation.chat"] [data-disclosure-row] [class*="_summary"] {
|
|
511
|
+
font-size: 12.5px !important;
|
|
512
|
+
line-height: 1.45 !important;
|
|
513
|
+
letter-spacing: -0.01em !important;
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
/* 3.7 消息列表双层滚动容器(wSkVaW_scrollBody + Md3f7G_scroll)padding 叠加:
|
|
517
|
+
官方各带 12~16px(合计每侧最多 28px),统一每层压到 8px(每侧合计 16px)。
|
|
518
|
+
均排除输入区滚动容器,避免误伤 composer。 */
|
|
519
|
+
[class*="_centerCol"] [class*="_scrollBody"],
|
|
520
|
+
[class*="_centerCol"] [class*="_scroll"]:not([data-composer-card] [class*="_scroll"]) {
|
|
521
|
+
padding: 8px 8px !important;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
/* 4. 消息操作条(时间戳/复制等)与内行图标:显式收敛(SVG 不随字号缩放,需显式尺寸) */
|
|
525
|
+
[class*="_centerCol"] [class*="_actions"],
|
|
526
|
+
[data-slot^="conversation.chat"] [class*="_actions"] {
|
|
527
|
+
font-size: 11px !important;
|
|
528
|
+
line-height: 1.2 !important;
|
|
529
|
+
}
|
|
530
|
+
[class*="_centerCol"] [class*="_actions"] [class*="_timeStart"],
|
|
531
|
+
[class*="_centerCol"] [class*="_actions"] [class*="_timeEnd"],
|
|
532
|
+
[class*="_centerCol"] [class*="_actions"] [class*="_time"],
|
|
533
|
+
[data-slot^="conversation.chat"] [class*="_actions"] [class*="_timeStart"],
|
|
534
|
+
[data-slot^="conversation.chat"] [class*="_actions"] [class*="_timeEnd"],
|
|
535
|
+
[data-slot^="conversation.chat"] [class*="_actions"] [class*="_time"] {
|
|
536
|
+
font-size: 11px !important;
|
|
537
|
+
}
|
|
538
|
+
/* 用时统计内各指标/分隔点间距收紧(margin: 0) */
|
|
539
|
+
[class*="_centerCol"] [class*="_actions"] [class*="_timeEnd"] span,
|
|
540
|
+
[data-slot^="conversation.chat"] [class*="_actions"] [class*="_timeEnd"] span {
|
|
541
|
+
margin: 0 !important;
|
|
542
|
+
}
|
|
543
|
+
/* 统计行:单行优先,空间不足才折行(不再强制独占整行);折行后与消息左缘对齐(margin-left 清零) */
|
|
544
|
+
[class*="_centerCol"] [class*="_actions"] [class*="_timeEnd"],
|
|
545
|
+
[data-slot^="conversation.chat"] [class*="_actions"] [class*="_timeEnd"] {
|
|
546
|
+
flex: 0 1 auto !important;
|
|
547
|
+
min-width: 0 !important;
|
|
548
|
+
height: auto !important;
|
|
549
|
+
white-space: normal !important;
|
|
550
|
+
overflow: visible !important;
|
|
551
|
+
text-overflow: clip !important;
|
|
552
|
+
padding-left: 6px !important; /* 折行时也保留 6px 缩进,与上方内容区分 */
|
|
553
|
+
}
|
|
554
|
+
[class*="_centerCol"] [class*="_actions"],
|
|
555
|
+
[data-slot^="conversation.chat"] [class*="_actions"] {
|
|
556
|
+
flex-wrap: wrap !important;
|
|
557
|
+
height: auto !important;
|
|
558
|
+
overflow: visible !important;
|
|
559
|
+
}
|
|
560
|
+
[class*="_centerCol"] [class*="_actions"] svg,
|
|
561
|
+
[data-slot^="conversation.chat"] [class*="_actions"] svg,
|
|
562
|
+
[class*="_centerCol"] [class*="_leading"] svg,
|
|
563
|
+
[data-slot^="conversation.chat"] [class*="_leading"] svg {
|
|
564
|
+
width: 13px !important;
|
|
565
|
+
height: 13px !important;
|
|
566
|
+
max-width: 13px !important;
|
|
567
|
+
max-height: 13px !important;
|
|
568
|
+
vertical-align: middle !important;
|
|
569
|
+
flex: none !important;
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
/* 5. 聊天输入区(composer)紧凑:ghost-textarea 三元件(backdrop 文字层 / input 输入层 / mirror 撑高层)
|
|
573
|
+
官方共用同一排版:card 16px/24px,三层皆 inherit,且官方 JS 读 mirror 的 lineHeight 做光标滚动定位。
|
|
574
|
+
因此必须整体改 card 一个基准让三层同步,绝不能只改其中一两层,否则光标随行数错位、高度不撑开。
|
|
575
|
+
注:插件已设 user-scalable=no,iOS 聚焦不会放大,14px 安全。 */
|
|
576
|
+
[data-composer-card="true"] {
|
|
577
|
+
font-size: 14px !important;
|
|
578
|
+
line-height: 20px !important;
|
|
579
|
+
}
|
|
580
|
+
/* ghost-textarea 三件套(backdrop 文字层 / input 输入层 / mirror 撑高层)全参数锁定:
|
|
581
|
+
与官方共享样式基准一致(仅字号行高改小),根除继承链差异 → 光标/高度/滚动定位同步 */
|
|
582
|
+
[data-composer-card="true"] textarea,
|
|
583
|
+
[data-composer-card="true"] [data-dsh-part="composer-input"],
|
|
584
|
+
[data-composer-card="true"] [data-input-mirror="true"],
|
|
585
|
+
[data-composer-card="true"] [data-input-backdrop="true"] {
|
|
586
|
+
font-family: var(--dsw-font-family, inherit) !important;
|
|
587
|
+
font-size: 14px !important;
|
|
588
|
+
line-height: 20px !important;
|
|
589
|
+
letter-spacing: 0 !important;
|
|
590
|
+
white-space: pre-wrap !important;
|
|
591
|
+
word-break: break-word !important;
|
|
592
|
+
overflow-wrap: anywhere !important;
|
|
593
|
+
padding: 4px 12px 0 16px !important;
|
|
594
|
+
}
|
|
595
|
+
[data-composer-card="true"] button,
|
|
596
|
+
[data-composer-card="true"] [role="button"],
|
|
597
|
+
[data-composer-card="true"] [class*="_triggerLabel"] {
|
|
598
|
+
font-size: 13px !important;
|
|
599
|
+
}
|
|
600
|
+
/* 输入框整体加宽:composer 外层容器左右留白 16px → 8px(:has 精准定位 card 的直接父,避免误伤其它 _root) */
|
|
601
|
+
[class*="_root"]:has(> [data-composer-card="true"]) {
|
|
602
|
+
padding: 0 8px 8px !important;
|
|
603
|
+
}
|
|
604
|
+
[data-composer-card="true"] svg {
|
|
605
|
+
width: 13px !important;
|
|
606
|
+
height: 13px !important;
|
|
607
|
+
max-width: 13px !important;
|
|
608
|
+
max-height: 13px !important;
|
|
609
|
+
flex: none !important;
|
|
610
|
+
}
|
|
611
|
+
/* composer 工具栏紧凑:保持两行布局不变,仅缩小控件尺寸。
|
|
612
|
+
以工具栏行(_row,即 uV2eYG_row)为锚点,避免误伤输入文本区内的
|
|
613
|
+
文本引用 / chip 等行内元素。特异性 (0,2,0)~ (0,3,0) 均高于官方单类 (0,1,0)。 */
|
|
614
|
+
[data-composer-card="true"] [class*="_row"] {
|
|
615
|
+
gap: 6px !important;
|
|
616
|
+
padding: 2px 6px 4px !important;
|
|
617
|
+
}
|
|
618
|
+
[data-composer-card="true"] [class*="_row"] [class*="_tools"],
|
|
619
|
+
[data-composer-card="true"] [class*="_row"] [class*="_modes"],
|
|
620
|
+
[data-composer-card="true"] [class*="_row"] [class*="_trailing"] {
|
|
621
|
+
gap: 6px !important;
|
|
622
|
+
}
|
|
623
|
+
[data-composer-card="true"] [class*="_row"] [class*="_add"],
|
|
624
|
+
[data-composer-card="true"] [class*="_row"] [class*="_trigger"] {
|
|
625
|
+
padding: 0 4px !important;
|
|
626
|
+
gap: 2px !important;
|
|
627
|
+
}
|
|
628
|
+
[data-composer-card="true"] [class*="_row"] [class*="_add"] {
|
|
629
|
+
width: 26px !important;
|
|
630
|
+
min-width: 26px !important;
|
|
631
|
+
height: 26px !important;
|
|
632
|
+
min-height: 26px !important;
|
|
633
|
+
}
|
|
634
|
+
[data-composer-card="true"] [class*="_row"] [class*="_triggerLabel"],
|
|
635
|
+
[data-composer-card="true"] [class*="_row"] [class*="_triggerEffort"] {
|
|
636
|
+
font-size: 12px !important;
|
|
637
|
+
line-height: 16px !important;
|
|
638
|
+
}
|
|
639
|
+
[data-composer-card="true"] [class*="_row"] [class*="_primary"] {
|
|
640
|
+
width: 30px !important;
|
|
641
|
+
height: 30px !important;
|
|
642
|
+
min-width: 30px !important;
|
|
643
|
+
min-height: 30px !important;
|
|
644
|
+
}
|
|
645
|
+
[data-composer-card="true"] [class*="_row"] svg {
|
|
646
|
+
width: 12px !important;
|
|
647
|
+
height: 12px !important;
|
|
648
|
+
max-width: 12px !important;
|
|
649
|
+
max-height: 12px !important;
|
|
650
|
+
flex: none !important;
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
/* 6. 提问卡片(Mbwy4a_frame,data-question-key 为官方稳定属性锚点):
|
|
654
|
+
收窄左右外边距(官方 padding: calc(composer-side-clearance + 16px) 偏大),
|
|
655
|
+
选项文案字号跟随正文(正文 12.5px,选项标题 13px、说明 12.5px),
|
|
656
|
+
行高同步收敛,保持卡片整体与对话紧凑排版一致。 */
|
|
657
|
+
[data-question-key] {
|
|
658
|
+
padding-left: 8px !important;
|
|
659
|
+
padding-right: 8px !important;
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
[data-question-key] [class*="_optionLabel"] {
|
|
663
|
+
font-size: 13px !important;
|
|
664
|
+
line-height: 20px !important;
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
[data-question-key] [class*="_description"] {
|
|
668
|
+
font-size: 12.5px !important;
|
|
669
|
+
line-height: 20px !important;
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
[data-question-key] [class*="_title"] {
|
|
673
|
+
font-size: 15px !important;
|
|
674
|
+
line-height: 21px !important;
|
|
675
|
+
}
|
|
676
676
|
`;
|
|
677
677
|
/**
|
|
678
678
|
* 内置官方预设:按界面区域划分的三段预设。
|