kongdeqiang
2026-10-12 285bf234bd50ce54fcae7bb777f8fa579b91266e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
:root {
  --sidebar-width: 268px;
  --border-color: #e5e7eb;
  --bg-page: #ffffff;
  --bg-sidebar: #f7f7f8;
  --bg-hover: #ececf1;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --bubble-user: #f1f5f9;
  --bubble-assistant: #ffffff;
  --code-bg: #f6f8fa;
}
 
* {
  box-sizing: border-box;
}
 
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  color: var(--text-primary);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
}
 
/* ---------------- 滚动条:细一些,减少视觉噪音 ---------------- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
 
::-webkit-scrollbar-track {
  background: transparent;
}
 
::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 4px;
}
 
::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}
 
/* ---------------- 消息正文排版 ---------------- */
/*
 * 消息正文:Markdown 渲染后的样式。
 *
 * 注意这里**不能**再用 `white-space: pre-wrap` ——
 * 那是「按纯文本显示」时代的写法,用来保留原文换行。
 * 现在内容已经是 <p>/<pre>/<li> 这些块级元素,pre-wrap 会:
 *   1. 把 HTML 源码里的缩进与换行也渲染出来,段落之间出现莫名空行
 *   2. 让 <pre> 的换行被重复计算,代码块行距翻倍
 * 换行现在由 Markdown 自己负责(marked 的 breaks: true 把单换行转 <br>)。
 */
.message-content {
  line-height: 1.75;
  word-break: break-word;
  overflow-wrap: anywhere;
}
 
/* 段落之间留出间距,同时去掉首尾多余空隙,避免气泡上下被撑开 */
.message-content > :first-child {
  margin-top: 0;
}
 
.message-content > :last-child {
  margin-bottom: 0;
}
 
.message-content p {
  margin: 0 0 10px;
}
 
.message-content h1,
.message-content h2,
.message-content h3,
.message-content h4,
.message-content h5,
.message-content h6 {
  margin: 16px 0 8px;
  font-weight: 600;
  line-height: 1.4;
}
 
.message-content h1 { font-size: 1.5em; }
.message-content h2 { font-size: 1.3em; }
.message-content h3 { font-size: 1.15em; }
.message-content h4,
.message-content h5,
.message-content h6 { font-size: 1em; }
 
.message-content ul,
.message-content ol {
  margin: 0 0 10px;
  padding-left: 1.6em;
}
 
.message-content li {
  margin: 3px 0;
}
 
.message-content blockquote {
  margin: 0 0 10px;
  padding: 2px 0 2px 12px;
  border-left: 3px solid #d1d5db;
  color: var(--text-secondary);
}
 
.message-content hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 14px 0;
}
 
/* 行内代码 */
.message-content code {
  background: var(--code-bg);
  padding: 2px 5px;
  border-radius: 4px;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.9em;
}
 
/*
 * 代码块。注意要写在行内代码规则**之后**并覆盖 background/padding,
 * 否则 <pre><code> 会同时命中两条规则,出现「块里又套了一层底色」。
 */
.message-content pre {
  background: #f6f8fa;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 14px;
  margin: 0 0 10px;
  /* 代码不换行,过长时横向滚动;纵向交给外层消息列表 */
  overflow-x: auto;
  line-height: 1.6;
}
 
.message-content pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: 12.5px;
  white-space: pre;
}
 
/* 表格 */
.message-content table {
  border-collapse: collapse;
  margin: 0 0 10px;
  display: block;
  overflow-x: auto;
  max-width: 100%;
}
 
.message-content th,
.message-content td {
  border: 1px solid var(--border-color);
  padding: 6px 10px;
  text-align: left;
}
 
.message-content th {
  background: #f9fafb;
  font-weight: 600;
}
 
.message-content a {
  color: #0f766e;
  text-decoration: none;
}
 
.message-content a:hover {
  text-decoration: underline;
}
 
/* ---------------- 打字光标 ---------------- */
.typing-cursor::after {
  content: '▍';
  margin-left: 1px;
  animation: blink 1s step-end infinite;
  color: var(--text-secondary);
}
 
@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}
 
/* ---------------- 通用工具类 ---------------- */
.text-secondary {
  color: var(--text-secondary);
}
 
.text-muted {
  color: var(--text-muted);
}
 
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}
 
.empty-hint {
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}