/* ============================================================
   app.css — 设计令牌 + 组件
   移动优先；只有一套结构，深浅色只换令牌。
   ============================================================ */

/* ---------- 1. 令牌 ---------- */
:root {
  /* 色彩：语义命名 */
  --bg: #F3F3F6;
  --surface: #FFFFFF;
  --surface-2: #FBFBFD;
  --surface-3: #EFEFF3;
  --border: #E4E4EB;
  --border-strong: #CACAD5;
  --text: #17171C;
  --text-2: #3F3F4B;
  --text-muted: #666674;
  --primary: #5348D6;
  --primary-ink: #FFFFFF;
  --primary-press: #3F35B8;
  --primary-soft: #EDEBFD;
  --success: #0B7343;
  --success-soft: #E4F5EC;
  --danger: #BE2A1C;
  --danger-soft: #FCEAE8;
  --warning: #855100;
  --warning-soft: #FFF2DC;

  /* 尺寸 */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;

  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-base: 16px;
  --fs-md: 18px;
  --fs-lg: 22px;
  --fs-xl: 28px;
  --fs-2xl: 34px;

  --lh-tight: 1.2;
  --lh-normal: 1.55;

  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  --shadow-1: 0 1px 2px rgba(20, 20, 33, .06), 0 1px 3px rgba(20, 20, 33, .05);
  --shadow-2: 0 10px 30px rgba(20, 20, 33, .12);

  --dur-1: 120ms;
  --dur-2: 200ms;
  --dur-3: 320ms;
  --ease: cubic-bezier(.2, .8, .2, 1);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Noto Sans SC", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-en: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E0E13;
    --surface: #17171F;
    --surface-2: #1D1D26;
    --surface-3: #24242F;
    --border: #2B2B37;
    --border-strong: #3C3C4B;
    --text: #F3F3F7;
    --text-2: #CFCFDA;
    --text-muted: #9C9CAC;
    --primary: #9A8CFF;
    --primary-ink: #17132B;
    --primary-press: #B0A4FF;
    --primary-soft: #262046;
    --success: #4FD69B;
    --success-soft: #11301F;
    --danger: #FF9184;
    --danger-soft: #391713;
    --warning: #F2C266;
    --warning-soft: #33260C;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .5);
    --shadow-2: 0 10px 30px rgba(0, 0, 0, .6);
  }
}

/* ---------- 2. 基础 ---------- */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

body { min-height: 100dvh; }

button { font-family: inherit; font-size: inherit; color: inherit; }

h1, h2, h3, p { margin: 0; }

:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- 3. 应用骨架 ---------- */
.app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100dvh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
}

@media (min-width: 768px) {
  body { background: var(--surface-3); }
  .app {
    box-shadow: 0 0 0 1px var(--border), var(--shadow-2);
    min-height: 100dvh;
  }
}

.view {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(var(--sp-5) + env(safe-area-inset-bottom, 0px));
  animation: view-in var(--dur-3) var(--ease);
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .view { animation: none; }
  * { transition-duration: 1ms !important; animation-duration: 1ms !important; }
}

