:root {
  --paper: #f3f0e8;
  --paper-deep: #ece7dc;
  --surface: #fffdf7;
  --surface-soft: #f8f5ec;
  --surface-glass: rgba(255, 253, 247, 0.82);
  --ink: #1d2b23;
  --ink-soft: #3e4c44;
  --muted: #7e867e;
  --faint: #a7aca5;
  --line: rgba(31, 57, 41, 0.11);
  --line-strong: rgba(31, 57, 41, 0.18);
  --green: #2b5c45;
  --green-deep: #1b3f2e;
  --green-soft: #e4eee6;
  --green-wash: #eff5ef;
  --terra: #a65343;
  --terra-deep: #8b4033;
  --terra-soft: #f7e8e2;
  --amber: #a9732d;
  --amber-soft: #f7eddb;
  --shadow-sm: 0 8px 24px rgba(41, 52, 44, 0.06);
  --shadow-md: 0 20px 52px rgba(41, 52, 44, 0.09);
  --shadow-lg: 0 32px 80px rgba(30, 47, 36, 0.14);
  --radius-sm: 14px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-xl: 34px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-word: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino,
    Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  background: var(--paper);
}

body {
  margin: 0;
  min-width: 300px;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

body.modal-open {
  overflow: hidden;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 3px solid rgba(43, 92, 69, 0.3);
  outline-offset: 2px;
}

::selection {
  background: rgba(43, 92, 69, 0.18);
}

.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 45% at 12% -8%, rgba(192, 216, 199, 0.76), transparent 70%),
    radial-gradient(ellipse 55% 38% at 104% 4%, rgba(239, 219, 183, 0.7), transparent 68%),
    radial-gradient(ellipse 55% 50% at 50% 112%, rgba(207, 219, 205, 0.38), transparent 72%),
    var(--paper);
}

.app-shell {
  position: relative;
  width: 100%;
  max-width: 560px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 0 18px calc(104px + var(--safe-bottom));
}

.view {
  width: 100%;
  animation: view-in 0.34s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

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

/* ---------- 通用页头 ---------- */

.page {
  padding-top: calc(16px + var(--safe-top));
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 4px 3px 20px;
}

.page-head-main {
  min-width: 0;
}

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

.page-title {
  margin: 0;
  color: var(--ink);
  font-size: 29px;
  font-weight: 750;
  letter-spacing: -0.035em;
  line-height: 1.16;
}

.page-sub {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
}

.masthead {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 3px 2px 20px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 14px;
  color: #f8f1dd;
  background: linear-gradient(150deg, #386d53 0%, #1c4432 100%);
  box-shadow: 0 8px 18px rgba(28, 68, 50, 0.2);
  font-family: var(--font-word);
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
}

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

.brand-name {
  color: var(--ink);
  font-size: 17px;
  font-weight: 760;
  letter-spacing: 0.04em;
  line-height: 1.25;
}

.brand-sub {
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: 0.07em;
}

.masthead-spacer {
  flex: 1;
}

.icon-btn {
  display: inline-grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink-soft);
  background: rgba(255, 253, 247, 0.66);
  transition: transform 0.16s ease, background 0.16s ease;
}

.icon-btn:active {
  transform: scale(0.94);
  background: var(--surface-soft);
}

.icon-btn svg,
.tab-icon svg,
.inline-icon svg {
  display: block;
  width: 21px;
  height: 21px;
}

.icon-btn.small {
  width: 36px;
  height: 36px;
  flex-basis: 36px;
  border-radius: 12px;
}

.icon-btn.small svg {
  width: 18px;
  height: 18px;
}

.back-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 3px 0 18px;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 38px;
  padding: 0 12px 0 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink-soft);
  background: rgba(255, 253, 247, 0.62);
  font-size: 13px;
  font-weight: 650;
}

.back-btn svg {
  width: 18px;
  height: 18px;
}

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

/* ---------- 首页 ---------- */

