Skip to content

Commit 20b018c

Browse files
committed
fix: 修复水平滚动条问题,改用100%宽度替代100vw
1 parent 61383cc commit 20b018c

File tree

1 file changed

+29
-31
lines changed

1 file changed

+29
-31
lines changed

src/components/AlgorithmRunner.css

Lines changed: 29 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,51 @@
11
.algorithm-runner {
2-
min-height: 100vh;
2+
height: 100vh;
3+
width: 100%;
34
display: flex;
45
flex-direction: column;
56
background: #f5f7fa;
7+
overflow: hidden;
8+
box-sizing: border-box;
69
}
710

811
/* 输入区域 */
912
.input-section {
10-
padding: 12px 20px;
13+
padding: 8px 16px;
1114
background: white;
1215
border-bottom: 1px solid #e1e4e8;
16+
flex-shrink: 0;
1317
}
1418

1519
/* 主内容区 - 左右分栏 */
1620
.main-content {
1721
display: flex;
1822
flex: 1;
1923
overflow: hidden;
20-
gap: 16px;
21-
padding: 16px;
24+
gap: 12px;
25+
padding: 12px 16px;
26+
min-height: 0;
27+
width: 100%;
28+
box-sizing: border-box;
2229
}
2330

2431
/* 画布区域 - 左侧,占据大部分空间 */
2532
.canvas-section {
2633
flex: 2;
2734
min-width: 0;
2835
background: white;
29-
border-radius: 12px;
30-
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
36+
border-radius: 8px;
37+
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
3138
overflow: hidden;
3239
position: relative;
3340
}
3441

3542
/* 代码区域 - 右侧 */
3643
.code-section {
37-
flex: 1;
38-
min-width: 320px;
39-
max-width: 500px;
44+
width: 340px;
45+
flex-shrink: 0;
4046
background: white;
41-
border-radius: 12px;
42-
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
47+
border-radius: 8px;
48+
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
4349
overflow: hidden;
4450
display: flex;
4551
flex-direction: column;
@@ -49,39 +55,31 @@
4955
.bottom-controls {
5056
background: white;
5157
border-top: 1px solid #e1e4e8;
52-
padding: 12px 20px;
58+
padding: 8px 16px;
5359
display: flex;
5460
flex-direction: column;
55-
gap: 12px;
61+
gap: 8px;
62+
flex-shrink: 0;
5663
}
5764

5865
/* 响应式布局 */
59-
@media (max-width: 1024px) {
60-
.main-content {
61-
flex-direction: column;
62-
}
63-
66+
@media (max-width: 900px) {
6467
.code-section {
65-
max-width: none;
66-
min-height: 300px;
67-
}
68-
69-
.canvas-section {
70-
min-height: 300px;
68+
width: 280px;
7169
}
7270
}
7371

7472
@media (max-width: 768px) {
75-
.input-section {
76-
padding: 10px 12px;
73+
.main-content {
74+
flex-direction: column;
7775
}
7876

79-
.main-content {
80-
padding: 10px;
81-
gap: 10px;
77+
.code-section {
78+
width: 100%;
79+
min-height: 200px;
8280
}
8381

84-
.bottom-controls {
85-
padding: 10px 12px;
82+
.canvas-section {
83+
min-height: 200px;
8684
}
8785
}

0 commit comments

Comments
 (0)