/* ---------- 4. 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-height: 56px;
  padding: var(--sp-2) var(--sp-4);
  padding-top: calc(var(--sp-2) + env(safe-area-inset-top, 0px));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-2) var(--ease);
}
.topbar.is-scrolled { border-bottom-color: var(--border); }

.topbar__title {
  font-size: var(--fs-md);
  font-weight: 650;
  letter-spacing: -.01em;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar__sub {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  font-weight: 400;
  display: block;
}

/* 标题当按钮用（点一下改名） */
.topbar__title--btn {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  background: transparent;
  border: 0;
  padding: var(--sp-1) var(--sp-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
  font-size: var(--fs-md);
  font-weight: 650;
  transition: background var(--dur-1) var(--ease);
}
.topbar__title--btn:hover { background: var(--surface-3); }
.rename-pen { display: flex; flex: none; color: var(--text-muted); opacity: .7; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  flex: none;
  transition: background var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn:active { transform: scale(.94); }
.icon-btn--solid { background: var(--surface); box-shadow: var(--shadow-1); }

/* ---------- 5. 内容容器 ---------- */
.content {
  padding: var(--sp-3) var(--sp-4) 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.section-title {
  font-size: var(--fs-sm);
  font-weight: 650;
  color: var(--text-muted);
  letter-spacing: .04em;
  padding: 0 var(--sp-1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
}

/* ---------- 6. 卡片 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  box-shadow: var(--shadow-1);
}

.card--flat { box-shadow: none; }

/* 今日统计卡 */
.today {
  background: var(--primary);
  color: var(--primary-ink);
  border: 0;
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-2);
}
.today::after {
  content: "";
  position: absolute;
  right: -46px; top: -60px;
  width: 190px; height: 190px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  pointer-events: none;
}
.today__eyebrow {
  font-size: var(--fs-sm);
  opacity: .82;
  font-weight: 500;
}
.today__num {
  font-size: var(--fs-2xl);
  font-weight: 720;
  line-height: 1.05;
  letter-spacing: -.02em;
}
.today__num small {
  font-size: var(--fs-sm);
  font-weight: 500;
  opacity: .82;
  margin-left: var(--sp-2);
  letter-spacing: 0;
}
.today__row { display: flex; gap: var(--sp-5); }
.today__stat { display: flex; flex-direction: column; gap: 2px; }
.today__stat b { font-size: var(--fs-md); font-weight: 650; }
.today__stat span { font-size: var(--fs-xs); opacity: .78; }

.today .btn--on-primary {
  background: rgba(255, 255, 255, .16);
  color: var(--primary-ink);
  border: 1px solid rgba(255, 255, 255, .3);
}
.today .btn--on-primary:hover { background: rgba(255, 255, 255, .24); }

/* ---------- 7. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 48px;
  padding: 0 var(--sp-4);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: var(--surface-3);
  color: var(--text);
  font-size: var(--fs-base);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--dur-1) var(--ease), transform var(--dur-1) var(--ease), opacity var(--dur-1);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn--block { width: 100%; }
.btn--lg { min-height: 54px; font-size: var(--fs-md); border-radius: var(--radius-lg); }
.btn--sm { min-height: 38px; font-size: var(--fs-sm); padding: 0 var(--sp-3); border-radius: var(--radius-sm); }
/* 区块标题里的小按钮 */
.btn--xs { min-height: 36px; font-size: var(--fs-xs); padding: 0 var(--sp-3); border-radius: var(--radius-xs); font-weight: 600; gap: var(--sp-1); }

.btn--primary { background: var(--primary); color: var(--primary-ink); box-shadow: var(--shadow-1); }
.btn--primary:hover { background: var(--primary-press); }

.btn--ghost { background: transparent; border-color: var(--border-strong); color: var(--text-2); }
.btn--ghost:hover { background: var(--surface-3); }

.btn--soft { background: var(--primary-soft); color: var(--primary); }
.btn--soft:hover { background: color-mix(in srgb, var(--primary-soft) 70%, var(--primary) 12%); }

.btn--danger { background: var(--danger-soft); color: var(--danger); }
.btn--danger:hover { background: color-mix(in srgb, var(--danger-soft) 80%, var(--danger) 10%); }

.btn--success { background: var(--success); color: #fff; }
.btn--cancel { background: var(--surface-3); color: var(--text-2); }

/* 底部主行动条 */
.actionbar {
  position: sticky;
  bottom: 0;
  z-index: 15;
  margin-top: auto;
  padding: var(--sp-3) var(--sp-4) calc(var(--sp-4) + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to top, var(--bg) 62%, color-mix(in srgb, var(--bg) 0%, transparent));
  display: flex;
  gap: var(--sp-3);
}

/* ---------- 8. 词库列表 ---------- */
.deck-list { display: flex; flex-direction: column; gap: var(--sp-3); }

.deck {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  text-align: left;
  padding: var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
  cursor: pointer;
  transition: transform var(--dur-1) var(--ease), border-color var(--dur-1);
}
.deck:hover { border-color: var(--border-strong); }
.deck:active { transform: scale(.99); }

.deck__mark {
  width: 44px; height: 44px;
  flex: none;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
  font-size: var(--fs-md);
}
.deck__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.deck__name {
  font-weight: 620;
  font-size: var(--fs-base);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.deck__meta { font-size: var(--fs-xs); color: var(--text-muted); display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.deck__due {
  color: var(--primary);
  font-weight: 600;
  background: var(--primary-soft);
  padding: 1px var(--sp-2);
  border-radius: var(--radius-pill);
}
.deck__arrow { color: var(--text-muted); flex: none; display: flex; }

.bar {
  height: 5px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--text) 12%, transparent);
  overflow: hidden;
  margin-top: var(--sp-2);
}
.bar__fill {
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width var(--dur-3) var(--ease);
}

/* ---------- 9. 空状态 ---------- */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--sp-3);
  padding: var(--sp-6) var(--sp-4);
  color: var(--text-muted);
}
.empty__art {
  width: 72px; height: 72px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
}
.empty__title { color: var(--text); font-weight: 650; font-size: var(--fs-md); }
.empty__text { font-size: var(--fs-sm); max-width: 26em; }

/* ---------- 10. 表单 ---------- */
.field { display: flex; flex-direction: column; gap: var(--sp-2); }
.label { font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); }
.hint { font-size: var(--fs-xs); color: var(--text-muted); }

.input, .textarea, .select {
  width: 100%;
  min-height: 48px;
  padding: var(--sp-3);
  font-family: inherit;
  font-size: var(--fs-base);
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--dur-1), background var(--dur-1);
}
.input::placeholder, .textarea::placeholder { color: var(--text-muted); opacity: .8; }
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.textarea { min-height: 120px; resize: vertical; line-height: var(--lh-normal); font-size: var(--fs-sm); }
.select { appearance: none; background-image: none; }

