/* 默背台 · 独立默背工具（与学习台同一套配色） */
:root {
  --bg: #0B1020;
  --bg-2: #0F1730;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-hover: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.22);
  --text: #EDF1F9;
  --dim: #98A2BA;
  --faint: #6B7691;
  --accent: #7C9CFF;
  --accent-2: #66D9C0;
  --good: #4ADE80;
  --bad: #F87171;
  --warn: #F0B860;
  --radius: 16px;
  --max: 860px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed; inset: 0;
  background:
    radial-gradient(680px 400px at 10% -6%, rgba(124,156,255,.16), transparent 62%),
    radial-gradient(620px 380px at 94% 2%, rgba(102,217,192,.10), transparent 60%);
  pointer-events: none;
}
#app { position: relative; max-width: var(--max); margin: 0 auto; padding: 26px 18px 80px; }

/* ---------- 顶栏 ---------- */
.top { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.top .mark {
  width: 36px; height: 36px; border-radius: 10px; flex: none;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  display: grid; place-items: center;
  color: #0A1022; font-weight: 800; font-size: 16px;
}
.top h1 { font-size: 17px; margin: 0; font-weight: 650; letter-spacing: .02em; flex: 1; }
.top h1 small { display: block; font-size: 11.5px; color: var(--faint); font-weight: 400; letter-spacing: .06em; }
.home-link { color: var(--dim); font-size: 13px; text-decoration: none; border: 1px solid var(--border); border-radius: 999px; padding: 5px 13px; }
.home-link:hover { color: var(--text); border-color: var(--border-strong); }

/* ---------- 通用 ---------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.eyebrow { font-size: 12px; letter-spacing: .14em; color: var(--dim); margin: 0 0 10px; font-weight: 600; }
.muted { color: var(--dim); font-size: 13px; }
.faint { color: var(--faint); font-size: 12.5px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--border-strong); background: transparent; color: var(--text);
  border-radius: 12px; padding: 9px 16px; font-size: 14px; cursor: pointer; font-family: inherit;
  transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { background: var(--surface-hover); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #0A1022; font-weight: 650; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { border-color: transparent; color: var(--dim); }
.btn.ghost:hover { color: var(--text); background: var(--surface-hover); }
.btn.small { padding: 5px 11px; font-size: 12.5px; border-radius: 9px; }
.btn.danger { color: var(--bad); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
input[type="text"], textarea, select {
  width: 100%; background: rgba(255,255,255,.05); border: 1px solid var(--border);
  color: var(--text); border-radius: 12px; padding: 10px 13px; font-size: 15px; font-family: inherit;
  outline: none;
}
input[type="text"]:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 150px; line-height: 1.7; }
select { width: auto; }

/* ---------- 任务列表 ---------- */
.task {
  display: flex; align-items: center; gap: 14px; padding: 15px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 10px;
}
.task .info { flex: 1; min-width: 0; }
.task h3 { margin: 0 0 3px; font-size: 15.5px; font-weight: 650; }
.task .meta { font-size: 12.5px; color: var(--faint); display: flex; gap: 8px; flex-wrap: wrap; }
.tag { font-size: 11px; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--dim); }
.tag.en { color: var(--accent); border-color: rgba(124,156,255,.45); }
.tag.zh { color: var(--accent-2); border-color: rgba(102,217,192,.45); }
.tag.other { color: var(--warn); border-color: rgba(240,184,96,.45); }
.task .acts { display: flex; gap: 6px; flex: none; }
.empty { text-align: center; padding: 52px 18px; color: var(--faint); }
.empty .big { font-size: 40px; margin-bottom: 10px; }

/* ---------- 编辑器：条目划重点 ---------- */
.item { border: 1px solid var(--border); border-radius: 13px; padding: 12px 14px; margin-bottom: 10px; background: rgba(255,255,255,.028); }
.item .zh-line { color: var(--dim); font-size: 13.5px; margin-bottom: 8px; display: flex; gap: 8px; align-items: baseline; }
.item .zh-line .no { color: var(--faint); font-size: 11.5px; flex: none; }
.item .sent { font-size: 16px; line-height: 2.15; word-break: break-word; }
.tok { border-radius: 5px; cursor: pointer; padding: 1px 2px; transition: background .1s; user-select: none; }
.tok:hover { background: rgba(124,156,255,.16); }
.tok.is-blank {
  background: rgba(124,156,255,.16); color: var(--accent);
  border-bottom: 2px solid var(--accent); padding: 1px 7px; margin: 0 2px;
}
.tok.is-blank::after { content: ""; }
.hint-bar { font-size: 12.5px; color: var(--faint); margin: 4px 0 14px; }

/* ---------- 出题配置 ---------- */
.pick { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 11px; cursor: pointer; }
.pick:hover { background: var(--surface-hover); }
.pick input { margin-top: 5px; accent-color: var(--accent); flex: none; }
.pick .txt { font-size: 14.5px; line-height: 1.55; }
.pick .txt small { display: block; color: var(--faint); font-size: 12px; }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.mode-card { border: 1px solid var(--border); border-radius: 13px; padding: 13px 15px; cursor: pointer; background: transparent; color: var(--text); text-align: left; font-family: inherit; }
.mode-card b { display: block; font-size: 14.5px; margin-bottom: 3px; }
.mode-card small { color: var(--faint); font-size: 12px; line-height: 1.5; display: block; }
.mode-card.on { border-color: var(--accent); background: rgba(124,156,255,.10); }
.mode-card:disabled { opacity: .4; cursor: not-allowed; }
@media (max-width: 560px) { .modes { grid-template-columns: 1fr; } }

