:root {
  --primary: #3b6ef5;
  --primary-dark: #2851c9;
  --primary-light: #eaf1ff;
  --accent: #ff8a3d;
  --accent-soft: #fff1e6;
  --ok: #18a957;
  --ok-light: #e8f8ee;
  --bg: #f6f9fe;
  --card: #ffffff;
  --text: #1b2430;
  --muted: #8a94a6;
  --line: #eef1f6;
  --radius: 16px;
  --shadow: 0 4px 20px rgba(33, 52, 93, 0.06);
  --shadow-lg: 0 10px 34px rgba(33, 52, 93, 0.10);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
  padding-bottom: env(safe-area-inset-bottom);
  -webkit-font-smoothing: antialiased;
}

/* 头部 —— 白底 + 品牌色底线，让橙蓝 logo 完全突出 */
.app-header {
  background: #ffffff;
  color: var(--text);
  padding: 16px 18px calc(14px + env(safe-area-inset-top));
  padding-top: calc(16px + env(safe-area-inset-top));
  box-shadow: 0 2px 12px rgba(33, 52, 93, 0.08);
  position: relative;
}
.app-header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: linear-gradient(90deg, var(--primary), #6a8bff, var(--accent));
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo {
  width: 48px; height: 48px; border-radius: 14px;
  object-fit: contain; background: #f0f4ff; padding: 3px;
  box-shadow: 0 2px 8px rgba(59, 110, 245, 0.12);
}
.brand-text h1 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: .3px; color: var(--primary-dark); }
.brand-text p { margin: 3px 0 0; font-size: 12px; color: var(--muted); }

/* 主区 */
#main { max-width: 560px; margin: 0 auto; padding: 16px 14px 96px; }
.view { display: none; }
.view.active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* 卡片 */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(238, 241, 246, 0.9);
}
.card h2 { margin: 0 0 12px; font-size: 16px; font-weight: 700; color: var(--text); }

