/* =========================================================
 * css/pages.css —— 各页面专属样式
 * ========================================================= */

/* ---------- 通用网格 ---------- */
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
@media (max-width: 1080px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ---------- 主控台 ---------- */
.dash-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 18px; }
@media (max-width: 1000px) { .dash-grid { grid-template-columns: 1fr; } }

.countdown-card {
  display: flex; align-items: center; gap: 22px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); box-shadow: var(--sh-2); padding: 24px 26px;
}
.cd-num { font-size: 52px; font-weight: 800; letter-spacing: -2px; line-height: 1; }
.cd-num small { font-size: 16px; font-weight: 700; color: var(--muted); margin-left: 6px; letter-spacing: 0; }
.cd-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.cd-sub { font-size: 12.5px; color: var(--muted); }

.goal-row { display: flex; align-items: center; gap: 14px; margin-top: 16px; }
.goal-ring { width: 78px; height: 78px; position: relative; flex: none; }
.goal-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.goal-ring .lab {
  position: absolute; inset: 0; display: grid; place-content: center; text-align: center;
  font-size: 15px; font-weight: 800; line-height: 1;
}
.goal-ring .lab span { font-size: 9.5px; color: var(--muted); font-weight: 600; }

.streak-card {
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #fff; border: none; box-shadow: 0 14px 30px rgba(245, 158, 11, .32);
}
.streak-card .lbl { color: rgba(255, 255, 255, .88); }
.streak-num { font-size: 40px; font-weight: 800; letter-spacing: -1.5px; line-height: 1; }
.streak-days { display: flex; gap: 5px; margin-top: 12px; }
.streak-days i {
  width: 100%; height: 26px; border-radius: 7px;
  background: rgba(255, 255, 255, .22);
  display: grid; place-items: center; font-size: 9.5px; font-style: normal;
}
.streak-days i.on { background: #fff; color: #c2410c; font-weight: 800; }

.mini-stat { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px dashed var(--border); }
.mini-stat:last-child { border-bottom: none; }
.mini-stat .ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font-size: 14px; flex: none; }
.mini-stat .v { font-size: 17px; font-weight: 800; }
.mini-stat .l { font-size: 12px; color: var(--muted); }

.lesson-row {
  display: flex; align-items: center; gap: 13px;
  padding: 12px 14px; border-radius: 14px;
  transition: background .2s, transform .2s;
}
.lesson-row:hover { background: var(--surface-2); transform: translateX(3px); }
.lesson-row .no {
  width: 34px; height: 34px; flex: none; border-radius: 11px;
  display: grid; place-items: center; font-size: 13px; font-weight: 800; color: #fff;
}
.lesson-row .t { font-size: 14px; font-weight: 600; }
.lesson-row .s { font-size: 11.5px; color: var(--muted); }

/* ---------- 概念百科：词条卡 ---------- */
.filter-bar {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  margin-bottom: 20px; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--sh-1);
}
.filter-bar .sep { width: 1px; height: 22px; background: var(--border); margin: 0 4px; }

.term-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--sh-1);
  padding: 24px 26px; margin-bottom: 18px;
  scroll-margin-top: 92px;
  transition: box-shadow .25s, border-color .25s, transform .25s;
}
.term-card:hover { box-shadow: var(--sh-2); }
.term-card.focus { border-color: var(--brand-1); box-shadow: 0 0 0 3px rgba(79, 70, 229, .18); }
.term-card.mastered { border-left: 4px solid var(--vi); }

.term-head { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.term-head .titles { flex: 1; min-width: 220px; }
.term-zh { font-size: 24px; letter-spacing: -.6px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.term-vi { font-size: 16px; font-weight: 700; color: var(--vi); margin-top: 4px; }
.term-tags { display: flex; gap: 7px; margin-top: 9px; flex-wrap: wrap; }
.term-actions { display: flex; gap: 8px; align-items: center; }

.term-body { margin-top: 18px; display: grid; gap: 16px; }
.def-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 16px; }
@media (max-width: 900px) { .def-grid { grid-template-columns: 1fr; } }

.block-label {
  display: flex; align-items: center; gap: 7px;
  font-size: 11.5px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase;
  color: var(--muted); margin-bottom: 8px;
}
.block-label i { color: var(--brand-1); }
.block-label.green i { color: var(--vi); }
.block-label.warn i { color: var(--warn); }

.def-text { font-size: 14.5px; color: var(--text-2); }
.def-text.vi { color: var(--vi); font-weight: 500; }

.formula-box {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border); border-radius: var(--r);
  padding: 18px 16px; text-align: center; overflow-x: auto; overflow-y: hidden;
}
.formula-box .katex-display { margin: 0; }

