/* =========================================================================
   妍宝语法宝 · Essential Grammar in Use 学习版 — 全站样式
   设计语言参考「妍宝单词宝」，主色改为红色。
   兼容 电脑端 / 手机端 / iPad 端。
   ========================================================================= */

:root {
  /* 暖白背景 + 红色主色系 */
  --bg-top:    #FFF6F5;
  --bg-bottom: #FFF0EE;
  --surface:   #FFFFFF;
  --surface-2: #FDF3F2;

  --primary:      #E23B3B;   /* 主红 */
  --primary-dark: #C22B2B;
  --primary-soft: #FBE0DE;

  --accent:      #FF8A5B;    /* 橙珊瑚 */
  --accent-dark: #F26A34;

  --gold:        #F6C445;
  --gold-dark:   #E0A92E;

  --correct: #2E9E52;        /* 正确 = 绿色 */
  --wrong:   #E23B3B;        /* 错误 = 红色 */

  --ink:      #3A2E2E;
  --ink-soft: #7A6A6A;
  --line:     #F1DCDA;

  --radius:   16px;
  --radius-sm:10px;
  --shadow:   0 6px 20px rgba(194, 43, 43, 0.12);
  --shadow-sm:0 3px 10px rgba(194, 43, 43, 0.12);

  --font: Georgia, "Times New Roman", "Songti SC", "STSong", serif;
  --font-hei: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Heiti SC", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  color: var(--ink);
  background: linear-gradient(160deg, var(--bg-top), var(--bg-bottom));
  background-attachment: fixed;
  min-height: 100%;
  max-width: 100%;
  overflow-x: hidden;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
body { min-height: 100vh; }

/* 中文正文用黑体，更清晰易读 */
.cn, .page-subtitle, .m-intent, .kp-desc, .ex-cn, .q-explain, .note-cn { font-family: var(--font-hei); }

a { color: var(--primary-dark); text-decoration: none; }

/* ----------------------------- 顶部栏 ----------------------------------- */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px clamp(12px, 3vw, 32px);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(1.4) blur(8px);
  -webkit-backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.app-header .brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 0 1 auto; }
.app-header .brand img { width: 40px; height: 40px; display: block; }
.app-header .brand .titles { min-width: 0; line-height: 1.15; }
.app-header .brand .t-main {
  font-family: var(--font-hei);
  font-size: clamp(16px, 2.4vw, 22px);
  font-weight: 800;
  color: var(--primary-dark);
  letter-spacing: .3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.app-header .brand .t-sub { font-family: var(--font-hei); font-size: 12px; color: var(--ink-soft); white-space: nowrap; }
.app-header .spacer { flex: 1; }
.app-header .back-link { flex: none; }

.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--primary-dark);
  font-family: var(--font-hei);
  font-size: 15px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.back-link:active { transform: translateY(1px); }
.back-link .ic { display: block; flex: none; }
.icon-link { gap: 6px; }
.app-header .cal-btn, .app-header .user-chip { flex: none; }

/* 顶栏控件：中小屏(含 iPad 竖屏)只留图标 */
@media (max-width: 900px) {
  .icon-link span { display: none; }
  .icon-link { padding: 7px 11px; }
}
@media (max-width: 600px) {
  .app-header .brand .titles { display: none; }
  .coin-pill .coin-label { display: none; }
}

/* 金币胶囊 */
.coin-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px 7px 10px;
  background: linear-gradient(180deg, #FFF6DA, #FFE9A8);
  border: 1px solid var(--gold-dark);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  font-family: var(--font-hei);
  font-weight: 700; color: #8A6516;
  font-size: clamp(14px, 2vw, 17px);
  user-select: none; flex: none;
}
.coin-pill .coin-ico {
  width: 24px; height: 24px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #FFE89A, var(--gold) 60%, var(--gold-dark));
  border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.18);
  display: grid; place-items: center; color: #9A7414; flex: none;
}
.coin-pill .coin-ico svg { display: block; }
.coin-pill .coin-amount.bump { animation: coinBump .5s ease; }
@keyframes coinBump {
  0% { transform: scale(1); }
  35% { transform: scale(1.5); color: var(--gold-dark); }
  100% { transform: scale(1); }
}

/* 用户胶囊 */
.user-chip { cursor: pointer; max-width: 46vw; }
.user-chip .u-ico { font-size: 15px; line-height: 1; }
.user-chip .u-name { font-weight: 700; max-width: 8em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 600px) { .user-chip .u-name { display: none; } }

