/* =====================================================================
   视图样式：仪表盘 / 查词 / 词卡 / 队列 / 复习 / 词库 / 精读 /
             练习 / 听写 / 统计 / 设置

   分层靠三样东西：卡片的内高光与投影、区块上方的 eyebrow 标签、
   以及 38–46px 的数字。刻线只留在复习卡顶部与极少数分隔上。
   ===================================================================== */

/* ==================== 背景装饰 ==================== */
.atmos-mandala {
  position: absolute;
  right: -20vmin;
  top: 10vmin;
  width: 54vmin;
  height: 54vmin;
  color: var(--primary);
  opacity: 0;
  transition: opacity var(--dur-slow) var(--ease-out);
}

.atmos-mandala svg { width: 100%; height: 100%; display: block; animation: breathe 14s var(--ease-in-out) infinite; }

:root[data-theme='dark'] .atmos-mandala { opacity: .06; }
:root[data-theme='light'] .atmos-mandala { opacity: .03; }

.atmos-stars { position: absolute; inset: 0; opacity: 0; transition: opacity var(--dur-slow); }
:root[data-theme='dark'] .atmos-stars { opacity: .4; }

.atmos-stars i { position: absolute; border-radius: 50%; background: var(--gold); animation: breathe 5s var(--ease-in-out) infinite; }

/* ==================== 通用两栏 ==================== */
.cols-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 336px;
  gap: 18px;
  align-items: start;
}

.cols-2 > .col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

/* ==================== 仪表盘 ==================== */
.dash-hello {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-5);
  margin-bottom: var(--sp-5);
  flex-wrap: wrap;
}

.dh-name {
  font-family: var(--font-deva);
  font-size: clamp(34px, 4.6vw, 46px);
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  animation: headRise 700ms var(--ease-out) 40ms both;
}

.dh-greet { font-size: 17px; margin-top: var(--sp-2); }
.dh-greet .who { color: var(--text-2); }
.dh-date { margin-top: 4px; font-family: var(--font-en); font-size: 11px; letter-spacing: .16em; }

/* 连续打卡：一张小卡，拟态内高光把它托起来 */
.dh-streak {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 10px 12px 10px 14px;
  border-radius: var(--r-lg);
  background: var(--grad-card);
  border: 1px solid var(--line);
  box-shadow: var(--inner-light), var(--shadow-sm);
}

.dh-flame { width: 22px; height: 22px; color: var(--text-3); flex: none; }
.dh-flame svg { width: 100%; height: 100%; }
.dh-streak.lit .dh-flame { color: var(--gold); filter: drop-shadow(0 2px 4px rgba(169, 118, 27, .35)); }

.dh-streak-num {
  font-family: var(--font-en);
  font-size: 26px;
  font-weight: 600;
  color: var(--text);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.dh-streak.lit .dh-streak-num { color: var(--gold); }
.dh-streak-sub { font-size: 11.5px; color: var(--text-3); line-height: 1.35; }
.dh-checkin { margin-left: var(--sp-2); }
.dh-checked { margin-left: var(--sp-2); color: var(--green); font-size: 11px; }

/* ---------- 提醒 ---------- */
.reminder-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-5);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, #FBF2DC 0%, #F7EAD0 100%);
  border: 1px solid #EAD9B4;
  box-shadow: var(--inner-light), 0 6px 16px -12px rgba(150, 96, 26, .5);
  animation: riseIn var(--dur) var(--ease-out) both;
}

:root[data-theme='dark'] .reminder-bar {
  background: linear-gradient(180deg, #2E2618 0%, #262014 100%);
  border-color: #3C3220;
}

.rm-ico {
  width: 34px; height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .55);
  color: var(--gold);
  flex: none;
  box-shadow: var(--inner-light);
}

:root[data-theme='dark'] .rm-ico { background: rgba(255, 255, 255, .06); }
.rm-ico svg { width: 17px; height: 17px; }

.rm-text { flex: 1; min-width: 0; }
.rm-title { font-size: 14px; font-weight: 600; }
.rm-sub { font-size: 12.5px; color: #7A6636; }
:root[data-theme='dark'] .rm-sub { color: var(--text-3); }

/* ---------- 三张统计卡 ---------- */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.stat-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 20px;
  text-align: left;
  background: var(--grad-card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--inner-light), var(--shadow-sm);
  transition: box-shadow var(--dur) var(--ease-out),
              transform var(--dur) var(--ease-out),
              border-color var(--dur);
}

.stat-card:hover {
  box-shadow: var(--inner-light), var(--shadow);
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.stat-card .head { display: flex; align-items: center; gap: 10px; }

.s-ico {
  width: 30px; height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  flex: none;
  box-shadow: var(--inner-light), 0 1px 2px rgba(60, 48, 30, .06);
}

.s-ico svg { width: 16px; height: 16px; }

.stat-card.c1 .s-ico { background: var(--seal-soft); color: var(--primary); }
.stat-card.c2 .s-ico { background: var(--accent-soft); color: var(--accent); }
.stat-card.c3 .s-ico { background: var(--gold-soft); color: var(--gold); }

.s-label { font-size: 12.5px; color: var(--text-3); letter-spacing: .04em; }

.s-num {
  font-family: var(--font-en);
  font-size: 38px;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -.01em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.stat-card.c1 .s-num { color: var(--primary); }
.s-note { font-size: 12.5px; color: var(--text-3); }

/* ---------- 今日足迹 ---------- */
.dash-today .card-head { margin-bottom: var(--sp-3); }

.today-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }

.today-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border-radius: var(--r);
  background: var(--surface-1);
  box-shadow: inset 0 1px 2px rgba(60, 48, 30, .05);
}