.figure-box {
  border: 1px solid var(--border); border-radius: var(--r);
  background: var(--surface-2); padding: 14px;
  display: flex; flex-direction: column; align-items: center;
}
.figure-box .block-label { align-self: flex-start; }
.figure-box svg { width: 100%; max-width: 440px; height: auto; display: block; }
[data-theme="dark"] .figure-box svg text { fill: #cbd5e1; }
[data-theme="dark"] .figure-box svg { opacity: .95; }
.figure-cap { font-size: 12px; color: var(--muted); text-align: center; margin-top: 8px; }

.ex-box { border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.ex-box .head {
  background: var(--surface-2); padding: 9px 15px;
  font-size: 12.5px; font-weight: 800; color: var(--muted);
  display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--border);
}
.ex-box .body { padding: 15px 17px; }
.ex-zh { font-size: 14.5px; }
.ex-vi { font-size: 14px; color: var(--vi); font-weight: 500; margin-top: 9px; }

.trap-box {
  background: rgba(245, 158, 11, .09);
  border: 1px solid rgba(245, 158, 11, .32);
  border-left: 4px solid var(--warn);
  border-radius: var(--r); padding: 15px 17px;
}
.trap-box p { font-size: 13.8px; color: var(--text-2); }
.trap-box .vi { color: var(--vi); font-weight: 500; margin-top: 7px; }

.mnemonic {
  background: rgba(5, 150, 105, .08); border: 1px dashed rgba(5, 150, 105, .35);
  border-radius: var(--r-sm); padding: 11px 14px; font-size: 13.5px; color: var(--text-2);
}
.mnemonic b { color: var(--vi); }

.sym-list { display: flex; gap: 7px; flex-wrap: wrap; }
.sym-list span {
  font-family: var(--font-mono); font-size: 13px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 3px 9px;
}

/* ---------- 长句拆解器 ---------- */
.sentence-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--sh-1);
  padding: 26px 28px; margin-bottom: 20px; scroll-margin-top: 92px;
}
.sentence-text {
  font-size: 20px; line-height: 2.5; letter-spacing: .2px;
  padding: 18px 20px; border-radius: var(--r);
  background: var(--surface-2); border: 1px solid var(--border);
}
.chunk {
  border-radius: 8px; padding: 3px 7px; margin: 0 1px;
  cursor: pointer; position: relative;
  transition: background .2s, box-shadow .2s, transform .2s;
  border-bottom: 3px solid transparent;
}
.chunk:hover { transform: translateY(-2px); }
.chunk.signal { background: rgba(79, 70, 229, .13); border-bottom-color: var(--brand-1); }
.chunk.cond { background: rgba(14, 165, 233, .13); border-bottom-color: var(--info); }
.chunk.quantifier { background: rgba(245, 158, 11, .16); border-bottom-color: var(--warn); }
.chunk.goal { background: rgba(5, 150, 105, .14); border-bottom-color: var(--vi); }
.chunk.obj { background: rgba(124, 58, 237, .12); border-bottom-color: var(--brand-2); }
.chunk.link { background: var(--surface-2); border-bottom-color: var(--muted); }
.chunk.active { box-shadow: 0 0 0 3px rgba(79, 70, 229, .28); }

