/* 英语模块专用样式。继承 theme.css 的 iOS 令牌与 components.css 的通用组件，
   这里只补默写引擎需要的排版（下划线槽位、词卡、键位栏）。 */

/* ---- 页面基线 ----
   theme.css 的 `html,body{min-height:100%}` 在 html 没有 height 时按规范退化为 0，
   于是 body 只有内容那么高；而 html 又被铺了 --bg 平色，结果就是"渐变没到底、下方露出纯色块"。
   另外 theme.css 没有 margin reset，body 还留着浏览器默认 8px 外边距。
   这段只写在 english.css 里 ⇒ 只影响英语模块的页面，不动全站基准。 */
html { height: 100%; }
body { margin: 0; min-height: 100dvh; display: flex; flex-direction: column; }

:root {
  --en-pos-pron: #ef4444;
  --en-pos-verb: #16a34a;
  --en-pos-noun: #2563eb;
  --en-pos-adj: #d97706;
  --en-pos-adv: #9333ea;
  --en-pos-det: #0891b2;
  --en-pos-prep: #64748b;
  --en-pos-conj: #db2777;
  --en-pos-num: #b45309;
  --en-pos-int: #0284c7;
  --en-pos-abbr: #64748b;
  --en-pos-unknown: #9ca3af;
  --en-line-idle: #d1d5db;
  --en-line-wrong: #ef4444;
  --en-line-correct: var(--text-secondary, #8e8e93);
  --en-line-active: #a855f7;
}
[data-theme="dark"] {
  --en-pos-pron: #ff7b7b;
  --en-pos-verb: #5ee08a;
  --en-pos-noun: #7db4ff;
  --en-pos-adj: #ffc45c;
  --en-pos-adv: #c89bff;
  --en-pos-det: #5ee0e0;
  --en-pos-prep: #a8b3c7;
  --en-pos-conj: #ff8fc7;
  --en-pos-num: #f0b46a;
  --en-pos-int: #6fd7ff;
  --en-pos-abbr: #a8b3c7;
  --en-pos-unknown: #8e8e93;
  --en-line-idle: rgba(235, 235, 245, 0.25);
  --en-line-wrong: #ff8a80;
  --en-line-correct: var(--text-secondary, #8e8e93);
  --en-line-active: #c89bff;
}

/* width:100% 不能省：body 变成 flex 容器后 .en-shell 成了 flex 项，
   原有的 margin:0 auto 会让宽度退化成内容宽（宽屏上宫格会塌）。 */
.en-shell { position: relative; width: 100%; max-width: 880px; margin: 0 auto; padding: var(--sp-4) var(--sp-4) var(--sp-6); flex: 1; min-height: 0; }
#app { flex: 1; display: flex; flex-direction: column; min-height: 0; }
/* 手机和触屏平板共用的隐藏输入框；不能只放在小屏媒体查询里，否则平板上会露出普通输入框。 */
.en-mobile-input {
  position: fixed; left: 0; bottom: 0; width: 1px; height: 1px;
  opacity: .01; border: 0; padding: 0; font-size: 16px;
  pointer-events: none;
}

/* flex: 0 0 auto 是必须的：父级 .en-shell 是 min-height:0 的 flex 项，会把 .en-head 压矮，
   而 .en-head 带着 flex-wrap: wrap —— 一旦被压矮 + 方向变 column，就会"高度不够换列"，
   工具栏被挤到第二列叠在一起（上一版工具栏重叠就是这么来的）。 */
/* justify-content: space-between 负责「标题 + 单个按钮」这种两元素场景（返回 / 退出 靠右），
   .en-toolbar 自己的 margin-left:auto 负责「工具栏换行后独占一行」时仍贴右。两个都要。 */
.en-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2); margin-bottom: var(--sp-3); flex: 0 0 auto; }
.en-title { font-size: var(--fs-lg); font-weight: 600; color: var(--text-primary); }
.en-sub { font-size: var(--fs-xs); color: var(--text-secondary); margin-top: 2px; }

/* margin-left:auto 而不是 justify-content:space-between：工具栏若因放不下而换到下一行、
   独占一行时，space-between 会把单独一项推到左边，auto 外边距则稳定贴右。
   flex: 0 0 auto + max-width:100% + 子项不可压缩 ⇒ 空间不够时"工具内部换行"（仍靠右），
   而不是整块溢出压到标题上。 */
.en-toolbar { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px 8px; margin-left: auto; max-width: 100%; flex: 0 0 auto; }
.en-toolbar > * { flex: 0 0 auto; }
/* 工具栏现在只有 3 个按钮，原先给「语速/重复」两个 select 打的 nowrap/flex 补丁已不再需要 */

/* ---- 选词书后的练习设置弹窗：章节网格 + 词数滚轮 ---- */
/* overflow-y:auto 会让另一轴按规范也变成 auto ⇒ 内容只要横向溢出 1px，
   弹窗内容区底部就会长出一条可左右拖的横向滚动条（用户报的"没什么用的那条"）。
   所以两轴都显式声明，横向一律 hidden。 */
.en-setup { max-width: 560px; overflow-x: hidden; }
.en-setup .modal-body { max-height: 64vh; overflow-y: auto; overflow-x: hidden; }

/* 章节：11 个格子（全部 + 第1..10章），标题 + 已练计数两行 */
.en-chap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.en-chap {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 0; overflow: hidden;
  padding: 8px 6px; border: 1px solid var(--hairline); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text-primary); font-family: inherit; cursor: pointer;
  transition: var(--transition);
}
.en-chap b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.en-chap b { font-size: var(--fs-sm); font-weight: 600; }
.en-chap span { font-size: 10px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.en-chap:hover { border-color: var(--accent-soft); }
.en-chap.active { background: var(--accent); border-color: var(--accent); color: var(--text-on-accent); }
.en-chap.active span { color: rgba(255, 255, 255, .82); }

/* 词数滚轮：靠 scroll-snap 实现，无第三方依赖；中间一条高亮带 */
.en-wheel { position: relative; height: 180px; overflow: hidden; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--hairline); }
.en-wheel-band {
  position: absolute; left: 0; right: 0; top: 72px; height: 36px; pointer-events: none;
  background: var(--accent-soft); border-top: 1px solid var(--accent-soft); border-bottom: 1px solid var(--accent-soft);
}
.en-wheel-scroll {
  height: 100%; overflow-y: auto; overflow-x: hidden; scroll-snap-type: y mandatory;
  scrollbar-width: none; -ms-overflow-style: none;
}
.en-wheel-scroll::-webkit-scrollbar { width: 0; height: 0; }
.en-wheel-item {
  height: 36px; display: flex; align-items: center; justify-content: center;
  scroll-snap-align: center; font-size: var(--fs-sm); color: var(--text-muted);
  font-variant-numeric: tabular-nums; cursor: pointer; user-select: none;
}
.en-wheel-item.active { color: var(--text-primary); font-weight: 600; font-size: var(--fs-md); }

