/* 题库 (bank.js) and 精听与听写 (dictation.js) */

/* ---------- Bank ---------- */
.bank-head { align-items: flex-start; }
.bank-head-link { font-size: 13px; font-weight: 500; white-space: nowrap; }

.bank-panel { padding: 0 20px; margin-bottom: 16px; overflow: visible; }
.bank-tabs { display: flex; border-bottom: 1px solid var(--line); }
.bank-tabs button {
  flex: 1; border: 0; background: transparent; padding: 14px 0 12px; font-size: 14px; color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color 0.15s, border-color 0.15s;
}
.bank-tabs button:hover { color: var(--text); }
.bank-tabs button.active { color: var(--text); font-weight: 600; border-bottom-color: var(--brand); }
.bank-tools { display: flex; align-items: center; gap: 12px; padding: 12px 0; flex-wrap: wrap; }
.bank-caret { font-size: 12px; margin-left: 2px; }
.bank-filter-btn.on { border-color: var(--brand); color: var(--brand-600); }
.bank-draw-btn { color: var(--brand-600); border-color: var(--brand-100); background: var(--brand-50); }
.bank-search { width: 210px; height: 32px; font-size: 13px; }
@media (max-width: 860px) { .bank-search { width: 100%; order: 10; height: 36px; } }
.bank-search { width: 210px; height: 32px; font-size: 13px; }
@media (max-width: 860px) { .bank-search { width: 100%; order: 10; height: 36px; } }
.bank-filter-wrap { position: relative; }
.bank-pop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; width: 260px; background: #fff; border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 10px 30px rgba(16, 40, 32, 0.12); padding: 14px; display: flex; flex-direction: column; gap: 12px;
}
.bank-pop-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.bank-pop-foot { border-top: 1px solid var(--line); padding-top: 10px; }
.bank-type-chips { padding: 0 0 14px; }

