:root {
  color-scheme: light;
  --bg: #f6f3ea;
  --surface: #fffdf8;
  --surface-strong: #ffffff;
  --surface-soft: #eeeae0;
  --text: #172033;
  --text-soft: #657080;
  --text-faint: #8a928f;
  --primary: #2f7d74;
  --primary-strong: #24675f;
  --primary-soft: #dcece7;
  --amber: #a96714;
  --amber-soft: #f5e7c9;
  --blue: #426c8c;
  --blue-soft: #dce8f0;
  --danger: #a24343;
  --danger-soft: #f6dddd;
  --border: #ddd9ce;
  --border-strong: #c8c5ba;
  --shadow: 0 18px 50px rgba(38, 49, 54, 0.08);
  --shadow-soft: 0 6px 24px rgba(38, 49, 54, 0.06);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --sidebar: 252px;
  --ease: 180ms ease;
}

body[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101820;
  --surface: #18232c;
  --surface-strong: #1d2a34;
  --surface-soft: #23323c;
  --text: #edf3f2;
  --text-soft: #a8b6ba;
  --text-faint: #849398;
  --primary: #69b9ad;
  --primary-strong: #8bcfc5;
  --primary-soft: #213f3e;
  --amber: #e4b662;
  --amber-soft: #43371f;
  --blue: #8bb6d4;
  --blue-soft: #233b4c;
  --danger: #ef9a9a;
  --danger-soft: #4c292d;
  --border: #30404a;
  --border-strong: #465862;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
  --shadow-soft: 0 8px 30px rgba(0, 0, 0, 0.18);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  transition: background-color var(--ease), color var(--ease);
}

button, input, select { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: var(--primary); }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 58%, transparent);
  outline-offset: 3px;
}

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

.skip-link {
  position: fixed;
  left: 16px;
  top: -80px;
  z-index: 2000;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  transition: top var(--ease);
}

.skip-link:focus { top: 16px; }

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  display: flex;
  width: var(--sidebar);
  flex-direction: column;
  padding: 30px 20px 24px;
  border-right: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(18px);
}

.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px; }
.brand-mark { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 14px; background: var(--primary); color: #fff; }
.brand-mark svg { width: 28px; height: 28px; }
.brand strong { display: block; font-family: Georgia, "Times New Roman", serif; font-size: 24px; line-height: 1.1; letter-spacing: .08em; }
.brand small { display: block; margin-top: 3px; color: var(--text-soft); font-size: 12px; letter-spacing: .08em; }

.nav-list { display: grid; gap: 8px; margin-top: 48px; }
.nav-item {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  font-weight: 600;
  transition: color var(--ease), background-color var(--ease), transform var(--ease);
}
.nav-item:hover { background: var(--surface-soft); color: var(--text); }
.nav-item:active { transform: scale(.98); }
.nav-item.is-active { background: var(--primary-soft); color: var(--primary-strong); }
.nav-item svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.sidebar-foot { display: flex; align-items: center; gap: 12px; margin-top: auto; padding: 16px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.sidebar-foot strong, .sidebar-foot small { display: block; }
.sidebar-foot strong { font-size: 18px; line-height: 1.1; }
.sidebar-foot small { color: var(--text-soft); font-size: 12px; }
.quiet-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 6px var(--primary-soft); }

.main-content { min-height: 100dvh; margin-left: var(--sidebar); padding: 48px clamp(28px, 5vw, 76px) 72px; }
.view { width: min(1160px, 100%); margin: 0 auto; animation: view-in 240ms ease-out; }
.view[hidden] { display: none !important; }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.mobile-header, .bottom-nav { display: none; }
.loading-screen { display: grid; min-height: 60vh; place-items: center; align-content: center; gap: 12px; color: var(--text-soft); }
.loader { width: 30px; height: 30px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.page-heading h1 { margin: 0; font-family: Georgia, "Times New Roman", "Songti SC", serif; font-size: clamp(32px, 4.5vw, 54px); font-weight: 600; line-height: 1.15; letter-spacing: -.025em; }
.page-heading .muted { margin: 9px 0 0; }
.eyebrow { margin: 0 0 8px; color: var(--primary); font-size: 11px; font-weight: 800; letter-spacing: .19em; }
.muted { color: var(--text-soft); }

.icon-button, .sound-button, .stat-icon, .data-icon, .empty-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
}
.icon-button { width: 46px; height: 46px; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); cursor: pointer; }
.icon-button svg, .sound-button svg, .stat-icon svg, .data-icon svg, .empty-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 22px; }
.stat-card { display: flex; min-height: 110px; align-items: center; gap: 17px; padding: 22px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-soft); }
.stat-icon { width: 52px; height: 52px; border-radius: 16px; }
.soft-teal { background: var(--primary-soft); color: var(--primary-strong); }
.soft-amber { background: var(--amber-soft); color: var(--amber); }
.soft-blue { background: var(--blue-soft); color: var(--blue); }
.stat-card strong, .stat-card span { display: block; }
.stat-card strong { font-family: Georgia, serif; font-size: 30px; font-variant-numeric: tabular-nums; line-height: 1; }
.stat-card div > span { margin-top: 7px; color: var(--text-soft); font-size: 13px; }
.streak-badge { display: inline-block; margin-top: 5px; padding: 1px 7px; border-radius: 999px; background: var(--blue-soft); color: var(--blue); font-size: 10px; font-weight: 800; }