/* ---------- 11. 拍照 / 导入 ---------- */
.drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-6) var(--sp-4);
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--dur-2), background var(--dur-2);
}
.drop-zone:hover, .drop-zone.is-over { border-color: var(--primary); background: var(--primary-soft); }
.drop-zone__icon {
  width: 60px; height: 60px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary);
}
.drop-zone__title { font-weight: 650; font-size: var(--fs-md); }
.drop-zone__text { font-size: var(--fs-sm); color: var(--text-muted); max-width: 24em; }

.thumbs { display: flex; gap: var(--sp-3); overflow-x: auto; padding-bottom: var(--sp-1); }
.thumb {
  position: relative;
  flex: none;
  width: 88px; height: 88px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-3);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb__x {
  position: absolute; top: 3px; right: 3px;
  width: 24px; height: 24px; min-height: 0;
  padding: 0;
  border-radius: 50%;
  border: 0;
  background: rgba(0, 0, 0, .62);
  color: #fff;
  display: grid; place-items: center;
  cursor: pointer;
}

.progress-panel {
  display: flex; flex-direction: column; gap: var(--sp-3);
  padding: var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.progress-panel__head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.progress-panel__label { font-size: var(--fs-sm); font-weight: 600; }
.progress-panel__pct { font-size: var(--fs-sm); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.progress-panel .bar { height: 8px; margin-top: 0; }
.progress-panel .bar__fill { transition: width var(--dur-2) linear; }

/* 解析校对表 */
.entry-list { display: flex; flex-direction: column; gap: var(--sp-2); }
.entry {
  display: grid;
  grid-template-columns: 22px 1fr 1fr 36px;
  gap: var(--sp-2);
  align-items: center;
}
.entry__idx { font-size: var(--fs-xs); color: var(--text-muted); text-align: right; font-variant-numeric: tabular-nums; }
.entry .input { min-height: 44px; padding: var(--sp-2) var(--sp-3); font-size: var(--fs-sm); }
.entry .input--en { font-family: var(--font-en); font-weight: 600; }
.entry .input.is-warn { border-color: var(--warning); background: var(--warning-soft); }
.entry .input.is-check { border-color: var(--primary); background: var(--primary-soft); }

/* 窄屏：英文一行、释义一行，避免中文被挤成省略号 */
@media (max-width: 430px) {
  .entry {
    grid-template-columns: 20px 1fr 32px;
    grid-template-rows: auto auto;
    row-gap: var(--sp-1);
    align-items: start;
    padding-bottom: var(--sp-2);
    border-bottom: 1px solid var(--border);
  }
  .entry__idx { grid-row: 1 / span 2; padding-top: var(--sp-3); }
  .entry .input--en { grid-column: 2; grid-row: 1; }
  .entry .input:not(.input--en) { grid-column: 2; grid-row: 2; }
  .entry__del { grid-column: 3; grid-row: 1 / span 2; }
}
.entry__del {
  width: 36px; height: 44px;
  border: 0; background: transparent; color: var(--text-muted);
  border-radius: var(--radius-xs); cursor: pointer;
  display: grid; place-items: center;
}
.entry__del:hover { background: var(--danger-soft); color: var(--danger); }

/* ---------- 11b. 文章摘词的选词格子 ---------- */
.wchips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
}

.wchip {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  max-width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.wchip:active { transform: scale(.97); }
/* 长按中：给一个"正在按住"的视觉反馈 */
.wchip.is-pressing {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
  transform: scale(.96);
  transition: transform 120ms var(--ease), box-shadow 120ms var(--ease);
}
.wchip { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.wchip:hover { border-color: var(--border-strong); }

.wchip__head {
  display: flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
}
.wchip__flags { display: inline-flex; gap: 3px; }

.wchip__en {
  font-family: var(--font-en);
  font-weight: 650;
  font-size: var(--fs-base);
  line-height: 1.25;
}
.wchip__zh {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  line-height: 1.3;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 选中态：实心强调 */
.wchip.is-on {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.wchip.is-on .wchip__zh { color: var(--text-2); }
.wchip.is-on::after {
  content: '';
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
}

/* 已经在单词本里：默认不选，弱化显示 */
.wchip.is-known:not(.is-on) { opacity: .55; }

.wchip__flag {
  font-size: 10px;
  line-height: 1.4;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  color: var(--text-muted);
}
.wchip__flag--fix { background: var(--warning-soft); color: var(--warning); }

/* 疑似原形/纠错：一点就采用 */
.wchip__hint {
  margin-top: 2px;
  font-size: var(--fs-xs);
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.wchip__orig {
  font-size: 10px;
  color: var(--text-muted);
  opacity: .8;
}


/* ---------- 11c. 高频词表 ---------- */
.hot-entry {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  margin-top: var(--sp-3);
  padding: var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--dur-1) var(--ease);
}
.hot-entry:hover { border-color: var(--border-strong); }
.hot-entry__icon {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  border-radius: var(--radius-sm);
  background: var(--warning-soft);
  color: var(--warning);
}
.hot-entry__body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.hot-entry__title { font-weight: 650; font-size: var(--fs-base); }
.hot-entry__sub { font-size: var(--fs-xs); color: var(--text-muted); }
.hot-entry__arrow { color: var(--text-muted); flex: none; }

.hot-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.hot-row__main {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.hot-row__en { font-family: var(--font-en); font-weight: 650; }
.hot-row__zh {
  flex: 1; min-width: 0;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hot-row__n {
  flex: none;
  font-size: var(--fs-xs);
  color: var(--warning);
  background: var(--warning-soft);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}
.wchip__flag--hot { background: var(--warning-soft); color: var(--warning); }

/* ---------- 11d. 原文逐行对照 ---------- */
.lines {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin-top: var(--sp-3);
}
.aline {
  padding-left: var(--sp-3);
  border-left: 2px solid var(--primary-soft);
}
.aline--empty { border-left-color: var(--border); opacity: .7; }
.aline__src {
  font-size: var(--fs-sm);
  line-height: 1.5;
  color: var(--text-2);
  word-break: break-word;
  margin-bottom: 6px;
}
.aline__words {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.wchip--sm {
  padding: 4px 9px;
  border-radius: var(--radius-xs);
}
.wchip--sm .wchip__en { font-size: var(--fs-sm); }
.wchip--sm .wchip__zh { font-size: 10px; max-width: 110px; }
.wchip--sm .wchip__flag { font-size: 9px; padding: 0 4px; }
.wchip--sm.is-on::after { width: 6px; height: 6px; top: 5px; right: 5px; }

/* ---------- 11e. 视图切换 ---------- */
.seg {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  margin-top: var(--sp-3);
  border-radius: var(--radius-pill);
  background: var(--surface-3);
}
.seg__btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.seg__btn.is-on {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow-1);
}


/* ---------- 11f. 查词详情：变形 / 搭配 / 近反义词 ---------- */
.detail-block { margin-top: var(--sp-3); }
.detail-block__title {
  font-size: var(--fs-xs);
  font-weight: 650;
  color: var(--text-muted);
  letter-spacing: .02em;
  margin-bottom: 6px;
}
.detail-pairs { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.detail-pair { display: inline-flex; align-items: baseline; gap: 6px; font-size: var(--fs-sm); }
.detail-pair__k { color: var(--text-muted); font-size: var(--fs-xs); }
.detail-pair__v { font-family: var(--font-en); font-weight: 600; }

.kw-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.kw-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  max-width: 100%;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: var(--fs-sm);
  cursor: pointer;
}
.kw-chip:hover { border-color: var(--primary); }
.kw-chip__en { font-family: var(--font-en); font-weight: 600; }
.kw-chip__zh {
  font-size: 11px;
  color: var(--text-muted);
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.phrase-row {
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.phrase-row:hover { border-color: var(--primary); }
.phrase-row__en { font-family: var(--font-en); font-weight: 600; font-size: var(--fs-sm); flex: none; }
.phrase-row__zh {
  flex: 1; min-width: 0;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}


/* ---------- 11g. 裁剪 ---------- */
.crop-wrap {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  background: rgba(10, 10, 14, .94);
  opacity: 0;
  transition: opacity var(--dur-2) var(--ease);
  padding: calc(env(safe-area-inset-top) + 12px) 0 calc(env(safe-area-inset-bottom) + 12px);
}
.crop-wrap.is-on { opacity: 1; }
.crop__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: 0 var(--sp-4) var(--sp-2);
  color: #fff;
}
.crop__title { font-size: var(--fs-base); font-weight: 600; }
.crop__scroll { flex: 1; display: grid; place-items: center; overflow: auto; padding: 0 var(--sp-4); }
.crop__stage {
  position: relative;
  touch-action: none;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #000;
}
.crop__img { display: block; width: 100%; height: 100%; user-select: none; -webkit-user-drag: none; }
.crop__maskpart {
  position: absolute;
  background: rgba(0, 0, 0, .55);
  pointer-events: none;
}
.crop__box {
  position: absolute;
  border: 2px solid #fff;
  border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .35), 0 0 18px rgba(0, 0, 0, .45);
  cursor: move;
  touch-action: none;
}
.crop__handle {
  position: absolute;
  width: 26px;
  height: 26px;
  background: #fff;
  border-radius: 50%;
  border: 2px solid var(--primary);
  touch-action: none;
}
.crop__handle--nw { left: -13px; top: -13px; cursor: nwse-resize; }
.crop__handle--ne { right: -13px; top: -13px; cursor: nesw-resize; }
.crop__handle--sw { left: -13px; bottom: -13px; cursor: nesw-resize; }
.crop__handle--se { right: -13px; bottom: -13px; cursor: nwse-resize; }
.crop__hint {
  text-align: center;
  color: rgba(255, 255, 255, .62);
  font-size: var(--fs-xs);
  padding: var(--sp-2) var(--sp-4) 0;
}
.crop__actions {
  display: flex;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4) 0;
}

/* ---------- 12. 模式选择 ---------- */
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }

.mode {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-4);
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
  cursor: pointer;
  transition: transform var(--dur-1) var(--ease), border-color var(--dur-1);
}
.mode:hover { border-color: var(--primary); }
.mode:active { transform: scale(.985); }
.mode__icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-xs);
  display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary);
}
.mode__name { font-weight: 620; font-size: var(--fs-base); }
.mode__desc { font-size: var(--fs-xs); color: var(--text-muted); line-height: 1.45; }

/* ---------- 13. 练习界面 ---------- */
.study-bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-4);
  padding-top: calc(var(--sp-2) + env(safe-area-inset-top, 0px));
  min-height: 56px;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(12px);
}
.study-bar__count {
  font-size: var(--fs-sm); color: var(--text-muted);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.study-bar .bar { flex: 1; margin-top: 0; height: 6px; }

.study-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--sp-4);
  padding: var(--sp-2) var(--sp-4) var(--sp-5);
}

