/* ===== 背单词 · 独立板块（自含视觉系统，与英语模块同族宣纸色） ===== */
:root {
  --paper: #f3eee1; --paper-deep: #eae3d0; --card: #fcfaf2;
  --ink: #2e2b24; --text: #3d392f; --text-dim: #8a8172;
  --gold: #9a7b1c; --gold-deep: #7c6213; --green: #4a7c4e; --blue: #3a6a8c;
  --line: #ddd3bc;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "SimSun", serif;
  --kai: "Kaiti SC", "STKaiti", "KaiTi", serif;
  --en: "Georgia", "Times New Roman", "Songti SC", serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: var(--paper); color: var(--text); font-family: var(--serif); font-size: 17px; min-height: 100vh; -webkit-font-smoothing: antialiased; }
button { font-family: inherit; cursor: pointer; }
a { color: inherit; }
.app { max-width: 560px; margin: 0 auto; padding: 18px 18px 70px; -webkit-tap-highlight-color: transparent; }
.btn { border: 1px solid var(--line); background: var(--paper); color: var(--text); border-radius: 8px;
  padding: 9px 18px; font-size: 15px; transition: all .2s ease; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { border-color: var(--gold); color: var(--gold-deep); }
.btn.primary { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn.primary:hover { background: var(--gold-deep); }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; }
.btn:disabled { opacity: .45; cursor: default; }
.loading { text-align: center; padding: 80px 0; color: var(--text-dim); letter-spacing: .1em; }

/* ===== 首页 ===== */
.home-head { text-align: center; padding: 34px 0 6px; }
.home-head .seal { width: 54px; height: 54px; border: 2px solid var(--gold); border-radius: 8px; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center; font-family: var(--kai); font-size: 28px;
  color: var(--gold-deep); transform: rotate(-3deg); background: var(--card); box-shadow: 0 6px 18px rgba(120,95,30,.12); }
.home-head h1 { font-family: var(--kai); font-weight: 400; font-size: 34px; letter-spacing: .14em; color: var(--ink); }
.home-head .sub { color: var(--text-dim); margin-top: 8px; font-size: 14.5px; letter-spacing: .06em; }
.totals { margin: 20px 0 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); padding: 18px 18px 14px; }
.totals .row { display: flex; align-items: baseline; gap: 10px; margin: 6px 0; }
.totals .row b { font-size: 26px; font-family: var(--en); color: var(--gold-deep); min-width: 52px; }
.totals .row span { font-size: 14px; color: var(--text-dim); }
.totals .bar { height: 6px; border-radius: 3px; background: var(--paper-deep); overflow: hidden; margin: 4px 0 10px; }
.totals .bar i { display: block; height: 100%; background: var(--gold); }
.totals .bar.g i { background: var(--green); }
.start-big { width: 100%; margin-top: 16px; padding: 16px; font-size: 19px; letter-spacing: .1em; border-radius: 12px; justify-content: center; }
.home-links { display: flex; justify-content: space-between; margin-top: 14px; font-size: 14px; }
.home-links a { color: var(--text-dim); text-decoration: none; border-bottom: 1px dashed var(--line); }
.recent { margin-top: 24px; }
.recent h3 { font-family: var(--kai); font-weight: 400; font-size: 17px; color: var(--ink); margin-bottom: 8px; }
.recent .r { display: flex; gap: 10px; font-size: 13.5px; color: var(--text-dim); padding: 6px 2px; border-bottom: 1px dashed var(--line); }
.recent .r b { color: var(--text); font-weight: 400; }

