/* embed 模式:被 vocab.html iframe 引入的子页(daily/library/test)加 ?embed=1
   会由页头脚本给 <html> 加 .embed 类,这里统一隐藏顶栏留出内容区。 */
html.embed .topbar { display: none !important; }
html.embed body { padding-top: 0; margin: 0; }
html.embed .container { padding-top: 8px; }

/* ---------- Notion 优雅版主题(2026-07 · Follow-up 4)----------
   白底 + 深灰文字 + 单点深绿 accent + serif 标题 + Sans 正文。
   保留 --green / --green-dark 别名兼容旧组件,值切到新主题。 */
:root {
  --accent: #059669;         /* 深翠绿:主强调色 */
  --accent-hover: #047857;
  --accent-soft: #d1fae5;    /* 强调背景 */
  --bg: #fafafa;             /* 页面背景近白 */
  --card: #ffffff;
  --text: #1a1a1a;
  --text-soft: #374151;      /* 次文字 */
  --muted: #6b7280;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --hl: #ecfdf5;             /* 高亮背景(极浅绿) */
  --danger: #dc2626;
  --warn: #d97706;
  /* 兼容别名(旧组件用) */
  --green: var(--accent);
  --green-dark: var(--accent-hover);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-serif: var(--font-sans);
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  /* ---- 字型系统(2026-07 · type scale)----
     6 级字号 + 4 级字重 + 3 级行距。全站硬编码 font-size / font-weight
     逐步收敛到这套 tokens。
     使用映射见 h1-h4 defaults 与 .type-caption / .type-label helper。 */
  --text-xs:   11px;   /* label · badge · seg-no · 页脚 */
  --text-sm:   13px;   /* caption · muted meta · 表格 · 生词提示 */
  --text-base: 15px;   /* 默认正文 · question item · card body */
  --text-md:   17px;   /* h4 · card title · 阅读原文 · topbar h1 */
  --text-lg:   20px;   /* h3 · section 标题 · book-head */
  --text-xl:   26px;   /* h2 · 页面主标题 */
  --text-2xl:  34px;   /* hero(landing 用,慎用) */

  --w-regular: 400;
  --w-medium:  500;
  --w-semi:    600;
  --w-bold:    700;

  --lh-tight:   1.30;   /* 标题 */
  --lh-normal:  1.55;   /* UI 元素、按钮、caption */
  --lh-relaxed: 1.75;   /* 长段正文、阅读原文 */
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; font-family: var(--font-sans);
  font-size: var(--text-base); font-weight: var(--w-regular);
  background: var(--bg); color: var(--text); line-height: var(--lh-relaxed);
  -webkit-font-smoothing: antialiased;
}

/* ---- 标题梯度(全站统一)---- */
h1, h2, h3, h4 {
  font-family: var(--font-serif); color: var(--text);
  letter-spacing: -0.01em; line-height: var(--lh-tight);
  margin: 0 0 0.5em;
}
h1 { font-size: var(--text-2xl);  font-weight: var(--w-bold); }
h2 { font-size: var(--text-xl);   font-weight: var(--w-semi); }
h3 { font-size: var(--text-lg);   font-weight: var(--w-semi); }
h4 { font-size: var(--text-md);   font-weight: var(--w-semi); font-family: var(--font-sans); letter-spacing: 0; }

/* ---- 通用文字 helper(不覆盖组件里已经硬编码的 font-size,只补 body defaults)---- */
p { line-height: var(--lh-relaxed); }
small, .type-caption { font-size: var(--text-sm); color: var(--muted); line-height: var(--lh-normal); }
.type-label {
  font-size: var(--text-xs); font-weight: var(--w-medium);
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
}
code, kbd, .type-mono { font-family: var(--font-mono); font-size: 0.92em; }

/* ---- Band Descriptors 面板(writing / speaking 共用)---- */
.bd-panel { margin: 12px 0 16px; padding: 8px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); }
.bd-panel[open] { padding-bottom: 14px; }
.bd-heading { cursor: pointer; font-weight: 600; color: var(--text-soft); font-size: var(--text-sm); padding: 4px 0; user-select: none; }
.bd-heading:hover { color: var(--accent-hover); }
.bd-body { padding-top: 10px; font-size: var(--text-sm); line-height: var(--lh-normal); }
.bd-criteria { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 16px; margin-bottom: 12px; }
.bd-criterion { color: var(--text-soft); }
.bd-criterion b { color: var(--accent-hover); font-family: var(--font-mono); font-size: var(--text-sm); margin-right: 4px; }
.bd-criterion .bd-cn { color: var(--text); font-weight: 500; margin-right: 4px; }
.bd-criterion .bd-desc { color: var(--muted); }
.bd-levels { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.bd-level { border-left: 2px solid var(--border); padding: 4px 10px; }
.bd-level summary { cursor: pointer; font-weight: 500; color: var(--text-soft); user-select: none; }
.bd-level summary b { color: var(--accent); font-family: var(--font-mono); }
.bd-level ul { margin: 6px 0 4px 20px; padding: 0; color: var(--text-soft); }
.bd-level li { margin: 2px 0; }
.bd-level li b { color: var(--accent-hover); font-family: var(--font-mono); font-size: var(--text-xs); margin-right: 4px; }
.bd-level .bd-target { display: inline; margin-left: 8px; font-size: var(--text-xs); color: var(--warn); font-weight: 500; }
.bd-tips { padding-top: 8px; border-top: 1px dashed var(--border); }
.bd-tips h4 { font-size: var(--text-sm); margin: 0 0 4px; color: var(--text-soft); }
.bd-tips ul { margin: 0 0 0 18px; padding: 0; color: var(--muted); font-size: var(--text-sm); }
.bd-tips li { margin: 3px 0; }
@media (max-width: 640px) { .bd-criteria { grid-template-columns: 1fr; } }
header.topbar {
  min-height: 60px; padding: 0 34px;
  display: flex; align-items: center; gap: 28px;
  background: rgba(255,255,255,.9); color: var(--text);
  border-bottom: 1px solid rgba(24, 63, 48, .1);
  box-shadow: 0 1px 0 rgba(255,255,255,.8);
  backdrop-filter: blur(14px);
  position: sticky; top: 0; z-index: 30;
}
header.topbar h1 {
  display: inline-flex; align-items: center; gap: 10px;
  margin: 0 10px 0 0; font-family: Georgia, "Noto Serif SC", "Songti SC", serif;
  font-size: 18px; font-weight: 700; letter-spacing: -.02em; line-height: 1;
}
header.topbar h1::before {
  content: ""; width: 10px; height: 22px; border-radius: 2px 7px 7px 2px;
  background: var(--accent); box-shadow: 4px 0 0 rgba(5,150,105,.17);
}
header.topbar a {
  align-self: stretch; display: inline-flex; align-items: center; position: relative;
  color: #69746d; text-decoration: none; font-weight: 500;
  font-size: 14px; transition: color .15s;
}
header.topbar a:hover { color: var(--text); }
header.topbar a.active { color: var(--accent); font-weight: 600; }
header.topbar a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 3px; border-radius: 3px 3px 0 0; background: var(--accent);
}
.container { max-width: 1200px; margin: 0 auto; padding: 28px 32px; }

/* ---- 长文本两端对齐(F4 合并进来)---- */
.container p, .container li,
.task-prompt, .task-hint, .sp-cue, .sp-note,
.review-hint, .review-answer, .review-answer p,
.pane.left p, .gzh, .seg-zh, .details-zh,
.pdef, .card p {
  text-align: justify;
  text-justify: inter-word;
}
.gzh, .seg-zh, .details-zh, .chunk-zh, .gp-explain, .deep-plain,
.q-zh, .dw-def, .expr-zh { text-justify: auto; }

.filebtn {
  display: inline-block; background: var(--green); color: #fff; border-radius: 7px;
  padding: 7px 13px; cursor: pointer; font-size: 14px; white-space: nowrap;
}
.ghostbtn, .ghostfile {
  border: 1px solid #acd5b1 !important; background: #fff !important; color: var(--green-dark) !important;
}
.ghostbtn:hover, .ghostfile:hover { background: #eef8ef !important; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card {
  background: var(--card); border-radius: 10px; padding: 16px 18px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08); text-decoration: none; color: inherit;
  display: block; transition: transform .1s, box-shadow .1s;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 3px 10px rgba(0,0,0,.12); }
.card .src { color: var(--muted); font-size: 13px; }
.card .title { font-size: 17px; font-weight: 600; margin: 6px 0; }
.card .count { color: var(--green-dark); font-size: 13px; display: flex; gap: 12px; }