.panel { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-soft); }
.home-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(310px, .9fr); gap: 22px; }
.focus-card { display: flex; min-height: 348px; align-items: center; justify-content: space-between; gap: 32px; padding: clamp(28px, 4vw, 46px); overflow: hidden; background: linear-gradient(135deg, var(--surface) 0%, color-mix(in srgb, var(--primary-soft) 42%, var(--surface)) 100%); }
.focus-copy { max-width: 480px; }
.focus-copy h2 { margin: 18px 0 12px; font-family: Georgia, "Songti SC", serif; font-size: clamp(27px, 3vw, 40px); line-height: 1.25; }
.focus-copy p { margin: 0 0 26px; color: var(--text-soft); }
.tag, .pill, .privacy-badge { display: inline-flex; min-height: 28px; align-items: center; padding: 3px 11px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-strong); font-size: 12px; font-weight: 700; }

.primary-button, .secondary-button, .danger-button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 20px;
  border-radius: 13px;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
  transition: transform var(--ease), background-color var(--ease), border-color var(--ease);
}
.primary-button { border: 1px solid var(--primary); background: var(--primary); color: #fff; }
.primary-button:hover { background: var(--primary-strong); }
.primary-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.secondary-button { border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); }
.secondary-button:hover { border-color: var(--primary); color: var(--primary-strong); }
.danger-button { border: 1px solid color-mix(in srgb, var(--danger) 45%, var(--border)); background: var(--danger-soft); color: var(--danger); }
.primary-button:active, .secondary-button:active, .danger-button:active { transform: scale(.98); }

.progress-orbit { min-width: 155px; text-align: center; }
.orbit { --progress: 0deg; display: grid; width: 148px; height: 148px; margin: auto; place-items: center; border-radius: 50%; background: conic-gradient(var(--primary) var(--progress), var(--surface-soft) 0); position: relative; }
.orbit::before { content: ""; position: absolute; width: 118px; height: 118px; border-radius: 50%; background: var(--surface); }
.orbit span { position: relative; z-index: 1; }
.orbit strong, .orbit small { display: block; }
.orbit strong { font-family: Georgia, serif; font-size: 34px; line-height: 1; }
.orbit small { margin-top: 5px; color: var(--text-soft); }
.progress-orbit > p { margin: 12px 0 0; color: var(--text-soft); font-size: 13px; }

.path-card { padding: 28px; }
.panel-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.panel-title h2 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: 25px; }
.learning-path { display: grid; gap: 0; margin: 26px 0 0; padding: 0; list-style: none; }
.learning-path li { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 12px; min-height: 78px; border-top: 1px solid var(--border); }
.learning-path li > span { color: var(--primary); font-family: Georgia, serif; font-weight: 700; }
.learning-path strong, .learning-path small { display: block; }
.learning-path small { margin-top: 2px; color: var(--text-soft); font-size: 12px; }
.learning-path b { color: var(--text-soft); font-size: 12px; }

.data-banner { display: flex; align-items: center; gap: 17px; margin-top: 22px; padding: 22px 26px; }
.data-icon { width: 48px; height: 48px; border-radius: 15px; background: var(--primary-soft); color: var(--primary-strong); }
.data-banner div { flex: 1; }
.data-banner strong { font-size: 16px; }
.data-banner p { margin: 2px 0 0; color: var(--text-soft); font-size: 13px; }

