/* ============================================
   词境 · Liquid Glass + iOS 交互
   ============================================ */

:root {
  --bg: #eef2ff;
  --ink: #1c1c1e;
  --ink-2: #3a3a3c;
  --muted: #8e8e93;
  --line: rgba(255, 255, 255, 0.45);
  --glass: rgba(255, 255, 255, 0.42);
  --glass-strong: rgba(255, 255, 255, 0.58);
  --glass-soft: rgba(255, 255, 255, 0.28);
  --accent: #007aff;
  --accent-2: #5ac8fa;
  --violet: #af52de;
  --green: #34c759;
  --red: #ff3b30;
  --orange: #ff9f0a;
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --shadow-soft:
    0 10px 40px rgba(28, 40, 90, 0.10),
    inset 0 1px 1px rgba(255, 255, 255, 0.55);
  --shadow-float:
    0 18px 50px rgba(28, 40, 90, 0.14),
    inset 0 1px 2px rgba(255, 255, 255, 0.5);
  --ease-spring: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font:
    -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "PingFang SC", "MiSans", "HarmonyOS Sans SC", "Noto Sans SC",
    "Helvetica Neue", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* hidden 属性优先于组件 display，避免反馈卡未作答就露出 */
[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

button {
  font: inherit;
  color: inherit;
  border: none;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:active {
  transform: scale(0.96);
}

/* ---------- 背景光斑 ---------- */
.bg-scene {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(1200px 700px at 10% -10%, #dbe7ff 0%, transparent 55%),
    radial-gradient(900px 600px at 90% 10%, #f0e4ff 0%, transparent 50%),
    radial-gradient(800px 500px at 50% 110%, #d9f3ff 0%, transparent 55%),
    linear-gradient(165deg, #f4f7ff 0%, #eef2ff 45%, #f7f4ff 100%);
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  will-change: transform;
  animation: float 18s var(--ease-out) infinite alternate;
}

.orb-a {
  width: 420px;
  height: 420px;
  top: -80px;
  left: -60px;
  background: radial-gradient(circle, #8ec5ff 0%, transparent 70%);
}

.orb-b {
  width: 380px;
  height: 380px;
  top: 10%;
  right: -80px;
  background: radial-gradient(circle, #c5a3ff 0%, transparent 70%);
  animation-delay: -5s;
}

.orb-c {
  width: 460px;
  height: 460px;
  bottom: -120px;
  left: 20%;
  background: radial-gradient(circle, #7dd8ff 0%, transparent 70%);
  animation-delay: -9s;
}

.orb-d {
  width: 280px;
  height: 280px;
  bottom: 20%;
  right: 15%;
  background: radial-gradient(circle, #ffd29a 0%, transparent 70%);
  opacity: 0.35;
  animation-delay: -12s;
}

.noise {
  position: absolute;
  inset: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@keyframes float {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(30px, -24px, 0) scale(1.08); }
}

/* ---------- 玻璃工具 ---------- */
.glass {
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.glass-soft {
  background: var(--glass-soft);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

/* ---------- 布局 ---------- */
.app-shell {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 130px;
}

/* ---------- 顶栏 ---------- */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-radius: var(--radius-xl);
  margin-bottom: 16px;
  position: sticky;
  top: calc(10px + env(safe-area-inset-top, 0px));
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  background: linear-gradient(145deg, #5b8cff, #7c5cff 55%, #4fc3ff);
  box-shadow:
    0 8px 20px rgba(76, 110, 255, 0.35),
    inset 0 1px 1px rgba(255, 255, 255, 0.45);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text strong {
  font-size: 17px;
  letter-spacing: 0.02em;
}

.brand-text span {
  font-size: 12px;
  color: var(--muted);
}

.top-stats {
  display: flex;
  gap: 8px;
}

.chip {
  display: flex;
  align-items: baseline;
  gap: 4px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--ink-2);
}

.chip strong {
  font-size: 16px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.chip-label {
  color: var(--muted);
}

.chip-unit {
  color: var(--muted);
}

/* ---------- 进度卡 ---------- */
.progress-card {
  border-radius: var(--radius-xl);
  padding: 22px;
  width: min(640px, 100%);
  margin: 14px auto 0;
}

.progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.progress-head h1 {
  font-size: clamp(22px, 4vw, 28px);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.progress-ring-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}

.progress-ring {
  width: 72px;
  height: 72px;
  transform: rotate(-90deg);
}

.ring-bg,
.ring-fg {
  fill: none;
  stroke-width: 7;
  stroke-linecap: round;
}

.ring-bg {
  stroke: rgba(255, 255, 255, 0.55);
}

.ring-fg {
  stroke: url(#ringGrad);
  stroke: var(--accent);
  stroke-dasharray: 188.4;
  stroke-dashoffset: 188.4;
  transition: stroke-dashoffset 0.7s var(--ease-spring);
}

.ring-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

.bar-track.slim {
  height: 8px;
}

.bar-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #5b8cff, #7c5cff, #4fc3ff);
  box-shadow: 0 4px 12px rgba(76, 110, 255, 0.35);
  transition: width 0.65s var(--ease-spring);
}

.progress-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 20px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
}

.progress-meta strong {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* ---------- 主网格 ---------- */
.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.9fr);
  gap: 18px;
  align-items: start;
}

/* 学习页只留练习卡：单列居中 */
.main-grid.learn-only {
  grid-template-columns: 1fr;
  width: min(640px, 100%);
  margin: 0 auto;
}

/* 统计 / 我的：主卡下方的附加面板 */
.stats-extra,
.me-extra {
  width: min(560px, 100%);
  margin: 14px auto 0;
}

.review-progress-card {
  width: 100%;
  margin: 14px 0 0;
  background: rgba(255, 255, 255, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 18px;
}

/* 今日暂放清单 */
.defer-card {
  width: 100%;
  margin: 0 0 4px;
  background: rgba(255, 159, 10, 0.16);
  border: 1px solid rgba(255, 159, 10, 0.3);
  border-radius: 18px;
}

.defer-badge {
  color: #c2410c;
  background: rgba(255, 159, 10, 0.2);
}

.defer-chips {
  margin: 0 0 14px;
}

.defer-chip {
  cursor: pointer;
  background: rgba(255, 255, 255, 0.5);
}

.defer-clear-btn {
  background: linear-gradient(160deg, #ffb340, #ff9f0a);
  box-shadow: 0 12px 28px rgba(255, 159, 10, 0.3);
}

.defer-note {
  margin-top: 10px;
  text-align: center;
}

/* 完成页 · 重考通过亮点 */
.retry-pass-banner {
  margin: 16px 0 0;
  padding: 14px 16px;
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(52, 199, 89, 0.22), rgba(52, 199, 89, 0.1));
  border: 1px solid rgba(52, 199, 89, 0.32);
  text-align: left;
}

.retry-pass-banner strong {
  display: block;
  font-size: 16px;
  color: #137333;
  margin-bottom: 2px;
}

.retry-pass-banner strong span {
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.retry-pass-banner p {
  font-size: 12px;
  color: var(--muted);
}

.study-panel,
.side-card {
  border-radius: var(--radius-xl);
}

.study-panel {
  padding: 20px;
  background: rgba(255, 255, 255, 0.34);
  backdrop-filter: blur(20px) saturate(155%);
  -webkit-backdrop-filter: blur(20px) saturate(155%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  transition: transform 0.25s var(--ease-spring), filter 0.2s ease;
}

.tag:active {
  transform: scale(0.95);
}

.tag-blue {
  color: #0a58d6;
  background: rgba(0, 122, 255, 0.12);
  border-color: rgba(0, 122, 255, 0.18);
}

.tag-violet {
  color: #7a2fbd;
  background: rgba(175, 82, 222, 0.12);
  border-color: rgba(175, 82, 222, 0.18);
}

.tag-green {
  color: #1d7a36;
  background: rgba(52, 199, 89, 0.12);
  border-color: rgba(52, 199, 89, 0.18);
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--ink-2);
  transition: transform 0.25s var(--ease-spring), background 0.2s ease;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.5);
}

.icon-btn:active {
  transform: scale(0.9);
}

/* ---------- 闪卡 ---------- */
.flashcard {
  perspective: 1400px;
  margin-bottom: 14px;
  outline: none;
}

.flashcard-inner {
  position: relative;
  width: 100%;
  min-height: 300px;
  transform-style: preserve-3d;
  transition: transform 0.7s var(--ease-spring);
  cursor: pointer;
}

.flashcard.flipped .flashcard-inner {
  transform: rotateY(180deg);
}

.flash-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 28px;
  padding: 28px 26px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: var(--shadow-float);
  overflow: hidden;
}

.flash-front {
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.38)),
    radial-gradient(circle at 20% 15%, rgba(91, 140, 255, 0.18), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(124, 92, 255, 0.14), transparent 40%);
}

.flash-back {
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.78), rgba(244, 247, 255, 0.5)),
    radial-gradient(circle at 80% 20%, rgba(90, 200, 250, 0.16), transparent 42%);
  transform: rotateY(180deg);
  align-items: flex-start;
  text-align: left;
}

.face-label {
  position: absolute;
  top: 18px;
  left: 18px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.word {
  font-size: clamp(36px, 7vw, 52px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #1c1c1e 20%, #3a4d8c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.phonetic {
  font-size: 18px;
  color: var(--muted);
  margin-bottom: 28px;
}

.hint-pill {
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.55);
}

.meaning {
  font-size: clamp(22px, 4vw, 28px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.35;
  margin-bottom: 18px;
}

.example {
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-2);
  margin-bottom: 8px;
}

.example-zh {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.55;
}

/* ---------- 掌握度 ---------- */
.mastery-box {
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 14px;
}

.mastery-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}

.mastery-head strong {
  color: var(--ink);
  font-size: 14px;
}

.mastery-dots {
  display: flex;
  gap: 8px;
}

/* SRS 记忆强度 */
.srs-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.srs-item {
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 12px;
  padding: 8px 6px;
  text-align: center;
}

.srs-item span {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 2px;
}

.srs-item strong {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.curve-tip {
  margin-top: 10px;
  letter-spacing: 0.01em;
}

.curve-tip sup {
  font-size: 0.7em;
}

.dot {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.5);
  transition: background 0.35s var(--ease-out), transform 0.3s var(--ease-spring);
}

.dot.on {
  background: linear-gradient(90deg, #5b8cff, #7c5cff);
  box-shadow: 0 4px 12px rgba(76, 110, 255, 0.28);
}

.dot.on:nth-child(4),
.dot.on:nth-child(5) {
  background: linear-gradient(90deg, #34c759, #30d158);
}

/* ---------- 操作按钮 ---------- */
.action-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 72px;
  padding: 12px 8px;
  border-radius: 18px;
  font-size: 13px;
  font-weight: 600;
  transition:
    transform 0.28s var(--ease-spring),
    box-shadow 0.25s ease,
    filter 0.2s ease;
}

.action-btn:hover {
  filter: brightness(1.03);
}

.action-btn:active {
  transform: scale(0.94);
}

.action-icon {
  font-size: 18px;
  line-height: 1;
}

.btn-ghost {
  color: var(--ink-2);
}

.btn-danger {
  color: #fff;
  background: linear-gradient(160deg, #ff6b60, #ff3b30);
  box-shadow: 0 10px 24px rgba(255, 59, 48, 0.28);
}

.btn-success {
  color: #fff;
  background: linear-gradient(160deg, #4cd97a, #34c759);
  box-shadow: 0 10px 24px rgba(52, 199, 89, 0.28);
}

.btn-primary {
  color: #fff;
  background: linear-gradient(160deg, #5b8cff, #007aff 50%, #5ac8fa);
  box-shadow: 0 12px 28px rgba(0, 122, 255, 0.32);
}

/* ---------- 模式切换条 ---------- */
.mode-switch {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 5px;
  border-radius: 18px;
  margin-bottom: 16px;
  overflow: hidden;
}

.mode-pill {
  position: relative;
  z-index: 1;
  padding: 11px 6px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  transition: color 0.25s ease, transform 0.25s var(--ease-spring);
}

.mode-pill.active {
  color: #fff;
}

.mode-pill:active {
  transform: scale(0.96);
}

.mode-pill-glow {
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 5px;
  width: calc(25% - 6px);
  border-radius: 14px;
  background: linear-gradient(160deg, #5b8cff, #007aff 55%, #4fc3ff);
  box-shadow: 0 8px 20px rgba(0, 122, 255, 0.28);
  transition: transform 0.35s var(--ease-spring), width 0.35s var(--ease-spring);
  z-index: 0;
}

/* ---------- 模式舞台 ---------- */
.mode-stage {
  position: relative;
}

.mode-view {
  display: none;
  animation: modeIn 0.4s var(--ease-spring);
}

.mode-view.active {
  display: block;
}

@keyframes modeIn {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.panel-actions {
  display: flex;
  gap: 8px;
}

/* ---------- 测验卡片 ---------- */
.quiz-card {
  position: relative;
  border-radius: 28px;
  padding: 28px 22px 24px;
  margin-bottom: 14px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: var(--shadow-float);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.38)),
    radial-gradient(circle at 20% 15%, rgba(91, 140, 255, 0.18), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(124, 92, 255, 0.14), transparent 40%);
  text-align: center;
  min-height: 210px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.quiz-prompt-label {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.quiz-meaning {
  font-size: clamp(22px, 4vw, 30px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.4;
  max-width: 28ch;
}

.quiz-example {
  font-size: 15px;
  color: var(--ink-2);
  line-height: 1.6;
  max-width: 36ch;
  opacity: 0.85;
}

.word.small {
  font-size: clamp(28px, 5vw, 40px);
}

.choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.choice-btn {
  position: relative;
  text-align: left;
  padding: 18px 44px 18px 16px;
  border-radius: 20px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.42);
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 8px 24px rgba(28, 40, 90, 0.08);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  transition:
    transform 0.28s var(--ease-spring),
    background 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    opacity 0.22s ease,
    color 0.22s ease;
  min-height: 72px;
  overflow: hidden;
}

.choice-btn:hover {
  background: rgba(255, 255, 255, 0.58);
  transform: translateY(-2px);
}

.choice-btn:active {
  transform: scale(0.96);
}

.choice-btn:disabled {
  cursor: default;
  transform: none;
}

/* iOS 状态徽章：右上角圆标 */
.choice-btn::after {
  content: "";
  position: absolute;
  top: 12px;
  right: 12px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: center / 12px 12px no-repeat;
  opacity: 0;
  transform: scale(0.5);
  transition:
    opacity 0.25s var(--ease-spring),
    transform 0.35s var(--ease-spring);
}

.choice-btn.correct::after {
  opacity: 1;
  transform: scale(1);
  background-color: var(--green);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E");
  animation: badgePop 0.4s var(--ease-spring);
}

.choice-btn.wrong::after {
  opacity: 1;
  transform: scale(1);
  background-color: var(--red);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6L6 18M6 6l12 12'/%3E%3C/svg%3E");
  animation: badgePop 0.4s var(--ease-spring);
}

.choice-btn.correct {
  background: linear-gradient(165deg, rgba(52, 199, 89, 0.28), rgba(48, 209, 88, 0.42));
  border-color: rgba(52, 199, 89, 0.65);
  box-shadow: 0 12px 28px rgba(52, 199, 89, 0.28);
  color: #0b6b2e;
  animation: iosSuccess 0.45s var(--ease-spring);
}

.choice-btn.wrong {
  background: linear-gradient(165deg, rgba(255, 59, 48, 0.2), rgba(255, 107, 96, 0.34));
  border-color: rgba(255, 59, 48, 0.55);
  color: #b3261e;
  animation: iosError 0.5s var(--ease-spring);
}

.choice-btn.dim {
  opacity: 0.38;
  filter: grayscale(0.15);
}

.choice-btn .choice-sub {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

@keyframes badgePop {
  0% { transform: scale(0.4); opacity: 0; }
  60% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes iosSuccess {
  0% { transform: scale(1); }
  40% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

@keyframes iosError {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-8px); }
  30% { transform: translateX(7px); }
  45% { transform: translateX(-5px); }
  60% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* ---------- 测验反馈（iOS 横幅式） ---------- */
.quiz-feedback {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: feedbackIn 0.4s var(--ease-spring);
  position: sticky;
  bottom: 8px;
  z-index: 5;
}

@keyframes feedbackIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.feedback-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.feedback-actions .action-btn {
  min-height: 52px;
  flex-direction: row;
  gap: 8px;
  border-radius: 16px;
  font-size: 14px;
}

.quiz-hint-text {
  margin-top: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  color: var(--ink-2);
  background: rgba(255, 159, 10, 0.12);
  border: 1px solid rgba(255, 159, 10, 0.28);
  animation: slideUp 0.3s var(--ease-spring);
}

.feedback-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: var(--shadow-soft);
  animation: feedbackCardPop 0.45s var(--ease-spring);
}

@keyframes feedbackCardPop {
  0% { transform: scale(0.94); opacity: 0; }
  55% { transform: scale(1.02); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.feedback-card.ok {
  background: linear-gradient(165deg, rgba(52, 199, 89, 0.2), rgba(255, 255, 255, 0.5));
  border-color: rgba(52, 199, 89, 0.4);
  box-shadow:
    0 14px 36px rgba(52, 199, 89, 0.18),
    inset 0 1px 1px rgba(255, 255, 255, 0.55);
}

.feedback-card.bad {
  background: linear-gradient(165deg, rgba(255, 59, 48, 0.16), rgba(255, 255, 255, 0.5));
  border-color: rgba(255, 59, 48, 0.35);
  box-shadow:
    0 14px 36px rgba(255, 59, 48, 0.14),
    inset 0 1px 1px rgba(255, 255, 255, 0.55);
}

.feedback-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: #fff;
  background: linear-gradient(165deg, #4cd97a, #34c759);
  box-shadow: 0 8px 20px rgba(52, 199, 89, 0.35);
  animation: badgePop 0.5s var(--ease-spring);
}

.feedback-icon svg {
  width: 24px;
  height: 24px;
  display: block;
}

.feedback-card.bad .feedback-icon {
  background: linear-gradient(165deg, #ff6b60, #ff3b30);
  box-shadow: 0 8px 20px rgba(255, 59, 48, 0.32);
}

.feedback-card strong {
  display: block;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 3px;
  color: var(--ink);
}

.feedback-card.ok strong {
  color: #0b6b2e;
}

.feedback-card.bad strong {
  color: #b3261e;
}

.feedback-card p {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.5;
}

.primary-wide-btn {
  width: 100%;
  padding: 15px 18px;
  border-radius: 18px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(160deg, #5b8cff, #007aff 50%, #5ac8fa);
  box-shadow: 0 12px 28px rgba(0, 122, 255, 0.28);
  transition: transform 0.28s var(--ease-spring);
}

.primary-wide-btn:active {
  transform: scale(0.97);
}

/* 拼写 */
.spell-card {
  min-height: 250px;
}

.spell-phonetic-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.mini-audio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  transition: transform 0.25s var(--ease-spring);
}

.mini-audio:active {
  transform: scale(0.95);
}

.spell-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin: 8px 0 4px;
}

.spell-slot {
  width: 28px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.55);
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

.spell-slot.filled {
  background: rgba(0, 122, 255, 0.12);
  border-color: rgba(0, 122, 255, 0.28);
}

.spell-slot.reveal {
  background: rgba(255, 159, 10, 0.18);
  border-color: rgba(255, 159, 10, 0.4);
  color: #b36a00;
}

.spell-input {
  width: min(100%, 360px);
  padding: 14px 18px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.55);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-align: center;
  color: var(--ink);
  outline: none;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.5);
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.spell-input:focus {
  border-color: rgba(0, 122, 255, 0.45);
  box-shadow:
    0 0 0 4px rgba(0, 122, 255, 0.15),
    inset 0 1px 2px rgba(255, 255, 255, 0.5);
}

.spell-input.ok {
  border-color: rgba(52, 199, 89, 0.65);
  box-shadow:
    0 0 0 4px rgba(52, 199, 89, 0.18),
    inset 0 1px 2px rgba(255, 255, 255, 0.5);
  animation: iosSuccess 0.45s var(--ease-spring);
}

.spell-input.bad {
  border-color: rgba(255, 59, 48, 0.65);
  box-shadow:
    0 0 0 4px rgba(255, 59, 48, 0.16),
    inset 0 1px 2px rgba(255, 255, 255, 0.5);
  animation: iosError 0.5s var(--ease-spring);
}

.spell-input.empty-shake {
  animation: iosError 0.45s var(--ease-spring);
  border-color: rgba(255, 159, 10, 0.65);
}

.spell-hint-line {
  display: flex;
  gap: 18px;
  justify-content: center;
}

/* 听音 */
.listen-card {
  min-height: 250px;
}

.audio-orb {
  position: relative;
  width: 110px;
  height: 110px;
  margin: 10px 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.audio-orb-core {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(160deg, #5b8cff, #007aff 50%, #5ac8fa);
  box-shadow:
    0 16px 36px rgba(0, 122, 255, 0.32),
    inset 0 1px 2px rgba(255, 255, 255, 0.45);
  transition: transform 0.28s var(--ease-spring);
  z-index: 1;
}

.audio-orb:hover .audio-orb-core {
  transform: scale(1.05);
}

.audio-orb:active .audio-orb-core {
  transform: scale(0.94);
}

.audio-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(0, 122, 255, 0.35);
  opacity: 0;
}

.audio-orb.playing .audio-ring {
  animation: pulseRing 1s ease-out infinite;
}

@keyframes pulseRing {
  0% { transform: scale(0.85); opacity: 0.7; }
  100% { transform: scale(1.25); opacity: 0; }
}

.listen-meta kbd {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.55);
  font-size: 11px;
}

.listen-word-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding-top: 8px;
}

/* ---------- 提示面板 ---------- */
.hint-panel {
  margin-top: 12px;
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  animation: slideUp 0.35s var(--ease-spring);
}

.hint-title {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.hint-panel p {
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-2);
  margin-bottom: 10px;
}

.text-btn {
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  padding: 6px 0;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- 侧栏 ---------- */
.side-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.side-card {
  padding: 18px;
}

.side-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.side-card-head h3,
.collapse-trigger h3 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.mini-badge {
  font-size: 12px;
  font-weight: 600;
  color: #0a58d6;
  background: rgba(0, 122, 255, 0.12);
  padding: 5px 10px;
  border-radius: 999px;
}

.review-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.review-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.review-label span:last-child {
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
}

.mini-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  overflow: hidden;
}

.mini-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  transition: width 0.55s var(--ease-spring);
}

.fill-blue { background: linear-gradient(90deg, #5b8cff, #4fc3ff); }
.fill-violet { background: linear-gradient(90deg, #af52de, #c98cff); }
.fill-green { background: linear-gradient(90deg, #34c759, #30d158); }

.secondary-btn {
  width: 100%;
  padding: 13px 16px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(160deg, #5b8cff, #007aff);
  box-shadow: 0 10px 24px rgba(0, 122, 255, 0.25);
  transition: transform 0.28s var(--ease-spring);
}

.secondary-btn:active {
  transform: scale(0.97);
}

/* ---------- 折叠面板 ---------- */
.collapse-card {
  padding: 6px 6px 6px;
  overflow: hidden;
}

.collapse-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px;
  text-align: left;
  border-radius: 20px;
  transition: background 0.2s ease;
}

.collapse-trigger:hover {
  background: rgba(255, 255, 255, 0.22);
}

.chevron {
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.35s var(--ease-spring);
  flex-shrink: 0;
  margin-right: 6px;
}

.collapse-trigger[aria-expanded="true"] .chevron {
  transform: rotate(225deg);
}

.collapse-body {
  padding: 0 14px 16px;
  display: grid;
  gap: 12px;
  animation: collapseIn 0.35s var(--ease-spring);
}

.collapse-body.collapsed {
  display: none;
}

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

.book-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.book-meta > div {
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 14px;
  padding: 12px 10px;
  text-align: center;
}

.book-meta span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}

.book-meta strong {
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.book-progress .muted {
  display: block;
  margin-top: 8px;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.muted.small {
  font-size: 12px;
  line-height: 1.5;
}

/* 掌握度图谱 */
.mastery-chart {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chart-row {
  display: grid;
  grid-template-columns: 42px 1fr 40px;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}

.chart-row strong {
  text-align: right;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.chart-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  overflow: hidden;
}

.chart-fill {
  height: 100%;
  border-radius: inherit;
}

.c-red { background: linear-gradient(90deg, #ff6b60, #ff3b30); }
.c-orange { background: linear-gradient(90deg, #ffb340, #ff9f0a); }
.c-blue { background: linear-gradient(90deg, #5b8cff, #5ac8fa); }
.c-green { background: linear-gradient(90deg, #4cd97a, #34c759); }
.c-violet { background: linear-gradient(90deg, #b07cff, #af52de); }
.c-teal { background: linear-gradient(90deg, #5ac8fa, #32ade6); }

/* 学习模式 */
.mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mode-chip {
  padding: 12px 10px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.4);
  transition:
    transform 0.25s var(--ease-spring),
    background 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
}

.mode-chip:hover {
  background: rgba(255, 255, 255, 0.48);
}

.mode-chip.active {
  color: #fff;
  background: linear-gradient(160deg, #5b8cff, #007aff);
  box-shadow: 0 8px 20px rgba(0, 122, 255, 0.28);
  border-color: transparent;
}

/* ---------- iOS 式 Tab 页面切换 ---------- */
.tab-viewport {
  position: relative;
  width: 100%;
  isolation: isolate;
}

/* 页面切换：active 在流内撑高度，leaving 脱流叠放，杜绝「统计下面出现词典」 */
.tab-page {
  display: none;
  width: 100%;
  will-change: transform, opacity, filter;
}

.tab-page.active {
  display: block;
  position: relative;
  z-index: 2;
}

.tab-page.leaving {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1;
  pointer-events: none;
}

/* iOS / Liquid Glass：推拉 + 微缩放 + 轻虚化，约 320ms */
.tab-page.active.entering {
  animation: tabIn 0.32s cubic-bezier(0.32, 0.72, 0, 1) both;
}

.tab-page.active.entering.from-right {
  animation-name: tabInRight;
}

.tab-page.active.entering.from-left {
  animation-name: tabInLeft;
}

.tab-page.leaving.to-left {
  animation: tabOutLeft 0.28s cubic-bezier(0.32, 0.72, 0, 1) both;
}

.tab-page.leaving.to-right {
  animation: tabOutRight 0.28s cubic-bezier(0.32, 0.72, 0, 1) both;
}

@keyframes tabIn {
  from {
    opacity: 0;
    transform: scale(0.985);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
  }
}

@keyframes tabInRight {
  from {
    opacity: 0;
    transform: translateX(32px) scale(0.98);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
    filter: blur(0);
  }
}

@keyframes tabInLeft {
  from {
    opacity: 0;
    transform: translateX(-32px) scale(0.98);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
    filter: blur(0);
  }
}

@keyframes tabOutLeft {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
    filter: blur(0);
  }
  to {
    opacity: 0;
    transform: translateX(-22px) scale(0.985);
    filter: blur(4px);
  }
}

@keyframes tabOutRight {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
    filter: blur(0);
  }
  to {
    opacity: 0;
    transform: translateX(22px) scale(0.985);
    filter: blur(4px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tab-page.active.entering,
  .tab-page.leaving.to-left,
  .tab-page.leaving.to-right {
    animation-duration: 0.12s;
    animation-name: tabIn;
  }
}

/* 学习页需要留出 Tab 空间 */
#pageLearn,
#pageReview,
#pageStats,
#pageDict,
#pageMe {
  padding-bottom: 8px;
}

/* ---------- 底部 iOS Liquid Glass Tab ---------- */
.tab-bar {
  position: fixed;
  left: 50%;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 40;
  width: min(420px, calc(100% - 28px));
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

/* 上下各留 10px 命中余量，避免点到底栏边缘漏到内容 */
.tab-bar::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -10px;
  bottom: -10px;
}

.tab-glass {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: stretch;
  padding: 8px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.52);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow:
    0 12px 40px rgba(28, 40, 90, 0.16),
    0 2px 8px rgba(28, 40, 90, 0.06),
    inset 0 1px 1px rgba(255, 255, 255, 0.75),
    inset 0 -1px 1px rgba(255, 255, 255, 0.25);
  pointer-events: auto;
  overflow: hidden;
  gap: 0;
}

.tab-glass::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
}

/* iOS 滑动光斑指示 */
.tab-glow {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 8px;
  width: calc(20% - 4px);
  border-radius: 20px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.95),
    rgba(255, 255, 255, 0.72)
  );
  box-shadow:
    0 8px 20px rgba(0, 122, 255, 0.14),
    inset 0 1px 1px rgba(255, 255, 255, 0.9),
    inset 0 -1px 1px rgba(0, 122, 255, 0.06);
  transition: transform 0.38s var(--ease-spring), width 0.38s var(--ease-spring);
  z-index: 0;
  pointer-events: none;
}

.tab-item {
  position: relative;
  z-index: 1;
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 58px;
  padding: 8px 4px 6px;
  border-radius: 20px;
  color: #8e8e93;
  transition:
    color 0.28s ease,
    transform 0.32s var(--ease-spring);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  cursor: pointer;
}

/* 扩大命中区：盖住相邻按钮圆角留下的空隙 */
.tab-item::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -3px;
  right: -3px;
  z-index: 2;
}

.tab-icon-wrap {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  transition: transform 0.32s var(--ease-spring);
}

.tab-svg {
  width: 24px;
  height: 24px;
}

.ti-stroke {
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.ti-fill {
  fill: currentColor;
  stroke: none;
}

.tab-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
}

/* iOS 选中态：主题蓝 + 图标微放大 */
.tab-item.active {
  color: var(--accent);
}

.tab-item.active .tab-icon-wrap {
  transform: scale(1.08) translateY(-1px);
}

.tab-item.active .tab-label {
  font-weight: 700;
}

.tab-item:not(.active) .ti-fill {
  opacity: 0.85;
}

.tab-item:active {
  transform: scale(0.92);
}

.tab-item:active .tab-icon-wrap {
  transform: scale(0.9);
}

/* 统计 / 我的 页面 */
.page-overlay {
  position: fixed;
  inset: 0;
  z-index: 65;
  overflow-y: auto;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 16px calc(110px + env(safe-area-inset-bottom, 0px));
  background:
    radial-gradient(800px 480px at 12% -8%, rgba(91, 140, 255, 0.2), transparent 55%),
    radial-gradient(700px 420px at 88% 8%, rgba(175, 82, 222, 0.16), transparent 50%),
    linear-gradient(165deg, #e8eeff, #f3eefe 55%, #eaf6ff);
  animation: fadeIn 0.28s ease;
}

.page-overlay[hidden] {
  display: none;
}

.page-card {
  width: min(560px, 100%);
  margin: 0 auto;
  border-radius: 28px;
  padding: 22px 20px;
  animation: doneIn 0.4s var(--ease-spring);
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
}

.page-head h1 {
  font-size: 28px;
  letter-spacing: -0.02em;
}

.stat-hero {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.stat-big {
  text-align: center;
  padding: 18px 8px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.stat-big strong {
  display: block;
  font-size: clamp(26px, 7vw, 34px);
  letter-spacing: -0.03em;
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}

.stat-big span {
  font-size: 12px;
  color: var(--muted);
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.stat-cell {
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 16px;
  padding: 14px 12px;
}

.stat-cell span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}

.stat-cell strong {
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.stat-block {
  margin-bottom: 12px;
}

.stage-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.stage-row {
  display: grid;
  grid-template-columns: 52px 1fr 36px;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}

.stage-row strong {
  text-align: right;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

/* 近 7 天趋势 */
.trend-chart {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  align-items: end;
  height: 120px;
  padding: 4px 2px 0;
}

.trend-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  height: 100%;
  min-width: 0;
}

.trend-stack {
  width: 100%;
  max-width: 28px;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 3px;
  background: rgba(255, 255, 255, 0.35);
}

.trend-seg {
  width: 100%;
  min-height: 2px;
}

.trend-seg.t-review {
  background: linear-gradient(180deg, #af52de, #b07cff);
}

.trend-seg.t-new {
  background: linear-gradient(180deg, #ffb340, #ff9f0a);
}

.trend-col span {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}

.trend-legend {
  display: flex;
  gap: 14px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
}

.trend-legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
}

.dot-violet {
  background: linear-gradient(90deg, #af52de, #b07cff);
}

.dot-orange {
  background: #ff9f0a;
}

/* 记忆健康 */
.health-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.health-grid > div {
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 14px;
  padding: 14px 10px;
  text-align: center;
}

.health-grid span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}

.health-grid strong {
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

/* 到期预测 */
.forecast-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.forecast-grid > div {
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 14px;
  padding: 12px 6px;
  text-align: center;
}

.forecast-grid strong {
  display: block;
  font-size: 22px;
  margin-bottom: 2px;
  font-variant-numeric: tabular-nums;
}

.forecast-grid span {
  font-size: 11px;
  color: var(--muted);
}

/* 难词榜 */
.leech-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.leech-row {
  display: grid;
  grid-template-columns: minmax(72px, 1fr) 1.4fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.4);
  text-align: left;
  transition: transform 0.22s var(--ease-spring), background 0.2s ease;
}

.leech-row:active {
  transform: scale(0.97);
}

.leech-word {
  font-weight: 700;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leech-meaning {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leech-lapses {
  font-size: 11px;
  font-weight: 600;
  color: #c2410c;
  background: rgba(255, 159, 10, 0.16);
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.me-profile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.45);
  margin-bottom: 14px;
}

.me-avatar {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  background: linear-gradient(145deg, #5b8cff, #7c5cff 55%, #4fc3ff);
  box-shadow: 0 10px 24px rgba(76, 110, 255, 0.3);
}

.me-profile strong {
  font-size: 17px;
}

.me-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.me-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.45);
  min-height: 52px;
  font-size: 15px;
  text-align: left;
  transition: background 0.2s ease, transform 0.22s var(--ease-spring);
}

.me-row:hover {
  background: rgba(255, 255, 255, 0.52);
}

.me-row:active {
  transform: scale(0.98);
}

.me-row strong {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.me-logout-row {
  justify-content: center;
  margin-top: 6px;
}

.me-logout-row span {
  color: var(--red);
  font-weight: 600;
  font-size: 15px;
}

.me-logout-row:hover {
  background: rgba(255, 59, 48, 0.08);
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  top: 28px;
  transform: translateX(-50%) translateY(-20px);
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(28, 28, 30, 0.82);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0;
  pointer-events: none;
  z-index: 100;
  transition:
    opacity 0.3s ease,
    transform 0.4s var(--ease-spring);
  max-width: calc(100% - 40px);
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- 卡片切换动画 ---------- */
.study-panel.leaving {
  animation: cardOut 0.35s var(--ease-spring) forwards;
}

.study-panel.entering {
  animation: cardIn 0.45s var(--ease-spring);
}

@keyframes cardOut {
  to {
    opacity: 0;
    transform: translateX(-18px) scale(0.98);
  }
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateX(22px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

/* ---------- 遗忘曲线卡片 ---------- */
.curve-card {
  padding: 16px;
}

.curve-wrap {
  background: rgba(255, 255, 255, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 18px;
  padding: 10px 8px 6px;
  margin-bottom: 12px;
}

.curve-svg {
  width: 100%;
  height: 222px;
  display: block;
  overflow: visible;
}

.curve-svg.large {
  height: 254px;
}

.curve-label {
  font-size: 9px;
  fill: var(--muted);
  font-family: var(--font);
}

.curve-label-active {
  fill: #007aff;
  font-weight: 700;
  font-size: 10px;
}

.curve-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 6px 8px 4px;
  font-size: 11px;
  color: var(--muted);
}

.curve-legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}

.dot-blue {
  background: linear-gradient(90deg, #5b8cff, #af52de);
}

.dot-green {
  background: #34c759;
}

.dot-hollow {
  background: #007aff;
  box-shadow: 0 0 0 2px #fff;
}

.curve-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.curve-stats > div {
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 12px;
  padding: 8px 6px;
  text-align: center;
}

.curve-stats span {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 2px;
}

.curve-stats strong {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

/* ---------- 词典 ---------- */
.dict-hero {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 8px 0 12px;
}

.dict-hero strong {
  font-size: 40px;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.dict-hero span {
  color: var(--muted);
  font-size: 13px;
}

.dict-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.dict-chips .chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.65);
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--font);
  transition: transform 0.18s var(--ease-spring, ease), background 0.22s ease, color 0.22s ease,
    border-color 0.22s ease, box-shadow 0.22s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.dict-chips .chip:active {
  transform: scale(0.94);
}

.dict-chips .chip b {
  color: var(--ink, #1c2748);
  font-variant-numeric: tabular-nums;
  transition: color 0.22s ease;
}

.dict-chips .chip-user {
  background: rgba(0, 122, 255, 0.1);
  border-color: rgba(0, 122, 255, 0.18);
}

.dict-chips .chip-user b {
  color: #007aff;
}

/* iOS 选中态：系统蓝填充 */
.dict-chips .chip-on {
  background: linear-gradient(180deg, #3f8cff, #007aff);
  border-color: rgba(0, 90, 200, 0.25);
  color: #fff;
  box-shadow:
    0 6px 16px rgba(0, 122, 255, 0.28),
    inset 0 1px 1px rgba(255, 255, 255, 0.35);
  animation: chipSelect 0.32s var(--ease-spring, ease);
}

.dict-chips .chip-on b,
.dict-chips .chip-on.chip-user b {
  color: #fff;
}

@keyframes chipSelect {
  0% {
    transform: scale(0.92);
  }
  55% {
    transform: scale(1.06);
  }
  100% {
    transform: scale(1);
  }
}

.dict-list.list-swap {
  animation: listSwap 0.28s ease;
}

@keyframes listSwap {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dict-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.dict-search-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--muted);
  pointer-events: none;
}

.dict-search {
  width: 100%;
  padding: 13px 40px 13px 42px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.62);
  font-size: 15px;
  color: inherit;
  outline: none;
  font-family: var(--font);
}

.dict-search:focus {
  border-color: rgba(0, 122, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.12);
}

.dict-search-clear {
  position: absolute;
  right: 10px;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: rgba(120, 130, 160, 0.18);
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.dict-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(52vh, 520px);
  overflow-y: auto;
  padding-right: 6px;
}

.dict-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.48);
  border: 1px solid rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease;
}

.dict-row:hover {
  background: rgba(255, 255, 255, 0.7);
}

.dict-row:active {
  transform: scale(0.985);
}

.dict-row-main {
  flex: 1;
  min-width: 0;
}

.dict-row-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.dict-word {
  font-size: 16px;
  font-family: var(--font-en, var(--font));
  letter-spacing: -0.01em;
}

.dict-phonetic {
  font-size: 12px;
  color: var(--muted);
}

.dict-meaning {
  margin-top: 3px;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dict-row-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.dict-badge {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0, 122, 255, 0.1);
  color: #007aff;
  font-size: 11px;
  white-space: nowrap;
}

.dict-del {
  border: none;
  background: rgba(255, 59, 48, 0.1);
  color: #ff3b30;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--font);
}

.dict-del:active {
  background: rgba(255, 59, 48, 0.2);
}

.dict-row mark.hl,
.dict-meaning mark.hl {
  background: rgba(255, 214, 10, 0.45);
  color: inherit;
  border-radius: 3px;
  padding: 0 1px;
}

.dict-empty {
  padding: 28px 12px;
  text-align: center;
}

.dict-empty-title {
  font-size: 16px;
  font-weight: 650;
  margin-bottom: 6px;
}

.add-word-card .add-word-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 8px;
}

.aw-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.aw-field span {
  font-size: 12px;
  color: var(--muted);
}

.aw-field input {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.62);
  font-size: 15px;
  color: inherit;
  outline: none;
  font-family: var(--font);
}

.aw-field input:focus {
  border-color: rgba(0, 122, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.12);
}

.aw-actions {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 10px;
  margin-top: 8px;
}

.primary-btn {
  padding: 12px 18px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(180deg, #3f8cff, #007aff);
  color: #fff;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  font-family: var(--font);
  box-shadow: 0 8px 20px rgba(0, 122, 255, 0.22);
}

.primary-btn:active {
  transform: scale(0.97);
}

/* ---------- 单词详情弹层 ---------- */
.detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(20, 28, 48, 0.32);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: fadeIn 0.28s ease;
  overflow-y: auto;
}

.detail-overlay[hidden] {
  display: none;
}

.detail-card {
  width: min(520px, 100%);
  max-height: min(92vh, 900px);
  overflow-y: auto;
  border-radius: 28px;
  padding: 22px 20px;
  animation: doneIn 0.4s var(--ease-spring);
  -webkit-overflow-scrolling: touch;
}

/* ---------- 苹果式玻璃滚动条（详情 / 词典 / 页面） ---------- */
.detail-overlay,
.detail-card,
.dict-list,
.page-overlay {
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 112, 156, 0.32) transparent;
}

.detail-overlay::-webkit-scrollbar,
.detail-card::-webkit-scrollbar,
.dict-list::-webkit-scrollbar,
.page-overlay::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.detail-overlay::-webkit-scrollbar-track,
.detail-card::-webkit-scrollbar-track,
.dict-list::-webkit-scrollbar-track,
.page-overlay::-webkit-scrollbar-track {
  background: transparent;
  margin: 6px 0;
}

.detail-overlay::-webkit-scrollbar-thumb,
.detail-card::-webkit-scrollbar-thumb,
.dict-list::-webkit-scrollbar-thumb,
.page-overlay::-webkit-scrollbar-thumb {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.55),
    rgba(120, 132, 168, 0.38) 40%,
    rgba(100, 112, 156, 0.32)
  );
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow:
    0 1px 4px rgba(28, 40, 90, 0.12),
    inset 0 1px 1px rgba(255, 255, 255, 0.55);
  min-height: 42px;
  background-clip: padding-box;
  transition: background 0.2s ease, width 0.2s ease;
}

/* 未悬停时几乎隐形，像 iOS 浮层滚动条 */
.detail-overlay:not(:hover)::-webkit-scrollbar-thumb,
.detail-card:not(:hover)::-webkit-scrollbar-thumb,
.dict-list:not(:hover)::-webkit-scrollbar-thumb,
.page-overlay:not(:hover)::-webkit-scrollbar-thumb {
  background: rgba(120, 132, 168, 0.14);
  border-color: transparent;
  box-shadow: none;
}

.detail-overlay:hover::-webkit-scrollbar-thumb,
.detail-card:hover::-webkit-scrollbar-thumb,
.dict-list:hover::-webkit-scrollbar-thumb,
.page-overlay:hover::-webkit-scrollbar-thumb {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.7),
    rgba(120, 132, 168, 0.5) 40%,
    rgba(100, 112, 156, 0.42)
  );
}

.detail-overlay::-webkit-scrollbar-thumb:active,
.detail-card::-webkit-scrollbar-thumb:active,
.dict-list::-webkit-scrollbar-thumb:active,
.page-overlay::-webkit-scrollbar-thumb:active {
  background: rgba(0, 122, 255, 0.45);
  border-color: rgba(255, 255, 255, 0.5);
}

.detail-overlay::-webkit-scrollbar-corner,
.detail-card::-webkit-scrollbar-corner,
.dict-list::-webkit-scrollbar-corner,
.page-overlay::-webkit-scrollbar-corner {
  background: transparent;
}

.detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.detail-head .word {
  margin: 4px 0;
}

.detail-curve {
  background: rgba(255, 255, 255, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 18px;
  padding: 10px 8px 8px;
  margin-bottom: 14px;
}

.detail-curve-tip {
  padding: 6px 8px 0;
  text-align: center;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.detail-cell {
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 12px;
  padding: 10px 8px;
  text-align: center;
}

.detail-cell span {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 3px;
}

.detail-cell strong {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.detail-meaning {
  padding: 12px 4px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  margin-bottom: 14px;
}

.detail-meaning strong {
  display: block;
  font-size: 16px;
  line-height: 1.5;
  margin-bottom: 6px;
}

.detail-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.detail-actions .action-btn {
  min-height: 52px;
  font-size: 12px;
  flex-direction: column;
  gap: 2px;
  padding: 8px 4px;
  border-radius: 14px;
}

.detail-wordlist {
  margin-top: 4px;
}

.word-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.word-chip {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.5);
  transition: transform 0.22s var(--ease-spring), background 0.2s ease;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.word-chip:hover {
  background: rgba(255, 255, 255, 0.58);
}

.word-chip:active {
  transform: scale(0.95);
}

.word-chip.active {
  color: #fff;
  background: linear-gradient(160deg, #5b8cff, #007aff);
  border-color: transparent;
}

.word-chip .chip-r {
  display: block;
  font-size: 10px;
  opacity: 0.8;
  font-weight: 500;
}

@media (max-width: 560px) {
  .detail-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .detail-actions {
    grid-template-columns: repeat(2, 1fr);
  }

  .detail-card {
    border-radius: 22px;
    padding: 18px 14px;
    max-height: 94vh;
  }
}

/* ---------- 复习模式（百词斩/扇贝） ---------- */
/* 复习页内布局（不再遮罩） */
.review-hub,
.review-done,
.review-session {
  width: min(640px, 100%);
  margin: 0 auto 12px;
}

.review-overlay {
  /* 保留类名兼容，但已不再使用遮罩 */
  background: transparent;
  padding: 0;
  overflow: visible;
}

.review-overlay[hidden] {
  display: none;
}

.review-hub,
.review-done {
  width: min(640px, 100%);
  margin: 0 auto;
  border-radius: 28px;
  padding: 24px 20px;
}

.review-hub-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.review-hub-head h1 {
  font-size: clamp(22px, 5vw, 28px);
  letter-spacing: -0.02em;
}

.review-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 14px 10px;
  border-radius: 18px;
  margin-bottom: 16px;
}

.review-summary > div {
  text-align: center;
}

.review-summary strong {
  display: block;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  margin-bottom: 2px;
}

.review-summary span {
  font-size: 11px;
  color: var(--muted);
}

.review-modes {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.review-mode-card {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 16px 14px;
  border-radius: 20px;
  text-align: left;
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 8px 24px rgba(28, 40, 90, 0.08);
  transition: transform 0.25s var(--ease-spring), background 0.2s ease;
  min-height: 72px;
}

.review-mode-card:hover {
  background: rgba(255, 255, 255, 0.58);
  transform: translateY(-2px);
}

.review-mode-card:active {
  transform: scale(0.97);
}

.rm-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 22px;
  background: linear-gradient(160deg, rgba(91, 140, 255, 0.2), rgba(175, 82, 222, 0.18));
}

.review-mode-card h3 {
  font-size: 16px;
  margin-bottom: 2px;
}

.review-mode-card p {
  font-size: 12px;
  color: var(--muted);
}

.rm-badge {
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(0, 122, 255, 0.12);
}

.review-tip {
  text-align: center;
}

/* 会话 */
.session-top {
  width: min(640px, 100%);
  margin: 0 auto 14px;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 20px;
}

.session-progress {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

.session-progress .bar-track {
  width: 100%;
}

.session-progress span {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.session-body {
  width: min(640px, 100%);
  margin: 0 auto;
}

.session-view {
  display: none;
  animation: modeIn 0.35s var(--ease-spring);
}

.session-view.active {
  display: block;
}

.recognize-card {
  min-height: 260px;
}

.recognize-card .word {
  margin: 12px 0 8px;
}

.hint-ladder {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 320px;
  margin-top: 10px;
}

.ladder-step {
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.55);
  font-size: 13px;
  color: var(--ink-2);
  text-align: left;
  animation: slideUp 0.3s var(--ease-spring);
}

.recognize-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.recognize-actions .action-btn {
  min-height: 68px;
  border-radius: 18px;
}

.explore-card {
  margin-top: 14px;
  border-radius: 22px;
  padding: 18px 16px;
  animation: slideUp 0.35s var(--ease-spring);
}

.explore-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.explore-head strong {
  font-size: 20px;
  letter-spacing: -0.02em;
}

.explore-meaning {
  font-size: 15px;
  line-height: 1.55;
  margin-bottom: 8px;
}

.explore-example {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 14px;
}

.quiz-type-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.spell-area {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.review-done {
  text-align: center;
  padding: 32px 22px;
}

.review-done-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 20px 0 14px;
}

.review-done-stats > div {
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 14px;
  padding: 12px 6px;
}

.review-done-stats strong {
  display: block;
  font-size: 22px;
  margin-bottom: 2px;
}

.review-done-stats span {
  font-size: 11px;
  color: var(--muted);
}

.review-done .done-actions {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

@media (max-width: 560px) {
  .review-summary {
    grid-template-columns: repeat(2, 1fr);
  }

  .review-done-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .review-mode-card {
    grid-template-columns: 44px 1fr auto;
  }
}

/* ---------- 词库 / 设置骨架 ---------- */
.lib-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.lib-stat {
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 14px;
  padding: 12px;
  text-align: center;
}

.lib-stat strong {
  display: block;
  font-size: 18px;
  margin-bottom: 2px;
}

.lib-stat span {
  font-size: 11px;
  color: var(--muted);
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.35) !important;
  color: var(--muted) !important;
  box-shadow: none !important;
  cursor: not-allowed;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 2px;
  font-size: 14px;
  color: var(--muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}

.setting-row:last-of-type {
  border-bottom: none;
}

.setting-row strong {
  color: var(--ink);
  font-size: 13px;
}

.switch-on {
  color: var(--green) !important;
}

/* ---------- 今日完成浮层 ---------- */
.done-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(20, 28, 48, 0.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: fadeIn 0.3s ease;
}

.done-overlay[hidden] {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.done-card {
  width: min(400px, 100%);
  border-radius: 28px;
  padding: 32px 28px;
  text-align: center;
  animation: doneIn 0.45s var(--ease-spring);
}

@keyframes doneIn {
  from { opacity: 0; transform: scale(0.92) translateY(16px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.done-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  font-size: 30px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(160deg, #4cd97a, #34c759);
  box-shadow: 0 14px 32px rgba(52, 199, 89, 0.35);
}

.done-card h2 {
  font-size: 22px;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.done-card p {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 22px;
  line-height: 1.6;
}

.done-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ---------- 安全区 / 触控基础 ---------- */
html {
  -webkit-text-size-adjust: 100%;
}

body {
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

button,
.choice-btn,
.mode-pill,
.mode-chip,
.action-btn,
.tab-item,
.collapse-trigger {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* 最小触控热区 */
.tab-item,
.mode-pill,
.mode-chip,
.action-btn,
.icon-btn {
  min-height: 44px;
}

/* ---------- 响应式 ---------- */

/* 大桌面 */
@media (min-width: 1100px) {
  .app-shell {
    width: min(1180px, calc(100% - 40px));
    padding-top: 22px;
  }

  .flashcard-inner {
    min-height: 320px;
  }
}

/* 小笔记本 / 大平板横屏 */
@media (max-width: 1024px) {
  .main-grid {
    grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.9fr);
    gap: 14px;
  }

  .main-grid.learn-only {
    grid-template-columns: 1fr;
  }
}

/* 平板竖屏 & 大手机 */
@media (max-width: 900px) {
  .main-grid {
    grid-template-columns: 1fr;
  }

  .app-shell {
    width: min(720px, calc(100% - 28px));
    padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px));
  }

  .side-stack {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .side-stack .side-card:first-child {
    grid-column: 1 / -1;
  }

  .tab-bar {
    width: min(520px, calc(100% - 24px));
  }
}

/* 平板竖屏单列侧栏时更紧凑 */
@media (max-width: 720px) {
  .side-stack {
    grid-template-columns: 1fr;
  }

  .side-stack .side-card:first-child {
    grid-column: auto;
  }
}

/* 手机 */
@media (max-width: 560px) {
  .app-shell {
    width: calc(100% - 20px);
    padding-top: 12px;
    padding-bottom: calc(108px + env(safe-area-inset-bottom, 0px));
  }

  .top-bar {
    padding: 10px 12px;
    top: 8px;
    border-radius: 20px;
    gap: 8px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    font-size: 16px;
  }

  .brand-text span {
    display: none;
  }

  .chip {
    padding: 6px 9px;
    font-size: 11px;
  }

  .chip strong {
    font-size: 14px;
  }

  .progress-card,
  .study-panel,
  .side-card {
    border-radius: 20px;
    padding: 14px;
  }

  .progress-head {
    margin-bottom: 12px;
  }

  .progress-head h1 {
    font-size: 20px;
  }

  .progress-ring-wrap,
  .progress-ring {
    width: 60px;
    height: 60px;
  }

  .mode-switch {
    gap: 2px;
    padding: 4px;
    border-radius: 16px;
  }

  .mode-pill {
    padding: 10px 2px;
    font-size: 12px;
    min-height: 42px;
  }

  .mode-pill-glow {
    top: 4px;
    bottom: 4px;
    left: 4px;
  }

  .flashcard-inner {
    min-height: 250px;
  }

  .flash-face {
    padding: 22px 16px;
    border-radius: 20px;
  }

  .word {
    font-size: clamp(30px, 9vw, 40px);
  }

  .phonetic {
    font-size: 16px;
    margin-bottom: 20px;
  }

  .hint-pill {
    font-size: 12px;
    padding: 8px 12px;
  }

  .meaning {
    font-size: 20px;
  }

  .example {
    font-size: 14px;
  }

  .action-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .action-btn {
    min-height: 60px;
    flex-direction: row;
    gap: 8px;
    border-radius: 16px;
    font-size: 14px;
  }

  .quiz-card {
    min-height: 190px;
    padding: 22px 16px;
    border-radius: 20px;
  }

  .quiz-meaning {
    font-size: 20px;
  }

  .choice-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .choice-btn {
    min-height: 60px;
    padding: 14px 14px;
    font-size: 14px;
    border-radius: 16px;
  }

  .spell-slot {
    width: 24px;
    height: 32px;
    font-size: 13px;
  }

  .spell-input {
    font-size: 16px;
    padding: 12px 14px;
  }

  .audio-orb {
    width: 92px;
    height: 92px;
  }

  .audio-orb-core {
    width: 76px;
    height: 76px;
  }

  .primary-wide-btn {
    min-height: 52px;
    border-radius: 16px;
  }

  .tab-bar {
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    width: calc(100% - 20px);
    padding: 6px;
    border-radius: 20px;
    gap: 2px;
  }

  .tab-item {
    padding: 8px 4px;
    font-size: 10px;
    border-radius: 14px;
  }

  .tab-item .tab-icon {
    font-size: 16px;
  }

  .toast {
    top: calc(12px + env(safe-area-inset-top, 0px));
    font-size: 13px;
    padding: 10px 14px;
  }

  .done-card {
    padding: 26px 20px;
    border-radius: 24px;
  }
}

/* 超小屏 / SE */
@media (max-width: 380px) {
  .chip-label {
    display: none;
  }

  .mode-pill {
    font-size: 11px;
  }

  .flashcard-inner {
    min-height: 220px;
  }

  .action-btn span:last-child {
    font-size: 13px;
  }

  .book-meta {
    gap: 6px;
  }

  .book-meta strong {
    font-size: 14px;
  }
}

/* 手机横屏（高度紧） */
@media (max-height: 480px) and (orientation: landscape) {
  .app-shell {
    padding-top: 8px;
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  }

  .top-bar {
    position: relative;
    top: 0;
    margin-bottom: 10px;
    padding: 8px 12px;
  }

  .progress-card {
    padding: 12px 16px;
  }

  .progress-head {
    margin-bottom: 8px;
  }

  .progress-ring-wrap {
    width: 52px;
    height: 52px;
  }

  .progress-ring {
    width: 52px;
    height: 52px;
  }

  .flashcard-inner {
    min-height: 180px;
  }

  .quiz-card {
    min-height: 150px;
    padding: 16px;
  }

  .audio-orb {
    width: 72px;
    height: 72px;
    margin: 4px 0;
  }

  .audio-orb-core {
    width: 60px;
    height: 60px;
  }

  .main-grid {
    gap: 10px;
  }

  .tab-bar {
    bottom: calc(6px + env(safe-area-inset-bottom, 0px));
  }
}

/* 平板横屏舒适区 */
@media (min-width: 901px) and (max-width: 1100px) {
  .flashcard-inner {
    min-height: 290px;
  }

  .action-btn {
    min-height: 68px;
  }
}

/* 触控设备加大热区 */
@media (hover: none) and (pointer: coarse) {
  .choice-btn {
    min-height: 64px;
  }

  .mode-pill,
  .mode-chip {
    min-height: 48px;
  }

  .icon-btn {
    width: 46px;
    height: 46px;
  }

  .collapse-trigger {
    min-height: 56px;
  }
}

/* =========================================================
   真机适配
   1) iPhone 14 Pro Max  430×932pt · DPR3 · 灵动岛
   2) 红米 K90 Pro Max    大屏安卓 · 约 412–440 CSS px
   3) iPad Pro 13" 2024  1032×1376pt · 横竖屏
   ========================================================= */

/* ---------- 公共：Dynamics / 安全区 / 触控 ---------- */
@supports (height: 100dvh) {
  body {
    min-height: 100dvh;
  }
}

.app-shell {
  /* 顶部避开灵动岛 / 状态栏 */
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
}

/* 粘性顶栏在刘海屏上不顶破 */
.top-bar {
  top: calc(env(safe-area-inset-top, 0px) + 8px);
}

/* =========================================================
   iPhone 14 Pro Max（逻辑宽 430，兼容 14/15 Pro 系）
   ========================================================= */
@media (min-width: 390px) and (max-width: 460px) {
  .app-shell {
    width: calc(100% - 20px);
    padding-top: calc(8px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(112px + env(safe-area-inset-bottom, 0px));
  }

  .top-bar {
    padding: 12px 14px;
    top: calc(env(safe-area-inset-top, 0px) + 6px);
    border-radius: 22px;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 13px;
    font-size: 17px;
  }

  .brand-text strong {
    font-size: 16px;
  }

  .chip {
    padding: 8px 11px;
    min-height: 38px;
  }

  .chip strong {
    font-size: 15px;
  }

  .progress-card {
    padding: 18px 16px;
  }

  .progress-head h1 {
    font-size: 22px;
    letter-spacing: -0.03em;
  }

  .progress-ring-wrap,
  .progress-ring {
    width: 64px;
    height: 64px;
  }

  .bar-track {
    height: 9px;
  }

  .study-panel,
  .side-card {
    padding: 16px 14px;
    border-radius: 22px;
  }

  .mode-switch {
    padding: 4px;
    border-radius: 16px;
  }

  .mode-pill {
    font-size: 12px;
    padding: 11px 2px;
    min-height: 44px;
    letter-spacing: -0.01em;
  }

  .flashcard-inner {
    min-height: 268px;
  }

  .flash-face {
    padding: 24px 18px;
    border-radius: 22px;
  }

  .word {
    font-size: 36px;
  }

  .phonetic {
    font-size: 16px;
    margin-bottom: 22px;
  }

  .hint-pill {
    font-size: 12px;
    padding: 9px 13px;
  }

  .meaning {
    font-size: 22px;
  }

  .example,
  .example-zh {
    font-size: 14px;
  }

  .action-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .action-btn {
    min-height: 62px;
    border-radius: 17px;
    font-size: 14px;
    flex-direction: row;
    gap: 8px;
    /* iOS 大按钮按压 */
    transition: transform 0.22s var(--ease-spring), filter 0.2s ease;
  }

  .action-btn:active {
    transform: scale(0.96);
    filter: brightness(0.97);
  }

  .quiz-card {
    min-height: 210px;
    padding: 24px 18px;
    border-radius: 22px;
  }

  .quiz-meaning {
    font-size: 22px;
  }

  .choice-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .choice-btn {
    min-height: 62px;
    border-radius: 17px;
    padding: 15px 16px;
    font-size: 15px;
  }

  .spell-slot {
    width: 26px;
    height: 34px;
  }

  .spell-input {
    min-height: 52px;
    font-size: 17px;
  }

  .audio-orb {
    width: 100px;
    height: 100px;
  }

  .audio-orb-core {
    width: 82px;
    height: 82px;
  }

  .primary-wide-btn {
    min-height: 54px;
    border-radius: 17px;
  }

  .tab-bar {
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    width: calc(100% - 20px);
    padding: 7px;
    border-radius: 22px;
  }

  .tab-item {
    min-height: 52px;
    padding: 9px 4px;
    font-size: 11px;
    border-radius: 15px;
  }

  .tab-item .tab-icon {
    font-size: 17px;
  }

  .toast {
    top: calc(14px + env(safe-area-inset-top, 0px));
    font-size: 14px;
    padding: 12px 16px;
    border-radius: 16px;
  }

  .done-card {
    width: min(360px, calc(100% - 32px));
    border-radius: 26px;
    padding: 28px 22px;
  }

  .mastery-box {
    padding: 13px 14px;
  }
}

/* iPhone 14 Pro Max 横屏（844×390 级） */
@media (min-width: 800px) and (max-width: 960px) and (max-height: 480px) {
  .app-shell {
    width: min(920px, calc(100% - 24px));
    padding-top: calc(6px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  }

  .top-bar {
    position: relative;
    top: 0;
    padding: 8px 14px;
    margin-bottom: 10px;
  }

  .progress-card {
    padding: 12px 18px;
    margin-bottom: 12px;
  }

  .progress-head {
    margin-bottom: 8px;
  }

  .progress-ring-wrap,
  .progress-ring {
    width: 52px;
    height: 52px;
  }

  .main-grid {
    grid-template-columns: minmax(0, 1.4fr) minmax(240px, 0.85fr);
    gap: 12px;
    align-items: start;
  }

  .flashcard-inner {
    min-height: 170px;
  }

  .word {
    font-size: 32px;
  }

  .phonetic {
    margin-bottom: 12px;
    font-size: 15px;
  }

  .quiz-card {
    min-height: 150px;
  }

  .audio-orb {
    width: 72px;
    height: 72px;
  }

  .audio-orb-core {
    width: 58px;
    height: 58px;
  }

  .action-btn {
    min-height: 56px;
  }

  .tab-bar {
    width: min(520px, calc(100% - 28px));
    bottom: calc(6px + env(safe-area-inset-bottom, 0px));
    left: calc(50% + env(safe-area-inset-left, 0px) / 2 - env(safe-area-inset-right, 0px) / 2);
  }
}

/* =========================================================
   红米 K90 Pro Max（大屏安卓手机）
   ========================================================= */
@media (min-width: 380px) and (max-width: 480px) {
  /* 小米/红米默认系统字体 */
  body {
    font-family: "MiSans", "HarmonyOS Sans SC", "PingFang SC", "Noto Sans SC",
      "Microsoft YaHei", -apple-system, sans-serif;
  }

  .flashcard-inner {
    min-height: 270px;
  }

  /* 安卓手势条 */
  .tab-bar {
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .action-btn,
  .choice-btn,
  .primary-wide-btn {
    min-height: 60px;
  }

  .mode-pill,
  .tab-item {
    min-height: 46px;
  }

  /* 避免安卓 Chrome 地址栏收缩导致跳动 */
  html,
  body {
    min-height: 100%;
    min-height: 100dvh;
    overflow-x: hidden;
  }
}

/* 安卓大屏横置（红米横屏） */
@media (min-width: 800px) and (max-width: 1000px) and (max-height: 480px) {
  .flashcard-inner {
    min-height: 175px;
  }

  .action-btn {
    min-height: 58px;
  }
}

/* =========================================================
   iPad Pro 13" 2024（1032×1376 / 1376×1032）
   ========================================================= */

/* 竖屏 1032 */
@media (min-width: 1000px) and (max-width: 1120px) and (min-height: 1200px) {
  .app-shell {
    width: min(980px, calc(100% - 48px));
    padding-top: calc(18px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px));
  }

  .top-bar {
    padding: 16px 22px;
    border-radius: 28px;
  }

  .brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    font-size: 20px;
  }

  .brand-text strong {
    font-size: 19px;
  }

  .chip {
    padding: 10px 14px;
    min-height: 44px;
    font-size: 13px;
  }

  .chip strong {
    font-size: 18px;
  }

  .progress-card {
    padding: 26px 28px;
  }

  .progress-head h1 {
    font-size: 30px;
  }

  .progress-ring-wrap,
  .progress-ring {
    width: 80px;
    height: 80px;
  }

  .main-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.9fr);
    gap: 20px;
  }

  .study-panel,
  .side-card {
    padding: 22px;
    border-radius: 28px;
  }

  .mode-switch {
    padding: 6px;
    border-radius: 20px;
  }

  .mode-pill {
    font-size: 15px;
    padding: 14px 10px;
    min-height: 52px;
  }

  .flashcard-inner {
    min-height: 360px;
  }

  .flash-face {
    padding: 36px 32px;
    border-radius: 28px;
  }

  .word {
    font-size: 52px;
  }

  .phonetic {
    font-size: 20px;
  }

  .meaning {
    font-size: 30px;
  }

  .example {
    font-size: 17px;
  }

  .action-row {
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
  }

  .action-btn {
    min-height: 84px;
    border-radius: 22px;
    font-size: 15px;
    flex-direction: column;
  }

  .quiz-card {
    min-height: 300px;
    padding: 36px 32px;
    border-radius: 28px;
  }

  .quiz-meaning {
    font-size: 32px;
  }

  .choice-grid {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }

  .choice-btn {
    min-height: 84px;
    border-radius: 22px;
    padding: 22px 20px;
    font-size: 17px;
  }

  .spell-slot {
    width: 34px;
    height: 44px;
    font-size: 18px;
  }

  .spell-input {
    min-height: 60px;
    font-size: 22px;
    width: min(100%, 420px);
  }

  .audio-orb {
    width: 130px;
    height: 130px;
  }

  .audio-orb-core {
    width: 106px;
    height: 106px;
  }

  .tab-bar {
    width: min(560px, calc(100% - 40px));
    padding: 10px;
    border-radius: 28px;
    bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  }

  .tab-item {
    min-height: 60px;
    font-size: 12px;
    border-radius: 18px;
  }

  .side-stack {
    gap: 16px;
  }
}

/* iPad Pro 13 横屏 1376 */
@media (min-width: 1280px) and (max-width: 1500px) and (min-height: 900px) and (max-height: 1150px) {
  .app-shell {
    width: min(1240px, calc(100% - 56px));
    padding-top: calc(16px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px));
  }

  .main-grid {
    grid-template-columns: minmax(0, 1.45fr) minmax(360px, 0.9fr);
    gap: 22px;
    align-items: start;
  }

  .flashcard-inner {
    min-height: 380px;
  }

  .word {
    font-size: 56px;
  }

  .action-row {
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
  }

  .action-btn {
    min-height: 88px;
  }

  .choice-grid {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .choice-btn {
    min-height: 88px;
    font-size: 18px;
  }

  .mode-pill {
    font-size: 15px;
    min-height: 54px;
    padding: 15px 12px;
  }

  .tab-bar {
    width: min(600px, calc(100% - 48px));
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    padding: 10px;
    border-radius: 28px;
  }

  .tab-item {
    min-height: 62px;
    font-size: 12px;
  }

  .toast {
    top: calc(18px + env(safe-area-inset-top, 0px));
    font-size: 15px;
    padding: 14px 20px;
  }
}

/* iPad 悬停 + 触控混合（Apple Pencil / 触控板） */
@media (hover: hover) and (pointer: fine) {
  .choice-btn:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.58);
  }

  .mode-pill:hover,
  .tab-item:hover {
    filter: brightness(1.03);
  }

  .action-btn:hover {
    filter: brightness(1.03);
  }
}

/* 长时间阅读：iPad 上增大正文舒适度 */
@media (min-width: 1000px) {
  .example,
  .example-zh,
  .hint-panel p {
    line-height: 1.7;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .flashcard-inner {
    transition: none;
  }
}

/* 深色模式可选 */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1020;
    --ink: #f5f5f7;
    --ink-2: #d1d1d6;
    --muted: #98989d;
    --line: rgba(255, 255, 255, 0.12);
    --glass: rgba(28, 32, 48, 0.55);
    --glass-strong: rgba(36, 42, 62, 0.7);
    --glass-soft: rgba(255, 255, 255, 0.08);
  }

  .bg-scene {
    background:
      radial-gradient(1000px 600px at 15% -10%, rgba(60, 90, 180, 0.35), transparent 55%),
      radial-gradient(800px 500px at 90% 0%, rgba(120, 70, 180, 0.28), transparent 50%),
      linear-gradient(165deg, #0b1020, #12182c 50%, #0d1428);
  }

  .flash-front,
  .flash-back {
    background:
      linear-gradient(160deg, rgba(40, 48, 72, 0.85), rgba(28, 34, 54, 0.7)),
      radial-gradient(circle at 20% 15%, rgba(91, 140, 255, 0.18), transparent 45%);
    border-color: rgba(255, 255, 255, 0.1);
  }

  .word {
    background: linear-gradient(135deg, #f5f5f7 20%, #a8c0ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
  }

  .btn-danger {
    background: linear-gradient(160deg, #ff6b60, #ff453a);
  }

  .tab-item.active {
    background: rgba(255, 255, 255, 0.1);
    color: #6eb6ff;
  }

  .me-logout-row span {
    color: #ff453a;
  }
}

/* ---------- 云同步弹窗 ---------- */
.sync-card {
  max-width: 420px;
}

.sync-account {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 18px;
  margin-bottom: 14px;
}

.sync-account strong {
  font-size: 15px;
  font-weight: 650;
  word-break: break-all;
}

.sync-error {
  color: var(--ios-red, #ff3b30) !important;
  font-size: 13px;
  margin: 2px 0 0;
}

.sync-card .aw-actions {
  justify-content: flex-end;
}

/* ---------- 首屏登录门（苹果账户式 · iPhone 14 Pro Max / 红米 K90 Pro Max 适配） ---------- */
.login-gate {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: flex;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  animation: fadeIn 0.3s ease;
}

.login-gate[hidden] {
  display: none;
}

/* margin:auto 居中 + 空间不足时可滚动（iOS 键盘弹起时 100dvh 收缩，卡片自动上移） */
.login-stage {
  margin: auto;
  width: min(400px, 100%);
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding:
    calc(env(safe-area-inset-top, 0px) + 32px)
    24px
    calc(env(safe-area-inset-bottom, 0px) + 32px);
  animation: doneIn 0.5s var(--ease-spring);
}

.login-brand {
  text-align: center;
}

.login-logo {
  position: relative;
  z-index: 0;
  width: 84px;
  height: 84px;
  margin: 0 auto 14px;
  border-radius: 26px;
  display: grid;
  place-items: center;
  font-size: 42px;
  font-weight: 700;
  color: transparent;
  background-image: linear-gradient(135deg, #1c1c1e 20%, #3a4d8c 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

/* 玻璃罩叠在渐变字后（罩为玻璃、字为渐变） */
.login-logo::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 26px;
  background: var(--glass-strong);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-float);
}

.login-title {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.login-sub {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}

.login-card {
  border-radius: var(--radius-xl);
  padding: 20px 18px 16px;
  box-shadow: var(--shadow-float);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 苹果式输入框：高 52、17px 防 iOS 聚焦缩放、focus 蓝环 */
.login-field {
  position: relative;
  display: block;
}

.login-field input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--glass-strong);
  color: var(--ink);
  font-size: 17px;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.login-field input::placeholder {
  color: var(--muted);
}

.login-field input:focus {
  border-color: rgba(0, 122, 255, 0.5);
  box-shadow: 0 0 0 3.5px rgba(0, 122, 255, 0.14);
}

.login-field-pwd input {
  padding-right: 68px;
}

/* 「显示」按钮：iOS Safari 密码框同款文案，44px 触控区 */
.login-eye {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  min-width: 56px;
  height: 40px;
  padding: 0 10px;
  font-size: 14px;
  font-weight: 550;
  color: var(--accent);
  border-radius: 10px;
}

.login-eye:active {
  transform: translateY(-50%) scale(0.94);
}

.login-msg {
  margin: 0;
  font-size: 13px;
  text-align: center;
  color: var(--red);
}

.login-msg.is-hint {
  color: var(--accent);
}

/* 蓝色胶囊主按钮（iOS Continue 风格），加载态转圈 */
.login-btn {
  position: relative;
  width: 100%;
  height: 52px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  font-family: var(--font);
  box-shadow: 0 10px 26px rgba(0, 122, 255, 0.28);
  transition: transform 0.15s ease, opacity 0.2s ease, filter 0.2s ease;
}

.login-btn:active {
  transform: scale(0.97);
  filter: brightness(0.96);
}

.login-btn:disabled {
  opacity: 0.45;
  box-shadow: none;
}

.login-btn.loading {
  pointer-events: none;
}

.login-btn.loading .login-btn-label {
  visibility: hidden;
}

.login-btn.loading::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: loginSpin 0.7s linear infinite;
}

@keyframes loginSpin {
  to {
    transform: rotate(360deg);
  }
}

.login-forgot {
  align-self: center;
  min-height: 40px;
  padding: 6px 12px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--accent);
}

/* 登录失败：卡片轻摇（苹果式错误反馈） */
.login-card.shake {
  animation: shake 0.4s ease;
}

@media (prefers-reduced-motion: reduce) {
  .login-stage {
    animation: none;
  }
  .login-btn,
  .login-eye {
    transition: none;
  }
  .login-card.shake {
    animation: none;
  }
}

@media (prefers-color-scheme: dark) {
  .login-logo {
    background-image: linear-gradient(135deg, #f5f5f7 20%, #a8c0ff 100%);
  }
}

/* 小屏兜底（高度 < 640 的老设备）：压缩间距仍可完整滚动 */
@media (max-height: 640px) {
  .login-stage {
    gap: 12px;
    padding-top: calc(env(safe-area-inset-top, 0px) + 20px);
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
  }
  .login-logo {
    width: 64px;
    height: 64px;
    font-size: 32px;
    margin-bottom: 10px;
    border-radius: 20px;
  }
  .login-logo::before {
    border-radius: 20px;
  }
}