.tc-num { font-family: var(--font-en); font-size: 24px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.tc-label { font-size: 11.5px; color: var(--text-3); }

.trend-card { margin-bottom: 0; }

.dash-quick { display: grid; gap: 10px; }

.dash-quick .btn { justify-content: space-between; width: 100%; min-height: 44px; }

/* ---------- 右栏 ---------- */
.rail { display: flex; flex-direction: column; gap: 18px; }

.rail .card { padding: var(--sp-4); }
.rail .card-head { margin-bottom: 12px; }

.rail-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 2px;
  font-size: 13.5px;
  color: var(--text-2);
  border-radius: var(--r-xs);
  transition: color var(--dur-fast);
}

.rail-link:hover { color: var(--text); }
.rail-link .n { font-family: var(--font-en); font-weight: 600; color: var(--text); }

/* ==================== 查词 ==================== */
.search-box { display: flex; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.search-box .input { flex: 1; font-size: 16px; min-height: 46px; }
.hints { margin-bottom: var(--sp-5); }

/* ==================== 词卡 ==================== */
.wcard {
  background: var(--grad-card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--inner-light), var(--shadow);
  overflow: hidden;
  animation: riseIn var(--dur) var(--ease-out) both;
}

.wcard-head {
  position: relative;
  padding: var(--sp-6) var(--sp-6) var(--sp-5);
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, #FFFFFF 0%, #FDF8EE 100%);
}

:root[data-theme='dark'] .wcard-head { background: linear-gradient(180deg, #262119, #201C16); }

.w-word { font-size: clamp(34px, 5vw, 46px); font-weight: 600; line-height: 1.4; word-break: break-word; }
.w-tags { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-top: var(--sp-3); align-items: center; }
.w-translit { margin-top: var(--sp-1); font-family: var(--font-en); font-style: italic; font-size: 16px; color: var(--text-3); }
.w-pron { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }

.wcard-body { padding: var(--sp-5) var(--sp-6); display: flex; flex-direction: column; gap: var(--sp-5); }

.w-sec-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: var(--sp-3);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.w-sec-label::after { content: ''; flex: 1; height: 1px; background: var(--line-soft); }

.w-sec-mean { display: flex; flex-direction: column; gap: var(--sp-2); }
.w-mean-zh { font-size: 20px; line-height: 1.6; color: var(--text); }
.w-mean-en { font-size: 13px; color: var(--text-3); font-family: var(--font-en); font-style: italic; }

.w-mnemonic {
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r);
  border-left: 2px solid var(--gold);
  background: var(--gold-soft);
  font-size: 14px;
  line-height: 1.8;
}

.m-tag { margin-right: var(--sp-2); color: var(--gold); }

.w-root { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; font-family: var(--font-deva); font-size: 20px; }

.r-part { padding: 2px var(--sp-2); border-radius: var(--r-xs); }
.r-prefix { background: var(--male-soft); color: var(--male); }
.r-root   { background: var(--primary-soft); color: var(--primary-ink); }
.r-suffix { background: var(--accent-soft); color: var(--accent); }
.r-plus { color: var(--text-3); }

.w-root-explain { margin-top: var(--sp-3); font-size: 13px; color: var(--text-2); line-height: 1.75; }

.w-example { padding: var(--sp-3) 0; border-bottom: 1px solid var(--line-soft); }
.w-example:last-child { border-bottom: none; }
.ex-hi { font-size: 17px; line-height: var(--lh-deva); }
.ex-zh { font-size: 13px; color: var(--text-2); margin-top: 4px; }

.w-rel { display: flex; flex-wrap: wrap; gap: var(--sp-2); }

.rel-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 5px var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  box-shadow: var(--inner-light);
  transition: border-color var(--dur-fast), background var(--dur-fast);
}

.rel-chip:hover { border-color: var(--primary); background: var(--primary-soft); }
.rel-label { font-size: 9.5px; color: var(--text-3); letter-spacing: .1em; text-transform: uppercase; }
.r-deva { font-family: var(--font-deva); font-size: 15px; }
.rel-mean { font-size: 11.5px; color: var(--text-3); }

.wcard-foot {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
  padding: var(--sp-4) var(--sp-6);
  background: var(--surface-1);
  border-top: 1px solid var(--line-soft);
}

.foot-note { font-size: 12px; color: var(--text-3); margin-right: auto; }

.cword.c-masc { color: var(--male); }
.cword.c-fem  { color: var(--female); }

.vmark { font-size: .5em; vertical-align: super; color: var(--text-3); margin-left: 3px; }
.vmark.trans   { color: var(--trans); }
.vmark.intrans { color: var(--intrans); }

/* ==================== 紧凑行 ==================== */
.wrow {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-2);
  border-bottom: 1px solid var(--line-soft);
  width: 100%;
  text-align: left;
  transition: background var(--dur-fast);
}
.wrow:hover { background: var(--surface-1); }
.wrow-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.wrow-word { font-size: 17px; }
.wrow-mean { font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wrow-right { display: flex; gap: var(--sp-2); align-items: center; }

/* ==================== 新词队列 ==================== */
.q-meta-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-2); margin-bottom: var(--sp-3); }

.q-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  min-height: 300px;
  margin: var(--sp-4) 0 var(--sp-5);
  padding: var(--sp-7) var(--sp-5);
  background: var(--grad-card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--inner-light), var(--shadow);
}

.q-word {
  font-family: var(--font-deva);
  font-size: clamp(44px, 7vw, 68px);
  font-weight: 600;
  text-align: center;
  line-height: 1.4;
  word-break: break-word;
  animation: headRise 620ms var(--ease-out) both;
}

.q-translit { font-family: var(--font-en); font-style: italic; font-size: 18px; color: var(--text-3); }
.q-hint { text-align: center; margin-bottom: var(--sp-4); font-size: 12.5px; color: var(--text-3); }
.q-actions { display: flex; gap: var(--sp-3); justify-content: center; flex-wrap: wrap; }

