/* =========================================================
   研词 · YANCI
   设计语言：纸张、墨绿、朱砂；安静、专注、有手感。
   ========================================================= */

:root {
  --bg: #f3eee3;
  --bg-deep: #ebe4d5;
  --surface: #fffdf7;
  --surface-2: #f9f4e9;
  --surface-3: #f1eadb;
  --ink: #1e2a24;
  --ink-soft: #38473f;
  --muted: #6f7b73;
  --faint: #9ba59d;
  --line: #e2dac9;
  --line-strong: #d3c8b3;
  --green: #235b42;
  --green-deep: #173c2c;
  --green-ink: #174630;
  --green-soft: #e5efe7;
  --green-mist: #eef5ef;
  --red: #b34a3b;
  --red-soft: #f8e9e5;
  --red-ink: #8e3529;
  --gold: #a97c25;
  --gold-soft: #f5ecd6;
  --blue: #3d6580;
  --sidebar-bg: #1a3a2c;
  --sidebar-bg-2: #142e23;
  --sidebar-ink: #f4eddd;
  --sidebar-muted: #a9bcb1;
  --shadow-sm: 0 1px 2px rgba(38, 45, 38, 0.04), 0 6px 18px rgba(45, 55, 44, 0.045);
  --shadow-md: 0 2px 6px rgba(38, 45, 38, 0.05), 0 18px 48px rgba(45, 55, 44, 0.09);
  --shadow-lg: 0 24px 80px rgba(23, 40, 30, 0.18);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 26px;
  --sidebar-w: 246px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei",
    "Noto Sans SC", "Hiragino Sans GB", sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", "Songti SC", "STSong", "Noto Serif CJK SC",
    "Source Han Serif SC", "SimSun", Georgia, serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #111814;
  --bg-deep: #0d130f;
  --surface: #19221d;
  --surface-2: #1e2923;
  --surface-3: #243129;
  --ink: #eef1e8;
  --ink-soft: #d4dbd2;
  --muted: #98a79d;
  --faint: #6f7e74;
  --line: #2d3b33;
  --line-strong: #3c4c42;
  --green: #6fae8c;
  --green-deep: #24503b;
  --green-ink: #bfe3ce;
  --green-soft: #223a2e;
  --green-mist: #1d2d25;
  --red: #d9897b;
  --red-soft: #3a2521;
  --red-ink: #f0b4a9;
  --gold: #d3ac5c;
  --gold-soft: #382f1d;
  --blue: #8db3c9;
  --sidebar-bg: #0d1612;
  --sidebar-bg-2: #0a120e;
  --sidebar-ink: #edf0e7;
  --sidebar-muted: #8fa197;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2), 0 6px 18px rgba(0, 0, 0, 0.12);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.24), 0 18px 48px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 24px 80px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 8% 4%, rgba(255, 255, 255, 0.5), transparent 32%),
    radial-gradient(circle at 92% 12%, rgba(169, 124, 37, 0.05), transparent 38%);
}

[data-theme="dark"] body::before {
  background:
    radial-gradient(circle at 8% 4%, rgba(111, 174, 140, 0.05), transparent 34%),
    radial-gradient(circle at 92% 12%, rgba(211, 172, 92, 0.035), transparent 40%);
}

::selection {
  color: #fffdf7;
  background: var(--green);
}

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

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

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

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

img,
svg {
  display: block;
}

svg {
  flex: 0 0 auto;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

.skip-link {
  position: fixed;
  top: -60px;
  left: 16px;
  z-index: 999;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--surface);
  transition: top 0.2s;
}

.skip-link:focus-visible {
  top: 12px;
}

.noscript {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  padding: 32px;
  background: var(--bg);
  color: var(--ink);
  text-align: center;
}

/* ---------------- 布局 ---------------- */

.app-root,
.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
}

.app-shell {
  position: relative;
  z-index: 1;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-w);
  padding: 30px 18px 22px;
  background:
    radial-gradient(circle at 10% 0%, rgba(255, 255, 255, 0.07), transparent 28%),
    linear-gradient(165deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 100%);
  color: var(--sidebar-ink);
  overflow: hidden;
}

.sidebar::after {
  content: "";
  position: absolute;
  right: -54px;
  bottom: 62px;
  width: 160px;
  height: 160px;
  border: 1px solid rgba(244, 237, 221, 0.08);
  border-radius: 50%;
  pointer-events: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px 28px;
}

.brand-seal {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(244, 237, 221, 0.3);
  border-radius: 12px;
  background: rgba(244, 237, 221, 0.06);
  color: #f4eddd;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  box-shadow: inset 0 0 0 3px rgba(26, 58, 44, 0.7);
}

.brand-name {
  display: block;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1.2;
}

.brand-sub {
  display: block;
  margin-top: 3px;
  color: var(--sidebar-muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 46px;
  padding: 0 13px;
  border-radius: 12px;
  color: var(--sidebar-muted);
  font-size: 14.5px;
  font-weight: 500;
  transition: background 0.18s, color 0.18s, transform 0.18s;
}

.nav-item:hover {
  background: rgba(244, 237, 221, 0.06);
  color: var(--sidebar-ink);
}

.nav-item:active {
  transform: scale(0.985);
}

.nav-item.active {
  background: rgba(244, 237, 221, 0.11);
  color: #fbf6e9;
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 13px;
  bottom: 13px;
  width: 2px;
  border-radius: 2px;
  background: #d6b36a;
}

.nav-item .nav-badge {
  margin-left: auto;
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 20px;
  background: rgba(214, 179, 106, 0.18);
  color: #e5c88c;
  font-family: var(--mono);
  font-size: 10.5px;
  text-align: center;
}

.sidebar-foot {
  margin-top: auto;
  padding: 18px 10px 2px;
}

.streak-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 13px;
  border: 1px solid rgba(244, 237, 221, 0.1);
  border-radius: 13px;
  background: rgba(244, 237, 221, 0.04);
  color: var(--sidebar-muted);
  font-size: 12px;
}