/* 比例滑块：给个看得见的手感 */
.en-range { width: 100%; accent-color: var(--accent); }
.en-start-no { max-width: 180px; }
.en-wrong { max-width: 420px; }
.en-finish { max-width: 420px; }
.en-finish .modal-body { text-align: center; }

/* 设置弹层：分段控件上方的小标题 + 说明 */
.en-set-row { margin-bottom: var(--sp-4); }
.en-set-row:last-child { margin-bottom: 0; }
.en-set-label { font-size: var(--fs-sm); font-weight: 600; color: var(--text-primary); margin-bottom: 8px; }
.en-set-row .en-hint { margin-top: 6px; }

.en-progress { height: 6px; border-radius: 999px; background: var(--selected-bg); overflow: hidden; margin-bottom: var(--sp-4); }
.en-progress span { display: block; height: 100%; background: var(--accent); transition: width .25s var(--ease); }

.en-card-box { padding: var(--sp-6) var(--sp-5); display: flex; flex-direction: column; align-items: center; gap: var(--sp-5); }
.en-prompt { font-size: var(--fs-lg); line-height: 1.6; color: var(--text-primary); text-align: center; max-width: 640px; }
.en-prompt-en { font-size: var(--fs-xl); line-height: 1.45; font-weight: 650; letter-spacing: .01em; text-align: center; }
.en-zh-answer { width: 100%; max-width: 420px; margin: 0 auto; display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
.en-zh-input {
  width: 100%;
  min-height: 54px;
  height: 54px;
  max-height: 160px;
  box-sizing: border-box;
  resize: none;
  overflow-y: auto;
  padding: 8px 6px 7px;
  border: 0;
  border-bottom: 2px solid var(--en-line-idle, #d1d5db);
  border-radius: 0;
  background: transparent;
  color: var(--en-line-active, #a855f7);
  font: inherit;
  font-size: 21px;
  font-weight: 500;
  line-height: 1.45;
  text-align: center;
  outline: none;
  box-shadow: none;
}
.en-zh-input::placeholder { color: var(--text-muted); font-size: 14px; font-weight: 400; }
.en-zh-input:focus { border-bottom-color: var(--en-line-active, #a855f7); box-shadow: none; }
.en-zh-input.is-wrong { border-bottom-color: var(--error); color: var(--error-text); background: transparent; box-shadow: none; }
.en-zh-submit { align-self: center; min-width: 128px; }
.en-zh-ref { max-width: 420px; margin: 2px auto 0; padding: 8px 10px; border-radius: 10px; background: var(--gold-bg, rgba(201,164,96,.10)); color: var(--text-secondary); font-size: 12px; line-height: 1.55; text-align: center; }
.en-zh-ref b { color: var(--text-primary); font-weight: 600; }

/* ---- 下划线槽位：一个词一条连续线，线条中间不画光标 ---- */
.en-slots { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 22px 26px; }
.en-slot { display: inline-flex; flex-direction: column; align-items: center; cursor: pointer; }
.en-slot:hover .en-slot-letters { background: var(--accent-tint); border-radius: 8px; }
.en-slot-letters { display: flex; justify-content: center; height: 60px; font-size: 45px; font-weight: 500; line-height: 1; }
/* 定宽会让 m/w 这类宽字母挤在一起 ⇒ 改用 min-width + 左右内边距，下划线仍是一整条 */
.en-cell { display: inline-flex; min-width: 30px; padding: 0 2px; align-items: flex-end; justify-content: center; }
.en-slot-line { display: block; width: 100%; height: 2px; border-radius: 2px; margin-top: 4px; transition: background .15s var(--ease); }
/* 字母着色：迁移时留下了 Tailwind 的 text-red-500 那套类名，本项目没有工具类 ⇒ 一直是"提交后毫无变化" */
.en-ch { color: var(--text-primary); transition: color .12s var(--ease); }
.en-ch.is-right { color: var(--text-secondary); }
.en-ch.is-wrong { color: var(--error-text); }

/* ---- 答对后的词卡：音标 → 单词 → 词性色线（紧贴单词）→ 词性 → 中文 ---- */
.en-cards { display: flex; flex-wrap: wrap; justify-content: center; gap: 26px; }
.en-card { display: flex; flex-direction: column; align-items: center; min-width: 76px; }
.en-card-phone { font-size: var(--fs-xs); color: var(--text-muted); min-height: 16px; }
.en-card-word { font-size: 34px; font-weight: 600; color: var(--text-primary); }
.en-card-line { width: 64px; height: 2px; border-radius: 2px; margin-top: 4px; }
.en-card-pos { font-size: var(--fs-xs); color: var(--text-secondary); margin-top: 4px; }
.en-card-zh { font-size: var(--fs-xs); color: var(--text-secondary); margin-top: 2px; text-align: center; max-width: 144px; }

/* ---- 看答案 ---- */
.en-answer { font-size: var(--fs-sm); color: var(--text-secondary); text-align: center; }
.en-answer b { color: var(--text-primary); }

/* ---- 练习态：撑满剩余高度，键位栏沉到窗口底部 ---- */
.en-play { display: flex; flex-direction: column; }
.en-play .card.en-card-box { flex: 1; justify-content: center; }
.en-play .en-keybar { margin-top: var(--sp-4); }

/* 开课预览：让标题、课程卡、起始句和开始按钮形成完整重心 */
.en-opening {
  padding-top: clamp(42px, 8vh, 88px);
  padding-bottom: clamp(32px, 6vh, 64px);
}
.en-opening .en-head { margin-bottom: var(--sp-4); }
.en-opening .en-card-box {
  border-color: var(--gold-border);
  background: linear-gradient(180deg, var(--surface), var(--gold-bg-soft));
  box-shadow: var(--shadow), inset 0 1px 0 var(--warm-highlight);
}
.en-opening .en-lesson { max-height: min(42vh, 380px); }

/* 语法课程表起始句 + 练习页左右切句 */
.en-start-pick {
  width: 100%; max-width: 560px; box-sizing: border-box;
  margin: 2px 0 2px; padding: 14px 16px 12px; border-radius: 14px;
  border: 1px solid var(--gold-border);
  background: linear-gradient(145deg, var(--gold-bg), var(--gold-bg-soft));
}
.en-start-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.en-start-kicker { color: var(--gold-text); font-size: 11px; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; }
.en-start-counter { color: var(--text-muted); font: 600 10px/1 var(--font-mono); letter-spacing: .08em; }
.en-start-rail { display: flex; flex-wrap: wrap; gap: 6px; }
.en-start-dot {
  width: 36px; height: 28px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--hairline, rgba(120,120,128,.16)); border-radius: 8px;
  background: var(--fill-1); color: var(--text-secondary);
  font: 600 10px/1 var(--font-mono); cursor: pointer;
  transition: color .15s var(--ease), border-color .15s var(--ease), background .15s var(--ease), transform .15s var(--ease);
}
.en-start-dot:hover { color: var(--gold-text); border-color: var(--gold-border-strong); transform: translateY(-1px); }
.en-start-dot.active {
  color: var(--gold-strong); border-color: var(--gold-border-strong);
  background: linear-gradient(145deg, var(--gold-bg), var(--gold-bg-soft));
  box-shadow: 0 4px 12px var(--gold-glow);
}
.en-start-dot:focus-visible { outline: 2px solid var(--gold-border-strong); outline-offset: 2px; }
.en-start-preview { margin-top: 11px; padding-top: 9px; border-top: 1px solid var(--gold-border); }
.en-start-preview-en { margin: 0; color: var(--text-primary); font-size: var(--fs-sm); line-height: 1.55; }
.en-start-preview-zh { margin: 2px 0 0; color: var(--text-secondary); font-size: var(--fs-xs); line-height: 1.55; }

.en-item-nav {
  position: fixed; z-index: 35; bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  width: 52px; height: 52px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 0; background: transparent; color: var(--gold-text); padding: 0;
  box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none;
  cursor: pointer; transition: color .16s var(--ease), transform .16s var(--ease), opacity .16s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.en-item-nav svg { filter: drop-shadow(0 2px 3px var(--warm-shadow)); }
.en-item-nav.prev { left: max(18px, calc(50% - 440px)); }
.en-item-nav.next { right: max(18px, calc(50% - 440px)); }
.en-item-nav:hover:not(:disabled) { color: var(--gold-strong); transform: translateY(-1px) scale(1.08); }
.en-item-nav:active:not(:disabled) { transform: scale(.94); }
.en-item-nav:focus-visible { outline: 2px solid var(--gold-border-strong); outline-offset: 6px; }
.en-item-nav:disabled { opacity: .24; cursor: not-allowed; color: var(--text-muted); }
@media (max-width: 960px) {
  .en-item-nav { bottom: calc(132px + env(safe-area-inset-bottom, 0px)); width: 46px; height: 46px; z-index: 42; }
  .en-item-nav.prev { left: 8px; }
  .en-item-nav.next { right: 8px; }
}

/* ---- 底部键位栏 ---- */
.en-keybar { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: var(--sp-3); }
.en-audio-gate {
  align-self: center;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 34px; margin: 0 auto 10px; padding: 0 14px;
  border: 1px solid var(--gold-border); border-radius: 999px;
  background: linear-gradient(145deg, var(--gold-bg), var(--gold-bg-soft));
  color: var(--gold-text); font: 600 12px/1 var(--font-sans, -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif);
  cursor: pointer; white-space: nowrap;
}
.en-audio-gate:active { transform: scale(.97); }
.en-key { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border: 0; border-radius: 9px; background: transparent; cursor: pointer; }
.en-key:hover { background: var(--accent-tint); }
.en-key.active { background: var(--accent-soft); }
.en-key kbd {
  display: inline-flex; align-items: center; justify-content: center; min-width: 24px; padding: 3px 6px;
  font-family: var(--font-mono); font-size: 11px; line-height: 1; color: var(--text-secondary);
  background: var(--surface-solid); border: 1px solid var(--hairline-strong); border-radius: 5px;
  box-shadow: inset 0 -1px 0 var(--key-inset);
}
.en-key span { font-size: var(--fs-xs); color: var(--text-secondary); }

/* ---- 课程内容 / 预览 ---- */
.en-lesson {
  list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px;
  max-height: min(56vh, 460px); overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: none; -ms-overflow-style: none;          /* 去掉系统滚动条 */
}
.en-lesson::-webkit-scrollbar { width: 0; height: 0; }
/* 还能继续下滑时底边渐隐，比系统滚动条干净；滑到底后由 JS 摘掉 */
.en-lesson.is-scrollable { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 26px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 26px), transparent); }
.en-lesson.is-scrolled-end { -webkit-mask-image: none; mask-image: none; }
.en-lesson-item { display: block; width: 100%; padding: 8px 10px; border: 0; border-radius: 10px; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.en-lesson-item:hover { background: var(--fill-1); }
.en-lesson-item.active { background: var(--accent-tint); }
.en-lesson-tip { margin: -2px 0 8px; font-size: var(--fs-xs); color: var(--text-muted); }
.en-lesson-en { display: block; font-size: var(--fs-sm); color: var(--text-primary); }
.en-lesson-zh { display: block; font-size: var(--fs-xs); color: var(--text-secondary); margin-top: 2px; }
.en-lesson-pop { position: absolute; right: 12px; top: 56px; z-index: 40; width: min(22rem, 90vw); padding: var(--sp-3); }

/* ---- 课程表：起点选择 / 续练 / 乱序 / 筛选 ---- */
.en-course { width: min(780px, 94vw); height: min(88vh, 760px); max-height: min(88vh, 760px); display: flex; flex-direction: column; overflow: hidden; }
.en-course .modal-body { flex: 1 1 auto; display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow: hidden; }
.en-course-stats, .en-course-resume, .en-course-controls, .en-course-jump, .en-course-foot, .en-course-hint { flex: none; }
.en-course .modal-title { font-size: var(--fs-lg); }
.en-course-stats { display: flex; flex-wrap: wrap; gap: 6px; }
.en-course-stat {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px;
  border-radius: 999px; border: 1px solid var(--glass-border);
  background: var(--fill-1); color: var(--text-secondary);
  font-size: 11px; line-height: 1.5; white-space: nowrap;
}
.en-course-stat b { color: var(--text-primary); font-weight: 650; font-variant-numeric: tabular-nums; }
.en-course-stat.is-gold { border-color: var(--gold-border); background: var(--gold-bg); color: var(--gold-text); }
.en-course-stat.is-gold b { color: var(--gold-strong); }
.en-course-stat.is-wrong { border-color: var(--gold-border); background: var(--gold-bg-soft); color: var(--state-wrong); }
.en-course-stat.is-wrong b { color: var(--state-wrong); }

.en-course-resume {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px; border: 1px solid var(--gold-border); border-radius: 12px;
  background: linear-gradient(135deg, var(--gold-bg), var(--gold-bg-soft));
  color: var(--text-primary);
}
.en-course-resume[hidden] { display: none; }
.en-course-resume-text { display: flex; align-items: baseline; gap: 8px; min-width: 0; font-size: 12px; }
.en-course-resume-label { flex: none; color: var(--gold-text); font-size: 11px; letter-spacing: .04em; }
.en-course-resume b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.en-course-resume .btn { flex: none; }

.en-course-controls { display: grid; grid-template-columns: 1.1fr 1fr 1.5fr; gap: 10px 14px; }
.en-course-control { min-width: 0; }
.en-course-label { margin-bottom: 5px; font-size: 11px; color: var(--text-secondary); letter-spacing: .03em; }
.en-course-seg { display: flex; flex-wrap: wrap; }
.en-course-seg .seg-btn { flex: 1 1 auto; }
.en-course-select { width: 100%; min-height: 34px; padding: 6px 30px 6px 10px; border-radius: 9px; font-size: 12px; }
.en-course-filter-wrap { position: relative; }
.en-course-order-wrap { position: relative; }
.en-course-secondary { position: relative; margin-top: 6px; }
.en-course-secondary .seg { width: 100%; }
.en-course-secondary .seg-btn { flex: 1 1 auto; }
.en-review-menu {
  position: absolute; left: 0; top: calc(100% + 6px); z-index: 8;
  min-width: 132px; padding: 6px;
  border: 1px solid var(--glass-border); border-radius: 12px;
  background: var(--surface-strong); box-shadow: var(--shadow-lg);
  -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%);
}
.en-review-menu[hidden] { display: none; }
.en-review-menu button {
  display: block; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text-primary); font: inherit; font-size: 12px;
  text-align: left; cursor: pointer;
}
.en-review-menu button:hover, .en-review-menu button.active { background: var(--accent-soft); color: var(--accent-text); }

.en-course-jump { display: grid; grid-template-columns: auto minmax(120px, 1fr) minmax(160px, 1.1fr); align-items: center; gap: 10px; }
.en-course-pos { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-secondary); white-space: nowrap; }
.en-course-pos input {
  width: 62px; box-sizing: border-box; padding: 6px 7px; border: 1px solid var(--hairline, rgba(120,120,128,.18));
  border-radius: 9px; background: var(--input-bg); color: var(--text-primary);
  font: inherit; font-size: 12px; text-align: center; outline: none;
}
.en-course-pos input:focus, .en-course-search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.en-course-range { width: 100%; accent-color: var(--accent); cursor: pointer; }
.en-course-range:disabled { opacity: .35; cursor: not-allowed; }
.en-course-search {
  width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--hairline, rgba(120,120,128,.18));
  border-radius: 10px; background: var(--input-bg); color: var(--text-primary);
  font: inherit; font-size: 12px; outline: none; -webkit-appearance: none;
}