.progress-label { padding: 7px 13px; border-radius: 999px; background: var(--surface-soft); color: var(--text-soft); font-size: 13px; font-variant-numeric: tabular-nums; }
.study-stage { width: min(790px, 100%); margin: 0 auto; }
.word-card, .spelling-card { position: relative; padding: clamp(28px, 5vw, 52px); }
.word-meta { display: flex; align-items: center; justify-content: space-between; }
.sound-button { width: 52px; height: 52px; margin: 4px auto 0; border-radius: 50%; background: var(--primary-soft); color: var(--primary-strong); cursor: pointer; transition: transform var(--ease), background-color var(--ease); }
.sound-button:hover { background: color-mix(in srgb, var(--primary-soft) 76%, var(--primary)); }
.sound-button:active { transform: scale(.94); }
.word-center { margin: 22px 0 28px; text-align: center; }
.clickable-word, .word-title-button, .word-primary { border: 0; background: transparent; color: inherit; cursor: pointer; }
.clickable-word { padding: 2px 8px; border-radius: 12px; transition: color var(--ease), background-color var(--ease); }
.clickable-word:hover { background: var(--primary-soft); color: var(--primary-strong); }
.word-center .word-display { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(54px, 10vw, 88px); font-weight: 500; line-height: 1.05; letter-spacing: -.03em; }
.phonetic { margin: 12px 0 0; color: var(--text-soft); font-size: 18px; }
.pos-list { display: flex; justify-content: center; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.pos-chip { padding: 3px 9px; border-radius: 8px; background: var(--surface-soft); color: var(--text-soft); font-size: 12px; font-weight: 700; }
.meaning-list { width: min(560px, 100%); margin: 0 auto; padding: 22px 28px; border-radius: 18px; background: var(--surface-soft); list-style: none; }
.meaning-list li { padding: 6px 0; font-size: 17px; text-align: center; }
.memory-prompt { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin: 30px 0 18px; color: var(--text-faint); font-size: 12px; text-align: center; }
.memory-prompt span { height: 1px; background: var(--border); }
.memory-prompt p { margin: 0; }
.rating-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.rating-button { min-height: 76px; padding: 10px; border: 1px solid var(--border); border-radius: 15px; background: var(--surface); cursor: pointer; transition: transform var(--ease), border-color var(--ease), background-color var(--ease); }
.rating-button span, .rating-button small { display: block; }
.rating-button span { font-weight: 700; }
.rating-button small { margin-top: 3px; color: var(--text-soft); font-size: 11px; }
.rating-button:hover { transform: translateY(-2px); }
.rating-unknown:hover { border-color: var(--danger); background: var(--danger-soft); }
.rating-fuzzy:hover { border-color: var(--amber); background: var(--amber-soft); }
.rating-known:hover { border-color: var(--primary); background: var(--primary-soft); }

.spelling-heading { display: flex; justify-content: space-between; align-items: center; }
.sound-button.centered { margin-top: 28px; }
.spelling-label { margin: 18px 0 6px; color: var(--text-soft); text-align: center; }
.spelling-card h2 { margin: 0 0 30px; font-family: Georgia, "Songti SC", serif; font-size: 28px; text-align: center; }
.spelling-card form { width: min(560px, 100%); margin: auto; }
.spelling-card label { display: block; margin-bottom: 8px; font-weight: 700; }
.answer-row { display: flex; gap: 10px; }
.answer-row input { min-width: 0; min-height: 50px; flex: 1; padding: 10px 14px; border: 1px solid var(--border-strong); border-radius: 13px; background: var(--surface-strong); color: var(--text); font-size: 20px; }
.feedback { width: min(560px, 100%); margin: 18px auto 0; padding: 12px 15px; border-radius: 12px; text-align: center; }
.feedback.is-correct { background: var(--primary-soft); color: var(--primary-strong); }
.feedback.is-wrong { background: var(--danger-soft); color: var(--danger); }
.centered-button { margin: 18px auto 0; }
.empty-state { padding: 70px 30px; text-align: center; }
.empty-icon { width: 64px; height: 64px; margin: auto; border-radius: 50%; background: var(--primary-soft); color: var(--primary-strong); }
.empty-icon svg { width: 30px; height: 30px; }
.empty-state h2 { margin: 18px 0 7px; font-family: Georgia, "Songti SC", serif; font-size: 30px; }
.empty-state p { max-width: 500px; margin: 0 auto 22px; color: var(--text-soft); }

.review-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 22px; }
.summary-card { padding: 24px; }
.summary-card > span, .summary-card strong, .summary-card small { display: block; }
.summary-card > span { color: var(--text-soft); font-size: 13px; }
.summary-card strong { margin: 7px 0; font-family: Georgia, serif; font-size: 38px; line-height: 1; }
.summary-card small { color: var(--text-faint); }
.list-panel { padding: 28px; }
.wrong-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 22px; }
.wrong-item { display: flex; min-height: 66px; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-strong); }
.wrong-item > div { min-width: 0; flex: 1; }
.wrong-item strong, .wrong-item small, .wrong-item .word-title-button { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.word-title-button { min-width: 44px; min-height: 44px; padding: 0; font-weight: 700; text-align: left; }
.word-title-button:hover { color: var(--primary-strong); text-decoration: underline; text-underline-offset: 3px; }
.wrong-item small { color: var(--text-soft); }
.mini-sound { display: grid; width: 44px; height: 44px; place-items: center; border: 0; border-radius: 50%; background: var(--primary-soft); color: var(--primary-strong); cursor: pointer; }
.mini-sound svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.list-empty { grid-column: 1 / -1; padding: 44px 20px; color: var(--text-soft); text-align: center; }

.search-toolbar { display: flex; gap: 12px; padding: 14px; border-radius: 18px; }
.search-box { display: flex; min-width: 0; flex: 1; align-items: center; gap: 10px; padding: 0 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-strong); }
.search-box svg { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: var(--text-soft); stroke-width: 1.8; }
.search-box input { width: 100%; min-height: 46px; border: 0; outline: 0; background: transparent; color: var(--text); }
.select-wrap select, .setting-row select { min-height: 46px; padding: 8px 38px 8px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-strong); color: var(--text); }
.list-caption { display: flex; justify-content: space-between; gap: 16px; margin: 18px 2px 10px; color: var(--text-soft); font-size: 13px; }
.vocab-list { overflow: hidden; border-radius: 18px; }
.word-row { display: grid; grid-template-columns: minmax(140px, .8fr) minmax(220px, 1.7fr) 80px 44px; align-items: center; gap: 18px; min-height: 82px; padding: 13px 18px; border-bottom: 1px solid var(--border); }
.word-row:last-child { border-bottom: 0; }
.word-primary { min-width: 0; padding: 0; text-align: left; }
.word-primary:hover strong { color: var(--primary-strong); text-decoration: underline; text-underline-offset: 3px; }
.word-primary strong, .word-primary small { display: block; }
.word-primary strong { font-family: Georgia, serif; font-size: 21px; }
.word-primary small { color: var(--text-soft); }
.word-meaning { color: var(--text-soft); }
.word-unit { color: var(--text-faint); font-size: 12px; text-align: right; }
.load-more { margin: 20px auto 0; }