.hero-card {
  position: relative;
  overflow: hidden;
  padding: 24px 23px 22px;
  border-radius: var(--radius-xl);
  color: #f9f5e7;
  background:
    radial-gradient(circle at 92% 8%, rgba(230, 204, 151, 0.2), transparent 40%),
    linear-gradient(148deg, #35674e 0%, #214b37 55%, #193c2b 100%);
  box-shadow: 0 24px 54px rgba(28, 62, 45, 0.24);
}

.hero-card::before {
  position: absolute;
  top: -92px;
  right: -60px;
  width: 220px;
  height: 220px;
  border: 1px solid rgba(255, 248, 225, 0.13);
  border-radius: 50%;
  content: "";
}

.hero-card::after {
  position: absolute;
  right: 30px;
  bottom: -125px;
  width: 250px;
  height: 250px;
  border: 1px solid rgba(255, 248, 225, 0.1);
  border-radius: 50%;
  content: "";
}

.hero-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 248, 225, 0.16);
  border-radius: 999px;
  color: rgba(255, 250, 236, 0.88);
  background: rgba(255, 255, 255, 0.07);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.hero-badge .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #d9c38d;
  box-shadow: 0 0 0 3px rgba(217, 195, 141, 0.12);
}

.hero-date {
  color: rgba(255, 250, 236, 0.55);
  font-size: 11.5px;
}

.hero-count-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin: 12px 0 1px;
}

.hero-count {
  font-family: var(--font-word);
  font-size: 78px;
  font-weight: 500;
  letter-spacing: -0.06em;
  line-height: 0.95;
}

.hero-count-suffix {
  padding-bottom: 10px;
  color: rgba(255, 250, 236, 0.7);
  font-size: 14px;
  font-weight: 550;
  letter-spacing: 0.03em;
}

.hero-note {
  position: relative;
  z-index: 1;
  margin: 8px 0 20px;
  color: rgba(255, 250, 236, 0.7);
  font-size: 13px;
}

.hero-progress {
  position: relative;
  z-index: 1;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
}

.hero-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #d9c38d, #efe0b7);
  transition: width 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.hero-bottom {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 19px;
}