.en-course-list {
  position: relative; flex: 1 1 0; height: auto; min-height: 140px; overflow-y: auto; overscroll-behavior: contain;
  border: 1px solid var(--glass-border); border-radius: 12px; background: var(--surface-solid, var(--surface));
  scrollbar-width: none; -ms-overflow-style: none;
}
.en-course-list::-webkit-scrollbar { width: 0; height: 0; }
.en-course-list.is-scrollable {
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent);
}
.en-course-list.is-scrolled-end { -webkit-mask-image: none; mask-image: none; }
.en-course-spacer { position: relative; width: 100%; }
.en-course-rows { position: absolute; left: 0; right: 0; top: 0; }
.en-course-row {
  box-sizing: border-box; width: 100%; height: 46px; display: grid;
  grid-template-columns: 38px minmax(0, 1.5fr) minmax(0, 1fr) auto;
  align-items: center; gap: 8px; padding: 0 11px;
  border: 0; border-bottom: 1px solid var(--hairline, rgba(120,120,128,.10));
  background: transparent; color: var(--text-primary); font: inherit; text-align: left; cursor: pointer;
}
.en-course-row:hover { background: var(--fill-1); }
.en-course-row.selected { background: var(--accent-tint); box-shadow: inset 3px 0 0 var(--accent); }
.en-course-row-idx { color: var(--text-muted); font: 600 10px/1 var(--font-mono); }
.en-course-row-en { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 550; }
.en-course-row-zh { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: var(--text-secondary); }
.en-course-row-state { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; color: var(--text-muted); white-space: nowrap; }
.en-course-row-state::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .55; }
.en-course-row-state.is-learned { color: var(--state-learned); }
.en-course-row-state.is-wrong { color: var(--state-wrong); }
.en-course-empty { padding: 42px 16px; text-align: center; color: var(--text-secondary); font-size: 12px; }

