/* Study Tracker — design tokens & layout */
:root {
  --bg: #f5f7f6;
  --bg-elevated: #ffffff;
  --bg-muted: #edf1ef;
  --text: #17201d;
  --text-muted: #62706b;
  --border: #dce3e0;
  --primary: #0f766e;
  --primary-hover: #0d9488;
  --primary-soft: #ccfbf1;
  --accent: #b45309;
  --accent-soft: #ffedd5;
  --danger: #b91c1c;
  --danger-soft: #fee2e2;
  --success: #15803d;
  --success-soft: #dcfce7;
  --shadow: 0 1px 2px rgba(15, 31, 28, 0.05), 0 6px 18px rgba(15, 31, 28, 0.045);
  --radius: 8px;
  --radius-sm: 6px;
  --radius-scale: 1;
  --font: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --nav-h: 52px;
  --topbar-h: 64px;
  --max: 1080px;
  --ring-track: #d5e0dc;
  --ring-focus: #0f766e;
  --ring-break: #0284c7;
  --ring-long: #7c3aed;
  --heat-0: #ebedf0;
  --heat-1: #9be9a8;
  --heat-2: #40c463;
  --heat-3: #30a14e;
  --heat-4: #216e39;
  /* 外观：字号缩放 / 密度 / 强调色（由设置驱动） */
  --font-scale: 1;
  --space-unit: 1;
  --tap-target: 44px;
  --accent-var: var(--primary);
  --accent-hover-var: var(--primary-hover);
  --accent-soft-var: var(--primary-soft);
}

[data-theme="dark"] {
  --bg: #0f1211;
  --bg-elevated: #181c1a;
  --bg-muted: #242a27;
  --text: #eef2f0;
  --text-muted: #9ba6a1;
  --border: #414a46;
  --primary: #2dd4bf;
  --primary-hover: #5eead4;
  --primary-soft: #134e4a;
  --accent: #fb923c;
  --accent-soft: #431407;
  --danger: #f87171;
  --danger-soft: #450a0a;
  --success: #4ade80;
  --success-soft: #14532d;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.28), 0 10px 28px rgba(0, 0, 0, 0.24);
  --ring-track: #414a46;
  --ring-focus: #2dd4bf;
  --ring-break: #38bdf8;
  --ring-long: #a78bfa;
  --heat-0: #161b22;
  --heat-1: #0e4429;
  --heat-2: #006d32;
  --heat-3: #26a641;
  --heat-4: #39d353;
}

/* Interactive outlines need >=3:1 against dark cards (WCAG 1.4.11);
   structural --border stays subtler — visible text carries those. */
[data-theme="dark"] .btn-ghost,
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  border-color: #5f6a66;
}

/* 字号缩放 */
[data-font-scale="small"] { --font-scale: 0.92; }
[data-font-scale="large"] { --font-scale: 1.12; }

/* 密度：紧凑 / 标准 / 宽松 */
[data-density="compact"] {
  --space-unit: 0.85;
  --tap-target: 40px;
}
[data-density="roomy"] {
  --space-unit: 1.15;
  --tap-target: 48px;
}

/* 强调色预设 */
[data-accent="teal"] {
  --accent-var: #0f766e;
  --accent-hover-var: #0d9488;
  --accent-soft-var: #ccfbf1;
}
[data-accent="blue"] {
  --accent-var: #1d4ed8;
  --accent-hover-var: #2563eb;
  --accent-soft-var: #dbeafe;
}
[data-accent="violet"] {
  --accent-var: #6d28d9;
  --accent-hover-var: #7c3aed;
  --accent-soft-var: #ede9fe;
}
[data-accent="rose"] {
  --accent-var: #be123c;
  --accent-hover-var: #e11d48;
  --accent-soft-var: #ffe4e6;
}
[data-accent="amber"] {
  --accent-var: #b45309;
  --accent-hover-var: #d97706;
  --accent-soft-var: #fef3c7;
}
[data-accent="green"] {
  --accent-var: #15803d;
  --accent-hover-var: #16a34a;
  --accent-soft-var: #dcfce7;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* 字号缩放（作用于根字号） */
html {
  font-size: calc(100% * var(--font-scale));
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--accent-var);
}

#app {
  max-width: var(--max);
  margin: 0 auto;
  padding: calc(8px * var(--space-unit)) calc(16px * var(--space-unit))
    calc(96px * var(--space-unit));
  min-height: 100vh;
  /* 移动端安全区 */
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--topbar-h);
  padding: calc(12px * var(--space-unit)) 0 calc(8px * var(--space-unit));
}

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

.brand-mark {
  font-size: 1.75rem;
  line-height: 1;
  flex-shrink: 0;
}

.brand-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0;
  white-space: nowrap;
}

.brand-sub {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.sync-status {
  appearance: none;
  cursor: pointer;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sync-status.ok {
  color: var(--success);
  background: var(--success-soft);
  border-color: transparent;
}

.sync-status.warn {
  color: var(--accent-var);
  background: var(--accent-soft-var);
  border-color: transparent;
}

.sync-status.err {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: transparent;
}

.sync-status.busy {
  color: var(--accent-var);
  background: var(--accent-soft-var);
  border-color: transparent;
}

/* Nav — 移动端底部导航，桌面端顶部横向条 */
.nav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 4px;
  margin: 0 0 calc(16px * var(--space-unit));
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow);
  scrollbar-width: none;
  position: sticky;
  top: 8px;
  z-index: 20;
  scroll-snap-type: x proximity;
}

.nav::-webkit-scrollbar {
  display: none;
}

.nav-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 1 0 auto;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 0.9rem;
  min-height: var(--tap-target);
  transition: background 0.15s, color 0.15s;
  scroll-snap-align: start;
  white-space: nowrap;
}

.nav-item:hover {
  color: var(--text);
  background: var(--bg-muted);
}

.nav-item:focus-visible {
  outline: 2px solid var(--accent-var);
  outline-offset: -2px;
}

