/* Power Up 单词卡 · 墨绿主题
   纯静态、无外部字体/依赖，可直接双击 index.html 或部署到 Cloudflare Pages */

:root {
  --ink: #0E3B31;
  --ink-2: #14544A;
  --ink-3: #1E6B58;
  --ink-soft: #E8F0EA;
  --gold: #C9A227;
  --red: #D8463E;
  --bg: #F3F6F1;
  --bg-2: #EAF0E9;
  --surface: #FFFFFF;
  --line: #D9E4DB;
  --text: #1B2B26;
  --muted: #6B7F76;
  --seg-1: #FFD98A;
  --seg-2: #9FE3C0;
  --seg-3: #A9C9FF;
  --seg-4: #FFB3A7;
  --seg-5: #D9B8FF;
  --seg-6: #F2E7A0;
  --shadow: 0 18px 46px rgba(14, 59, 49, .14), 0 3px 10px rgba(14, 59, 49, .07);
  --radius: 22px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 560px at 8% -12%, #DCEBE0 0%, transparent 62%),
    radial-gradient(900px 520px at 100% 0%, #E6EFE6 0%, transparent 58%),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font-family: inherit; }
button { cursor: pointer; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.is-hidden { display: none !important; }
.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.app { max-width: 1000px; margin: 0 auto; padding: 26px 24px 30px; }

/* ---------- 顶栏 ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 13px; flex: none;
  background: linear-gradient(145deg, var(--ink-3), var(--ink));
  display: grid; place-items: center; color: #fff;
  box-shadow: 0 6px 16px rgba(14, 59, 49, .22);
}
.brand-mark .ico { width: 22px; height: 22px; }
.brand-text h1 { margin: 0; font-size: 20px; letter-spacing: .04em; color: var(--ink); font-weight: 700; }
.brand-text p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); letter-spacing: .02em; }
.top-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.book-select {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 10px; padding: 8px 10px; font-size: 13px; outline: none;
}
.book-select:focus-visible { box-shadow: 0 0 0 3px rgba(30, 107, 88, .18); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border-radius: 11px; padding: 9px 14px; font-size: 13.5px; font-weight: 600;
  border: 1px solid transparent; transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
  white-space: nowrap; line-height: 1.2;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(30, 107, 88, .28); }
.btn-ghost { background: rgba(255,255,255,.72); border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { background: #fff; border-color: #BFD3C5; }
.btn-outline { background: var(--surface); border-color: #BFD3C5; color: var(--ink); }
.btn-outline:hover { border-color: var(--ink-3); }
.btn-primary { background: var(--ink); color: #fff; box-shadow: 0 6px 14px rgba(14, 59, 49, .18); }
.btn-primary:hover { background: var(--ink-2); }
.btn-strong { background: var(--surface); border-color: var(--line); color: var(--ink); box-shadow: 0 3px 10px rgba(14, 59, 49, .05); }
.btn-strong:hover { border-color: var(--ink-3); box-shadow: 0 6px 16px rgba(14, 59, 49, .1); }

/* ---------- 单元标签 ---------- */
.unit-bar { margin-bottom: 18px; }
.unit-tabs { display: flex; flex-wrap: wrap; gap: 8px; padding: 3px 2px 9px; }
.unit-tab {
  flex: none; border: 1px solid var(--line); background: rgba(255,255,255,.78);
  color: var(--ink-2); border-radius: 999px; padding: 8px 15px;
  font-size: 13px; font-weight: 600; line-height: 1.2; transition: all .16s ease;
  display: inline-flex; align-items: center; gap: 7px;
}
.unit-tab:hover { border-color: var(--ink-3); background: #fff; }
.unit-tab.active { background: var(--ink); border-color: var(--ink); color: #fff; box-shadow: 0 5px 13px rgba(14, 59, 49, .2); }
.unit-tab .tab-num { font-size: 11.5px; opacity: .72; }
.unit-tab.active .tab-num { opacity: .85; }

/* ---------- 进度条 ---------- */
.progress-row { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 18px; }
.progress-wrap { flex: 1; min-width: 0; }
.progress-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.progress-text { font-size: 14px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.progress-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress-track { height: 10px; border-radius: 999px; background: #DFE9E0; overflow: hidden; box-shadow: inset 0 1px 2px rgba(14,59,49,.08); }
.progress-fill { height: 100%; width: 0%; border-radius: 999px; background: linear-gradient(90deg, var(--ink-3), #43A47F); transition: width .45s cubic-bezier(.4,0,.2,1); }
.progress-actions { display: flex; gap: 8px; flex: none; }

/* ---------- 卡片 ---------- */
.card-stage { height: 524px; perspective: 1600px; margin-bottom: 18px; }
.card { width: 100%; height: 100%; outline: none; cursor: pointer; }
.card:focus-visible { border-radius: var(--radius); box-shadow: 0 0 0 4px rgba(30,107,88,.3); }
/* 3D 翻转只在动画的半秒里临时施加（见 app.js 的 toggleFlip）。
   静止状态保持零 3D 变换：backface-visibility + rotateY(180deg) 会让整面
   退出浏览器命中测试，背面的按钮因此点不中、点击反而落到卡片上触发翻面。 */
.card-inner { position: relative; width: 100%; height: 100%; }
.card-face {
  position: absolute; inset: 0; border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column; box-shadow: var(--shadow);
}
.card-front {
  background:
    radial-gradient(700px 380px at 88% -10%, rgba(78, 160, 126, .42), transparent 62%),
    radial-gradient(560px 360px at 0% 110%, rgba(9, 40, 33, .6), transparent 60%),
    linear-gradient(150deg, #14564A 0%, #0E3B31 58%, #0A2E27 100%);
  color: #fff; border: 1px solid rgba(255,255,255,.1);
}
.card-front::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.055) 1px, transparent 1px);
  background-size: 22px 22px;
}
.card-back { display: none; background: var(--surface); border: 1px solid var(--line); color: var(--text); }
.card.flipped .card-front { display: none; }
.card.flipped .card-back { display: flex; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 0; flex: none; position: relative; z-index: 1; }
.card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 22px 18px; flex: none; position: relative; z-index: 1; }
.badge-count { font-size: 12px; letter-spacing: .04em; color: rgba(255,255,255,.74); background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); padding: 5px 11px; border-radius: 999px; }
.back-tag { font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.group-label { font-size: 12px; color: rgba(255,255,255,.62); }
.card-back .group-label { color: var(--muted); }
.flip-hint { font-size: 12px; color: rgba(255,255,255,.5); }
.card-back .flip-hint { color: var(--muted); }

.icon-btn {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  display: grid; place-items: center; border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.1); color: #fff; transition: all .18s ease;
}
.icon-btn:hover { background: rgba(255,255,255,.2); transform: scale(1.06); }
.icon-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(255,255,255,.4); }
.icon-btn .ico { width: 20px; height: 20px; }
.heart-btn.active { color: var(--red); background: #fff; border-color: #fff; }
.heart-btn.active .ico { fill: currentColor; }
.heart-btn.active:hover { background: #FFF2F1; }
/* 背面是白底，心形要单独配色，否则未收藏时白色半透明按钮几乎看不见 */
.card-back .heart-btn { background: #F1F5F1; border-color: var(--line); color: var(--ink-3); }
.card-back .heart-btn:hover { background: #E3EBE4; }
.card-back .heart-btn.active { background: #FFF2F1; border-color: #F3C9C4; color: var(--red); }
.card-back .heart-btn.active:hover { background: #FFE7E5; }

.front-center { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 6px 26px; position: relative; z-index: 1; }
.word-display {
  --word-size: 72px;
  font-size: var(--word-size); font-weight: 800; line-height: 1.12; letter-spacing: .012em;
  text-align: center; max-width: 100%; word-break: keep-all;
  text-shadow: 0 6px 26px rgba(0,0,0,.22); transition: transform .3s ease;
}
.seg { display: inline-block; }
.seg-0 { color: var(--seg-1); } .seg-1 { color: var(--seg-2); }
.seg-2 { color: var(--seg-3); } .seg-3 { color: var(--seg-4); }
.seg-4 { color: var(--seg-5); } .seg-5 { color: var(--seg-6); }
.seg-gap { display: inline-block; width: .32em; }
.seg-punct { color: rgba(255,255,255,.55); }
.word-display.fx-big { transform: scale(1.3); }
.word-display.fx-small { transform: scale(.62); }
.word-display.fx-tall { transform: scaleY(1.65); }
.word-display.fx-fast { transform: skewX(-13deg) rotate(-3deg); }
.ipa-row { display: flex; align-items: center; gap: 12px; }
.ipa { font-size: 21px; color: rgba(255,255,255,.88); letter-spacing: .02em; font-family: "Segoe UI", "Lucida Sans Unicode", "Arial Unicode MS", sans-serif; }
.speak-btn { width: 40px; height: 40px; }
.speak-btn.small { width: 30px; height: 30px; background: var(--ink-soft); border-color: var(--ink-soft); color: var(--ink); }
.speak-btn.small .ico { width: 16px; height: 16px; }
.speak-btn.small:hover { background: #D9E9DE; }
.shape-tip { margin: 0; max-width: 560px; text-align: center; font-size: 13.5px; line-height: 1.6; color: #FFE9A8; background: rgba(255,255,255,.09); border: 1px solid rgba(255,233,168,.25); border-radius: 12px; padding: 9px 14px; }

/* 背面 */
.back-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 26px 4px; scrollbar-width: thin; }
.back-scroll::-webkit-scrollbar { width: 7px; }
.back-scroll::-webkit-scrollbar-thumb { background: #CFDFD3; border-radius: 6px; }
.back-main { padding-bottom: 9px; border-bottom: 1px dashed var(--line); }
.back-line { display: flex; align-items: center; gap: 10px; }
.back-word { font-size: 28px; font-weight: 750; color: var(--ink); letter-spacing: .01em; }
.back-cn { font-size: 22px; font-weight: 700; color: var(--ink-3); margin-top: 2px; }
.example { margin-top: 9px; background: #F4F8F4; border-left: 3px solid var(--ink-3); border-radius: 0 10px 10px 0; padding: 8px 12px; display: flex; align-items: center; gap: 12px; }
.example-text { flex: 1; min-width: 0; }
.example .ex-en { font-size: 15px; line-height: 1.45; color: var(--text); }
.example .ex-en mark { background: #FFE9A8; color: var(--ink); border-radius: 4px; padding: 0 3px; font-weight: 700; }
.example .ex-cn { font-size: 13px; color: var(--muted); margin-top: 4px; }
.ex-speak {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid #CFDFD3; background: #fff; color: var(--ink-2);
  border-radius: 9px; padding: 7px 11px; font-size: 12.5px; font-weight: 650;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}
.ex-speak:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.ex-speak:active { transform: translateY(1px); }
.ex-speak:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(30,107,88,.22); }
.ex-speak .ico { width: 15px; height: 15px; }
.ex-speak.playing { background: var(--ink); color: #fff; border-color: var(--ink); }

.tricks { padding: 10px 0 6px; display: flex; flex-direction: column; gap: 8px; }
.trick { border: 1px solid var(--line); border-radius: 12px; padding: 8px 11px; background: #FCFDFC; }
.trick-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 5px; }
.trick-title { font-size: 12px; font-weight: 800; color: var(--ink); letter-spacing: .05em; background: var(--ink-soft); border-radius: 6px; padding: 3px 8px; }
.trick-tip { font-size: 12.5px; color: var(--muted); }
.trick-body { font-size: 13.5px; line-height: 1.6; color: var(--text); }
.hidden-word { font-size: 19px; font-weight: 800; letter-spacing: .02em; color: var(--ink); margin-bottom: 3px; }
.hidden-word .hit { color: #C2622D; font-size: 1.28em; padding: 0 2px; cursor: pointer; border-bottom: 2px dashed #C2622D; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; border: 1px solid #CFDFD3;
  background: #fff; color: var(--ink-2); border-radius: 8px; padding: 3px 9px;
  font-size: 13.5px; font-weight: 650; margin: 2px 5px 2px 0; transition: all .15s ease;
}
.chip:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip .combo { font-size: 11px; opacity: .62; font-weight: 500; }
.chip .diff { color: var(--red); font-weight: 800; text-decoration: underline; }
.chip:hover .diff { color: #FFB3A7; }
.trick-note { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.trick-fallback { font-size: 14px; color: var(--ink-2); line-height: 1.7; }

/* ---------- 控制按钮 ---------- */
.controls { display: flex; flex-direction: column; gap: 10px; }
.control-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.control-row .btn { min-width: 150px; padding: 12px 18px; font-size: 14px; }
.count-pill { min-width: 20px; height: 20px; border-radius: 999px; background: var(--ink-soft); color: var(--ink); display: inline-grid; place-items: center; font-size: 11.5px; padding: 0 5px; }
.judge-row { min-height: 46px; opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(-4px); transition: opacity .22s ease, transform .22s ease; }
.judge-row.show { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0); }
.btn-judge { min-width: 190px !important; }
.btn-no { background: #FFF1EF; border-color: #F3C9C4; color: #B23B34; }
.btn-no:hover { background: #FFE4E1; border-color: #E9A9A2; }
.btn-yes { background: #E9F6EE; border-color: #B9DEC7; color: #1C7047; }
.btn-yes:hover { background: #D8F0E1; border-color: #8FCBA7; }
.hint { text-align: center; font-size: 12px; color: var(--muted); margin: 18px 0 0; line-height: 1.7; }

/* ---------- 弹窗 ---------- */
.modal-layer { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(8, 32, 27, .55); backdrop-filter: blur(3px); }
.modal-panel {
  position: relative; width: min(720px, 100%); max-height: min(86vh, 820px);
  background: var(--surface); border-radius: 20px; box-shadow: 0 28px 80px rgba(6, 30, 24, .32);
  display: flex; flex-direction: column; overflow: hidden; animation: pop .22s cubic-bezier(.2,.8,.3,1);
}
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 14px; border-bottom: 1px solid var(--line); flex: none; }
.modal-head h2 { margin: 0; font-size: 18px; color: var(--ink); }
.modal-head .icon-btn { background: #F1F5F1; border-color: var(--line); color: var(--ink); width: 32px; height: 32px; }
.modal-head .icon-btn:hover { background: #E3EBE4; }
.modal-head .ico { width: 17px; height: 17px; }
.modal-body { padding: 18px 22px; overflow-y: auto; flex: 1; min-height: 0; scrollbar-width: thin; }
.modal-foot { padding: 0 22px 18px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; flex: none; }
.modal-foot:empty { display: none; }

.fav-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.fav-summary { font-size: 13px; color: var(--muted); }
.fav-list { display: flex; flex-direction: column; gap: 9px; }
.fav-row { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #FCFDFC; }
.fav-main { flex: 1; min-width: 0; }
.fav-word { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.fav-word .w { font-size: 16px; font-weight: 750; color: var(--ink); cursor: pointer; border-bottom: 1px dashed transparent; }
.fav-word .w:hover { border-bottom-color: var(--ink-3); }
.fav-word .ipa { font-size: 12.5px; color: var(--muted); }
.fav-word .cn { font-size: 12.5px; color: var(--muted); }
.dots { display: inline-flex; gap: 5px; align-items: center; }
.dot { width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid #BFD3C5; background: transparent; }
.dot.on { background: #43A47F; border-color: #43A47F; box-shadow: 0 0 0 2px rgba(67,164,127,.14); }
.fav-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.mini-btn { border: 1px solid var(--line); background: #fff; color: var(--ink-2); border-radius: 8px; padding: 6px 9px; font-size: 12.5px; display: inline-flex; align-items: center; gap: 5px; }
.mini-btn:hover { border-color: var(--ink-3); background: #F4F8F4; }
.mini-btn .ico { width: 14px; height: 14px; }
.mini-btn.danger:hover { border-color: #E9A9A2; color: #B23B34; background: #FFF4F3; }
.empty { text-align: center; color: var(--muted); font-size: 14px; padding: 34px 10px; line-height: 1.8; }

/* 听写 */
.dict-progress { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.dict-bar { height: 7px; border-radius: 999px; background: #E6EEE7; overflow: hidden; margin-bottom: 20px; }
.dict-bar > div { height: 100%; background: linear-gradient(90deg, var(--ink-3), #43A47F); transition: width .3s ease; }
.dict-card { text-align: center; padding: 8px 0 4px; }
.dict-cn { font-size: 34px; font-weight: 750; color: var(--ink); margin-bottom: 6px; }
.dict-label { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.dict-answer { display: flex; gap: 9px; justify-content: center; flex-wrap: wrap; }
.dict-answer input {
  width: min(340px, 78%); padding: 12px 16px; font-size: 20px; text-align: center;
  border: 1.5px solid #C9DCCE; border-radius: 12px; outline: none; color: var(--ink); background: #fff;
}
.dict-answer input:focus { border-color: var(--ink-3); box-shadow: 0 0 0 3px rgba(30,107,88,.13); }
.dict-answer input:disabled { background: #F5F8F5; }
.dict-feedback { min-height: 62px; margin-top: 18px; display: grid; place-items: center; }
.dict-ok { color: #1C7047; font-size: 17px; font-weight: 700; }
.dict-bad { color: #B23B34; font-size: 17px; font-weight: 700; }
.dict-bad .correct { display: block; font-size: 22px; color: var(--ink); margin-top: 5px; letter-spacing: .03em; }
.dict-tools { display: flex; gap: 9px; justify-content: center; flex-wrap: wrap; margin-top: 6px; }
.dict-result-list { display: flex; flex-direction: column; gap: 7px; margin-top: 8px; }
.dict-result-row { display: flex; align-items: center; gap: 8px; font-size: 14px; padding: 8px 11px; border-radius: 9px; background: #F7FAF7; }
.dict-result-row .ok { color: #1C7047; } .dict-result-row .bad { color: #B23B34; }
.score { font-size: 46px; font-weight: 800; color: var(--ink); text-align: center; line-height: 1.2; }
.score-sub { text-align: center; color: var(--muted); font-size: 13px; margin: 6px 0 18px; }

/* 庆祝 */
.celebrate { text-align: center; padding: 8px 0 4px; }
.celebrate .badge { width: 68px; height: 68px; border-radius: 50%; margin: 0 auto 14px; display: grid; place-items: center; background: #FFF4D3; color: #B98A0E; }
.celebrate .badge .ico { width: 34px; height: 34px; stroke-width: 1.6; }
.celebrate h3 { margin: 0 0 6px; font-size: 21px; color: var(--ink); }
.celebrate p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.7; }

/* 关系图 */
.map-wrap { border: 1px solid var(--line); border-radius: 14px; background: #FBFCFB; padding: 8px; overflow-x: auto; }
.map-svg { display: block; width: 100%; height: auto; min-width: 560px; }
.map-node { cursor: pointer; }
.map-node rect { transition: stroke .16s ease, stroke-width .16s ease; }
.map-node:hover rect { stroke: var(--ink) !important; stroke-width: 2.4; }
.map-node:hover text { font-weight: 800; }
.map-node text { pointer-events: none; }
.map-svg text { font-family: inherit; }
.map-title { font-size: 13px; font-weight: 700; fill: var(--ink); }
.map-note { font-size: 11px; fill: var(--muted); }
.map-link { stroke: #B9CFBF; stroke-width: 1.6; fill: none; }
.map-box { fill: #FFFFFF; stroke: #DCE8DE; stroke-width: 1.2; }
.map-hint { font-size: 12.5px; color: var(--muted); margin: 10px 2px 0; line-height: 1.6; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 11px 20px; border-radius: 999px;
  font-size: 13.5px; box-shadow: 0 12px 30px rgba(8,32,27,.3); z-index: 80;
  animation: toastIn .22s ease; max-width: min(90vw, 520px); text-align: center;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- 响应式 ---------- */
@media (max-width: 760px) {
  .app { padding: 18px 14px 26px; }
  .topbar { flex-wrap: wrap; gap: 12px; }
  .top-actions { width: 100%; justify-content: flex-start; }
  .progress-row { flex-direction: column; align-items: stretch; gap: 12px; }
  .progress-actions { justify-content: flex-start; }
  .progress-actions .btn { flex: 1; }
  .card-stage { height: 470px; }
  .word-display { --word-size: 56px; }
  .ipa { font-size: 18px; }
  .card-top { padding: 14px 16px 0; }
  .card-bottom { padding: 0 16px 14px; }
  .front-center { padding: 6px 14px; gap: 14px; }
  .back-scroll { padding: 10px 16px 4px; }
  .control-row .btn { min-width: 0; flex: 1 1 45%; padding: 11px 10px; font-size: 13px; }
  .btn-judge { min-width: 0 !important; }
  .modal-layer { padding: 10px; }
  .modal-panel { max-height: 92vh; }
  .modal-body { padding: 14px 16px; }
  .modal-foot { padding: 0 16px 14px; }
  .fav-row { flex-wrap: wrap; }
}
@media (max-width: 420px) {
  .word-display { --word-size: 46px; }
  .card-stage { height: 448px; }
  .hint { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