/* ==================== 复习 ==================== */
.rev-head {
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
  flex-wrap: wrap;
}

.rev-count {
  margin-left: auto;
  font-family: var(--font-en);
  font-size: 12px;
  color: var(--text-3);
  letter-spacing: .04em;
}

.rev-progress-bar { margin-bottom: var(--sp-3); }

.rev-progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text-2);
  margin-top: var(--sp-2);
}

/* 方向切换 */
.rev-modebar { display: flex; align-items: center; gap: var(--sp-2); margin: var(--sp-4) 0 var(--sp-4); }
.rev-modebar .eyebrow { margin-right: 2px; }

.chip-xs {
  padding: 3px 11px;
  font-size: 11.5px;
  min-height: 0;
  line-height: 1.7;
}

/* 卡片：整页里唯一带刻线的容器 */
.rev-card {
  position: relative;
  background: var(--grad-card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--inner-light), var(--shadow-lg);
  padding: var(--sp-7) var(--sp-6) var(--sp-6);
  min-height: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4);
  text-align: center;
}

.rev-card::before {
  content: '';
  position: absolute;
  top: 0; left: 22px; right: 22px;
  height: 1.5px;
  background: linear-gradient(to right, transparent, var(--rule-ink) 12%, var(--rule-ink) 88%, transparent);
  transform: scaleX(0);
  transform-origin: left center;
  animation: ruleIn 620ms var(--ease-out) 40ms forwards;
}

.rev-front { cursor: pointer; }
.rev-front:hover { box-shadow: var(--inner-light), var(--shadow-lg), 0 0 0 1px var(--line-strong); }

.rev-word {
  font-family: var(--font-deva);
  font-size: clamp(46px, 6.4vw, 74px);
  font-weight: 600;
  line-height: 1.35;
  word-break: break-word;
  animation: headRise 680ms var(--ease-out) 80ms both;
}

.rev-translit {
  font-family: var(--font-en);
  font-style: italic;
  font-size: 19px;
  color: var(--text-3);
  animation: headRise 680ms var(--ease-out) 170ms both;
}

.rev-tap { margin-top: var(--sp-4); font-size: 12px; color: var(--text-3); }

.rev-back { animation: cardTurn var(--dur-slow) var(--ease-out) both; }

.rb-word {
  font-family: var(--font-deva);
  font-size: 38px;
  font-weight: 600;
  line-height: 1.4;
  animation: headRise 520ms var(--ease-out) both;
}

.rb-translit { font-family: var(--font-en); font-style: italic; font-size: 15px; color: var(--text-3); margin-top: -6px; }
.rb-mean { font-size: 23px; line-height: 1.6; color: var(--text); }
.rb-mean-en { font-size: 13.5px; color: var(--text-3); font-family: var(--font-en); font-style: italic; }
.rb-meta { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }

.rb-mnemonic {
  max-width: 52ch;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r);
  border-left: 2px solid var(--gold);
  background: var(--gold-soft);
  font-size: 13.5px;
  line-height: 1.8;
  text-align: left;
}

.rb-example {
  max-width: 52ch;
  padding: var(--sp-3) var(--sp-3) var(--sp-3) var(--sp-4);
  border-radius: var(--r);
  border-left: 2px solid var(--line-strong);
  background: var(--surface-1);
  text-align: left;
  font-size: 16px;
  line-height: var(--lh-deva);
}

/* 四档评分：柔和着色的小方块，间隔数字当主角 */
.rev-rate {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  width: 100%;
  margin-top: var(--sp-5);
}

.rate {
  position: relative;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 2px;
  padding: 12px 8px;
  min-height: 66px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--surface-1);
  box-shadow: var(--inner-light), 0 1px 2px rgba(60, 48, 30, .05);
  transition: transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast);
}

.rate:hover { transform: translateY(-2px); box-shadow: var(--inner-light), var(--shadow); }

.rate-label { font-size: 11.5px; font-weight: 500; letter-spacing: .06em; color: var(--text-3); }

