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

/* ==================== 背景装饰 ==================== */
.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);
  /* 注意：呼吸动画必须挂在**内层 svg** 上。
     若挂在本元素，keyframes 里的 opacity 会覆盖上面这一行，
     导致浅色主题下的 3.5% 变成 55%~100%，背景直接糊成一团。 */
}

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

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

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

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

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

.dh-name {
  font-size: 34px;
  font-weight: 600;
  color: var(--primary);
  line-height: 1.3;
}

.dh-greet { font-family: var(--font-zh); font-size: 19px; margin-top: 2px; }
.dh-date { margin-top: 4px; }

.dh-streak {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r);
  background: var(--surface);
  border: 1px solid var(--line);
}

.dh-flame { font-size: 20px; }
.dh-streak-num { font-size: 26px; font-weight: 600; color: var(--gold); }
.dh-streak-sub { margin-left: var(--sp-1); }

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

.stat-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  padding: var(--sp-5);
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--primary);
}

.stat-card.c2::after { background: var(--accent); }
.stat-card.c3::after { background: var(--gold); }

.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.s-label { font-size: 12.5px; color: var(--text-2); }
.s-num { font-size: 32px; font-weight: 600; line-height: 1.15; }
.s-note { font-size: 11.5px; color: var(--text-3); }

.dash-today { margin-bottom: var(--sp-5); }

.today-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-3); }

.today-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--sp-3);
  background: var(--surface-1);
  border-radius: var(--r-sm);
}

.tc-num { font-size: 22px; font-weight: 600; font-family: var(--font-en); }
.tc-label { font-size: 11.5px; color: var(--text-3); }

.trend-card { margin-bottom: var(--sp-5); }

.dash-quick {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin-bottom: var(--sp-5);
}

/* ==================== 查词 ==================== */
.search-box {
  display: flex;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}

.search-box .input { flex: 1; font-size: 17px; }
.hints { margin-bottom: var(--sp-5); }

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

.wcard-head {
  padding: var(--sp-6) var(--sp-6) var(--sp-5);
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, var(--surface-1), var(--surface));
}

.w-word {
  font-size: 40px;
  font-weight: 600;
  line-height: 1.6;
  word-break: break-word;
}

.w-tags { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-top: var(--sp-3); }

.w-translit {
  margin-top: var(--sp-2);
  font-family: var(--font-en);
  font-size: 15px;
  color: var(--text-2);
  letter-spacing: .04em;
}

.w-pron { font-size: 13.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: 11.5px;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--text-3);
  margin-bottom: var(--sp-3);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.w-sec-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--line), transparent);
}

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

.w-mnemonic {
  padding: var(--sp-3) var(--sp-4);
  background: var(--gold-soft);
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: 14.5px;
  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: var(--sp-1) var(--sp-3); border-radius: var(--r-sm); }
.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: 13.5px; color: var(--text-2); line-height: 1.75; }

.w-example {
  padding: var(--sp-3) 0;
  border-bottom: 1px dashed var(--line-soft);
}
.w-example:last-child { border-bottom: none; }
.ex-hi { font-size: 17px; line-height: 1.95; }
.ex-zh { font-size: 13.5px; 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: var(--sp-2) var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  transition: all var(--dur-fast) var(--ease-out);
}

.rel-chip:hover { border-color: var(--primary); background: var(--primary-soft); }
.rel-label { font-size: 10px; color: var(--text-3); font-weight: 700; }
.r-deva { font-family: var(--font-deva); font-size: 16px; }
.rel-mean { font-size: 12px; 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: 12.5px; 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-4);
  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: 18px; }
.wrow-mean { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wrow-right { display: flex; gap: var(--sp-2); align-items: center; }

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

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

.q-word { font-size: 52px; font-weight: 600; text-align: center; line-height: 1.5; }
.q-translit { font-family: var(--font-en); font-size: 17px; color: var(--text-3); }
.q-hint { text-align: center; margin-bottom: var(--sp-5); }
.q-actions { display: flex; gap: var(--sp-3); justify-content: center; flex-wrap: wrap; }

/* ==================== 复习 ==================== */
.rev-wrap { max-width: 760px; margin: 0 auto; }
.rev-progress-bar { margin-bottom: var(--sp-5); }
.rev-progress-meta { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-2); margin-top: var(--sp-2); }