.streak-pill strong {
  color: #f0d59a;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
}

.sidebar-quote {
  margin-top: 16px;
  padding: 0 6px;
  color: rgba(244, 237, 221, 0.4);
  font-family: var(--serif);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  line-height: 1.8;
}

.main-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  margin-left: var(--sidebar-w);
}

.main {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 38px 44px 80px;
}

.mobile-topbar {
  display: none;
}

/* ---------------- 通用排版与组件 ---------------- */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 28px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--gold);
}

.page-title {
  margin-top: 7px;
  font-family: var(--serif);
  font-size: clamp(28px, 3.2vw, 39px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.24;
}

.page-title em {
  font-style: normal;
  color: var(--green);
  background-image: linear-gradient(transparent 66%, var(--gold-soft) 66%);
  background-repeat: no-repeat;
}

.page-sub {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13.5px;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

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

.card-pad {
  padding: 24px;
}

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

.section-title h2 {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.section-title .link-btn {
  font-size: 12.5px;
}

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--green);
  font-weight: 600;
  font-size: 13px;
}

.link-btn:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

.faint {
  color: var(--faint);
}

.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition: transform 0.16s, background 0.18s, border-color 0.18s, box-shadow 0.18s, color 0.18s;
}

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

.btn:active {
  transform: translateY(0) scale(0.985);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
  box-shadow: none;
}

.btn-primary {
  background: var(--green);
  color: #fbf7ec;
  box-shadow: 0 8px 22px rgba(30, 80, 57, 0.17);
}

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

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

.btn-ghost {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink-soft);
}

.btn-ghost:hover {
  border-color: var(--green);
  color: var(--green);
}

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

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

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

.btn-lg {
  height: 50px;
  padding: 0 24px;
  border-radius: 14px;
  font-size: 15px;
}

.btn-sm {
  height: 34px;
  padding: 0 12px;
  border-radius: 9px;
  font-size: 12.5px;
}

.btn-block {
  width: 100%;
}

.icon-btn {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  color: var(--muted);
  transition: background 0.18s, color 0.18s, transform 0.16s;
}

.icon-btn:hover {
  background: var(--surface-2);
  color: var(--ink);
}

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

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

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border-radius: 7px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

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

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

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

.badge-plain {
  background: var(--surface-2);
  color: var(--muted);
}

.mastery-dots {
  display: inline-flex;
  align-items: center;
  gap: 3.5px;
}

.mastery-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--line-strong);
}

.mastery-dots i.on {
  background: var(--green);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 54px 24px;
  color: var(--muted);
  text-align: center;
}

.empty-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--faint);
}

.empty-state h3 {
  margin-bottom: 5px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
}

.empty-state p {
  max-width: 320px;
  font-size: 13px;
  line-height: 1.7;
}

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

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

.home-head {
  margin-bottom: 26px;
}

.home-title {
  margin-top: 8px;
  font-family: var(--serif);
  font-size: clamp(30px, 3.4vw, 42px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.25;
}

.home-title em {
  font-style: normal;
  color: var(--green);
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 0.95fr);
  gap: 18px;
  margin-bottom: 18px;
}

.goal-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 26px;
  min-height: 196px;
  padding: 28px 30px;
  border: 0;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 100% 0%, rgba(214, 179, 106, 0.17), transparent 38%),
    linear-gradient(140deg, #23523c 0%, #16382a 100%);
  color: #f7f1e2;
  box-shadow: 0 20px 44px rgba(24, 58, 42, 0.18);
  overflow: hidden;
}

.goal-card::after {
  content: "";
  position: absolute;
  right: -38px;
  bottom: -88px;
  width: 210px;
  height: 210px;
  border: 1px solid rgba(247, 241, 226, 0.1);
  border-radius: 50%;
  box-shadow: 0 0 0 24px rgba(247, 241, 226, 0.025);
  pointer-events: none;
}

.goal-ring {
  position: relative;
  width: 116px;
  height: 116px;
  flex: 0 0 auto;
}

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

.goal-ring .ring-bg {
  fill: none;
  stroke: rgba(247, 241, 226, 0.13);
  stroke-width: 7;
}

.goal-ring .ring-value {
  fill: none;
  stroke: #e6c57c;
  stroke-width: 7;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.7s ease;
}

.goal-ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
}

.goal-ring-label strong {
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
}

.goal-ring-label span {
  color: rgba(247, 241, 226, 0.58);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
}

.goal-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.goal-copy .eyebrow {
  color: rgba(247, 241, 226, 0.55);
}

.goal-copy .eyebrow::before {
  background: #d6b36a;
}

.goal-copy h2 {
  margin: 6px 0 4px;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.goal-copy p {
  color: rgba(247, 241, 226, 0.66);
  font-size: 12.5px;
}

.goal-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  margin-top: 18px;
  padding: 0 15px;
  border-radius: 10px;
  background: #f3ead7;
  color: #1a3d2c;
  font-size: 13px;
  font-weight: 700;
  transition: transform 0.16s, background 0.18s;
}

.goal-cta:hover {
  transform: translateY(-1px);
  background: #fff7e6;
}

.quote-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 196px;
  padding: 26px 26px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.7), rgba(249, 244, 233, 0.9)),
    var(--surface-2);
  overflow: hidden;
}

[data-theme="dark"] .quote-card {
  background: var(--surface);
}

.quote-mark {
  color: var(--gold);
  font-family: var(--serif);
  font-size: 44px;
  line-height: 0.8;
  opacity: 0.55;
}

.quote-text {
  margin: 10px 0 16px;
  font-family: var(--serif);
  font-size: 17px;
  letter-spacing: 0.02em;
  line-height: 1.75;
}

