:root {
  --primary: #15857A;
  --primary-light: #E6F4F2;
  --primary-dark: #0F6B62;
  --bg: #f8f9fa;
  --card: #ffffff;
  --text: #1a1a1a;
  --muted: #6b7280;
  --border: #e5e7eb;
  --success: #16a34a;
  --warning: #d97706;
  --error: #dc2626;
  --accent: #F59E0B;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --radius: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}
.app { max-width: 760px; margin: 0 auto; min-height: 100vh; background: var(--card); }

/* ===== Top Nav Bar ===== */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; background: var(--card); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.topbar .logo { font-size: 18px; font-weight: 800; color: var(--primary-dark); text-decoration: none; }
.topbar .nav-links { display: flex; gap: 16px; align-items: center; }
.topbar .nav-links a { color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500; transition: color .15s; }
.topbar .nav-links a:hover { color: var(--primary); }
.topbar .nav-links a.active { color: var(--primary-dark); font-weight: 600; }
.topbar .user-info { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.topbar .btn-logout { padding: 4px 12px; background: transparent; color: var(--error); border: 1px solid var(--error); border-radius: 16px; font-size: 13px; cursor: pointer; }

/* ===== Login ===== */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--primary-light); padding: 20px; }
.login-card { background: white; border-radius: 20px; padding: 40px 32px; max-width: 380px; width: 100%; box-shadow: 0 8px 32px rgba(21,133,122,0.12); }
.login-card .logo-area { text-align: center; margin-bottom: 28px; }
.login-card .logo-area .icon { font-size: 48px; }
.login-card .logo-area h1 { font-size: 22px; font-weight: 800; color: var(--primary-dark); margin-top: 8px; }
.login-card .logo-area p { font-size: 14px; color: var(--muted); margin-top: 4px; }
.login-card .form-group { margin-bottom: 16px; }
.login-card .form-group label { display: block; font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.login-card .form-group input { width: 100%; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 10px; font-size: 16px; font-family: inherit; background: white; transition: border-color .2s; }
.login-card .form-group input:focus { outline: none; border-color: var(--primary); }
.login-card .btn-login { width: 100%; padding: 14px; background: var(--primary); color: white; border: none; border-radius: 30px; font-size: 16px; font-weight: 600; cursor: pointer; box-shadow: 0 4px 14px rgba(21,133,122,0.3); transition: transform .15s; margin-top: 8px; }
.login-card .btn-login:active { transform: scale(0.98); }
.login-card .btn-login:disabled { background: #ccc; box-shadow: none; cursor: not-allowed; }
.login-card .error-msg { color: var(--error); font-size: 14px; text-align: center; margin-top: 12px; min-height: 20px; }
.login-card .contact-hint { text-align: center; font-size: 13px; color: var(--muted); margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }

/* ===== Dashboard ===== */
.dashboard { padding: 20px; }
.section-title { font-size: 20px; font-weight: 700; color: var(--primary-dark); margin-bottom: 16px; }

/* ===== Student Profile Card ===== */
.profile-card { margin-bottom: 24px; }
.profile-display {
  display: flex; align-items: center; gap: 14px;
  background: var(--primary-light); border: 1px solid #c3e0dc;
  border-radius: var(--radius); padding: 16px 20px;
}
.profile-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: white; display: flex; align-items: center; justify-content: center;
  font-size: 26px; flex-shrink: 0;
}
.profile-info { flex: 1; }
.profile-name { font-size: 18px; font-weight: 700; color: var(--primary-dark); }
.profile-meta { font-size: 14px; color: var(--muted); margin-top: 2px; }
.btn-edit-profile {
  padding: 6px 16px; background: white; color: var(--primary);
  border: 1.5px solid var(--primary); border-radius: 20px;
  font-size: 14px; font-weight: 600; cursor: pointer; transition: all .15s;
}
.btn-edit-profile:active { transform: scale(0.96); }
.profile-form {
  background: var(--primary-light); border: 1px solid #c3e0dc;
  border-radius: var(--radius); padding: 18px 20px;
}
.profile-form-title { font-size: 16px; font-weight: 700; color: var(--primary-dark); margin-bottom: 14px; }
.profile-form-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.profile-field { flex: 1; min-width: 120px; }
.profile-field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.profile-field input {
  width: 100%; padding: 10px 14px; border: 1.5px solid var(--border);
  border-radius: 10px; font-size: 16px; background: white;
}
.profile-field input:focus { outline: none; border-color: var(--primary); }
.btn-save-profile {
  padding: 10px 24px; background: var(--primary); color: white;
  border: none; border-radius: 10px; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: all .15s; white-space: nowrap;
}
.btn-save-profile:active { transform: scale(0.96); }
@media (max-width: 480px) {
  .profile-form-row { flex-direction: column; align-items: stretch; }
  .btn-save-profile { width: 100%; }
}
.test-card { background: white; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 12px; transition: box-shadow .2s; cursor: pointer; }
.test-card:hover { box-shadow: var(--shadow); }
.test-card .card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.test-card .card-badge { display: inline-block; padding: 3px 10px; background: var(--primary-light); color: var(--primary-dark); border-radius: 12px; font-size: 12px; font-weight: 600; }
.test-card .card-title { font-size: 18px; font-weight: 700; color: var(--text); margin: 6px 0 4px; }
.test-card .card-subtitle { font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.test-card .card-parts { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; }
.test-card .chip-sm { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; background: var(--primary-light); border-radius: 8px; font-size: 16px; color: var(--primary-dark); font-weight: 700; }
.test-card .card-footer { display: flex; justify-content: space-between; align-items: center; padding-top: 12px; border-top: 1px solid var(--border); }
.test-card .card-status { font-size: 14px; font-weight: 600; }
.test-card .card-status.done { color: var(--success); }
.test-card .card-status.pending { color: var(--accent); }
.test-card .btn-start { padding: 8px 20px; background: var(--primary); color: white; border: none; border-radius: 20px; font-size: 14px; font-weight: 600; cursor: pointer; }
.test-card .btn-start:disabled { background: #ccc; cursor: not-allowed; }
.test-card .btn-report { padding: 8px 16px; background: white; color: var(--primary-dark); border: 1.5px solid var(--primary); border-radius: 20px; font-size: 14px; font-weight: 600; cursor: pointer; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 15px; }

/* ===== Cover (test page) ===== */
.cover { padding: 40px 28px 36px; text-align: center; }
.cover .badge { display: inline-block; padding: 6px 14px; background: var(--primary-light); color: var(--primary-dark); border-radius: 20px; font-size: 13px; letter-spacing: 1px; font-weight: 600; margin-bottom: 16px; }
.cover h1 { font-size: 30px; font-weight: 800; color: var(--primary-dark); margin-bottom: 4px; letter-spacing: 1px; }
.cover .subtitle { font-size: 16px; color: var(--muted); margin-bottom: 24px; }
.cover .parts-box { background: var(--primary-light); border-radius: var(--radius); padding: 16px; margin: 0 0 24px; }
.cover .parts-box .label { font-size: 13px; color: var(--primary-dark); font-weight: 600; margin-bottom: 8px; }
.cover .parts-box .chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.cover .parts-box .chip { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; background: white; border-radius: 10px; font-size: 20px; color: var(--primary-dark); font-weight: 700; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.student-info { text-align: left; max-width: 400px; margin: 0 auto 24px; background: #fafafa; padding: 18px 20px; border-radius: var(--radius); border: 1px solid var(--border); }
.student-info label { display: block; font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.student-info input, .student-info select { width: 100%; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 15px; font-family: inherit; background: white; margin-bottom: 12px; transition: border-color .2s; }
.student-info input:focus, .student-info select:focus { outline: none; border-color: var(--primary); }
.student-info-display { display: flex; gap: 20px; margin-bottom: 14px; }
.si-item { display: flex; flex-direction: column; gap: 2px; }
.si-label { font-size: 13px; color: var(--muted); }
.si-value { font-size: 17px; font-weight: 600; color: var(--primary-dark); }
.cover .info-list { text-align: left; max-width: 480px; margin: 0 auto 24px; }
.cover .info-item { display: flex; gap: 12px; padding: 6px 0; font-size: 14px; color: #4b5563; }
.cover .info-item .ico { width: 22px; height: 22px; flex-shrink: 0; background: var(--primary); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.btn-primary { display: inline-block; padding: 14px 48px; background: var(--primary); color: white; border: none; border-radius: 30px; font-size: 17px; font-weight: 600; cursor: pointer; box-shadow: 0 4px 14px rgba(21,133,122,0.3); transition: transform .15s; }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { background: #ccc; box-shadow: none; cursor: not-allowed; }

/* ===== Progress bar ===== */
.progress-bar { position: sticky; top: 0; z-index: 10; background: var(--card); padding: 12px 20px 10px; border-bottom: 1px solid var(--border); }
.progress-track { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary) 0%, var(--primary-dark) 100%); border-radius: 3px; transition: width .3s ease; }
.progress-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 5px; }

/* ===== Section ===== */
.section { padding: 24px 20px 32px; display: none; }
.section.active { display: block; }
.section .dim-title { font-size: 20px; font-weight: 700; color: var(--primary-dark); margin-bottom: 2px; }
.section .dim-meta { font-size: 13px; color: var(--muted); margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px dashed var(--border); }
.q { margin-bottom: 24px; }
.q .q-num { display: inline-block; width: 26px; height: 26px; background: var(--primary); color: white; border-radius: 50%; text-align: center; line-height: 26px; font-size: 13px; font-weight: 700; margin-right: 8px; vertical-align: middle; flex-shrink: 0; }
.q .q-text { font-size: 17px; color: var(--text); display: inline; vertical-align: middle; font-weight: 500; }
.q .q-hint { font-size: 13px; color: var(--muted); margin: 4px 0 12px 36px; }

/* Char grid */
.char-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 12px 36px; max-width: 480px; }
.char-cell { aspect-ratio: 1.4/1; display: flex; align-items: center; justify-content: center; background: white; border: 2px solid var(--border); border-radius: 10px; font-size: 24px; font-weight: 600; color: var(--text); cursor: pointer; transition: all .12s; user-select: none; }
.char-cell:hover { border-color: var(--primary); }
.char-cell.selected { background: var(--primary); color: white; border-color: var(--primary); transform: scale(1.04); }
.char-cell.wrong-flash { background: #fee; border-color: var(--error); animation: shake .35s; }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-3px)} 75%{transform:translateX(3px)} }

/* Multiple choice */
.choices { margin: 0 0 12px 36px; display: flex; flex-direction: column; gap: 6px; max-width: 540px; }
.choice { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: white; border: 2px solid var(--border); border-radius: 10px; cursor: pointer; transition: all .12s; }
.choice:hover { border-color: var(--primary); }
.choice.selected { background: var(--primary-light); border-color: var(--primary); }
.choice .radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--muted); flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.choice.selected .radio { border-color: var(--primary); background: var(--primary); }
.choice.selected .radio::after { content: ""; width: 8px; height: 8px; background: white; border-radius: 50%; }
.choice .text { font-size: 15px; }

/* Audio recording */
.record-block { margin: 0 0 12px 36px; padding: 16px 18px; background: #fafafa; border-radius: var(--radius); border: 1px solid var(--border); }
.record-btn { padding: 10px 20px; background: white; color: var(--error); border: 2px solid var(--error); border-radius: 30px; font-size: 14px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; transition: all .15s; }
.record-btn.recording { background: var(--error); color: white; }
.record-btn .dot { width: 10px; height: 10px; background: var(--error); border-radius: 50%; }
.record-btn.recording .dot { background: white; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: 0.4; } }
.record-timer { font-size: 14px; color: var(--muted); margin-left: 10px; }
.audio-playback { margin-top: 10px; }
.audio-playback audio { width: 100%; height: 36px; }
.parent-rate { margin-top: 14px; }
.parent-rate .pr-label { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.parent-rate .pr-options { display: flex; flex-wrap: wrap; gap: 6px; }
.pr-opt { padding: 5px 12px; background: white; border: 1.5px solid var(--border); border-radius: 20px; font-size: 13px; cursor: pointer; transition: all .12s; }
.pr-opt.active { background: var(--primary); color: white; border-color: var(--primary); }
.pr-opt-col { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.num-input { width: 60px; padding: 4px 6px; border: 1px solid #ccc; border-radius: 6px; font-size: 14px; }

/* Dictation */
.dict-block { margin: 0 0 14px 36px; padding: 14px 16px; background: #fcfcfc; border-radius: 10px; border-left: 4px solid var(--primary); }
.dict-block .word { font-size: 22px; font-weight: 700; color: var(--text); margin-bottom: 6px; letter-spacing: 2px; }
.dict-block .play-btn { padding: 3px 10px; background: var(--primary-light); color: var(--primary-dark); border: none; border-radius: 14px; font-size: 12px; cursor: pointer; margin-left: 6px; }
.dict-block .label { font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
.err-types { display: flex; flex-wrap: wrap; gap: 4px; }
.err-type { padding: 4px 10px; background: white; border: 1.5px solid var(--border); border-radius: 14px; font-size: 12px; cursor: pointer; transition: all .12s; }
.err-type.active { background: var(--error); color: white; border-color: var(--error); }
.err-type.correct.active { background: var(--success); border-color: var(--success); }

/* Text input */
.text-input { margin: 0 0 12px 36px; }
.text-input textarea { width: 100%; min-height: 70px; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 10px; font-size: 14px; font-family: inherit; resize: vertical; }
.text-input textarea:focus { outline: none; border-color: var(--primary); }

/* Passage */
.passage { margin: 0 0 14px 36px; padding: 16px 18px; background: var(--primary-light); border-radius: var(--radius); font-size: 18px; line-height: 2; color: var(--text); letter-spacing: 0.5px; }
.passage .hl { color: var(--primary-dark); font-weight: 700; }

/* Poem */
.poem { margin: 0 0 14px 36px; padding: 16px 20px; background: #fff8ec; border-left: 4px solid var(--accent); border-radius: 8px; font-size: 18px; line-height: 2; letter-spacing: 1px; }
.poem .title { font-size: 13px; color: var(--muted); margin-bottom: 6px; letter-spacing: 0; }

/* Nav */
.nav { display: flex; justify-content: space-between; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); gap: 10px; }
.btn { padding: 9px 20px; border: none; border-radius: 24px; font-size: 14px; font-weight: 600; cursor: pointer; transition: all .12s; }
.btn-back { background: white; color: var(--muted); border: 1.5px solid var(--border); }
.btn-back:disabled { color: #ccc; border-color: #eee; cursor: not-allowed; }
.btn-next { background: var(--primary); color: white; }
.btn-next:disabled { background: #ccc; cursor: not-allowed; }
.btn-next.final { background: var(--success); }

/* ===== Results ===== */
.results { padding: 28px 20px; display: none; }
.results.active { display: block; }
.results .res-header { text-align: center; margin-bottom: 20px; }
.results .res-header h2 { font-size: 24px; font-weight: 800; color: var(--primary-dark); }
.results .res-header .res-sub { font-size: 13px; color: var(--muted); }
.results .res-header .res-student { font-size: 14px; color: var(--text); margin-top: 4px; }
.radar-wrap { display: flex; justify-content: center; margin: 0 auto 24px; }
.score-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 20px; }
.score-table th, .score-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); }
.score-table th { background: var(--primary-light); color: var(--primary-dark); font-weight: 600; font-size: 12px; }
.error-pattern { background: #fef9f3; border: 1px solid #ffe4c4; border-radius: var(--radius); padding: 14px 18px; margin-bottom: 20px; }
.error-pattern h3 { font-size: 15px; color: var(--warning); margin-bottom: 8px; }
.error-pattern .ep-row { display: flex; justify-content: space-between; padding: 3px 0; font-size: 13px; }
.error-pattern .ep-row .count { color: var(--error); font-weight: 700; }
.reco { background: var(--primary-light); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 20px; }
.reco h3 { font-size: 15px; color: var(--primary-dark); margin-bottom: 8px; }
.reco p { font-size: 14px; color: #374151; line-height: 1.7; }
.reco p b { color: var(--primary-dark); }
.export-row { text-align: center; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.btn-export { padding: 10px 22px; background: white; color: var(--primary-dark); border: 2px solid var(--primary); border-radius: 24px; font-size: 14px; font-weight: 600; cursor: pointer; }
.btn-restart { padding: 10px 22px; background: white; color: var(--muted); border: 1.5px solid var(--border); border-radius: 24px; font-size: 14px; cursor: pointer; }

/* Toast */
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,0.78); color: white; padding: 10px 18px; border-radius: 22px; font-size: 14px; z-index: 999; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: 90%; text-align: center; }
.toast.show { opacity: 1; }

/* Validation */
.validation-summary { background: #fef2f2; border: 1px solid #fecaca; border-radius: var(--radius); padding: 14px 18px; margin: 16px 0 0 36px; display: none; }
.validation-summary.show { display: block; }
.validation-summary h4 { color: var(--error); font-size: 14px; margin-bottom: 8px; }
.validation-summary .val-group { margin-bottom: 10px; }
.validation-summary .val-group:last-child { margin-bottom: 0; }
.validation-summary .val-group-title { font-size: 13px; font-weight: 600; color: #991b1b; margin-bottom: 4px; }
.validation-summary ul { margin-left: 16px; font-size: 13px; color: #991b1b; list-style: disc; }
.validation-summary .val-item { padding: 3px 4px; cursor: pointer; border-radius: 4px; transition: background .12s; }
.validation-summary .val-item:hover { background: #fee2e2; color: #7f1d1d; }
.validation-summary .val-hint { font-size: 12px; color: #9ca3af; margin-top: 8px; }

/* Speech comparison */
.speech-compare { margin: 0 0 14px 36px; padding: 14px 16px; background: #f0f7ff; border-radius: var(--radius); border: 1px solid #c7e0ff; }
.sc-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.sc-label { font-size: 14px; font-weight: 600; color: #1e40af; }
.sc-tip { font-size: 12px; color: #6b7280; margin-bottom: 10px; }
.sc-btn { padding: 6px 16px; background: white; color: #2563eb; border: 1.5px solid #2563eb; border-radius: 20px; font-size: 13px; font-weight: 600; cursor: pointer; transition: all .12s; }
.sc-btn.recording { background: #2563eb; color: white; }
.sc-btn:disabled { opacity: 0.5; cursor: not-allowed; border-color: #9ca3af; color: #9ca3af; }
.sc-btn:disabled.loading { opacity: 0.8; }
.sc-btn:active:not(:disabled) { transform: scale(0.97); }
.sc-status { font-size: 13px; color: #374151; margin: 8px 0; padding: 8px 10px; background: white; border-radius: 8px; min-height: 20px; }
.sc-result { margin-top: 10px; }
.sc-acc-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.sc-acc-label { font-size: 14px; font-weight: 600; color: #374151; }
.sc-acc-value { font-size: 28px; font-weight: 800; }
.sc-acc-detail { font-size: 12px; color: #6b7280; }
.sc-diff { margin-top: 6px; }
.sc-diff-label { font-size: 12px; color: #6b7280; margin-bottom: 4px; }
.sc-diff-content { font-size: 17px; line-height: 2; letter-spacing: 1px; padding: 10px 12px; background: white; border-radius: 8px; word-break: break-all; }
.diff-ok { color: #16a34a; }
.diff-miss { color: #dc2626; text-decoration: line-through; }
.diff-extra { color: #d97706; font-style: italic; }
.sc-manual { margin-top: 10px; padding-top: 10px; border-top: 1px dashed #c7e0ff; }
.sc-manual-label { font-size: 12px; color: #6b7280; margin-bottom: 4px; }
.sc-manual textarea { width: 100%; min-height: 60px; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 14px; font-family: inherit; resize: vertical; }
.sc-manual textarea:focus { outline: none; border-color: #2563eb; }
.sc-manual-btn { margin-top: 6px; padding: 5px 14px; background: #2563eb; color: white; border: none; border-radius: 16px; font-size: 12px; font-weight: 600; cursor: pointer; }
.sc-manual-btn:active { transform: scale(0.97); }

/* Evaluation criteria table */
.eval-criteria { margin-bottom: 24px; }
.eval-criteria h3 { font-size: 16px; color: var(--primary-dark); margin-bottom: 12px; }
.eval-table { width: 100%; border-collapse: collapse; font-size: 14px; background: white; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.eval-table th { background: var(--primary-light); color: var(--primary-dark); font-weight: 600; font-size: 13px; padding: 10px 12px; text-align: left; }
.eval-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; line-height: 1.6; }
.eval-table tr:last-child td { border-bottom: none; }
.eval-table .dim-name { font-weight: 600; color: var(--primary-dark); white-space: nowrap; }
.eval-table .score-cell { text-align: center; font-weight: 700; white-space: nowrap; }
.eval-table .level-cell { text-align: center; white-space: nowrap; font-weight: 600; }
.eval-table .desc-cell { color: #374151; font-size: 13px; }
.eval-table tr.level-2 .level-cell { color: var(--success); }
.eval-table tr.level-1 .level-cell { color: var(--warning); }
.eval-table tr.level-0 .level-cell { color: var(--error); }
.eval-table tr.level-2 { background: #f0fdf4; }
.eval-table tr.level-1 { background: #fffbeb; }
.eval-table tr.level-0 { background: #fef2f2; }

/* ===== Admin ===== */
.admin-page { max-width: 960px; margin: 0 auto; padding: 20px; }
.admin-tabs { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 2px solid var(--border); }
.admin-tab { padding: 10px 20px; font-size: 15px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all .15s; }
.admin-tab.active { color: var(--primary-dark); border-bottom-color: var(--primary); }
.admin-panel { display: none; }
.admin-panel.active { display: block; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat-card { background: white; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; }
.stat-card .stat-value { font-size: 28px; font-weight: 800; color: var(--primary-dark); }
.stat-card .stat-label { font-size: 13px; color: var(--muted); margin-top: 2px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; background: white; border-radius: var(--radius); overflow: hidden; }
.data-table th { background: var(--primary-light); color: var(--primary-dark); font-weight: 600; font-size: 13px; padding: 10px 12px; text-align: left; }
.data-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); }
.data-table tr:hover { background: #f9fafb; }
.badge-sm { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; }
.badge-sm.green { background: #dcfce7; color: #166534; }
.badge-sm.red { background: #fee2e2; color: #991b1b; }
.badge-sm.gray { background: #f3f4f6; color: #4b5563; }
.badge-sm.blue { background: #dbeafe; color: #1e40af; }
.btn-sm { padding: 4px 12px; border: none; border-radius: 14px; font-size: 12px; font-weight: 600; cursor: pointer; }
.btn-sm.primary { background: var(--primary); color: white; }
.btn-sm.danger { background: var(--error); color: white; }
.btn-sm.outline { background: white; color: var(--primary-dark); border: 1px solid var(--primary); }
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 200; align-items: center; justify-content: center; }
.modal-overlay.show { display: flex; }
.modal { background: white; border-radius: 16px; padding: 28px; max-width: 440px; width: 90%; max-height: 80vh; overflow-y: auto; }
.modal h3 { font-size: 18px; font-weight: 700; color: var(--primary-dark); margin-bottom: 16px; }
.modal .form-group { margin-bottom: 14px; }
.modal .form-group label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.modal .form-group input, .modal .form-group select { width: 100%; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 15px; font-family: inherit; }
.modal .modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }

@media (max-width: 480px) {
  .cover { padding: 24px 16px 28px; }
  .cover h1 { font-size: 24px; }
  .char-grid { grid-template-columns: repeat(3, 1fr); margin-left: 0; }
  .choices, .record-block, .dict-block, .text-input, .passage, .poem, .validation-summary, .speech-compare { margin-left: 0; }
  .q .q-hint { margin-left: 0; }
  .q .q-text { font-size: 15px; }
  .section { padding: 16px 14px 24px; }
  .student-info-display { flex-direction: column; gap: 12px; }
  .nav { flex-wrap: wrap; }
  .nav .btn { flex: 1; text-align: center; min-width: 80px; }
  .progress-bar { padding: 10px 14px; }
  .score-table { font-size: 12px; }
  .score-table th, .score-table td { padding: 5px 6px; }
  .radar-wrap svg { width: 280px; height: 280px; }
  .topbar { padding: 10px 14px; }
  .topbar .nav-links { gap: 10px; }
  .topbar .nav-links a { font-size: 13px; }
  .admin-page { padding: 14px; }
  .data-table { font-size: 12px; }
  .data-table th, .data-table td { padding: 6px 8px; }
}
@media print {
  .nav, .btn, .btn-primary, .export-row, .record-btn, .play-btn, .topbar { display: none !important; }
  .app { max-width: 100%; background: white; }
  .section { display: block !important; }
  .results { display: block !important; }
  .cover { page-break-after: avoid; }
}