.en-course-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.en-course-estimate { font-size: 11px; color: var(--text-secondary); }
.en-course-actions { display: flex; gap: 8px; margin-left: auto; }
.en-course-hint { margin: -4px 0 0; font-size: 11px; color: var(--text-muted); line-height: 1.5; }
.en-course-hint:empty { display: none; }

@media (max-width: 620px) {
  .en-course { width: 100%; height: 94vh; max-height: 94vh; }
  .en-course .modal-body { gap: 9px; }
  .en-course-controls { grid-template-columns: 1fr 1fr; }
  .en-course-control:last-child { grid-column: 1 / -1; }
  .en-course-jump { grid-template-columns: 1fr 1fr; }
  .en-course-search { grid-column: 1 / -1; }
  .en-course-list { min-height: 120px; }
  .en-course-row { grid-template-columns: 32px minmax(0, 1fr) auto; gap: 6px; }
  .en-course-row-zh { display: none; }
  .en-course-resume { align-items: flex-start; flex-direction: column; }
  .en-course-actions { width: 100%; }
  .en-course-actions .btn { flex: 1; }
}
@media (max-height: 700px) {
  .en-course .modal-body { gap: 8px; }
  .en-course-list { min-height: 110px; }
}

.en-center { display: flex; justify-content: center; margin-top: var(--sp-4); }
.en-center-col { display: flex; flex-direction: column; align-items: center; gap: var(--sp-3); min-height: 60vh; justify-content: center; }
.en-row { display: flex; gap: var(--sp-2); }
.en-row-between { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-2); }
.en-done { font-size: var(--fs-lg); font-weight: 600; color: var(--success-text); }
.en-empty { padding: 60px 0; text-align: center; color: var(--text-secondary); }

