:root {
  --bg-1: #eef3fa;
  --bg-2: #e4ecf7;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --brand: #2563eb;
  --brand-soft: #eff6ff;
  --ok: #16a34a;
  --ok-soft: #f0fdf4;
  --bad: #dc2626;
  --bad-soft: #fef2f2;
  --radius: 20px;
  --shadow: 0 10px 30px -12px rgba(15, 23, 42, .18), 0 2px 6px rgba(15, 23, 42, .05);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: linear-gradient(160deg, var(--bg-1) 0%, var(--bg-2) 100%);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  touch-action: manipulation;
}

.app {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 26px 16px calc(40px + env(safe-area-inset-bottom));
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ---------- 顶部 ---------- */
.head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 4px;
}

h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .2px;
}

.sub {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.review-pill {
  flex: none;
  padding: 6px 12px;
  border-radius: 999px;
  background: #fff7ed;
  color: #b45309;
  border: 1px solid #fed7aa;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: background .15s, color .15s, border-color .15s, transform .05s;
}

.review-pill:hover { background: #ffedd5; }
.review-pill:active { transform: scale(.97); }

.review-pill.on {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fecaca;
}

/* ---------- 完成页（题组做完 / 错题库清空） ---------- */
.done-panel {
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 24px 16px;
}

.done-title {
  font-size: clamp(20px, 6vw, 28px);
  font-weight: 800;
  color: var(--ink);
}

.done-sub {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 30em;
}

/* ---------- 统计 ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.stat {
  background: var(--card);
  border: 1px solid rgba(226, 232, 240, .9);
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
}

.stat .k {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .3px;
}

.stat strong {
  font-size: 19px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ---------- 单元选择 ---------- */
.unitbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.unitbar label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.unitbar select {
  flex: 1 1 140px;
  min-width: 120px;
  padding: 11px 12px;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

/* ---------- 音标 ---------- */
.ipa {
  margin-top: 8px;
  font-size: clamp(18px, 5vw, 24px);
  font-style: italic;
  color: var(--muted);
  text-align: center;
  letter-spacing: .3px;
}

/* ---------- 词性标签 ---------- */
.pos-tag {
  display: inline-block;
  margin-top: 14px;
  padding: 4px 12px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4338ca;
  font-size: clamp(13px, 3.6vw, 15px);
  font-weight: 600;
  letter-spacing: .3px;
}

/* ---------- 主面板 ---------- */
.board {
  position: relative;
  background: var(--card);
  border-radius: 22px;
  padding: 18px 20px 20px;
  box-shadow: var(--shadow);
  min-height: 420px;
  display: flex;
  flex-direction: column;
}

.board-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
  flex-wrap: wrap;
}

.spacer { flex: 1 1 auto; }

.type-tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .3px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
}

.type-tag[data-mode="word2pic"] {
  background: #f5f3ff;
  color: #7c3aed;
}

.review-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fff7ed;
  color: #c2410c;
  border: 1px dashed #fdba74;
}

.progress {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  padding: 4px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  white-space: nowrap;
}

.timer {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f8fafc;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.prompt {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 0 16px;
  min-height: 190px;
}

/* ---------- 图片 ---------- */
.pic {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: #f8fafc;
  border: 1.5px solid var(--line);
  overflow: hidden;
  font-size: 52px;
  line-height: 1;
}

.pic img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
}

.pic.emoji { font-size: 68px; }

.pic-lg.emoji { font-size: 112px; }