.rate-interval {
  font-family: var(--font-en);
  font-size: 21px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.rate-key {
  position: absolute; top: 5px; right: 7px;
  font-size: 9px; opacity: .38; font-family: var(--font-en);
}

.rate-forgot { border-color: #EBC9C2; background: #FBF0EE; }
.rate-forgot .rate-interval { color: var(--primary); }
.rate-hard { border-color: #EBD9B4; background: #FBF4E6; }
.rate-hard .rate-interval { color: var(--gold); }
.rate-good { border-color: #C9D8E2; background: #F0F5F8; }
.rate-good .rate-interval { color: var(--accent); }
.rate-easy { border-color: #C9DBCF; background: #F0F6F2; }
.rate-easy .rate-interval { color: var(--green); }

.rev-hint { text-align: center; margin-top: var(--sp-4); font-size: 11.5px; color: var(--text-3); }

kbd {
  display: inline-block;
  padding: 1px 6px;
  margin: 0 1px;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  background: var(--surface);
  box-shadow: var(--inner-light), 0 1px 1px rgba(60, 48, 30, .06);
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.7;
  color: var(--text-2);
}

/* 复习页右栏 */
.rev-side .card { padding: var(--sp-4); }
.rev-side .card-head { margin-bottom: 8px; }

.total-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 13px;
  color: var(--text-2);
}

.total-row b {
  font-family: var(--font-en);
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* ---------- 产出方向 ---------- */
.rev-prod { cursor: default; gap: var(--sp-3); }

.rp-prompt { font-size: 10.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); }
.rp-mean { font-size: clamp(24px, 3vw, 30px); line-height: 1.5; color: var(--text); max-width: 30ch; }
.rp-meta { display: flex; gap: 6px; justify-content: center; }
.rp-inputwrap { width: min(420px, 100%); margin-top: var(--sp-3); }

.rp-input {
  text-align: center;
  font-size: 26px;
  min-height: 60px;
  line-height: 1.5;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r);
}

.rp-input::placeholder { font-family: var(--font-en); font-style: italic; font-size: 15px; color: var(--text-3); }
.rp-conv { min-height: 22px; margin-top: 6px; font-family: var(--font-deva); font-size: 15px; color: var(--accent); }

/* 答案比对 */
.rb-diff {
  width: fit-content;
  max-width: 100%;
  text-align: left;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--surface-1);
}

.rb-diff.ok { border-color: #C9DBCF; background: #F1F7F3; }
.rd-ok { color: var(--green); font-size: 13px; letter-spacing: .04em; }

.rd-row { display: flex; gap: var(--sp-3); align-items: baseline; margin-bottom: 2px; }

.rd-k {
  flex: none;
  width: 3.4em;
  font-size: 10px;
  letter-spacing: .08em;
  color: var(--text-3);
}

.rd-deva { font-family: var(--font-deva); font-size: 21px; line-height: 1.9; letter-spacing: .02em; }
.rd-ch.same { color: var(--text-2); }
.rd-ch.bad { color: var(--err); background: rgba(167, 53, 44, .12); border-radius: 2px; }
/* 注意：不能叫 .empty —— 那是全局空态组件 */
.rd-ch.gap { color: var(--line-strong); }
.rd-note { color: var(--text-3); margin-top: 4px; }

/* ---------- 完成页 ---------- */
.rev-done-wrap {
  max-width: 580px;
  margin: 0 auto;
  text-align: center;
  padding: var(--sp-7) var(--sp-5);
  background: var(--grad-card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--inner-light), var(--shadow-lg);
}

.rev-done-burst { display: inline-block; width: 48px; height: 48px; color: var(--primary); animation: sealPress 620ms var(--ease-spring) both; }
.rev-done-burst svg { width: 100%; height: 100%; }

.rev-done-title { font-size: 22px; margin: var(--sp-3) 0 var(--sp-2); }
.rev-done-sub { color: var(--text-2); font-size: 13.5px; margin-bottom: var(--sp-5); }

.rev-done-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: var(--sp-5);
}

.rstat {
  padding: 12px 8px;
  border-radius: var(--r);
  background: var(--surface-1);
  box-shadow: inset 0 1px 2px rgba(60, 48, 30, .05);
}

.rstat-num { display: block; font-size: 24px; font-weight: 600; font-family: var(--font-en); font-variant-numeric: tabular-nums; }
.rstat-label { font-size: 11px; color: var(--text-3); }
.rstat.rate-forgot .rstat-num { color: var(--primary); }
.rstat.rate-hard .rstat-num { color: var(--gold); }
.rstat.rate-good .rstat-num { color: var(--accent); }
.rstat.rate-easy .rstat-num { color: var(--green); }

.rev-done-actions { display: flex; gap: var(--sp-3); justify-content: center; flex-wrap: wrap; }

/* ==================== 词库 ==================== */
.lib-stats { margin-bottom: var(--sp-4); }
.lib-toolbar { display: flex; gap: var(--sp-3); align-items: center; flex-wrap: wrap; margin-bottom: var(--sp-3); }
.lib-toolbar .search-box { flex: 1; min-width: 220px; margin: 0; }
.lib-sorts { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.lib-filters { margin-bottom: var(--sp-4); }

.letter-rail { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: var(--sp-5); }

.letter-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 46px;
  padding: 4px 6px 5px;
  border: 1px solid transparent;
  border-radius: var(--r-xs);
  color: var(--text-2);
  font-size: 15px;
  font-family: var(--font-deva);
  transition: background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast);
}

.letter-btn:hover { background: var(--surface-1); }
.letter-btn.on {
  background: var(--grad-surface);
  border-color: var(--line-strong);
  color: var(--primary);
  box-shadow: var(--inner-light), 0 1px 2px rgba(60, 48, 30, .06);
}

.letter-n { font-size: 9px; color: var(--text-3); font-family: var(--font-en); }

.lib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 14px;
}

.lib-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: var(--sp-4);
  background: var(--grad-card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--inner-light), var(--shadow-sm);
  transition: box-shadow var(--dur) var(--ease-out), transform var(--dur) var(--ease-out), border-color var(--dur);
}

.lib-card:hover {
  box-shadow: var(--inner-light), var(--shadow);
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.lc-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-2); }
.lc-deva { font-size: 23px; line-height: 1.5; word-break: break-word; }
.lc-mean { font-size: 13px; color: var(--text-2); line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lc-meta { display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; }
.lc-foot { display: flex; gap: 2px; margin-top: var(--sp-2); padding-top: var(--sp-2); border-top: 1px solid var(--line-soft); }

@media (hover: hover) and (min-width: 768px) {
  .lc-foot {
    border-top-color: transparent;
    opacity: 0;
    max-height: 0;
    margin-top: 0;
    padding-top: 0;
    overflow: hidden;
    transition: opacity var(--dur) var(--ease-out), max-height var(--dur) var(--ease-out);
  }
  .lib-card:hover .lc-foot,
  .lib-card:focus-within .lc-foot {
    opacity: 1;
    max-height: 46px;
    margin-top: var(--sp-2);
    padding-top: var(--sp-2);
    border-top-color: var(--line-soft);
  }
}

/* ==================== 批量导入 ==================== */
.batch-progress { margin-bottom: var(--sp-4); }

.batch-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r);
  border: 1px solid var(--line-soft);
  background: var(--surface);
  margin-bottom: var(--sp-2);
  box-shadow: var(--inner-light), 0 1px 2px rgba(60, 48, 30, .04);
}