.study-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
  padding: var(--sp-5) var(--sp-4);
  min-height: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  text-align: center;
}

/* 卡片吃掉剩余高度，但别长成一个巨大的空盒子 */
.study-body > .study-card { flex: 1 1 auto; max-height: 340px; }

.word {
  font-family: var(--font-en);
  font-size: clamp(30px, 11vw, 44px);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.15;
  word-break: break-word;
}
.word--md { font-size: clamp(22px, 7.6vw, 30px); }
.phonetic { font-family: var(--font-en); font-size: var(--fs-base); color: var(--text-muted); }
.meaning { font-size: var(--fs-lg); color: var(--text-2); font-weight: 520; line-height: 1.4; }

.speak-btn {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  min-height: 44px;
  padding: 0 var(--sp-4);
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: var(--fs-sm); font-weight: 600;
  cursor: pointer;
  transition: background var(--dur-1), border-color var(--dur-1), transform var(--dur-1);
}
.speak-btn:hover { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.speak-btn:active { transform: scale(.96); }
.speak-btn.is-speaking { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }

/* 答题输入 */
.answer-area { display: flex; flex-direction: column; gap: var(--sp-3); }
.answer-input {
  width: 100%;
  min-height: 60px;
  padding: var(--sp-3) var(--sp-4);
  font-family: var(--font-en);
  font-size: var(--fs-lg);
  font-weight: 600;
  text-align: center;
  letter-spacing: .02em;
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text);
  transition: border-color var(--dur-1), box-shadow var(--dur-1);
}
.answer-input::placeholder { font-family: var(--font); font-size: var(--fs-base); font-weight: 400; color: var(--text-muted); letter-spacing: 0; }
.answer-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.answer-input.is-ok { border-color: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.answer-input.is-bad { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }

/* 反馈 */
.feedback {
  border-radius: var(--radius-md);
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  animation: pop var(--dur-2) var(--ease);
}
@keyframes pop { from { opacity: 0; transform: scale(.98); } to { opacity: 1; transform: none; } }
.feedback--ok { background: var(--success-soft); color: var(--success); }
.feedback--bad { background: var(--danger-soft); color: var(--danger); }
.feedback__head { display: flex; align-items: center; gap: var(--sp-2); font-weight: 700; }
.feedback__body { color: var(--text-2); font-size: var(--fs-sm); }
.feedback__body b { color: var(--text); font-size: var(--fs-md); font-family: var(--font-en); }

.diff { font-family: var(--font-en); font-size: var(--fs-lg); font-weight: 700; letter-spacing: .02em; word-break: break-all; }
.diff span { color: var(--danger); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.diff span.ok { color: var(--success); text-decoration: none; }

/* 选择题 */
.choices { display: flex; flex-direction: column; gap: var(--sp-2); }
.choice {
  display: flex; align-items: center; gap: var(--sp-3);
  min-height: 54px;
  padding: var(--sp-3) var(--sp-4);
  text-align: left;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--fs-base);
  cursor: pointer;
  transition: border-color var(--dur-1), background var(--dur-1), transform var(--dur-1);
}
.choice:hover { border-color: var(--primary); }
.choice:active { transform: scale(.99); }
.choice__key {
  width: 26px; height: 26px; flex: none;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  color: var(--text-muted);
  display: grid; place-items: center;
  font-size: var(--fs-xs); font-weight: 700;
}
.choice.is-ok { border-color: var(--success); background: var(--success-soft); }
.choice.is-ok .choice__key { background: var(--success); color: #fff; }
.choice.is-bad { border-color: var(--danger); background: var(--danger-soft); }
.choice.is-bad .choice__key { background: var(--danger); color: #fff; }
.choice:disabled { cursor: default; }

/* 结果页 */
.result-hero {
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-2);
  padding: var(--sp-5) 0 var(--sp-3);
  text-align: center;
}
.result-hero__num {
  font-size: 56px; font-weight: 750; line-height: 1;
  letter-spacing: -.03em;
}
.result-hero__label { font-size: var(--fs-sm); color: var(--text-muted); }
.result-rows { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); }
.result-row {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: var(--sp-3);
  text-align: center; display: flex; flex-direction: column; gap: 2px;
}
.result-row b { font-size: var(--fs-md); font-variant-numeric: tabular-nums; }
.result-row span { font-size: var(--fs-xs); color: var(--text-muted); }

/* ---------- 14. 单词表 ---------- */
.word-list { display: flex; flex-direction: column; }
.word-row {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-2);
  border-bottom: 1px solid var(--border);
}
.word-row:last-child { border-bottom: 0; }
.word-row__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.word-row__en { font-family: var(--font-en); font-weight: 620; font-size: var(--fs-base); }
.word-row__zh { font-size: var(--fs-sm); color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.word-row__box {
  width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: var(--border-strong);
}
.word-row__box[data-box="1"], .word-row__box[data-box="2"] { background: var(--warning); }
.word-row__box[data-box="3"], .word-row__box[data-box="4"] { background: var(--primary); }
.word-row__box[data-box="5"], .word-row__box[data-box="6"], .word-row__box[data-box="7"] { background: var(--success); }

/* 整理模式：拖动手柄 + 删除按钮 */
.word-row__handle {
  width: 30px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: grab;
  touch-action: none;          /* 手机上拖动时不触发滚动 */
  border-radius: var(--radius-xs);
}
.word-row__handle:active { cursor: grabbing; background: var(--surface-3); }
.word-row.is-dragging { opacity: .5; }

/* 整理模式下的多选圆圈 */
.word-row__check {
  width: 18px;
  height: 18px;
  flex: none;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  display: grid;
  place-items: center;
  color: var(--primary-ink);
  background: transparent;
}
.word-row__check.is-on { background: var(--primary); border-color: var(--primary); }
.word-row.is-selected { background: var(--primary-soft); }
.drop-mark {
  height: 3px;
  border-radius: 2px;
  background: var(--primary);
  margin: 2px var(--sp-2);
}
.word-row__del { color: var(--text-muted); }
.word-row__del:hover { background: var(--danger-soft); color: var(--danger); }
.word-row--edit { background: color-mix(in srgb, var(--danger) 4%, transparent); }

/* ---------- 15. 设置列表 ---------- */
.list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-1);
}
.list-row {
  display: flex; align-items: center; gap: var(--sp-3);
  width: 100%;
  min-height: 56px;
  padding: var(--sp-3) var(--sp-4);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border);
  text-align: left;
  cursor: pointer;
  font-size: var(--fs-base);
}
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: var(--surface-2); }
.list-row__label { flex: 1; min-width: 0; }
.list-row__value { color: var(--text-muted); font-size: var(--fs-sm); }
.list-row--static { cursor: default; }
.list-row--static:hover { background: transparent; }