.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.settings-card { padding: 8px 26px; }
.setting-row { display: flex; min-height: 104px; align-items: center; justify-content: space-between; gap: 22px; border-bottom: 1px solid var(--border); }
.setting-row:last-child { border-bottom: 0; }
.setting-row h2 { margin: 0; font-size: 16px; }
.setting-row p { margin: 4px 0 0; color: var(--text-soft); font-size: 12px; }
.switch { position: relative; display: inline-flex; min-height: 44px; align-items: center; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; }
.switch span { width: 50px; height: 29px; border-radius: 999px; background: var(--border-strong); cursor: pointer; transition: background var(--ease); }
.switch span::after { content: ""; display: block; width: 23px; height: 23px; margin: 3px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.18); transition: transform var(--ease); }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { transform: translateX(21px); }
.switch input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--primary) 58%, transparent); outline-offset: 3px; }
.privacy-badge { white-space: nowrap; }
.source-note { margin-top: 20px; padding: 23px 26px; }
.source-note p { margin: 5px 0 7px; color: var(--text-soft); }
.source-note a { display: inline-flex; min-height: 44px; align-items: center; }

.module-panel { margin-top: 22px; padding: 28px; }
.module-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 22px; }
.module-card { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; min-height: 92px; align-items: center; gap: 14px; padding: 15px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface-strong); color: var(--text); cursor: pointer; text-align: left; transition: border-color var(--ease), background-color var(--ease), transform var(--ease); }
.module-card:hover { border-color: var(--primary); background: var(--primary-soft); transform: translateY(-2px); }
.module-card > span:nth-child(2) { min-width: 0; }
.module-card strong, .module-card small { display: block; }
.module-card strong em { margin-left: 5px; color: var(--primary-strong); font-size: 11px; font-style: normal; font-variant-numeric: tabular-nums; }
.module-card small { margin-top: 3px; color: var(--text-soft); font-size: 11px; line-height: 1.45; }
.module-card > b { color: var(--primary-strong); font-size: 12px; }
.module-icon { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 14px; background: var(--primary-soft); color: var(--primary-strong); }
.module-icon.amber { background: var(--amber-soft); color: var(--amber); }
.module-icon.blue { background: var(--blue-soft); color: var(--blue); }
.module-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.map-toolbar { padding: 20px 22px; }
.map-toolbar > label { display: block; margin-bottom: 8px; font-weight: 700; }
.map-search-row { display: flex; gap: 10px; }
.map-search-row input { min-width: 0; min-height: 48px; flex: 1; padding: 10px 14px; border: 1px solid var(--border-strong); border-radius: 13px; background: var(--surface-strong); color: var(--text); font-size: 18px; }
.map-toolbar > p { margin: 8px 2px 0; font-size: 12px; }
.mindmap-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .7fr); gap: 20px; margin-top: 20px; }
.mindmap-canvas { position: relative; min-height: 620px; overflow: hidden; background-color: var(--surface); background-image: radial-gradient(circle at center, color-mix(in srgb, var(--primary-soft) 48%, transparent) 0 17%, transparent 17.5%); }
.mindmap-lines { position: absolute; z-index: 0; inset: 0; width: 100%; height: 100%; overflow: visible; }
.mindmap-lines line { stroke: var(--border-strong); stroke-width: .45; stroke-dasharray: 1.5 1.2; vector-effect: non-scaling-stroke; }
.mindmap-nodes { position: absolute; z-index: 2; inset: 0; }
.mindmap-center, .mindmap-node { position: absolute; display: grid; place-items: center; border: 1px solid var(--border); background: var(--surface-strong); color: var(--text); cursor: pointer; text-align: center; box-shadow: var(--shadow-soft); transition: transform var(--ease), border-color var(--ease), background-color var(--ease); }
.mindmap-center { z-index: 3; left: 50%; top: 50%; width: 166px; min-height: 112px; transform: translate(-50%, -50%); padding: 14px; border: 2px solid var(--primary); border-radius: 28px; background: var(--primary-soft); }
.mindmap-center:hover { transform: translate(-50%, -50%) scale(1.03); }
.mindmap-center small, .mindmap-center span, .mindmap-center strong { display: block; }
.mindmap-center small { color: var(--primary-strong); font-size: 11px; font-weight: 800; }
.mindmap-center strong { max-width: 145px; overflow-wrap: anywhere; font-family: Georgia, serif; font-size: 27px; }
.mindmap-center span { color: var(--text-soft); font-size: 12px; }
.mindmap-node { width: 132px; min-height: 74px; transform: translate(-50%, -50%); padding: 10px; border-radius: 17px; }
.mindmap-node:hover { transform: translate(-50%, -50%) scale(1.04); border-color: var(--primary); background: var(--primary-soft); }
.mindmap-node small, .mindmap-node strong { display: block; }
.mindmap-node small { color: var(--primary-strong); font-size: 10px; }
.mindmap-node strong { max-width: 112px; overflow-wrap: anywhere; font-family: Georgia, serif; font-size: 16px; }
.map-detail { align-self: start; position: sticky; top: 28px; padding: 28px; }
.map-detail-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-top: 22px; }
.map-detail-word { margin: 0; padding-inline: 0; overflow-wrap: anywhere; font-family: Georgia, serif; font-size: 34px; font-weight: 700; text-align: left; }
.map-detail-title .phonetic { margin: 3px 0 0; font-size: 15px; }
.map-detail-title .sound-button { width: 46px; height: 46px; margin: 0; }
.pos-list.left { justify-content: flex-start; margin-top: 12px; }
.map-meaning { margin: 20px 0; padding: 15px; border-radius: 13px; background: var(--surface-soft); }
.map-example { padding-top: 18px; border-top: 1px solid var(--border); }
.map-example small { color: var(--primary-strong); font-weight: 800; }
.map-example p { margin: 7px 0 0; font-family: Georgia, "Songti SC", serif; font-size: 17px; line-height: 1.7; }
.map-example.is-placeholder p { color: var(--text-faint); font-family: inherit; font-size: 13px; }

