-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstyle.css
More file actions
350 lines (316 loc) · 15.6 KB
/
style.css
File metadata and controls
350 lines (316 loc) · 15.6 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
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
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
:root {
--primary: #4361ee;
--success: #06d6a0;
--danger: #ef233c;
--warning: #f8961e;
--dark: #1a1a2e;
--card-shadow: 0 6px 20px rgba(0,0,0,0.08);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: 'Segoe UI', system-ui, sans-serif;
line-height: 1.6;
background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
color: #333;
padding: 20px;
max-width: 1200px;
margin: 0 auto;
min-height: 100vh;
}
/* ── Header ── */
header { text-align: center; padding: 20px 12px 14px; position: relative; }
.header-top { display: flex; justify-content: center; align-items: center; gap: 12px; position: relative; }
h1 { font-size: 2.4rem; color: var(--dark); margin: 8px 0; }
.subtitle { color: #666; font-size: 1.05rem; margin: 4px 0 8px; }
header { position: relative; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; padding: 0.8rem 1.2rem; text-align: center; }
.burger-group { position: static; display: inline-flex; align-items: center; gap: 8px; border: 1px solid rgba(67,97,238,0.25); border-radius: 14px; background: rgba(255,255,255,0.98); padding: 4px 10px; box-shadow: 0 4px 12px rgba(33,33,33,0.12); margin: 0 auto 8px; order: 0; }
.burger-btn {
border: 0; border-radius: 10px; background: rgba(67,97,238,0.16);
width: 40px; height: 40px; font-size: 1.1rem; line-height: 1; cursor: pointer;
color: var(--primary); display: flex; align-items: center; justify-content: center;
transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.burger-btn:hover { transform: translateY(-2px); background: rgba(67,97,238,0.34); box-shadow: 0 12px 24px rgba(67,97,238,0.26); }
.burger-btn:focus { outline: none; box-shadow: 0 0 0 3px rgba(67,97,238,0.25); }
.burger-label { font-size: 0.95rem; color: var(--primary); font-weight: 700; cursor: pointer; letter-spacing: 0.2px; }
.burger-lang-menu {
position: absolute; top: 54px; left: 50%; transform: translateX(-50%); background: linear-gradient(180deg, #ffffff 0%, #f8faff 100%);
border: 1px solid rgba(67,97,238,0.24); border-radius: 14px;
box-shadow: 0 18px 28px rgba(23,45,93,0.18);
display: flex; flex-direction: column; padding: 10px 8px; gap: 6px; width: 190px; z-index: 1000;
transform-origin: top center; animation: popup 0.14s ease-out;
}
.burger-lang-menu::before { content: ""; position: absolute; top: -7px; right: 16px; width: 12px; height: 12px; background: #fff; border-top: 1px solid rgba(67,97,238,0.24); border-left: 1px solid rgba(67,97,238,0.24); transform: rotate(45deg); z-index: -1; }
.lang-option { border: 1px solid rgba(67,97,238,0.3); background: #fff; text-align: left; padding: 10px 14px; border-radius: 10px; cursor: pointer; color: #334475; font-weight: 600; transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
}
.lang-option.active { background: rgba(67,97,238,0.2); border-color: rgba(67,97,238,0.75); color: #1f3f8a; box-shadow: 0 0 0 2px rgba(67,97,238,0.15); }
.lang-option:hover { background: rgba(67,97,238,0.18); transform: translateX(2px); border-color: rgba(67,97,238,0.7); }
@media (max-width: 760px) {
header { align-items: center; padding-top: 4.2rem; }
.burger-group { position: fixed; right: 0.8rem; top: 0.8rem; width: auto; max-width: 220px; }
.burger-lang-menu { right: 0.2rem; left: auto; width: calc(100vw - 32px); max-width: 260px; }
.subtitle { font-size: 0.95rem; }
h1 { font-size: 1.8rem; }
}
@keyframes popup { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: scale(1); } }
.burger-lang-menu.hidden { display: none; }
.burger-menu-title { padding: 6px 12px; font-size: 0.85rem; color: #5f6b7b; text-transform: uppercase; letter-spacing: 0.5px; }
.lang-option { border: none; background: transparent; text-align: left; padding: 10px 12px;
border-radius: 10px; cursor: pointer; color: #2b3a61; font-weight: 600; transition: all 0.2s;
}
.lang-option.active { background: rgba(67,97,238,0.12); color: var(--primary); }
.lang-option:hover { background: rgba(67,97,238,0.12); color: var(--primary); }
/* ── Mode Tabs ── */
.mode-tabs { display: flex; justify-content: center; gap: 10px; margin: 18px 0 10px; }
.tab-btn {
padding: 10px 28px; border-radius: 50px; border: 2px solid #ddd;
background: white; font-size: 1rem; font-weight: 600; cursor: pointer;
transition: all 0.2s; color: #666;
}
.tab-btn.active { background: var(--primary); border-color: var(--primary); color: white; box-shadow: 0 4px 12px rgba(67,97,238,0.3); }
.tab-btn:hover:not(.active) { border-color: var(--primary); color: var(--primary); }
/* ── Controls ── */
.controls {
display: flex; flex-wrap: wrap; gap: 10px;
justify-content: center; align-items: center;
margin: 8px 0;
}
.controls-actions { margin-top: 4px; }
select, input[type="text"] {
padding: 10px 16px; border: 2px solid #ddd; border-radius: 50px;
font-size: 0.95rem; background: white; transition: border-color 0.2s;
}
select:focus, input[type="text"]:focus { outline: none; border-color: var(--primary); }
input[type="text"] { min-width: 240px; }
/* ── Buttons ── */
.btn {
background: var(--primary); color: white; border: none; padding: 10px 20px;
border-radius: 50px; cursor: pointer; font-size: 0.95rem; font-weight: 600;
transition: opacity 0.2s, transform 0.1s; white-space: nowrap;
}
.btn:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-success { background: var(--success); }
.btn-danger { background: var(--danger); }
.btn-export { background: #6c757d !important; color: white !important; border-color: #6c757d !important; }
.btn-outline {
background: white; color: var(--primary);
border: 2px solid var(--primary);
}
.btn-outline:hover { background: var(--primary); color: white; }
.btn-outline.active { background: var(--primary); color: white; }
/* ── Stats / Progress ── */
.stats { background: white; border-radius: 16px; padding: 16px 22px; margin: 14px 0; box-shadow: var(--card-shadow); }
.stats-row { display: flex; align-items: center; justify-content: center; gap: 18px; flex-wrap: wrap; margin-bottom: 10px; font-size: 0.95rem; }
.stats-row strong { font-size: 1.1rem; color: var(--dark); }
.progress-track { background: #e9ecef; border-radius: 50px; height: 12px; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--primary), var(--success)); border-radius: 50px; transition: width 0.5s ease; }
.progress-pct { text-align: center; font-size: 0.82rem; color: #888; margin-top: 5px; }
/* ── Word Grid ── */
.word-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 22px; margin-top: 10px; }
/* ── Study Card ── */
.card {
background: white; border-radius: 18px; box-shadow: var(--card-shadow);
padding: 22px; transition: transform 0.25s ease, box-shadow 0.25s ease;
border: 2px solid transparent;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(0,0,0,0.12); }
.card.is-mastered { border-color: var(--success); background: #f0fdf9; }
.card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 6px; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.level-badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-weight: 700; background: var(--primary); color: white; font-size: 0.8rem; }
.type-badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-weight: 600; background: #f0f2ff; color: var(--primary); font-size: 0.78rem; border: 1px solid #d0d6ff; }
.sr-badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-weight: 600; background: #fff3cd; color: #856404; font-size: 0.78rem; border: 1px solid #ffd060; }
.audio-btn {
background: #f0f2ff; border: none; color: var(--primary);
width: 36px; height: 36px; border-radius: 50%; cursor: pointer;
display: flex; align-items: center; justify-content: center;
transition: background 0.15s, transform 0.1s; flex-shrink: 0;
}
.audio-btn:hover { background: var(--primary); color: white; transform: scale(1.1); }
.chinese { font-size: 2.4rem; font-weight: bold; margin: 8px 0 4px; color: var(--dark); }
.pinyin { font-size: 1.3rem; color: #e63946; margin: 4px 0; font-family: monospace; }
.meaning { font-size: 1.2rem; color: #1d3557; margin: 10px 0 6px; font-weight: 600; display: none; }
.sentence-block {
background: #f8f9ff; border-left: 3px solid var(--primary);
border-radius: 0 8px 8px 0; padding: 8px 12px; margin: 8px 0;
font-size: 0.88rem; color: #444; display: none;
}
.sentence-zh { font-weight: 600; color: var(--dark); margin-bottom: 2px; }
.sentence-py { color: #e63946; font-family: monospace; font-size: 0.83rem; margin-bottom: 2px; }
.sentence-en { color: #555; font-style: italic; }
.card-actions { display: flex; gap: 8px; margin-top: 12px; }
.card-actions .btn { flex: 1; padding: 9px 12px; font-size: 0.88rem; }
/* ── Quiz ── */
#quizContainer { max-width: 680px; margin: 0 auto; }
.quiz-score-bar {
display: flex; justify-content: space-between; align-items: center;
background: white; border-radius: 14px; padding: 12px 22px;
margin-bottom: 18px; box-shadow: var(--card-shadow);
}
.quiz-card { background: white; border-radius: 22px; box-shadow: 0 8px 30px rgba(0,0,0,0.1); padding: 36px; text-align: center; }
.quiz-chinese { font-size: 4rem; font-weight: bold; color: var(--dark); margin: 10px 0; }
.quiz-pinyin { font-size: 1.5rem; color: #e63946; font-family: monospace; margin-bottom: 26px; }
.quiz-lbadge { display: inline-block; padding: 4px 14px; border-radius: 20px; background: var(--primary); color: white; font-size: 0.85rem; font-weight: 700; margin-bottom: 6px; }
.quiz-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.quiz-opt {
padding: 15px 12px; border: 2px solid #e0e0e0; border-radius: 14px;
background: white; font-size: 0.95rem; cursor: pointer;
transition: all 0.18s; font-family: inherit; line-height: 1.3; text-align: center;
}
.quiz-opt:hover:not(:disabled) { border-color: var(--primary); background: #f0f2ff; }
.quiz-opt.correct { background: #d4edda; border-color: var(--success); color: #155724; font-weight: 700; }
.quiz-opt.wrong { background: #f8d7da; border-color: var(--danger); color: #721c24; }
.quiz-opt:disabled { cursor: default; }
.quiz-feedback { margin: 16px 0 8px; font-size: 1.1rem; font-weight: 700; min-height: 1.8rem; }
.quiz-feedback.correct { color: #0a5e2a; }
.quiz-feedback.wrong { color: #8b0000; }
.quiz-sentence { background: #f8f9ff; border-left: 3px solid var(--primary); border-radius: 0 8px 8px 0; padding: 10px 14px; margin: 10px 0; text-align: left; font-size: 0.88rem; display: none; }
.quiz-nav { display: flex; justify-content: center; gap: 12px; margin-top: 22px; }
.quiz-end { text-align: center; background: white; border-radius: 22px; box-shadow: 0 8px 30px rgba(0,0,0,0.1); padding: 50px 36px; }
.quiz-end .score-big { font-size: 5rem; font-weight: bold; color: var(--primary); }
.quiz-end h2 { font-size: 1.8rem; margin: 10px 0; }
.quiz-end p { color: #555; margin: 8px 0 24px; font-size: 1.05rem; }
.flexBoxIcon {
display: flex;
margin: 25px auto;
justify-content: center;
align-items: center;
gap: 20px;
max-width: 300px;
}
.flexBoxIcon a {
transition: transform 0.2s ease;
}
.flexBoxIcon a:hover {
transform: scale(1.1);
}
.flexBoxIcon img {
width: 36px;
height: 36px;
object-fit: contain;
}
/* ── Empty state ── */
.empty-state { text-align: center; padding: 60px 20px; color: #888; font-size: 1.1rem; grid-column: 1 / -1; }
.empty-state .big-emoji { font-size: 3rem; margin-bottom: 12px; }
/* ── Footer ── */
footer { text-align: center; margin-top: 50px; padding: 22px; color: #777; font-size: 0.88rem; border-top: 1px solid #ddd; }
footer a { color: var(--primary); }
/* ── Responsive ── */
@media (max-width: 768px) {
body { padding: 10px; }
h1 { font-size: 2rem; }
.subtitle { font-size: 1rem; }
.controls { flex-direction: column; align-items: center; gap: 8px; }
.word-grid { grid-template-columns: 1fr; gap: 16px; }
.quiz-options { grid-template-columns: 1fr; }
.quiz-chinese { font-size: 3rem; }
.quiz-card { padding: 24px; }
.flexBoxIcon {
gap: 15px;
margin: 15px auto;
max-width: 250px;
}
.flexBoxIcon img { width: 32px; height: 32px; }
footer { margin-top: 30px; padding: 16px; }
}
@media (max-width: 480px) {
h1 { font-size: 1.8rem; }
.mode-tabs { flex-direction: column; gap: 8px; }
.tab-btn { padding: 8px 20px; font-size: 0.9rem; }
.controls { margin: 6px 0; }
select, input[type="text"] { min-width: 200px; padding: 8px 12px; font-size: 0.9rem; }
.btn { padding: 8px 16px; font-size: 0.9rem; }
.stats { padding: 12px 16px; }
.stats-row { gap: 12px; font-size: 0.9rem; }
.card { padding: 16px; }
.chinese { font-size: 2rem; }
.pinyin { font-size: 1.1rem; }
.meaning { font-size: 1.1rem; }
.quiz-score-bar { padding: 10px 16px; }
.quiz-card { padding: 20px; }
.quiz-chinese { font-size: 2.5rem; }
.quiz-pinyin { font-size: 1.3rem; }
.quiz-opt { padding: 12px 10px; font-size: 0.9rem; }
.quiz-end { padding: 30px 20px; }
.quiz-end .score-big { font-size: 4rem; }
.quiz-end h2 { font-size: 1.5rem; }
.flexBoxIcon {
flex-direction: column;
gap: 10px;
margin: 10px auto;
max-width: 200px;
}
.flexBoxIcon a { display: flex; justify-content: center; }
}
@media (min-width: 769px) and (max-width: 1024px) {
.word-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.quiz-options { grid-template-columns: 1fr 1fr; }
.flexBoxIcon {
gap: 25px;
max-width: 350px;
}
}
/* ── General Mobile Improvements ── */
@media (max-width: 768px) {
.tab-btn, .btn, .quiz-opt { min-height: 44px; } /* iOS touch target size */
.audio-btn { width: 40px; height: 40px; }
.card-actions .btn { min-height: 40px; }
}
/* ── High DPI Displays ── */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
.chinese { font-weight: 600; }
.quiz-chinese { font-weight: 600; }
}
@media (min-width: 1025px) {
.word-grid { grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 24px; }
.flexBoxIcon {
gap: 30px;
max-width: 400px;
}
}
/* ── Large Screens (TVs, 4K Monitors) ── */
@media (min-width: 1440px) {
body { max-width: 1400px; }
h1 { font-size: 3rem; }
.word-grid { grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); gap: 28px; }
.quiz-card { max-width: 800px; margin: 0 auto; }
.quiz-chinese { font-size: 5rem; }
.quiz-pinyin { font-size: 1.8rem; }
.flexBoxIcon {
gap: 35px;
max-width: 450px;
}
}
/* ── Ultra-Wide Screens ── */
@media (min-width: 1920px) {
body { max-width: 1600px; }
.word-grid { grid-template-columns: repeat(auto-fill, minmax(450px, 1fr)); gap: 32px; }
.quiz-card { max-width: 900px; }
.quiz-options { grid-template-columns: repeat(3, 1fr); }
}
/* ── Orientation-Specific Adjustments ── */
@media (max-width: 768px) and (orientation: landscape) {
h1 { font-size: 1.5rem; }
.subtitle { font-size: 0.9rem; }
.card { padding: 14px; }
.chinese { font-size: 1.8rem; }
.pinyin { font-size: 1rem; }
.quiz-card { padding: 18px; }
.quiz-chinese { font-size: 2.2rem; }
.quiz-pinyin { font-size: 1.1rem; }
.flexBoxIcon {
flex-direction: row;
justify-content: center;
gap: 20px;
margin: 10px auto;
max-width: 250px;
}
.flexBoxIcon img { width: 28px; height: 28px; }
}
/* ── Touch Device Optimizations ── */
@media (hover: none) and (pointer: coarse) {
.card:hover { transform: none; box-shadow: var(--card-shadow); }
.btn:hover { opacity: 1; transform: none; }
.audio-btn:hover { transform: none; }
.quiz-opt:hover:not(:disabled) { border-color: #e0e0e0; background: white; }
}