.batch-item.ok  { border-left: 3px solid var(--green); }
.batch-item.err { border-left: 3px solid var(--err); background: #FDF4F2; }
.batch-item.pending { border-left: 3px solid var(--line-strong); opacity: .75; }

.bi-no { font-size: 11px; color: var(--text-3); min-width: 20px; font-variant-numeric: tabular-nums; }
.bi-main { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-2); }
.bi-word { font-size: 17px; }
.bi-mean { font-size: 12.5px; color: var(--text-2); }
.bi-status { font-size: 11px; color: var(--text-3); }
.batch-item.err .bi-status { color: var(--err); }
.bi-act { display: flex; gap: 2px; }

/* ==================== 精读 ==================== */
.lesson-list { display: grid; gap: 14px; }

.lesson-card {
  padding: var(--sp-5);
  background: var(--grad-card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--inner-light), var(--shadow-sm);
  transition: box-shadow var(--dur) var(--ease-out), transform var(--dur) var(--ease-out), border-color var(--dur);
}

.lesson-card:hover {
  box-shadow: var(--inner-light), var(--shadow);
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.lc-head { display: flex; align-items: center; gap: var(--sp-3); }
.lesson-title { font-family: var(--font-deva); font-size: 21px; flex: 1; line-height: 1.6; }
.lesson-sub { margin-top: 4px; font-size: 11.5px; }
.lc-first {
  margin-top: var(--sp-2);
  font-size: 15px;
  color: var(--text-2);
  line-height: var(--lh-deva);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lesson-acts { display: flex; gap: var(--sp-2); margin-top: var(--sp-4); flex-wrap: wrap; }

.read-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin-bottom: var(--sp-4);
}

.rs-fold {
  margin-bottom: var(--sp-4);
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--inner-light), var(--shadow-sm);
  overflow: hidden;
}

.rs-fold > summary {
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  cursor: pointer;
  list-style: none;
  transition: background var(--dur-fast);
}

.rs-fold > summary::-webkit-details-marker { display: none; }
.rs-fold > summary:hover { background: var(--surface-1); }

.rs-fold > summary::before { content: '▸'; color: var(--text-3); font-size: 10px; transition: transform var(--dur) var(--ease-out); }
.rs-fold[open] > summary::before { transform: rotate(90deg); }

.rsf-title { font-size: 12.5px; font-weight: 600; letter-spacing: .04em; }
.rsf-hint { font-size: 11px; color: var(--text-3); margin-left: auto; }

.rs-list { display: flex; flex-direction: column; gap: 2px; padding: 0 var(--sp-2) var(--sp-2); max-height: 46vh; overflow-y: auto; }

.rs-item {
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid transparent;
  border-radius: var(--r-xs);
  text-align: left;
  transition: background var(--dur-fast), border-color var(--dur-fast);
}

.rs-item:hover { background: var(--surface-1); }
.rs-item.cur { background: var(--primary-soft); border-color: #EFCFC8; }
.rs-no { font-size: 10.5px; color: var(--text-3); min-width: 16px; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.rs-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.rs-hi { font-size: 15px; line-height: var(--lh-deva); }
.rs-zh { font-size: 11.5px; color: var(--text-3); }

.read-card {
  background: var(--grad-card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--inner-light), var(--shadow);
  touch-action: pan-y;
}

.rc-head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-5);
  border-bottom: 1px solid var(--line-soft);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  background: var(--surface-1);
}

.rc-idx { font-size: 11.5px; color: var(--text-2); white-space: nowrap; letter-spacing: .04em; }
.rc-progress { flex: 1; height: 3px; border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; }
.rc-progress > i { display: block; height: 100%; border-radius: var(--r-pill); background: var(--grad-seal); transition: width var(--dur-slow) var(--ease-out); }

.rc-body { display: flex; flex-direction: column; gap: var(--sp-5); padding: var(--sp-6) var(--sp-5); }

.rc-hi { font-family: var(--font-deva); font-size: 27px; line-height: 2.1; font-weight: 500; }
.rc-zh { font-size: 15.5px; color: var(--text-2); line-height: 1.8; margin-top: calc(-1 * var(--sp-3)); }

.rc-sec { padding-top: var(--sp-4); border-top: 1px solid var(--line-soft); }

.rc-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: var(--sp-2);
}

.rc-tense { font-size: 16px; font-weight: 600; margin-bottom: var(--sp-2); }
.rc-kw { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-bottom: var(--sp-2); }
.rc-frame { font-size: 13px; color: var(--text-2); line-height: 1.75; }

.rc-kv { display: flex; gap: var(--sp-3); align-items: baseline; padding: var(--sp-2) 0; border-bottom: 1px solid var(--line-soft); }
.rc-kv:last-child { border-bottom: none; }

.kv-deva { font-family: var(--font-deva); font-size: 17px; min-width: 84px; flex-shrink: 0; }
.kv-link { color: var(--primary); text-align: left; }
.kv-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.kv-mean { font-size: 13px; color: var(--text-2); flex: 1; }

.rc-empty { padding: var(--sp-3); border-radius: var(--r-xs); background: var(--surface-1); font-size: 13px; }

.rc-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-top: 1px solid var(--line-soft);
  border-radius: 0 0 var(--r-xl) var(--r-xl);
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: sticky;
  bottom: 0;
  z-index: 2;
}

.rc-dots { display: flex; gap: 5px; align-items: center; }
.rc-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); transition: background var(--dur) var(--ease-out), transform var(--dur); }
.rc-dot.on { background: var(--primary); transform: scale(1.35); }

/* ==================== 练习 ==================== */
.ex-top { margin-bottom: var(--sp-5); }

.ex-qcard {
  padding: var(--sp-6);
  background: var(--grad-card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--inner-light), var(--shadow);
  margin-bottom: var(--sp-5);
}