/* ---- 书架卡片 ---- */
.en-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--sp-3); }
.en-book { position: relative; display: flex; flex-direction: column; gap: 6px; padding: var(--sp-4); border-radius: var(--radius); background: var(--surface); border: 1px solid var(--glass-border); box-shadow: var(--shadow-sm); cursor: pointer; text-align: left; }
/* 卡片顶部信息行：分类在左，状态在右；不再用绝对定位压字 */
.en-book-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 18px; width: 100%; }
.en-book.has-del .en-book-top { padding-right: 26px; }
.en-book-del {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; padding: 0;
  border: 1px solid var(--hairline); border-radius: 50%;
  background: var(--surface-strong); color: var(--text-muted);
  cursor: pointer; -webkit-appearance: none; appearance: none;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.en-book-del:hover, .en-book-del:focus-visible {
  color: var(--error-text); border-color: var(--error-text);
  background: var(--error-soft); outline: none;
}
.en-book-del svg { display: block; pointer-events: none; }

/* 分类行：左边「分类」标题，右边「重置」按钮（恢复被移除的卡片） */
.en-cat-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.en-hidden-reset {
  display: inline-flex; align-items: center; gap: 3px;
  height: 26px; padding: 0 11px;
  border: 1px solid var(--hairline); border-radius: 999px;
  background: var(--surface); color: var(--text-secondary);
  font-family: inherit; font-size: 12px; font-weight: 600; line-height: 1;
  cursor: pointer; -webkit-appearance: none; appearance: none;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.en-hidden-reset:hover, .en-hidden-reset:focus-visible {
  color: var(--accent); border-color: var(--accent); background: var(--accent-soft); outline: none;
}
.en-hidden-reset[hidden] { display: none !important; }
.en-hidden-reset b { font-weight: 700; color: var(--accent); }
.en-book:hover { box-shadow: var(--shadow); }
.en-book.is-active { border-color: var(--accent); }
.en-book-badge { display: inline-block; align-self: center; padding: 1px 6px; border-radius: 6px; font-size: 10px; color: var(--accent); background: var(--accent-soft); }
.en-book-progress { display: flex; flex-direction: column; align-items: flex-end; margin-left: auto; align-self: center; font-size: 10px; line-height: 1.25; color: var(--text-secondary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.en-book-progress.is-below { margin-left: 0; align-self: flex-end; margin-top: -2px; }
/* 轻量状态标签：低饱和香槟金 / 石墨灰，细边 + 小圆点，不抢标题 */
.en-access-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 10px; font-weight: 600; line-height: 1.5;
  letter-spacing: .05em; white-space: nowrap;
}
.en-access-chip::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .6; flex: none; }
.en-access-chip.free { color: var(--gold-text); background: linear-gradient(135deg, var(--gold-bg), var(--gold-bg-soft)); border: 1px solid var(--gold-border); }
.en-access-chip.locked { color: var(--text-secondary); background: var(--fill-1); border: 1px solid var(--hairline); }
.en-book-title { font-size: var(--fs-md); font-weight: 600; color: var(--text-primary); }
.en-book-desc { font-size: var(--fs-xs); color: var(--text-secondary); line-height: 1.5; }
.en-book-count { font-size: var(--fs-xs); color: var(--text-secondary); font-weight: 500; }
.en-book-add { border: 2px dashed var(--accent-soft); background: var(--accent-tint); align-items: center; justify-content: center; text-align: center; }
.en-book-add .en-book-top { justify-content: center; }
.en-book-add .en-access-chip { align-self: center; }
/* 顶部激活 CTA：暖金轻玻璃，未激活显示，激活后 hidden */
.en-pro-cta {
  width: 100%; box-sizing: border-box;
  display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap;
  margin: 0 0 var(--sp-4); padding: 12px 16px;
  border: 1px solid var(--gold-border); border-radius: 14px;
  background: linear-gradient(135deg, var(--gold-bg), var(--gold-bg-soft));
  color: var(--text-primary); font: inherit; text-align: left; cursor: pointer;
  box-shadow: inset 0 1px 0 var(--warm-highlight), 0 8px 24px var(--warm-shadow);
  transition: var(--transition);
}
.en-pro-cta:hover { border-color: var(--gold-border-strong); transform: translateY(-1px); box-shadow: inset 0 1px 0 var(--warm-highlight), 0 10px 28px var(--warm-shadow); }
.en-pro-cta[hidden] { display: none; }
.en-pro-cta-main { font-size: 13px; font-weight: 600; letter-spacing: .02em; }
.en-pro-cta-sub { font-size: 11px; color: var(--text-secondary); margin-left: auto; }
.en-pro-cta-action { font-size: 12px; font-weight: 600; color: var(--gold-text); white-space: nowrap; }
@media (max-width: 520px) {
  .en-pro-cta {
    flex-wrap: nowrap;
    gap: 7px;
    padding: 10px 12px;
  }
  .en-pro-cta-main {
    flex: none;
    font-size: 12px;
    white-space: nowrap;
  }
  .en-pro-cta-sub {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    margin-left: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10.5px;
  }
  .en-pro-cta-action {
    flex: none;
    margin-left: auto;
    font-size: 11px;
  }
}
/* 选练习方式的弹窗：两张卡必须一样长，不能由内容撑开 */
#modeMask .modal-body { display: flex; flex-direction: column; gap: 10px; }
.en-book.mode-card { width: 100%; min-height: 76px; justify-content: center; }
.en-book.mode-card .en-book-title { font-size: var(--fs-lg); }
.en-book-add .en-book-title { color: var(--accent); }

.en-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: var(--sp-4); }
.en-tab { padding: 8px 16px; border-radius: var(--radius-pill); border: 0; background: var(--surface-solid); color: var(--text-secondary); font: inherit; font-size: var(--fs-sm); cursor: pointer; }
.en-tab.active { background: var(--accent); color: var(--text-on-accent); box-shadow: var(--shadow-accent); }

/* ---- 时态网格 ---- */
/* 手机 2 列 / 平板 3 列 / PC 固定 4 列 4 行（16 个时态刚好排满） */
.en-shell.en-syntax {
  max-width: 1000px;
  padding-top: clamp(52px, 9vh, 104px);
  padding-bottom: clamp(40px, 6vh, 76px);
}
.en-syntax::before {
  content: ""; position: absolute; z-index: 0; pointer-events: none;
  left: 4%; right: 4%; top: 36px; height: 300px;
  background:
    radial-gradient(ellipse at 22% 18%, var(--gold-bg), transparent 58%),
    radial-gradient(ellipse at 78% 8%, var(--accent-soft), transparent 62%);
  filter: blur(8px);
}
.en-syntax > * { position: relative; z-index: 1; }
.en-syntax .en-head { margin-bottom: 26px; }
.en-tense-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; grid-auto-rows: 1fr; margin-top: 22px; }
@media (min-width: 768px) { .en-tense-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .en-tense-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* 卡片是 <a>：不重置就会被浏览器默认画上整块下划线 */
.en-tense {
  position: relative; display: flex; flex-direction: column; gap: 6px; padding: 16px 18px;
  border-radius: var(--radius);
  background: linear-gradient(155deg, var(--surface), var(--gold-bg-soft));
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm), inset 0 1px 0 var(--warm-highlight);
  cursor: pointer; text-align: left; text-decoration: none;
  transition: transform .16s var(--ease), box-shadow .16s var(--ease), border-color .16s var(--ease);
}
.en-tense:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: var(--gold-border); }
.en-tense-idx { position: absolute; top: 14px; right: 16px; font: 600 11px/1 var(--font-mono); color: var(--text-muted); letter-spacing: .04em; }
.en-tense-name { font-size: var(--fs-lg); font-weight: 600; color: var(--text-primary); letter-spacing: -.01em; padding-right: 30px; white-space: nowrap; }
.en-tense-en { font-size: 11px; font-family: var(--font-mono); color: var(--accent); letter-spacing: .01em; }
/* 描述统一两行截断，避免同一行卡片高低不齐 */
.en-tense-desc { font-size: var(--fs-xs); color: var(--text-secondary); line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.en-tense-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--hairline); font-size: 11px; color: var(--text-muted); }
.en-tense-meta span { white-space: nowrap; }