.nav-item.active {
  color: #fff;
  background: var(--accent-var);
}

/* Skeleton loading */
.skeleton {
  display: grid;
  gap: 16px;
  animation: skeletonPulse 1.6s ease-in-out infinite;
}

.skeleton-blocks {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

@media (max-width: 700px) {
  .skeleton-blocks {
    grid-template-columns: 1fr 1fr;
  }
}

.skeleton-block {
  background: var(--bg-muted);
  border-radius: var(--radius-sm);
  opacity: 0.6;
}

/* Once views load, skeleton is hidden */
.skeleton-loaded .skeleton {
  display: none;
}

@keyframes skeletonPulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.7; }
}

[data-theme="dark"] .nav-item.active {
  color: #042f2e;
}

/* Views */
.view-root {
  animation: fadeIn 0.22s ease;
}

.view {
  display: grid;
  gap: calc(16px * var(--space-unit));
}

.view-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.view-header h2 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: 0;
}

.view-header p {
  margin: 2px 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: calc(16px * var(--space-unit));
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: calc(12px * var(--space-unit));
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: calc(12px * var(--space-unit));
}

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

@media (max-width: 700px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* Cards */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * var(--radius-scale));
  box-shadow: var(--shadow);
  padding: calc(16px * var(--space-unit));
}

.card h3 {
  margin: 0 0 calc(12px * var(--space-unit));
  font-size: 1rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: calc(12px * var(--space-unit));
  flex-wrap: wrap;
}

.card-header h3 {
  margin: 0;
}

.stat-card {
  padding: calc(14px * var(--space-unit)) calc(16px * var(--space-unit));
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin-top: 6px;
  /* 展示值用比例数字；tabular-nums 只用于需要对齐的列 */
}

.stat-hint {
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: 600;
  font-size: 0.9rem;
  background: var(--bg-muted);
  color: var(--text);
  min-height: var(--tap-target);
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
  touch-action: manipulation;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn:focus-visible {
  outline: 2px solid var(--accent-var);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--accent-var);
  color: #fff;
}

[data-theme="dark"] .btn-primary {
  color: #042f2e;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover-var);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-muted);
}

.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.8rem;
  border-radius: 8px;
  min-height: calc(var(--tap-target) - 6px);
}

.btn-icon {
  width: var(--tap-target);
  height: var(--tap-target);
  padding: 0;
  border-radius: 8px;
}

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

/* Forms */
.form-grid {
  display: grid;
  gap: calc(12px * var(--space-unit));
}

.form-row {
  display: grid;
  gap: 6px;
}

.form-row.inline {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: calc(12px * var(--space-unit));
}

label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 8px;
  padding: 9px 12px;
  outline: none;
  min-height: var(--tap-target);
  transition: border-color 0.15s, box-shadow 0.15s;
  touch-action: manipulation;
}

.modal-open {
  overflow: hidden;
}

input[type="date"],
input[type="time"] {
  min-height: var(--tap-target);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent-var);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-var) 25%, transparent);
}

textarea {
  min-height: 88px;
  resize: vertical;
}

.help {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: var(--tap-target);
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-var);
  flex-shrink: 0;
}

/* Lists */
.list {
  display: grid;
  gap: 8px;
}

.list-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.list-item.done .item-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.item-body {
  flex: 1;
  min-width: 0;
}

.item-title {
  font-weight: 600;
  word-break: break-word;
}

.item-meta {
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.empty {
  text-align: center;
  color: var(--text-muted);
  padding: 28px 12px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--accent-soft-var);
  color: var(--accent-var);
}

.badge.accent {
  background: var(--accent-soft);
  color: var(--accent);
}

.badge.warn {
  background: var(--danger-soft);
  color: var(--danger);
}

.badge.muted {
  background: var(--bg-muted);
  color: var(--text-muted);
}

/* Timer */
.timer-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 16px;
}

@media (max-width: 820px) {
  .timer-layout {
    grid-template-columns: 1fr;
  }
}

.timer-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 24px 16px 20px;
}

.timer-ring-wrap {
  position: relative;
  width: min(280px, 72vw);
  height: min(280px, 72vw);
}

.timer-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.timer-ring-track {
  fill: none;
  stroke: var(--ring-track);
  stroke-width: 10;
}

.timer-ring-progress {
  fill: none;
  stroke: var(--ring-focus);
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.35s linear, stroke 0.2s;
}

.timer-ring-wrap.mode-short .timer-ring-progress {
  stroke: var(--ring-break);
}

.timer-ring-wrap.mode-long .timer-ring-progress {
  stroke: var(--ring-long);
}

.timer-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
}

.timer-mode {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0.04em;
}

.timer-time {
  font-size: clamp(2.4rem, 8vw, 3.4rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  font-family: var(--mono);
  line-height: 1.1;
}

.timer-sub {
  margin-top: 4px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.timer-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.mode-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.mode-tabs .btn.active {
  background: var(--accent-var);
  color: #fff;
  border-color: transparent;
}

.duration-input {
  max-width: 100%;
  min-width: 0;
}

.btn-row.presets {
  gap: 6px;
}

.btn-row.presets .btn {
  min-width: 3.2rem;
}

.timer-layout .form-row.inline {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 900px) {
  .timer-layout .form-row.inline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

[data-theme="dark"] .mode-tabs .btn.active {
  color: #042f2e;
}

/* Charts */
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 160px;
  padding-top: 8px;
}

.chart-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: flex-end;
}

.chart-bar {
  width: 100%;
  max-width: 42px;
  border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, var(--accent-hover-var), var(--accent-var));
  min-height: 4px;
  transition: height 0.25s ease;
}