.chunk-legend { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.chunk-legend .lg { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.chunk-legend .dot { width: 11px; height: 11px; border-radius: 4px; }

.chunk-detail {
  margin-top: 16px; border: 1px solid var(--border); border-radius: var(--r);
  background: var(--surface-2); padding: 16px 18px; animation: pop .25s both;
}
.chunk-detail .cd-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.chunk-detail .cd-word { font-size: 17px; font-weight: 700; }
.chunk-detail .cd-vi { color: var(--vi); font-weight: 600; }
.chunk-detail p { font-size: 13.8px; color: var(--text-2); }

.pattern-box {
  background: rgba(79, 70, 229, .07); border: 1px solid rgba(79, 70, 229, .22);
  border-radius: var(--r); padding: 14px 17px; margin-top: 16px;
}
.pattern-box .p { font-size: 14px; font-weight: 600; color: var(--brand-1); }
.pattern-box .pv { font-size: 13.5px; color: var(--vi); margin-top: 5px; font-weight: 500; }

/* ---------- 3D 闪卡 ---------- */
.fc-layout { display: grid; grid-template-columns: 1fr 300px; gap: 22px; align-items: start; }
@media (max-width: 1080px) { .fc-layout { grid-template-columns: 1fr; } }

.fc-stage { display: flex; flex-direction: column; align-items: center; }
.flashcard {
  width: 100%; max-width: 660px; height: 410px;
  perspective: 1800px; cursor: pointer;
}
.fc-inner {
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d;
  transition: transform .75s cubic-bezier(.4, .2, .2, 1);
}
.flashcard.flipped .fc-inner { transform: rotateY(180deg); }
.fc-face {
  position: absolute; inset: 0;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: var(--r-xl);
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--sh-3);
  padding: 30px 32px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; overflow-y: auto;
}
.fc-face.back { transform: rotateY(180deg); background: linear-gradient(180deg, var(--surface), var(--surface-2)); }
.fc-face.back::before {
  content: ""; position: absolute; inset: 0; border-radius: var(--r-xl);
  border: 2px solid rgba(5, 150, 105, .35); pointer-events: none;
}
.fc-label { font-size: 11.5px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); }
.fc-zh { font-size: 42px; font-weight: 800; letter-spacing: -1.2px; margin: 12px 0 6px; }
.fc-vi { font-size: 26px; font-weight: 800; color: var(--vi); margin: 6px 0 4px; }
.fc-def { font-size: 14.5px; color: var(--text-2); max-width: 94%; }
.fc-def.vi { color: var(--vi); font-weight: 500; }
.fc-formula { margin-top: 14px; max-width: 96%; overflow-x: auto; }
.fc-ex {
  margin-top: 14px; font-size: 13.5px; color: var(--text-2);
  background: var(--surface-2); border: 1px dashed var(--border);
  border-radius: var(--r-sm); padding: 11px 15px; max-width: 94%;
}
.fc-ex .vi { color: var(--vi); display: block; margin-top: 5px; }
.fc-hint { margin-top: 16px; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.kbd {
  display: inline-block; padding: 1px 7px; border: 1px solid var(--border);
  border-bottom-width: 2px; border-radius: 6px; background: var(--surface-2);
  font-size: 11.5px; font-weight: 700; color: var(--text-2);
}
.fc-controls { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; justify-content: center; }
.btn-no { background: rgba(225, 29, 72, .12); color: var(--danger); }
.btn-no:hover { background: rgba(225, 29, 72, .2); }
.btn-yes { background: linear-gradient(135deg, var(--vi), #0d9488); color: #fff; box-shadow: var(--sh-vi); }

.fc-finish { text-align: center; padding: 46px 28px; width: 100%; max-width: 660px; }
.fc-finish .big-ic {
  width: 86px; height: 86px; border-radius: 50%; margin: 0 auto 16px;
  display: grid; place-items: center; font-size: 36px;
  background: rgba(5, 150, 105, .12); color: var(--vi);
}

.select-field { margin-bottom: 13px; }
.select-field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.select-field select {
  width: 100%; height: 40px; border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 0 12px; font-size: 13.5px; background: var(--surface); color: var(--text);
  outline: none; font-family: inherit;
}
.select-field select:focus { border-color: var(--brand-1); box-shadow: 0 0 0 3px rgba(79, 70, 229, .13); }

.pill-list { display: flex; flex-wrap: wrap; gap: 7px; }
.pill {
  font-size: 12.5px; padding: 5px 11px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-2);
  border: 1px solid var(--border);
}
.pill.mastered { background: rgba(5, 150, 105, .12); color: var(--vi); border-color: rgba(5, 150, 105, .3); font-weight: 600; }
.pill.due { background: rgba(245, 158, 11, .14); color: var(--warn); border-color: rgba(245, 158, 11, .3); }

/* ---------- 读题小测 ---------- */
.quiz-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); box-shadow: var(--sh-2); padding: 28px 30px;
}
.q-zh { font-size: 19px; font-weight: 600; line-height: 1.6; }
.q-vi { font-size: 14.5px; color: var(--vi); font-weight: 500; margin-top: 8px; }
.opt-list { margin-top: 22px; display: grid; gap: 10px; }
.opt {
  display: flex; align-items: center; gap: 13px;
  padding: 14px 17px; border-radius: var(--r);
  border: 1.5px solid var(--border); background: var(--surface);
  text-align: left; font-size: 14.5px; color: var(--text-2);
  transition: border-color .2s, background .2s, transform .18s;
  width: 100%;
}
.opt:hover { border-color: var(--brand-1); transform: translateX(4px); }
.opt .k {
  width: 28px; height: 28px; flex: none; border-radius: 9px;
  display: grid; place-items: center; font-size: 12.5px; font-weight: 800;
  background: var(--surface-2); color: var(--muted);
}
.opt.right { border-color: var(--vi); background: rgba(5, 150, 105, .10); color: var(--text); }
.opt.right .k { background: var(--vi); color: #fff; }
.opt.wrong { border-color: var(--danger); background: rgba(225, 29, 72, .09); }
.opt.wrong .k { background: var(--danger); color: #fff; }
.opt[disabled] { cursor: default; }

.explain {
  margin-top: 18px; padding: 16px 18px; border-radius: var(--r);
  background: rgba(79, 70, 229, .07); border: 1px solid rgba(79, 70, 229, .2);
  animation: pop .3s both;
}
.explain p { font-size: 14px; color: var(--text-2); }
.explain .vi { color: var(--vi); font-weight: 500; margin-top: 7px; }

/* ---------- 生词 / 错题本 ---------- */
.nb-item {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 15px 17px; border-radius: var(--r);
  border: 1px solid var(--border); background: var(--surface);
  margin-bottom: 10px; transition: transform .2s, box-shadow .2s;
}
.nb-item:hover { transform: translateY(-2px); box-shadow: var(--sh-1); }
.nb-item .ic {
  width: 40px; height: 40px; flex: none; border-radius: 12px;
  display: grid; place-items: center; font-size: 15px;
}
.nb-item .main { flex: 1; min-width: 0; }
.nb-item .zh { font-size: 16px; font-weight: 700; }
.nb-item .vi { font-size: 13.5px; color: var(--vi); font-weight: 600; }

.tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }

/* ---------- 陷阱速查表 ---------- */
.trap-row {
  display: grid; grid-template-columns: 150px 1fr 1fr; gap: 16px;
  padding: 15px 16px; border-radius: var(--r); border: 1px solid var(--border);
  background: var(--surface); margin-bottom: 10px;
}
@media (max-width: 820px) { .trap-row { grid-template-columns: 1fr; gap: 10px; } }
.trap-word { font-size: 17px; font-weight: 800; color: var(--warn); }
.trap-word .py { display: block; font-size: 11.5px; font-weight: 500; color: var(--muted); }
.trap-word .vv { display: block; font-size: 13px; font-weight: 600; color: var(--vi); }
.wrong-cell { color: var(--danger); font-size: 13.5px; }
.right-cell { color: var(--vi); font-size: 13.5px; font-weight: 500; }
.cell-label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); display: block; margin-bottom: 3px; }