.quote-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 11.5px;
}

.quote-seal {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(179, 74, 59, 0.45);
  border-radius: 7px;
  color: var(--red);
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.05em;
  transform: rotate(-4deg);
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 18px 19px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.stat-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 12px;
  background: var(--green-soft);
  color: var(--green);
}

.stat-icon.gold {
  background: var(--gold-soft);
  color: var(--gold);
}

.stat-icon.red {
  background: var(--red-soft);
  color: var(--red);
}

.stat-body {
  min-width: 0;
}

.stat-value {
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.stat-value small {
  margin-left: 2px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
}

.stat-label {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.9fr);
  gap: 18px;
}

.chart-card {
  padding: 22px 24px 18px;
  min-width: 0;
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 156px;
  margin-top: 10px;
  padding-top: 20px;
  min-width: 0;
}

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

.bar-value {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9.5px;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.2s;
}

.bar-col:hover .bar-value,
.bar-col.is-today .bar-value {
  opacity: 1;
}

.bar-track {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.bar {
  width: min(26px, 62%);
  min-height: 4px;
  border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, #cfe2d4 0%, #b8d3c0 100%);
  transition: height 0.5s cubic-bezier(0.2, 0.75, 0.3, 1), background 0.2s;
}

.bar-col.is-today .bar {
  background: linear-gradient(180deg, #3f7a5d 0%, #235b42 100%);
  box-shadow: 0 6px 14px rgba(35, 91, 66, 0.2);
}

[data-theme="dark"] .bar {
  background: linear-gradient(180deg, #355444, #2a4437);
}

[data-theme="dark"] .bar-col.is-today .bar {
  background: linear-gradient(180deg, #8fc8a8, #5e9e7b);
}

.bar-label {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 9.5px;
  line-height: 1;
}

.bar-col.is-today .bar-label {
  color: var(--green);
  font-weight: 700;
}

.wordbook-preview {
  display: flex;
  flex-direction: column;
  padding: 22px 22px 16px;
}

.preview-list {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.preview-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}

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

.preview-word {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.preview-meaning {
  flex: 1;
  overflow: hidden;
  color: var(--muted);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-empty {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 14px 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.8;
}

/* ---------------- 开始刷词 ---------------- */

.scope-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-2);
}

.scope-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 16px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}

.scope-tab:hover {
  color: var(--ink);
}

.scope-tab.active {
  background: var(--surface);
  color: var(--green);
  box-shadow: 0 2px 8px rgba(40, 50, 40, 0.07);
}

.scope-card {
  padding: 22px;
}

.unit-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.unit-toolbar-copy {
  color: var(--muted);
  font-size: 12.5px;
}

.unit-toolbar-copy strong {
  color: var(--ink);
  font-weight: 600;
}

.unit-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.text-btn {
  height: 30px;
  padding: 0 9px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.text-btn:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.unit-grid-wrap {
  position: relative;
}

.unit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
  max-height: 430px;
  padding: 3px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.unit-grid::-webkit-scrollbar {
  width: 8px;
}

.unit-grid::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 8px;
  background: var(--line-strong);
  background-clip: content-box;
}

.unit-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 1px;
  min-height: 55px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink-soft);
  text-align: left;
  transition: border-color 0.15s, background 0.15s, color 0.15s, transform 0.15s;
}

.unit-btn:hover {
  border-color: var(--green);
  background: var(--green-mist);
}

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

.unit-btn .unit-num {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.unit-btn .unit-count {
  color: var(--faint);
  font-size: 9.5px;
}

.unit-btn.selected {
  border-color: var(--green);
  background: var(--green);
  color: #fbf7ec;
  box-shadow: 0 4px 12px rgba(35, 91, 66, 0.14);
}

.unit-btn.selected .unit-count {
  color: rgba(251, 247, 236, 0.62);
}

.unit-btn.selected::after {
  content: "✓";
  position: absolute;
  top: 6px;
  right: 7px;
  font-size: 9px;
  line-height: 1;
  opacity: 0.75;
}

.scope-hero {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 150px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    radial-gradient(circle at 100% 0%, rgba(169, 124, 37, 0.08), transparent 36%),
    var(--surface-2);
}

.scope-hero-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 16px;
  background: var(--surface);
  color: var(--green);
  box-shadow: var(--shadow-sm);
}

.scope-hero h3 {
  margin-bottom: 4px;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
}

.scope-hero p {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.8;
}

.scope-hero .scope-numbers {
  display: flex;
  gap: 22px;
  margin-top: 13px;
}

.scope-number strong {
  display: block;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.1;
}

.scope-number span {
  color: var(--faint);
  font-size: 10px;
}

.setup-dock {
  position: sticky;
  bottom: 18px;
  z-index: 15;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 17px;
  background: rgba(255, 253, 247, 0.92);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

[data-theme="dark"] .setup-dock {
  background: rgba(25, 34, 29, 0.94);
}

.dock-summary {
  min-width: 150px;
}

.dock-summary strong {
  display: block;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
}

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

.dock-count {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-left: auto;
}

.count-label {
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
}

.count-chips {
  display: flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}

.count-chip {
  min-width: 40px;
  height: 31px;
  padding: 0 9px;
  border-radius: 7px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.count-chip:hover {
  color: var(--ink);
}

.count-chip.active {
  background: var(--surface);
  color: var(--green);
  box-shadow: 0 1px 5px rgba(40, 50, 40, 0.09);
}

.custom-count {
  width: 62px;
  height: 33px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
  font-family: var(--mono);
  font-size: 12px;
  text-align: center;
  outline: none;
}

.custom-count:focus {
  border-color: var(--green);
}

.dock-start {
  min-width: 132px;
}

.dock-note {
  flex: 1 0 100%;
  width: 100%;
  color: var(--muted);
  font-size: 11px;
}

.setup-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 14px;
  padding: 15px 18px;
}

.setup-option-copy strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
}

.setup-option-copy span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.6;
}