.chart-bar-label {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.chart-bar-value {
  font-size: 0.72rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.heatmap {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 12px);
  gap: 3px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.heat-cell {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  background: var(--heat-0);
}

.heat-cell.l1 { background: var(--heat-1); }
.heat-cell.l2 { background: var(--heat-2); }
.heat-cell.l3 { background: var(--heat-3); }
.heat-cell.l4 { background: var(--heat-4); }

.heat-legend {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.sparkline {
  width: 100%;
  height: 160px;
  overflow: visible;
}

.sparkline path.line {
  fill: none;
  stroke: var(--accent-var);
  stroke-width: 2.5;
}

.sparkline circle {
  fill: var(--accent-var);
}

.sparkline .axis {
  stroke: var(--border);
  stroke-width: 1;
}

/* IELTS */
.score-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

@media (max-width: 640px) {
  .score-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.score-pill {
  text-align: center;
  padding: 10px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
}

.score-pill .k {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.score-pill .v {
  font-size: 1.25rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.score-pill.overall {
  background: var(--accent-soft-var);
  border-color: transparent;
}

/* 最佳成绩达标态 */
.score-pill.met {
  border-color: var(--accent-var);
}

.best-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-muted);
}

.best-row .score-grid {
  flex: 1;
  min-width: 0;
}

.best-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

/* 分技能小 sparkline */
.section-sparklines {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.mini-sparkline {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-muted);
}

.mini-sparkline-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.sparkline.mini {
  width: 100%;
  height: 44px;
  overflow: visible;
}

.sparkline.mini path {
  fill: none;
  stroke-width: 2;
}

.sparkline.mini circle {
  r: 2.5;
}

/* 错题本标签筛选下拉 */
.mistake-tag-filter {
  margin-left: auto;
  max-width: 180px;
}

/* Settings */
.kbd {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 6px;
}

.callout {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft-var);
  color: var(--text);
  font-size: 0.9rem;
}

.callout.warn {
  background: var(--accent-soft);
}

.callout a {
  font-weight: 600;
}

/* Settings — 更明显的视觉分组 */
.card.form-grid > h3 {
  font-size: 1.05rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
  margin-bottom: 14px;
}

.card.form-grid + .card.form-grid {
  border-top: 2px solid var(--border);
}

/* 首尾卡片不需要额外间距 */
.card.form-grid:first-of-type {
  margin-top: 0;
}

/* Toast */
.toast-root {
  position: fixed;
  right: 16px;
  bottom: 72px;
  z-index: 100;
  display: grid;
  gap: 8px;
  max-width: min(360px, calc(100vw - 32px));
}

.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 0.9rem;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.toast.in {
  opacity: 1;
  transform: translateY(0);
}

.toast.out {
  opacity: 0;
  transform: translateY(6px);
}

.toast-icon {
  flex-shrink: 0;
  font-size: 1.1em;
  line-height: 1;
}

.toast-text {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.toast-close {
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  padding: 2px 4px;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.12s;
}

.toast-close:hover {
  background: var(--bg-muted);
}

.toast.success {
  border-color: color-mix(in srgb, var(--success) 40%, var(--border));
}

.toast.error {
  border-color: color-mix(in srgb, var(--danger) 40%, var(--border));
}

/* Mini pomodoro bar */
.mini-bar-root {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 90;
  width: min(520px, calc(100vw - 24px));
  pointer-events: none;
}

.mini-bar {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: box-shadow 0.15s, border-color 0.15s, transform 0.15s;
}

.mini-bar:hover {
  border-color: color-mix(in srgb, var(--accent-var) 40%, var(--border));
}

.mini-bar.running {
  border-color: color-mix(in srgb, var(--accent-var) 55%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-var) 18%, transparent), var(--shadow);
}

.mini-bar.paused {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}

.mini-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}

.mini-bar.running .mini-dot {
  background: var(--accent-var);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-var) 25%, transparent);
  animation: pulse 1.4s ease infinite;
}

.mini-bar.paused .mini-dot {
  background: var(--accent);
}

.mini-mode {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

.mini-time {
  font-family: var(--mono);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 1.05rem;
  letter-spacing: 0;
  flex: 1;
}

.mini-bar.mode-short .mini-time { color: var(--ring-break); }
.mini-bar.mode-long .mini-time { color: var(--ring-long); }
.mini-bar.running:not(.mode-short):not(.mode-long) .mini-time { color: var(--accent-var); }

/* Progress */
.progress-wrap {
  display: grid;
  gap: 6px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
}

.progress-track {
  height: 10px;
  border-radius: 999px;
  background: var(--bg-muted);
  overflow: hidden;
  border: 1px solid var(--border);
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-var), var(--accent-hover-var));
  transition: width 0.35s ease;
  min-width: 0;
}

.progress-fill.done {
  background: linear-gradient(90deg, var(--success), color-mix(in srgb, var(--success) 70%, white));
}

/* Live timer card on dashboard */
.live-timer-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  border-color: color-mix(in srgb, var(--accent-var) 35%, var(--border));
  background: var(--bg-elevated);
}

.live-timer-card.paused {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}

.live-timer-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 14px;
}

.live-timer-time {
  font-family: var(--mono);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

/* Mini week chart */
.mini-week {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  min-height: 110px;
  padding-top: 4px;
}

.mini-week-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
  min-width: 0;
}

.mini-week-bar {
  width: 100%;
  max-width: 36px;
  border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, var(--accent-hover-var), var(--accent-var));
  min-height: 4px;
}

.mini-week-label {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.mini-week-val {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* List tweaks */
.list-item.compact {
  padding: 10px 12px;
}

.list-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent-var);
  flex-shrink: 0;
}

.empty.soft {
  border-style: solid;
  background: var(--bg);
  padding: 20px 12px;
}

.quick-add {
  margin-top: 12px;
}

.stat-card {
  transition: transform 0.12s ease, border-color 0.12s;
}

.stat-card:hover {
  border-color: color-mix(in srgb, var(--accent-var) 30%, var(--border));
}

