Estazz commited on
Commit
705e331
·
verified ·
1 Parent(s): 6b667e3

Update styles.py

Browse files
Files changed (1) hide show
  1. styles.py +52 -5
styles.py CHANGED
@@ -90,11 +90,11 @@ position:absolute; right:16px; top:10px; font-weight:700; font-size:28px; letter
90
  }
91
 
92
  /* 聊天组件细节:头像更小、气泡更易读 */
93
- .custom-chatbot .avatar-image{
94
- width:40px !important; height:40px !important; min-width:40px !important; min-height:40px !important;
95
- border-radius:50% !important; border:2px solid #fff !important; background:#f6f8fb !important; flex-shrink:0 !important;
96
- box-shadow: 0 2px 6px rgba(0,0,0,.25);
97
- }
98
  .custom-chatbot .message{ font-size:16px; line-height:1.6; color:var(--ink); word-break:break-word; }
99
  .custom-chatbot .message.user{ background: rgba(255,255,255,.08) !important; }
100
  .custom-chatbot .message.bot{ background: rgba(0,0,0,.20) !important; }
@@ -154,6 +154,53 @@ position:absolute; right:16px; top:10px; font-weight:700; font-size:28px; letter
154
  }
155
 
156
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
157
 
158
  """
159
 
 
90
  }
91
 
92
  /* 聊天组件细节:头像更小、气泡更易读 */
93
+ # .custom-chatbot .avatar-image{
94
+ # width:40px !important; height:40px !important; min-width:40px !important; min-height:40px !important;
95
+ # border-radius:50% !important; border:2px solid #fff !important; background:#f6f8fb !important; flex-shrink:0 !important;
96
+ # box-shadow: 0 2px 6px rgba(0,0,0,.25);
97
+ # }
98
  .custom-chatbot .message{ font-size:16px; line-height:1.6; color:var(--ink); word-break:break-word; }
99
  .custom-chatbot .message.user{ background: rgba(255,255,255,.08) !important; }
100
  .custom-chatbot .message.bot{ background: rgba(0,0,0,.20) !important; }
 
154
  }
155
 
156
 
157
+ /* === Chatbot 头像尺寸 & 对齐(稳定版)=== */
158
+
159
+ /* 1) 用容器来做圆形与描边,更不易错位 */
160
+ .custom-chatbot .avatar{
161
+ width: 40px; /* 想更大改成 44px */
162
+ height: 40px;
163
+ min-width: 40px;
164
+ min-height: 40px;
165
+ border-radius: 9999px;
166
+ overflow: hidden; /* 把内部图像裁剪成圆形 */
167
+ border: 2px solid #ffffffcc; /* 半透明白描边 */
168
+ box-shadow: 0 2px 6px rgba(0,0,0,.25);
169
+ background: transparent;
170
+ flex-shrink: 0;
171
+ align-self: flex-start; /* 与气泡顶部对齐,避免“头像偏下” */
172
+ margin-top: 2px; /* 轻微上移,让视觉更齐 */
173
+ }
174
+
175
+ /* 2) 图片填充容器,避免被拉伸/留白/偏移 */
176
+ .custom-chatbot .avatar-image{
177
+ width: 100% !important;
178
+ height: 100% !important;
179
+ object-fit: cover; /* 等比铺满 */
180
+ object-position: 50% 50%; /* 居中人物脸部 */
181
+ display: block;
182
+ background: transparent !important;
183
+ border: none !important; /* 边框交给容器处理 */
184
+ }
185
+
186
+ /* 3) 气泡与头像的相对布局再细调一下 */
187
+ .custom-chatbot .message{
188
+ align-items: flex-start; /* 顶部对齐,避免头像和气泡错层 */
189
+ gap: 10px; /* 头像与气泡的水平间距 */
190
+ }
191
+ .custom-chatbot .message .message-content{
192
+ margin-top: 2px; /* 让气泡首行与头像更齐平 */
193
+ }
194
+
195
+ /* 4) 移动端略微缩小 */
196
+ @media (max-width: 820px){
197
+ .custom-chatbot .avatar{
198
+ width: 30px; height: 30px; min-width: 30px; min-height: 30px;
199
+ border-width: 1.5px;
200
+ }
201
+ }
202
+
203
+
204
 
205
  """
206