/* =========================================================
 * Bảng đối chiếu từ vựng（词汇对照表）
 * ========================================================= */
.gl-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.gl-search {
  position: relative; flex: 1; min-width: 220px;
}
.gl-search > i {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 13px; pointer-events: none;
}
.gl-search input {
  width: 100%; height: 42px; padding: 0 40px 0 38px;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); color: var(--text); font-size: 14px;
  font-family: var(--font); outline: none; transition: var(--t);
}
.gl-search input:focus { border-color: var(--brand-1); box-shadow: 0 0 0 3px rgba(79,70,229,.14); }
.gl-search .clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; border: 0; border-radius: 50%;
  background: var(--surface-2); color: var(--muted); cursor: pointer;
  display: grid; place-items: center; font-size: 11px; transition: var(--t);
}
.gl-search .clear:hover { background: var(--border); color: var(--text); }

.gl-select {
  height: 42px; padding: 0 34px 0 12px;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237b8794' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
  color: var(--text); font-size: 13.5px; font-family: var(--font);
  cursor: pointer; outline: none; appearance: none; transition: var(--t);
}
.gl-select:focus { border-color: var(--brand-1); }

.gl-wrap {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); box-shadow: var(--sh-1); overflow: hidden;
}
.gl-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.gl-table thead th {
  text-align: left; padding: 13px 14px; font-size: 12px; font-weight: 700;
  letter-spacing: .3px; text-transform: uppercase; color: var(--muted);
  background: var(--surface-2); border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.gl-row { cursor: pointer; transition: background .15s; }
.gl-row td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.gl-row:hover { background: var(--surface-2); }
.gl-row.open { background: rgba(79,70,229,.06); }
.gl-row.open:hover { background: rgba(79,70,229,.08); }
.gl-row .c-zh {
  font-size: 15px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.gl-row .c-zh .cv {
  font-size: 10px; color: var(--muted); transition: transform .2s;
  margin-left: auto;
}
.gl-row.open .c-zh .cv { transform: rotate(180deg); color: var(--brand-1); }
.gl-row .c-py { font-size: 12.5px; color: var(--muted); font-family: var(--font-mono); }
.gl-row .c-vi { font-size: 14px; color: var(--vi); font-weight: 500; }
.gl-row .c-type, .gl-row .c-lesson { white-space: nowrap; }

.gl-row .speak { width: 30px; height: 30px; font-size: 11px; }

/* 展开详情 */
.gd td { padding: 0 !important; border-bottom: 1px solid var(--border); }
.gd-box {
  padding: 18px 20px 20px; background: var(--surface-2);
  border-left: 3px solid var(--brand-1);
  animation: gdIn .22s ease;
}
@keyframes gdIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.gd-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.gd-head .spacer { flex: 1; }
.gd-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.gd-sec { margin-top: 14px; }

/* =========================================================
 * Trang chính：统计卡 + 模块卡
 * ========================================================= */
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 18px; box-shadow: var(--sh-1);
  display: flex; flex-direction: column; gap: 4px; transition: var(--t);
}
.stat-card:hover { box-shadow: var(--sh-2); transform: translateY(-2px); }
.stat-card .ic {
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center; font-size: 15px; margin-bottom: 6px;
}
.stat-card .v { font-size: 26px; font-weight: 800; letter-spacing: -.5px; }
.stat-card .l { font-size: 12.5px; color: var(--muted); font-weight: 500; }

.part-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.part-card {
  --pc: var(--brand-1);
  display: block; padding: 16px 18px; border-radius: var(--r);
  border: 1px solid var(--border); background: var(--surface);
  text-decoration: none; color: var(--text);
  transition: var(--t); position: relative; overflow: hidden;
}
.part-card::before {
  content: ''; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--pc);
}
.part-card:hover { transform: translateY(-3px); box-shadow: var(--sh-2); border-color: var(--pc); }
.part-card .hd { display: flex; align-items: center; gap: 9px; font-size: 14.5px; font-weight: 700; }
.part-card .hd i { color: var(--pc); font-size: 15px; }
.part-card .sb { font-size: 12px; color: var(--muted); margin-top: 3px; }
.part-card .ft { font-size: 12px; color: var(--muted); margin-top: 8px; }
.part-card .ft b { color: var(--text); font-size: 14px; }