.rev-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow);
  padding: var(--sp-7) var(--sp-6);
  min-height: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4);
  text-align: center;
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur);
}

.rev-front { cursor: pointer; }
.rev-front:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.rev-lotus { width: 64px; height: 64px; color: var(--primary); opacity: .38; }
.rev-lotus svg { width: 100%; height: 100%; animation: lotusBloom 5s var(--ease-in-out) infinite; }

.rev-word { font-size: 54px; font-weight: 600; line-height: 1.45; word-break: break-word; }
.rev-translit { font-family: var(--font-en); font-size: 17px; color: var(--text-3); }
.rev-tap { font-size: 13px; color: var(--text-3); margin-top: var(--sp-3); }

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

.rb-word { font-size: 40px; font-weight: 600; }
.rb-mean { font-size: 21px; font-family: var(--font-zh); line-height: 1.7; }
.rb-mean-en { font-size: 14px; color: var(--text-3); }
.rb-meta { display: flex; gap: var(--sp-2); flex-wrap: wrap; justify-content: center; }

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

.rb-example {
  max-width: 56ch;
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface-1);
  border-radius: var(--r-sm);
  text-align: left;
  font-size: 16px;
  line-height: 1.95;
}

.rev-rate {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-3);
  width: 100%;
  margin-top: var(--sp-4);
}

.rate {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--sp-3) var(--sp-2);
  min-height: 66px;
  border-radius: var(--r);
}

.rate-label { font-size: 15px; font-weight: 600; }
.rate-interval { font-size: 11.5px; opacity: .8; font-family: var(--font-en); }
.rate-key {
  position: absolute; top: 4px; right: 7px;
  font-size: 10px; opacity: .4; font-family: var(--font-mono);
}

.rate-forgot { border-color: color-mix(in srgb, var(--err) 40%, transparent); color: var(--err); }
.rate-forgot:hover { background: color-mix(in srgb, var(--err) 10%, transparent); }
.rate-hard { border-color: color-mix(in srgb, var(--warn) 40%, transparent); color: var(--warn); }
.rate-hard:hover { background: color-mix(in srgb, var(--warn) 10%, transparent); }
.rate-good { border-color: color-mix(in srgb, var(--accent) 40%, transparent); color: var(--accent); }
.rate-good:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.rate-easy { border-color: color-mix(in srgb, var(--gold) 45%, transparent); color: var(--gold); }
.rate-easy:hover { background: var(--gold-soft); }

.rev-hint { text-align: center; margin-top: var(--sp-5); }
kbd {
  display: inline-block;
  padding: 1px 6px;
  margin: 0 2px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: var(--r-xs);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 11px;
}

.rev-done-wrap {
  max-width: 620px;
  margin: 0 auto;
  text-align: center;
  padding: var(--sp-7) var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.rev-done-burst { font-size: 52px; animation: goldBurst 1.1s var(--ease-out) both; display: inline-block; }
.rev-done-title { font-size: 24px; margin: var(--sp-3) 0; }
.rev-done-sub { color: var(--text-2); margin-bottom: var(--sp-5); }

.rev-done-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-3); margin-bottom: var(--sp-5); }
.rstat { padding: var(--sp-3); border-radius: var(--r-sm); background: var(--surface-1); }
.rstat-num { display: block; font-size: 24px; font-weight: 600; font-family: var(--font-en); }
.rstat-label { font-size: 11.5px; color: var(--text-3); }
.rstat.rate-forgot .rstat-num { color: var(--err); }
.rstat.rate-hard .rstat-num { color: var(--warn); }
.rstat.rate-good .rstat-num { color: var(--accent); }
.rstat.rate-easy .rstat-num { color: var(--gold); }

.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;
  min-width: 34px;
  padding: var(--sp-1) 5px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: 15px;
  transition: all var(--dur-fast);
}

.letter-btn:hover { background: var(--surface-1); }
.letter-btn.on { background: var(--primary-soft); color: var(--primary-ink); border-color: var(--primary); }
.letter-n { font-size: 9.5px; color: var(--text-3); }