.switch {
  position: relative;
  width: 48px; height: 28px; flex: none;
  border-radius: var(--radius-pill);
  background: var(--border-strong);
  border: 0; padding: 0; cursor: pointer;
  transition: background var(--dur-2) var(--ease);
}
.switch::after {
  content: "";
  position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: var(--shadow-1);
  transition: transform var(--dur-2) var(--ease);
}
.switch[aria-checked="true"] { background: var(--primary); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }

input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
  height: 44px;
}

/* ---------- 16. 弹层与吐司 ---------- */
.sheet-wrap {
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0;
  transition: opacity var(--dur-2) var(--ease);
}
.sheet-wrap.is-on { opacity: 1; }
.sheet-mask { position: absolute; inset: 0; background: rgba(10, 10, 16, .46); }
.sheet {
  position: relative;
  width: 100%; max-width: 560px;
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: var(--sp-4) var(--sp-4) calc(var(--sp-5) + env(safe-area-inset-bottom, 0px));
  transform: translateY(16px);
  transition: transform var(--dur-2) var(--ease);
  max-height: 88dvh;
  overflow-y: auto;
}
.sheet-wrap.is-on .sheet { transform: none; }
.sheet__head { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.sheet__title { font-size: var(--fs-md); font-weight: 650; flex: 1; }
.sheet__body { padding-bottom: var(--sp-3); }
.sheet__text { color: var(--text-2); font-size: var(--fs-base); }
.sheet__actions { display: flex; flex-direction: column; gap: var(--sp-2); }

.toast {
  position: fixed;
  left: 50%; bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  z-index: 120;
  transform: translate(-50%, 16px);
  max-width: 88vw;
  padding: var(--sp-3) var(--sp-4);
  background: #17171C;
  color: #fff;
  font-size: var(--fs-sm);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-2);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-2) var(--ease), transform var(--dur-2) var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