/* =========================================================
 * 打印（词汇对照表可打印成纸）
 * ========================================================= */
@media print {
  .sidebar, .backdrop, .topbar, .gl-toolbar, .hero, .page-head .sub,
  .toast-host, .gl-row .cv, .gl-row td:first-child { display: none !important; }
  .main { margin-left: 0 !important; }
  .page { padding: 0 !important; }
  .gl-wrap { border: 0; box-shadow: none; }
  .gl-table thead th { background: #f1f5f9 !important; }
  .gl-row, .gd { break-inside: avoid; }
  body { background: #fff; }
}

/* =========================================================
 * Bẻ câu dài —— 中越逐块对照
 * ========================================================= */
.sent-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px;
}
.sent-head h2 { font-size: 17.5px; flex: 1 1 220px; min-width: 0; }
.sent-head .grow { flex: 1; }

/* 中文行：块可带拼音 */
.sent-zh {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r); padding: 18px 16px 14px;
  line-height: 3.1; font-size: 19px;
}
.sent-zh .chunk { line-height: 1.35; }
.chunk .py {
  display: block; font-style: normal; font-size: 11px; letter-spacing: .2px;
  color: var(--muted); font-family: var(--font-mono); line-height: 1.4;
  margin-bottom: 1px; white-space: nowrap;
}
.chunk b { font-weight: 600; }