.lib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: var(--sp-4);
}

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

.lib-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.lc-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-2); }
.lc-deva { font-size: 22px; line-height: 1.6; word-break: break-word; }
.lc-mean { font-size: 13.5px; 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: auto; padding-top: var(--sp-2); border-top: 1px solid 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: 1px solid var(--line);
  border-radius: var(--r-sm);
  margin-bottom: var(--sp-2);
  background: var(--surface);
}

.batch-item.ok  { border-left: 3px solid var(--accent); }
.batch-item.err { border-left: 3px solid var(--err); background: color-mix(in srgb, var(--err) 5%, var(--surface)); }
.batch-item.pending { border-left: 3px solid var(--line-strong); opacity: .7; }

.bi-no { font-size: 12px; color: var(--text-3); min-width: 20px; }
.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: 13px; color: var(--text-2); }
.bi-status { color: var(--text-3); }
.batch-item.err .bi-status { color: var(--err); }
.bi-act { display: flex; gap: 2px; }

/* ==================== 课文 ==================== */
.lesson-list { display: flex; flex-direction: column; gap: var(--sp-4); }

.lesson-card {
  padding: var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur);
}
.lesson-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.lc-head { display: flex; align-items: center; gap: var(--sp-3); }
.lesson-title { font-size: 19px; flex: 1; }
.lesson-sub { margin-top: 4px; }
.lesson-acts { display: flex; gap: var(--sp-2); margin-top: var(--sp-4); flex-wrap: wrap; }

.read-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-5); align-items: start; }

.rs-list { display: flex; flex-direction: column; gap: var(--sp-2); }

.rs-item {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  text-align: left;
  transition: all var(--dur-fast);
}

.rs-item:hover { background: var(--surface-1); }
.rs-item.cur { background: var(--primary-soft); border-color: var(--primary); }
.rs-no { font-size: 11px; color: var(--text-3); min-width: 16px; padding-top: 4px; }
.rs-hi { font-size: 17px; line-height: 1.95; }

.read-right {
  position: sticky;
  top: calc(var(--topbar-h) + var(--sp-4));
  padding: var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  max-height: calc(100dvh - var(--topbar-h) - var(--sp-8));
  overflow-y: auto;
}

.rp-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-4); }
.rp-block { margin-bottom: var(--sp-5); }
.rp-label { font-size: 11px; font-weight: 700; letter-spacing: .14em; color: var(--text-3); margin-bottom: var(--sp-2); }
.rp-hi { font-size: 19px; line-height: 2; }
.rp-zh { font-size: 15px; color: var(--text-2); line-height: 1.8; }
.rp-tense-name { font-weight: 600; margin-bottom: var(--sp-2); }
.rp-kw { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-bottom: var(--sp-2); }
.rp-frame { font-size: 13.5px; color: var(--text-2); }

.rp-kv { display: flex; gap: var(--sp-3); padding: var(--sp-2) 0; border-bottom: 1px dashed var(--line-soft); align-items: baseline; }
.kv-deva { font-size: 17px; min-width: 90px; }
.kv-link { color: var(--primary); text-align: left; }
.kv-link:hover { text-decoration: underline; }
.kv-mean { font-size: 13.5px; color: var(--text-2); flex: 1; }
.rp-empty { padding: var(--sp-3); background: var(--surface-1); border-radius: var(--r-sm); }

/* ==================== 背诵 ==================== */
.recite-top { margin-bottom: var(--sp-4); }
.recite-levels { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-bottom: var(--sp-5); }

.recite-card {
  padding: var(--sp-7) var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  text-align: center;
  margin-bottom: var(--sp-5);
}

.recite-sentence { font-family: var(--font-deva); font-size: 27px; line-height: 2.4; }

.blank {
  display: inline-block;
  min-width: 74px;
  border-bottom: 1.5px solid var(--text-3);
  margin: 0 3px;
  vertical-align: baseline;
  transition: all var(--dur) var(--ease-out);
}

.blank.revealed {
  border-bottom-color: var(--accent);
  color: var(--accent);
  min-width: auto;
  background: var(--accent-soft);
  border-radius: var(--r-xs);
  padding: 0 4px;
}