.hero-progress-label {
  color: rgba(255, 250, 236, 0.68);
  font-size: 12px;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 45px;
  padding: 0 19px;
  border: 0;
  border-radius: 14px;
  color: #23412f;
  background: #f4e8c7;
  box-shadow: 0 10px 22px rgba(10, 27, 18, 0.2);
  font-size: 14px;
  font-weight: 750;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.hero-cta:active {
  transform: scale(0.97);
  box-shadow: 0 4px 12px rgba(10, 27, 18, 0.18);
}

.hero-cta svg {
  width: 17px;
  height: 17px;
}

.hero-cta.ghost {
  color: rgba(255, 250, 236, 0.86);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
  border: 1px solid rgba(255, 255, 255, 0.13);
}

.hero-card.is-empty {
  background:
    radial-gradient(circle at 90% 0%, rgba(238, 213, 166, 0.18), transparent 40%),
    linear-gradient(148deg, #4d6f5c 0%, #315643 100%);
}

.hero-empty-title {
  position: relative;
  z-index: 1;
  margin: 20px 0 5px;
  font-family: var(--font-word);
  font-size: 31px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.hero-empty-copy {
  position: relative;
  z-index: 1;
  margin: 0 0 22px;
  color: rgba(255, 250, 236, 0.67);
  font-size: 13px;
}

/* ---------- 统计 ---------- */

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

.stat {
  padding: 14px 14px 13px;
  border: 1px solid rgba(31, 57, 41, 0.07);
  border-radius: 18px;
  background: rgba(255, 253, 247, 0.62);
  box-shadow: 0 8px 22px rgba(40, 53, 44, 0.035);
}

.stat-value {
  display: flex;
  align-items: baseline;
  gap: 3px;
  color: var(--ink);
  font-family: var(--font-word);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.stat-value small {
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0;
}

.stat-label {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

/* ---------- 区块 ---------- */

.section {
  margin-top: 28px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 3px 11px;
}

.section-title {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.section-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0;
  border: 0;
  color: var(--green);
  background: transparent;
  font-size: 12px;
  font-weight: 650;
}

.section-link svg {
  width: 14px;
  height: 14px;
}

.preview-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 253, 247, 0.7);
  box-shadow: var(--shadow-sm);
}

.preview-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 57px;
  padding: 10px 15px;
  border-bottom: 1px solid rgba(31, 57, 41, 0.065);
}

.preview-row:last-child {
  border-bottom: 0;
}

.preview-index {
  width: 21px;
  flex: 0 0 21px;
  color: var(--faint);
  font-family: var(--font-word);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.preview-term {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-family: var(--font-word);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--terra);
  background: var(--terra-soft);
  font-size: 10.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.score-badge::before {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.score-badge.zero {
  color: var(--muted);
  background: var(--surface-soft);
}

.score-badge.zero::before {
  background: var(--faint);
}

/* ---------- 空状态 ---------- */

.empty-state {
  padding: 40px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  text-align: center;
  background: rgba(255, 253, 247, 0.42);
}

.empty-orb {
  display: grid;
  width: 56px;
  height: 56px;
  margin: 0 auto 13px;
  place-items: center;
  border-radius: 20px;
  color: var(--green);
  background: var(--green-soft);
}

.empty-orb svg {
  width: 25px;
  height: 25px;
}

.empty-title {
  margin: 0 0 5px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 720;
}

.empty-copy {
  max-width: 250px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}

.empty-state .btn {
  margin-top: 17px;
}

.empty-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 17px;
}

.empty-actions .btn {
  margin-top: 0;
}

/* ---------- 按钮 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.btn:active {
  transform: scale(0.975);
}

.btn svg {
  width: 17px;
  height: 17px;
}

.btn-primary {
  color: #fbf7e9;
  background: var(--green);
  box-shadow: 0 10px 22px rgba(43, 92, 69, 0.2);
}

.btn-primary:active {
  background: var(--green-deep);
}

.btn-secondary {
  color: var(--ink-soft);
  border-color: var(--line);
  background: rgba(255, 253, 247, 0.76);
}

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

.btn-danger {
  color: #fff8f2;
  background: var(--terra);
  box-shadow: 0 10px 22px rgba(166, 83, 67, 0.2);
}

.btn-danger-soft {
  color: var(--terra);
  border-color: rgba(166, 83, 67, 0.16);
  background: var(--terra-soft);
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

/* ---------- 分段控件 ---------- */

.segmented {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid rgba(31, 57, 41, 0.07);
  border-radius: 12px;
  background: rgba(31, 57, 41, 0.055);
}

.segment {
  min-width: 48px;
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  font-size: 11.5px;
  font-weight: 650;
  transition: color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.segment.is-active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 3px 9px rgba(33, 48, 39, 0.09);
}

.segmented.wide {
  display: flex;
  width: 100%;
}

.segmented.wide .segment {
  flex: 1;
}

/* ---------- 复习页 ---------- */

body.focus-mode .app-shell {
  padding-bottom: calc(30px + var(--safe-bottom));
}

body.focus-mode .tabbar {
  display: none;
}

.study-screen {
  display: flex;
  min-height: calc(100vh - 30px - var(--safe-bottom));
  min-height: calc(100dvh - 30px - var(--safe-bottom));
  flex-direction: column;
  padding-top: calc(12px + var(--safe-top));
}

.study-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 1px 14px;
}

.study-head-copy {
  flex: 1;
  min-width: 0;
}

.study-head-title {
  color: var(--ink);
  font-size: 14px;
  font-weight: 750;
  letter-spacing: 0.01em;
}

.study-head-sub {
  color: var(--muted);
  font-size: 11px;
}

.study-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.study-progress {
  padding: 0 2px 10px;
}

.study-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 1px 10px;
}

.study-toolbar-label {
  color: var(--faint);
  font-size: 10.5px;
  letter-spacing: 0.04em;
}

.hint-toggle {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 4px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: rgba(255, 253, 247, 0.68);
  font-size: 10.5px;
  font-weight: 650;
  transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.hint-toggle svg {
  width: 15px;
  height: 15px;
}

.hint-toggle b {
  color: var(--faint);
  font-size: 9.5px;
  font-weight: 700;
}

.hint-toggle.is-on {
  color: var(--green);
  border-color: rgba(43, 92, 69, 0.15);
  background: var(--green-wash);
}

.hint-toggle.is-on b {
  color: var(--green);
}

.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.progress-meta strong {
  color: var(--ink-soft);
  font-weight: 750;
}

.progress-track {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(31, 57, 41, 0.09);
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.study-stage {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: flex-start;
  padding: 4px 0 12px;
}

.study-stage > .word-card {
  margin-top: auto;
  margin-bottom: auto;
}

.word-card {
  position: relative;
  overflow: hidden;
  padding: 30px 23px 25px;
  border: 1px solid rgba(31, 57, 41, 0.085);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(255, 255, 252, 0.7), transparent 30%),
    var(--surface);
  box-shadow: var(--shadow-md);
}

.word-card::before {
  position: absolute;
  top: 0;
  left: 25px;
  width: 44px;
  height: 3px;
  border-radius: 0 0 4px 4px;
  background: #d4bd88;
  content: "";
}

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

.card-kicker {
  color: var(--faint);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.word-term {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-family: var(--font-word);
  font-size: clamp(38px, 12vw, 56px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

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

.word-hint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  margin-top: 12px;
}

.hint-label {
  color: var(--faint);
  font-size: 10.5px;
  letter-spacing: 0.04em;
}

.hint-off {
  color: var(--faint);
  font-size: 11px;
}

.pos-chip {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 0 8px;
  border: 1px solid rgba(43, 92, 69, 0.1);
  border-radius: 7px;
  color: var(--green);
  background: var(--green-wash);
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
  font-size: 10.5px;
  font-weight: 600;
}

.blank-zone {
  margin-top: 25px;
  padding-top: 4px;
}

.blank-lines {
  display: flex;
  flex-direction: column;
  gap: 17px;
}

.blank-line {
  display: block;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, var(--line-strong), rgba(31, 57, 41, 0.04));
}

.blank-line:nth-child(2) {
  width: 88%;
}

.blank-line:nth-child(3) {
  width: 66%;
}

.blank-copy {
  margin: 18px 0 0;
  color: var(--faint);
  font-size: 11.5px;
  letter-spacing: 0.02em;
}

.reveal {
  animation: reveal-in 0.3s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

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

.answer {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.answer-label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 13px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.answer-label::after {
  height: 1px;
  flex: 1;
  background: var(--line);
  content: "";
}

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

.sense {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 9px;
}

.sense-pos {
  min-width: 42px;
  padding-top: 2px;
  color: var(--green);
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
  font-size: 10.5px;
  font-weight: 650;
  text-align: right;
}

.sense-zh {
  color: var(--ink-soft);
  font-size: 17px;
  font-weight: 520;
  line-height: 1.48;
  overflow-wrap: anywhere;
}

.outcome {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 19px;
  padding: 11px 13px;
  border-radius: 13px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.outcome strong {
  color: var(--ink-soft);
  font-weight: 750;
}

.outcome .outcome-icon {
  display: grid;
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  place-items: center;
  border-radius: 8px;
  color: var(--green);
  background: var(--green-soft);
}

.outcome .outcome-icon svg {
  width: 14px;
  height: 14px;
}

.outcome.is-miss {
  background: var(--terra-soft);
}

.outcome.is-miss .outcome-icon {
  color: var(--terra);
  background: rgba(166, 83, 67, 0.1);
}

.outcome.is-corrected {
  background: var(--amber-soft);
}

.outcome.is-corrected .outcome-icon {
  color: var(--amber);
  background: rgba(169, 115, 45, 0.11);
}

.answer-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.answer-tool {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 4px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  font-size: 10.5px;
  font-weight: 600;
}

.answer-tool:active {
  background: var(--surface-soft);
}

.answer-tool.danger {
  color: var(--terra);
  border-color: rgba(166, 83, 67, 0.16);
}

.answer-tool svg {
  width: 14px;
  height: 14px;
}

.previous-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin: 0 0 8px 2px;
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 650;
}

.previous-btn svg {
  width: 14px;
  height: 14px;
}

.score-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--terra);
  background: var(--terra-soft);
  font-size: 11px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.score-pill::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.score-pill.zero {
  color: var(--muted);
  background: var(--surface-soft);
}

.score-pill.zero::before {
  background: var(--faint);
}

.study-actions {
  position: sticky;
  z-index: 5;
  bottom: calc(6px + var(--safe-bottom));
  padding: 10px 0 4px;
  background: linear-gradient(180deg, rgba(243, 240, 232, 0), var(--paper) 34%);
}

.action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.action-btn {
  display: flex;
  min-height: 57px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 17px;
  font-size: 15px;
  font-weight: 750;
  transition: transform 0.16s ease, background 0.16s ease;
}

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

.action-btn svg {
  width: 18px;
  height: 18px;
}

.action-forgot {
  color: var(--terra-deep);
  border-color: rgba(166, 83, 67, 0.1);
  background: var(--terra-soft);
}

.action-known {
  color: #fbf7e9;
  background: var(--green);
  box-shadow: 0 12px 25px rgba(43, 92, 69, 0.2);
}

.action-known:active {
  background: var(--green-deep);
}

.revealed-actions {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.correction-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 9px;
}

.correction-btn {
  min-height: 50px;
  border: 1px solid rgba(169, 115, 45, 0.2);
  border-radius: 15px;
  color: var(--amber);
  background: var(--amber-soft);
  font-size: 13.5px;
  font-weight: 720;
}

.next-btn {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 15px;
  color: #fbf7e9;
  background: var(--ink);
  font-size: 14px;
  font-weight: 730;
}

.next-btn svg {
  width: 17px;
  height: 17px;
}

.study-footnote {
  margin: 12px 0 0;
  color: var(--faint);
  font-size: 10.5px;
  text-align: center;
  letter-spacing: 0.01em;
}

/* ---------- 列表复习 ---------- */

.list-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 14px;
}

.list-card {
  padding: 18px 18px 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: opacity 0.2s ease, background 0.2s ease;
}

.list-card.is-done {
  background: rgba(250, 248, 241, 0.82);
  box-shadow: none;
}

.list-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.list-card-index {
  color: var(--faint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.list-card-term {
  margin-top: 1px;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-family: var(--font-word);
  font-size: 27px;
  font-weight: 560;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.list-card .word-hint {
  margin-top: 7px;
}

.list-card .answer {
  margin-top: 14px;
  padding-top: 13px;
}

.list-card .sense-zh {
  font-size: 15px;
}

.list-card .outcome {
  margin-top: 13px;
}

.list-card .action-row {
  margin-top: 15px;
}

.list-card .action-btn {
  min-height: 47px;
  border-radius: 13px;
  font-size: 13px;
}

.list-card .correction-row {
  margin-top: 13px;
}

.list-card .correction-btn,
.list-card .next-btn {
  min-height: 44px;
}

.list-card .next-btn {
  border-radius: 13px;
}

.list-divider {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 4px 3px 1px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.list-divider::after {
  height: 1px;
  flex: 1;
  background: var(--line);
  content: "";
}

/* ---------- 完成页 ---------- */

.completion-screen {
  display: flex;
  min-height: calc(100vh - 60px - var(--safe-bottom));
  min-height: calc(100dvh - 60px - var(--safe-bottom));
  flex-direction: column;
  justify-content: center;
  padding: 20px 0 30px;
  text-align: center;
}

.completion-mark {
  display: grid;
  width: 82px;
  height: 82px;
  margin: 0 auto 22px;
  place-items: center;
  border-radius: 28px;
  color: var(--green);
  background: var(--green-soft);
  box-shadow: 0 18px 40px rgba(43, 92, 69, 0.12);
}

.completion-mark svg {
  width: 38px;
  height: 38px;
}

.completion-title {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-word);
  font-size: 35px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.completion-copy {
  margin: 8px auto 0;
  max-width: 280px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.completion-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin: 26px 0 15px;
}

.completion-next {
  margin: 0 auto 22px !important;
  font-size: 12px;
}

.completion-stat {
  padding: 13px 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 253, 247, 0.66);
}

.completion-stat strong {
  display: block;
  color: var(--ink);
  font-family: var(--font-word);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
}

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

.completion-actions {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

/* ---------- 表单 ---------- */

.form-card {
  padding: 21px 19px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.field {
  margin-bottom: 20px;
}

.field:last-child {
  margin-bottom: 0;
}

.field-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 720;
}

.field-label small {
  color: var(--faint);
  font-size: 10.5px;
  font-weight: 500;
}

.input,
.select,
.textarea {
  display: block;
  width: 100%;
  min-height: 49px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  color: var(--ink);
  background: var(--surface-soft);
  font-size: 16px;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
  -webkit-appearance: none;
  appearance: none;
}

.input::placeholder,
.textarea::placeholder {
  color: #b1b5ad;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: rgba(43, 92, 69, 0.45);
  outline: none;
  background: #fffef9;
  box-shadow: 0 0 0 3px rgba(43, 92, 69, 0.08);
}

.input.word-input {
  min-height: 58px;
  font-family: var(--font-word);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.select {
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%237e867e' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.textarea {
  min-height: 85px;
  resize: vertical;
  line-height: 1.5;
}

.field-error {
  margin: 6px 2px 0;
  color: var(--terra);
  font-size: 11.5px;
  font-weight: 600;
}

.field.has-error .input,
.field.has-error .select,
.sense-row.has-error .select,
.sense-row.has-error .input {
  border-color: rgba(166, 83, 67, 0.58);
  background: #fff9f6;
}

.helper {
  margin: 7px 2px 0;
  color: var(--faint);
  font-size: 10.5px;
  line-height: 1.55;
}

.sense-editor {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.sense-row {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr) 34px;
  align-items: start;
  gap: 7px;
}

.sense-row .select {
  min-height: 47px;
  padding-left: 10px;
  padding-right: 27px;
  background-position: right 10px center;
  font-size: 13px;
}

.sense-row .input {
  min-height: 47px;
  font-size: 15px;
}

.remove-sense {
  display: grid;
  width: 34px;
  height: 47px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 10px;
  color: var(--faint);
  background: transparent;
  transition: color 0.16s ease, background 0.16s ease;
}

.remove-sense:active {
  color: var(--terra);
  background: var(--terra-soft);
}

.remove-sense:disabled {
  opacity: 0.22;
  cursor: not-allowed;
}

.remove-sense svg {
  width: 17px;
  height: 17px;
}

.add-sense {
  display: flex;
  width: 100%;
  min-height: 43px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-top: 9px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  color: var(--green);
  background: rgba(239, 245, 239, 0.46);
  font-size: 12px;
  font-weight: 650;
}

.add-sense:active {
  background: var(--green-soft);
}

.add-sense svg {
  width: 15px;
  height: 15px;
}

.form-actions {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 18px;
}

.form-actions .btn {
  min-height: 52px;
}

.form-tip {
  display: flex;
  gap: 9px;
  margin-top: 15px;
  padding: 12px 13px;
  border-radius: 13px;
  color: var(--muted);
  background: rgba(255, 253, 247, 0.55);
  font-size: 11px;
  line-height: 1.55;
}

.form-tip svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  margin-top: 1px;
  color: var(--amber);
}

/* ---------- 词库 ---------- */

.library-toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 13px;
}

.search {
  position: relative;
  flex: 1;
}

.search svg {
  position: absolute;
  top: 50%;
  left: 13px;
  width: 17px;
  height: 17px;
  color: var(--faint);
  transform: translateY(-50%);
  pointer-events: none;
}

.search .input {
  min-height: 45px;
  padding-left: 39px;
  font-size: 14px;
  background: rgba(255, 253, 247, 0.7);
}

.library-count {
  flex: 0 0 auto;
  color: var(--faint);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}

.word-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.word-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 13px 13px 15px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 253, 247, 0.74);
  transition: background 0.16s ease, border-color 0.16s ease;
}

.word-row:active {
  background: var(--surface);
}

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

.word-row-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.word-row-term {
  overflow: hidden;
  color: var(--ink);
  font-family: var(--font-word);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.word-row-senses {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.word-row-senses .pos-inline {
  color: var(--green);
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
  font-size: 9.5px;
  font-weight: 650;
}

.word-row-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 2px;
  margin-top: -2px;
}

.row-icon {
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
}

.row-icon:active {
  color: var(--ink);
  background: var(--surface-soft);
}

.row-icon.danger:active {
  color: var(--terra);
  background: var(--terra-soft);
}

.row-icon svg {
  width: 17px;
  height: 17px;
}

.list-end-note {
  margin: 20px 0 0;
  color: var(--faint);
  font-size: 10.5px;
  text-align: center;
}

/* ---------- 设置 ---------- */

.settings-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.settings-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 253, 247, 0.72);
  box-shadow: var(--shadow-sm);
}

.settings-group-title {
  margin: 0;
  padding: 15px 16px 6px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.setting-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border-bottom: 1px solid rgba(31, 57, 41, 0.06);
}

.setting-row:last-child {
  border-bottom: 0;
}

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

.setting-label {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 650;
}

.setting-desc {
  margin-top: 2px;
  color: var(--faint);
  font-size: 10.5px;
  line-height: 1.45;
}

.setting-control {
  flex: 0 0 auto;
}

.setting-control .select {
  width: auto;
  min-width: 92px;
  min-height: 36px;
  padding: 6px 31px 6px 10px;
  border-radius: 9px;
  background-position: right 10px center;
  font-size: 12px;
}

.setting-control .score-input {
  width: 62px;
  min-height: 36px;
  padding: 6px 8px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

/* 开关 */
.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 29px;
  flex: 0 0 48px;
}

.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(31, 57, 41, 0.14);
  transition: background 0.2s ease;
}

.switch-track::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background: #fffdf7;
  box-shadow: 0 2px 5px rgba(30, 45, 35, 0.2);
  content: "";
  transition: transform 0.2s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.switch input:checked + .switch-track {
  background: var(--green);
}

.switch input:checked + .switch-track::after {
  transform: translateX(19px);
}

.switch input:focus-visible + .switch-track {
  outline: 3px solid rgba(43, 92, 69, 0.25);
  outline-offset: 2px;
}

.rules {
  margin: 0;
  padding: 2px 16px 15px 34px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.7;
}

.rules li {
  margin: 3px 0;
  padding-left: 2px;
}

.rules strong {
  color: var(--ink-soft);
  font-weight: 700;
}

.storage-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 16px 15px;
  padding: 11px 12px;
  border-radius: 12px;
  background: var(--surface-soft);
}

.storage-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  margin-top: 5px;
  border-radius: 50%;
  background: #5b9b78;
  box-shadow: 0 0 0 3px rgba(91, 155, 120, 0.12);
}