.setup-footnote {
  margin: 20px 0 4px;
  color: var(--faint);
  font-size: 10.5px;
  text-align: center;
}

.setup-footnote strong {
  color: var(--ink-soft);
  font-weight: 600;
}

.scope-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 12px;
  padding: 4px;
}

.scope-preview-item {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11.5px;
}

.scope-preview-item span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.03em;
}

/* ---------------- 刷词界面 ---------------- */

.focus-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 50% -10%, rgba(35, 91, 66, 0.07), transparent 42%),
    var(--bg);
}

.practice {
  display: flex;
  flex-direction: column;
  width: min(850px, 100%);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 22px 30px calc(34px + env(safe-area-inset-bottom));
}

.practice-top {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
}

.practice-progress {
  min-width: 0;
}

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

.practice-progress-label strong {
  overflow: hidden;
  color: var(--ink-soft);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-track {
  height: 4px;
  border-radius: 4px;
  background: var(--line);
  overflow: hidden;
}

.progress-track > i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4f8768, var(--green));
  transition: width 0.4s cubic-bezier(0.2, 0.75, 0.3, 1);
}

.practice-counter {
  min-width: 58px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.practice-counter strong {
  color: var(--ink);
  font-size: 15px;
}

.practice-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 34px 0 20px;
}

.practice-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 11.5px;
}

.stage-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
}

.stage-dot.review {
  background: var(--gold);
}

.prompt-card {
  position: relative;
  padding: 36px 38px 30px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.25), transparent 30%),
    var(--surface);
  box-shadow: var(--shadow-md);
  text-align: center;
  overflow: hidden;
}

.prompt-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 78px;
  height: 3px;
  border-radius: 0 0 4px 4px;
  background: var(--green);
  transform: translateX(-50%);
  opacity: 0.75;
}

.prompt-card.review-mode::before {
  background: var(--gold);
}

.prompt-kicker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.prompt-kicker::before,
.prompt-kicker::after {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--line-strong);
}

.prompt-meaning {
  max-width: 620px;
  margin: 0 auto;
  font-family: var(--serif);
  font-size: clamp(28px, 4.4vw, 43px);
  font-weight: 500;
  letter-spacing: 0.005em;
  line-height: 1.55;
  word-break: break-word;
}

.prompt-meaning.is-long {
  font-size: clamp(22px, 3.3vw, 32px);
  line-height: 1.65;
}

.prompt-meaning .meaning-line + .meaning-line {
  margin-top: 6px;
}

.prompt-meaning .meaning-pos {
  color: var(--gold);
  font-family: var(--sans);
  font-size: 0.46em;
  font-weight: 700;
  letter-spacing: 0.04em;
  vertical-align: 0.32em;
  margin-right: 0.35em;
}

.prompt-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 20px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.prompt-meta .sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--line-strong);
}

.answer-form {
  margin-top: 26px;
}

.answer-label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11.5px;
  text-align: center;
}

.answer-input {
  width: 100%;
  height: 68px;
  padding: 4px 14px;
  border: 0;
  border-bottom: 2px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(24px, 3.5vw, 33px);
  letter-spacing: 0.05em;
  text-align: center;
  outline: none;
  transition: border-color 0.18s, background 0.18s;
}

.answer-input::placeholder {
  color: var(--faint);
  font-family: var(--sans);
  font-size: 14px;
  letter-spacing: 0;
}

.answer-input:focus {
  border-color: var(--green);
  background: linear-gradient(180deg, transparent, rgba(229, 239, 231, 0.22));
}

.answer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

.answer-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 8px;
  color: var(--muted);
  font-size: 12px;
}

.answer-hint:hover {
  color: var(--gold);
}

.answer-submit {
  min-width: 132px;
}

.practice-foot {
  margin-top: auto;
  padding-top: 18px;
  color: var(--faint);
  font-size: 10.5px;
  text-align: center;
}

.practice-foot kbd {
  display: inline-block;
  min-width: 20px;
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--surface);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
}

.feedback {
  margin-top: 18px;
  padding: 19px 22px;
  border: 1px solid transparent;
  border-radius: 16px;
  animation: rise 0.28s ease both;
}

.feedback.correct {
  border-color: rgba(35, 91, 66, 0.16);
  background: var(--green-mist);
}

.feedback.wrong {
  border-color: rgba(179, 74, 59, 0.18);
  background: var(--red-soft);
}

.feedback-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
  font-size: 12px;
  font-weight: 700;
}

.feedback.correct .feedback-head {
  color: var(--green);
}

.feedback.wrong .feedback-head {
  color: var(--red-ink);
}