.blank.full { display: block; width: 100%; min-height: 1.9em; }
.blank.full.revealed { display: block; background: var(--accent-soft); padding: var(--sp-2) var(--sp-4); border-radius: var(--r-sm); border-bottom: none; }

.recite-trans { margin-top: var(--sp-4); font-size: 15px; color: var(--text-2); }
.recite-prog { margin-top: var(--sp-3); }

.recite-rate { display: flex; gap: var(--sp-3); margin-bottom: var(--sp-5); flex-wrap: wrap; }
.recite-rate .btn { flex: 1; min-width: 120px; min-height: 56px; flex-direction: column; gap: 2px; }
.rr-sub { font-size: 11.5px; opacity: .75; }

.recite-nav { display: flex; gap: var(--sp-2); flex-wrap: wrap; }

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

.ex-qcard {
  padding: var(--sp-6);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  margin-bottom: var(--sp-5);
}

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

.ex-answer {
  padding: var(--sp-5);
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--r) var(--r) 0;
  margin-bottom: var(--sp-5);
  animation: riseIn var(--dur) var(--ease-out) both;
}

.ex-answer-label { font-size: 11.5px; font-weight: 700; letter-spacing: .14em; color: var(--accent); margin-bottom: var(--sp-3); }
.ex-answer-body { font-size: 19px; line-height: 2; }
.ex-explain { margin-top: var(--sp-4); padding-top: var(--sp-4); border-top: 1px dashed var(--line); font-size: 14px; 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: var(--sp-3); margin-bottom: var(--sp-5); }

.mistake-list { display: flex; flex-direction: column; gap: var(--sp-4); }

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

.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: 13.5px; 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: 12.5px; font-weight: 600; color: var(--text-2); min-width: 76px; }
.cfg-num { width: 88px; min-height: 36px; padding: var(--sp-2) var(--sp-3); }
.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: #fffdf8;
  color: #1a1a1a;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-lg);
  padding: 22mm 18mm;
  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 #1a1a1a;
  margin-bottom: var(--sp-4);
  flex-wrap: wrap;
}

.ph-title { font-family: var(--font-zh); font-size: 20px; font-weight: 700; }
.ph-meta { display: flex; gap: var(--sp-5); font-size: 12px; color: #555; }

.ph-quote {
  text-align: center;
  font-size: 15px;
  line-height: 2;
  color: #444;
  padding: var(--sp-3) 0 var(--sp-4);
  border-bottom: 1px dashed #bbb;
  margin-bottom: var(--sp-4);
}
.ph-quote-zh { display: block; font-size: 12.5px; color: #777; margin-top: 4px; font-family: var(--font-zh); }

.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: 13px; font-weight: 700; min-width: 22px; padding-top: 3px; }
.d-body { flex: 1; min-width: 0; }
.d-prompt { font-size: 16px; line-height: 1.9; }
.d-hint { font-size: 11.5px; color: #888; margin-top: 2px; }

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

.paper-foot { text-align: center; font-size: 11px; color: #999; margin-top: var(--sp-5); }

.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: 14px; align-items: baseline; }
.ak-no { font-size: 11px; color: #888; min-width: 20px; }
.ak-ans { font-family: var(--font-deva); font-size: 16px; }
.ak-sub { font-size: 11.5px; color: #888; }

/* ==================== 统计 ==================== */
.stats-top { display: flex; gap: var(--sp-6); align-items: center; margin-bottom: var(--sp-5); flex-wrap: wrap; }
/* 固定 3 列：6 项正好排成 3×2，不会出现 5+1 的孤行 */
.stats-top-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3); flex: 1; min-width: 300px; }

.fact { display: flex; flex-direction: column; gap: 2px; padding: var(--sp-3); background: var(--surface-1); border-radius: var(--r-sm); }
.fact-k { font-size: 11.5px; color: var(--text-3); }
.fact-v { font-size: 21px; font-weight: 600; font-family: var(--font-en); }
.fact-v.warn { color: var(--warn); }

.stats-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); margin-bottom: var(--sp-4); }

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