.storage-dot.local {
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(169, 115, 45, 0.12);
}

.storage-copy {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.55;
}

.storage-copy strong {
  display: block;
  margin-bottom: 1px;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 650;
}

.settings-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  padding: 0 16px 15px;
}

.settings-actions .btn {
  min-height: 42px;
  padding: 0 9px;
  font-size: 12px;
}

.settings-actions .btn-block {
  grid-column: 1 / -1;
}

.danger-zone {
  margin-top: 8px;
}

.app-foot {
  margin: 26px 0 0;
  color: var(--faint);
  font-size: 10.5px;
  line-height: 1.6;
  text-align: center;
}

.banner {
  display: flex;
  gap: 9px;
  margin: 0 0 14px;
  padding: 11px 13px;
  border: 1px solid rgba(169, 115, 45, 0.12);
  border-radius: 13px;
  color: var(--amber);
  background: var(--amber-soft);
  font-size: 11.5px;
  line-height: 1.5;
}

.banner svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  margin-top: 1px;
}

/* ---------- 底部导航 ---------- */

.tabbar {
  position: fixed;
  z-index: 30;
  bottom: 0;
  left: 50%;
  display: grid;
  width: 100%;
  max-width: 560px;
  grid-template-columns: 1fr 1fr 74px 1fr;
  align-items: end;
  padding: 8px 18px calc(8px + var(--safe-bottom));
  border-top: 1px solid rgba(31, 57, 41, 0.08);
  background: rgba(248, 245, 236, 0.86);
  box-shadow: 0 -12px 35px rgba(42, 52, 44, 0.045);
  transform: translateX(-50%);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  backdrop-filter: blur(20px) saturate(1.2);
}