/* ---- 表单 ---- */
.en-form { display: flex; flex-direction: column; gap: 18px; }
.en-form > label { display: flex; flex-direction: column; gap: 8px; }
.en-form-label { font-size: var(--fs-sm); color: var(--text-primary); font-weight: 500; margin-bottom: 2px; }
.en-form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 4px; flex-wrap: wrap; }
.en-warn { padding: 10px 12px; border-radius: 10px; background: var(--error-soft); color: var(--error-text); font-size: var(--fs-xs); line-height: 1.6; }
.en-hint { font-size: var(--fs-xs); color: var(--text-secondary); }
.en-hint.is-over { color: var(--error-text); }

/* 免费 1 小时倒计时（练习页） */
#en-free-pill {
  position: fixed; z-index: 99970; right: 14px;
  top: calc(var(--sw-dock-top, 12px) + 52px);
  left: auto; bottom: auto; transform: none;
  max-width: calc(100vw - 24px);
  padding: 7px 12px; border-radius: 999px;
  background: var(--free-pill-bg); color: var(--free-pill-text);
  border: 1px solid var(--gold-border);
  font: 600 12px/1.4 var(--font-sans, -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif);
  letter-spacing: .01em; box-shadow: 0 8px 24px var(--warm-shadow);
  font-variant-numeric: tabular-nums; pointer-events: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
@media (max-width: 480px) {
  #en-free-pill {
    /* 放在汉堡按钮左边，避免压住下面的消息 */
    right: calc(10px + 38px + 8px);
    top: var(--sw-dock-top, 12px);
    max-width: calc(100vw - 120px);
    font-size: 10.5px;
    padding: 6px 10px;
  }
}

/* ---- 全屏沉浸态：全屏的是整个文档（不是 #app），渐变背景继续铺满，内容放大、键位栏吸底 ---- */
.en-fs .en-shell { max-width: 1120px; padding-top: var(--sp-5); }
.en-fs .en-slot-letters { height: 78px; font-size: 56px; }
.en-fs .en-cell { min-width: 38px; }
.en-fs .en-card-word { font-size: 42px; }
.en-fs .en-prompt { font-size: var(--fs-xl); max-width: 820px; }
.en-fs .en-play .card.en-card-box { padding: var(--sp-7) var(--sp-6); }
.en-fs .en-toolbar { gap: 8px; }
.en-fs .en-keybar {
  position: sticky; bottom: 0; padding: var(--sp-2) 0 var(--sp-3);
  background: linear-gradient(to top, var(--bg) 62%, transparent);
}