.leech-card { border-left: 3px solid var(--warn); }
.leech-list { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.leech-chip {
  display: inline-flex; align-items: baseline; gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); transition: all var(--dur-fast);
}
.leech-chip:hover { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 8%, var(--surface)); }
.leech-chip .deva { font-size: 16px; }
.leech-n { font-size: 10.5px; color: var(--err); }

/* ==================== 图表 ==================== */
.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: .78; }

.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: 13px;
  border: 1px dashed var(--line-strong); border-radius: var(--r);
}

.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: 12.5px; color: var(--text-2); min-width: 74px; }
.bl-track { flex: 1; height: 9px; background: var(--surface-2); border-radius: var(--r-pill); 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: 14px; min-width: 28px; text-align: right; }

.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: 25px; font-weight: 600; font-family: var(--font-en); line-height: 1.15; }
.ring-sub { font-size: 10.5px; color: var(--text-3); white-space: nowrap; line-height: 1.3; }

.cal-wrap { overflow-x: auto; padding-bottom: var(--sp-2); }
.cal-grid { display: flex; gap: 3px; }
.cal-col { display: flex; flex-direction: column; gap: 3px; }
.cal-day { width: 11px; height: 11px; border-radius: 2px; background: var(--surface-2); }
.cal-day.i0 { background: var(--surface-2); }
.cal-day.i1 { background: color-mix(in srgb, var(--accent) 28%, var(--surface-2)); }
.cal-day.i2 { background: color-mix(in srgb, var(--accent) 55%, var(--surface-2)); }
.cal-day.i3 { background: color-mix(in srgb, var(--accent) 80%, var(--surface-2)); }
.cal-day.i4 { background: var(--accent); }
.cal-legend { display: flex; align-items: center; gap: 5px; margin-top: var(--sp-3); }
.cal-dot { width: 10px; height: 10px; border-radius: 2px; }
.cal-dot.i0 { background: var(--surface-2); }
.cal-dot.i1 { background: color-mix(in srgb, var(--accent) 28%, var(--surface-2)); }
.cal-dot.i2 { background: color-mix(in srgb, var(--accent) 55%, var(--surface-2)); }
.cal-dot.i3 { background: color-mix(in srgb, var(--accent) 80%, var(--surface-2)); }
.cal-dot.i4 { background: var(--accent); }

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

.fp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: var(--sp-3); }
.fp { display: flex; flex-direction: column; gap: 2px; padding: var(--sp-3); background: var(--surface-1); border-radius: var(--r-sm); }
.fp-k { font-size: 11.5px; color: var(--text-3); }
.fp-v { font-size: 19px; font-weight: 600; font-family: var(--font-en); }
.fp-v.warn { color: var(--warn); }

.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: var(--sp-3); }

.ach-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: var(--sp-4) var(--sp-3);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface-1); text-align: center; opacity: .5;
  transition: all var(--dur) var(--ease-out);
}
.ach-item.on { opacity: 1; background: var(--gold-soft); border-color: var(--gold); }
.ach-icon { font-size: 24px; }
.ach-name { font-size: 13.5px; font-weight: 600; }
.ach-desc { line-height: 1.5; }

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

/* ==================== 通用小件 ==================== */
.mb-3 { margin-bottom: var(--sp-3); }
.mb-4 { margin-bottom: var(--sp-4); }
.ghost-tag { background: transparent; border: 1px solid var(--line); }

/* ==================== 响应式 ==================== */
@media (max-width: 900px) {
  .read-wrap { grid-template-columns: 1fr; }
  .read-right { position: static; max-height: none; }
  .stats-grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
  .dash-stats { grid-template-columns: 1fr; }
  .today-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-hello { padding: var(--sp-3) 0 var(--sp-5); }
  .dh-name { font-size: 28px; }
  .rev-rate { grid-template-columns: repeat(2, 1fr); }
  .rev-done-stats { grid-template-columns: repeat(2, 1fr); }
  .ex-rate { grid-template-columns: 1fr; }
  .rev-word { font-size: 42px; }
  .w-word { font-size: 32px; }
  .q-word { font-size: 40px; }
  .lib-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .cfg-label { min-width: 60px; font-size: 12px; }
  .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); }
}
