/* hidden 属性会被 .btn 的 display 覆盖，这里显式兜底 */
[hidden] { display: none !important; }

/* ==========================================================================
   基本功模块（打字练习 + 概念闯关）
   --------------------------------------------------------------------------
   与 style.css 共用变量，只在需要「专注模式」的地方另立面板。
   ========================================================================== */

/* ---------------- 打字练习 · 列表 ---------------- */
.drill-groups { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: start; }
@media (max-width: 980px) { .drill-groups { grid-template-columns: 1fr; } }

.drill-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; margin-right: 8px;
  border-radius: 6px; background: var(--brand-soft); color: var(--brand);
  font: 600 11px/1 ui-monospace, SFMono-Regular, Consolas, monospace;
  vertical-align: -3px;
}
.card-head h2 .drill-icon { vertical-align: -4px; }

.drill-list { margin-top: 10px; display: flex; flex-direction: column; }
.drill-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 10px; margin: 0 -10px;
  border-radius: 8px; color: var(--ink); text-decoration: none;
  border-bottom: 1px solid #f2f4f8;
}
.drill-item:last-child { border-bottom: 0; }
.drill-item:hover { background: #f8faff; text-decoration: none; }
.drill-item-main { display: flex; align-items: center; gap: 8px; min-width: 0; }
.drill-title { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drill-item-meta { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.drill-best { font-size: 12px; color: var(--green); font-variant-numeric: tabular-nums; }
.drill-best.muted { color: var(--muted); }
.drill-go { font-size: 12px; color: var(--brand); opacity: 0; transition: opacity .12s; }
.drill-item:hover .drill-go { opacity: 1; }

/* ---------------- 打字练习 · 练习页 ---------------- */
.drill-wrap { max-width: 900px; margin: 0 auto; }
.drill-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.back-link { font-size: 13px; color: var(--muted); flex: 0 0 auto; }
.drill-heading { display: flex; align-items: center; gap: 10px; flex: 1 1 auto; min-width: 0; }
.drill-heading h1 { font-size: 20px; margin: 0; }
.drill-personal { font-size: 13px; color: var(--muted); flex: 0 0 auto; }
.drill-personal b { color: var(--ink); font-size: 15px; }

.drill-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px;
}
.dstat {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 14px; text-align: center;
}
.dstat b { display: block; font-size: 24px; line-height: 1.3; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.dstat span { font-size: 11.5px; color: var(--muted); }

.drill-stage {
  position: relative; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 46px 34px 42px; min-height: 240px; cursor: text; outline: none;
  transition: opacity .2s;
}
.drill-stage.dim { opacity: .35; }

.drill-text {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", monospace;
  font-size: 19px; line-height: 34px;
  white-space: pre-wrap; word-break: break-word;
  letter-spacing: 0; font-variant-ligatures: none;
  -webkit-font-smoothing: antialiased;
}
.drill-text .ch { color: #aab2bd; }
.drill-text .ch.ok { color: var(--ink); }
.drill-text .ch.bad { color: #fff; background: #e05252; border-radius: 3px; }
.drill-text .ch.cur { color: var(--ink); background: #dbe8ff; border-radius: 3px; box-shadow: inset 0 -2px 0 var(--brand); }
.drill-text .ch.nl { color: #ccd2db; font-size: 14px; }
.drill-text .ch.nl.ok { color: #d7dde6; }
.drill-text .ch.nl.bad { color: #fff; }

.drill-start-hint {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  font-size: 12.5px; color: var(--muted); background: var(--gray-soft);
  padding: 4px 12px; border-radius: 20px; white-space: nowrap;
}

.drill-progress { height: 6px; background: #eceef3; border-radius: 6px; margin: 12px 0 0; overflow: hidden; }
.drill-progress span { display: block; height: 100%; width: 0; background: var(--brand-grad, var(--brand)); transition: width .1s linear; }

.drill-actions { display: flex; align-items: center; gap: 14px; margin-top: 16px; }

/* ---------------- 结算卡 ---------------- */
.drill-modal {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(22, 24, 29, .38);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.drill-modal[hidden] { display: none; }
.drill-card {
  width: 100%; max-width: 440px; background: var(--panel); border-radius: 16px;
  padding: 30px 32px 26px; text-align: center;
  box-shadow: 0 12px 40px rgba(16, 24, 40, .18);
  animation: popIn .16s ease-out;
}
@keyframes popIn { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.grade { font-size: 76px; font-weight: 800; line-height: 1; letter-spacing: -3px; }
.grade.S { color: #c88400; }
.grade.A { color: var(--brand); }
.grade.B { color: var(--green); }
.grade.C { color: #9aa1ab; }
.grade-note { font-size: 14px; color: var(--muted); margin-top: 6px; }

.result-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
  margin: 22px 0 16px; padding: 14px 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.result-grid b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; letter-spacing: -.4px; }
.result-grid span { font-size: 11.5px; color: var(--muted); }

.result-note { font-size: 13px; line-height: 1.9; min-height: 20px; }
.note-best { color: var(--green); font-weight: 600; }
.note-flag { color: var(--red); font-weight: 600; }
.note-up { color: var(--brand); font-weight: 600; }

.modal-actions { display: flex; gap: 10px; justify-content: center; margin-top: 20px; }

/* ==========================================================================
   概念闯关 · 知识点地图
   ========================================================================== */
.concept-group { margin-bottom: 26px; }
.cg-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.cg-head h2 { font-size: 16px; margin: 0; }
.cg-head .sub { font-size: 12.5px; }

.concept-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.concept-card {
  display: block; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 14px 16px; color: var(--ink); text-decoration: none;
  transition: border-color .12s, box-shadow .16s, transform .16s;
}
.concept-card:hover { border-color: #c9dbff; box-shadow: 0 6px 16px rgba(37, 99, 235, .09); transform: translateY(-2px); text-decoration: none; }
.concept-card.mastered { border-color: #c3e9d8; background: #fbfefc; }
.concept-card.doing { border-color: #cfdefb; }

.cc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 3px; }
.cc-name { font-weight: 600; font-size: 14.5px; }
.cc-mark { font-size: 11.5px; color: var(--green); background: var(--green-soft); padding: 2px 8px; border-radius: 20px; flex: 0 0 auto; }
.cc-count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.cc-sub { font-size: 12.5px; color: var(--muted); margin: 0 0 10px; line-height: 1.55; min-height: 34px; }
.cc-hint { font-size: 11.5px; color: var(--amber); margin-top: 8px; }
.concept-card .progress-bar { width: 100%; height: 5px; }

/* ==========================================================================
   概念闯关 · 答题页
   ========================================================================== */
.quiz-wrap { max-width: 780px; margin: 0 auto; }
.quiz-top { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.quiz-heading { flex: 1 1 auto; min-width: 0; }
.quiz-heading h1 { font-size: 20px; margin: 0 0 2px; }
.quiz-heading .sub { font-size: 12.5px; }

.quiz-dots { display: flex; gap: 6px; flex: 0 0 auto; }
.dot {
  width: 24px; height: 24px; border-radius: 50%;
  background: #eef0f4; color: var(--muted); font-size: 11.5px;
  display: flex; align-items: center; justify-content: center;
  font-variant-numeric: tabular-nums;
}
.dot.cur { background: #fff; color: var(--brand); box-shadow: 0 0 0 2px var(--brand); font-weight: 600; }
.dot.ok { background: var(--green-soft); color: var(--green); }
.dot.bad { background: var(--red-soft); color: var(--red); }

.quiz-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 26px 30px; min-height: 300px;
}
.q-kicker { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.q-solved { margin-left: 8px; color: var(--green); background: var(--green-soft); padding: 1px 8px; border-radius: 20px; }
.q-stem { font-size: 16px; line-height: 1.7; margin-bottom: 14px; }

.q-code {
  background: #f7f8fa; border: 1px solid var(--line); border-radius: 8px;
  padding: 14px 16px; overflow: auto; margin: 0 0 14px;
}
.q-code code {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 13.5px; line-height: 1.7; white-space: pre; color: #262626;
}

.q-options { display: flex; flex-direction: column; gap: 9px; margin-top: 12px; }
.q-opt {
  display: flex; align-items: flex-start; gap: 10px; text-align: left;
  background: #fff; border: 1px solid var(--line); border-radius: 9px;
  padding: 11px 14px; font: inherit; font-size: 14px; color: var(--ink); cursor: pointer;
  transition: border-color .1s, background .1s;
}
.q-opt:hover { border-color: #c9dbff; background: #fafcff; }
.q-opt.on { border-color: var(--brand); background: var(--brand-soft); }
.q-opt.locked { cursor: default; }
.q-key {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 6px;
  background: var(--gray-soft); color: var(--muted); font-size: 12px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.q-opt.on .q-key { background: var(--brand); color: #fff; }
.q-opt.right { border-color: var(--green); background: var(--green-soft); }
.q-opt.right .q-key { background: var(--green); color: #fff; }
.q-opt.wrong { border-color: var(--red); background: var(--red-soft); }
.q-opt.wrong .q-key { background: var(--red); color: #fff; }
.q-opt-text { line-height: 1.6; padding-top: 1px; }

.q-label { display: block; font-size: 13px; color: var(--muted); margin: 16px 0 7px; }
.q-input, .q-textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  font: inherit; font-size: 14px; color: var(--ink); background: #fff;
}
.q-textarea { font-family: ui-monospace, Consolas, monospace; font-size: 13.5px; resize: vertical; }
.q-input:focus, .q-textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

.q-run { display: flex; align-items: center; gap: 12px; margin: 4px 0 10px; flex-wrap: wrap; }
.q-output {
  background: #1f2430; color: #e6e9ef; border-radius: 8px; padding: 12px 14px;
  font-family: ui-monospace, Consolas, monospace; font-size: 13px; line-height: 1.7;
  white-space: pre-wrap; margin: 0 0 6px; max-height: 220px; overflow: auto;
}
.q-output.bad { background: #3a1f22; color: #ffd9d9; }

.q-result { margin-top: 18px; padding: 14px 16px; border-radius: 9px; border: 1px solid; }
.q-result.ok { background: var(--green-soft); border-color: #c3e9d8; }
.q-result.bad { background: var(--red-soft); border-color: #f3cccc; }
.qr-head { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.q-result.ok .qr-head { color: var(--green); }
.q-result.bad .qr-head { color: var(--red); }
.qr-explain { font-size: 13.5px; line-height: 1.75; color: #3a3f47; }
.qr-done { margin-top: 8px; font-size: 12.5px; color: var(--brand); font-weight: 600; }

.quiz-foot { display: flex; align-items: center; gap: 12px; margin-top: 16px; }

.quiz-done { text-align: center; padding: 24px 0 6px; }
.qd-num { font-size: 62px; font-weight: 800; line-height: 1; letter-spacing: -3px; color: var(--brand); }
.qd-num span { font-size: 26px; color: #b9c0ca; letter-spacing: 0; }
.qd-label { font-size: 14px; color: var(--muted); margin-top: 8px; }
.qd-tip { margin-top: 14px; font-size: 14px; color: var(--muted); }
.qd-tip.ok { color: var(--green); font-weight: 600; }
.qd-actions { display: flex; gap: 10px; justify-content: center; margin-top: 24px; }

/* 导航上的等级徽章 */
.lv-badge {
  display: inline-flex; align-items: center; height: 20px; padding: 0 8px;
  border-radius: 20px; background: var(--brand-soft); color: var(--brand);
  font-size: 11.5px; font-weight: 600; letter-spacing: .2px;
}

/* ---------------- 学生工作台：等级条 + 今日任务 ---------------- */
.lv-strip { display: flex; align-items: center; gap: 26px; margin-bottom: 16px; flex-wrap: wrap; }
.lv-left { display: flex; align-items: center; gap: 14px; flex: 0 0 auto; }
.lv-num {
  font-size: 28px; font-weight: 800; letter-spacing: -1px; color: #fff;
  background: var(--brand-grad, linear-gradient(135deg, #3b82f6, #2563eb));
  border-radius: 12px; padding: 6px 14px; line-height: 1.15;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 6px 14px rgba(37, 99, 235, .26);
}
.lv-name { font-size: 16px; }
.lv-right { flex: 1 1 320px; min-width: 0; }
.lv-reqs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.lv-req {
  font-size: 12px; color: var(--muted); background: var(--gray-soft);
  border-radius: 20px; padding: 3px 10px; white-space: nowrap;
}
.lv-req b { color: var(--ink); font-variant-numeric: tabular-nums; }
.lv-req.ok { background: var(--green-soft); color: var(--green); }
.lv-req.ok b { color: var(--green); }
.lv-bar { width: 100%; height: 6px; margin-bottom: 8px; }

.today-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 16px; }
@media (max-width: 860px) { .today-grid { grid-template-columns: 1fr; } }
.today-card {
  display: block; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 16px 18px; text-decoration: none; color: var(--ink);
  transition: border-color .12s, box-shadow .16s, transform .16s;
}
.today-card:hover { border-color: #c9dbff; box-shadow: 0 6px 18px rgba(37, 99, 235, .10); transform: translateY(-2px); text-decoration: none; }
.tc-kicker { font-size: 11.5px; color: var(--brand); font-weight: 600; margin-bottom: 6px; }
.tc-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.tc-sub { font-size: 12.5px; color: var(--muted); line-height: 1.55; }

/* ---------------- 班级页：知识点热力图 ---------------- */
.heat-wrap { overflow-x: auto; margin-top: 4px; }
.heat-table { border-collapse: separate; border-spacing: 4px; font-size: 12.5px; width: auto; }
.heat-table th {
  background: transparent; border: 0; padding: 2px 2px 6px;
  font-size: 11px; font-weight: 500; color: var(--muted);
  text-align: center; white-space: normal; line-height: 1.3;
  width: 46px; max-width: 46px; vertical-align: bottom;
}
.heat-table td.heat-name, .heat-table th.heat-name {
  text-align: left; background: transparent; border: 0;
  padding-right: 10px; white-space: nowrap; color: var(--ink); font-size: 13px;
}
.heat-cell {
  width: 46px; height: 30px; text-align: center; border: 0;
  border-radius: 6px; background: #f1f2f5; color: #a2a8b2;
  font-variant-numeric: tabular-nums;
}
.heat-cell.lv1 { background: #e7f7f0; color: var(--green); }
.heat-cell.lv2 { background: #c9eedd; color: #0b6b48; font-weight: 600; }
.heat-table tbody tr:hover { background: transparent; }

/* 打字练习页：收起页脚，别把视线往下拽 */
.drill-page .footer { display: none; }
.drill-page .container { padding-top: 22px; }