.ex-question { font-size: 19px; line-height: 2; white-space: pre-wrap; }
.ex-hint { margin-top: var(--sp-3); font-size: 13px; color: var(--text-3); }

.ex-answer {
  padding: var(--sp-5);
  border-radius: var(--r-lg);
  border: 1px solid rgba(46, 80, 104, .16);
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  margin-bottom: var(--sp-5);
  animation: riseIn var(--dur) var(--ease-out) both;
}

.ex-answer-label { font-size: 10px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); margin-bottom: var(--sp-2); }
.ex-answer-body { font-size: 18px; line-height: 2; }
.ex-explain { margin-top: var(--sp-4); padding-top: var(--sp-3); border-top: 1px solid rgba(46, 80, 104, .18); font-size: 13.5px; color: var(--text-2); line-height: 1.85; }

.ex-rate { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }

.ex-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: var(--sp-5);
}

.mistake-list { display: flex; flex-direction: column; gap: 12px; }

.mistake-card {
  padding: var(--sp-4) var(--sp-4) var(--sp-4) var(--sp-5);
  border: 1px solid var(--line);
  border-left: 3px solid var(--err);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--inner-light), var(--shadow-sm);
}

.mc-head { display: flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.mc-q { font-size: 17px; line-height: 1.95; margin-bottom: var(--sp-2); }
.mc-hint { margin-bottom: var(--sp-2); }
.mc-a { font-size: 15px; line-height: 1.9; }
.mc-ex { font-size: 13px; color: var(--text-2); margin-top: var(--sp-2); line-height: 1.8; }
.mc-acts { display: flex; gap: var(--sp-2); margin-top: var(--sp-4); }

/* ==================== 听写 ==================== */
.dict-config { margin-bottom: var(--sp-5); }

.cfg-row { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-4); flex-wrap: wrap; }
.cfg-label { font-size: 10.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); min-width: 84px; }
.cfg-num { width: 90px; min-height: 38px; padding: 6px var(--sp-3); }
.cfg-time { width: 132px; min-height: 38px; padding: 6px var(--sp-3); flex: 0 0 auto; }
.cfg-check { display: inline-flex; align-items: center; gap: var(--sp-2); font-size: 13.5px; cursor: pointer; }
.cfg-check input { width: 16px; height: 16px; accent-color: var(--primary); }
.cfg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--sp-3); }

.paper-stage { padding: var(--sp-5) 0; }
.paper-stack { display: flex; flex-direction: column; gap: var(--sp-6); }

.paper {
  background: #FFFEFA;
  color: #17140F;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-lg);
  padding: 20mm 16mm;
  max-width: 210mm;
  margin: 0 auto;
  width: 100%;
}

.paper-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-4);
  padding-bottom: var(--sp-3);
  border-bottom: 1.5px solid #17140F;
  margin-bottom: var(--sp-4);
  flex-wrap: wrap;
}