/* 带「撤销」的吐司可以点 */
.toast.is-action {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  pointer-events: auto;
  padding-right: var(--sp-2);
  white-space: nowrap;
  max-width: 92vw;
}
/* 页面底部有主按钮时，把吐司抬高，别压住按钮 */
.toast.toast--raised { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
.toast__action {
  border: 0;
  background: transparent;
  color: #8FD3FF;
  font-weight: 700;
  font-size: var(--fs-sm);
  padding: var(--sp-1) var(--sp-2);
  border-radius: var(--radius-xs);
  cursor: pointer;
  flex: none;
}
.toast__action:hover { background: rgba(255, 255, 255, .14); }
@media (prefers-color-scheme: dark) {
  .toast { background: #ECECF2; color: #14141A; }
}

/* ---------- 17. 查词 ---------- */
.search {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  height: 44px;
  padding: 0 var(--sp-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
}
.search__icon { display: flex; color: var(--text-muted); flex: none; }
.search__input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: var(--fs-base);
  color: var(--text);
  height: 100%;
}
.search__input::placeholder { color: var(--text-muted); }
.search__input::-webkit-search-cancel-button { display: none; }
.search__clear {
  border: 0;
  background: var(--surface-3);
  color: var(--text-muted);
  width: 24px; height: 24px;
  border-radius: 50%;
  display: grid; place-items: center;
  flex: none;
  cursor: pointer;
}

.dict-list { display: flex; flex-direction: column; gap: var(--sp-2); }
.dict-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color var(--dur-1), transform var(--dur-1);
}
.dict-row:hover { border-color: var(--primary); }
.dict-row:active { transform: scale(.99); }
.dict-row__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.dict-row__top { display: flex; align-items: baseline; gap: var(--sp-2); flex-wrap: wrap; }
.dict-row__en { font-family: var(--font-en); font-weight: 650; font-size: var(--fs-base); }
.dict-row__ph { font-family: var(--font-en); font-size: var(--fs-xs); color: var(--text-muted); }
.dict-row__zh {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.dict-row__note { font-size: var(--fs-xs); color: var(--primary); }
.dict-row__plus { flex: none; display: flex; color: var(--primary); }

/* ---------- 18. 杂项 ---------- */
.row { display: flex; align-items: center; gap: var(--sp-3); }
.row--between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: var(--sp-3); }
.muted { color: var(--text-muted); }
.small { font-size: var(--fs-sm); }
.tiny { font-size: var(--fs-xs); }
.center { text-align: center; }
.mt-2 { margin-top: var(--sp-2); }
.mt-3 { margin-top: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); }
.pill {
  display: inline-flex; align-items: center; gap: var(--sp-1);
  padding: 2px var(--sp-2);
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: 600;
}
.pill--primary { background: var(--primary-soft); color: var(--primary); }
.pill--warning { background: var(--warning-soft); color: var(--warning); }