.feedback-word {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.feedback-word strong {
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.3;
}

.feedback-phonetic {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11.5px;
}

.feedback-meaning {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.feedback-user {
  margin-top: 5px;
  color: var(--red-ink);
  font-size: 11.5px;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  opacity: 0.8;
}

.feedback-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 13px;
}

.feedback-note {
  margin-right: auto;
  color: var(--muted);
  font-size: 10.5px;
}

.review-intro {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 34px 20px;
  text-align: center;
}

.review-ring {
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  background: var(--gold-soft);
  color: var(--gold);
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 600;
}

.review-intro h2 {
  font-family: var(--serif);
  font-size: 29px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.review-intro p {
  max-width: 430px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.review-words {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 18px 0 24px;
}

.review-words span {
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
}

.review-banner {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  margin-bottom: 14px;
  border: 1px solid rgba(169, 124, 37, 0.18);
  border-radius: 11px;
  background: var(--gold-soft);
  color: var(--gold);
  font-size: 11.5px;
}

.review-banner strong {
  font-weight: 700;
}

/* ---------------- 结果页 ---------------- */

.result-wrap {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 36px 24px calc(48px + env(safe-area-inset-bottom));
}

.result-card {
  padding: 34px 34px 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  animation: rise 0.45s ease both;
}

.result-head {
  display: flex;
  align-items: center;
  gap: 26px;
  padding-bottom: 25px;
  border-bottom: 1px solid var(--line);
}

.result-ring {
  position: relative;
  width: 122px;
  height: 122px;
  flex: 0 0 auto;
}

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

.result-ring .ring-bg {
  fill: none;
  stroke: var(--line);
  stroke-width: 8;
}

.result-ring .ring-value {
  fill: none;
  stroke: var(--green);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.9s ease;
}

.result-ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.result-ring-label strong {
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 600;
  line-height: 1;
}

.result-ring-label span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9.5px;
}

.result-copy h1 {
  font-family: var(--serif);
  font-size: clamp(26px, 3.4vw, 34px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.result-copy p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.8;
}

.result-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  color: var(--green);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 22px 0;
}

.result-stat {
  padding: 13px 12px;
  border-radius: 12px;
  background: var(--surface-2);
  text-align: center;
}

.result-stat strong {
  display: block;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
}

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

.result-missed {
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

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

.result-missed-head h2 {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
}

.missed-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: 260px;
  overflow-y: auto;
}

.missed-item {
  display: grid;
  grid-template-columns: minmax(120px, 0.7fr) minmax(0, 1.3fr);
  gap: 18px;
  align-items: baseline;
  padding: 9px 2px;
  border-bottom: 1px dashed var(--line);
}

.missed-item:last-child {
  border-bottom: 0;
}

.missed-word {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
}

.missed-word strong {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
}

.missed-word span {
  overflow: hidden;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.result-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.result-actions .btn {
  flex: 1;
}

.result-all-clear {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 15px;
  border: 1px solid rgba(35, 91, 66, 0.14);
  border-radius: 12px;
  background: var(--green-mist);
  color: var(--green-ink);
  font-size: 12px;
  line-height: 1.6;
}

/* ---------------- 生词本 ---------------- */

.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.filter-chips {
  display: flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
}

.filter-chip {
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.filter-chip.active {
  background: var(--surface);
  color: var(--green);
  box-shadow: 0 1px 4px rgba(40, 50, 40, 0.08);
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 190px;
}

.search-box svg {
  position: absolute;
  top: 50%;
  left: 12px;
  color: var(--faint);
  transform: translateY(-50%);
}

.search-box input {
  width: 100%;
  height: 39px;
  padding: 0 13px 0 37px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font-size: 12.5px;
  outline: none;
  transition: border-color 0.18s;
}

.search-box input:focus {
  border-color: var(--green);
}

.search-box input::placeholder {
  color: var(--faint);
}

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

.word-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  transition: border-color 0.18s, box-shadow 0.18s;
}

.word-row:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}

.word-main {
  min-width: 0;
}

.word-line {
  display: flex;
  align-items: baseline;
  gap: 9px;
  flex-wrap: wrap;
}

.word-line strong {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.005em;
  line-height: 1.3;
}

.word-phonetic {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10.5px;
}

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

.word-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
  color: var(--faint);
  font-size: 9.5px;
}

.word-actions {
  display: flex;
  align-items: center;
  gap: 3px;
}

.word-actions .icon-btn {
  width: 34px;
  height: 34px;
  color: var(--faint);
}

.wordbook-count {
  color: var(--muted);
  font-size: 12px;
}

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

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

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

.summary-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 11.5px;
}

.summary-top svg {
  color: var(--faint);
}

.summary-card strong {
  display: block;
  margin-top: 9px;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.summary-card strong small {
  margin-left: 3px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0;
}

.summary-sub {
  margin-top: 4px;
  color: var(--faint);
  font-size: 10px;
}

.stats-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(0, 0.92fr);
  gap: 18px;
  margin-bottom: 18px;
}

.stats-card {
  padding: 22px 24px;
}

.mastery-bar {
  display: flex;
  height: 10px;
  margin: 18px 0 12px;
  border-radius: 10px;
  background: var(--line);
  overflow: hidden;
}

.mastery-bar i {
  display: block;
  height: 100%;
  transition: width 0.6s ease;
}

.mastery-bar .seg-mastered {
  background: var(--green);
}

.mastery-bar .seg-learning {
  background: #c6a45e;
}

.mastery-bar .seg-untouched {
  background: var(--line);
}

.mastery-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-size: 10.5px;
}

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

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.legend-dot.green {
  background: var(--green);
}

.legend-dot.gold {
  background: #c6a45e;
}

.legend-dot.grey {
  background: var(--line-strong);
}

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

.dict-progress-nums {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 10.5px;
}

.dict-progress-nums strong {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
}

.donut-wrap {
  display: flex;
  align-items: center;
  gap: 20px;
}

.donut {
  position: relative;
  width: 104px;
  height: 104px;
  flex: 0 0 auto;
}

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

.donut .donut-bg {
  fill: none;
  stroke: var(--line);
  stroke-width: 10;
}

.donut .donut-value {
  fill: none;
  stroke: var(--green);
  stroke-width: 10;
  stroke-linecap: round;
}

.donut-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.donut-label strong {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
}

.donut-label span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.weak-list {
  display: flex;
  flex-direction: column;
}

.weak-item {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
}

.weak-item:last-child {
  border-bottom: 0;
}

.weak-rank {
  width: 17px;
  flex: 0 0 auto;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 9.5px;
}

.weak-word {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
}

.weak-meaning {
  flex: 1;
  overflow: hidden;
  color: var(--muted);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weak-wrong {
  color: var(--red);
  font-family: var(--mono);
  font-size: 9.5px;
}

.recent-list {
  display: flex;
  flex-direction: column;
}

.recent-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}