.tab {
  display: flex;
  min-height: 49px;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex-direction: column;
  border-radius: 13px;
  color: #8c938b;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.03em;
  transition: color 0.16s ease, background 0.16s ease;
}

.tab:active {
  background: rgba(43, 92, 69, 0.05);
}

.tab.is-active {
  color: var(--green);
}

.tab-icon {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
}

.tab-icon svg {
  width: 21px;
  height: 21px;
}

.tab-add {
  padding-top: 0;
}

.tab-add .tab-plus {
  display: grid;
  width: 53px;
  height: 53px;
  margin-top: -19px;
  place-items: center;
  border: 4px solid rgba(248, 245, 236, 0.95);
  border-radius: 18px;
  color: #f8f2de;
  background: linear-gradient(145deg, #376d52, #1d4934);
  box-shadow: 0 10px 22px rgba(29, 73, 52, 0.24);
}

.tab-add .tab-plus svg {
  width: 23px;
  height: 23px;
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  z-index: 80;
  bottom: calc(104px + var(--safe-bottom));
  left: 50%;
  max-width: min(88vw, 420px);
  padding: 11px 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 13px;
  color: #fbf6e8;
  background: rgba(29, 43, 35, 0.94);
  box-shadow: 0 14px 34px rgba(19, 31, 23, 0.22);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.45;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 9px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.is-error {
  background: rgba(116, 47, 37, 0.96);
}

/* ---------- 弹窗 ---------- */

.modal-backdrop {
  position: fixed;
  z-index: 70;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 20px 16px calc(20px + var(--safe-bottom));
  background: rgba(24, 35, 28, 0.38);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  animation: fade-in 0.18s ease both;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal {
  width: 100%;
  max-width: 440px;
  padding: 21px 20px 17px;
  border-radius: 23px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.23s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

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

.modal-title {
  margin: 0;
  color: var(--ink);
  font-size: 19px;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.modal-body {
  margin: 7px 0 19px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.65;
}

.modal-body strong {
  color: var(--ink-soft);
}

.modal-edit {
  max-height: min(84vh, 760px);
  overflow-y: auto;
}

.modal-edit .modal-body {
  margin-bottom: 14px;
}

.modal-edit .field {
  margin-bottom: 14px;
}

.modal-edit .word-input {
  min-height: 52px;
  font-size: 23px;
}

.modal-edit .sense-row {
  grid-template-columns: 112px minmax(0, 1fr) 32px;
}

.modal-edit .modal-actions {
  margin-top: 15px;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.modal-actions .btn {
  min-height: 45px;
  font-size: 13px;
}

.modal-actions .btn-block {
  grid-column: 1 / -1;
}

/* ---------- 错误兜底 ---------- */

.fatal {
  max-width: 420px;
  margin: 18vh auto 0;
  padding: 26px;
  border: 1px solid rgba(166, 83, 67, 0.15);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  text-align: center;
}

.fatal h1 {
  margin: 0 0 8px;
  font-size: 20px;
}

.fatal p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

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

@media (min-width: 640px) {
  .app-shell {
    padding-right: 22px;
    padding-left: 22px;
  }

  .tabbar {
    border-right: 1px solid rgba(31, 57, 41, 0.05);
    border-left: 1px solid rgba(31, 57, 41, 0.05);
    border-radius: 22px 22px 0 0;
  }

  .hero-card {
    padding: 27px 27px 24px;
  }

  .hero-count {
    font-size: 86px;
  }
}

@media (max-width: 360px) {
  .app-shell {
    padding-right: 14px;
    padding-left: 14px;
  }

  .page-title {
    font-size: 26px;
  }

  .hero-card {
    padding: 21px 19px 19px;
  }

  .hero-count {
    font-size: 68px;
  }

  .hero-empty-title {
    font-size: 27px;
    line-height: 1.2;
  }

  .completion-title {
    font-size: 30px;
  }

  .sense-row {
    grid-template-columns: 102px minmax(0, 1fr) 31px;
  }

  .word-card {
    padding: 26px 19px 22px;
  }

  .stat {
    padding: 12px 11px;
  }
}

@media (max-height: 690px) {
  .study-screen {
    min-height: auto;
  }

  .study-stage {
    padding-top: 0;
    padding-bottom: 0;
  }

  .word-card {
    padding-top: 24px;
    padding-bottom: 21px;
  }

  .word-term {
    font-size: 38px;
  }

  .blank-zone {
    margin-top: 18px;
  }

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

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