.pic-lg {
  width: 190px;
  height: 190px;
  aspect-ratio: auto;
  border: none;
  border-radius: 24px;
  background: radial-gradient(circle at 30% 25%, #ffffff 0%, #eef4fd 70%);
  box-shadow: inset 0 0 0 1.5px #e8effa;
  font-size: 112px;
}

.pic-lg img { padding: 12px; }

.pic.letter {
  font-size: 64px;
  font-weight: 800;
  color: #94a3b8;
  background: linear-gradient(140deg, #f1f5f9, #e2e8f0);
}

.pic-lg.letter { font-size: 92px; }

/* ---------- 读音按钮 ---------- */
.speak-btn {
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--brand);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(37, 99, 235, .08);
  transition: transform .05s, background .15s, border-color .15s;
}
.speak-btn:hover { background: #f0f6ff; border-color: #bfdbfe; }
.speak-btn:active { transform: scale(.97); }
.speak-btn .speak-ico { font-size: 18px; line-height: 1; }

/* 反馈区内的小喇叭：重听正确读音 */
.speak-mini {
  flex: none;
  width: 30px;
  height: 30px;
  margin-left: 6px;
  border: none;
  border-radius: 50%;
  background: #eef2ff;
  color: var(--brand);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  vertical-align: middle;
  transition: transform .05s, background .15s;
}
.speak-mini:hover { background: #dbe4ff; }
.speak-mini:active { transform: scale(.92); }

/* ---------- 看词选词的题干 ---------- */
.word-prompt {
  font-size: clamp(38px, 9vw, 58px);
  font-weight: 700;
  letter-spacing: .5px;
  text-align: center;
  word-break: break-word;
  line-height: 1.15;
  padding: 8px 4px;
}

/* ---------- 选项 ---------- */
.options {
  display: grid;
  gap: 12px;
}

.options.pic2word {
  grid-template-columns: 1fr 1fr;
}

.options.word2pic {
  grid-template-columns: repeat(4, 1fr);
}

.opt {
  position: relative;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 16px;
  cursor: pointer;
  padding: 0;
  font: inherit;
  color: inherit;
  transition: border-color .15s ease, background .15s ease,
    transform .12s ease, box-shadow .15s ease;
  -webkit-user-select: none;
  user-select: none;
}

.opt.text-opt {
  min-height: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 10px 12px;
}

.opt-ipa {
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
  letter-spacing: .3px;
  line-height: 1.2;
}

.opt-word {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: .2px;
  word-break: break-word;
}

.opt.pic-opt {
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.opt-cn {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.25;
  text-align: center;
  margin-top: 2px;
}

.pic-cn {
  margin-top: 10px;
  font-size: clamp(16px, 4.5vw, 22px);
  color: var(--muted);
  text-align: center;
}

.opt.pic-opt .pic {
  border: none;
  background: #f8fafc;
}

.opt:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .35);
  outline-offset: 2px;
}

.opt.locked { cursor: default; }

.opt.correct {
  border-color: var(--ok);
  background: var(--ok-soft);
  animation: popCorrect .28s ease;
}

.opt.wrong {
  border-color: var(--bad);
  background: var(--bad-soft);
  animation: shake .32s ease;
}

.opt.correct .opt-word { color: #15803d; }
.opt.wrong .opt-word { color: #b91c1c; }

.opt.correct .pic,
.opt.wrong .pic {
  background: transparent;
}

/* ---------- 反馈 ---------- */
.feedback {
  min-height: 46px;
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 15px;
  font-weight: 500;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .18s ease, transform .18s ease;
}

.feedback.show {
  opacity: 1;
  transform: translateY(0);
}

.feedback.ok { color: var(--ok); }
.feedback.bad { color: var(--bad); }

.feedback strong {
  font-weight: 700;
  font-size: 16px;
}

.fb-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: currentColor;
  flex: none;
}

.feedback.ok .fb-ico { background: var(--ok); color: #fff; }
.feedback.bad .fb-ico { background: var(--bad); color: #fff; }

.fb-cn {
  color: var(--muted);
  font-weight: 500;
}

.fb-ipa {
  color: var(--muted);
  font-style: italic;
  letter-spacing: .3px;
}

.fb-tip {
  margin-left: 6px;
  font-size: 12px;
  color: #c2410c;
  background: #fff7ed;
  border-radius: 999px;
  padding: 3px 9px;
}

/* ---------- 操作按钮区 ---------- */
.action {
  min-height: 52px;
  margin-top: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.act-btn {
  border: none;
  cursor: pointer;
  padding: 13px 26px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: var(--brand);
  box-shadow: 0 6px 16px -10px rgba(37, 99, 235, .75);
  transition: transform .12s ease, background .15s ease;
  -webkit-user-select: none;
  user-select: none;
}

.act-btn:active { transform: scale(.97); }

.act-btn.next { background: var(--brand); }

.act-btn.skip { background: #64748b; box-shadow: none; }

/* ---------- 答题卡 ---------- */
.sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(15, 23, 42, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.sheet-panel {
  width: min(560px, 100%);
  max-height: 82vh;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(2, 6, 23, .3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #eef2f7;
}
.sheet-title { font-weight: 700; font-size: 16px; color: #0f172a; }
.sheet-count { font-size: 12px; font-weight: 400; color: #64748b; margin-left: 6px; }
.sheet-close {
  border: none; background: #f1f5f9; color: #475569;
  width: 32px; height: 32px; border-radius: 10px; font-size: 16px; cursor: pointer;
}
.sheet-close:active { transform: scale(.95); }
.sheet-grid {
  padding: 14px 16px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 10px;
}
.sheet-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 52px;
  padding: 6px 4px;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  color: #334155;
  transition: transform .05s, border-color .15s, background .15s;
}
.sheet-cell:active { transform: scale(.97); }
.sheet-cell.status-todo { border-color: #c7d2fe; }
.sheet-cell.status-ok { border-color: #bbf7d0; background: #f0fdf4; color: #166534; }
.sheet-cell.status-bad { border-color: #fecaca; background: #fef2f2; color: #b91c1c; }
.sheet-cell.current { outline: 2px solid #2563eb; outline-offset: 1px; }
.sheet-word { font-weight: 600; }
.sheet-mark { font-size: 12px; }

/* ---------- 下一题模式切换 ---------- */
.nextbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.nextbar .lbl {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

/* ---------- 题库切换 / 顺序 / 记录管理 ---------- */
.bankbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.seg-sm button { padding: 8px 12px; font-size: 13px; }

.manage-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(15, 23, 42, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.manage-panel {
  width: min(620px, 100%);
  max-height: 86vh;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(2, 6, 23, .3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.manage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #eef2f7;
}

.manage-title { font-weight: 700; font-size: 16px; color: #0f172a; }

.manage-close {
  border: none;
  background: #f1f5f9;
  color: #475569;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-size: 16px;
  cursor: pointer;
}
.manage-close:active { transform: scale(.95); }

.manage-body {
  padding: 14px 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.manage-sec { display: flex; flex-direction: column; gap: 8px; }
.manage-sec-title { font-weight: 700; font-size: 14px; color: #0f172a; }
.manage-empty { font-size: 13px; color: var(--muted); padding: 6px 0; }

.manage-group { display: flex; flex-direction: column; gap: 6px; }
.manage-group-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.manage-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.mchip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
}
.mchip-word { font-weight: 600; font-size: 14px; color: #334155; }
.mchip-ctrl { display: inline-flex; align-items: center; gap: 4px; }
.mchip-need { font-size: 12px; color: var(--muted); min-width: 34px; text-align: center; }

.mchip-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: #475569;
  min-width: 26px;
  height: 26px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}
.mchip-btn:hover { background: #f1f5f9; }
.mchip-btn.del { color: #b91c1c; border-color: #fecaca; background: #fef2f2; }
.mchip-btn.del:hover { background: #fee2e2; }

.mrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.mrow-label { font-size: 13px; color: #334155; }

.act-btn:disabled {
  background: #cbd5e1;
  box-shadow: none;
  cursor: not-allowed;
}

/* ---------- 工具栏 ---------- */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.seg {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: rgba(226, 232, 240, .85);
  border-radius: 13px;
}

.seg button {
  border: none;
  background: transparent;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}

.seg button.on {
  background: #fff;
  color: var(--brand);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .12);
}

.tools {
  display: flex;
  gap: 8px;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  border: 1px solid rgba(203, 213, 225, .9);
  background: #fff;
  font-size: 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s ease, transform .12s ease;
  -webkit-user-select: none;
  user-select: none;
}

.icon-btn:active { transform: scale(.94); }

.icon-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.hint {
  margin: 0;
  text-align: center;
  font-size: 12px;
  color: #94a3b8;
}

.fatal {
  margin: auto;
  padding: 24px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--bad);
  text-align: center;
}

/* ---------- 动画 ---------- */
.board.pop .prompt,
.board.pop .options {
  animation: fadeUp .22s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes popCorrect {
  0% { transform: scale(1); }
  45% { transform: scale(1.025); }
  100% { transform: scale(1); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

/* 仅在支持悬停的设备上启用 hover，避免触屏点击后状态残留 */
@media (hover: hover) {
  .opt:not(.locked):hover {
    border-color: #93c5fd;
    background: #f5faff;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px -10px rgba(37, 99, 235, .5);
  }
  .opt:not(.locked):active { transform: scale(.985); }

  .seg button:hover { color: var(--brand); }
  .icon-btn:hover { background: #f8fafc; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- 响应式 ---------- */

/* 平板 / 大屏：保持桌面布局，适当放大触控目标 */
@media (min-width: 768px) {
  .opt.text-opt { min-height: 70px; }
  .opt-word { font-size: 22px; }
  .icon-btn { width: 46px; height: 46px; }
}

/* 手机竖屏 */
@media (max-width: 640px) {
  .app { padding: 18px 12px calc(28px + env(safe-area-inset-bottom)); gap: 12px; }

  h1 { font-size: 19px; }
  .sub { font-size: 12px; }

  .stat { padding: 8px 10px; border-radius: 12px; }
  .stat strong { font-size: 17px; }

  .board { padding: 14px 14px 16px; min-height: 360px; border-radius: 18px; }

  .prompt { min-height: 150px; padding: 6px 0 12px; }

  .pic-lg { width: 150px; height: 150px; font-size: 82px; }
  .pic.emoji { font-size: 58px; }
  .pic-lg.emoji { font-size: 88px; }
  .pic.letter { font-size: 52px; }
  .pic-lg.letter { font-size: 74px; }

  .options { gap: 10px; }
  .options.word2pic { grid-template-columns: repeat(2, 1fr); }

  .opt.text-opt { min-height: 58px; }
  .opt-word { font-size: 17px; }

  .seg button { padding: 9px 12px; font-size: 13px; }
  .icon-btn { width: 44px; height: 44px; border-radius: 12px; }

  .feedback { font-size: 14px; min-height: 42px; margin-top: 10px; }

  .act-btn { padding: 14px 28px; font-size: 16px; }
  .action { min-height: 56px; }
}

@media (max-width: 380px) {
  .options.word2pic { grid-template-columns: 1fr 1fr; }
  .opt-word { font-size: 16px; }
}

/* 手机横屏：高度有限，压缩纵向空间，保证一屏可见 */
@media (orientation: landscape) and (max-height: 560px) {
  .app { padding-top: 12px; padding-bottom: 16px; gap: 8px; }

  .board { min-height: 0; padding: 12px 16px; }

  .prompt { min-height: 96px; padding: 4px 0 8px; }

  .pic-lg { width: 120px; height: 120px; font-size: 64px; }
  .pic-lg.emoji { font-size: 72px; }

  .word-prompt { font-size: clamp(28px, 7vw, 44px); }

  .opt.text-opt { min-height: 48px; }
  .opt-word { font-size: 16px; }

  .feedback { min-height: 34px; margin-top: 8px; }

  .action { min-height: 44px; margin-top: 8px; }
  .act-btn { padding: 10px 22px; }

  .stat { padding: 6px 10px; }
  .stat strong { font-size: 15px; }
}

/* 超窄屏宽度保护：防止任何横向滚动 */
@media (max-width: 340px) {
  .app { padding-left: 10px; padding-right: 10px; }
  .head { flex-direction: column; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- 弹层 / 管理 / 答题卡 / 完成页 ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(15, 23, 42, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.overlay[hidden] { display: none !important; }

.panel {
  width: min(620px, 100%);
  max-height: 86vh;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(2, 6, 23, .3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #eef2f7;
}
.panel-head h2 { margin: 0; font-size: 16px; color: #0f172a; }

.panel-body {
  padding: 14px 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.manage-sec { display: flex; flex-direction: column; gap: 8px; }
.manage-sec-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
  color: #0f172a;
}
.manage-sec-head .cnt { color: var(--muted); font-weight: 600; font-size: 13px; }
.manage-sec-head .mini-btn { margin-left: auto; }

.manage-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.manage-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding:8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
  color: #334155;
}
.manage-list li.empty { justify-content: center; color: var(--muted); font-size: 13px; }

.mini-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: #475569;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}
.mini-btn:hover { background: #f1f5f9; }
.mini-btn:active { transform: scale(.96); }

.sheet-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 60vh; overflow-y: auto; }
.sheet-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  color: #334155;
}
.sheet-item:active { background: #f1f5f9; }
.sheet-idx { width: 22px; color: var(--muted); font-size: 13px; text-align: center; }
.sheet-word { flex: 1; }
.sheet-mark { font-weight: 700; }
.sheet-item.ok .sheet-mark { color: #16a34a; }
.sheet-item.bad .sheet-mark { color: #dc2626; }
.sheet-item.empty { justify-content: center; color: var(--muted); cursor: default; font-size: 13px; }

.complete {
  margin: auto;
  text-align: center;
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}
.complete h2 { margin: 0; font-size: 22px; color: #0f172a; }
.complete p { margin: 0; font-size: 15px; color: #475569; }
.complete-note { color: var(--muted) !important; font-size: 13px !important; }

.act-btn.mini { padding: 8px 16px; font-size: 14px; }