/* ============================================================
   18. 视觉打磨层（覆盖层：层次、呼吸感、反馈）
   ============================================================ */

/* --- 数字统一用等宽数字，跳动时不抖 --- */
.today__num, .today__stat b, .deck__meta, .pill, .bar, .entry__idx {
  font-variant-numeric: tabular-nums;
}

/* --- 顶栏：滚动时毛玻璃 --- */
.topbar {
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
}
.topbar.is-scrolled {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
}

/* --- 今日卡：更有层次的渐变 --- */
.today {
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(255, 255, 255, .22) 0%, transparent 55%),
    linear-gradient(140deg, var(--primary) 0%, color-mix(in srgb, var(--primary) 72%, #1b1240) 100%);
  box-shadow: 0 14px 34px -14px color-mix(in srgb, var(--primary) 70%, transparent),
              0 2px 6px rgba(20, 20, 33, .18);
}
.today::after {
  width: 220px; height: 220px;
  right: -70px; top: -80px;
  background: radial-gradient(circle, rgba(255, 255, 255, .18), transparent 70%);
  border-radius: 50%;
}
.today__num { font-weight: 760; }
.today__row {
  gap: 0;
  padding-top: var(--sp-4);
  border-top: 1px solid rgba(255, 255, 255, .18);
}
.today__stat {
  flex: 1;
  padding: 0 var(--sp-3);
  border-left: 1px solid rgba(255, 255, 255, .16);
}
.today__stat:first-child { padding-left: 0; border-left: 0; }
.today__stat b { font-size: var(--fs-lg); font-weight: 700; }

/* --- 主按钮：内高光，更像实体按钮 --- */
.btn--primary {
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--primary) 88%, #fff) 0%,
    var(--primary) 55%,
    color-mix(in srgb, var(--primary) 92%, #000) 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .22) inset, 0 6px 16px -8px color-mix(in srgb, var(--primary) 80%, transparent);
}
.btn--primary:hover {
  filter: brightness(1.05);
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--primary) 88%, #fff) 0%,
    var(--primary) 55%,
    color-mix(in srgb, var(--primary) 92%, #000) 100%);
}

/* --- 卡片：hover 轻微抬起（只在有鼠标的设备上） --- */
@media (hover: hover) {
  .deck, .hot-entry, .card {
    transition: transform var(--dur-2) var(--ease),
                box-shadow var(--dur-2) var(--ease),
                border-color var(--dur-2) var(--ease);
  }
  .deck:hover, .hot-entry:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-2);
  }
}