.recent-item:last-child {
  border-bottom: 0;
}

.recent-date {
  width: 47px;
  flex: 0 0 auto;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 9.5px;
  line-height: 1.45;
}

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

.recent-copy strong {
  display: block;
  overflow: hidden;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-copy span {
  color: var(--faint);
  font-size: 10px;
}

.recent-score {
  color: var(--green);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
}

.stats-empty {
  padding: 28px 10px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  line-height: 1.8;
}

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

.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 18px;
  align-items: start;
}

.settings-card {
  padding: 6px 22px;
}

.settings-card + .settings-card {
  margin-top: 14px;
}

.settings-card-head {
  padding: 17px 0 10px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 0;
  border-top: 1px solid var(--line);
}

.setting-row:first-of-type {
  border-top: 0;
}

.setting-copy strong {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
}

.setting-copy span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.6;
}

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

.segmented {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
}

.segmented button {
  min-width: 36px;
  height: 29px;
  padding: 0 9px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
}

.segmented button.active {
  background: var(--surface);
  color: var(--green);
  box-shadow: 0 1px 4px rgba(40, 50, 40, 0.08);
}

.switch {
  position: relative;
  display: inline-flex;
  width: 42px;
  height: 24px;
  flex: 0 0 auto;
  cursor: pointer;
}

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

.switch-track {
  width: 100%;
  height: 100%;
  border-radius: 24px;
  background: var(--line-strong);
  transition: background 0.2s;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(30, 40, 30, 0.2);
  transition: transform 0.2s;
}

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

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

.switch input:focus-visible + .switch-track {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.data-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0 18px;
}

.about-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.about-seal {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 13px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: var(--surface-2);
  color: var(--green);
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 700;
}

.about-card h3 {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
}

.about-card p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.75;
}

.about-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 15px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 10px;
}

.about-meta a {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.install-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  margin-bottom: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  background: var(--surface-2);
}

.install-card-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 10px;
  background: var(--green-soft);
  color: var(--green);
}

.install-card-copy {
  flex: 1;
  min-width: 0;
}

.install-card-copy strong {
  display: block;
  font-size: 12.5px;
}

.install-card-copy span {
  color: var(--muted);
  font-size: 10.5px;
}

.danger-zone {
  margin-top: 14px;
  padding: 18px 22px;
  border: 1px solid rgba(179, 74, 59, 0.2);
  border-radius: var(--radius);
  background: var(--surface);
}

.danger-zone h3 {
  color: var(--red-ink);
  font-size: 13px;
  font-weight: 700;
}

.danger-zone p {
  margin: 4px 0 12px;
  color: var(--muted);
  font-size: 10.5px;
}

/* ---------------- 弹窗 / 提示 ---------------- */

.modal-root:empty {
  display: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(16, 27, 21, 0.48);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fade-in 0.18s ease both;
}

.modal {
  width: min(440px, 100%);
  max-height: min(720px, calc(100dvh - 40px));
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.24s cubic-bezier(0.2, 0.8, 0.3, 1) both;
  overflow: hidden;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 21px 22px 0;
}

.modal-head h2 {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.modal-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.65;
}

.modal-body {
  padding: 18px 22px 4px;
  overflow-y: auto;
}

.modal-foot {
  display: flex;
  gap: 9px;
  justify-content: flex-end;
  padding: 16px 22px 20px;
}

.modal-foot .btn {
  min-width: 84px;
}

.form-field + .form-field {
  margin-top: 14px;
}

.form-label {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 600;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 13px;
  outline: none;
  transition: border-color 0.18s, background 0.18s;
}

.form-input {
  height: 42px;
}

.form-textarea {
  min-height: 82px;
  resize: vertical;
  line-height: 1.7;
}

.form-input:focus,
.form-textarea:focus {
  border-color: var(--green);
  background: var(--surface);
}

.form-hint {
  margin-top: 5px;
  color: var(--faint);
  font-size: 10px;
  line-height: 1.6;
}

.form-error {
  margin-top: 6px;
  color: var(--red);
  font-size: 10.5px;
}

.confirm-copy {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.8;
}

.confirm-copy strong {
  color: var(--ink);
}

.toast-root {
  position: fixed;
  right: 0;
  bottom: calc(24px + env(safe-area-inset-bottom));
  left: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 10px 15px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 11px;
  background: rgba(25, 39, 31, 0.94);
  color: #f7f3e8;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
  font-size: 12px;
  line-height: 1.5;
  animation: toast-in 0.22s ease both;
  backdrop-filter: blur(8px);
}

.toast.leaving {
  animation: toast-out 0.2s ease both;
}

.toast.error {
  background: rgba(125, 45, 35, 0.95);
}

/* ---------------- 动画 ---------------- */

.view-enter {
  animation: rise 0.35s ease both;
}

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

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

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

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

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

@keyframes shake {
  10%,
  90% {
    transform: translateX(-1px);
  }
  20%,
  80% {
    transform: translateX(2px);
  }
  30%,
  50%,
  70% {
    transform: translateX(-3px);
  }
  40%,
  60% {
    transform: translateX(3px);
  }
}

.shake {
  animation: shake 0.38s ease both;
}