/* ---- 阅读内容按册分组(可折叠) ---- */
.book-group { margin-bottom: 22px; }
.book-head {
  display: flex; align-items: baseline; gap: 12px; width: 100%;
  margin: 0 0 14px; padding: 6px 4px 10px; border: none;
  border-bottom: 2px solid #dce8dd; background: none;
  font: inherit; text-align: left; cursor: pointer; color: inherit;
}
.book-head:hover { border-bottom-color: var(--green); }
.book-head h2 { font-size: 20px; margin: 0; color: var(--text); }
.book-note { color: var(--muted); font-size: 13px; }
.book-caret {
  align-self: center; color: var(--green-dark); font-size: 12px;
  transition: transform .15s; transform: rotate(90deg);
}
.book-group.collapsed .book-caret { transform: rotate(0deg); }
.book-group.collapsed .book-head { margin-bottom: 0; }
.book-group.collapsed .card-grid { display: none; }

/* ---- 阅读 / 听力资料库：纸质书房视觉 ---- */
.library-page,
.listening-page { background: #f4f6f1; }
.library-shell { max-width: 1320px; padding-top: 34px; padding-bottom: 64px; }
.library-hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 258px; padding: 42px 48px;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 42px;
  border-radius: 28px; color: #f7f4e9;
  background:
    radial-gradient(circle at 77% 12%, rgba(225,190,107,.23), transparent 26%),
    linear-gradient(135deg, #102e25 0%, #174735 58%, #1b5b43 100%);
  box-shadow: 0 22px 54px rgba(24, 58, 45, .17);
}
.library-hero::before {
  content: ""; position: absolute; z-index: -1; inset: 0 0 0 57%; opacity: .23;
  background: repeating-linear-gradient(104deg, transparent 0 26px, rgba(255,255,255,.25) 27px 28px, transparent 29px 50px);
  transform: skewX(-9deg) scale(1.25);
}
.library-hero::after {
  content: "IELTS"; position: absolute; z-index: -1; right: 33px; top: -34px;
  font: 700 146px/.9 Georgia, serif; letter-spacing: -.07em;
  color: transparent; -webkit-text-stroke: 1px rgba(255,255,255,.12);
}
.library-hero-copy { max-width: 650px; }
.library-eyebrow {
  display: block; margin-bottom: 14px; color: #d9c58f;
  font-size: 11px; font-weight: 700; letter-spacing: .19em;
}
.library-hero h2 {
  margin: 0 0 13px; color: #fff;
  font: 700 43px/1.08 Georgia, "Noto Serif SC", "Songti SC", serif;
  letter-spacing: -.04em;
}
.library-hero p {
  max-width: 590px; margin: 0; color: rgba(245,248,242,.73);
  font-size: 15px; line-height: 1.75; text-align: left;
}
.library-stats {
  display: grid; grid-template-columns: repeat(3, minmax(82px, 1fr));
  min-width: 335px; border: 1px solid rgba(255,255,255,.16); border-radius: 18px;
  background: rgba(4,28,20,.22); backdrop-filter: blur(8px); overflow: hidden;
}
.library-stats div { padding: 18px 16px; border-right: 1px solid rgba(255,255,255,.12); text-align: center; }
.library-stats div:last-child { border-right: 0; }
.library-stats strong { display: block; color: #fff; font: 700 28px/1 Georgia, serif; }
.library-stats span { display: block; margin-top: 8px; color: rgba(255,255,255,.58); font-size: 11px; }
.library-toolbar {
  margin: 42px 0 20px; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
}
.library-toolbar > div:first-child { display: flex; align-items: baseline; gap: 13px; }
.library-toolbar-label {
  color: #173f30; font: 700 24px/1.2 Georgia, "Noto Serif SC", "Songti SC", serif;
}
.library-toolbar small { color: #8a938d; font-size: 12px; }
.library-search {
  width: min(330px, 100%); height: 42px; padding: 0 14px;
  display: flex; align-items: center; gap: 9px; border: 1px solid #d9dfd8; border-radius: 12px;
  background: rgba(255,255,255,.78); color: #819087; transition: border-color .15s, box-shadow .15s, background .15s;
}
.library-search:focus-within { border-color: #72a88d; background: #fff; box-shadow: 0 0 0 4px rgba(5,150,105,.08); }
.library-search input { width: 100%; border: 0; outline: 0; background: transparent; color: #26342d; font: inherit; font-size: 13px; }
.library-search input::placeholder { color: #9aa39d; }

.reading-library .book-shelf {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 17px;
}
.reading-library .book-group {
  min-width: 0; margin: 0; border: 1px solid rgba(32,67,53,.11); border-radius: 18px;
  background: rgba(255,255,255,.82); box-shadow: 0 8px 24px rgba(32,58,47,.055);
  overflow: hidden; animation: shelf-in .45s both; animation-delay: calc(var(--book-order) * 24ms);
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.reading-library .book-group.collapsed:hover {
  transform: translateY(-4px); border-color: rgba(5,150,105,.3); box-shadow: 0 16px 34px rgba(28,65,49,.11);
}
.reading-library .book-group:not(.collapsed) { grid-column: 1 / -1; border-color: rgba(5,150,105,.24); }
.reading-library .book-head {
  width: 100%; min-height: 188px; margin: 0; padding: 22px;
  display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto 1fr auto;
  gap: 0 18px; align-items: start; border: 0; background: transparent; color: inherit;
  text-align: left; cursor: pointer;
}
.reading-library .book-head:hover { border: 0; }
.book-number {
  grid-column: 1; align-self: start; color: #aec3b6;
  font: 700 47px/.95 Georgia, serif; letter-spacing: -.06em;
}
.book-title-block { grid-column: 1; align-self: end; display: block; }
.book-title-block small { color: #8f9a93; font-size: 9px; font-weight: 700; letter-spacing: .13em; }
.book-title-block h2 { margin: 5px 0 0; color: #18362b; font-size: 20px; }
.book-count { grid-column: 2; grid-row: 1; text-align: right; }
.book-count strong { display: block; color: #1e4938; font: 700 22px/1 Georgia, serif; }
.book-count small { color: #99a29d; font-size: 10px; }
.book-action {
  grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between;
  padding-top: 14px; border-top: 1px solid #e5e9e4; color: #59806c; font-size: 11px; font-weight: 600;
}
.book-caret { color: inherit; font-size: 17px; transform: none; transition: transform .2s; }
.book-group:not(.collapsed) .book-caret,
.lsn-book-group:not(.collapsed) .book-caret { transform: rotate(90deg); }
.reading-library .book-group:not(.collapsed) .book-head {
  min-height: 98px; padding: 17px 22px;
  grid-template-columns: 68px minmax(0,1fr) auto 118px; grid-template-rows: 1fr;
  align-items: center; border-bottom: 1px solid #e4e9e3;
}
.reading-library .book-group:not(.collapsed) .book-number { grid-column: 1; grid-row: 1; font-size: 34px; }
.reading-library .book-group:not(.collapsed) .book-title-block { grid-column: 2; grid-row: 1; align-self: center; }
.reading-library .book-group:not(.collapsed) .book-count { grid-column: 3; grid-row: 1; align-self: center; }
.reading-library .book-group:not(.collapsed) .book-action {
  grid-column: 4; grid-row: 1; align-self: stretch; padding: 0 0 0 18px;
  border-top: 0; border-left: 1px solid #e5e9e4;
}
.reading-library .book-group .card-grid {
  padding: 22px; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; background: #f8faf7;
}
.reading-library .book-group.collapsed .card-grid { display: none; }
.reading-library .card {
  min-height: 150px; padding: 17px; border: 1px solid #e2e7e1; border-radius: 13px; background: #fff;
  box-shadow: none; display: flex; flex-direction: column; transition: border-color .15s, transform .15s, box-shadow .15s;
}
.reading-library .card:hover { transform: translateY(-2px); border-color: #9bc4ad; box-shadow: 0 10px 24px rgba(34,72,55,.09); }
.reading-library .card-topline { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.reading-library .card-order { color: #56806c; font-size: 9px; font-weight: 700; letter-spacing: .09em; }
.reading-library .card-arrow { color: #a9b4ae; font-size: 17px; }
.reading-library .card .src { font-size: 11px; }
.reading-library .card .title { margin: 5px 0 18px; font: 600 16px/1.45 Georgia, "Noto Serif SC", serif; }
.reading-library .card .count { margin-top: auto; color: #6d7d74; font-size: 11px; justify-content: space-between; }
@keyframes shelf-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (max-width: 1050px) {
  .reading-library .book-shelf { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .reading-library .book-group .card-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .library-hero { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 760px) {
  header.topbar { padding: 0 18px; gap: 18px; overflow-x: auto; scrollbar-width: none; }
  header.topbar::-webkit-scrollbar { display: none; }
  header.topbar h1 { position: sticky; left: 0; z-index: 2; flex: 0 0 auto; padding-right: 10px; background: rgba(255,255,255,.94); }
  header.topbar a { flex: 0 0 auto; white-space: nowrap; }
  .library-shell { padding: 20px 16px 44px; }
  .library-hero { min-height: 0; padding: 30px 24px; border-radius: 20px; }
  .library-hero h2 { font-size: 34px; }
  .library-stats { width: 100%; min-width: 0; }
  .library-toolbar { align-items: stretch; flex-direction: column; margin-top: 32px; }
  .library-toolbar > div:first-child { align-items: flex-start; flex-direction: column; gap: 4px; }
  .library-search { width: 100%; }
  .reading-library .book-shelf { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .reading-library .book-group .card-grid { grid-template-columns: 1fr; }
  .reading-library .book-group:not(.collapsed) .book-head {
    grid-template-columns: 55px minmax(0,1fr) auto; grid-template-rows: 1fr; padding: 15px;
  }
  .reading-library .book-group:not(.collapsed) .book-action { display: none; }
}
@media (max-width: 500px) {
  .reading-library .book-shelf { grid-template-columns: 1fr; }
  .library-stats strong { font-size: 23px; }
  .library-stats div { padding: 15px 8px; }
}

/* ---- 阅读器 ---- */
.reader-toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.reader-toolbar button:not(.phase-tab):not(.toolbar-btn) {
  background: var(--green); color: #fff; border: none; border-radius: 6px;
  padding: 6px 12px; cursor: pointer; font-size: 14px;
}
.reader-toolbar .src { color: var(--muted); font-size: 14px; }
.speech-controls {
  display: flex; align-items: center; gap: 6px; margin-left: auto; padding: 4px 5px 4px 10px;
  border: 1px solid #d9e4da; border-radius: 8px; background: #fff; color: #738077; font-size: 12px;
}
.speech-controls select { max-width: 180px; border: 0; background: transparent; color: #435149; font-size: 12px; outline: none; }
.reader-toolbar .speech-controls .speech-stop { padding: 3px 8px; background: #e8efe9; color: #52705a; }
.reader-toolbar .speech-controls .speech-stop:disabled { opacity: .45; }
.reader-grid {
  display: grid; grid-template-columns: minmax(360px, 1.15fr) minmax(300px, .86fr) minmax(360px, 1fr);
  gap: 16px; align-items: start;
}
.reader-grid .pane { max-height: calc(100dvh - 100px); overflow-y: auto; scrollbar-gutter: stable; }
.pane { background: var(--card); border-radius: 10px; padding: 18px 22px; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.pane.left { font-size: 17px; }
.pane.left p { margin: 0 0 12px; }
.sent { cursor: pointer; border-radius: 3px; transition: background .18s ease; }
.sent:hover { background: #eef7ef; }
.sent.active { background: var(--hl); }
.sent.pulse { animation: sent-pulse 1.15s ease-out; }
@keyframes sent-pulse {
  0% { box-shadow: 0 0 0 0 rgba(74,157,91,.55); }
  70% { box-shadow: 0 0 0 8px rgba(74,157,91,0); }
  100% { box-shadow: 0 0 0 0 rgba(74,157,91,0); }
}
.sent.speaking { background: #ccebd1; box-shadow: 0 0 0 2px #ccebd1; }
.speak-sentence {
  margin: 0 5px 0 0; padding: 0 3px; border: 0; border-radius: 4px;
  background: transparent; color: var(--green-dark); cursor: pointer; font-size: 12px;
  vertical-align: .12em; opacity: .58;
}
.sent:hover .speak-sentence, .sent.speaking .speak-sentence { opacity: 1; }
.speak-sentence:hover { background: #d9eddd; }
.speak-sentence:disabled { opacity: .25; cursor: default; }
.word { cursor: pointer; }
.word.phrase { border-bottom: 1px dotted #9fbea5; }
.word.phrase:hover { background: #e3f3e5; border-bottom-color: var(--green-dark); }
.word.saved { color: var(--green-dark); border-bottom: 2px solid var(--green); }
/* 右侧讲解卡片(折叠式) */
.gcard {
  border-left: 3px solid transparent; padding: 4px 10px; margin-bottom: 6px; border-radius: 4px;
  font-family: "Avenir Next", "Avenir", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  line-height: 2;
}
.gcard.active { border-left-color: var(--green); background: #f3faf4; }
.gcard .ghead { display: flex; align-items: center; gap: 6px; cursor: pointer; padding: 4px 0; user-select: none; }
.gcard .ghead:hover .gtype { color: var(--green); }
.gcard .garrow { color: var(--green-dark); font-size: 12px; transition: transform .25s ease; }
.gcard.open .garrow { transform: rotate(90deg); }
.gcard .gtype { font-weight: 600; color: var(--green-dark); font-size: 16px; }
.gcard .gbody { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .28s ease; }
.gcard.open .gbody { grid-template-rows: 1fr; }
.gcard .gbody-inner { overflow: hidden; min-height: 0; }
.gcard .gnote { font-size: 16px; margin: 4px 0; }
.gcard .gzh { font-size: 16px; color: #333; }
.gcard .gwords { font-size: 15px; color: var(--muted); margin-top: 4px; padding-bottom: 6px; }
.glabel {
  display: inline-block; background: var(--green-dark); color: #fff;
  font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 4px;
  margin-right: 6px; vertical-align: baseline; letter-spacing: .04em;
  position: relative; top: -1px;
}
.hide-zh .gzh { display: none; }
/* ---- 中栏题目 ---- */
.pane.questions { padding: 0; overflow-x: hidden; overflow-y: auto; }
.questions-title {
  position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between;
  align-items: baseline; padding: 15px 17px 12px; background: #20352a; color: #fff;
}
.questions-title span { font-size: var(--text-lg); font-weight: var(--w-semi); }
.questions-title small { color: #bcd3c1; }
.question-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.question-actions button {
  border: 1px solid rgba(214,236,219,.6); border-radius: 999px; padding: 4px 9px;
  background: rgba(255,255,255,.09); color: #eaf7ed; cursor: pointer; font-size: 12px;
}
.question-actions button:hover { background: rgba(255,255,255,.18); }
.question-group { padding: 16px 17px 20px; border-bottom: 1px solid #e6ebe7; }
.question-group h2 { margin: 0 0 8px; font-size: var(--text-md); font-weight: var(--w-bold); color: var(--text); }
.instruction { margin: 3px 0; color: #69736c; font-size: 13px; }
.question-item { margin: 15px 0; padding: 11px; border-radius: 8px; background: #f7f8f5; border: 1px solid transparent; }
.question-item label { display: flex; gap: 9px; font-size: 15px; line-height: 1.5; cursor: pointer; }
.question-item label b { color: var(--green-dark); flex: 0 0 18px; }
.question-item input { width: 100%; margin-top: 9px; padding: 7px 9px; border: 1px solid #cbd4cd; border-radius: 6px; background: #fff; font-size: 15px; }
.question-item.correct { border-color: #75b881; background: #eff8f0; }
.question-item.wrong { border-color: #d99a91; background: #fff5f3; }
.question-item.answer-only { border-color: #bcd8c1; background: #f1f8f2; }
.question-item.unanswered { border-color: #d7c28b; background: #fff9e8; }
.answer-note { min-height: 18px; margin-top: 4px; color: #9b4439; font-size: 12px; }
.question-item.correct .answer-note { color: #397a47; }
.question-item.answer-only .answer-note { color: #315f3b; }
.evidence-jump {
  margin-left: 7px; border: 0; border-radius: 999px; padding: 2px 7px;
  background: #dbeee0; color: #356b42; cursor: pointer; font-size: 11px;
}
.evidence-jump:hover { background: #c9e5cf; }
.check-answers { width: 100%; border: 0; border-radius: 7px; padding: 8px; background: #20352a; color: #fff; cursor: pointer; }
.question-empty { padding: 18px; color: var(--muted); }
/* 生词气泡 */
.popup {
  position: absolute; z-index: 50; background: #fff; border: 1px solid #ddd;
  border-radius: 8px; box-shadow: 0 3px 12px rgba(0,0,0,.18); padding: 10px 12px;
  max-width: 260px; font-size: 14px;
}
.popup .pw { font-weight: 600; }
.popup .ppos { color: var(--muted); font-size: 12px; margin-left: 4px; }
.popup .pdef { max-height: 120px; overflow-y: auto; }
.popup button {
  margin-top: 8px; background: var(--green); color: #fff; border: none;
  border-radius: 5px; padding: 4px 10px; cursor: pointer; font-size: 13px;
}
.popup button:disabled { background: #bbb; cursor: default; }
.popup-actions { display: flex; gap: 7px; align-items: center; }
.popup .speak-word { background: #263d30; }
/* 做题模式:原文 + 题目,两栏 */
.reader-grid[data-phase="practice"] {
  grid-template-columns: 1fr 1fr;
}
.reader-grid[data-phase="practice"] .pane.right { display: none; }

/* 精读模式:原文 + 分析卡,两栏 */
.reader-grid[data-phase="analysis"] {
  grid-template-columns: 1fr 1fr;
}
.reader-grid[data-phase="analysis"] .pane.questions { display: none; }
.reader-grid[data-phase="analysis"] .pane.right {
  animation: fadeSlideIn .3s ease;
}
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: none; }
}

/* 答题/精读 Tab 切换 */
.phase-tabs {
  display: flex; border: 1px solid #cfe0d2; border-radius: 8px; overflow: hidden;
}
.phase-tab {
  padding: 6px 18px; border: none; background: #fff;
  color: var(--green-dark); font-size: 14px; font-weight: 600; cursor: pointer;
}
.phase-tab + .phase-tab { border-left: 1px solid #cfe0d2; }
.phase-tab.active { background: var(--green-dark); color: #fff; }
.phase-tab:not(.active):hover { background: #f0f8f1; }
.phase-tab.pulse-hint { animation: phase-pulse 1.8s ease-in-out 2; }
@keyframes phase-pulse {
  0%, 100% { box-shadow: none; }
  50% { box-shadow: 0 0 0 4px rgba(74,157,91,.4); background: #3bb85a; }
}
.toolbar-btn {
  border: none; background: none; padding: 4px 10px;
  color: var(--green-dark); cursor: pointer;
  font-size: 13px; font-weight: 500; opacity: .7;
}
.toolbar-btn:hover { opacity: 1; }

@media (min-width: 1200px) { .container:has(.reader-grid) { max-width: 1600px; } }
@media (max-width: 1150px) {
  .reader-grid[data-phase="practice"],
  .reader-grid[data-phase="analysis"] { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .reader-grid, .reader-grid[data-phase="practice"], .reader-grid[data-phase="analysis"] {
    grid-template-columns: 1fr;
  }
  .reader-grid[data-phase="practice"] .pane.right,
  .reader-grid[data-phase="analysis"] .pane.questions { display: block; }
  .reader-grid .pane { max-height: none; }
  .speech-controls { width: 100%; margin-left: 0; }
  .speech-controls select:first-of-type { min-width: 0; flex: 1; }
}

/* ---- 生词库 ---- */
.review-studio {
  display: grid; grid-template-columns: minmax(240px, .75fr) minmax(360px, 1.25fr);
  gap: 22px; margin-bottom: 26px; padding: 24px;
  border-radius: 18px; color: #f6f3e8;
  background:
    radial-gradient(circle at 82% 12%, rgba(123,196,127,.2), transparent 34%),
    linear-gradient(135deg, #17281f, #263c30);
  box-shadow: 0 14px 35px rgba(28,52,38,.18);
}
.review-intro { padding: 8px 4px; align-self: center; }
.review-intro .eyebrow { color: #9ccca3; font-size: var(--text-xs); font-weight: var(--w-bold); letter-spacing: .18em; }
.review-intro h2 { margin: 5px 0 7px; font-size: var(--text-2xl); font-weight: var(--w-bold); color: #fff; }
.review-intro p { max-width: 330px; margin: 0 0 16px; color: #c7d2ca; font-size: 13px; }
.review-intro > button {
  border: 1px solid #9dcc9f; border-radius: 999px; padding: 9px 18px;
  background: #a8d7a8; color: #183021; font-weight: 700; cursor: pointer;
}
.review-buttons { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.review-buttons > button {
  border: 1px solid #9dcc9f; border-radius: 999px; padding: 9px 18px;
  background: #a8d7a8; color: #183021; font-weight: 700; cursor: pointer;
}
.vocab-speech-controls {
  width: 100%; margin-left: 0; border-color: rgba(188,211,193,.35);
  background: rgba(255,255,255,.08); color: #c7d2ca;
}
.vocab-speech-controls select { color: #eef7ef; }
.vocab-speech-controls select option { color: #1d2b22; }
.vocab-speech-controls .speech-stop { background: rgba(255,255,255,.16) !important; color: #eaf7ed !important; }
.review-stats { display: flex; gap: 16px; margin-bottom: 17px; flex-wrap: wrap; }
.review-stats span { color: #afbbb2; font-size: 11px; }
.review-stats b { display: block; color: #fff; font-size: var(--text-lg); font-weight: var(--w-bold); }
.review-card {
  position: relative; min-height: 285px; padding: 24px; overflow: hidden;
  border: 1px solid rgba(255,255,255,.5); border-radius: 14px;
  background: #f8f5e9; color: #1d2b22; box-shadow: 0 8px 24px rgba(0,0,0,.17);
  transition: transform .25s ease, box-shadow .25s ease;
}
.review-card::after {
  content: ""; position: absolute; right: -35px; bottom: -55px; width: 150px; height: 150px;
  border: 24px solid rgba(74,157,91,.10); border-radius: 50%; pointer-events: none;
}
.review-card.rolling { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(0,0,0,.24); }
.review-progress { color: #7a837c; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.review-word-line { display: flex; align-items: center; gap: 12px; margin-top: 27px; }
.review-word { font-size: var(--text-2xl); font-weight: var(--w-bold); line-height: 1.15; }
.review-card.rolling .review-word { filter: blur(1.5px); opacity: .72; }
.speak-review-word {
  width: 42px; height: 42px; flex: 0 0 auto; border: 0; border-radius: 50%;
  background: #243b2e; color: #fff; cursor: pointer; box-shadow: 0 6px 14px rgba(36,59,46,.18);
}
.speak-review-word:hover, .speak-review-word.speaking { background: #4a9d5b; }
.speak-review-word:disabled { opacity: .35; cursor: default; box-shadow: none; }
.review-pos { min-height: 22px; color: #758478; font-style: italic; }
.review-answer { margin: 15px 0; padding-top: 13px; border-top: 1px solid #d9ded7; }
.review-answer strong { color: #2d6940; font-size: 18px; }
.review-answer p { margin: 7px 0 0; color: #5f6962; font-size: 12px; }
.review-card .reveal {
  position: absolute; left: 24px; bottom: 23px; z-index: 1; border: 0; border-radius: 7px;
  padding: 8px 15px; background: #243b2e; color: #fff; cursor: pointer;
}
.review-actions { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.review-actions button { border: 1px solid #cad3cb; border-radius: 8px; padding: 8px 5px; background: #fff; cursor: pointer; }
.review-actions button:first-child { color: #a8463b; }
.review-actions button:last-child { color: #397747; }
.review-actions small { display: block; margin-top: 2px; color: #8a938c; font-size: 9px; }
.review-actions button.suggested { border-color: #4a9d5b; box-shadow: 0 0 0 2px rgba(74,157,91,.25); }
.review-actions button.suggested::after { content: " ·建议"; font-size: 9px; color: #4a9d5b; }

/* 复习方式切换(拼写 / 认词)——位于深色 intro 上 */
.review-mode { display: inline-flex; margin-bottom: 14px; border: 1px solid rgba(157,204,159,.45);
  border-radius: 999px; overflow: hidden; background: rgba(255,255,255,.06); }
.review-mode button { border: 0; background: transparent; color: #c7d2ca; padding: 7px 16px;
  cursor: pointer; font-size: 13px; font-weight: 600; }
.review-mode button.active { background: #a8d7a8; color: #183021; }

/* 拼写(主动回忆)面板 —— 位于浅色复习卡内 */
.review-cloze { margin: 24px 0 4px; }
.cloze-def { font-size: var(--text-xl); font-weight: var(--w-bold); color: var(--text); line-height: var(--lh-tight); margin-bottom: 6px; }
.cloze-sentence { color: #5f6962; font-size: 14px; margin-bottom: 15px; line-height: 1.75; }
.cloze-blank { display: inline-block; min-width: 72px; border-bottom: 2px solid #4a9d5b; margin: 0 4px; }
.cloze-input-row { display: flex; gap: 10px; flex-wrap: wrap; }
.cloze-input-row input { flex: 1; min-width: 180px; padding: 11px 14px; border: 1.5px solid #cdd8cf;
  border-radius: 10px; font-size: 17px; letter-spacing: .02em; background: #fff; }
.cloze-input-row input:focus { outline: none; border-color: #4a9d5b; box-shadow: 0 0 0 3px rgba(74,157,91,.15); }
.cloze-input-row input:disabled { background: #f1f4f1; color: #6a7a6e; }
.cloze-input-row button { border: 0; border-radius: 10px; padding: 11px 22px; background: #243b2e;
  color: #fff; font-weight: 700; cursor: pointer; font-size: 15px; }
.cloze-input-row button:hover:not(:disabled) { background: #2f4d3a; }
.cloze-input-row button:disabled { background: #c3ccc5; cursor: default; }
.cloze-feedback { margin-top: 12px; font-size: 14px; font-weight: 600; }
.cloze-feedback.ok { color: #1f7a3a; }
.cloze-feedback.near { color: #b45309; }
.cloze-feedback.wrong { color: #b23c34; }
.vocab-tools { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.vocab-tools input[type=text] { padding: 6px 10px; border: 1px solid #ccc; border-radius: 6px; }
.vocab-tools button, .vocab-tools label.filebtn {
  background: var(--green); color: #fff; border: none; border-radius: 6px;
  padding: 6px 12px; cursor: pointer; font-size: 14px;
}
.vocab-count { color: var(--muted); margin-left: auto; }
table.vocab { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 8px; overflow: hidden; }
table.vocab th, table.vocab td { padding: 8px 10px; border-bottom: 1px solid #eee; text-align: left; font-size: 14px; vertical-align: top; }
table.vocab th { background: #eef7ef; }
table.vocab .src-link { color: var(--green-dark); cursor: pointer; text-decoration: underline; }
table.vocab .del { color: #c0392b; cursor: pointer; }
.speak-vocab-word {
  margin: 0 7px 0 0; border: 0; border-radius: 50%; width: 24px; height: 24px;
  background: #e5f3e7; color: var(--green-dark); cursor: pointer; font-size: 12px; vertical-align: middle;
}
.speak-vocab-word:hover, .speak-vocab-word.speaking { background: var(--green); color: #fff; }
.speak-vocab-word:disabled { opacity: .35; cursor: default; }
@media (max-width: 760px) {
  .review-studio { grid-template-columns: 1fr; padding: 18px; }
  .review-actions { grid-template-columns: 1fr; }
}

/* ==== 记忆法卡片(aids.js 渲染,复习/列表/词库三处共用) ==== */
/* 词根色块:前缀红 · 词根蓝(粗边) · 后缀琥珀 · 连接件灰。取自 word-root-workshop 配色 */
.mchips { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mchip {
  display: inline-flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 4px 11px; border-radius: 9px; font-weight: 700; font-size: 15px; line-height: 1.15;
}
.mchip small { font-size: 10px; font-weight: 500; opacity: .85; }
.mchip.pre { background: rgba(239,68,68,.10); color: #EF4444; border: 1px solid rgba(239,68,68,.28); }
.mchip.rt  { background: rgba(59,130,246,.10); color: #3B82F6; border: 2px solid rgba(59,130,246,.32); }
.mchip.suf { background: rgba(245,158,11,.10); color: #F59E0B; border: 1px solid rgba(245,158,11,.28); }
.mchip.con { background: #f0f2f0; color: #7a837c; border: 1px solid #dfe4df; }
.mplus { color: #b6bdb7; font-weight: 400; }

.aids { display: flex; flex-direction: column; gap: 9px; }
.aid-block { font-size: 13.5px; line-height: 1.55; color: #37453b; }
.aid-label {
  display: inline-block; margin-right: 8px; padding: 1px 8px; border-radius: 999px;
  background: #eaf3ec; color: #3d7a4e; font-size: 11px; font-weight: 700;
  letter-spacing: .03em; vertical-align: 2px;
}
.aid-deriv { color: #4a6b52; font-style: normal; background: #f4f9f5; border-radius: 7px; padding: 7px 11px; }
.fam-root { color: #2563EB; margin-right: 4px; font-weight: 700; }
.aid-family { padding: 9px 11px 10px; border: 1px solid #dce9df; border-radius: 10px; background: linear-gradient(135deg, #f8fcf8 0%, #f2f8f4 100%); }
.family-head { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.family-head .aid-label { margin-right: 0; }
.family-open-link { margin-left: auto; color: #0f7a5a; font-size: 11.5px; font-weight: 800; text-decoration: none; white-space: nowrap; }
.family-open-link:hover { color: #075b43; text-decoration: underline; }
.family-count { color: #6d8173; font-size: 11.5px; font-weight: 600; }
.family-note { margin: 3px 0 1px; color: #7b8a80; font-size: 11.5px; }
.fam-pills { display: inline-flex; gap: 7px; flex-wrap: wrap; margin-top: 5px; }
.fam-pill {
  display: inline-flex; align-items: baseline; gap: 5px;
  background: rgba(59,130,246,.07); border: 1px solid rgba(59,130,246,.20);
  color: #2563EB; border-radius: 999px; padding: 3px 10px; font-size: 12.5px; font-weight: 600;
  text-decoration: none; transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.fam-pill[href] { cursor: pointer; }
.fam-pill[href]::after { content: "↗"; margin-left: 1px; color: currentColor; font-size: 10px; opacity: .65; }
.fam-pill:hover { transform: translateY(-1px); box-shadow: 0 3px 9px rgba(37,99,235,.16); background: rgba(59,130,246,.14); }
.fam-pill.current { background: #2563EB; border-color: #2563EB; color: #fff; box-shadow: 0 2px 6px rgba(37,99,235,.2); }
.fam-pill.current i { color: rgba(255,255,255,.8); }
.fam-pill i { color: #7a837c; font-style: normal; font-weight: 400; font-size: 11.5px; }
/* 高频搭配 chips(青绿,区别于蓝色词族) */
.colloc-pills { display: inline-flex; gap: 7px; flex-wrap: wrap; margin-top: 5px; }
.colloc-pill {
  display: inline-flex; align-items: baseline; gap: 5px;
  background: rgba(16,185,129,.08); border: 1px solid rgba(16,185,129,.22);
  color: #0f7a5a; border-radius: 999px; padding: 3px 10px; font-size: 12.5px; font-weight: 600;
}
.colloc-pill i { color: #6a8578; font-style: normal; font-weight: 400; font-size: 11.5px; }
.aid-mnemo { color: #6a4a1e; background: rgba(245,158,11,.07); border-radius: 7px; padding: 7px 11px; }
.form-list { display: inline-flex; gap: 12px; flex-wrap: wrap; margin-top: 3px; }
.form-item { font-size: 12.5px; color: #56605a; }
.form-item b { color: #2d3a31; }

/* 复习卡里的"词根提示区"(B 交互:显示释义前先给词根让你推词义) */
.review-hint { margin: 14px 0 4px; }
.review-hint .hint-tip { display: block; margin-top: 6px; color: #8a938c; font-size: 11px; font-style: italic; }
.review-answer .aids { margin-top: 12px; }

/* 列表行内的展开记忆法 */
.vocab-aids-row td { background: #fbfdfb; padding: 12px 14px 15px; }
.aids-expand-btn {
  border: 0; background: #eef7ef; color: var(--green-dark); border-radius: 6px;
  padding: 3px 9px; cursor: pointer; font-size: 12px; white-space: nowrap;
}
.aids-expand-btn:hover { background: #dcefdf; }
.aids-expand-btn.empty { background: #f3f3f3; color: #9aa39c; }

/* ==== 词库页 library.html ==== */
.lib-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.lib-head h2 { margin: 0; font-size: var(--text-xl); font-weight: var(--w-bold); color: var(--text); }
.lib-progress { color: var(--muted); font-size: 13px; }
.lib-progress b { color: var(--green-dark); }
.lib-tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.lib-tab {
  border: 1px solid #cfe0d2; background: #fff; color: #3d7a4e; border-radius: 999px;
  padding: 6px 15px; cursor: pointer; font-size: 13px; font-weight: 600;
}
.lib-tab.active { background: var(--green); color: #fff; border-color: var(--green); }
.lib-search { padding: 6px 11px; border: 1px solid #ccc; border-radius: 6px; margin-bottom: 14px; width: 260px; max-width: 100%; }

/* CEFR 难度筛选 chips */
.lib-cefr-filter { display: flex; gap: 7px; flex-wrap: wrap; margin: -2px 0 16px; }
.lib-cefr-filter:empty { display: none; }
.lib-cefr-chip {
  border: 1px solid #dce6de; background: #fff; color: #3d5a45; border-radius: 999px;
  padding: 4px 12px; cursor: pointer; font-size: 12.5px; display: inline-flex; align-items: center; gap: 5px;
}
.lib-cefr-chip span { color: #9aa39c; font-size: 11px; }
.lib-cefr-chip:hover { border-color: #4a9d5b; }
.lib-cefr-chip.active { background: #eef2ff; border-color: #4560c0; color: #4560c0; }
.lib-cefr-chip.active span { color: #7f92d8; }

.lib-word-card {
  background: var(--card); border: 1px solid #e4ece5; border-radius: 12px;
  padding: 15px 18px; margin-bottom: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.lib-word-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.lib-word { font-size: var(--text-lg); font-weight: var(--w-bold); color: var(--text); }
.lib-phon { color: #9aa39c; font-size: 13px; }
.lib-pos { color: #758478; font-style: italic; font-size: 13px; }
.lib-cefr { margin-left: auto; background: #eef2ff; color: #4560c0; border-radius: 999px; padding: 1px 9px; font-size: 11px; font-weight: 700; }
.lib-def { color: #3a463e; font-size: 15px; margin: 5px 0 10px; }
.lib-add-btn {
  border: 1px solid #9dcc9f; background: #a8d7a8; color: #183021; border-radius: 999px;
  padding: 5px 14px; cursor: pointer; font-size: 12.5px; font-weight: 700;
}
.lib-add-btn.added { background: #e8f3e9; color: #4a9d5b; border-color: #cfe0d2; cursor: default; }
.lib-speak {
  border: 0; border-radius: 50%; width: 26px; height: 26px; background: #e5f3e7;
  color: var(--green-dark); cursor: pointer; font-size: 12px;
}
.lib-speak:hover, .lib-speak.speaking { background: var(--green); color: #fff; }

/* ==== 词根词族详情页 family.html ==== */
.family-page-body { background: #f4f7f3; }
.family-shell { width: min(1080px, calc(100% - 40px)); margin: 0 auto; padding: 30px 0 64px; }
.family-back { display: inline-flex; align-items: center; color: #4a7660; text-decoration: none; font-size: 13px; margin-bottom: 16px; }
.family-back:hover { color: #0f7a5a; }
.family-hero { position: relative; overflow: hidden; padding: 30px 34px 28px; border-radius: 20px; color: #fff; background: linear-gradient(120deg, #123f31 0%, #17664c 58%, #2a7b5b 100%); box-shadow: 0 14px 30px rgba(21,72,51,.18); }
.family-hero::after { content: ""; position: absolute; width: 240px; height: 240px; right: -60px; top: -90px; border: 1px solid rgba(255,255,255,.18); border-radius: 50%; box-shadow: 0 0 0 28px rgba(255,255,255,.04), 0 0 0 58px rgba(255,255,255,.03); }
.family-kicker { position: relative; z-index: 1; color: #b4e7ca; font-size: 11px; letter-spacing: .18em; font-weight: 700; }
.family-hero h2 { position: relative; z-index: 1; margin: 7px 0 5px; color: #fff; font-family: var(--font-serif); font-size: clamp(25px, 4vw, 38px); letter-spacing: -.02em; }
.family-hero p { position: relative; z-index: 1; max-width: 720px; margin: 0; color: rgba(255,255,255,.78); line-height: 1.7; font-size: 14px; }
.family-root-line { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.family-root-line span { padding: 5px 12px; border: 1px solid rgba(255,255,255,.3); border-radius: 999px; color: #e9fff1; font-family: var(--font-mono); font-size: 13px; }
.family-root-line i { color: #a5d9bb; font-style: normal; }
.family-explainer { margin: 18px 0 14px; padding: 17px 20px; border: 1px solid #dce9df; border-radius: 14px; background: #fffdf7; box-shadow: 0 3px 12px rgba(29,66,43,.05); }
.family-explainer-title { margin-bottom: 4px; color: #835d25; font-size: 14px; font-weight: 800; }
.family-explainer p { margin: 0; color: #69583e; font-size: 13px; line-height: 1.7; }
.family-toolbar { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin: 22px 2px 10px; color: #758478; font-size: 12px; }
.family-toolbar span:first-child { color: #1e5b42; font-weight: 800; }
.family-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.family-word-card { min-width: 0; padding: 20px 21px 19px; border: 1px solid #e0e9e1; border-radius: 15px; background: #fff; box-shadow: 0 3px 12px rgba(27,62,42,.05); transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease; }
.family-word-card:hover { transform: translateY(-2px); border-color: #b6d6c0; box-shadow: 0 8px 18px rgba(27,62,42,.1); }
.family-word-card.active { border: 2px solid #1b8a63; padding: 19px 20px 18px; box-shadow: 0 8px 22px rgba(27,118,82,.13); }
.family-word-top { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.family-word { color: #173f2f; font-family: var(--font-serif); font-size: 25px; font-weight: 800; text-decoration: none; }
.family-word:hover { color: #0f8a60; }
.family-current { padding: 2px 8px; border-radius: 999px; background: #dff5e7; color: #187449; font-size: 11px; font-weight: 800; }
.family-pos { color: #87948b; font-size: 12px; font-style: italic; }
.family-def { margin-top: 5px; color: #35493d; font-size: 15px; line-height: 1.55; }
.family-morphemes { margin-top: 13px; }
.family-morphemes .mchip { font-size: 14px; padding: 4px 10px; }
.family-derivation { display: flex; flex-direction: column; gap: 3px; margin-top: 14px; padding: 10px 12px; border-radius: 9px; background: #f4f9f5; color: #4a6b52; font-size: 13px; line-height: 1.65; }
.family-derivation b { color: #2e6f47; font-size: 11px; letter-spacing: .05em; }
.family-empty { padding: 55px 20px; text-align: center; border: 1px dashed #cddbd0; border-radius: 16px; background: #fff; }
.family-empty h2 { margin: 0 0 8px; color: #294a38; font-size: 22px; }
.family-empty p { color: #7a887e; font-size: 14px; }
.family-empty a { color: #0f7a5a; font-weight: 700; }
@media (max-width: 720px) {
  .family-shell { width: min(100% - 24px, 620px); padding-top: 20px; }
  .family-hero { padding: 24px 22px; border-radius: 16px; }
  .family-grid { grid-template-columns: 1fr; }
  .family-toolbar { align-items: flex-start; flex-direction: column; gap: 4px; }
}

/* 按词根成组 */
.lib-root-group { margin-bottom: 26px; }
.lib-root-title {
  display: flex; align-items: baseline; gap: 10px; margin: 0 0 10px;
  font-size: var(--text-md); font-weight: var(--w-bold); color: var(--text);
}
.lib-root-title .rg-root {
  background: rgba(59,130,246,.12); color: #2563EB; border-radius: 8px;
  padding: 2px 12px; font-family: inherit;
}
.lib-root-title .rg-gloss { color: #758478; font-size: 14px; font-weight: 400; }
.lib-root-title .rg-count { color: #9aa39c; font-size: 12px; font-weight: 400; margin-left: auto; }

.lib-empty { color: var(--muted); padding: 30px; text-align: center; }

/* 词库翻页器 + List 头 */
.lib-pager { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 2px 0 16px; }
.lib-pager.bottom { margin: 20px 0 4px; justify-content: center; }
.lib-pager:empty { display: none; }
.lib-pager button {
  border: 1px solid #cfe0d2; background: #fff; color: #2d6940; border-radius: 8px;
  padding: 6px 14px; cursor: pointer; font-size: 13px; font-weight: 600;
}
.lib-pager button:not(:disabled):hover { background: #eef8ef; border-color: #4a9d5b; }
.lib-pager button:disabled { color: #b7c1b9; border-color: #e6ebe6; background: #f7f9f7; cursor: default; }
.lib-pager select {
  border: 1px solid #cfe0d2; border-radius: 8px; padding: 6px 10px; font-size: 13px;
  color: #20352a; background: #fff; cursor: pointer; max-width: 60vw;
}
.lib-pager .lib-page-info { color: var(--muted); font-size: 12px; }
.lib-list-banner {
  display: flex; align-items: baseline; gap: 10px; margin: 2px 0 14px;
  font-size: var(--text-md); font-weight: var(--w-bold); color: var(--text);
}
.lib-list-banner .llb-range { color: #9aa39c; font-size: 12px; font-weight: 400; }

@media (max-width: 760px) {
  .lib-search { width: 100%; }
  .lib-pager select { max-width: 44vw; }
}

/* ==== 每日单词 daily.html ==== */
/* 日历热力图 */
.cal-card {
  background: radial-gradient(circle at 85% 10%, rgba(123,196,127,.18), transparent 38%),
              linear-gradient(135deg, #17281f, #263c30);
  border-radius: 18px; padding: 22px 24px; color: #eef3ea; margin-bottom: 18px;
  box-shadow: 0 12px 30px rgba(28,52,38,.16);
}
.cal-top { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.cal-top h3 { margin: 0; font-size: var(--text-lg); font-weight: var(--w-bold); color: #fff; }
.cal-streak { color: #a8d7a8; font-size: 13px; }
.cal-streak b { font-size: 21px; color: #fff; }
.heat { display: grid; grid-template-columns: repeat(18, 1fr); gap: 5px; max-width: 560px; }
.heat .cell { aspect-ratio: 1; border-radius: 4px; background: rgba(255,255,255,.07); }
.heat .cell.l1 { background: #2f5137; }
.heat .cell.l2 { background: #3f7a4c; }
.heat .cell.l3 { background: #5bbf6a; }
.heat .cell.l4 { background: #8ee89b; }
.heat .cell.today { outline: 2px solid #ffd873; outline-offset: 1px; }
.cal-legend { display: flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 11px; color: #b6c7ba; }
.cal-legend .cell { width: 12px; height: 12px; border-radius: 3px; background: rgba(255,255,255,.07); display: inline-block; }
.cal-legend .cell.l1 { background: #2f5137; } .cal-legend .cell.l2 { background: #3f7a4c; }
.cal-legend .cell.l3 { background: #5bbf6a; } .cal-legend .cell.l4 { background: #8ee89b; }
.cal-legend .today-legend { outline: 2px solid #ffd873; outline-offset: 1px; background: #8ee89b; }

/* 今日任务卡 */
.today-card { background: #fff; border: 1px solid #e0ebe2; border-radius: 16px; padding: 22px 24px; box-shadow: 0 4px 16px rgba(0,0,0,.05); }
.today-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.today-head h3 { margin: 0; font-size: var(--text-lg); font-weight: var(--w-bold); color: var(--text); }
.today-date { color: #9aa39c; font-size: 13px; }
.today-sub { color: #6a7a6e; font-size: 14px; margin: 0 0 18px; }
.today-card .split { display: flex; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.stat-box { flex: 1; min-width: 130px; border: 1px solid #e6ece7; border-radius: 12px; padding: 14px 16px; background: #fbfdfb; }
.stat-box .n { font-size: var(--text-2xl); font-weight: var(--w-bold); color: #2d6940; line-height: 1; }
.stat-box .lbl { color: #6a7a6e; font-size: 12.5px; margin-top: 5px; }
.stat-box.new .n { color: #c07a2a; }
.prog-wrap { margin: 4px 0 18px; }
.prog-bar { height: 10px; border-radius: 6px; background: #e8efe9; overflow: hidden; }
.prog-fill { height: 100%; background: linear-gradient(90deg, #7bc47f, #4a9d5b); transition: width .4s cubic-bezier(.4,0,.2,1); }
.prog-txt { font-size: 12px; color: #6a7a6e; margin-top: 6px; }
.today-buttons { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.start-btn { background: #243b2e; color: #fff; border: none; border-radius: 10px; padding: 13px 26px; font-size: 16px; font-weight: 700; cursor: pointer; }
.start-btn:hover { background: #2f4d3a; }
.start-btn:disabled { background: #c3ccc5; cursor: default; }
.pace-btn { background: #fff; color: #4a9d5b; border: 1px solid #9dcc9f; border-radius: 10px; padding: 12px 16px; cursor: pointer; font-size: 14px; }
.pace-btn:hover { background: #eef8ef; }
.mini-note { color: #9aa39c; font-size: 12px; margin-top: 12px; }

/* 过词卡:复用 .review-card,补充徽章与容器 */
.study-wrap { max-width: 760px; }
.study-top { margin-bottom: 8px; }
.study-badge { display: inline-block; border-radius: 999px; padding: 3px 12px; font-size: 12px; font-weight: 700; }
.study-badge.new { background: rgba(192,122,42,.14); color: #b45309; }
.study-badge.review { background: rgba(59,130,246,.12); color: #2563EB; }
.study-wrap .review-card { min-height: 240px; }
.study-wrap .review-card .reveal { position: static; margin-top: 14px; }
.study-controls { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.study-quit { background: #fff; color: #8a938c; border: 1px solid #d9ded7; border-radius: 8px; padding: 8px 14px; cursor: pointer; font-size: 13px; }
.study-quit:hover { background: #f4f6f4; }
.study-remove { margin-left: auto; background: transparent; color: #a16b61; border: 1px solid transparent; border-radius: 8px; padding: 8px 10px; cursor: pointer; font-size: 13px; }
.study-remove:hover { color: #9b3f35; background: #fff5f3; border-color: #f0d7d3; }
.study-remove-confirm { margin-top: 10px; padding: 13px 14px; border: 1px solid #efd5d0; border-radius: 11px; background: #fff8f6; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.study-remove-confirm strong { color: #69352f; font-size: 14px; }
.study-remove-confirm p { margin: 3px 0 0; color: #8b6b66; font-size: 12px; }
.study-remove-actions { display: flex; gap: 8px; flex: none; }
.study-remove-actions button { border: 1px solid #dccbc8; background: #fff; color: #735b57; border-radius: 7px; padding: 7px 11px; cursor: pointer; white-space: nowrap; }
.study-remove-actions .danger { border-color: #a8493f; background: #a8493f; color: #fff; }
.study-remove-actions .danger:hover { background: #903b33; }

/* 完成卡 */
.done-card { background: #fff; border: 1px solid #cfe8d4; border-radius: 16px; padding: 34px 24px; text-align: center; box-shadow: 0 4px 16px rgba(0,0,0,.05); }
.done-card .done-emoji { font-size: 46px; }
.done-card h3 { margin: 10px 0 6px; font-size: var(--text-lg); font-weight: var(--w-bold); color: var(--text); }
.done-card p { color: #6a7a6e; margin: 0 0 18px; }

/* 节奏设置弹层 */
.pace-modal { position: fixed; inset: 0; background: rgba(20,32,25,.45); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.pace-panel { background: #fff; border-radius: 16px; padding: 24px; max-width: 440px; width: 100%; max-height: calc(100vh - 40px); overflow-y: auto; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.pace-panel h3 { margin: 0 0 6px; font-size: var(--text-lg); font-weight: var(--w-bold); color: var(--text); }
.pace-hint { color: #6a7a6e; font-size: 13px; margin: 0 0 16px; }
.pace-list { display: flex; flex-direction: column; gap: 9px; margin-bottom: 14px; }
.pace-opt { text-align: left; border: 1px solid #e0ebe2; background: #fff; border-radius: 10px; padding: 12px 16px; cursor: pointer; font-size: 14px; color: #37453b; }
.pace-opt:hover { background: #f4f9f5; }
.pace-opt.active { border-color: #4a9d5b; box-shadow: 0 0 0 2px rgba(74,157,91,.3); background: #f0f8f1; }
.pace-opt b { color: #2d6940; }
.pace-custom { margin-bottom: 18px; }
.pace-custom label { font-size: 14px; color: #37453b; }
.pace-custom input { width: 72px; padding: 6px 8px; border: 1px solid #cbd4cd; border-radius: 6px; text-align: center; font-size: 14px; margin-left: 6px; }
.excluded-manager { border-top: 1px solid #e7ece8; padding-top: 16px; margin: 2px 0 18px; }
.excluded-manager-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #37453b; font-size: 14px; }
.excluded-manager-head span { border-radius: 999px; padding: 2px 8px; background: #f0f3f1; color: #768179; font-size: 12px; }
.excluded-manager > p { margin: 5px 0 10px; color: #89928b; font-size: 12px; }
.excluded-list { display: flex; flex-direction: column; gap: 7px; max-height: 168px; overflow-y: auto; }
.excluded-empty { padding: 10px 12px; border-radius: 8px; background: #f7f9f7; color: #9aa39c; font-size: 12px; text-align: center; }
.excluded-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 10px; border: 1px solid #e5e9e6; border-radius: 9px; }
.excluded-word { min-width: 0; color: #344139; font-size: 14px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.excluded-kind { margin-left: 6px; color: #939c95; font-size: 11px; font-weight: 400; }
.excluded-restore { flex: none; border: 1px solid #b8d5be; background: #fff; color: #397649; border-radius: 7px; padding: 5px 9px; cursor: pointer; font-size: 12px; }
.excluded-restore:hover { background: #eef8ef; }
.excluded-feedback { min-height: 17px; margin-top: 5px; color: #397649; font-size: 12px; }
.pace-actions { display: flex; justify-content: flex-end; gap: 10px; }
.pace-cancel { background: #fff; color: #6a7a6e; border: 1px solid #d9ded7; border-radius: 8px; padding: 9px 16px; cursor: pointer; }
.pace-save { background: #243b2e; color: #fff; border: none; border-radius: 8px; padding: 9px 18px; cursor: pointer; font-weight: 600; }
@media (max-width: 760px) {
  .heat { grid-template-columns: repeat(14, 1fr); }
  .today-card .split { flex-direction: column; }
  .study-remove-confirm { align-items: stretch; flex-direction: column; }
  .study-remove-actions { justify-content: flex-end; }
}

/* ============ 单词测试(完形填空) ============ */
.quiz-container { max-width: 720px; }

/* --- 首页 --- */
.quiz-setup { background: var(--card); border-radius: 16px; padding: 32px 28px; box-shadow: 0 2px 14px rgba(0,0,0,.05); text-align: center; }
.quiz-setup .eyebrow { color: #9ccca3; font-size: var(--text-xs); font-weight: var(--w-bold); letter-spacing: .18em; }
.quiz-setup h2 { margin: 6px 0 10px; font-size: var(--text-2xl); font-weight: var(--w-bold); color: var(--text); }
.quiz-intro { max-width: 440px; margin: 0 auto 20px; color: #6a7a6e; font-size: 14px; }
.quiz-stat { color: #4a9d5b; font-size: 14px; margin-bottom: 22px; }
.quiz-stat b { color: #2d6940; }
.quiz-start-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.quiz-primary { background: #243b2e; color: #fff; border: none; border-radius: 10px; padding: 13px 26px; font-size: 15px; font-weight: 600; cursor: pointer; }
.quiz-primary:hover { background: #2f4d3b; }
.quiz-secondary { background: #fff; color: #2d6940; border: 1.5px solid #cbd9cd; border-radius: 10px; padding: 13px 22px; font-size: 15px; font-weight: 600; cursor: pointer; }
.quiz-secondary:hover:not(:disabled) { background: #f2f9f3; border-color: #4a9d5b; }
.quiz-secondary:disabled { color: #b3bdb5; border-color: #e3e8e3; cursor: not-allowed; }
.quiz-notice { margin-top: 18px; color: #a06a3b; background: #fdf6ee; border-radius: 10px; padding: 12px 16px; font-size: 13px; }

/* --- 答题 --- */
.quiz-play { background: var(--card); border-radius: 16px; padding: 26px 26px 30px; box-shadow: 0 2px 14px rgba(0,0,0,.05); }
.quiz-topline { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.quiz-bar { height: 6px; background: #e7ece7; border-radius: 99px; margin-bottom: 26px; overflow: hidden; }
.quiz-bar-fill { height: 100%; width: 0; background: var(--green-dark); border-radius: 99px; transition: width .25s ease; }
.quiz-stem { font-size: 19px; line-height: 1.9; color: #1f2d24; margin-bottom: 26px; }
.q-word { cursor: help; border-bottom: 1px dotted transparent; }
.q-word:hover { border-bottom-color: #9ccca3; background: #f0f8f1; }
.q-blank { display: inline-block; min-width: 92px; border-bottom: 2px solid var(--green-dark); margin: 0 3px; vertical-align: bottom; }
.quiz-options { display: flex; flex-direction: column; gap: 11px; }
.q-option { display: flex; align-items: center; gap: 13px; padding: 13px 18px; border: 1.5px solid #e2e8e3; border-radius: 11px; background: #fff; font-size: 16px; color: #2b3a30; cursor: pointer; text-align: left; transition: border-color .12s, background .12s; }
.q-option:hover:not(.locked) { border-color: var(--green); background: #f5faf6; }
.q-option b { color: var(--green-dark); min-width: 14px; }
.q-option.locked { cursor: default; }
.q-option.right { border-color: #52b168; background: #eefaf0; }
.q-option.right b, .q-option.right span { color: #1f7a3a; font-weight: 600; }
.q-option.wrong { border-color: #dd6a63; background: #fdf1f0; }
.q-option.wrong b, .q-option.wrong span { color: #b23c34; }
.q-option.dim { color: #a7b1a9; }
.q-option.dim b { color: #b8c1ba; }

/* --- 解析 --- */
.quiz-explain { margin-top: 22px; padding-top: 20px; border-top: 1px solid #e7ece7; }
.q-sentence { position: relative; background: #f6f9f6; border-radius: 11px; padding: 15px 17px; margin-bottom: 15px; }
.q-en { font-size: 16px; color: #1f2d24; margin-bottom: 7px; }
.q-fill { color: #1f7a3a; }
.q-zh { font-size: 14px; color: #566a5c; }
.q-speak { margin-top: 10px; }
.q-speak-btn { background: #eef4ef; border: 1px solid #d3e0d5; color: #2d6940; border-radius: 7px; padding: 5px 12px; font-size: 12px; cursor: pointer; }
.q-speak-btn:disabled { opacity: .5; cursor: not-allowed; }
/* 中英互选:题干方向徽标 + 提示词 + 答案行 */
.q-dir { display: inline-block; font: 700 12px Georgia, serif; letter-spacing: .06em; color: var(--green-dark); background: #eef4ef; border: 1px solid #d3e0d5; border-radius: 999px; padding: 3px 12px; margin-bottom: 14px; }
.q-prompt { font-size: 27px; font-weight: 700; line-height: 1.4; color: #1f2d24; }
.q-answer-line { font-size: 18px; color: #1f2d24; margin-bottom: 12px; }
.q-answer-line .q-fill { color: #1f7a3a; font-weight: 700; }
.q-ph { color: #7d8c82; font-weight: 400; font-size: 15px; }
.q-pos { color: #9bb3a1; font-size: 14px; margin: 0 4px; }
.q-answer-line .q-def { font-weight: 600; }
.q-why { margin-bottom: 15px; }
.q-why-label { font-size: var(--text-sm); font-weight: var(--w-bold); letter-spacing: .04em; color: var(--green-dark); margin-bottom: 5px; }
.q-why-text { font-size: 14px; color: #37453b; line-height: 1.7; }
.q-defs { border-top: 1px solid #e7ece7; padding-top: 13px; font-size: 13px; color: #4a5850; line-height: 2; }
.q-defs b { color: #2b3a30; margin-right: 4px; }
.q-def-ans b { color: #1f7a3a; }
.quiz-next { width: 100%; margin-top: 20px; background: #243b2e; color: #fff; border: none; border-radius: 10px; padding: 13px; font-size: 15px; font-weight: 600; cursor: pointer; }
.quiz-next:hover { background: #2f4d3b; }

/* --- 悬停查词气泡 --- */
.q-tip { position: absolute; z-index: 50; max-width: 240px; background: #22352a; color: #eaf5ec; border-radius: 9px; padding: 9px 12px; box-shadow: 0 8px 24px rgba(0,0,0,.22); font-size: 13px; pointer-events: none; }
.q-tip-w { font-weight: 700; }
.q-tip-ph { color: #9fc7a8; font-size: 12px; margin-left: 6px; }
.q-tip-def { margin-top: 3px; color: #d3e6d7; line-height: 1.5; }

/* --- 结果 --- */
.quiz-result { background: var(--card); border-radius: 16px; padding: 32px 28px; box-shadow: 0 2px 14px rgba(0,0,0,.05); text-align: center; }
.quiz-score-big { font-size: 52px; font-weight: var(--w-bold); color: #2d6940; }
.quiz-score-big span { font-size: 26px; color: #9bb3a1; }
.quiz-pct { color: #6a7a6e; font-size: 15px; margin-top: 4px; }
.quiz-missed-title { margin: 26px 0 10px; font-size: var(--text-base); font-weight: var(--w-bold); color: var(--text); }
.quiz-missed { list-style: none; padding: 0; margin: 0 auto 24px; max-width: 420px; text-align: left; }
.quiz-missed li { display: flex; justify-content: space-between; gap: 14px; padding: 9px 14px; border-bottom: 1px solid #eef2ee; font-size: 14px; }
.quiz-missed li b { color: #b23c34; }
.quiz-missed li span { color: #566a5c; text-align: right; }
.quiz-missed li.q-none { justify-content: center; color: #4a9d5b; border: none; }
.quiz-result-btns { display: flex; gap: 11px; justify-content: center; flex-wrap: wrap; }
.quiz-ghost { background: transparent; color: #6a7a6e; border: 1px solid #d9ded7; border-radius: 10px; padding: 13px 22px; font-size: 15px; cursor: pointer; }
.quiz-ghost:hover { background: #f4f7f4; }

@media (max-width: 760px) {
  .quiz-stem { font-size: 17px; }
  .quiz-setup, .quiz-result { padding: 24px 18px; }
}