/* 越南语行：片段与中文块一一对应 */
.sent-vi {
  display: flex; gap: 10px; align-items: flex-start;
  margin-top: 12px; padding: 13px 15px;
  border-radius: var(--r); background: rgba(5, 150, 105, .06);
  border: 1px solid rgba(5, 150, 105, .22);
  line-height: 2.1; font-size: 14.5px; color: var(--text-2);
}
.sent-vi .flag { flex: 0 0 auto; line-height: 1.9; }
.sent-vi .segs { min-width: 0; }

/* 联动高亮 */
.chunk.active, .seg.active {
  outline: 2px solid var(--brand-1); outline-offset: 2px;
  box-shadow: 0 0 0 5px rgba(79, 70, 229, .16);
  border-radius: 8px;
}
.seg.active { background: rgba(79, 70, 229, .14); color: var(--text); }

/* 详情面板 */
.cd-top {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 10px;
}
.cd-word { font-size: 21px; font-weight: 700; }
.cd-py { font-size: 12.5px; color: var(--muted); font-family: var(--font-mono); }
.cd-vi { font-size: 15px; color: var(--vi); font-weight: 600; }
.chunk-detail .zh-note { font-size: 13.5px; color: var(--muted); margin-top: 6px; }

/* 关联词条 / 功能词词典 */
.cd-term, .cd-word-note {
  margin-top: 12px; padding: 13px 15px;
  border-radius: var(--r); background: var(--surface-2);
  border: 1px solid var(--border); border-left: 3px solid var(--brand-1);
}
.cd-word-note { border-left-color: var(--warn); }
.cd-term-hd {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 8px;
}
.cd-term-hd .zh { font-size: 17px; font-weight: 700; }
.cd-term-hd .py { font-size: 12px; color: var(--muted); font-family: var(--font-mono); }
.cd-term-hd .vi { font-size: 14.5px; color: var(--vi); font-weight: 600; }
.cd-term .def, .cd-word-note .def {
  font-size: 13.5px; color: var(--text-2); line-height: 1.75;
}

/* =========================================================
 * 渐进式学习路径：「从这一步开始」+ 五步路线图
 * ========================================================= */
.start-card {
  display: grid; grid-template-columns: 1.35fr .95fr; gap: 22px;
  padding: 26px 28px; margin-bottom: 20px;
  border-radius: var(--r-lg);
  background: linear-gradient(125deg, rgba(79, 70, 229, .09), rgba(168, 85, 247, .07) 60%, rgba(5, 150, 105, .08));
  border: 1px solid rgba(79, 70, 229, .22);
  box-shadow: var(--sh-md);
}
.start-card .sc-step {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .6px;
  color: var(--brand-1); text-transform: uppercase;
}
.start-card .sc-stage { font-size: 25px; font-weight: 800; margin-top: 8px; line-height: 1.25; }
.start-card .sc-stage .sn {
  font-size: 13px; font-weight: 700; color: #fff; background: var(--brand-1);
  padding: 3px 9px; border-radius: 999px; vertical-align: middle; margin-right: 6px;
}
.start-card .sc-lesson {
  margin-top: 11px; font-size: 15.5px; font-weight: 600; color: var(--text-2);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.start-card .sc-lesson .left { font-weight: 500; color: var(--warn); font-size: 13.5px; }
.start-card .sc-goal { margin-top: 7px; font-size: 13.5px; color: var(--muted); line-height: 1.7; }
.start-card .sc-meta { display: flex; align-items: center; gap: 11px; margin-top: 15px; flex-wrap: wrap; }
.start-card .sc-bar {
  flex: 1; min-width: 130px; height: 8px; border-radius: 99px;
  background: var(--surface-3); overflow: hidden;
}
.start-card .sc-bar i {
  display: block; height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--brand-1), var(--vi));
  transition: width .5s;
}
.start-card .sc-pct { font-size: 13px; font-weight: 700; color: var(--vi); }
.start-card .sc-actions { display: flex; gap: 11px; margin-top: 17px; flex-wrap: wrap; }
.start-card .sc-right {
  display: flex; flex-direction: column; gap: 11px;
  padding: 16px 18px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--border);
}
.start-card .sc-why {
  font-size: 13.5px; line-height: 1.72; color: var(--text-2);
  display: flex; gap: 8px; align-items: flex-start;
}
.start-card .sc-why i { color: var(--brand-1); margin-top: 3px; }
.start-card .sc-tip {
  font-size: 12.5px; line-height: 1.65; color: var(--muted);
  padding-top: 10px; border-top: 1px dashed var(--border-2);
}