/* =========================================================================
   个人档悬浮框
   ========================================================================= */
.profile-overlay {
  position: fixed; inset: 0; z-index: 210;
  background: rgba(58, 46, 46, 0.45);
  display: flex; align-items: center; justify-content: center;
  padding: 16px; opacity: 0; visibility: hidden; transition: opacity .18s ease;
}
.profile-overlay.show { opacity: 1; visibility: visible; }
.profile-card {
  position: relative; width: 100%; max-width: 380px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 24px; box-shadow: 0 18px 50px rgba(0,0,0,.22);
  padding: 10px 24px 22px; text-align: center;
  transform: translateY(8px) scale(.98); transition: transform .18s ease;
}
.profile-overlay.show .profile-card { transform: none; }
.profile-close {
  position: absolute; top: 12px; right: 12px;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface-2);
  color: var(--ink-soft); font-size: 15px; cursor: pointer;
}
.profile-art { margin-top: 4px; }
.profile-art svg { display: block; margin: 0 auto; }
.profile-hi { font-family: var(--font-hei); font-size: 18px; font-weight: 800; color: var(--primary-dark); margin: 2px 0 12px; }
.profile-quote {
  background: linear-gradient(180deg, var(--surface-2), #FFF6EE);
  border: 1px solid #F2E6D8; border-radius: 16px; padding: 16px; margin-bottom: 18px;
}
.pq-en { font-family: var(--font); font-size: 17px; font-weight: bold; color: var(--ink); line-height: 1.45; margin: 0 0 8px; }
.pq-zh { font-family: var(--font-hei); font-size: 15px; color: var(--ink-soft); line-height: 1.55; margin: 0; }
.profile-logout { width: 100%; }

/* =========================================================================
   打卡日历
   ========================================================================= */
.cal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(58, 46, 46, 0.45);
  display: flex; align-items: center; justify-content: center;
  padding: 16px; opacity: 0; visibility: hidden; transition: opacity .18s ease;
}
.cal-overlay.show { opacity: 1; visibility: visible; }
.cal-card {
  width: 100%; max-width: 430px; max-height: 92vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 22px; box-shadow: 0 18px 50px rgba(0,0,0,.22);
  padding: clamp(16px, 4vw, 24px);
  transform: translateY(8px) scale(.98); transition: transform .18s ease;
}
.cal-overlay.show .cal-card { transform: none; }
.cal-top { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.cal-title { flex: 1; text-align: center; font-family: var(--font-hei); font-size: 20px; font-weight: 800; color: var(--primary-dark); }
.cal-nav, .cal-close {
  font-family: var(--font-hei); border: 1px solid var(--line); background: var(--surface-2);
  color: var(--primary-dark); width: 36px; height: 36px; border-radius: 50%;
  font-size: 18px; cursor: pointer; flex: none;
}
.cal-close { color: var(--ink-soft); }
.cal-userbar { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 2px 0 12px; }
.cal-admin-tag { font-family: var(--font-hei); font-size: 12px; font-weight: 700; color: #fff; background: linear-gradient(180deg, #F0574F, var(--primary)); padding: 3px 10px; border-radius: 999px; }
.cal-user-pick { font-family: var(--font-hei); font-size: 14px; font-weight: 700; color: var(--ink); display: inline-flex; align-items: center; gap: 6px; }
.cal-user-pick select { font-family: var(--font-hei); font-size: 14px; font-weight: 700; color: var(--primary-dark); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; cursor: pointer; }
.cal-summary { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 14px; }
.cal-pill { font-family: var(--font-hei); font-size: 13px; font-weight: 700; color: var(--primary-dark); background: var(--primary-soft); padding: 5px 12px; border-radius: 999px; }
.cal-weekdays, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-weekdays { margin-bottom: 6px; }
.cal-weekdays span { text-align: center; font-family: var(--font-hei); font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.cal-cell {
  position: relative; aspect-ratio: 1 / 1; border-radius: 12px;
  background: var(--surface-2); border: 1px solid transparent;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.cal-cell.empty { background: transparent; }
.cal-cell .cal-day { font-size: 12px; color: var(--ink-soft); position: absolute; top: 5px; left: 7px; }
.cal-cell.today { border-color: var(--primary); }
.cal-cell.has { background: var(--primary-soft); cursor: pointer; }
.cal-cell.sel { box-shadow: 0 0 0 3px var(--accent); border-color: var(--accent); }
.cal-count {
  margin-top: 6px; min-width: 26px; height: 26px;
  display: inline-grid; place-items: center; padding: 0 6px; border-radius: 999px;
  background: linear-gradient(180deg, #F0574F, var(--primary)); color: #fff;
  font-family: var(--font-hei); font-weight: 700; font-size: 15px; cursor: pointer; box-shadow: var(--shadow-sm);
}
.cal-detail { margin-top: 16px; min-height: 2em; }
.cal-hint { font-family: var(--font-hei); color: var(--ink-soft); font-size: 13px; text-align: center; margin: 8px 0; }
.cal-detail-head { font-family: var(--font-hei); font-weight: 800; color: var(--primary-dark); margin-bottom: 8px; }
.cal-sub { font-family: var(--font-hei); font-weight: 700; color: var(--primary-dark); font-size: 14px; margin: 12px 0 6px; }
.cal-st-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cal-st-list a { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; color: var(--ink); }
.cal-st-list a:active { transform: translateY(1px); }
.cal-st-no { font-family: var(--font-hei); font-size: 12px; font-weight: 700; color: var(--primary-dark); }
.cal-st-title { font-family: var(--font); font-weight: bold; }
.cal-st-range { font-family: var(--font-hei); font-size: 12px; color: var(--ink-soft); margin-left: auto; }

/* =========================================================================
   登录 / 注册页
   ========================================================================= */
.login-body { display: block; }
.login-wrap { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: clamp(16px, 5vw, 40px); }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); padding: clamp(20px, 5vw, 30px); }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.login-brand img { width: 52px; height: 52px; }
.login-brand .lb-main { font-family: var(--font-hei); font-size: 22px; font-weight: 800; color: var(--primary-dark); line-height: 1.1; }
.login-brand .lb-sub { font-family: var(--font); font-size: 13px; color: var(--ink-soft); }
.login-tabs { display: flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px; margin-bottom: 18px; }
.login-tab { flex: 1; font-family: var(--font-hei); font-size: 16px; font-weight: 700; border: none; background: transparent; color: var(--ink-soft); padding: 9px 10px; border-radius: 999px; cursor: pointer; transition: background .15s ease, color .15s ease; }
.login-tab.active { background: linear-gradient(180deg, #F0574F, var(--primary)); color: #fff; box-shadow: var(--shadow-sm); }
.field { display: block; margin-bottom: 14px; }
.field-label { display: block; font-family: var(--font-hei); font-size: 13px; font-weight: 700; color: var(--primary-dark); margin: 0 0 5px 4px; }
.field input { width: 100%; font-family: var(--font); font-size: 17px; color: var(--ink); background: var(--surface-2); border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; outline: none; transition: border-color .15s ease, box-shadow .15s ease; }
.field input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); background: #fff; }
.login-msg { min-height: 1.2em; margin: 4px 2px 12px; font-family: var(--font-hei); font-size: 14px; font-weight: 700; }
.login-msg.err { color: var(--wrong); }
.login-msg.ok { color: var(--primary-dark); }
.login-submit { width: 100%; padding: 13px; font-size: 18px; }
.login-note { margin: 16px 2px 0; font-family: var(--font-hei); font-size: 12.5px; color: var(--ink-soft); line-height: 1.5; }

@media (max-width: 600px) { .app-header .brand .titles { display: none; } }

/* ----------------------------- 通用容器 --------------------------------- */
.wrap { max-width: 880px; margin: 0 auto; padding: clamp(16px, 3.5vw, 32px); }

.page-title {
  font-family: var(--font-hei);
  font-size: clamp(22px, 4vw, 32px);
  color: var(--primary-dark);
  margin: 4px 0 2px;
  font-weight: 800;
}
.page-subtitle { color: var(--ink-soft); margin: 0 0 18px; font-size: clamp(14px, 2.4vw, 16px); }

/* ----------------------------- 按钮 ------------------------------------- */
.btn {
  font-family: var(--font-hei);
  font-size: clamp(15px, 2.3vw, 17px);
  font-weight: 700;
  border: none;
  border-radius: 999px;
  padding: 11px 22px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .08s ease, filter .15s ease, opacity .15s ease;
  color: #fff;
  user-select: none;
}
.btn:active { transform: translateY(2px); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn-primary { background: linear-gradient(180deg, #F0574F, var(--primary)); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.05); }
.btn-accent  { background: linear-gradient(180deg, #FF9C6E, var(--accent)); }
.btn-ghost   { background: var(--surface); color: var(--primary-dark); border: 1px solid var(--line); }

/* =========================================================================
   目录页 (Unit 列表)
   ========================================================================= */
.toc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 560px) { .toc-grid { grid-template-columns: 1fr; } }

.unit-card {
  position: relative;
  display: flex; flex-direction: column; gap: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow);
  transition: transform .12s ease, box-shadow .12s ease;
  cursor: pointer;
  overflow: hidden;
}
.unit-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 6px; background: linear-gradient(180deg, var(--primary), #FF8A80);
}
.unit-card:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(194,43,43,.18); }
.unit-card:active { transform: translateY(0); }
.uc-no { font-family: var(--font-hei); font-size: 13px; color: var(--primary-dark); font-weight: 700; letter-spacing: .5px; }
.uc-title { font-size: 21px; font-weight: bold; color: var(--ink); line-height: 1.2; }
.uc-titlecn { font-family: var(--font-hei); font-size: 14px; color: var(--ink-soft); }
.uc-foot { margin-top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.uc-badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.badge-done { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-hei); font-size: 13px; font-weight: 700; color: var(--correct); background: #E5F5EB; padding: 4px 10px; border-radius: 999px; }
.badge-progress { font-family: var(--font-hei); font-size: 13px; font-weight: 700; color: #8A6516; background: #FFF1CC; padding: 4px 10px; border-radius: 999px; }
.badge-todo { font-family: var(--font-hei); font-size: 13px; color: var(--ink-soft); }
.uc-start { font-family: var(--font-hei); font-size: 14px; color: var(--accent-dark); font-weight: 700; }
.unit-card.done { border-color: #BFE6CC; }
.unit-card.done::before { background: linear-gradient(180deg, var(--correct), #7BD79A); }

/* 简介卡片 */
.intro-card {
  background: linear-gradient(160deg, #FFF3F1, var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  font-family: var(--font-hei);
  font-size: clamp(14px, 2.4vw, 15.5px);
  line-height: 1.7;
  color: var(--ink);
}
.intro-card b { color: var(--primary-dark); }

/* =========================================================================
   Unit 学习页
   ========================================================================= */
.unit-head { margin: 2px 0 8px; }
.unit-head .u-no { font-family: var(--font-hei); font-size: 14px; font-weight: 700; color: var(--primary-dark); letter-spacing: .5px; }
.unit-head h1 { font-size: clamp(24px, 4.6vw, 34px); margin: 4px 0 2px; color: var(--ink); }
.unit-head .u-cn { font-family: var(--font-hei); font-size: clamp(15px, 2.6vw, 18px); color: var(--ink-soft); }

/* Unit 内导航（各模块 + 测验 锚点） */
.unit-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 8px; }
.unit-nav a {
  font-family: var(--font-hei);
  font-size: 13px; font-weight: 700;
  color: var(--primary-dark);
  background: var(--primary-soft);
  padding: 6px 13px; border-radius: 999px;
  border: 1px solid transparent;
}
.unit-nav a:active { transform: translateY(1px); }
.unit-nav a.test-link { background: #FFF1CC; color: #8A6516; }

/* 模块 */
.module { margin: 26px 0; }
.m-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.m-tag {
  flex: none;
  font-family: var(--font-hei);
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(180deg, #F0574F, var(--primary));
  color: #fff; font-size: 20px; font-weight: 800;
  box-shadow: var(--shadow-sm);
}
.m-titles { min-width: 0; }
.m-titles .m-t { font-family: var(--font-hei); font-size: clamp(18px, 3vw, 22px); font-weight: 800; color: var(--ink); line-height: 1.25; }
.m-titles .m-src { font-family: var(--font-hei); font-size: 12.5px; color: var(--ink-soft); }

/* 教学意图 */
.m-intent {
  background: #FFF8E9;
  border: 1px solid #F5E4B8;
  border-left: 5px solid var(--gold-dark);
  border-radius: var(--radius-sm);
  padding: 11px 15px;
  font-size: clamp(13.5px, 2.3vw, 15px);
  line-height: 1.7;
  color: #6B4E12;
  margin-bottom: 16px;
}
.m-intent .lbl { font-weight: 800; color: var(--gold-dark); }

/* 讲解卡片 */
.teach-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: clamp(16px, 3.2vw, 24px);
  margin-bottom: 16px;
}
.kp-title {
  font-family: var(--font-hei);
  font-size: clamp(16px, 2.7vw, 19px);
  font-weight: 800;
  color: var(--primary-dark);
  margin: 4px 0 10px;
  display: flex; align-items: center; gap: 8px;
}
.kp-title::before { content: "📘"; font-size: .95em; }
.kp-desc { font-size: clamp(14px, 2.4vw, 16px); line-height: 1.85; color: var(--ink); margin: 0 0 12px; }
.kp-desc:last-child { margin-bottom: 0; }
.kp-desc b, .kp-desc strong { color: var(--primary-dark); }
.hl { color: var(--primary-dark); font-weight: bold; background: var(--primary-soft); padding: 0 4px; border-radius: 4px; }
.en { font-family: var(--font); font-style: italic; }

/* 语法表格 */
.g-table-wrap { overflow-x: auto; margin: 12px 0; -webkit-overflow-scrolling: touch; }
table.g-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 320px;
  font-size: clamp(13.5px, 2.3vw, 15.5px);
  background: var(--surface);
}
table.g-table th, table.g-table td {
  border: 1px solid var(--line);
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
  line-height: 1.5;
}
table.g-table th { background: var(--primary-soft); color: var(--primary-dark); font-family: var(--font-hei); font-weight: 700; }
table.g-table td.en, table.g-table td .en { font-family: var(--font); }
table.g-table caption { font-family: var(--font-hei); font-size: 13px; color: var(--ink-soft); text-align: left; margin-bottom: 6px; }
table.g-table .cn { font-family: var(--font-hei); color: var(--ink-soft); font-size: .92em; }

/* 例句列表 */
.examples { list-style: none; margin: 8px 0 4px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.examples li {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  padding: 9px 13px;
}
.ex-en { font-family: var(--font); font-size: clamp(15px, 2.6vw, 17px); line-height: 1.6; color: var(--ink); }
.ex-en b, .ex-en strong { color: var(--primary-dark); font-weight: bold; }
.ex-cn { font-family: var(--font-hei); font-size: clamp(13px, 2.3vw, 14.5px); color: var(--ink-soft); margin-top: 3px; line-height: 1.55; }
.examples-label { font-family: var(--font-hei); font-size: 13px; font-weight: 700; color: var(--primary-dark); margin: 12px 0 2px; }

/* 小贴士 */
.note {
  background: #EAF6FF;
  border: 1px solid #C9E5FA;
  border-left: 5px solid #4A9FE0;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin: 12px 0;
  font-size: clamp(13.5px, 2.3vw, 15px);
  line-height: 1.7;
}
.note .lbl { font-family: var(--font-hei); font-weight: 800; color: #2E7DBE; }
.note-cn { color: var(--ink); }
.note.warn { background: #FFF2EE; border-color: #F7D2C6; border-left-color: var(--accent-dark); }
.note.warn .lbl { color: var(--accent-dark); }

/* =========================================================================
   朗读(📢) / 点词查释义(.lw + 弹窗) / 本模块易错点
   ========================================================================= */
/* 例句：文字 + 朗读按钮 */
.ex-en { display: flex; align-items: flex-start; gap: 8px; }
.ex-en-t { flex: 1 1 auto; min-width: 0; }
.ex-speak {
  flex: 0 0 auto; width: 30px; height: 30px; margin-top: 1px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--primary-dark);
  cursor: pointer; transition: transform .12s, background .12s, box-shadow .12s;
  -webkit-tap-highlight-color: transparent;
}
.ex-speak:hover { background: #FFF0EA; }
.ex-speak:active { transform: scale(.9); }
.ex-speak.speaking { background: var(--primary); color: #fff; box-shadow: 0 0 0 4px rgba(226,59,59,.16); }

/* 可点击单词 */
.lw { cursor: pointer; border-radius: 3px; transition: background .1s; }
.lw:hover { background: rgba(74,159,224,.18); }
.lw:active { background: rgba(74,159,224,.3); }

/* 点词弹窗 */
.dict-pop {
  position: fixed; z-index: 1200; max-width: min(320px, 90vw);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.18);
  padding: 11px 13px; font-family: var(--font-hei);
}
.dp-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dp-word { font-family: var(--font); font-weight: 700; font-size: 17px; color: var(--ink); }
.dp-ipa { font-family: var(--font); font-size: 14px; color: var(--primary-dark); }
.dp-speak {
  margin-left: auto; width: 30px; height: 30px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--primary-dark); cursor: pointer;
}
.dp-speak:hover { background: #FFF0EA; }
.dp-speak.speaking { background: var(--primary); color: #fff; }
.dp-base { font-size: 12.5px; color: var(--ink-soft); margin-top: 5px; }
.dp-base b { color: var(--primary-dark); font-family: var(--font); }
.dp-cn { font-size: 14px; color: var(--ink); margin-top: 6px; line-height: 1.6; }

/* 本模块易错点 */
.pitfall-card {
  background: #FFF8E9; border: 1px solid #F3E0AE;
  border-left: 5px solid var(--gold-dark, #C98A00);
  border-radius: var(--radius-sm); padding: 12px 15px; margin: 12px 0 2px;
}
.pitfall-title {
  font-family: var(--font-hei); font-weight: 800; font-size: 14.5px;
  color: var(--gold-dark, #B7791F); margin-bottom: 6px;
}
.pitfall-list { margin: 0; padding-left: 20px; }
.pitfall-list li {
  font-family: var(--font-hei); font-size: clamp(13.5px, 2.3vw, 15px);
  line-height: 1.7; color: var(--ink); margin: 4px 0;
}
.pitfall-list li b { color: var(--accent-dark); }
.pitfall-list .en { color: var(--primary-dark); }

/* =========================================================================
   练习 / 测验
   ========================================================================= */
.practice {
  background: linear-gradient(165deg, #FFF6F0, var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: clamp(16px, 3.2vw, 22px);
  margin-top: 8px;
}
.practice-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.practice-head .p-title { font-family: var(--font-hei); font-size: clamp(16px, 2.7vw, 19px); font-weight: 800; color: var(--accent-dark); }
.practice-head .p-title::before { content: "✏️ "; }
.practice-sub { font-family: var(--font-hei); font-size: 13px; color: var(--ink-soft); margin: 0 0 14px; }

.q-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 14px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.q-card.correct { border-color: #BFE6CC; box-shadow: inset 0 0 0 1px #BFE6CC; }
.q-card.wrong { border-color: #F7C9C4; box-shadow: inset 0 0 0 1px #F7C9C4; }
.q-num { font-family: var(--font-hei); font-size: 12.5px; font-weight: 700; color: var(--primary-dark); }
.q-type { font-family: var(--font-hei); font-size: 11px; font-weight: 700; color: #fff; background: var(--accent); border-radius: 999px; padding: 2px 9px; margin-left: 6px; }
.q-type.fill { background: #4A9FE0; }
.q-type.write { background: #7A5AF0; }
.q-type.order { background: #2E9E8F; }

/* 造句输入框 */
.q-writein {
  width: 100%;
  font-family: var(--font);
  font-size: clamp(15px, 2.6vw, 17px);
  color: var(--ink);
  background: var(--surface-2);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 11px 14px;
  outline: none;
  margin-top: 4px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.q-writein:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); background: #fff; }
.q-writein.ok { border-color: var(--correct); color: var(--correct); font-weight: bold; }
.q-writein.no { border-color: var(--wrong); color: var(--wrong); }

/* 连词成句 */
.order-answer {
  min-height: 46px;
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 9px 12px; margin: 8px 0;
  border: 1.5px dashed var(--primary);
  border-radius: 12px; background: #FFF7F6;
}
.order-answer.ok { border-style: solid; border-color: var(--correct); background: #E9F7EE; }
.order-answer.no { border-style: solid; border-color: var(--wrong); background: #FDEBEA; }
.order-ph { font-family: var(--font-hei); color: var(--ink-soft); font-size: 13px; }
.order-bank { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.order-chip {
  font-family: var(--font);
  font-size: clamp(14px, 2.5vw, 16.5px);
  color: var(--primary-dark);
  background: linear-gradient(180deg, #FFFFFF, #FFF0EF);
  border: 1.5px solid var(--primary);
  border-radius: 10px;
  padding: 7px 13px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .06s ease;
}
.order-answer .order-chip { background: linear-gradient(180deg, #FFF0EF, #FDE2E0); }
.order-chip:active { transform: translateY(1px); }
.order-chip:disabled { cursor: default; opacity: .9; }

/* 测验提交条 */
.test-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 8px 0 4px; }
.test-submit { padding: 11px 28px; }
.test-progress { font-family: var(--font-hei); font-size: 13.5px; color: var(--ink-soft); }

/* =========================================================================
   可折叠面板（练习 / 测验 / 错题本）
   ========================================================================= */
.collapse { margin: 22px 0; }
.collapse-head {
  width: 100%;
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-hei);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 14px 18px;
  cursor: pointer; text-align: left;
  transition: filter .12s ease;
}
.collapse-head:hover { filter: brightness(1.02); }
.collapse-head:active { transform: translateY(1px); }
.collapse.open .collapse-head { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.collapse-head .ch-main { font-size: clamp(16px, 2.7vw, 19px); font-weight: 800; color: var(--primary-dark); }
.collapse-head .ch-stat {
  margin-left: auto; flex: none;
  font-size: 13px; font-weight: 700; color: var(--ink-soft);
  background: var(--surface-2); border: 1px solid var(--line);
  padding: 4px 12px; border-radius: 999px; white-space: nowrap;
}
.collapse-head .ch-chevron { flex: none; color: var(--primary); font-size: 13px; transition: transform .2s ease; }
.collapse.open .ch-chevron { transform: rotate(180deg); }
.collapse-body {
  border: 1px solid var(--line); border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: clamp(14px, 3vw, 20px);
  background: linear-gradient(180deg, #FFFBFA, var(--surface));
}
/* 练习面板：珊瑚强调 */
.collapse-head.accent .ch-main { color: var(--accent-dark); }
/* 测验面板：金色标题栏 */
.collapse-head.gold { background: linear-gradient(180deg, #FFE7AE, var(--gold)); border-color: #E6C24A; }
.collapse-head.gold .ch-main { color: #6B4E12; }
.collapse-head.gold .ch-stat { background: rgba(255,255,255,.62); border-color: #E6C24A; color: #6B4E12; }
.collapse-head.gold .ch-chevron { color: #6B4E12; }
.collapse.unit-test .collapse-body, .collapse.mistakes .collapse-body { background: linear-gradient(180deg, #FFF9F1, var(--surface)); }
.test-desc { font-family: var(--font-hei); font-size: 13.5px; line-height: 1.7; color: var(--ink); margin: 0 0 14px; }
.test-desc b { color: var(--primary-dark); }
.mist-toolbar { display: flex; justify-content: flex-end; margin-bottom: 6px; }

/* 错题本 */
.mistakes { margin: 30px 0 10px; }
.mist-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.mist-head h2 { font-family: var(--font-hei); margin: 0; font-size: clamp(19px, 3.2vw, 24px); color: var(--primary-dark); }
.mist-badge { color: var(--accent-dark); font-size: .8em; }
.mist-refresh { margin-left: auto; }
.mist-body { margin-top: 12px; }
.mist-empty {
  font-family: var(--font-hei); color: var(--correct);
  background: #E9F7EE; border: 1px solid #BFE6CC; border-radius: var(--radius-sm);
  padding: 16px; text-align: center; font-weight: 700;
}
.badge-mist { font-family: var(--font-hei); font-size: 13px; font-weight: 700; color: var(--accent-dark); background: #FFEDE4; padding: 4px 10px; border-radius: 999px; }
.badge-clear { font-family: var(--font-hei); font-size: 13px; font-weight: 700; color: var(--correct); background: #E5F5EB; padding: 4px 10px; border-radius: 999px; }
.q-stem {
  font-family: var(--font);
  font-size: clamp(15px, 2.6vw, 17.5px);
  line-height: 1.9;
  color: var(--ink);
  margin: 8px 0 12px;
}
.q-stem .cn-hint { font-family: var(--font-hei); font-size: .82em; color: var(--ink-soft); }

/* 填空输入 */
.q-blank {
  font-family: var(--font);
  font-size: clamp(15px, 2.6vw, 17px);
  color: var(--ink);
  background: var(--surface-2);
  border: none;
  border-bottom: 2px solid var(--primary);
  border-radius: 6px 6px 3px 3px;
  padding: 3px 8px;
  min-width: 90px;
  max-width: 200px;
  text-align: center;
  outline: none;
}
.q-blank:focus { background: #fff; box-shadow: 0 2px 0 var(--primary); }
.q-blank.ok { color: var(--correct); border-bottom-color: var(--correct); font-weight: bold; }
.q-blank.no { color: var(--wrong); border-bottom-color: var(--wrong); font-weight: bold; }

/* 选择题选项 */
.opts { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 4px; }
.opt {
  font-family: var(--font);
  display: flex; align-items: center; gap: 10px;
  text-align: left;
  font-size: clamp(15px, 2.5vw, 16.5px);
  color: var(--ink);
  background: var(--surface-2);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 11px 14px;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
  width: 100%;
}
.opt:hover:not(:disabled) { border-color: var(--primary); background: #fff; }
.opt .opt-key {
  font-family: var(--font-hei);
  flex: none;
  display: inline-grid; place-items: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary-dark);
  font-size: 13px; font-weight: 700;
}
.opt.selected { border-color: var(--primary); background: #FFF3F1; }
.opt.selected .opt-key { background: var(--primary); color: #fff; }
.opt.opt-correct { border-color: var(--correct); background: #E9F7EE; }
.opt.opt-correct .opt-key { background: var(--correct); color: #fff; }
.opt.opt-wrong { border-color: var(--wrong); background: #FDEBEA; }
.opt.opt-wrong .opt-key { background: var(--wrong); color: #fff; }
.opt:disabled { cursor: default; }

/* 反馈区 */
.q-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.btn-check { padding: 8px 20px; font-size: 15px; }
.btn-mini { font-family: var(--font-hei); font-size: 13.5px; font-weight: 700; padding: 7px 15px; }
.q-verdict { font-family: var(--font-hei); font-size: 14.5px; font-weight: 800; }
.q-verdict.ok { color: var(--correct); }
.q-verdict.no { color: var(--wrong); }
.q-feedback { margin-top: 10px; display: none; }
.q-feedback.show { display: block; }
.q-answer {
  font-family: var(--font-hei);
  font-size: 14px; color: var(--ink);
  background: #E9F7EE; border: 1px solid #BFE6CC;
  border-radius: 8px; padding: 8px 12px; margin-bottom: 8px;
}
.q-answer .a-en { font-family: var(--font); font-weight: bold; color: var(--correct); }
.q-explain {
  font-size: 13.5px; color: var(--ink-soft); line-height: 1.7;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 12px;
}
.q-explain .en { color: var(--primary-dark); }

/* 教材示范块（原书已给答案的例题） */
.q-example {
  border: 1px dashed var(--primary);
  background: linear-gradient(180deg, #FFF6F5, var(--surface));
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 14px;
}
.qe-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.qe-no { font-family: var(--font-hei); font-weight: 800; color: var(--primary-dark); font-size: 13px; }
.qe-tag { font-family: var(--font-hei); font-size: 11px; font-weight: 700; color: #fff; background: var(--primary); border-radius: 999px; padding: 2px 9px; }
.qe-body { font-family: var(--font); font-size: clamp(15px, 2.6vw, 17px); line-height: 1.6; color: var(--ink); }
.qe-body b { color: var(--correct); }
.qe-cn { font-family: var(--font-hei); font-size: 13px; color: var(--ink-soft); margin-top: 4px; line-height: 1.5; }

/* 练习结果条 */
.practice-result {
  display: none;
  margin-top: 6px;
  font-family: var(--font-hei);
  font-size: 15px; font-weight: 800;
  text-align: center;
  padding: 12px;
  border-radius: var(--radius-sm);
}
.practice-result.show { display: block; }
.practice-result.pass { color: var(--correct); background: #E9F7EE; border: 1px solid #BFE6CC; }
.practice-result.retry { color: var(--accent-dark); background: #FFF2EC; border: 1px solid #F7D2C6; }

.practice-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 4px; }

/* Unit 测验区 */
.unit-test { margin: 30px 0 10px; }
.test-head {
  background: linear-gradient(180deg, #FFE7AE, var(--gold));
  color: #6B4E12;
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.test-head h2 { font-family: var(--font-hei); margin: 0 0 4px; font-size: clamp(19px, 3.2vw, 24px); }
.test-head p { font-family: var(--font-hei); margin: 0; font-size: 13.5px; line-height: 1.6; }

/* 底部导航 */
.unit-footnav { display: flex; justify-content: space-between; gap: 12px; margin: 30px 0 10px; }
.unit-footnav .btn { flex: 1; text-align: center; }
.unit-footnav .btn.disabled { opacity: .4; pointer-events: none; }

/* 恭喜横幅 */
.win-toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(120%);
  z-index: 300;
  background: linear-gradient(180deg, #33B764, #2E9E52);
  color: #fff; font-family: var(--font-hei); font-weight: 800;
  padding: 13px 26px; border-radius: 999px;
  box-shadow: 0 10px 30px rgba(46,158,82,.4);
  transition: transform .3s cubic-bezier(.2,.9,.3,1.2);
  font-size: 16px;
}
.win-toast.show { transform: translateX(-50%) translateY(0); }

.footer-note { text-align: center; font-family: var(--font-hei); color: var(--ink-soft); font-size: 12.5px; margin: 30px 0 10px; line-height: 1.6; }

/* 小屏微调 */
@media (max-width: 520px) {
  .q-stem { line-height: 1.8; }
  .m-tag { width: 34px; height: 34px; font-size: 17px; }
}