@keyframes pop {
  0% {
    transform: scale(0.92);
    opacity: 0;
  }
  60% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.pop {
  animation: pop 0.28s ease both;
}

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

@media (max-width: 1120px) {
  :root {
    --sidebar-w: 222px;
  }

  .main {
    padding: 34px 30px 70px;
  }

  .goal-card {
    gap: 20px;
    padding: 24px;
  }

  .goal-ring {
    width: 104px;
    height: 104px;
  }
}

@media (max-width: 940px) {
  :root {
    --sidebar-w: 0px;
  }

  .sidebar {
    top: auto;
    right: 0;
    bottom: 0;
    width: 100%;
    height: calc(64px + env(safe-area-inset-bottom));
    flex-direction: row;
    align-items: stretch;
    padding: 6px 10px calc(6px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(244, 237, 221, 0.08);
    background: var(--sidebar-bg);
    box-shadow: 0 -8px 28px rgba(20, 36, 28, 0.13);
  }

  .sidebar::after,
  .brand,
  .sidebar-foot {
    display: none;
  }

  .nav {
    flex: 1;
    flex-direction: row;
    justify-content: space-around;
    gap: 2px;
  }

  .nav-item {
    flex: 1;
    height: auto;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    padding: 5px 2px;
    border-radius: 10px;
    font-size: 9.5px;
    font-weight: 500;
  }

  .nav-item.active::before {
    top: auto;
    right: 30%;
    bottom: 1px;
    left: 30%;
    width: auto;
    height: 2px;
  }

  .nav-item .nav-badge {
    display: none;
  }

  .nav-item svg {
    width: 19px;
    height: 19px;
  }

  .main-wrap {
    margin-left: 0;
  }

  .main {
    padding: 20px 18px calc(94px + env(safe-area-inset-bottom));
  }

  .mobile-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    height: 58px;
    padding: 0 18px;
    border-bottom: 1px solid var(--line);
    background: rgba(243, 238, 227, 0.86);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  [data-theme="dark"] .mobile-topbar {
    background: rgba(17, 24, 20, 0.88);
  }

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

  .mobile-brand .brand-seal {
    width: 31px;
    height: 31px;
    border-color: var(--line-strong);
    background: var(--surface);
    color: var(--green);
    font-size: 17px;
    box-shadow: none;
  }

  .mobile-brand-name {
    font-family: var(--serif);
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 0.12em;
  }

  .mobile-streak {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--gold);
    font-size: 11px;
  }

  .page-head {
    margin-bottom: 20px;
  }

  .page-actions .btn .btn-long-text {
    display: none;
  }

  .home-hero {
    grid-template-columns: 1fr;
  }

  .quote-card {
    min-height: auto;
  }

  .stat-strip {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .stat-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 9px;
    padding: 14px;
  }

  .stat-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
  }

  .stat-icon svg {
    width: 16px;
    height: 16px;
  }

  .stat-value {
    font-size: 21px;
  }

  .stat-label {
    font-size: 10px;
  }

  .home-grid,
  .stats-grid,
  .settings-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .home-grid > *,
  .stats-grid > *,
  .settings-layout > * {
    min-width: 0;
  }

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

  .setup-dock {
    position: sticky;
    bottom: calc(78px + env(safe-area-inset-bottom));
    flex-wrap: wrap;
    gap: 10px 14px;
    padding: 13px 14px;
  }

  .dock-summary {
    flex: 1;
    min-width: 120px;
  }

  .dock-count {
    margin-left: 0;
  }

  .dock-start {
    flex: 1 1 100%;
    min-width: 0;
  }

  .focus-shell .practice {
    padding: 16px 18px calc(24px + env(safe-area-inset-bottom));
  }

  .practice-main {
    justify-content: flex-start;
    padding-top: 30px;
  }

  .prompt-card {
    padding: 30px 24px 25px;
  }

  .result-wrap {
    padding: 24px 16px calc(30px + env(safe-area-inset-bottom));
  }

  .result-card {
    padding: 26px 22px 22px;
  }

  .result-head {
    gap: 20px;
  }

  .result-ring {
    width: 104px;
    height: 104px;
  }

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

  .unit-grid {
    max-height: 380px;
  }
}