.heat-cell.future {
  opacity: 0.25;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(8, 16, 14, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.modal-backdrop.show {
  opacity: 1;
}

.modal-panel {
  /* 默认居中，拖拽后改为 left/top 定位 */
  position: relative;
  width: min(440px, 100%);
  max-height: min(85vh, 720px);
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * var(--radius-scale));
  box-shadow: var(--shadow);
  padding: calc(16px * var(--space-unit));
  overscroll-behavior: contain;
  transition: opacity 0.15s ease;
}

/* 尺寸档位 */
.modal-sm { width: min(360px, 100%); }
.modal-md { width: min(440px, 100%); }
.modal-lg { width: min(640px, 100%); }
.modal-xl { width: min(860px, calc(100vw - 32px)); }

.modal-dragging {
  user-select: none;
  transition: none;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.modal-dragging .modal-body {
  pointer-events: none;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: calc(12px * var(--space-unit));
  position: sticky;
  top: 0;
  background: var(--bg-elevated);
  z-index: 1;
  border-radius: calc(var(--radius) * var(--radius-scale) - 4px) calc(var(--radius) * var(--radius-scale) - 4px) 0 0;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.05rem;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.modal-body {
  margin-bottom: 16px;
}

.modal-footer {
  justify-content: flex-end;
  position: sticky;
  bottom: 0;
  background: var(--bg-elevated);
  padding-top: 8px;
  z-index: 1;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

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

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-var) 20%, transparent); }
  50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent-var) 8%, transparent); }
}

/* Utilities */
.muted { color: var(--text-muted); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.gap-sm { gap: 8px; }
.full { width: 100%; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 520px) {
  .mini-bar .btn-ghost {
    display: none;
  }
}

/* IELTS section details (listening/reading rate + mistakes) */
.subscore-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 720px) {
  .subscore-grid {
    grid-template-columns: 1fr;
  }
}

.subscore-block {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  display: grid;
  gap: 8px;
  align-content: start;
}

.subscore-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.subscore-block textarea {
  min-height: 64px;
  font-size: 0.88rem;
}

.section-detail {
  margin-top: 10px;
  padding: 10px 12px;
  border-left: 2px solid var(--accent-var);
  background: var(--bg);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.section-detail-head {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
}

.mistake-list {
  margin: 6px 0 0;
  padding-left: 18px;
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.mistake-list li + li {
  margin-top: 2px;
}

.score-pill .sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

/* =====================================================
 * IELTS 改版：tabs / part-line / mistake-form / 目标
 * ===================================================== */
.ielts-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  margin: 6px 0 14px;
  position: sticky;
  top: calc(var(--nav-h) + 16px);
  background: var(--bg);
  z-index: 10;
  padding-top: 4px;
}

.ielts-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.92rem;
  padding: 10px 14px 12px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s ease, border-color 0.15s ease;
  min-height: var(--tap-target);
}

.ielts-tab:hover {
  color: var(--text);
}

.ielts-tab.active {
  color: var(--accent-var);
  border-bottom-color: var(--accent-var);
  font-weight: 600;
}

/* ---- Part stats inputs ---- */
.part-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.part-line {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
}

@media (max-width: 720px) {
  .part-stack {
    grid-template-columns: 1fr;
  }
}

.part-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.part-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.part-field {
  display: grid;
  gap: 2px;
}