/* 五步路线图 */
.stage-list { display: flex; flex-direction: column; gap: 9px; margin-top: 12px; }
.stage-row {
  display: flex; align-items: center; gap: 13px;
  padding: 14px 16px; border-radius: var(--r);
  background: var(--surface-2); border: 1px solid var(--border);
  color: inherit; text-decoration: none; transition: all .2s;
  position: relative;
}
.stage-row:hover { border-color: var(--sc); transform: translateY(-2px); box-shadow: var(--sh-sm); }
.stage-row.cur {
  border-color: var(--sc); background: var(--surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--sc) 16%, transparent);
}
.stage-row.done { opacity: .72; }
.stage-row.locked { opacity: .55; }
.stage-row .sn {
  flex: 0 0 auto; width: 32px; height: 32px; border-radius: 10px;
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 14px;
}
.stage-row .body { flex: 1; min-width: 0; }
.stage-row .t { display: block; font-size: 15px; font-weight: 700; }
.stage-row .g {
  display: block; font-size: 12.5px; color: var(--muted); margin-top: 3px; line-height: 1.6;
}
.stage-row .ls {
  display: block; font-size: 11.5px; color: var(--sc); font-weight: 600; margin-top: 5px;
}
.stage-row .rt { flex: 0 0 auto; text-align: right; }
.stage-row .rt b { display: block; font-size: 17px; color: var(--sc); }
.stage-row .rt span { font-size: 11.5px; color: var(--muted); }
.stage-row .now {
  position: absolute; top: -8px; right: 14px;
  font-size: 10px; font-weight: 700; letter-spacing: .4px;
  background: var(--sc); color: #fff; padding: 2px 8px; border-radius: 999px;
}

/* 课次进度条 + 上一课/下一课 */
.lnav {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; margin-bottom: 14px;
  border-radius: var(--r); background: var(--surface-2);
  border: 1px solid var(--border); border-left: 3px solid var(--sc, var(--brand-1));
}
.lnav-step {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; color: var(--sc, var(--brand-1)); font-weight: 600;
}
.lnav-step b { font-weight: 700; }
.lnav-pos { font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.lnav-bar {
  flex: 1; min-width: 110px; height: 7px; border-radius: 99px;
  background: var(--surface-3); overflow: hidden;
}
.lnav-bar i {
  display: block; height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--sc, var(--brand-1)), var(--vi)); transition: width .45s;
}
.lnav-num { font-size: 12.5px; font-weight: 700; color: var(--vi); }

.lnav-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.lnav-foot .btn { max-width: 42%; }
.lnav-foot .btn:first-child { justify-content: flex-start; }
.lnav-left { font-size: 13px; color: var(--warn); font-weight: 600; }
.lnav-done { font-size: 13px; color: var(--vi); font-weight: 600; }
@media (max-width: 620px) {
  .lnav-foot { flex-direction: column; align-items: stretch; }
  .lnav-foot .btn { max-width: none; justify-content: center !important; }
}
@media (max-width: 620px) {
  .lnav-foot { flex-direction: column; align-items: stretch; }
  .lnav-foot .btn {
    max-width: none; width: 100%; justify-content: center !important; text-align: center;
    white-space: normal; word-break: break-word; line-height: 1.45;
    height: auto; min-height: 38px; padding: 8px 12px;
  }
}