@media (max-width: 640px) {
  .en-slot-letters { height: 48px; font-size: 36px; }
  .en-cell { min-width: 24px; }
  .en-card-word { font-size: 28px; }
  .en-card-box { padding: var(--sp-4) var(--sp-3); }
  .en-slot { gap: 18px; }
  /* 窄屏标题与工具栏上下排。column 必须配 flex-wrap: nowrap，
     否则"高度不够就换列"会把工具栏挤到标题右边（上一版的重叠就是这么产生的）。 */
  .en-head { flex-direction: column; align-items: stretch; flex-wrap: nowrap; }
  .en-toolbar { margin-left: 0; justify-content: flex-end; }
  /* 手机端时态卡：两列 + 更紧凑的内边距；最长时态名也不换行 */
  .en-tense { padding: 12px 10px; gap: 4px; }
  .en-tense-idx { top: 12px; right: 10px; }
  .en-tense-name { font-size: 11.5px; letter-spacing: -.03em; padding-right: 16px; }
  .en-start-rail { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .en-start-dot { width: 100%; }
}
@media (max-width: 380px) {
  .en-tense-name { font-size: 11px; }
}

/* ===== 英语模块手机端完整布局（767px 以下） ===== */
@media (max-width: 767px) {
  .en-shell {
    width: 100%;
    max-width: 100%;
    padding: 14px 14px calc(92px + env(safe-area-inset-bottom));
    box-sizing: border-box;
  }
  .en-head {
    flex-direction: column;
    align-items: stretch;
    gap: 9px;
    margin-bottom: 12px;
  }
  .en-head > .btn,
  .en-head > a.btn {
    align-self: flex-end;
    min-height: 40px;
  }
  .en-title { font-size: 20px; line-height: 1.25; }
  .en-sub { font-size: 12px; line-height: 1.55; }
  .en-toolbar {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
    gap: 7px;
  }
  .en-toolbar .btn { min-height: 38px; }

  /* 手机端练习页底部按键：每个按键内部居中 */
  .en-keybar .en-key { justify-content: center; }
  .en-keybar .en-key span { text-align: center; }
  /* 手机端不需要保存返回（底部已有退出） */
  #enSaveExitBtn { display: none !important; }
  /* 手机端英语模块不显示返回按钮，交给系统返回 */
  .en-head > a.btn[data-back] { display: none !important; }

  /* 开课页：全文列表即起点选择器，压缩上下留白，开始按钮吸底 */
  .en-shell.en-opening {
    padding-top: 10px;
    padding-bottom: calc(64px + env(safe-area-inset-bottom));
  }
  .en-opening .en-head { margin-bottom: 8px; gap: 6px; }
  .en-opening .en-head .btn { min-height: 34px; }
  .en-opening .en-card-box { padding: 10px; gap: 10px; }
  .en-opening .en-opening-list { max-height: 38dvh; gap: 4px; }
  .en-opening .en-lesson-item { min-height: 40px; padding: 6px 8px; }
  .en-opening .en-lesson-en { font-size: 13px; line-height: 1.4; }
  .en-opening .en-lesson-zh { font-size: 10.5px; line-height: 1.4; margin-top: 1px; }
  .en-opening .en-center {
    position: sticky;
    bottom: calc(8px + env(safe-area-inset-bottom));
    z-index: 3;
    width: 100%;
    margin-top: 0;
    padding: 8px 0 calc(2px + env(safe-area-inset-bottom));
    background: var(--surface);
    border-top: 1px solid var(--hairline);
  }
  .en-opening .en-center .btn { width: 100%; min-height: 44px; }
  .en-grid { grid-template-columns: 1fr; gap: 10px; }
  .en-book { padding: 14px 13px; border-radius: 15px; gap: 5px; }
  .en-book-title { font-size: 15px; line-height: 1.35; }
  .en-book-desc { font-size: 12px; line-height: 1.55; }
  .en-book-count { margin-top: 2px; }
  .en-pro-cta { padding: 10px 12px; border-radius: 12px; gap: 7px; flex-wrap: nowrap; }
  .en-pro-cta-main { font-size: 12px; white-space: nowrap; }
  .en-pro-cta-sub { font-size: 10.5px; }
  .en-pro-cta-action { font-size: 11px; align-self: center; }

  /* 开始练习：苹果风格胶囊，不再铺成生硬的长方形 */
  #setupStart,
  #previewStart,
  #enStart,
  #courseStart {
    min-height: 48px;
    padding: 0 24px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent-filled), var(--accent-filled-hover));
    color: #fff;
    font-size: 15px;
    font-weight: 650;
    letter-spacing: .01em;
    box-shadow: 0 8px 20px var(--accent-soft);
  }
  #setupStart,
  #previewStart,
  #enStart {
    width: min(320px, 100%);
    margin-left: auto;
    margin-right: auto;
  }
  #courseStart { flex: 0 1 auto; }
  #courseStart:active,
  #setupStart:active,
  #previewStart:active,
  #enStart:active { transform: scale(.98); }
  #courseStart:disabled,
  #setupStart:disabled,
  #previewStart:disabled,
  #enStart:disabled { opacity: .55; box-shadow: none; }
  .en-tabs { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; scrollbar-width: none; }
  .en-tabs::-webkit-scrollbar { display: none; }
  .en-tab { flex: 0 0 auto; min-height: 36px; padding: 0 12px; }
  .en-tense-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
  .en-tense { padding: 12px 10px; min-height: 132px; }
  .en-tense-name { font-size: 12.5px; line-height: 1.35; white-space: normal; padding-right: 14px; }
  .en-tense-en { font-size: 10.5px; line-height: 1.4; }
  .en-tense-desc { font-size: 10.5px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .en-tense-meta { font-size: 9.5px; gap: 3px 6px; }

  /* 统一手机弹层：底部 sheet，内容滚动，操作区吸底 */
  .modal-mask { padding: 0; align-items: flex-end; }
  .modal {
    width: 100% !important;
    max-width: none !important;
    max-height: calc(100dvh - 4px) !important;
    margin: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 20px 20px 0 0;
    border-bottom: 0;
  }
  .modal-header { flex: none; padding: 14px 15px 11px; }
  .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  .modal-footer {
    flex: none;
    position: sticky;
    bottom: 0;
    margin-top: 0;
    padding: 10px 15px calc(10px + env(safe-area-inset-bottom));
    background: var(--surface-strong);
    border-top: 1px solid var(--hairline);
    z-index: 2;
  }
  .en-setup { max-height: calc(100dvh - 4px) !important; }
  .en-setup .modal-body { max-height: none; }
  .en-course {
    width: 100% !important;
    height: calc(100dvh - 4px) !important;
    max-height: calc(100dvh - 4px) !important;
    border-radius: 20px 20px 0 0;
  }
  .en-course .modal-body { overflow-y: auto; }
  .en-course-stat { font-size: 10.5px; padding: 4px 7px; }
  .en-course-controls { grid-template-columns: 1fr; gap: 12px; }
  .en-course-jump { grid-template-columns: 1fr; gap: 9px; }
  .en-course-pos { justify-content: flex-start; }
  .en-course-list { min-height: 150px; }
  .en-course-row { padding: 9px 8px; gap: 5px; }
  .en-course-row-en { font-size: 12px; }
  .en-course-row-zh { font-size: 10.5px; }
  .en-course-foot {
    flex: none;
    margin: 0;
    padding: 10px 15px calc(10px + env(safe-area-inset-bottom));
    background: var(--surface-strong);
    border-top: 1px solid var(--hairline);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, .08);
    z-index: 2;
  }
  .en-course-hint { margin: 0; padding: 0 15px calc(8px + env(safe-area-inset-bottom)); background: var(--surface-strong); }
  .en-course-actions { width: 100%; display: flex; gap: 8px; }
  .en-course-actions .btn { flex: 1; min-height: 44px; }
  .en-chap-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .en-chap { min-height: 52px; }
  .en-chap b { font-size: 11.5px; }
  .en-wheel { height: 160px; }
  .en-wheel-band { top: 62px; }
  .en-set-label { font-size: 12px; }
  .en-form-actions { flex-direction: column-reverse; align-items: stretch; }
  .en-form-actions .btn { width: 100%; min-height: 42px; }

  /* 练习页：整页固定成一个手机视口，只让下划线区域滚动。
     键盘弹起时 visualViewport.height 变小，页面不会被顶变形。 */
  #app { width: 100%; }
  body.en-practicing { overflow: hidden; height: 100%; }

  .en-shell.en-play {
    position: fixed;
    top: var(--en-play-top, 0px);
    left: 0;
    right: 0;
    z-index: 1;
    width: 100%;
    max-width: 100%;
    height: var(--en-play-height, 100dvh);
    min-height: 0;
    max-height: var(--en-play-height, 100dvh);
    margin: 0;
    padding: max(6px, env(safe-area-inset-top)) 12px 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .en-shell.en-play .en-head {
    flex: none;
    gap: 4px;
    margin-bottom: 6px;
  }
  .en-shell.en-play .en-title {
    font-size: 17px;
    line-height: 1.25;
  }
  .en-shell.en-play .en-sub {
    margin-top: 1px;
    font-size: 10.5px;
    line-height: 1.4;
  }
  .en-shell.en-play .en-toolbar {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 1px;
    scrollbar-width: none;
  }
  .en-shell.en-play .en-toolbar::-webkit-scrollbar { display: none; }
  .en-shell.en-play .en-toolbar .btn { flex: 0 0 auto; }
  .en-shell.en-play .en-progress {
    flex: none;
    margin: 0 0 7px;
  }
  .en-shell.en-play .card.en-card-box {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    padding: 10px 11px 8px;
    gap: 8px;
    justify-content: flex-start;
    overflow: hidden;
  }
  .en-shell.en-play.en-zh-mode .card.en-card-box {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .en-shell.en-play .en-zh-input {
    min-height: 50px;
    height: 50px;
    max-height: 120px;
    font-size: 18px;
  }
  .en-shell.en-play .en-prompt {
    flex: 0 1 auto;
    max-height: 24vh;
    overflow-y: auto;
    padding: 0 2px;
    font-size: 14px;
    line-height: 1.55;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
  }
  .en-shell.en-play .en-slots {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    overflow-y: auto;
    align-content: flex-start;
    justify-content: center;
    padding: 2px 2px 8px;
    gap: 12px 14px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  .en-shell.en-play .en-cards {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    width: 100%;
    -webkit-overflow-scrolling: touch;
  }
  .en-shell.en-play .en-keybar {
    position: static;
    left: auto;
    right: auto;
    bottom: auto;
    flex: none;
    z-index: auto;
    gap: 6px;
    margin: 0;
    padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
    background: transparent;
  }
  .en-shell.en-play .en-key {
    flex: 1 1 0;
    min-width: 0;
    height: 42px;
    padding: 0 4px;
    gap: 1px;
  }
  .en-shell.en-play.en-kind-phrase .en-slot-letters,
  .en-shell.en-play.en-kind-template .en-slot-letters {
    height: 42px;
    font-size: 30px;
  }
  .en-shell.en-play.en-kind-phrase .en-slot,
  .en-shell.en-play.en-kind-template .en-slot { gap: 6px; }
  .en-shell.en-play.en-kind-phrase .en-slots,
  .en-shell.en-play.en-kind-template .en-slots { gap: 10px 12px; }
  .en-shell.en-play.en-kind-phrase .en-cell,
  .en-shell.en-play.en-kind-template .en-cell { min-width: 20px; }

  /* 键盘打开：压缩头部、隐藏底部按键栏，把高度全部留给下划线/词卡。 */
  html.en-kb-open .en-shell.en-play .en-head { margin-bottom: 2px; }
  html.en-kb-open .en-shell.en-play .en-sub,
  html.en-kb-open .en-shell.en-play .en-progress { display: none; }
  html.en-kb-open .en-shell.en-play .en-title { font-size: 14px; }
  html.en-kb-open .en-shell.en-play .card.en-card-box {
    padding-top: 5px;
    gap: 6px;
  }
  html.en-kb-open .en-shell.en-play .en-prompt {
    max-height: 20vh;
    font-size: 13px;
    line-height: 1.45;
  }
  html.en-kb-open .en-shell.en-play .en-item-nav { top: 42%; }

  .en-key {
    flex: 1 1 0;
    min-width: 0;
    height: 46px;
    padding: 0 4px;
    gap: 1px;
  }
  .en-key kbd { display: none; }
  .en-key span { font-size: 10.5px; white-space: nowrap; }
  .en-mobile-input {
    position: fixed; left: 0; bottom: 0; width: 1px; height: 1px;
    opacity: .01; border: 0; padding: 0; font-size: 16px;
    pointer-events: none;
  }
  .en-item-nav.prev { left: 2px; }
  .en-item-nav.next { right: 2px; }
  .en-lesson-pop { position: fixed; left: 10px; right: 10px; top: auto; bottom: calc(80px + env(safe-area-inset-bottom)); max-height: 60dvh; overflow: auto; }
  .en-lesson-item { min-height: 44px; }
  .en-cards { width: 100%; }
  .en-card-word { font-size: 34px; }
  .en-card-zh { font-size: 12px; }
  .en-play .en-toolbar .btn { min-height: 36px; padding: 0 9px; font-size: 11.5px; }

  /* 自定义词书 */
  .en-warn-row { flex-direction: column; align-items: stretch; }
  .en-qr { width: 100%; }
  .en-qr img { width: 150px !important; height: 150px !important; margin: 0 auto; }
  .card { border-radius: 15px; }
  .input, .textarea, select { min-height: 42px; font-size: 15px; }
  .textarea { min-height: 180px; }
  .seg { gap: 6px; }
  .seg-btn { min-height: 38px; padding: 0 10px; }
  .kb { display: none !important; }
}
@media (max-width: 380px) {
  .en-tense-grid { grid-template-columns: 1fr; }
  .en-key span { font-size: 9.5px; }
  .en-slot-letters { font-size: 30px; }
  .en-card-box { padding-left: 10px; padding-right: 10px; }
}
