forked from t11003/w4-git-practice
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstyle.css
More file actions
153 lines (131 loc) · 2.49 KB
/
Copy pathstyle.css
File metadata and controls
153 lines (131 loc) · 2.49 KB
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
/* ============================
W4 練習 Chatbot 樣式
學生練習:修改顏色、字體大小等
============================ */
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-family: 'Noto Sans TC', sans-serif;
/* 練習:把背景色改成你喜歡的顏色 */
background-color: #fdf6ee;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
}
.container {
background: white;
border-radius: 16px;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
width: 480px;
max-width: 95vw;
overflow: hidden;
}
header {
/* 練習:把標題列顏色從藍色改成其他顏色 */
background: #e8723a;
color: white;
padding: 20px 24px;
}
header h1 {
font-size: 20px;
}
header .subtitle {
font-size: 13px;
opacity: 0.85;
margin-top: 4px;
}
#chat-box {
height: 360px;
overflow-y: auto;
padding: 20px;
display: flex;
flex-direction: column;
gap: 12px;
}
.message {
max-width: 75%;
padding: 10px 14px;
border-radius: 12px;
font-size: 14px;
line-height: 1.5;
}
.message.bot {
background: #fff3e0;
color: #5d4037;
align-self: flex-start;
border-bottom-left-radius: 4px;
}
.message.user {
/* 練習:把使用者訊息顏色從綠色改成你喜歡的顏色 */
background: #d84315;
color: white;
align-self: flex-end;
border-bottom-right-radius: 4px;
}
.input-area {
display: flex;
padding: 16px;
gap: 10px;
border-top: 1px solid #f5d6c0;
}
.input-area input {
flex: 1;
padding: 10px 14px;
border: 1px solid #e0c4a8;
border-radius: 8px;
font-size: 14px;
outline: none;
}
.input-area input:focus {
border-color: #e8723a;
}
.input-area button {
/* 按鈕顏色:保留暖色系橘色 */
background: #e8723a;
color: white;
border: none;
padding: 10px 20px;
border-radius: 8px;
cursor: pointer;
font-size: 14px;
}
.input-area button:hover {
opacity: 0.85;
}
/* ===== feature/dark-mode 新增 ===== */
.dark-toggle {
margin-top: 8px;
background: rgba(255, 255, 255, 0.2);
border: none;
color: white;
padding: 4px 12px;
border-radius: 6px;
cursor: pointer;
font-size: 12px;
}
body.dark {
background-color: #1e1e2e;
}
body.dark .container {
background: #313244;
color: #cdd6f4;
}
body.dark header {
background: #1e1e2e;
}
body.dark .message.bot {
background: #45475a;
color: #cdd6f4;
}
body.dark .input-area {
border-top-color: #45475a;
}
body.dark .input-area input {
background: #45475a;
color: #cdd6f4;
border-color: #585b70;
}