jingyaogong commited on
Commit
723bbbd
·
verified ·
1 Parent(s): 1d95487

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +29 -36
app.py CHANGED
@@ -10,44 +10,22 @@ st.set_page_config(page_title="MiniMind", initial_sidebar_state="collapsed")
10
 
11
  st.markdown("""
12
  <style>
13
- /* 添加操作按钮样式 */
14
- .stButton button {
15
- border-radius: 50% !important; /* 改为圆形 */
16
- width: 32px !important; /* 固定宽度 */
17
- height: 32px !important; /* 固定高度 */
18
- padding: 0 !important; /* 移除内边距 */
19
- background-color: transparent !important;
20
- border: 1px solid #ddd !important;
21
- display: flex !important;
22
- align-items: center !important;
23
- justify-content: center !important;
24
- font-size: 14px !important;
25
- color: #666 !important; /* 更柔和的颜色 */
26
- margin: 5px 10px 5px 0 !important; /* 调整按钮间距 */
27
- }
28
- .stButton button:hover {
29
- border-color: #999 !important;
30
- color: #333 !important;
31
- background-color: #f5f5f5 !important;
32
  }
33
- .stMainBlockContainer > div:first-child {
34
- margin-top: -50px !important;
35
- }
36
- .stApp > div:last-child {
37
- margin-bottom: -35px !important;
38
- }
39
-
40
- /* 重置按钮基础样式 */
41
  .stButton > button {
42
- all: unset !important; /* 重置所有默认样式 */
43
  box-sizing: border-box !important;
44
  border-radius: 50% !important;
45
- width: 18px !important;
46
- height: 18px !important;
47
- min-width: 18px !important;
48
- min-height: 18px !important;
49
- max-width: 18px !important;
50
- max-height: 18px !important;
51
  padding: 0 !important;
52
  background-color: transparent !important;
53
  border: 1px solid #ddd !important;
@@ -58,9 +36,24 @@ st.markdown("""
58
  color: #888 !important;
59
  cursor: pointer !important;
60
  transition: all 0.2s ease !important;
61
- margin: 0 2px !important; /* 调整这里的 margin 值 */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62
  }
63
-
64
  </style>
65
  """, unsafe_allow_html=True)
66
 
 
10
 
11
  st.markdown("""
12
  <style>
13
+ /* 调整主容器边距,避免溢出 */
14
+ .stMainBlockContainer {
15
+ padding-top: 1rem !important;
16
+ padding-bottom: 1rem !important;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  }
18
+
19
+ /* 操作按钮样式 */
 
 
 
 
 
 
20
  .stButton > button {
 
21
  box-sizing: border-box !important;
22
  border-radius: 50% !important;
23
+ width: 24px !important;
24
+ height: 24px !important;
25
+ min-width: 24px !important;
26
+ min-height: 24px !important;
27
+ max-width: 24px !important;
28
+ max-height: 24px !important;
29
  padding: 0 !important;
30
  background-color: transparent !important;
31
  border: 1px solid #ddd !important;
 
36
  color: #888 !important;
37
  cursor: pointer !important;
38
  transition: all 0.2s ease !important;
39
+ margin: 2px !important;
40
+ }
41
+
42
+ .stButton > button:hover {
43
+ border-color: #999 !important;
44
+ color: #333 !important;
45
+ background-color: #f5f5f5 !important;
46
+ }
47
+
48
+ /* 确保聊天容器不溢出 */
49
+ .stChatMessage {
50
+ max-width: 100% !important;
51
+ }
52
+
53
+ /* 侧边栏样式优化 */
54
+ section[data-testid="stSidebar"] {
55
+ overflow-y: auto !important;
56
  }
 
57
  </style>
58
  """, unsafe_allow_html=True)
59