/* ===== 轮次：进度条 ===== */
.prog { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.prog .bar { flex: 1; height: 5px; border-radius: 3px; background: var(--paper-deep); overflow: hidden; }
.prog .bar i { display: block; height: 100%; background: var(--gold); border-radius: 3px; transition: width .3s ease; }
.prog .n { font-size: 13px; color: var(--text-dim); letter-spacing: .05em; min-width: 52px; text-align: right; }
.q { text-align: center; padding: 26px 0 8px; min-height: 150px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.q .word { font-family: var(--en); font-size: 46px; color: var(--ink); line-height: 1.15; }
.q .orb { width: 92px; height: 92px; border-radius: 50%; border: 2px solid var(--gold); background: var(--card);
  display: flex; align-items: center; justify-content: center; font-size: 42px; cursor: pointer;
  transition: transform .15s ease; box-shadow: 0 8px 22px rgba(90,75,35,.12); }
.q .orb:active { transform: scale(.94); }
.q .orb.playing { animation: pulse 1s ease infinite; background: #f6efdb; }
@keyframes pulse { 50% { transform: scale(1.06); } }
.q .re { font-size: 12.5px; color: var(--text-dim); }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.opt { border: 1.5px solid var(--line); background: var(--card); border-radius: 13px; padding: 17px 12px;
  font-size: 17px; color: var(--ink); cursor: pointer; transition: all .13s ease; line-height: 1.5; }
.opt:active { transform: scale(.97); }
.opt.right { border-color: var(--green); background: #eef6ec; }
.opt.wrong { border-color: #d8a29a; background: #f9eeec; color: #8a5a50; }
.opt:disabled { cursor: default; }
/* 反馈完整卡：大图在上，文字在下 */
.reveal { margin-top: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper);
  padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 12px; animation: up .25s ease; cursor: pointer; }
@keyframes up { from { opacity: 0; transform: translateY(8px); } }
.reveal img { width: min(88%, 430px); aspect-ratio: 4/3; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }
.reveal .t { width: 100%; min-width: 0; text-align: center; }
.reveal .en { font-family: var(--en); font-size: 22px; color: var(--ink); }
.reveal .py { font-size: 13.5px; color: var(--gold-deep); margin-top: 2px; }
.reveal .zh { font-size: 15.5px; color: var(--text); margin-top: 6px; }
.ok-mark { width: 66px; height: 66px; border-radius: 50%; background: var(--green); color: #fff; font-size: 40px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; margin: 16px auto 0; animation: pop .25s ease;
  box-shadow: 0 6px 16px rgba(60,120,70,.28); }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
/* 掌握度进度 */
.mp { margin-top: 10px; }
.mp .bar { height: 4px; background: var(--paper-deep); border-radius: 2px; overflow: hidden; }
.mp .bar i { display: block; height: 100%; background: var(--green); transition: width .3s ease; }
.mp .t { display: block; font-size: 11.5px; color: var(--text-dim); margin-top: 4px; letter-spacing: .03em; }
.mp.done .done-tag { color: #2E7D4F; font-weight: 700; font-size: 15px; letter-spacing: .1em; }
/* 新词讲解卡 */
.teach { margin-top: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--card);
  padding: 22px 18px; text-align: center; box-shadow: 0 8px 22px rgba(90,75,35,.08); animation: up .25s ease; cursor: pointer; }
.teach img { width: min(88%, 430px); aspect-ratio: 4/3; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }
.teach .en { font-family: var(--en); font-size: 34px; color: var(--ink); margin-top: 12px; }
.teach .py { font-size: 15px; color: var(--gold-deep); margin-top: 2px; }
.teach .zh { font-size: 18px; color: var(--text); margin-top: 8px; }
/* 内联重听小喇叭（讲解卡/翻面卡通用） */
.spk { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px;
  margin-left: 8px; border: 1px solid var(--line); border-radius: 50%; background: transparent;
  font-size: 13px; cursor: pointer; vertical-align: middle; padding: 0; }
.spk:active { transform: scale(.92); }
.teach .btn { margin-top: 18px; }
.teach .head { display: flex; gap: 8px; justify-content: center; align-items: center; margin-bottom: 12px; }
.teach .new-tag { display: inline-block; background: var(--gold); color: #fff; border-radius: 999px; padding: 5px 20px;
  font-size: 14.5px; letter-spacing: .2em; }
.grade-tag { display: inline-block; font-size: 11.5px; color: var(--text-dim); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
.lk { border: none; background: none; color: var(--gold-deep); font-size: 14.5px; display: inline-flex; gap: 5px; align-items: center; padding: 6px 10px; border-radius: 6px; }
.lk:hover { background: var(--paper-deep); }
/* 轮末/补漏结束面板 */
.end-panel { text-align: center; padding: 30px 0 10px; }
.end-panel .emoji { font-size: 52px; }
.end-panel h3 { font-family: var(--kai); font-weight: 400; font-size: 24px; color: var(--ink); margin: 14px 0 8px; }
.end-panel .nums { display: flex; gap: 10px; justify-content: center; margin: 18px 0; flex-wrap: wrap; }
.end-panel .num { border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; background: var(--card); }
.end-panel .num b { display: block; font-size: 24px; color: var(--gold-deep); }
.end-panel .num b.g { color: var(--green); }
.end-panel .num span { font-size: 12.5px; color: var(--text-dim); }
.end-panel .row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 6px; }

/* ===== 总览页 ===== */
.stats { max-width: 640px; }
.stats h2 { font-family: var(--kai); font-weight: 400; font-size: 22px; color: var(--ink); margin: 26px 0 10px; letter-spacing: .06em; }
.stats .back { font-size: 14px; color: var(--text-dim); text-decoration: none; border-bottom: 1px dashed var(--line); }
.s-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.s-cell { border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 14px; }
.s-cell .k { font-size: 12.5px; color: var(--text-dim); }
.s-cell .v { font-size: 22px; font-family: var(--en); color: var(--ink); margin-top: 4px; }
.s-cell .v small { font-size: 13px; color: var(--text-dim); }
.cal { display: flex; gap: 6px; align-items: flex-end; height: 90px; border-bottom: 1px solid var(--line); padding: 0 2px; }
.cal .d { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; height: 100%; }
.cal .d i { display: block; width: 70%; background: var(--gold); border-radius: 3px 3px 0 0; min-height: 2px; }
.cal .d span { font-size: 11px; color: var(--text-dim); }
.weak { width: 100%; border-collapse: collapse; font-size: 14px; }
.weak td { padding: 7px 4px; border-bottom: 1px dashed var(--line); }
.weak td:first-child { font-family: var(--en); font-size: 15.5px; color: var(--ink); }
.weak td:last-child { text-align: right; color: var(--text-dim); font-size: 12.5px; }
.set-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.set-row .k { font-size: 15px; color: var(--text); }
.set-row .k small { display: block; color: var(--text-dim); font-size: 12.5px; margin-top: 2px; }

/* 用户与登录 */
.user-line { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 13px; color: var(--text-dim); }
.user-line a { color: var(--text-dim); text-decoration: none; border-bottom: 1px dashed var(--line); }
.login-mask { position: fixed; inset: 0; background: rgba(40,32,18,.42); display: flex; align-items: center; justify-content: center; z-index: 90; animation: fadein .18s ease; }
@keyframes fadein { from { opacity: 0; } }
.login { width: min(88vw, 320px); background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px 20px 18px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 14px 40px rgba(60,48,20,.18); }
.login h3 { margin: 0 0 2px; font-size: 17px; color: var(--ink); }
.login input { height: 42px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); padding: 0 12px; font-size: 16px; color: var(--ink); outline: none; }
.login input:focus { border-color: var(--gold-deep); }
.lg-err { min-height: 16px; font-size: 12.5px; color: #b3564c; }
.login .btn { height: 42px; }