.quiz-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(250px, .55fr); gap: 20px; }
.quiz-card { padding: clamp(24px, 5vw, 46px); }
.quiz-progress { display: flex; justify-content: space-between; gap: 18px; color: var(--text-soft); font-size: 13px; font-variant-numeric: tabular-nums; }
.quiz-prompt { margin: 22px 0 28px; text-align: center; }
.quiz-prompt .sound-button { width: 48px; height: 48px; }
.quiz-prompt p { margin: 14px 0 2px; color: var(--text-soft); }
.quiz-prompt .word-display { margin: 0; overflow-wrap: anywhere; font-family: Georgia, serif; font-size: clamp(48px, 8vw, 72px); font-weight: 500; line-height: 1.15; }
.quiz-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.quiz-option { display: flex; min-height: 76px; align-items: center; gap: 12px; padding: 13px; border: 1px solid var(--border); border-radius: 15px; background: var(--surface-strong); color: var(--text); cursor: pointer; text-align: left; transition: border-color var(--ease), background-color var(--ease), transform var(--ease); }
.quiz-option:hover:not(:disabled) { border-color: var(--primary); background: var(--primary-soft); transform: translateY(-2px); }
.quiz-option b { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 10px; background: var(--surface-soft); color: var(--text-soft); }
.quiz-option.is-correct { border-color: var(--primary); background: var(--primary-soft); }
.quiz-option.is-correct b { background: var(--primary); color: #fff; }
.quiz-option.is-wrong { border-color: var(--danger); background: var(--danger-soft); }
.quiz-option.is-wrong b { background: var(--danger); color: #fff; }
.quiz-option:disabled { cursor: default; opacity: 1; }
.quiz-feedback { margin-top: 18px; padding: 14px 16px; border-radius: 13px; }
.quiz-feedback.is-correct { background: var(--primary-soft); color: var(--primary-strong); }
.quiz-feedback.is-wrong { background: var(--danger-soft); color: var(--danger); }
.quiz-next { margin: 18px 0 0 auto; }
.quiz-note { align-self: start; padding: 25px; }
.quiz-note h2 { margin: 17px 0 7px; font-family: Georgia, "Songti SC", serif; }
.quiz-note p { margin: 0; color: var(--text-soft); font-size: 13px; }
.quiz-note ol { margin: 18px 0 0; padding-left: 22px; color: var(--text-soft); }

.stats-panel { margin-bottom: 22px; padding: 28px; }
.stats-bars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 24px; }
.stats-bars > div > span { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.stats-bars b { font-size: 13px; }
.stats-bars em { color: var(--text-soft); font-size: 12px; font-style: normal; font-variant-numeric: tabular-nums; }
.bar-track { height: 9px; overflow: hidden; border-radius: 999px; background: var(--surface-soft); }
.bar-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--primary); transition: width 300ms ease-out; }