/* --- 单词本：不同颜色标记 + 进度条更明确 --- */
.deck { padding: var(--sp-4); }
.deck__mark {
  width: 44px; height: 44px;
  font-size: var(--fs-md);
  font-weight: 700;
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset;
}
.deck:nth-child(4n+1) .deck__mark { background: linear-gradient(145deg, #6C63E8, #4B41C9); }
.deck:nth-child(4n+2) .deck__mark { background: linear-gradient(145deg, #E86C8B, #C94B6E); }
.deck:nth-child(4n+3) .deck__mark { background: linear-gradient(145deg, #2FB58C, #17896A); }
.deck:nth-child(4n+4) .deck__mark { background: linear-gradient(145deg, #E8A23A, #C97F17); }

.deck .bar {
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  overflow: hidden;
  margin-top: 2px;
}
.deck .bar__fill {
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--primary), color-mix(in srgb, var(--primary) 55%, #7C6CFF));
  transition: width var(--dur-3) var(--ease);
}

/* --- 底部操作栏：毛玻璃 + 上方渐隐，内容不再"撞"上来 --- */
.actionbar {
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  border-top: 1px solid var(--border);
}
.actionbar::before {
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: -28px;
  height: 28px;
  background: linear-gradient(to top, color-mix(in srgb, var(--bg) 86%, transparent), transparent);
  pointer-events: none;
}

/* --- 区块标题：加一条引导线 --- */
.section-title {
  font-size: var(--fs-sm);
  letter-spacing: .01em;
  color: var(--text-2);
  font-weight: 650;
}

/* --- 页面入场：淡入 + 轻微上移 --- */
@keyframes viewIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
.view > .content { animation: viewIn var(--dur-3) var(--ease) both; }

@media (prefers-reduced-motion: reduce) {
  .view > .content { animation: none; }
  .deck, .hot-entry, .btn, .card { transition: none !important; }
}

/* --- 空状态更柔和 --- */
.empty__art {
  background: linear-gradient(145deg, var(--primary-soft), var(--surface-3));
  color: var(--primary);
}

/* --- 输入框聚焦：更明显的焦点环 --- */
.input:focus-visible, .textarea:focus-visible, .search__input:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--primary) 45%, transparent);
  outline-offset: 1px;
}
/* --- 进度条 + 百分比 --- */
.deck__prog { display: flex; align-items: center; gap: var(--sp-2); }
.deck__prog .bar { flex: 1; }
.deck__pct {
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  min-width: 30px;
  text-align: right;
}

/* --- 怎么用：可折叠 --- */
.howto {
  margin-top: var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  overflow: hidden;
}
.howto summary {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.howto summary::-webkit-details-marker { display: none; }
.howto summary::after {
  content: "";
  margin-left: auto;
  width: 8px; height: 8px;
  border-right: 1.6px solid var(--text-muted);
  border-bottom: 1.6px solid var(--text-muted);
  transform: rotate(45deg) translateY(-2px);
  transition: transform var(--dur-2) var(--ease);
}
.howto[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.howto ol {
  margin: 0;
  padding: 0 var(--sp-4) var(--sp-4) calc(var(--sp-4) + 1.1em);
  font-size: var(--fs-sm);
  color: var(--text-muted);
  line-height: 1.7;
}
.howto li + li { margin-top: 4px; }

/* ---------- 18b. 学习卡 ---------- */
.study-card {
  background:
    radial-gradient(120% 80% at 50% 0%, color-mix(in srgb, var(--primary) 10%, transparent), transparent 68%),
    var(--surface);
  border: 1px solid color-mix(in srgb, var(--primary) 14%, var(--border));
  box-shadow: 0 10px 30px -18px color-mix(in srgb, var(--primary) 60%, transparent);
  transition: transform var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease);
}
.study-card .word { letter-spacing: -.02em; }
.study-bar, .bar { border-radius: var(--radius-pill); overflow: hidden; }
.bar__fill {
  background: linear-gradient(90deg, var(--primary), color-mix(in srgb, var(--primary) 55%, #8C7BFF));
  transition: width var(--dur-3) var(--ease);
}
.choice {
  transition: transform var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
}
.choice:active { transform: scale(.985); }
.choice__key { font-weight: 700; border-radius: var(--radius-xs); }
.feedback__head { font-weight: 700; letter-spacing: -.01em; }