.bank-test { padding: 0; margin-bottom: 12px; overflow: hidden; }
.card + .bank-test, .bank-test + .bank-test { margin-top: 0; }
.bank-test-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.bank-test-head h3 { font-size: 17px; }
.bank-progress { font-size: 13px; font-weight: 600; color: var(--brand-600); font-variant-numeric: tabular-nums; }
.bank-progress.full::before { content: "✓ "; }
.bank-cells { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); }
.bank-cell {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; min-width: 0;
  border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 -1px -1px 0;
  background: #fff; padding: 14px 20px; cursor: pointer; transition: background 0.15s;
}
.bank-cell:hover { background: var(--brand-50); }
.bank-cell-name { font-size: 13px; color: var(--brand-600); }
.bank-cell-name b { color: var(--text); font-weight: 600; margin-left: 2px; }
.bank-cell-sub { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.bank-cell-meta { display: flex; gap: 10px; font-size: 12px; color: var(--muted); }
.bank-score { font-size: 12px; color: var(--muted); }
.bank-cell.done .bank-score, .bank-score.has { color: var(--ok); font-weight: 600; }
.bank-badge {
  position: absolute; top: 10px; right: 12px; font-size: 11px; padding: 0 8px; border-radius: 999px;
  background: var(--warn-50); color: #9a5f05; border: 1px solid #f4dfb8;
}

.bank-full { display: flex; align-items: center; gap: 24px; margin-bottom: 12px; padding: 18px 20px; }
.card + .bank-full, .bank-full + .bank-full { margin-top: 0; }
.bank-full-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.bank-full-main h3 { font-size: 17px; }
.bank-full-parts { display: flex; flex-wrap: wrap; gap: 6px; }
.bank-full-part { font-size: 12px; padding: 2px 10px; border-radius: 6px; background: var(--bg); color: var(--muted); }
.bank-full-meta { display: flex; gap: 22px; text-align: center; }
.bank-full-meta div { display: flex; flex-direction: column; }
.bank-full-meta b { font-size: 15px; font-variant-numeric: tabular-nums; }
.bank-full-meta b.ok { color: var(--ok); }
.bank-full-meta span { font-size: 12px; color: var(--muted); }

.bank-tasks { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.bank-tasks .card + .card { margin-top: 0; }
.bank-task {
  display: flex; flex-direction: column; padding: 0; overflow: hidden; text-align: left; cursor: pointer;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.bank-task:hover { border-color: var(--brand); transform: translateY(-1px); }
.bank-task-visual {
  --h: 160; position: relative; display: flex; flex-direction: column; gap: 4px; padding: 18px 20px 16px; min-height: 118px;
  background:
    radial-gradient(circle at 88% 20%, hsl(var(--h) 60% 88% / 0.9) 0 46px, transparent 47px),
    repeating-linear-gradient(135deg, hsl(var(--h) 40% 96%) 0 10px, hsl(var(--h) 40% 93%) 10px 11px),
    hsl(var(--h) 40% 96%);
  border-bottom: 1px solid var(--line);
}
.bank-task-kicker { font-size: 12px; color: hsl(var(--h) 45% 30%); }
.bank-task-topic { font-size: 19px; font-weight: 600; line-height: 1.35; color: hsl(var(--h) 40% 18%); max-width: 80%; }
.bank-task-lines { display: flex; flex-direction: column; gap: 5px; margin-top: auto; padding-top: 10px; }
.bank-task-lines i { display: block; height: 4px; border-radius: 2px; background: hsl(var(--h) 35% 82%); width: 70%; }
.bank-task-lines i:nth-child(2) { width: 52%; }
.bank-task-lines i:nth-child(3) { width: 36%; }
.bank-corner {
  position: absolute; top: 12px; right: 12px; font-size: 11px; padding: 1px 8px; border-radius: 6px;
  background: #e8f0fd; color: var(--info); border: 1px solid #cfdefa;
}
.bank-task-body { display: flex; flex-direction: column; gap: 10px; padding: 14px 20px 16px; flex: 1; }
.bank-task-preview { color: #3c4a45; line-height: 1.7; font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bank-task-foot { display: flex; align-items: center; gap: 10px; margin-top: auto; flex-wrap: wrap; }
.bank-task-test { font-weight: 600; color: var(--brand-600); font-size: 13px; }
.bank-task-foot .bank-score { margin-left: auto; }

.bank-pager { justify-content: flex-end; padding-top: 4px; }
.bank-pager .pages button { padding: 0 12px; }
.bank-page-no { padding: 0 8px; color: var(--text); font-variant-numeric: tabular-nums; }
.bank-foot { text-align: center; margin-top: 24px; }

.bank-draw { display: flex; flex-direction: column; gap: 18px; }
.bank-draw-label { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.bank-draw-label .muted { font-weight: 400; font-size: 12px; margin-left: 4px; }
.bank-pick.active { font-weight: 500; }
.bank-select { position: relative; }
.bank-select-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 9px 12px; cursor: pointer;
}
.bank-select.open .bank-select-btn, .bank-select-btn:hover { border-color: var(--brand); }
.bank-select-menu { margin-top: 6px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; display: flex; flex-direction: column; gap: 6px; max-height: 200px; overflow: auto; }
.bank-draw-actions { gap: 10px; }
.bank-drawn { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 10px; background: var(--brand-50); border: 1px solid var(--brand-100); }
.bank-drawn h3 { font-size: 17px; }
.bank-drawn-sub { font-family: Georgia, "Times New Roman", serif; font-size: 15px; }

/* ---------- Dictation ---------- */
.dict-back { display: inline-block; font-size: 13px; margin-bottom: 14px; }
.dict-hero { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 20px; }
.dict-hero h1 { font-size: 26px; }
.dict-hero .sub { color: var(--muted); margin-top: 6px; }
.dict-hero-icon { flex: none; width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-50); border: 1px solid var(--brand-100); font-size: 20px; }
.dict-modes { display: grid; grid-template-columns: repeat(3, 1fr); padding: 0; overflow: hidden; margin-bottom: 16px; }
.dict-mode {
  display: flex; gap: 12px; align-items: flex-start; text-align: left; border: 0; border-right: 1px solid var(--line);
  background: #fff; padding: 16px 20px; cursor: pointer; transition: background 0.15s;
}
.dict-mode:last-child { border-right: 0; }
.dict-mode:hover { background: #fafcfb; }
.dict-mode.active { background: var(--brand-50); box-shadow: inset 0 -2px 0 var(--brand); }
.dict-mode > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.dict-mode-icon { flex: none; color: var(--brand); font-size: 17px; line-height: 1.4; }
.dict-search { display: flex; justify-content: flex-end; gap: 10px; margin-bottom: 16px; padding: 12px 16px; }
.card + .dict-search, .card + .dict-lib { margin-top: 0; }
.dict-search .input { width: min(340px, 100%); }
.dict-lib-head { margin-bottom: 16px; align-items: flex-end; }
.dict-lib-head h2 { font-size: 19px; }
.dict-count { font-size: 13px; font-weight: 600; color: var(--brand-600); }
.dict-res-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.dict-res {
  display: flex; align-items: center; gap: 12px; text-align: left; border: 1px solid var(--line); border-radius: 10px;
  background: #fafcfb; padding: 14px 16px; cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.dict-res:hover { border-color: var(--brand); background: var(--brand-50); }
.dict-res-icon { flex: none; font-size: 18px; }
.dict-res-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.dict-res-main .bar { height: 4px; margin-top: 4px; }
.dict-arrow { color: var(--brand); flex: none; }
.dict-materials { display: flex; flex-direction: column; }
.dict-material {
  display: grid; grid-template-columns: minmax(0, 1fr) 120px 150px 16px; align-items: center; gap: 16px; text-align: left;
  border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 14px 8px; cursor: pointer; border-radius: 0;
}
.dict-material:last-child { border-bottom: 0; }
.dict-material:hover { background: #fafcfb; }
.dict-material-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dict-material-main b { font-size: 15px; font-weight: 600; }
.dict-material-prog .bar { height: 5px; }
.dict-status { font-size: 12px; color: var(--muted); text-align: right; }
.dict-status.open { color: var(--warn); font-weight: 600; }
.dict-status.done { color: var(--ok); font-weight: 600; }

.dict-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
.dict-side { padding: 12px; position: sticky; top: calc(var(--topbar) + 16px); max-height: calc(100vh - var(--topbar) - 32px); overflow: auto; }
.dict-side-test { font-weight: 600; font-size: 13px; padding: 8px 8px 2px; }
.dict-side-part { font-size: 12px; color: var(--muted); padding: 6px 8px 4px; }
.dict-chapter {
  display: flex; flex-direction: column; gap: 4px; width: 100%; text-align: left; border: 1px solid transparent; background: transparent;
  border-radius: 8px; padding: 8px 10px; cursor: pointer; margin-bottom: 2px;
}
.dict-chapter:hover { background: var(--bg); }
.dict-chapter.active { background: var(--brand-50); border-color: var(--brand-100); }
.dict-chapter-title { font-size: 14px; }
.dict-chapter .bar { height: 4px; width: 100%; }

.dict-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.dict-main .card + .card { margin-top: 0; }
.dict-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.dict-head h2 { font-size: 20px; font-weight: 600; }
.dict-opt { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.dict-opt .select { height: 30px; padding: 0 8px; }

.dict-sent { display: flex; flex-direction: column; gap: 16px; }
.dict-sent-top { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.dict-marks { gap: 10px; }
.dict-mark { min-width: 84px; height: 38px; border-radius: 999px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 14px; transition: 0.15s; }
.dict-mark.ok:hover, .dict-mark.ok.active { border-color: var(--ok); background: var(--brand-50); color: var(--ok); }
.dict-mark.warn:hover, .dict-mark.warn.active { border-color: var(--warn); background: var(--warn-50); color: #9a5f05; }
.dict-mark.bad:hover, .dict-mark.bad.active { border-color: var(--danger); background: var(--danger-50); color: var(--danger); }
.dict-mark.active { font-weight: 600; }
.dict-orig { font-size: 18px; line-height: 1.8; padding: 16px 18px; background: var(--brand-50); border-radius: 10px; }
.dict-hidden { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border: 1px dashed var(--line); border-radius: 10px; }
.dict-nav { padding-top: 4px; }

.dict-dots { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.dict-dot { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-size: 11px; color: var(--muted); cursor: pointer; padding: 0; }
.dict-dot.dictated { box-shadow: inset 0 -3px 0 var(--brand-100); }
.dict-dot.ok { background: var(--brand-50); border-color: var(--ok); color: var(--ok); }
.dict-dot.warn { background: var(--warn-50); border-color: var(--warn); color: #9a5f05; }
.dict-dot.bad { background: var(--danger-50); border-color: var(--danger); color: var(--danger); }
.dict-dot.cur { outline: 2px solid var(--brand); outline-offset: 2px; font-weight: 700; }

.dict-input { font-size: 16px; }
.dict-result { display: flex; flex-direction: column; gap: 12px; }
.dict-acc { font-weight: 700; }
.dict-acc.ok { color: var(--ok); }
.dict-acc.warn { color: var(--warn); }
.dict-acc.bad { color: var(--danger); }
.dict-diff { font-size: 18px; line-height: 2; padding: 14px 18px; background: #fafcfb; border-radius: 10px; }
.dict-w.miss { color: var(--danger); text-decoration: underline wavy var(--danger); text-underline-offset: 4px; }
.dict-w.extra { color: #a3aeaa; text-decoration: line-through; }
.dict-ref p { font-size: 15px; line-height: 1.8; }

.dict-play { display: flex; flex-direction: column; gap: 16px; }
.dict-play-bar { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.dict-script { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 60vh; overflow: auto; }
.dict-script li { display: flex; gap: 12px; padding: 10px 12px; border-radius: 8px; cursor: pointer; line-height: 1.75; font-size: 15px; }
.dict-script li:hover { background: var(--bg); }
.dict-script li.on { background: var(--brand-50); box-shadow: inset 3px 0 0 var(--brand); }
.dict-spk { flex: none; width: 34px; font-size: 12px; color: var(--muted); padding-top: 3px; }

.dict-rep-stats { text-align: center; padding: 8px 0 4px; }
.dict-rep-section { margin-top: 20px; }
.dict-rep-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.dict-rep-bar .bar { flex: 1; height: 8px; }
.dict-rep-bar .bar > i.warn { background: var(--warn); }
.dict-rep-bar .bar > i.bad { background: var(--danger); }
.dict-mark-label { width: 36px; font-size: 13px; }
.dict-mark-label.ok { color: var(--ok); }
.dict-mark-label.warn { color: #9a5f05; }
.dict-mark-label.bad { color: var(--danger); }
.dict-weak { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.dict-weak:last-child { border-bottom: 0; }
.dict-weak p { font-size: 14px; line-height: 1.7; }

@media (max-width: 860px) {
  .bank-full { flex-direction: column; align-items: flex-start; gap: 12px; }
  .bank-full-meta { flex-wrap: wrap; text-align: left; }
  .bank-cells { grid-template-columns: 1fr; }
  .dict-modes { grid-template-columns: 1fr; }
  .dict-mode { border-right: 0; border-bottom: 1px solid var(--line); }
  .dict-material { grid-template-columns: minmax(0, 1fr) auto; }
  .dict-material-prog, .dict-arrow { display: none; }
  .dict-layout { grid-template-columns: 1fr; }
  .dict-side { position: static; max-height: 260px; }
  .dict-orig, .dict-diff { font-size: 16px; }
  .dict-play-bar .spacer { display: none; }
}
