471 lines
8.9 KiB
CSS
471 lines
8.9 KiB
CSS
/* ===== Custom properties ===== */
|
|
:root {
|
|
--accent: #2563EB;
|
|
--accent-light: #EFF6FF;
|
|
--bg: #F8FAFC;
|
|
--surface: #FFFFFF;
|
|
--text: #0F172A;
|
|
--text-muted: #64748B;
|
|
--border: #E2E8F0;
|
|
--correct-bg: #DCFCE7;
|
|
--correct-text: #166534;
|
|
--correct-border:#16A34A;
|
|
--wrong-bg: #FEE2E2;
|
|
--wrong-text: #991B1B;
|
|
--wrong-border: #DC2626;
|
|
--shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
|
|
--radius: 12px;
|
|
--radius-sm: 8px;
|
|
}
|
|
|
|
@media (prefers-color-scheme: dark) {
|
|
:root {
|
|
--bg: #0F172A;
|
|
--surface: #1E293B;
|
|
--text: #F1F5F9;
|
|
--text-muted: #94A3B8;
|
|
--border: #334155;
|
|
--accent-light: #1E3A5F;
|
|
--correct-bg: #14532D;
|
|
--correct-text: #86EFAC;
|
|
--correct-border:#16A34A;
|
|
--wrong-bg: #450A0A;
|
|
--wrong-text: #FCA5A5;
|
|
--wrong-border: #DC2626;
|
|
--shadow: 0 1px 3px rgba(0,0,0,.4);
|
|
}
|
|
}
|
|
|
|
/* ===== Reset & base ===== */
|
|
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
|
|
|
|
body {
|
|
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
|
background: var(--bg);
|
|
color: var(--text);
|
|
font-size: 16px;
|
|
line-height: 1.6;
|
|
-webkit-font-smoothing: antialiased;
|
|
}
|
|
|
|
button {
|
|
font-family: inherit;
|
|
font-size: inherit;
|
|
cursor: pointer;
|
|
border: none;
|
|
background: none;
|
|
}
|
|
|
|
/* ===== Layout ===== */
|
|
.quiz-wrap {
|
|
max-width: 640px;
|
|
margin: 0 auto;
|
|
padding: 0 1rem;
|
|
}
|
|
|
|
.screen { display: none; }
|
|
.screen.active { display: block; }
|
|
|
|
/* ===== Language screen ===== */
|
|
.lang-screen {
|
|
text-align: center;
|
|
padding: 3rem 0;
|
|
}
|
|
|
|
.lang-screen h2 {
|
|
font-size: 1.25rem;
|
|
font-weight: 600;
|
|
margin-bottom: 0.5rem;
|
|
}
|
|
|
|
.lang-screen p {
|
|
color: var(--text-muted);
|
|
margin-bottom: 2rem;
|
|
}
|
|
|
|
.lang-grid {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 0.75rem;
|
|
max-width: 280px;
|
|
margin: 0 auto;
|
|
}
|
|
|
|
.lang-btn {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
gap: 0.5rem;
|
|
min-height: 52px;
|
|
padding: 0.75rem 1.5rem;
|
|
border: 2px solid var(--border);
|
|
border-radius: var(--radius);
|
|
background: var(--surface);
|
|
color: var(--text);
|
|
font-size: 1rem;
|
|
font-weight: 500;
|
|
box-shadow: var(--shadow);
|
|
transition: border-color .15s, background .15s;
|
|
}
|
|
|
|
.lang-btn:hover {
|
|
border-color: var(--accent);
|
|
background: var(--accent-light);
|
|
color: var(--accent);
|
|
}
|
|
|
|
/* ===== Start screen ===== */
|
|
.start-screen {
|
|
text-align: center;
|
|
padding: 2.5rem 0;
|
|
}
|
|
|
|
.start-screen h2 {
|
|
font-size: 1.375rem;
|
|
font-weight: 700;
|
|
margin-bottom: 0.375rem;
|
|
}
|
|
|
|
.start-screen > p {
|
|
color: var(--text-muted);
|
|
margin-bottom: 2rem;
|
|
}
|
|
|
|
.count-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(5, 1fr);
|
|
gap: 0.625rem;
|
|
margin-bottom: 2rem;
|
|
max-width: 480px;
|
|
margin-left: auto;
|
|
margin-right: auto;
|
|
}
|
|
|
|
@media (max-width: 480px) {
|
|
.count-grid {
|
|
grid-template-columns: repeat(3, 1fr);
|
|
max-width: 320px;
|
|
}
|
|
}
|
|
|
|
.count-btn {
|
|
min-height: 52px;
|
|
padding: 0.75rem 0.5rem;
|
|
border: 2px solid var(--border);
|
|
border-radius: var(--radius-sm);
|
|
background: var(--surface);
|
|
color: var(--text);
|
|
font-size: 1rem;
|
|
font-weight: 600;
|
|
box-shadow: var(--shadow);
|
|
transition: border-color .15s, background .15s, color .15s;
|
|
}
|
|
|
|
.count-btn:hover:not(:disabled) {
|
|
border-color: var(--accent);
|
|
background: var(--accent-light);
|
|
color: var(--accent);
|
|
}
|
|
|
|
.count-btn.selected {
|
|
border-color: var(--accent);
|
|
background: var(--accent-light);
|
|
color: var(--accent);
|
|
}
|
|
|
|
.count-btn:disabled {
|
|
opacity: .35;
|
|
cursor: not-allowed;
|
|
}
|
|
|
|
.start-btn {
|
|
min-height: 52px;
|
|
min-width: 140px;
|
|
padding: 0.75rem 2rem;
|
|
border-radius: var(--radius);
|
|
background: var(--accent);
|
|
color: #fff;
|
|
font-size: 1rem;
|
|
font-weight: 600;
|
|
box-shadow: var(--shadow);
|
|
transition: opacity .15s;
|
|
}
|
|
|
|
.start-btn:disabled {
|
|
opacity: .4;
|
|
cursor: not-allowed;
|
|
}
|
|
|
|
.start-btn:not(:disabled):hover {
|
|
opacity: .9;
|
|
}
|
|
|
|
/* ===== Quiz screen ===== */
|
|
.quiz-screen {
|
|
padding: 1.5rem 0 2rem;
|
|
}
|
|
|
|
.progress-bar-bg {
|
|
height: 4px;
|
|
background: var(--border);
|
|
border-radius: 2px;
|
|
margin-bottom: 1.5rem;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.progress-bar-fill {
|
|
height: 4px;
|
|
background: var(--accent);
|
|
border-radius: 2px;
|
|
transition: width 0.3s ease;
|
|
}
|
|
|
|
.question-meta {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
font-size: 0.8125rem;
|
|
color: var(--text-muted);
|
|
margin-bottom: 0.75rem;
|
|
font-variant-numeric: tabular-nums;
|
|
}
|
|
|
|
.question-text {
|
|
font-size: 1rem;
|
|
line-height: 1.65;
|
|
font-weight: 500;
|
|
color: var(--text);
|
|
margin-bottom: 1.25rem;
|
|
}
|
|
|
|
/* ===== Answer options ===== */
|
|
.options-list {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 0.5rem;
|
|
margin-bottom: 0.25rem;
|
|
}
|
|
|
|
.option-btn {
|
|
display: flex;
|
|
align-items: flex-start;
|
|
gap: 0.625rem;
|
|
width: 100%;
|
|
min-height: 52px;
|
|
padding: 0.75rem 1rem;
|
|
border: 2px solid var(--border);
|
|
border-radius: var(--radius);
|
|
background: var(--surface);
|
|
color: var(--text);
|
|
font-size: 0.9375rem;
|
|
line-height: 1.5;
|
|
text-align: left;
|
|
box-shadow: var(--shadow);
|
|
transition: border-color .15s, background .15s;
|
|
}
|
|
|
|
.option-btn .opt-letter {
|
|
flex-shrink: 0;
|
|
font-weight: 700;
|
|
color: var(--text-muted);
|
|
min-width: 1.25rem;
|
|
transition: color .15s;
|
|
}
|
|
|
|
.option-btn:hover:not(:disabled) {
|
|
border-color: var(--accent);
|
|
background: var(--accent-light);
|
|
}
|
|
|
|
.option-btn:hover:not(:disabled) .opt-letter {
|
|
color: var(--accent);
|
|
}
|
|
|
|
.option-btn.correct {
|
|
border-color: var(--correct-border);
|
|
background: var(--correct-bg);
|
|
color: var(--correct-text);
|
|
}
|
|
|
|
.option-btn.correct .opt-letter { color: var(--correct-text); }
|
|
|
|
.option-btn.wrong {
|
|
border-color: var(--wrong-border);
|
|
background: var(--wrong-bg);
|
|
color: var(--wrong-text);
|
|
}
|
|
|
|
.option-btn.wrong .opt-letter { color: var(--wrong-text); }
|
|
|
|
.option-btn:disabled { cursor: default; }
|
|
|
|
/* ===== Explanation ===== */
|
|
.explanation-box {
|
|
margin-top: 1.25rem;
|
|
padding: 1rem 1.125rem;
|
|
border-radius: var(--radius);
|
|
background: var(--surface);
|
|
border: 1px solid var(--border);
|
|
box-shadow: var(--shadow);
|
|
}
|
|
|
|
.explanation-source {
|
|
font-size: 0.75rem;
|
|
color: var(--text-muted);
|
|
margin-bottom: 0.5rem;
|
|
font-weight: 500;
|
|
letter-spacing: .02em;
|
|
}
|
|
|
|
.explanation-label {
|
|
font-size: 0.6875rem;
|
|
font-weight: 700;
|
|
color: var(--text-muted);
|
|
text-transform: uppercase;
|
|
letter-spacing: .07em;
|
|
margin-bottom: 0.625rem;
|
|
}
|
|
|
|
.explanation-box p {
|
|
font-size: 0.875rem;
|
|
line-height: 1.6;
|
|
color: var(--text);
|
|
margin-bottom: 0.5rem;
|
|
}
|
|
|
|
.explanation-box p:last-child { margin-bottom: 0; }
|
|
|
|
.next-btn {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
margin-top: 1.25rem;
|
|
min-height: 44px;
|
|
padding: 0.625rem 1.5rem;
|
|
border-radius: var(--radius);
|
|
background: var(--accent);
|
|
color: #fff;
|
|
font-size: 0.9375rem;
|
|
font-weight: 600;
|
|
box-shadow: var(--shadow);
|
|
transition: opacity .15s;
|
|
}
|
|
|
|
.next-btn:hover { opacity: .9; }
|
|
|
|
/* ===== Result screen ===== */
|
|
.result-screen {
|
|
text-align: center;
|
|
padding: 2rem 0;
|
|
}
|
|
|
|
.score-circle {
|
|
width: 120px;
|
|
height: 120px;
|
|
border-radius: 50%;
|
|
margin: 0 auto 1.25rem;
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
justify-content: center;
|
|
font-size: 2rem;
|
|
font-weight: 800;
|
|
line-height: 1;
|
|
box-shadow: var(--shadow);
|
|
}
|
|
|
|
.score-circle span {
|
|
font-size: 0.75rem;
|
|
font-weight: 500;
|
|
margin-top: 0.25rem;
|
|
opacity: .8;
|
|
}
|
|
|
|
.score-pass { background: var(--correct-bg); color: var(--correct-text); }
|
|
.score-fail { background: var(--wrong-bg); color: var(--wrong-text); }
|
|
|
|
.result-label {
|
|
font-size: 1.375rem;
|
|
font-weight: 700;
|
|
margin-bottom: 0.375rem;
|
|
}
|
|
|
|
.result-sub {
|
|
color: var(--text-muted);
|
|
font-size: 0.9375rem;
|
|
margin-bottom: 2rem;
|
|
}
|
|
|
|
.result-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(3, 1fr);
|
|
gap: 0.75rem;
|
|
max-width: 380px;
|
|
margin: 0 auto 2rem;
|
|
}
|
|
|
|
.result-stat {
|
|
background: var(--surface);
|
|
border: 1px solid var(--border);
|
|
border-radius: var(--radius);
|
|
padding: 1rem 0.75rem;
|
|
box-shadow: var(--shadow);
|
|
}
|
|
|
|
.result-stat-val {
|
|
font-size: 1.5rem;
|
|
font-weight: 700;
|
|
line-height: 1.1;
|
|
margin-bottom: 0.25rem;
|
|
}
|
|
|
|
.result-stat-lbl {
|
|
font-size: 0.75rem;
|
|
color: var(--text-muted);
|
|
font-weight: 500;
|
|
}
|
|
|
|
.result-actions {
|
|
display: flex;
|
|
gap: 0.75rem;
|
|
justify-content: center;
|
|
flex-wrap: wrap;
|
|
}
|
|
|
|
.result-actions button {
|
|
min-height: 48px;
|
|
min-width: 44px;
|
|
padding: 0.625rem 1.375rem;
|
|
border-radius: var(--radius);
|
|
font-size: 0.9375rem;
|
|
font-weight: 600;
|
|
box-shadow: var(--shadow);
|
|
transition: opacity .15s;
|
|
}
|
|
|
|
.result-actions button:first-child {
|
|
background: var(--surface);
|
|
border: 2px solid var(--border);
|
|
color: var(--text);
|
|
}
|
|
|
|
.result-actions button:first-child:hover {
|
|
border-color: var(--accent);
|
|
color: var(--accent);
|
|
}
|
|
|
|
#retry-btn {
|
|
background: var(--accent);
|
|
color: #fff;
|
|
}
|
|
|
|
#retry-btn:hover { opacity: .9; }
|
|
|
|
/* ===== Accessibility ===== */
|
|
.sr-only {
|
|
position: absolute;
|
|
width: 1px;
|
|
height: 1px;
|
|
overflow: hidden;
|
|
clip: rect(0,0,0,0);
|
|
white-space: nowrap;
|
|
}
|