@media (max-width: 620px) {
  .main {
    padding: 16px 14px calc(90px + env(safe-area-inset-bottom));
  }

  .mobile-topbar {
    height: 54px;
    padding: 0 14px;
  }

  .page-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .page-actions {
    width: 100%;
  }

  .page-actions .btn {
    flex: 1;
  }

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

  .home-title {
    font-size: 28px;
  }

  .goal-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 17px;
    min-height: 0;
    padding: 22px;
  }

  .goal-ring {
    width: 92px;
    height: 92px;
  }

  .goal-ring-label strong {
    font-size: 23px;
  }

  .goal-copy h2 {
    font-size: 23px;
  }

  .goal-cta {
    margin-top: 14px;
  }

  .stat-strip {
    grid-template-columns: repeat(3, 1fr);
  }

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

  .stat-value {
    font-size: 19px;
  }

  .chart-card,
  .wordbook-preview,
  .stats-card {
    padding: 18px 16px 14px;
  }

  .bar-chart {
    gap: 5px;
    height: 138px;
  }

  .scope-tabs {
    display: flex;
    width: 100%;
    overflow-x: auto;
  }

  .scope-tab {
    flex: 1;
    justify-content: center;
    padding: 0 8px;
    font-size: 12px;
    white-space: nowrap;
  }

  .scope-tab svg {
    display: none;
  }

  .scope-card {
    padding: 15px;
  }

  .unit-grid {
    grid-template-columns: repeat(3, 1fr);
    max-height: 360px;
    gap: 6px;
  }

  .unit-btn {
    min-height: 52px;
    padding: 7px 9px;
  }

  .unit-btn .unit-num {
    font-size: 11px;
  }

  .unit-toolbar {
    gap: 8px;
    margin-bottom: 12px;
  }

  .unit-toolbar-copy {
    width: 100%;
    font-size: 11.5px;
  }

  .unit-actions {
    width: 100%;
    justify-content: space-between;
  }

  .scope-hero {
    flex-direction: row;
    align-items: flex-start;
    gap: 13px;
    padding: 18px;
  }

  .scope-hero-icon {
    width: 48px;
    height: 48px;
    border-radius: 13px;
  }

  .scope-hero .scope-numbers {
    gap: 18px;
  }

  .setup-dock {
    bottom: calc(70px + env(safe-area-inset-bottom));
    margin-right: -2px;
    margin-left: -2px;
  }

  .dock-summary strong {
    font-size: 15px;
  }

  .count-label {
    display: none;
  }

  .count-chip {
    min-width: 35px;
    padding: 0 7px;
  }

  .custom-count {
    width: 52px;
  }

  .practice {
    padding: 12px 14px calc(18px + env(safe-area-inset-bottom));
  }

  .practice-top {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 10px;
  }

  .practice-progress-label {
    margin-bottom: 5px;
    font-size: 9.5px;
  }

  .practice-counter {
    min-width: 48px;
    font-size: 10px;
  }

  .practice-counter strong {
    font-size: 13px;
  }

  .practice-main {
    padding-top: 22px;
  }

  .prompt-card {
    padding: 25px 18px 21px;
    border-radius: 18px;
  }

  .prompt-kicker {
    margin-bottom: 14px;
    font-size: 8.5px;
  }

  .prompt-meaning {
    font-size: clamp(24px, 7.2vw, 31px);
    line-height: 1.5;
  }

  .prompt-meaning.is-long {
    font-size: clamp(19px, 5.6vw, 24px);
  }

  .prompt-meta {
    margin-top: 15px;
  }

  .answer-form {
    margin-top: 20px;
  }

  .answer-input {
    height: 58px;
    font-size: 25px;
  }

  .answer-actions {
    margin-top: 12px;
  }

  .answer-submit {
    flex: 1;
    min-width: 0;
  }

  .feedback {
    padding: 16px;
  }

  .feedback-word strong {
    font-size: 23px;
  }

  .feedback-actions {
    flex-wrap: wrap;
  }

  .feedback-note {
    flex: 1 1 100%;
    margin-right: 0;
    order: 2;
  }

  .feedback-actions .btn {
    flex: 1;
  }

  .result-card {
    padding: 22px 17px 18px;
    border-radius: 20px;
  }

  .result-head {
    flex-direction: column;
    align-items: center;
    gap: 14px;
    text-align: center;
  }

  .result-ring {
    width: 96px;
    height: 96px;
  }

  .result-actions {
    flex-direction: column-reverse;
  }

  .missed-item {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 8px 0;
  }

  .missed-meaning {
    white-space: normal;
  }

  .word-row {
    gap: 8px;
    padding: 13px 13px;
  }

  .word-line strong {
    font-size: 18px;
  }

  .word-actions {
    flex-direction: column;
  }

  .word-actions .icon-btn {
    width: 30px;
    height: 30px;
  }

  .toolbar {
    gap: 8px;
  }

  .filter-chips {
    width: 100%;
  }

  .filter-chip {
    flex: 1;
    padding: 0 8px;
  }

  .search-box {
    min-width: 100%;
  }

  .summary-grid {
    gap: 8px;
  }

  .summary-card {
    padding: 14px;
  }

  .summary-card strong {
    font-size: 25px;
  }

  .donut-wrap {
    gap: 15px;
  }

  .donut {
    width: 88px;
    height: 88px;
  }

  .settings-card {
    padding: 4px 15px;
  }

  .setting-row {
    gap: 10px;
    padding: 13px 0;
  }

  .setting-control {
    max-width: 50%;
  }

  .segmented {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .about-card {
    padding: 17px;
  }

  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .modal {
    width: 100%;
    max-height: 88dvh;
    border-radius: 20px 20px 0 0;
    border-bottom: 0;
    animation-name: sheet-in;
  }

  .modal-foot {
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }

  .modal-foot .btn {
    flex: 1;
  }

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

@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;
  }
}

@media print {
  .sidebar,
  .mobile-topbar,
  .practice-top,
  .practice-foot,
  .result-actions,
  .setup-dock {
    display: none !important;
  }

  .main-wrap {
    margin: 0;
  }

  body {
    background: #fff;
  }
}

/* ---------------- 云同步 ---------------- */

.sync-card {
  padding-bottom: 4px;
}

.sync-pad {
  padding: 2px 0 18px;
}

.sync-intro {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 12px;
}

.sync-intro strong {
  font-size: 13.5px;
  font-weight: 600;
}

.sync-intro span {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.6;
}

.sync-form {
  margin: 0;
}

.sync-form-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.sync-tabs {
  display: flex;
  gap: 3px;
  width: fit-content;
  padding: 3px;
  margin-bottom: 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
}

.sync-tabs button {
  min-width: 64px;
  height: 30px;
  padding: 0 12px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
}

.sync-tabs button.active {
  background: var(--surface);
  color: var(--green);
  box-shadow: 0 1px 4px rgba(40, 50, 40, 0.08);
}

.sync-account {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 4px 0 8px;
}

.sync-account strong {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  word-break: break-all;
}

.sync-account span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.6;
}

.sync-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--line-strong);
}

.sync-dot.ok {
  background: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft);
}

.sync-dot.warn {
  background: var(--gold);
  box-shadow: 0 0 0 4px var(--gold-soft);
}

.sync-dot.bad {
  background: var(--red);
  box-shadow: 0 0 0 4px var(--red-soft);
}

.sync-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding: 8px 0;
  color: var(--faint);
  font-size: 10px;
  border-top: 1px solid var(--line);
}

.sync-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.sync-note {
  margin-top: 8px;
  color: var(--faint);
  font-size: 10px;
  line-height: 1.65;
}

.sync-error {
  margin-top: 8px;
  color: var(--red);
  font-size: 10.5px;
  line-height: 1.6;
}

@media (max-width: 620px) {
  .sync-account {
    gap: 8px;
  }

  .sync-actions .btn,
  .sync-actions .text-btn {
    flex: 1;
  }
}