/* 统计 */
.stat-row { display: flex; gap: 10px; }
.stat {
  flex: 1; text-align: center; background: var(--primary-light);
  border-radius: 14px; padding: 14px 4px;
}
.stat-num { font-size: 26px; font-weight: 800; color: var(--primary); line-height: 1.1; }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* 列表项 */
.list-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 16px; border-radius: 14px; background: #fff;
  border: 1px solid var(--line); margin-bottom: 10px;
  transition: transform .08s, box-shadow .2s, border-color .2s;
}
.list-item:active { background: #f7f9fc; transform: scale(0.99); box-shadow: var(--shadow); border-color: #dfe6f2; }
.list-item .li-main { flex: 1; min-width: 0; }
.list-item .li-title { font-weight: 600; font-size: 15px; }
.list-item .li-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.badge {
  font-size: 11px; padding: 3px 10px; border-radius: 20px;
  background: var(--primary-light); color: var(--primary); white-space: nowrap; font-weight: 600;
}
.badge.done { background: var(--ok-light); color: var(--ok); }
.badge.real { background: var(--accent-soft); color: #c96a1f; font-weight: 600; }
.tag {
  display: inline-block; font-size: 11px; padding: 2px 9px; border-radius: 8px;
  background: #f1f4f9; color: var(--muted); margin-right: 6px; margin-top: 4px;
}
.arrow { color: #b9c2d0; font-size: 18px; margin-left: 8px; transition: transform .15s; }
.list-item:active .arrow { transform: translateX(2px); color: var(--primary); }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; border-radius: 14px; padding: 14px 16px;
  font-size: 15px; font-weight: 600; cursor: pointer; width: 100%;
  font-family: inherit; transition: transform .06s, box-shadow .2s, filter .15s;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 6px 16px rgba(59,110,245,.28); }
.btn-primary:active { filter: brightness(0.95); }
.btn-accent { background: var(--accent); color: #fff; box-shadow: 0 6px 16px rgba(255,138,61,.28); }
.btn-ghost { background: #fff; color: var(--primary); border: 1px solid var(--line); margin-top: 10px; }
.btn-ghost:active { background: var(--primary-light); }
.btn-ok { background: var(--ok); color: #fff; box-shadow: 0 6px 16px rgba(24,169,87,.26); }
.btn:disabled { opacity: .5; cursor: default; box-shadow: none; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }

/* 朗读跟读页 */
.read-head { margin-bottom: 12px; }
.read-ko {
  font-size: 26px; font-weight: 700; line-height: 1.4; margin: 4px 0;
  color: var(--primary-dark); word-break: keep-all;
}
.read-zh { font-size: 15px; color: var(--muted); }
.read-rom { font-size: 13px; color: #9aa5b1; margin-top: 4px; }
.play-btn {
  width: 64px; height: 64px; border-radius: 50%; border: none;
  background: var(--primary); color: #fff; font-size: 28px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; margin: 16px auto;
  box-shadow: 0 8px 22px rgba(59,110,245,0.38);
}
.play-btn:active { transform: scale(0.95); }
.play-btn.rec { background: var(--accent); box-shadow: 0 6px 16px rgba(232,89,12,0.35); }
.play-btn.recording { animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(232,89,12,0.5);} 50%{ box-shadow:0 0 0 12px rgba(232,89,12,0);} }

.rec-status { text-align: center; font-size: 13px; color: var(--muted); min-height: 18px; }
.audio-ctrl { display: flex; gap: 10px; align-items: center; margin-top: 10px; }
.audio-ctrl audio { flex: 1; height: 40px; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.pager .pinfo { font-size: 13px; color: var(--muted); }

/* 跟读进度点 */
.dots { display: flex; gap: 5px; flex-wrap: wrap; margin: 10px 0; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.dot.done { background: var(--ok); }

/* 答题 */
.q-meta { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.q-stem { font-size: 17px; font-weight: 600; margin-bottom: 14px; word-break: keep-all; }
.opt {
  display: flex; align-items: center; gap: 10px; padding: 13px 14px;
  border: 1.5px solid var(--line); border-radius: 12px; margin-bottom: 10px;
  cursor: pointer; background: #fff; font-size: 15px;
}
.opt.sel { border-color: var(--primary); background: var(--primary-light); }
.opt.correct { border-color: var(--ok); background: #e6f4ea; }
.opt.wrong { border-color: #e03131; background: #fdecec; }
.opt .opt-key { font-weight: 700; color: var(--primary); }
.opt.correct .opt-key { color: var(--ok); }
.opt.wrong .opt-key { color: #e03131; }
.explain { background: #fff8f1; border-radius: 10px; padding: 12px; font-size: 14px; color: #8a5a2b; margin-top: 8px; }
.explain b { color: var(--accent); }

.timer { text-align: center; font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.timer b { color: var(--accent); font-size: 18px; }

/* 结果 */
.result-score { text-align: center; padding: 10px 0 6px; }
.result-score .num { font-size: 48px; font-weight: 800; color: var(--primary); }
.result-score .den { font-size: 20px; color: var(--muted); }
.wbbox-item { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.wbbox-item .wbq { font-weight: 600; }
.wbbox-item .wba { font-size: 13px; margin-top: 6px; }
.wbbox-item .wb-correct { color: var(--ok); }
.wbbox-item .wb-yours { color: #e03131; }

/* 顶部小工具条 */
.subbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.subbar .title { font-size: 17px; font-weight: 700; }
.link-btn { background: none; border: none; color: var(--primary); font-size: 14px; cursor: pointer; font-family: inherit; }

.empty { text-align: center; color: var(--muted); padding: 40px 0; font-size: 14px; }
.tip { font-size: 12px; color: var(--muted); margin-top: 8px; line-height: 1.6; }
.about p { font-size: 13px; color: var(--muted); margin: 6px 0; }

/* tabbar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  max-width: 560px; margin: 0 auto;
}
.tab {
  flex: 1; border: none; background: none; cursor: pointer;
  padding: 8px 0 6px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-family: inherit; color: var(--muted); font-size: 11px; position: relative;
  transition: color .15s;
}
.tab .tab-ico { font-size: 22px; transition: transform .15s; }
.tab.active { color: var(--primary); }
.tab.active .tab-ico { transform: translateY(-1px) scale(1.05); }
.tab.active::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 26px; height: 3px; border-radius: 0 0 3px 3px;
  background: var(--primary);
}

/* 子标签（模块内切换） */
.subtabs { display: flex; gap: 8px; margin-bottom: 12px; }
.subtabs.sub2 { margin: 4px 0 12px; }
.stab {
  flex: 1; border: 1px solid var(--line); background: #fff; color: var(--muted);
  border-radius: 12px; padding: 10px 6px; font-size: 14px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: all .15s;
}
.stab.active { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 4px 12px rgba(59,110,245,.22); }

/* 延世单词卡 */
.word-card {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px; margin-bottom: 10px; flex-wrap: wrap;
}
.word-card.done { background: #f3faf5; border-color: #cfe9d6; }
.w-ko {
  width: 42px; height: 42px; border-radius: 50%; border: none; flex-shrink: 0;
  background: var(--primary-light); color: var(--primary); font-size: 18px; cursor: pointer;
}
.w-ko:active { transform: scale(0.95); }
.w-text { flex: 1; min-width: 0; }
.w-ko-text { font-size: 18px; font-weight: 700; color: var(--primary-dark); word-break: keep-all; }
.w-zh { font-size: 13px; color: var(--muted); margin-top: 2px; }
.w-rec {
  width: 42px; height: 42px; border-radius: 50%; border: none; flex-shrink: 0;
  background: #fff0e8; color: var(--accent); font-size: 18px; cursor: pointer;
}
.w-rec.recording { animation: pulse 1s infinite; }
.w-done {
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); flex-shrink: 0;
  background: #fff; color: var(--muted); font-size: 16px; cursor: pointer;
}
.w-done.on { background: var(--ok); color: #fff; border-color: var(--ok); }
.w-pb { flex-basis: 100%; }
.w-pb .audio-ctrl { margin-top: 4px; }

/* ===== 单词听写（Dictation）卡片 ===== */
.dict-card {
  text-align: center;
  padding: 24px 18px 20px;
}
.dict-zh {
  font-size: 28px; font-weight: 700; color: var(--text);
  line-height: 1.4; margin: 8px 0 6px; word-break: keep-all;
}
.dict-play {
  width: 64px; height: 64px; border-radius: 50%; border: none;
  background: var(--primary); color: #fff; font-size: 28px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; margin: 14px auto 8px;
  box-shadow: 0 8px 22px rgba(59,110,245,0.38);
}
.dict-play:active { transform: scale(0.95); }
.dict-hint {
  font-size: 13px; color: var(--muted); margin-bottom: 16px; min-height: 18px;
}
.dict-input {
  display: block; width: 100%; max-width: 320px; margin: 0 auto 16px;
  box-sizing: border-box; padding: 10px 12px 10px 2px;
  border: none; border-bottom: 2.5px solid var(--line);
  border-radius: 0; background: transparent;
  font-size: 24px; font-weight: 600; text-align: center;
  color: var(--text); outline: none; font-family: inherit;
  transition: border-color .2s;
}
.dict-input:focus { border-bottom-color: var(--primary); }
.dict-input::placeholder { color: #c0c8d0; font-weight: 400; font-size: 15px; }
.dict-submit {
  max-width: 280px; margin: 0 auto; font-size: 16px; padding: 14px;
}
.dict-quit {
  max-width: 200px; margin: 8px auto 0; font-size: 13px; padding: 10px;
}
.dict-skip {
  max-width: 280px; margin: 10px auto 0; font-size: 14px; padding: 11px;
  color: var(--accent); border: 1px dashed var(--accent);
}
.dict-skip:active { background: #fff4ec; }

/* 反馈 */
.dict-feedback {
  min-height: 22px; font-size: 14px; margin: 10px auto; max-width: 340px;
  transition: opacity .3s;
}
.dict-feedback.ok { color: var(--ok); font-weight: 600; }
.dict-feedback.wrong { color: #e03131; line-height: 1.7; }
.dict-correct-ans {
  display: inline-block; margin-top: 4px; font-size: 14px; color: var(--ok);
}
.dict-correct-ans b { font-size: 18px; }

/* 进度条 */
.dict-progress-wrap {
  display: flex; align-items: center; gap: 10px; margin-top: 18px; padding-top: 12px;
  border-top: 1px solid var(--line);
}
.dict-progress-bar {
  flex: 1; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden;
}
.dict-progress-fill {
  height: 100%; background: linear-gradient(90deg, var(--primary), var(--ok));
  border-radius: 3px; transition: width .35s ease;
}
.dict-progress-text {
  font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap;
  min-width: 42px; text-align: right;
}

/* 听写卡片默认竖排（手机） */
.dict-main { display: block; }

/* iPad 大屏（竖向）：加宽容器，更舒适 */
@media (min-width: 768px) {
  #main { max-width: 680px; }
  .tabbar { max-width: 680px; }
}

/* iPad 横屏 / 大屏横放：左右分栏，自动利用宽屏空间 */
@media (orientation: landscape) and (min-width: 700px) {
  #main { max-width: 860px; }
  .tabbar { max-width: 860px; }
  .dict-card { max-width: 760px; margin: 0 auto; padding: 30px 28px; }
  .dict-main { display: flex; align-items: center; gap: 36px; text-align: left; }
  .dict-left { flex: 1; text-align: center; }
  .dict-right { flex: 1.2; min-width: 0; }
  .dict-zh { font-size: 34px; }
  .dict-input { margin-bottom: 14px; }
  .dict-progress-wrap { margin-top: 16px; }
}


/* 版权页脚 —— 确保在固定 tabbar 上方可见 */
.app-footer {
  text-align: center; padding: 24px 14px calc(70px + env(safe-area-inset-bottom));
  margin-top: 4px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.footer-brand { font-size: 13px; font-weight: 800; color: var(--primary); letter-spacing: .3px; }
.footer-copy { font-size: 11px; color: var(--muted); margin-top: 5px; letter-spacing: .2px; }

/* 真题资源卡 */
.res-card { padding: 14px; }
.res-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.res-card .li-title { font-weight: 600; font-size: 15px; }
.res-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.res-actions .btn { width: auto; flex: 1; margin-top: 0; min-width: 130px; }


/* ===== 访问门禁 / 审核后台 ===== */
#gate-overlay {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1f4f86 0%, #2b6cb0 100%);
  padding: 24px; box-sizing: border-box;
}
.gate-card {
  background: #fff; border-radius: 18px; padding: 30px 26px;
  width: 100%; max-width: 340px; text-align: center;
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
.gate-logo {
  width: 56px; height: 56px; border-radius: 14px; margin: 0 auto 12px;
  background: var(--primary); color: #fff; font-size: 28px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.gate-card h2 { font-size: 18px; margin: 4px 0 6px; color: var(--text); }
.gate-sub { color: var(--muted); font-size: 13px; margin: 0 0 18px; }
.gate-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.gate-tabs .gtab {
  flex: 1; padding: 8px; border: 1px solid var(--line); background: #fff;
  border-radius: 10px; font-size: 14px; color: var(--muted); cursor: pointer;
}
.gate-tabs .gtab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.gate-input {
  width: 100%; box-sizing: border-box; padding: 12px 14px; margin-bottom: 10px;
  border: 1px solid var(--line); border-radius: 10px; font-size: 15px; outline: none;
}
.gate-input:focus { border-color: var(--primary); }
.gate-btn {
  width: 100%; padding: 12px; border: 0; border-radius: 10px; margin-top: 4px;
  background: var(--primary); color: #fff; font-size: 15px; font-weight: 600; cursor: pointer;
}
.gate-btn:active { background: var(--primary-dark); }
.gate-msg { color: #e03131; font-size: 13px; min-height: 18px; margin-top: 8px; }

.admin-wrap { max-width: 480px; margin: 40px auto; padding: 24px; text-align: center; }
.admin-wrap h2 { margin: 8px 0 20px; }
.admin-hint { text-align: left; color: var(--muted); font-size: 13px; margin: 16px 0 8px; }
.pending-item {
  display: flex; align-items: center; justify-content: space-between;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 10px; text-align: left;
}
.pi-info { font-size: 14px; line-height: 1.5; }
.pi-info small { color: var(--muted); }
.pi-btn { background: var(--ok); color: #fff; border: 0; border-radius: 8px; padding: 8px 16px; cursor: pointer; }
.admin-empty { color: var(--ok); text-align: center; padding: 20px; }
.admin-section { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 14px; }
.admin-subtitle { font-size: 15px; font-weight: 700; margin: 0 0 10px; color: var(--text); }
.wrong-list { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; max-height: 52vh; overflow-y: auto; }
.wrong-item { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; text-align: left; }
.wi-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wi-lang { font-size: 11px; font-weight: 700; color: #fff; background: var(--primary); border-radius: 6px; padding: 1px 7px; }
.wi-word { font-size: 16px; color: var(--text); }
.wi-zh { font-size: 13px; color: var(--muted); }
.wi-bottom { margin-top: 6px; font-size: 13px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.wi-input { color: #d9480f; font-weight: 600; }
.wi-time { margin-left: auto; font-size: 11px; opacity: .7; }

/* ===== 分享 / 说明书 弹窗 ===== */
.btn-share {
  width: 100%; padding: 13px; border: 0; border-radius: 12px;
  background: linear-gradient(135deg, #ff8a3d 0%, #ff6b1a 100%);
  color: #fff; font-size: 16px; font-weight: 700; cursor: pointer;
  box-shadow: 0 6px 16px rgba(255,107,26,.28);
}
.btn-share:active { transform: translateY(1px); }

.share-overlay, .help-overlay {
  position: fixed; inset: 0; background: rgba(20,28,45,.55);
  display: flex; align-items: center; justify-content: center;
  padding: 18px; z-index: 1000; backdrop-filter: blur(2px);
}
.share-modal, .help-modal {
  background: #fff; border-radius: 18px; width: 100%; max-width: 360px;
  max-height: 88vh; overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.share-modal-head, .help-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; font-size: 16px; font-weight: 700; color: var(--text);
  border-bottom: 1px solid var(--line);
}
.share-close, .help-close {
  border: 0; background: #f0f2f7; color: #6b7488; width: 30px; height: 30px;
  border-radius: 50%; font-size: 20px; line-height: 1; cursor: pointer;
}
.share-poster {
  width: 100%; display: block; background: #eef3ff; padding: 12px 0;
}
.share-tip {
  font-size: 13px; color: var(--muted); text-align: center; line-height: 1.6;
  margin: 10px 16px 0;
}
.share-actions { display: flex; gap: 10px; padding: 12px 16px 18px; }
.share-actions .btn { flex: 1; }

.help-body {
  padding: 16px 18px 22px; overflow-y: auto; text-align: left;
  font-size: 14px; line-height: 1.7; color: #2b3346;
}
.help-body h3 { font-size: 15px; margin: 18px 0 8px; color: var(--primary); }
.help-body h3:first-child { margin-top: 4px; }
.help-body p { margin: 6px 0; }
.help-body ol, .help-body ul { margin: 6px 0; padding-left: 20px; }
.help-body li { margin: 4px 0; }
.help-body .tip {
  background: #fff6ee; border-left: 3px solid #ff8a3d; padding: 8px 12px;
  border-radius: 8px; font-size: 13px; color: #9a5a2b; margin: 8px 0;
}

/* ===== 学员管理后台（admin.html） ===== */
.am-wrap { max-width: 520px; margin: 24px auto 60px; padding: 0 16px; text-align: center; }
.am-wrap > .gate-logo { margin-top: 24px; }
.am-wrap h2 { margin: 10px 0 18px; font-size: 20px; }
.am-login { max-width: 320px; margin: 0 auto; text-align: left; }
.am-login .gate-input { margin-bottom: 12px; }
.am-login .gate-btn { margin-top: 6px; }

/* 统计条 */
.am-stats { display: flex; gap: 8px; margin: 6px 0 16px; }
.am-stat { flex: 1; border-radius: 12px; padding: 12px 4px; background: #fff; border: 1px solid var(--line); }
.am-stat-n { font-size: 22px; font-weight: 800; line-height: 1.1; }
.am-stat-l { font-size: 12px; color: var(--muted); margin-top: 2px; }
.am-s-pending .am-stat-n { color: var(--accent); }
.am-s-active  .am-stat-n { color: var(--ok); }
.am-s-paused  .am-stat-n { color: #d9480f; }
.am-s-expired .am-stat-n { color: var(--muted); }

/* 筛选 */
.am-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; justify-content: center; }
.am-filters { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.am-refresh {
  border: 1px solid var(--primary); background: #fff; color: var(--primary);
  border-radius: 20px; padding: 7px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: all .15s;
}
.am-refresh:active { background: var(--primary); color: #fff; }
.amf {
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  border-radius: 20px; padding: 7px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: all .15s;
}
.amf.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 学员卡片 */
.stu-card {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 14px; margin-bottom: 12px; text-align: left; box-shadow: var(--shadow);
}
.stu-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.stu-name { font-weight: 700; font-size: 15px; }
.stu-mobile { color: var(--muted); font-weight: 500; font-size: 13px; margin-left: 4px; }
.stu-meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.am-badge { flex-shrink: 0; }
.am-b-pending { background: var(--accent-soft); color: #c96a1f; }
.am-b-active  { background: var(--ok-light); color: var(--ok); }
.am-b-paused  { background: #fdecec; color: #e03131; }
.am-b-expired { background: #f1f4f9; color: var(--muted); }

/* 操作按钮组 */
.stu-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.am-btn {
  border: 1px solid var(--line); background: #fff; color: var(--text);
  border-radius: 10px; padding: 9px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: all .12s;
}
.am-btn:active { transform: scale(0.97); }
.am-btn-ok     { background: var(--ok); color: #fff; border-color: var(--ok); }
.am-btn-primary{ background: var(--primary); color: #fff; border-color: var(--primary); }
.am-btn-warn   { background: #fff7ed; color: #c96a1f; border-color: #ffd9b8; }
.am-btn-danger { background: #fff; color: #e03131; border-color: #f3c2c2; }
.am-btn-ghost  { background: #f6f8fc; color: var(--primary); }

/* 时长选择器 */
.am-dur { margin-top: 12px; padding: 12px; background: var(--primary-light); border-radius: 12px; }
.am-dur-title { font-size: 13px; color: var(--primary-dark); font-weight: 600; margin-bottom: 8px; }
.am-dur-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.am-dur-btn {
  flex: 1; min-width: 70px; border: 1px solid var(--primary); background: #fff; color: var(--primary);
  border-radius: 10px; padding: 9px 6px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.am-dur-btn:active { background: var(--primary); color: #fff; }
.am-dur-custom { display: flex; gap: 8px; margin-top: 10px; align-items: center; }
.am-date { flex: 1; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; font-family: inherit; }
.am-dur-ok { border: 1px solid var(--primary); background: var(--primary); color: #fff; border-radius: 10px; padding: 9px 12px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; white-space: nowrap; }
.am-dur-cancel { margin-top: 10px; border: none; background: none; color: var(--muted); font-size: 13px; cursor: pointer; font-family: inherit; text-decoration: underline; }

/* 错题本区 */
.stu-wrong { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 10px; }
.am-wrong-loading, .am-wrong-empty, .am-empty { color: var(--muted); font-size: 13px; padding: 10px 2px; text-align: center; }

.am-login .gate-msg { text-align: center; }

/* ===== 拓展阅读模块 ===== */
.ext-body { font-size: 16px; line-height: 2; color: var(--text); word-break: keep-all; }
.ext-vocab {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 2px; border-bottom: 1px dashed var(--line);
}
.ext-vocab:last-child { border-bottom: none; }
.ext-vocab-ko { font-size: 16px; font-weight: 700; min-width: 96px; }
.ext-vocab-zh { flex: 1; font-size: 14px; color: var(--muted); }
.ext-vocab-zh i { font-style: normal; font-size: 12px; }
.ext-grammar { padding: 10px 2px; border-bottom: 1px dashed var(--line); }
.ext-grammar:last-child { border-bottom: none; }
.ext-grammar-form { font-size: 15px; font-weight: 700; color: var(--primary); }
.ext-grammar-meaning { font-size: 14px; margin-top: 3px; line-height: 1.6; }
.ext-grammar-ex { font-size: 13px; color: var(--muted); margin-top: 2px; }
.ext-question { padding: 12px 0; border-bottom: 1px dashed var(--line); }
.ext-question:last-child { border-bottom: none; }
.ext-q-stem { font-size: 15px; line-height: 1.7; margin-bottom: 8px; font-weight: 600; }
.ext-opt {
  display: block; width: 100%; text-align: left; margin-bottom: 8px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 14px; font-size: 14px; font-family: inherit; cursor: pointer;
}
.ext-opt:active { background: #f5f7fa; }
.ext-opt-ok { border-color: var(--ok) !important; background: #f0fff5 !important; }
.ext-opt-bad { border-color: #e03131 !important; background: #fff5f5 !important; }
.ext-q-fb { font-size: 14px; margin-top: 4px; }

/* 4-tab 底栏适配（字号略缩） */
.tabbar .tab .tab-txt { font-size: 11px; }

/* ===== 学习排行榜 ===== */
#rank-overlay { position: fixed; inset: 0; z-index: 999; display: none; }
.rank-mask { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.rank-panel {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 82vh; overflow-y: auto;
  background: #f6f9fe; border-radius: 18px 18px 0 0; padding-bottom: env(safe-area-inset-bottom);
  animation: rankUp .22s ease-out;
}
@keyframes rankUp { from { transform: translateY(40px); opacity: .5; } to { transform: none; opacity: 1; } }
.rank-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px 8px;
}
.rank-head h2 { font-size: 17px; margin: 0; }
.rank-tabs { display: flex; gap: 8px; padding: 0 16px 10px; }
.rank-me { margin: 0 16px 10px; padding: 12px; text-align: center; }
.rank-me-title { font-size: 13px; color: var(--muted); margin-bottom: 8px; font-weight: 600; }
.rank-me-row { display: flex; justify-content: space-around; }
.rank-me-item { min-width: 60px; }
.rank-me-num { font-size: 18px; font-weight: 800; color: var(--primary); }
.rank-me-label { font-size: 11px; color: var(--muted); margin-top: 2px; }
.rank-list { padding: 0 16px; }
.rank-item {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; margin-bottom: 8px;
}
.rank-item-me { border-color: var(--primary); background: #fff7f6; }
.rank-item-medal { min-width: 34px; text-align: center; font-size: 20px; }
.rank-no { font-size: 14px; font-weight: 700; color: var(--muted); }
.rank-item-name { font-size: 14px; font-weight: 700; }
.rank-me-tag {
  background: var(--primary); color: #fff; font-size: 10px;
  border-radius: 4px; padding: 1px 5px; vertical-align: 1px;
}
.rank-item-val { font-size: 12px; color: var(--muted); margin-top: 2px; }
.rank-empty { text-align: center; color: var(--muted); padding: 30px 10px; font-size: 13px; }

/* 退出登录按钮（警示色） */
.btn-logout { color: #e03131; border-color: #f3c1bd; }
.btn-logout:active { background: #fff5f5; }