.part-field label {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.part-field input {
  width: 100%;
  padding: 5px 8px;
  font-size: 0.85rem;
  min-height: calc(var(--tap-target) - 8px);
}

.section-mini {
  margin-top: 2px;
}

/* ---- Mistake form rows (录入) ---- */
.mistake-form-list {
  display: grid;
  gap: 10px;
}

.mistake-form {
  padding: 10px 12px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  display: grid;
  gap: 8px;
}

.mistake-form-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mistake-form-no {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
}

/* ---- 学习分析：目标卡 ---- */
.target-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.target-chip {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
}

.tc-label {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.tc-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

/* ---- 学习分析：每 Part 正确率表 ---- */
.goal-table-wrap {
  overflow-x: auto;
}

.goal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.goal-table th,
.goal-table td {
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.goal-table th {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ---- 4 周趋势 ---- */
.trend-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.trend-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.trend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

.trend-swatch.listening { background: var(--accent-var); }
.trend-swatch.reading { background: var(--accent); }

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

.trend-col {
  display: grid;
  gap: 6px;
  justify-items: center;
}

.trend-bars {
  height: 96px;
  display: flex;
  align-items: flex-end;
  gap: 6px;
}

.trend-bar {
  width: 22px;
  border-radius: 4px 4px 0 0;
  background: var(--bg-muted);
  min-height: 2px;
  transition: height 0.2s ease;
}

.trend-bar.listening { background: var(--accent-var); }
.trend-bar.reading { background: var(--accent); }

.trend-week {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.trend-vals {
  display: flex;
  gap: 8px;
  font-size: 0.74rem;
}

.trend-val.listening { color: var(--accent-var); }
.trend-val.reading { color: var(--accent); }

/* ---- 错题本 ---- */
.mistake-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

.mistake-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  align-content: start;
}

.mistake-card-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
  font-size: 0.78rem;
}

.mistake-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mistake-body {
  display: grid;
  gap: 4px;
}

.mistake-text {
  font-size: 0.86rem;
  color: var(--text);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.mistake-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  border-left: 2px solid var(--border);
  padding-left: 8px;
}

.mistake-original {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

/* ---- FSRS review and vocabulary ---- */
.review-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: 22px 0 26px;
  border-bottom: 1px solid var(--border);
}

.dashboard-review-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  border-left: 4px solid var(--accent-var);
}

.dashboard-review-main {
  display: grid;
  gap: 8px;
}

.dashboard-review-main .card-header,
.dashboard-review-main p {
  margin: 0;
}

.dashboard-review-count {
  font-size: 2rem;
  font-variant-numeric: tabular-nums;
}

.dashboard-review-tracks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.dashboard-review-track {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.dashboard-review-track strong,
.dashboard-review-track p {
  margin: 0;
}

.dashboard-review-track > div {
  min-width: 0;
}

.dashboard-review-track > div strong {
  display: block;
}

.dashboard-review-track p {
  margin-top: 3px;
  font-size: 0.75rem;
}

.review-hero-copy {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: baseline;
  column-gap: 10px;
}

.review-hero-copy .eyebrow,
.review-hero-copy p {
  grid-column: 1 / -1;
}

.review-hero-copy .eyebrow {
  color: var(--accent-var);
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.review-due-number {
  font-size: 3rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.review-due-label {
  font-size: 1rem;
  font-weight: 600;
}

.review-hero-copy p {
  margin: 8px 0 0;
}

.review-hero-actions {
  display: grid;
  gap: 8px;
  min-width: 190px;
}

.review-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.review-stat {
  display: grid;
  gap: 2px;
  padding: 14px 16px;
  background: var(--bg);
}

.review-stat-label,
.review-stat-sub {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.review-stat strong {
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
}

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

.review-choice-grid.single {
  grid-template-columns: minmax(0, 1fr);
}

.review-choice-button {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px 12px;
  min-height: 86px;
  padding: 14px;
  text-align: left;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.review-choice-button:hover:not(:disabled) {
  border-color: var(--accent-var);
  background: var(--accent-soft-var);
}

.review-choice-button:disabled {
  opacity: 0.58;
}

.review-choice-title {
  font-weight: 700;
}

.review-choice-button .muted {
  grid-column: 1 / -1;
  font-size: 0.78rem;
}

.review-session {
  max-width: 820px;
  margin: 0 auto;
}

.review-session-head {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.review-session-progress {
  display: grid;
  grid-template-columns: auto minmax(80px, 1fr);
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.progress {
  height: 6px;
  overflow: hidden;
  background: var(--bg-muted);
  border-radius: 999px;
}

.progress .progress-fill {
  height: 100%;
  background: var(--accent-var);
  border-radius: inherit;
  transition: width 0.2s ease;
}

.study-card {
  overflow: hidden;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.study-card-body {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 22px;
  min-height: 390px;
  padding: 32px clamp(18px, 6vw, 64px);
  text-align: center;
}

.study-card-kicker {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.word-prompt,
.spelling-prompt,
.mistake-prompt {
  display: grid;
  justify-items: center;
  gap: 12px;
  width: min(100%, 640px);
}

.word-prompt h3 {
  margin: 0;
  font-size: 2.35rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.word-phonetic {
  margin: 0;
  color: var(--text-muted);
  font-family: var(--mono);
}

.speak-button {
  font-size: 1.1rem;
}

.spelling-definition,
.mistake-prompt p {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.65;
}

.spelling-input,
.vocabulary-filters input[type="search"] {
  width: 100%;
  min-height: var(--tap-target);
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  outline: none;
}

.spelling-input {
  max-width: 420px;
  font-size: 1.15rem;
  text-align: center;
}

.spelling-input:focus,
.vocabulary-filters input[type="search"]:focus {
  border-color: var(--accent-var);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-var) 25%, transparent);
}

.spelling-feedback,
.answer-line {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.spelling-feedback.correct,
.answer-line.correct {
  color: var(--success);
  background: var(--success-soft);
}

.spelling-feedback.incorrect,
.answer-line.wrong {
  color: var(--danger);
  background: var(--danger-soft);
}

.study-answer {
  display: grid;
  justify-items: stretch;
  gap: 12px;
  width: min(100%, 680px);
  padding-top: 20px;
  border-top: 1px solid var(--border);
  text-align: left;
}

.study-answer-main strong {
  font-size: 1.25rem;
}

.study-answer-main p {
  margin: 4px 0 0;
}

.word-related {
  margin: 0;
  padding: 10px 12px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  overflow-wrap: anywhere;
}

.study-answer blockquote {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 12px 14px;
  color: var(--text-muted);
  background: var(--bg-muted);
  border-left: 3px solid var(--accent-var);
}

.study-answer blockquote small {
  color: var(--text-muted);
}

.review-rating-area {
  padding: 18px;
  background: var(--bg-muted);
  border-top: 1px solid var(--border);
}

.rating-question {
  margin: 0 0 10px;
  color: var(--text-muted);
  text-align: center;
  font-size: 0.8rem;
}

.rating-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.rating-button {
  display: grid;
  gap: 2px;
  min-height: 66px;
  padding: 8px;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.rating-button:hover:not(:disabled) {
  border-color: var(--accent-var);
}

.rating-button.again { border-top: 3px solid var(--danger); }
.rating-button.hard { border-top: 3px solid var(--accent); }
.rating-button.good { border-top: 3px solid var(--success); }
.rating-button.easy { border-top: 3px solid #2563eb; }

.rating-button > span,
.rating-interval {
  color: var(--text-muted);
  font-size: 0.68rem;
}

.review-complete {
  display: grid;
  justify-items: center;
  gap: 14px;
  max-width: 620px;
  margin: 36px auto;
  padding: 36px 18px;
  text-align: center;
}

.review-complete h3,
.review-complete p {
  margin: 0;
}

.complete-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  color: var(--success);
  background: var(--success-soft);
  border-radius: 50%;
  font-size: 1.6rem;
  font-weight: 700;
}

.complete-ratings {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  width: min(100%, 420px);
  overflow: hidden;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.complete-ratings div {
  display: grid;
  gap: 2px;
  padding: 10px;
  background: var(--bg-elevated);
}

.complete-ratings span {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.import-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding: 12px 0 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.import-toolbar h3,
.import-toolbar p {
  margin: 0;
}

.import-toolbar p {
  font-size: 0.78rem;
}

.vocabulary-panel {
  display: grid;
  gap: 12px;
}

.vocabulary-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(140px, 0.35fr) minmax(130px, 0.3fr);
  gap: 8px;
}

.vocabulary-count {
  margin: 0;
  padding-top: 4px;
}

.vocabulary-list {
  border-top: 1px solid var(--border);
}

.vocabulary-row {
  display: grid;
  grid-template-columns: minmax(140px, 0.7fr) minmax(220px, 1.6fr) auto auto;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.vocabulary-word,
.vocabulary-meaning {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.vocabulary-word strong,
.vocabulary-word span,
.vocabulary-meaning span,
.vocabulary-meaning small {
  overflow-wrap: anywhere;
}

.vocabulary-word span,
.vocabulary-meaning small {
  color: var(--text-muted);
  font-size: 0.74rem;
}

.vocabulary-status,
.vocabulary-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 5px;
}

.vocabulary-more {
  width: 100%;
  margin-top: 12px;
}

.review-settings {
  margin-top: 16px;
}

.review-integration {
  margin-top: 16px;
}

.review-integration .card-header {
  margin: 0;
}

.integration-install {
  display: grid;
  gap: 12px;
}

.integration-install p {
  margin: 0;
}

.integration-definition,
.integration-fallback {
  display: grid;
  gap: 4px;
}

.integration-shortcut {
  font-size: 0.78rem;
}

.integration-bookmark-row {
  display: flex;
  justify-content: center;
  padding: 16px;
  background: var(--bg-muted);
  border: 1px dashed var(--accent-var);
  border-radius: var(--radius-sm);
}

.integration-bookmark {
  cursor: grab;
}

.integration-copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.integration-url {
  min-width: 0;
  font-size: 0.72rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.integration-steps {
  margin: 4px 0 0 20px;
  padding: 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.6;
}

.import-preview,
.import-preview-counts {
  display: grid;
  gap: 12px;
}

.import-preview-counts {
  grid-template-columns: 1fr 1fr;
}

.import-preview-counts div {
  display: grid;
  gap: 3px;
  padding: 14px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.import-preview-counts strong {
  font-size: 1.35rem;
}

@media (max-width: 760px) {
  .dashboard-review-card {
    grid-template-columns: 1fr;
  }

  .dashboard-review-card > .btn {
    width: 100%;
  }

  .dashboard-review-tracks {
    grid-template-columns: 1fr;
  }

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

  .review-hero-actions {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .review-stats {
    grid-template-columns: 1fr 1fr;
  }

  .review-choice-grid,
  .vocabulary-filters {
    grid-template-columns: 1fr;
  }

  .study-card-body {
    min-height: 330px;
    padding: 24px 16px;
  }

  .word-prompt h3 {
    font-size: 1.9rem;
  }

  .rating-grid {
    grid-template-columns: 1fr 1fr;
  }

  .vocabulary-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .vocabulary-meaning {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .vocabulary-status {
    grid-column: 2;
    grid-row: 1;
  }

  .vocabulary-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 430px) {
  .review-hero-actions,
  .review-session-head {
    grid-template-columns: 1fr;
  }

  .review-session-head > .badge {
    display: none;
  }

  .review-session-progress {
    grid-row: 1;
  }

  .review-session-head > .btn {
    grid-row: 2;
  }

  .import-toolbar .btn-row,
  .import-toolbar .btn-row > .btn {
    width: 100%;
  }
}

.mistake-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* =====================================================
 * 自适应与可用性增强
 * ===================================================== */

/* 触控设备：加大热区，避免 300ms 延迟 */
@media (pointer: coarse) {
  .btn-sm {
    min-height: var(--tap-target);
  }
  .nav-item {
    padding: 12px 14px;
  }
}

/* 移动端：底部安全区 + 迷你条不被遮挡 */
@media (max-width: 640px) {
  #app {
    padding-bottom: calc(88px * var(--space-unit) + env(safe-area-inset-bottom));
  }
  .mini-bar-root {
    bottom: calc(12px + env(safe-area-inset-bottom));
  }
  .toast-root {
    bottom: calc(120px + env(safe-area-inset-bottom));
    right: 12px;
    left: 12px;
    max-width: none;
  }
  .view-header h2 {
    font-size: 1.25rem;
  }
  .brand-sub {
    display: none;
  }
  .sync-status {
    max-width: 110px;
  }
  .modal-backdrop {
    padding: 8px;
    align-items: flex-end;
  }
  .modal-panel {
    width: 100%;
    max-height: 88vh;
    border-radius: calc(var(--radius) * 1.2) calc(var(--radius) * 1.2) 0 0;
  }
}

/* 桌面端：导航更紧凑，内容更宽 */
@media (min-width: 1100px) {
  #app {
    padding-left: 24px;
    padding-right: 24px;
  }
}

/* 减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 表单内联字段在极窄屏下堆叠 */
@media (max-width: 380px) {
  .form-row.inline {
    grid-template-columns: 1fr;
  }
  .part-stack {
    grid-template-columns: 1fr;
  }
  .score-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* 雅思 band 行：桌面端 5 列，窄屏自动换行 */
.band-row {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

@media (max-width: 720px) {
  .band-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 380px) {
  .band-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* =====================================================
 * 全站体验优化
 * ===================================================== */

/* 导航图标 */
.nav-ico {
  font-size: 1.05em;
  line-height: 1;
  margin-right: 2px;
}

/* 细滚动条（桌面端） */
@media (pointer: fine) {
  ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
  }
  ::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--text-muted) 35%, transparent);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: content-box;
  }
  ::-webkit-scrollbar-thumb:hover {
    background: color-mix(in srgb, var(--text-muted) 55%, transparent);
    background-clip: content-box;
  }
  ::-webkit-scrollbar-track {
    background: transparent;
  }
}

/* 视图切换过渡 —— 已在 .view-root 上定义，移除重复 */

/* 卡片 hover 微交互（桌面端） */
@media (pointer: fine) {
  .card {
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
  }
  .card:hover {
    border-color: color-mix(in srgb, var(--accent-var) 25%, var(--border));
  }
}

/* 空状态更友好 */
.empty {
  line-height: 1.6;
}

/* 表单在窄屏的 label 字号 */
@media (max-width: 480px) {
  label {
    font-size: 0.8rem;
  }
}

/* 键盘可达性：全局焦点环 */
:focus-visible {
  outline: 2px solid var(--accent-var);
  outline-offset: 2px;
}

/* 选择控件在移动端高度一致 */
select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 28px;
}

/* =====================================================
 * 雅思分段表
 * ===================================================== */
.band-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

@media (max-width: 720px) {
  .band-grid {
    grid-template-columns: 1fr;
  }
}

.band-table-card {
  min-width: 0;
}

.band-table {
  width: 100%;
}

.band-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.band-table th {
  text-align: center;
}

.band-cell {
  font-weight: 700;
  color: var(--accent-var);
}

.band-raw {
  position: relative;
}

.band-raw-dots {
  color: var(--accent-soft-var);
  letter-spacing: 2px;
  font-size: 0.7rem;
}

.band-row-mine {
  background: var(--accent-soft-var);
}

.band-row-mine .band-cell {
  color: var(--accent-var);
}

.band-row-mine .badge {
  margin-left: 6px;
}

/* 分段表考试类型切换 */
.band-type-tabs {
  justify-content: center;
  margin-bottom: 4px;
}

.band-type-tabs .btn {
  min-width: 120px;
}

/* =====================================================
 * Focused workflow improvements
 * ===================================================== */

body[data-view="dashboard"] .mini-bar-root,
body[data-view="timer"] .mini-bar-root {
  display: none;
}

.mini-open-area {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.mini-task {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-time {
  flex: 0 0 auto;
}

/* Explainable local study coach */
.coach-card {
  border-color: color-mix(in srgb, var(--accent-var) 34%, var(--border));
  background: color-mix(in srgb, var(--accent-soft-var) 24%, var(--bg-elevated));
}

.coach-header {
  align-items: flex-start;
}

.coach-title-wrap,
.task-smart-copy {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.coach-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent-var);
  color: #fff;
  font-size: 1rem;
  line-height: 1;
}

[data-theme="dark"] .coach-mark {
  color: #042f2e;
}

.coach-caption {
  margin: 2px 0 0;
  color: var(--text-muted);
  font-size: 0.76rem;
}

.coach-badge {
  background: var(--bg-elevated);
  border: 1px solid color-mix(in srgb, var(--accent-var) 26%, var(--border));
}

.coach-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.coach-copy {
  min-width: 0;
}

.coach-headline {
  display: block;
  font-size: 1.05rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.coach-detail {
  margin: 5px 0 0;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.coach-main > .btn {
  flex: 0 0 auto;
}

.coach-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid color-mix(in srgb, var(--accent-var) 18%, var(--border));
}

.coach-signal {
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 0.73rem;
  font-weight: 600;
}

.coach-insight-list {
  display: grid;
}

.coach-insight-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 16px;
  align-items: baseline;
  padding: 11px 0;
  border-top: 1px solid var(--border);
}

.coach-insight-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.coach-insight-row:last-child {
  padding-bottom: 0;
}

.coach-insight-label {
  color: var(--accent-var);
  font-size: 0.78rem;
  font-weight: 700;
}

.coach-insight-row p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.task-board {
  display: grid;
  gap: 16px;
}

.task-date-toolbar {
  display: grid;
  grid-template-columns: var(--tap-target) minmax(150px, 220px) auto var(--tap-target);
  gap: 8px;
  align-items: center;
  justify-content: start;
}

.task-quick-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.task-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

.task-summary {
  margin: 0;
}

.task-smart-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--accent-var) 28%, var(--border));
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent-soft-var) 28%, var(--bg));
}

.task-smart-copy {
  align-items: flex-start;
}

.task-smart-copy .coach-mark {
  flex-basis: 28px;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-size: 0.85rem;
}

.task-smart-copy strong,
.task-smart-copy span:not(.coach-mark) {
  display: block;
  overflow-wrap: anywhere;
}

.task-smart-copy strong {
  font-size: 0.88rem;
}

.task-smart-copy span:not(.coach-mark) {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.task-item {
  align-items: center;
}

.timer-plan .card-header {
  margin-bottom: 16px;
}

.timer-advanced {
  margin-top: 4px;
  border-top: 1px solid var(--border);
}

.timer-advanced summary {
  min-height: var(--tap-target);
  padding: 12px 2px 8px;
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}

.timer-advanced[open] summary {
  color: var(--text);
}

.timer-advanced-body {
  padding-top: 8px;
}

.timer-plan .duration-input {
  flex: 1;
}

@media (max-width: 640px) {
  #app {
    padding-bottom: calc(82px + env(safe-area-inset-bottom));
  }

  body.mini-timer-visible #app {
    padding-bottom: calc(150px + env(safe-area-inset-bottom));
  }

  body[data-view="timer"] #app {
    padding-bottom: calc(82px + env(safe-area-inset-bottom));
  }

  body[data-view="dashboard"].mini-timer-visible #app {
    padding-bottom: calc(82px + env(safe-area-inset-bottom));
  }

  .topbar {
    min-height: 56px;
  }

  .nav {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 110;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 2px;
    overflow: visible;
    width: 100%;
    margin: 0;
    padding: 6px max(4px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(4px, env(safe-area-inset-left));
    border-width: 1px 0 0;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 -8px 24px rgba(15, 31, 28, 0.08);
    scroll-snap-type: none;
  }

  .nav-item {
    display: flex;
    flex-direction: column;
    gap: 1px;
    align-items: center;
    min-width: 0;
    min-height: 54px;
    padding: 6px 2px;
    border-radius: 6px;
    font-size: 0.68rem;
    line-height: 1.15;
  }

  .nav-item.active,
  [data-theme="dark"] .nav-item.active {
    background: var(--accent-soft-var);
    color: var(--accent-var);
  }

  .nav-ico {
    margin: 0;
    font-size: 1.2rem;
    line-height: 1;
  }

  .nav-label {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mini-bar-root {
    bottom: calc(74px + env(safe-area-inset-bottom));
  }

  .mini-bar {
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
  }

  .mini-open-area {
    gap: 8px;
  }

  .mini-task {
    max-width: 32vw;
  }

  .toast-root {
    bottom: calc(82px + env(safe-area-inset-bottom));
  }

  body.mini-timer-visible .toast-root {
    bottom: calc(142px + env(safe-area-inset-bottom));
  }

  .view > .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .stat-card {
    min-height: 104px;
    padding: 12px;
  }

  .stat-value {
    font-size: 1.35rem;
  }

  .stat-hint {
    font-size: 0.72rem;
  }

  .card {
    padding: 14px;
  }

  .ielts-tabs {
    top: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .ielts-tabs::-webkit-scrollbar {
    display: none;
  }

  .ielts-tab {
    flex: 0 0 auto;
    padding-inline: 12px;
  }

  .task-date-toolbar {
    grid-template-columns: 40px minmax(0, 1fr) auto 40px;
  }

  .coach-main,
  .task-smart-hint {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .coach-main > .btn,
  .task-smart-hint > .btn {
    width: 100%;
  }

  .coach-insight-row {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .task-quick-form {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .task-list-head {
    align-items: flex-start;
  }

  .task-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .task-item .item-actions {
    grid-column: 2;
  }

  .timer-ring-wrap {
    width: min(250px, 68vw);
    height: min(250px, 68vw);
  }
}

@media (max-width: 380px) {
  .mini-mode {
    display: none;
  }

  .task-today-btn {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
  }

  .task-date-toolbar {
    grid-template-columns: 40px minmax(0, 1fr) 40px;
  }

  .task-date-prev {
    grid-column: 1;
    grid-row: 1;
  }

  .task-date-toolbar input[type="date"] {
    grid-column: 2;
    grid-row: 1;
  }

  .task-date-next {
    grid-column: 3;
    grid-row: 1;
  }

  .task-list-head {
    flex-direction: column;
  }
}

/* 爱听写同步历史 */
.sync-log {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  display: grid;
  gap: 3px;
}

.sync-log-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.sync-log-item {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ===== 视觉升级：hero 问候区 / 统计卡片 / 动效（2026-08-16） ===== */

/* 页面氛围光晕：右上角低透明度径向渐变，随主题 token 变色 */
#app::before {
  content: '';
  position: fixed;
  top: -20vw;
  right: -15vw;
  width: 55vw;
  height: 55vw;
  max-width: 820px;
  max-height: 820px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--accent-var) 8%, transparent),
    transparent 65%
  );
  pointer-events: none;
  z-index: -1;
}

/* hero 问候区 */
.hero-greet {
  padding: calc(14px * var(--space-unit)) calc(18px * var(--space-unit));
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--accent-var) 18%, var(--border));
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--accent-var) 10%, var(--bg-elevated)),
      var(--bg-elevated) 60%
    );
}

.hero-greet h2 {
  margin: 0;
}

.hero-greet .muted {
  margin: 2px 0 0;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-muted);
  border: 1px solid var(--border);
}

.chip-hot {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: transparent;
}

/* 统计卡片：图标徽章 / 底部行 / delta / 迷你趋势线 */
.stat-card {
  display: grid;
  gap: 2px;
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.stat-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  font-size: 1.05rem;
  border-radius: 10px;
  background: var(--bg-muted);
}

.stat-bottom {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.stat-bottom .stat-hint {
  margin-top: 0;
}

.stat-delta {
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.stat-delta.up {
  color: var(--success);
}

.stat-delta.down {
  color: var(--danger);
}

.stat-spark {
  display: flex;
  margin-top: 8px;
  color: var(--text-muted);
}

/* 视图入场：轻微上浮 + 逐级延迟 */
.view > * {
  animation: rise-in 0.32s ease both;
}

.view > *:nth-child(2) { animation-delay: 0.03s; }
.view > *:nth-child(3) { animation-delay: 0.06s; }
.view > *:nth-child(4) { animation-delay: 0.09s; }
.view > *:nth-child(5) { animation-delay: 0.12s; }
.view > *:nth-child(n+6) { animation-delay: 0.15s; }

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

/* 桌面端卡片悬停微抬升 */
@media (pointer: fine) {
  .card {
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.12s;
  }

  .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(15, 31, 28, 0.08), 0 10px 24px rgba(15, 31, 28, 0.06);
  }
}

[data-theme="dark"] .card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 10px 24px rgba(0, 0, 0, 0.25);
}

@media (prefers-reduced-motion: reduce) {
  .view > *,
  .card {
    animation: none !important;
    transition: none !important;
  }

  .card:hover {
    transform: none;
  }
}

/* ===== 词汇学习流：选择题 / 学习卡（2026-08-17） ===== */

.choice-grid {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.choice-option {
  text-align: left;
  min-height: var(--tap-target);
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.4;
  transition: border-color 0.12s, background 0.12s, transform 0.12s;
}

.choice-option:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--accent-var) 45%, var(--border));
  transform: translateY(-1px);
}

.choice-option:disabled {
  cursor: default;
  opacity: 0.75;
}

.choice-option.correct {
  border-color: var(--success);
  background: var(--success-soft);
  opacity: 1;
  font-weight: 600;
}

.choice-option.incorrect {
  border-color: var(--danger);
  background: var(--danger-soft);
  opacity: 1;
}

.study-answer.learn-card {
  margin: 12px 0 16px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--bg-muted);
}

.learn-card .learn-definition {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.learn-card .word-related {
  margin: 8px 0 0;
}

/* ===== 同替配对训练（2026-08-17） ===== */

.cluster-chips {
  margin-top: 10px;
  align-items: center;
}

.cluster-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}

.choice-option.word-option {
  text-align: center;
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* ===== 考前节奏横幅（2026-08-17） ===== */

.pacing-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--accent-soft) 45%, var(--bg-elevated)),
      var(--bg-elevated) 65%
    );
}

.pacing-banner .muted {
  margin: 4px 0 0;
}