.ph-title { font-family: var(--font-zh); font-size: 19px; font-weight: 700; letter-spacing: .06em; }
.ph-meta { display: flex; gap: var(--sp-5); font-size: 11px; color: #5A5346; letter-spacing: .04em; }

.paper-foot {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: var(--sp-5);
  padding-top: 3mm;
  border-top: 0.5pt solid #E3DCCB;
  font-size: 9.5px;
  color: #A39C8C;
}

.pf-quote { font-family: var(--font-deva); font-size: 10.5px; color: #8B8474; }
.pf-quote-zh { font-size: 9.5px; color: #B2AB9C; }
.pf-page { margin-left: auto; }

.d-list { list-style: none; }
.d-item { display: flex; gap: var(--sp-3); break-inside: avoid; page-break-inside: avoid; margin-bottom: 7mm; }
.d-no { font-size: 12px; font-weight: 700; min-width: 22px; padding-top: 3px; font-variant-numeric: tabular-nums; }
.d-body { flex: 1; min-width: 0; }
.d-prompt { font-size: 16px; line-height: 1.9; }
.d-hint { font-size: 11px; color: #8B8474; margin-top: 2px; }

.write-line { height: var(--line-h, 12mm); border-bottom: 0.4pt solid #A39C8C; margin-top: var(--sp-1); }

.answer-key { break-before: page; page-break-before: always; }
.ak-list { list-style: none; column-count: 2; column-gap: 10mm; }
.ak-item { break-inside: avoid; display: flex; gap: var(--sp-2); padding: var(--sp-1) 0; font-size: 13px; align-items: baseline; }
.ak-no { font-size: 10.5px; color: #8B8474; min-width: 20px; font-variant-numeric: tabular-nums; }
.ak-ans { font-family: var(--font-deva); font-size: 16px; }
.ak-sub { font-size: 11px; color: #8B8474; }

/* ==================== 统计 ==================== */
.stats-top { display: flex; gap: var(--sp-5); align-items: center; margin-bottom: var(--sp-5); flex-wrap: wrap; }
.stats-top-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; flex: 1; min-width: 300px; }

.fact {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px;
  border-radius: var(--r);
  background: var(--surface-1);
  box-shadow: inset 0 1px 2px rgba(60, 48, 30, .05);
}

.fact-k { font-size: 11px; color: var(--text-3); }
.fact-v { font-size: 24px; font-weight: 600; font-family: var(--font-en); font-variant-numeric: tabular-nums; }
.fact-v.warn { color: var(--warn); }

.stats-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }

.ret-table { display: flex; flex-direction: column; }
.ret-row { display: flex; align-items: baseline; gap: var(--sp-3); padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.ret-row span:first-child { flex: 1; font-size: 13px; color: var(--text-2); }
.ret-row.sub { padding-left: var(--sp-4); }
.ret-row b { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }

.leech-card { border-left: 3px solid var(--warn); }

/* 产出准确率 */
.prod-row { display: flex; align-items: center; gap: var(--sp-6); flex-wrap: wrap; }
.prod-facts { flex: 1; min-width: 200px; }
.leech-list { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.leech-chip {
  display: inline-flex; align-items: baseline; gap: var(--sp-2);
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  box-shadow: var(--inner-light);
  transition: border-color var(--dur-fast), background var(--dur-fast);
}
.leech-chip:hover { border-color: var(--warn); background: #FBF2DF; }
.leech-chip .deva { font-size: 15px; }
.leech-n { font-size: 10px; color: var(--err); font-variant-numeric: tabular-nums; }

/* ==================== 图表 ==================== */
.ch { width: 100%; height: auto; display: block; overflow: visible; }
.ch-tick { font-size: 10px; fill: var(--text-3); font-family: var(--font-en); }

.ch-bar {
  transform-origin: bottom;
  animation: riseIn 420ms var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 22ms);
  transition: opacity var(--dur-fast);
}
.ch-bar:hover { opacity: .75; }

.ch-line { stroke-dasharray: 2000; stroke-dashoffset: 0; animation: drawLine 900ms var(--ease-out) both; --dash: 2000; }

.ch-empty { display: grid; place-items: center; color: var(--text-3); font-size: 12.5px; border-radius: var(--r); background: var(--surface-1); }

.barlist { display: flex; flex-direction: column; gap: var(--sp-3); }
.bl-row { display: flex; align-items: center; gap: var(--sp-3); }
.bl-label { font-size: 11.5px; color: var(--text-2); min-width: 74px; letter-spacing: .04em; }
.bl-track { flex: 1; height: 8px; border-radius: var(--r-pill); background: var(--surface-2); box-shadow: inset 0 1px 2px rgba(60, 48, 30, .1); overflow: hidden; }
.bl-fill { display: block; height: 100%; border-radius: var(--r-pill); animation: barGrow 620ms var(--ease-out) both; transform-origin: left; }
@keyframes barGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.bl-num { font-size: 13px; min-width: 26px; text-align: right; font-variant-numeric: tabular-nums; }

.ring-wrap { position: relative; display: grid; place-items: center; flex-shrink: 0; }
.ring { width: 100%; height: 100%; }
.ring-arc { transition: stroke-dasharray var(--dur-slow) var(--ease-out); }
.ring-text { position: absolute; display: flex; flex-direction: column; align-items: center; width: 128%; text-align: center; }
.ring-num { font-size: 26px; font-weight: 600; font-family: var(--font-en); line-height: 1.15; font-variant-numeric: tabular-nums; }
.ring-sub { font-size: 10.5px; color: var(--text-3); white-space: nowrap; line-height: 1.3; }

/* 热力图 */
.cal-wrap { --cal-cell: 12px; --cal-gap: 3px; overflow-x: auto; padding-bottom: var(--sp-2); }
.cal-empty { padding: var(--sp-5); text-align: center; }

.cal-months { display: flex; align-items: flex-end; margin-bottom: 4px; }
.cal-month-gutter { width: 20px; flex-shrink: 0; }
.cal-month-track { display: flex; gap: var(--cal-gap); }
.cal-month { font-size: 10px; color: var(--text-3); white-space: nowrap; letter-spacing: .06em; }

.cal-main { display: flex; gap: 0; }
.cal-wds { display: flex; flex-direction: column; gap: var(--cal-gap); width: 20px; flex-shrink: 0; }
.cal-wd { height: var(--cal-cell); font-size: 9px; line-height: var(--cal-cell); color: var(--text-3); text-align: left; }

.cal-grid { display: flex; gap: var(--cal-gap); }
.cal-col { display: flex; flex-direction: column; gap: var(--cal-gap); }

.cal-day {
  width: var(--cal-cell);
  height: var(--cal-cell);
  border-radius: 3px;
  background: var(--surface-2);
  box-shadow: inset 0 1px 1px rgba(60, 48, 30, .06);
  transition: transform var(--dur-fast) var(--ease-out);
}
.cal-day:hover { transform: scale(1.35); }
.cal-day.cal-blank { background: transparent; box-shadow: none; }

.cal-day.i0 { background: var(--surface-2); }
.cal-day.i1 { background: #EBC9C2; }
.cal-day.i2 { background: #D08C80; }
.cal-day.i3 { background: #B85A4A; }
.cal-day.i4 { background: var(--primary); }

.cal-legend { display: flex; align-items: center; gap: 5px; margin-top: var(--sp-3); padding-left: 20px; }

.cal-dot { width: 10px; height: 10px; border-radius: 3px; }
.cal-dot.i0 { background: var(--surface-2); }
.cal-dot.i1 { background: #EBC9C2; }
.cal-dot.i2 { background: #D08C80; }
.cal-dot.i3 { background: #B85A4A; }
.cal-dot.i4 { background: var(--primary); }

/* ==================== 设置 ==================== */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }

.fp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; }
.fp { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: var(--r); background: var(--surface-1); box-shadow: inset 0 1px 2px rgba(60, 48, 30, .05); }
.fp-k { font-size: 10.5px; color: var(--text-3); }
.fp-v { font-size: 21px; font-weight: 600; font-family: var(--font-en); font-variant-numeric: tabular-nums; }
.fp-v.warn { color: var(--warn); }

.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }

.ach-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px;
  border-radius: var(--r);
  border: 1px solid var(--line-soft);
  background: var(--surface-1);
  text-align: left;
  opacity: .55;
  transition: opacity var(--dur) var(--ease-out), box-shadow var(--dur);
}

.ach-item.on {
  opacity: 1;
  background: linear-gradient(180deg, #FFFDF7, #FBF2DC);
  border-color: #E9D7AE;
  box-shadow: var(--inner-light), 0 1px 2px rgba(169, 118, 27, .12);
}

:root[data-theme='dark'] .ach-item.on { background: linear-gradient(180deg, #2C2418, #262014); }

.ach-icon { font-size: 20px; line-height: 1.2; filter: grayscale(1); }
.ach-item.on .ach-icon { filter: none; }
.ach-name { font-size: 13px; font-weight: 600; }
.ach-desc { font-size: 11px; line-height: 1.5; }

.about-card { text-align: center; }

/* ==================== 深色覆写 ====================
   浅色里那几块「带颜色的纸」（评分块、提示条、错误行）在深色下
   必须换成暗底，否则会亮成一片白。 */
:root[data-theme='dark'] .rate-forgot { background: #33201C; border-color: #4A2E28; }
:root[data-theme='dark'] .rate-hard   { background: #2E2618; border-color: #443820; }
:root[data-theme='dark'] .rate-good   { background: #1C2A33; border-color: #2A3D4A; }
:root[data-theme='dark'] .rate-easy   { background: #17261F; border-color: #25402F; }

:root[data-theme='dark'] .notice.err  { background: #3A2320; border-color: #4A2E28; }
:root[data-theme='dark'] .notice.warn { background: #33280F; border-color: #443820; }
:root[data-theme='dark'] .notice.gold { background: var(--gold-soft); border-color: #443820; }

:root[data-theme='dark'] .batch-item.err { background: #2A1D1A; }
:root[data-theme='dark'] .leech-chip:hover { background: #33280F; }
:root[data-theme='dark'] .rb-diff.ok { background: #16241F; border-color: #25402F; }
:root[data-theme='dark'] .rb-mnemonic { background: var(--gold-soft); }

:root[data-theme='dark'] .cal-day.i1 { background: #4A2E28; }
:root[data-theme='dark'] .cal-day.i2 { background: #7A3A30; }
:root[data-theme='dark'] .cal-day.i3 { background: #A94A3D; }
:root[data-theme='dark'] .cal-dot.i1 { background: #4A2E28; }
:root[data-theme='dark'] .cal-dot.i2 { background: #7A3A30; }
:root[data-theme='dark'] .cal-dot.i3 { background: #A94A3D; }

/* ==================== 响应式 ==================== */

@media (min-width: 901px) {
  .read-bar, .rs-fold, .read-card { max-width: 780px; margin-left: auto; margin-right: auto; }
  .read-bar { margin-bottom: var(--sp-4); }
}

@media (max-width: 980px) {
  .cols-2 { grid-template-columns: minmax(0, 1fr); }
  .rev-side { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
}

@media (max-width: 900px) {
  .stats-grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
  .dash-hello { align-items: flex-start; gap: var(--sp-3); }
  .dh-name { font-size: 34px; }
  .dh-streak { width: 100%; justify-content: flex-start; }
  .dash-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .stat-card { padding: 14px; gap: 6px; }
  .s-ico { width: 26px; height: 26px; border-radius: 8px; }
  .s-ico svg { width: 14px; height: 14px; }
  .s-label { font-size: 11px; }
  .s-num { font-size: 26px; }
  .s-note { font-size: 11px; }
  .today-grid { grid-template-columns: repeat(2, 1fr); }
  .rev-side { display: none; }   /* 手机上顶部的进度与计数已经够了，右栏只会挤走卡片 */
  .rev-rate { grid-template-columns: repeat(2, 1fr); }
  .rev-rate .rate { min-height: 60px; }
  /* 手机上四档评分吸在底栏上方：卡片再长也不用滑到底才能打分 */
  .rev-rate {
    position: sticky;
    bottom: calc(62px + env(safe-area-inset-bottom, 0px));
    z-index: 3;
    margin-top: var(--sp-4);
    padding: var(--sp-2) 0 4px;
    background: linear-gradient(180deg, rgba(255, 252, 246, 0) 0%, var(--surface) 32%);
  }
  :root[data-theme='dark'] .rev-rate {
    background: linear-gradient(180deg, rgba(32, 28, 23, 0) 0%, var(--surface) 32%);
  }
  .rev-done-stats { grid-template-columns: repeat(2, 1fr); }
  .ex-rate { grid-template-columns: 1fr; }
  .rev-card { padding: var(--sp-6) var(--sp-4) var(--sp-5); min-height: 360px; }
  .rev-card::before { left: 14px; right: 14px; }
  .rev-word { font-size: 46px; }
  .rb-word { font-size: 30px; }
  .rb-mean { font-size: 20px; }
  .q-word { font-size: 46px; }
  .q-card { min-height: 240px; padding: var(--sp-6) var(--sp-4); }
  .w-word { font-size: 34px; }
  .lib-grid { grid-template-columns: 1fr; }
  .cfg-label { min-width: 68px; }
  .paper { padding: 12mm 8mm; }
  .ak-list { column-count: 1; }
  .wcard-body, .wcard-head, .wcard-foot { padding-left: var(--sp-4); padding-right: var(--sp-4); }
  .rp-input { font-size: 22px; min-height: 54px; }
  .rd-deva { font-size: 19px; }

  /* 手机上筛选条横向滑动 */
  .lib-sorts, .chip-row, .letter-rail {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .lib-sorts::-webkit-scrollbar, .chip-row::-webkit-scrollbar, .letter-rail::-webkit-scrollbar { display: none; }
  .lib-sorts > *, .chip-row > *, .letter-rail > * { flex: 0 0 auto; }

  .rc-body { padding: var(--sp-4); gap: var(--sp-4); }
  .rc-hi { font-size: 23px; line-height: 2; }
  .rc-head, .rc-nav { padding-left: var(--sp-4); padding-right: var(--sp-4); }
  .rc-nav .btn { min-height: 42px; }
  .rs-list { max-height: 42vh; }
}