/* ---------- 答题 ---------- */
.progress { height: 7px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; margin-bottom: 22px; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 99px; transition: width .3s; }
.q-count { font-size: 12.5px; color: var(--faint); margin-bottom: 8px; }
.prompt-zh { font-size: clamp(18px, 3.4vw, 24px); font-weight: 650; margin: 0 0 6px; line-height: 1.7; }
.cloze { font-size: clamp(16px, 2.9vw, 20px); line-height: 2.4; word-break: break-word; }
.cloze .zh-hint { color: var(--dim); font-size: 14px; }
.gap {
  display: inline-block; min-width: 64px; width: 100%; max-width: 260px;
  background: rgba(124,156,255,.08); border: none; border-bottom: 2px solid var(--accent);
  color: var(--text); font: inherit; text-align: center; padding: 0 6px; margin: 0 3px; outline: none;
  border-radius: 6px 6px 0 0;
}
.gap:focus { background: rgba(124,156,255,.16); }
.gap.is-ok { border-color: var(--good); color: var(--good); }
.gap.is-bad { border-color: var(--bad); color: var(--bad); }
.gap.is-bad ~ .fix, .fix { color: var(--good); font-size: .82em; }
.blank-reveal { color: var(--good); border-bottom: 2px solid var(--good); padding: 0 6px; margin: 0 3px; }
.blank-wrong-user { color: var(--bad); text-decoration: line-through; margin: 0 3px; }
.verdict { margin-top: 18px; border-radius: 13px; padding: 14px 16px; font-size: 14.5px; }
.verdict.ok { background: rgba(74,222,128,.09); border: 1px solid rgba(74,222,128,.35); }
.verdict.bad { background: rgba(248,113,113,.08); border: 1px solid rgba(248,113,113,.3); }
.verdict .ans { margin-top: 6px; font-size: 16px; word-break: break-word; }
.wword { border-radius: 4px; padding: 0 1px; }
.wword.ok { color: var(--good); }
.wword.bad { color: var(--bad); text-decoration: underline wavy rgba(248,113,113,.6); }
.key-tip { font-size: 12px; color: var(--faint); margin-top: 10px; }
kbd { border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px; padding: 0 6px; font-size: 11.5px; font-family: inherit; }

/* ---------- 结果 ---------- */
.score { text-align: center; padding: 34px 16px; }
.score .num { font-size: 52px; font-weight: 700; letter-spacing: -.02em; }
.score .num small { font-size: 20px; color: var(--faint); font-weight: 500; }
.wrong-item { border-left: 3px solid var(--bad); padding: 8px 14px; margin-bottom: 10px; font-size: 14px; }
.wrong-item .ans { color: var(--good); margin-top: 2px; }

/* ---------- 导入导出 ---------- */
.io-box textarea { min-height: 120px; font-size: 12.5px; font-family: ui-monospace, monospace; }

.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%);
  background: #1A2440; border: 1px solid var(--border-strong); color: var(--text);
  padding: 10px 20px; border-radius: 12px; font-size: 13.5px; z-index: 50;
  box-shadow: 0 10px 30px rgba(0,0,0,.4); animation: pop .2s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ---------- 上传 / 拍照识别 ---------- */
.up-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.up-btn {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 16px 12px; border-radius: 14px; cursor: pointer; text-align: center;
  background: rgba(124,156,255,.09); border: 1px dashed rgba(124,156,255,.45);
  transition: background .18s ease, border-color .18s ease, transform .12s ease;
  -webkit-tap-highlight-color: transparent;
}
.up-btn:hover { background: rgba(124,156,255,.15); border-color: rgba(124,156,255,.7); }
.up-btn:active { transform: translateY(1px); }
.up-btn input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.up-btn .ic { font-size: 22px; line-height: 1.2; }
.up-btn b { font-size: 14px; font-weight: 620; }
.up-btn small { font-size: 11.5px; color: var(--faint); }
.up-btn.is-busy { opacity: .5; }

.up-drop {
  margin-top: 10px; padding: 12px; text-align: center; font-size: 12.5px; color: var(--faint);
  border: 1px dashed var(--border); border-radius: 12px; transition: all .18s ease;
}
.up-drop.is-over { border-color: var(--accent-2); color: var(--accent-2); background: rgba(102,217,192,.07); }
.up-drop.is-busy { color: var(--accent); border-color: rgba(124,156,255,.5); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }

.up-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.up-item {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  font-size: 12.5px; padding: 7px 10px; border-radius: 9px;
  background: var(--surface); border: 1px solid var(--border);
}
.up-item b { font-weight: 600; }
.up-item span { color: var(--faint); font-size: 12px; }
.up-item.ok b { color: var(--good); }
.up-item.bad b { color: var(--bad); }
.up-tip { font-size: 12px; margin: 10px 0 0; }

@media (max-width: 480px) {
  .up-row { grid-template-columns: 1fr; }
  .up-btn { flex-direction: row; justify-content: center; gap: 8px; padding: 13px; }
}