.notice { position: fixed; z-index: 1500; top: 16px; left: 50%; width: min(560px, calc(100% - 32px)); transform: translateX(-50%); padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow); }
.notice-warning { border: 1px solid color-mix(in srgb, var(--amber) 50%, var(--border)); background: var(--amber-soft); color: var(--text); }

@media (max-width: 1040px) {
  :root { --sidebar: 214px; }
  .sidebar { padding-inline: 14px; }
  .home-grid { grid-template-columns: 1fr; }
  .path-card { min-height: auto; }
  .settings-grid { grid-template-columns: 1fr; }
  .module-grid { grid-template-columns: 1fr; }
  .mindmap-layout, .quiz-layout { grid-template-columns: 1fr; }
  .map-detail { position: static; }
}

@media (max-width: 760px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; padding: 88px 16px 104px; }
  .mobile-header { position: fixed; z-index: 60; inset: 0 0 auto 0; display: flex; height: 68px; align-items: center; justify-content: space-between; padding: 10px 16px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(16px); }
  .brand.compact { padding: 0; }
  .brand.compact .brand-mark { width: 38px; height: 38px; border-radius: 12px; }
  .brand.compact .brand-mark svg { width: 24px; height: 24px; }
  .brand.compact strong { font-size: 21px; }
  .desktop-theme-toggle { display: none; }
  .bottom-nav { position: fixed; z-index: 70; inset: auto 0 0; display: grid; grid-template-columns: repeat(5, 1fr); min-height: 74px; padding: 7px 6px max(7px, env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(18px); }
  .bottom-nav .nav-item { min-height: 58px; justify-content: center; flex-direction: column; gap: 2px; padding: 4px 2px; border-radius: 10px; font-size: 10px; }
  .bottom-nav .nav-item svg { width: 21px; height: 21px; }
  .page-heading { margin-bottom: 22px; }
  .page-heading h1 { font-size: 34px; }
  .home-heading { align-items: center; }
  .stats-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat-card { min-height: 104px; flex-direction: column; justify-content: center; gap: 8px; padding: 12px 5px; text-align: center; }
  .stat-icon { width: 38px; height: 38px; border-radius: 12px; }
  .stat-icon svg { width: 18px; height: 18px; }
  .stat-card strong { font-size: 25px; }
  .stat-card div > span { margin-top: 3px; font-size: 11px; }
  .focus-card { min-height: auto; flex-direction: column; align-items: flex-start; padding: 28px; }
  .progress-orbit { align-self: center; }
  .orbit { width: 132px; height: 132px; }
  .orbit::before { width: 106px; height: 106px; }
  .path-card { padding: 24px; }
  .data-banner { align-items: flex-start; flex-wrap: wrap; padding: 20px; }
  .data-banner .secondary-button { width: 100%; }
  .word-card, .spelling-card { padding: 24px 18px; border-radius: 22px; }
  .word-center .word-display { font-size: clamp(48px, 17vw, 70px); overflow-wrap: anywhere; }
  .meaning-list { padding: 18px 14px; }
  .rating-grid { gap: 7px; }
  .rating-button { min-height: 82px; padding-inline: 4px; }
  .rating-button span { font-size: 14px; }
  .rating-button small { font-size: 9px; }
  .memory-prompt { grid-template-columns: 30px 1fr 30px; }
  .review-summary { gap: 8px; }
  .summary-card { padding: 18px 12px; text-align: center; }
  .summary-card strong { font-size: 30px; }
  .summary-card small { font-size: 10px; }
  .list-panel { padding: 22px 16px; }
  .wrong-list { grid-template-columns: 1fr; }
  .search-toolbar { align-items: stretch; flex-direction: column; }
  .select-wrap select { width: 100%; }
  .word-row { grid-template-columns: 1fr 44px; gap: 8px 12px; padding: 14px; }
  .word-meaning { grid-column: 1 / 2; font-size: 13px; }
  .word-unit { grid-column: 1 / 2; text-align: left; }
  .word-row .mini-sound { grid-column: 2; grid-row: 1 / 4; }
  .settings-card { padding-inline: 18px; }
  .setting-row { min-height: 116px; }
  .answer-row { flex-direction: column; }
  .answer-row .primary-button { width: 100%; }
  .module-panel { padding: 22px 16px; }
  .module-card { grid-template-columns: 44px minmax(0, 1fr); }
  .module-card > b { display: none; }
  .mindmap-canvas { min-height: 540px; }
  .mindmap-center { width: 132px; min-height: 94px; border-radius: 23px; }
  .mindmap-center strong { font-size: 22px; }
  .mindmap-node { width: 105px; min-height: 66px; padding: 7px; }
  .mindmap-node strong { max-width: 92px; font-size: 13px; }
  .mindmap-node small { font-size: 9px; }
  .map-search-row { flex-direction: column; }
  .map-search-row .primary-button { width: 100%; }
  .quiz-options { grid-template-columns: 1fr; }
  .quiz-next { width: 100%; }
  .stats-bars { grid-template-columns: 1fr; }
}

@media (max-width: 390px) {
  .main-content { padding-inline: 12px; }
  .page-heading h1 { font-size: 31px; }
  .focus-copy h2 { font-size: 28px; }
  .review-summary { grid-template-columns: 1fr; }
  .summary-card { display: grid; grid-template-columns: 1fr auto; align-items: center; text-align: left; }
  .summary-card strong { grid-column: 2; grid-row: 1 / 3; }
  .summary-card small { grid-column: 1; }
}

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