:root {
  --bg: #e7eeeb;
  --surface: #f8faf9;
  --surface-2: #ffffff;
  --ink: #172422;
  --muted: #687673;
  --line: #d8e1de;
  --line-strong: #c4d1cd;
  --primary: #0c766d;
  --primary-dark: #075a53;
  --primary-soft: #dceeea;
  --coral: #e6603c;
  --coral-soft: #fae3dc;
  --blue: #315b9a;
  --blue-soft: #dfe7f4;
  --amber: #a66a16;
  --amber-soft: #f5ead6;
  --danger: #c84435;
  --shadow: 0 14px 36px rgba(27, 54, 49, 0.1);
  --radius: 8px;
  --bottom-nav: 72px;
  color-scheme: light;
  font-family: "SF Pro Display", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
}

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

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: default;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(12, 118, 109, 0.22);
  outline-offset: 2px;
}

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

.icon {
  display: block;
  flex: 0 0 auto;
}

.app-shell {
  position: relative;
  width: 100%;
  max-width: 560px;
  min-height: 100dvh;
  margin: 0 auto;
  overflow-x: hidden;
  background: var(--surface);
  box-shadow: 0 0 0 1px rgba(31, 66, 59, 0.05), var(--shadow);
}

#app {
  min-height: 100dvh;
  padding-bottom: calc(var(--bottom-nav) + env(safe-area-inset-bottom, 0px));
}

.page {
  width: 100%;
  padding: 18px 18px 28px;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 56px;
  align-items: center;
  min-height: 64px;
  padding: max(8px, env(safe-area-inset-top, 0px)) 10px 8px;
  border-bottom: 1px solid rgba(216, 225, 222, 0.92);
  background: rgba(248, 250, 249, 0.94);
  backdrop-filter: blur(18px);
}

.topbar-side {
  display: flex;
  align-items: center;
  min-width: 0;
}

.topbar-side.right {
  justify-content: flex-end;
}

.topbar-title {
  min-width: 0;
  text-align: center;
}

.topbar-title strong {
  display: block;
  overflow: hidden;
  font-size: 16px;
  font-weight: 750;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-title small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 17px;
  font-weight: 800;
}

.hero-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: max(24px, calc(env(safe-area-inset-top, 0px) + 16px)) 18px 18px;
  background: var(--surface);
}

.hero-header h1 {
  margin: 5px 0 2px;
  font-size: 25px;
  font-weight: 790;
  letter-spacing: 0;
  line-height: 1.18;
}

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

.eyebrow {
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.avatar-button {
  display: grid;
  flex: 0 0 auto;
  width: 43px;
  height: 43px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 800;
}

.bottom-nav {
  position: fixed;
  z-index: 50;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  width: 100%;
  max-width: 560px;
  min-height: calc(var(--bottom-nav) + env(safe-area-inset-bottom, 0px));
  margin: 0 auto;
  padding: 7px 5px max(7px, env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(18px);
}

.nav-item {
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  border-radius: 8px;
  background: transparent;
  color: #788480;
  font-size: 10px;
  font-weight: 650;
}

.nav-item .nav-icon {
  display: grid;
  width: 36px;
  height: 31px;
  place-items: center;
  border-radius: 9px;
}

.nav-item.active {
  color: var(--primary);
}

.nav-item.active .nav-icon {
  background: var(--primary-soft);
}

.icon-button,
.round-action {
  display: inline-grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
}

.icon-button:hover,
.round-action:hover {
  background: #edf2f0;
}

.round-action {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--primary);
}

.primary-button,
.secondary-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 15px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 750;
  transition: transform 0.15s ease, background 0.15s ease;
}

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

.primary-button:hover {
  background: var(--primary-dark);
}

.primary-button:active,
.secondary-button:active,
.danger-button:active {
  transform: scale(0.985);
}

.primary-button.compact {
  min-height: 38px;
  padding: 7px 10px;
  font-size: 12px;
}

.secondary-button {
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--ink);
}

.danger-button {
  background: var(--danger);
  color: #fff;
}

.primary-button.wide,
.secondary-button.wide,
.danger-button.wide {
  width: 100%;
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  border-radius: 6px;
  background: transparent;
  color: var(--primary);
  font-size: 12px;
  font-weight: 750;
}

.text-button.strong {
  font-size: 14px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 24px 0 10px;
}

.section-title h2 {
  font-size: 17px;
  font-weight: 770;
}

.section-title > span,
.count-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 520;
}

.status-pill,
.score-chip,
.status-chip,
.score-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.6;
}

.status-pill {
  border-color: #bcdcd5;
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.status-chip.online {
  border-color: #bcdcd5;
  color: var(--primary);
}

.learning-hero {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 18px;
  border: 1px solid #c8ddd8;
  border-radius: var(--radius);
  background: #eef6f3;
}

.hero-progress {
  display: grid;
  place-items: center;
}

.progress-ring {
  position: relative;
  display: grid;
  width: 112px;
  height: 112px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--primary) var(--progress), #d5e5e1 0);
}

.progress-ring::before {
  position: absolute;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: #eef6f3;
  content: "";
}

.progress-ring-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  flex-direction: column;
}

.progress-ring-inner strong {
  font-size: 25px;
  line-height: 1;
}

.progress-ring-inner span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}

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

.hero-copy h2 {
  margin: 8px 0 1px;
  font-size: 27px;
  font-weight: 800;
}

.hero-copy h2 small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 550;
}

.hero-copy > p {
  margin-bottom: 13px;
  color: var(--muted);
  font-size: 11px;
}

.hero-copy .primary-button {
  width: 100%;
  justify-content: space-between;
  padding-inline: 13px;
}

.focus-strip {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 70px auto;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.focus-book-dot {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 7px;
  background: var(--book-color);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}

.focus-strip > div:nth-child(2) {
  min-width: 0;
}

.focus-strip span,
.focus-strip strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.focus-strip strong {
  font-size: 13px;
}

.mini-progress,
.book-bar {
  display: block;
  overflow: hidden;
  height: 5px;
  border-radius: 99px;
  background: #e8eeec;
}

.mini-progress span,
.book-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

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

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

.stat-tile {
  display: flex;
  min-width: 0;
  min-height: 112px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  flex-direction: column;
}

.stat-tile.accent {
  border-color: #bcdcd5;
  background: #edf6f3;
}

.stat-tile.warning {
  border-color: #edc8be;
  background: #fcf0ec;
}

.stat-icon {
  display: grid;
  width: 29px;
  height: 29px;
  margin-bottom: auto;
  place-items: center;
  border-radius: 7px;
  background: #edf2f0;
  color: var(--primary);
}

.stat-tile.warning .stat-icon {
  background: var(--coral-soft);
  color: var(--danger);
}

.stat-tile > span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.stat-tile > strong {
  display: block;
  overflow: hidden;
  margin: 1px 0;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-tile > small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.continue-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 40px;
  gap: 12px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
}

.word-miniature {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 24px;
  font-weight: 750;
}

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

.continue-main > div {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.continue-main strong {
  font-size: 19px;
}

.continue-main small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.continue-main p {
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.quick-action {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 74px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  text-align: left;
}

.quick-action:hover {
  border-color: var(--line-strong);
  background: #fcfdfd;
}

.quick-icon,
.tool-icon {
  display: grid;
  flex: 0 0 auto;
  width: 39px;
  height: 39px;
  place-items: center;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary);
}

.quick-icon.ai,
.tool-icon.ai {
  background: #ece8f8;
  color: #5e4a8f;
}

.quick-icon.train,
.tool-icon.train {
  background: var(--coral-soft);
  color: var(--coral);
}

.quick-icon.listen,
.tool-icon.listen {
  background: var(--blue-soft);
  color: var(--blue);
}

.quick-icon.read,
.tool-icon.weak {
  background: var(--amber-soft);
  color: var(--amber);
}

.quick-action > span:last-child,
.tool-row > span:nth-child(2) {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.quick-action strong,
.tool-row strong {
  font-size: 13px;
}

.quick-action small,
.tool-row small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overview-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) 42px;
  gap: 8px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.overview-row > div strong,
.overview-row > div span {
  display: block;
  text-align: center;
}

.overview-row > div strong {
  font-size: 18px;
}

.overview-row > div span {
  color: var(--muted);
  font-size: 9px;
}

.sync-note,
.ai-footnote,
.app-version {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--muted);
}

.search-box input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  flex: 1;
}

.search-hint {
  padding: 3px 6px;
  border-radius: 5px;
  background: #edf2f0;
  color: var(--primary);
  font-size: 9px;
  font-weight: 700;
}

.current-book {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 15px;
  padding: 15px;
  border: 1px solid #c8ddd8;
  border-radius: var(--radius);
  background: #eef6f3;
}

.book-cover {
  display: flex;
  width: 64px;
  height: 82px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 9px;
  border-radius: 7px;
  background: var(--book-color, var(--primary));
  color: #fff;
  flex-direction: column;
  font-size: 12px;
  font-weight: 800;
  box-shadow: inset -7px 0 rgba(0, 0, 0, 0.07);
}

.book-cover.large {
  width: 96px;
  height: 128px;
  padding: 12px;
  font-size: 20px;
}

.book-cover.large small {
  font-size: 10px;
  font-weight: 600;
  opacity: 0.76;
}

.book-cover.xlarge {
  width: 112px;
  height: 152px;
  padding: 14px;
  font-size: 24px;
}

.book-cover.custom {
  align-items: center;
  justify-content: center;
  background: var(--blue);
}

.current-book-info {
  min-width: 0;
}

.current-book-info h2 {
  margin: 5px 0 3px;
  font-size: 20px;
}

.current-book-info > p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.book-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 9px;
  margin: 9px 0;
  color: var(--muted);
  font-size: 9px;
}

.current-book-info .primary-button {
  width: 100%;
}

.book-shelf {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.book-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 22px;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  text-align: left;
}

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

.book-row:hover,
.book-row.active {
  background: #f0f7f5;
}

.book-row .book-cover {
  width: 54px;
  height: 68px;
  padding: 7px;
  font-size: 10px;
}

.book-row-main {
  min-width: 0;
}

.book-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.book-row-head strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.book-row-head em {
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 9px;
  font-style: normal;
}

.book-row-main small {
  display: block;
  margin: 1px 0 7px;
  color: var(--muted);
  font-size: 10px;
}

.empty-inline {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}

.empty-inline button {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 20px;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 16px;
  background: transparent;
  color: var(--primary);
  text-align: left;
}

.empty-inline span {
  display: flex;
  color: var(--ink);
  flex-direction: column;
}

.empty-inline small {
  color: var(--muted);
  font-size: 10px;
}

.book-detail-head {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.book-detail-head p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 12px;
}

.tag-row span {
  padding: 3px 7px;
  border-radius: 999px;
  background: #edf2f0;
  color: var(--muted);
  font-size: 9px;
}

.word-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.word-list.compact .word-list-row {
  grid-template-columns: minmax(90px, 0.7fr) minmax(0, 1fr) 20px;
}

.word-list-row {
  display: grid;
  grid-template-columns: minmax(100px, 0.7fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  text-align: left;
}

.word-list-row:last-child {
  border: 0;
}

.word-list-row > span:first-child {
  min-width: 0;
}

.word-list-row strong,
.word-list-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.word-list-row strong {
  font-size: 14px;
}

.word-list-row small {
  color: var(--muted);
  font-size: 9px;
}

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

.word-state {
  padding: 3px 6px;
  border-radius: 999px;
  background: #edf2f0;
  color: var(--muted);
  font-size: 9px;
}

.word-state.weak {
  background: var(--coral-soft);
  color: var(--danger);
}

.word-state.mastered {
  background: var(--primary-soft);
  color: var(--primary);
}

.book-detail-head + .stats-grid {
  margin-bottom: 10px;
}

.word-list + .secondary-button {
  margin-top: 14px;
}

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

.empty-state > .icon {
  margin-bottom: 14px;
  color: var(--primary);
}

.empty-state strong {
  color: var(--ink);
  font-size: 17px;
}

.empty-state p {
  max-width: 320px;
  margin: 7px 0 16px;
  font-size: 12px;
}

.study-page {
  overflow: hidden;
}

.study-progress {
  overflow: hidden;
  height: 5px;
  margin-bottom: 14px;
  border-radius: 99px;
  background: #e2eae7;
}

.study-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width 0.25s ease;
}

.study-card {
  min-height: 438px;
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
}

.study-card-tags {
  display: flex;
  gap: 6px;
}

.study-card-tags span {
  padding: 3px 7px;
  border-radius: 999px;
  background: #edf2f0;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.study-card-tags span.danger {
  background: var(--coral-soft);
  color: var(--danger);
}

.study-word-block {
  padding: 58px 0 42px;
  text-align: center;
}

.study-word-block h1 {
  font-family: "Georgia", "Times New Roman", serif;
  font-size: clamp(37px, 11vw, 52px);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.study-word-block p {
  margin-top: 8px;
  color: var(--muted);
  font-family: "Georgia", serif;
  font-size: 15px;
}

.audio-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 18px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8faf9;
  color: var(--primary);
  font-size: 10px;
  font-weight: 700;
}

.audio-button.compact {
  margin: 0;
}

.reveal-prompt {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 15px;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--primary);
  flex-direction: column;
  gap: 5px;
}

.reveal-prompt span {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 750;
}

.reveal-prompt small {
  color: var(--muted);
  font-size: 10px;
}

.study-answer {
  padding-top: 4px;
  border-top: 1px solid var(--line);
  animation: answer-in 0.22s ease both;
}

@keyframes answer-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
}

.meaning-line {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 9px;
  align-items: baseline;
  padding: 14px 0;
}

.meaning-line b {
  color: var(--coral);
  font-size: 12px;
}

.meaning-line span {
  font-size: 16px;
  font-weight: 700;
}

.example-block {
  position: relative;
  padding: 14px 42px 14px 13px;
  border-left: 3px solid var(--primary);
  background: #f0f7f5;
}

.example-block > span {
  color: var(--primary);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.09em;
}

.example-block p {
  margin-top: 5px;
  font-family: "Georgia", serif;
  font-size: 14px;
  line-height: 1.5;
}

.example-block small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.inline-audio {
  position: absolute;
  top: 12px;
  right: 8px;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 8px;
  background: #fff;
  color: var(--primary);
}

.inline-audio.large {
  position: static;
  width: 42px;
  height: 42px;
  margin-top: 15px;
}

.memory-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
}

.memory-row > span {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
}

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

.rating-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 62px;
  border-radius: var(--radius);
  font-weight: 750;
}

.rating-button span {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
}

.rating-button small {
  font-size: 9px;
  font-weight: 550;
  opacity: 0.72;
}

.rating-button.unknown {
  border: 1px solid #edc8be;
  background: var(--coral-soft);
  color: var(--danger);
}

.rating-button.known {
  border: 1px solid #b6d9d2;
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.study-bottom-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 11px;
}

.completion-page {
  padding-top: 32px;
}

.completion-hero {
  display: flex;
  align-items: center;
  padding: 30px 18px;
  border: 1px solid #c8ddd8;
  border-radius: var(--radius);
  background: #eef6f3;
  flex-direction: column;
  text-align: center;
}

.completion-hero.compact {
  padding: 24px 18px;
}

.completion-mark {
  display: grid;
  width: 68px;
  height: 68px;
  margin-bottom: 14px;
  place-items: center;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
}

.completion-hero h1 {
  margin: 5px 0;
  font-size: 24px;
}

.completion-hero p {
  max-width: 330px;
  color: var(--muted);
  font-size: 12px;
}

.completion-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 13px;
  padding: 16px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.completion-stats div {
  text-align: center;
  border-right: 1px solid var(--line);
}

.completion-stats div:last-child {
  border: 0;
}

.completion-stats strong,
.completion-stats span {
  display: block;
}

.completion-stats strong {
  font-size: 23px;
}

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

.completion-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 16px;
}

.training-overview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 16px;
  border: 1px solid #c8ddd8;
  border-radius: var(--radius);
  background: #eef6f3;
}

.training-overview > div:first-child {
  min-width: 0;
}

.training-overview span {
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
}

.training-overview strong {
  display: block;
  margin: 3px 0;
  font-size: 17px;
}

.training-overview p {
  color: var(--muted);
  font-size: 10px;
}

.training-score {
  display: grid;
  flex: 0 0 66px;
  height: 66px;
  place-items: center;
  border: 1px solid #b9d9d3;
  border-radius: 50%;
  background: #fff;
  align-content: center;
}

.training-score strong {
  margin: 0;
  font-size: 21px;
  line-height: 1;
}

.training-score small {
  color: var(--muted);
  font-size: 9px;
}

.tool-list,
.menu-list,
.activity-list,
.listen-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.tool-row,
.menu-list > button,
.listen-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 22px;
  gap: 11px;
  align-items: center;
  width: 100%;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  text-align: left;
}

.tool-row:last-child,
.menu-list > button:last-child,
.listen-row:last-child {
  border-bottom: 0;
}

.tool-row.featured {
  background: #f7f4fc;
}

.activity-list {
  padding: 4px 12px;
}

.activity-list > div {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.activity-list > div:last-child {
  border: 0;
}

.activity-list span {
  display: flex;
  flex-direction: column;
}

.activity-list strong {
  font-size: 12px;
}

.activity-list small {
  color: var(--muted);
  font-size: 9px;
}

.activity-list b {
  color: var(--primary);
  font-size: 12px;
}

.question-card {
  display: flex;
  align-items: center;
  min-height: 250px;
  padding: 26px 19px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.question-card h1 {
  margin-top: 13px;
  font-family: "Georgia", "Times New Roman", serif;
  font-size: clamp(34px, 10vw, 48px);
  font-weight: 650;
}

.question-card h1.cloze-prompt {
  max-width: 470px;
  font-size: 21px;
  line-height: 1.55;
}

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

.option-button {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 20px;
  gap: 9px;
  align-items: center;
  min-height: 54px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  text-align: left;
}

.option-button > span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 6px;
  background: #edf2f0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.option-button strong {
  font-size: 13px;
  font-weight: 650;
}

.option-button.correct {
  border-color: #a9d4cc;
  background: #eef8f5;
  color: var(--primary-dark);
}

.option-button.correct > span {
  background: var(--primary);
  color: #fff;
}

.option-button.wrong {
  border-color: #ebc0b6;
  background: #fdf0ed;
  color: var(--danger);
}

.option-button.wrong > span {
  background: var(--coral);
  color: #fff;
}

.answer-feedback {
  margin-top: 13px;
  padding: 14px;
  border: 1px solid #b8dcd5;
  border-radius: var(--radius);
  background: #eef8f5;
}

.answer-feedback.wrong {
  border-color: #ebc4ba;
  background: #fdf2ef;
}

.answer-feedback > div {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--primary-dark);
}

.answer-feedback.wrong > div {
  color: var(--danger);
}

.answer-feedback p {
  margin: 7px 0 12px;
  color: var(--muted);
  font-size: 11px;
}

.question-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 10px;
}

.word-picker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border: 1px solid #d6cfeb;
  border-radius: var(--radius);
  background: #f5f2fb;
}

.word-picker-display {
  min-width: 0;
}

.word-picker-display span,
.word-picker-display strong,
.word-picker-display small {
  display: block;
}

.word-picker-display span {
  color: #5e4a8f;
  font-size: 9px;
  font-weight: 800;
}

.word-picker-display strong {
  margin: 1px 0;
  font-family: "Georgia", serif;
  font-size: 28px;
}

.word-picker-display small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-config {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.ai-config > div:first-child span,
.ai-config > div:first-child small {
  display: block;
}

.ai-config > div:first-child span {
  font-size: 12px;
  font-weight: 750;
}

.ai-config > div:first-child small {
  color: var(--muted);
  font-size: 9px;
}

.segmented {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef2f1;
}

.segmented button {
  min-height: 30px;
  padding: 4px 9px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.segmented button.active {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(30, 54, 49, 0.12);
}

.segmented.compact {
  grid-auto-columns: auto;
}

.ai-result {
  margin-top: 14px;
}

.ai-result-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid #d9d1ee;
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  background: #f7f4fc;
}

.ai-orb {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: #5e4a8f;
  color: #fff;
}

.ai-result-head strong,
.ai-result-head small {
  display: block;
}

.ai-result-head strong {
  font-size: 12px;
}

.ai-result-head small {
  color: var(--muted);
  font-size: 9px;
}

.sentence-list {
  border-right: 1px solid #d9d1ee;
  border-left: 1px solid #d9d1ee;
}

.sentence-item {
  padding: 14px;
  border-top: 1px solid #e5e0f1;
  background: #fff;
}

.sentence-item > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sentence-item > div span {
  color: #5e4a8f;
  font-size: 9px;
  font-weight: 800;
}

.sentence-item button {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 7px;
  background: #f1eef8;
  color: #5e4a8f;
}

.sentence-item p {
  margin-top: 6px;
  font-family: "Georgia", serif;
  font-size: 15px;
  line-height: 1.6;
}

.sentence-item small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.usage-notes,
.output-task {
  padding: 13px;
  border: 1px solid #d9d1ee;
  background: #faf9fd;
}

.usage-notes strong {
  font-size: 11px;
}

.usage-notes p {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
}

.usage-notes p .icon {
  margin-top: 1px;
  color: #5e4a8f;
}

.output-task {
  border-radius: 0 0 var(--radius) var(--radius);
  background: #f0edf8;
}

.output-task span {
  color: #5e4a8f;
  font-size: 9px;
  font-weight: 800;
}

.output-task p {
  margin-top: 4px;
  font-size: 12px;
}

.ai-intro {
  display: flex;
  align-items: center;
  padding: 30px 22px;
  border: 1px solid #d9d1ee;
  border-radius: var(--radius);
  background: #f7f4fc;
  flex-direction: column;
  text-align: center;
}

.ai-intro-mark {
  display: grid;
  width: 62px;
  height: 62px;
  margin-bottom: 14px;
  place-items: center;
  border-radius: 50%;
  background: #5e4a8f;
  color: #fff;
}

.ai-intro h2 {
  font-size: 18px;
}

.ai-intro p {
  max-width: 350px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

.writing-box {
  margin-top: 16px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.writing-box .section-title {
  margin: 0 0 8px;
}

.writing-box .section-title h2 {
  font-size: 14px;
}

.writing-box .section-title span {
  color: var(--muted);
  font-size: 9px;
}

.writing-box textarea,
.form-label textarea {
  width: 100%;
  padding: 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  outline: 0;
  background: #f9fbfa;
  resize: vertical;
  font-size: 13px;
  line-height: 1.55;
}

.writing-box .secondary-button {
  margin-top: 8px;
}

.sticky-action {
  margin-top: 14px;
}

.ai-footnote {
  padding: 0 12px;
  line-height: 1.5;
}

.reading-summary,
.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 14px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.reading-summary > div,
.profile-stats > div {
  text-align: center;
  border-right: 1px solid var(--line);
}

.reading-summary > div:last-child,
.profile-stats > div:last-child {
  border: 0;
}

.reading-summary span,
.reading-summary strong,
.profile-stats span,
.profile-stats strong {
  display: block;
}

.reading-summary span,
.profile-stats span {
  color: var(--muted);
  font-size: 9px;
}

.reading-summary strong,
.profile-stats strong {
  margin-top: 2px;
  font-size: 18px;
}

.reading-summary + .search-box {
  margin-top: 12px;
}

.article-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.article-row {
  display: grid;
  grid-template-columns: 73px minmax(0, 1fr) 22px;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  text-align: left;
}

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

.article-cover {
  position: relative;
  display: grid;
  width: 73px;
  height: 84px;
  place-items: center;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
}

.article-cover.cover-city {
  background: #315b9a;
}

.article-cover.cover-sleep {
  background: #5e4a8f;
}

.article-cover.cover-ai {
  background: #9a4d35;
}

.article-cover.cover-custom {
  background: #526460;
}

.article-cover i {
  position: absolute;
  top: 6px;
  left: 7px;
  font-size: 8px;
  font-style: normal;
  font-weight: 800;
  opacity: 0.8;
}

.article-cover b {
  opacity: 0.9;
}

.article-row-main {
  min-width: 0;
}

.article-row-main > span {
  color: var(--primary);
  font-size: 9px;
  font-weight: 800;
}

.article-row-main strong,
.article-row-main small,
.article-row-main em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.article-row-main strong {
  margin: 2px 0 3px;
  font-size: 14px;
  white-space: nowrap;
}

.article-row-main small {
  display: -webkit-box;
  color: var(--muted);
  font-size: 10px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.article-row-main em {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
  white-space: nowrap;
}

.import-banner {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 20px;
  gap: 10px;
  align-items: center;
  width: 100%;
  margin-top: 13px;
  padding: 13px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: #f5f8f7;
  color: var(--primary);
  text-align: left;
}

.import-banner > span:nth-child(2) {
  display: flex;
  color: var(--ink);
  flex-direction: column;
}

.import-banner strong {
  font-size: 12px;
}

.import-banner small {
  color: var(--muted);
  font-size: 9px;
}

.article-header {
  padding: 10px 2px 20px;
  border-bottom: 1px solid var(--line);
}

.article-header h1 {
  margin: 8px 0;
  font-family: "Georgia", "Times New Roman", serif;
  font-size: clamp(27px, 8vw, 38px);
  font-weight: 650;
  line-height: 1.17;
}

.article-header > p {
  color: var(--muted);
  font-size: 12px;
}

.article-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.article-actions button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 10px;
}

.article-actions button:first-child {
  color: var(--primary);
}

.article-body {
  padding: 22px 1px;
}

.article-body p {
  margin-bottom: 18px;
  color: #25322f;
  font-family: "Georgia", "Times New Roman", serif;
  font-size: var(--article-font);
  line-height: 1.78;
}

.inline-word {
  display: inline;
  padding: 0 1px;
  border-bottom: 1px solid rgba(12, 118, 109, 0.26);
  border-radius: 2px;
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

.inline-word:hover {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.glossary {
  margin-top: 8px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.glossary > button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 11px 2px;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--primary);
  text-align: left;
}

.glossary > button span {
  display: flex;
  color: var(--ink);
  flex-direction: column;
}

.glossary strong {
  font-family: "Georgia", serif;
  font-size: 14px;
}

.glossary small {
  color: var(--muted);
  font-size: 10px;
}

.reading-finish {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-top: 20px;
  padding: 14px;
  border: 1px solid #c8ddd8;
  border-radius: var(--radius);
  background: #eef6f3;
}

.reading-finish > div {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--primary);
}

.reading-finish span {
  display: flex;
  color: var(--ink);
  flex-direction: column;
}

.reading-finish strong {
  font-size: 12px;
}

.reading-finish small {
  color: var(--muted);
  font-size: 9px;
}

.listening-banner {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid #cbd8e9;
  border-radius: var(--radius);
  background: #eef3fa;
}

.sound-wave {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 55px;
}

.sound-wave i {
  width: 3px;
  border-radius: 3px;
  background: var(--blue);
  opacity: 0.7;
}

.listening-banner span,
.listening-banner strong,
.listening-banner p {
  display: block;
}

.listening-banner span {
  color: var(--blue);
  font-size: 9px;
  font-weight: 800;
}

.listening-banner strong {
  margin: 3px 0;
  font-size: 14px;
}

.listening-banner p {
  color: var(--muted);
  font-size: 9px;
}

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

.listen-play {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue);
}

.listen-row > span:nth-child(2) {
  min-width: 0;
}

.listen-row small,
.listen-row strong,
.listen-row em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.listen-row small {
  color: var(--blue);
  font-size: 9px;
  font-weight: 700;
}

.listen-row strong {
  font-size: 13px;
}

.listen-row em {
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
}

.listen-score {
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 10px;
  font-weight: 800;
}

.exam-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  padding: 13px;
  border: 1px solid #e7d5b7;
  border-radius: var(--radius);
  background: #fbf5e9;
  color: var(--amber);
}

.exam-note strong {
  font-size: 12px;
}

.exam-note p {
  color: #7b6845;
  font-size: 10px;
}

.audio-player {
  padding: 17px;
  border: 1px solid #cbd8e9;
  border-radius: var(--radius);
  background: #eef3fa;
}

.audio-art {
  position: relative;
  display: grid;
  width: 100%;
  height: 112px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--blue);
  color: #fff;
}

.audio-art span {
  position: absolute;
  top: 10px;
  left: 11px;
  font-size: 9px;
  font-weight: 800;
  opacity: 0.8;
}

.audio-info {
  padding: 13px 0 9px;
  text-align: center;
}

.audio-info span,
.audio-info strong,
.audio-info small {
  display: block;
}

.audio-info span {
  color: var(--blue);
  font-size: 9px;
  font-weight: 700;
}

.audio-info strong {
  margin: 3px 0;
  font-size: 17px;
}

.audio-info small {
  color: var(--muted);
  font-size: 10px;
}

.audio-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
}

.control-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  color: var(--blue);
}

.play-button {
  display: grid;
  width: 60px;
  height: 60px;
  place-items: center;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
}

.player-progress {
  overflow: hidden;
  height: 4px;
  margin-top: 16px;
  border-radius: 99px;
  background: #d3ddec;
}

.player-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
  transition: width 0.25s ease;
}

.player-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}

.transcript {
  margin-top: 14px;
}

.transcript > button {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) 20px;
  gap: 8px;
  align-items: flex-start;
  width: 100%;
  padding: 10px 3px;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  text-align: left;
}

.transcript > button.current {
  background: var(--blue-soft);
  color: var(--blue);
}

.transcript > button span {
  font-size: 9px;
  font-weight: 800;
}

.transcript > button p {
  color: var(--ink);
  font-family: "Georgia", serif;
  font-size: 13px;
  line-height: 1.55;
}

.listen-questions {
  display: grid;
  gap: 12px;
}

.listen-question {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.listen-question > div:first-child {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.listen-question > div:first-child span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 7px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 10px;
  font-weight: 800;
}

.listen-question > div:first-child strong {
  padding-top: 4px;
  font-size: 13px;
}

.listen-options {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.listen-options button {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) 18px;
  gap: 7px;
  align-items: center;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fafcfb;
  text-align: left;
  font-size: 11px;
}

.listen-options button > span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 6px;
  background: #edf2f0;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.listen-options button.correct {
  border-color: #a9d4cc;
  background: #eef8f5;
  color: var(--primary-dark);
}

.listen-options button.correct > span {
  background: var(--primary);
  color: #fff;
}

.listen-options button.wrong {
  border-color: #ebc0b6;
  background: #fdf0ed;
  color: var(--danger);
}

.listen-explanation {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  margin-top: 10px;
  padding: 9px;
  border-radius: 6px;
  background: #eef8f5;
  color: var(--primary-dark);
  font-size: 10px;
}

.notebook-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid #e4d4b4;
  border-radius: var(--radius);
  background: #fbf5e9;
}

.notebook-summary > div span,
.notebook-summary > div strong {
  display: block;
}

.notebook-summary > div span {
  color: #7b6845;
  font-size: 9px;
}

.notebook-summary > div strong {
  font-size: 20px;
}

.notebook-summary + .search-box {
  margin: 12px 0;
}

.weak-list {
  border-color: #e5d8c1;
}

.weak-word-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.weak-word-row:last-child {
  border: 0;
}

.weak-word-row > button:first-child {
  display: grid;
  grid-template-columns: minmax(90px, 0.65fr) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 11px 12px;
  background: #fff;
  text-align: left;
}

.weak-word-row span:first-child {
  min-width: 0;
}

.weak-word-row strong,
.weak-word-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weak-word-row strong {
  font-size: 14px;
}

.weak-word-row small,
.weak-word-row > button:first-child > span:last-child {
  color: var(--muted);
  font-size: 10px;
}

.weak-word-row > button:first-child > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mistake-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.mistake-list button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 20px;
  gap: 8px;
  align-items: center;
  width: 100%;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  text-align: left;
}

.mistake-list button:last-child {
  border: 0;
}

.mistake-list button > span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--danger);
}

.mistake-list button strong {
  color: var(--ink);
  font-size: 13px;
}

.mistake-list small {
  color: var(--muted);
  font-size: 9px;
}

.report-headline {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 17px;
  border: 1px solid #c8ddd8;
  border-radius: var(--radius);
  background: #eef6f3;
}

.report-headline .progress-ring {
  width: 106px;
  height: 106px;
}

.report-headline .progress-ring::before {
  width: 82px;
  height: 82px;
}

.report-headline > div:last-child > span {
  color: var(--muted);
  font-size: 10px;
}

.report-headline h1 {
  margin: 3px 0 5px;
  font-size: 20px;
}

.report-headline p {
  color: var(--muted);
  font-size: 10px;
}

.chart-panel,
.forecast-panel,
.mastery-distribution,
.diagnosis-panel {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

#trendChart {
  display: block;
  width: 100%;
  height: 180px;
}

.chart-legend {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
}

.chart-legend span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.chart-legend i {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--primary);
}

.chart-legend i.orange {
  background: var(--coral);
}

.chart-legend i.green {
  background: var(--blue);
}

.forecast-bars {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  height: 125px;
  align-items: end;
}

.forecast-bars > div {
  display: flex;
  align-items: center;
  height: 100%;
  flex-direction: column;
  justify-content: flex-end;
}

.forecast-bars > div > span {
  display: flex;
  align-items: center;
  width: 100%;
  height: 94px;
  flex-direction: column-reverse;
  justify-content: flex-start;
}

.forecast-bars i {
  display: block;
  width: min(20px, 70%);
  border-radius: 4px 4px 0 0;
  background: #a9cfc8;
}

.forecast-bars > div:first-child i {
  background: var(--coral);
}

.forecast-bars b {
  min-height: 16px;
  color: var(--muted);
  font-size: 8px;
}

.forecast-bars small {
  color: var(--muted);
  font-size: 8px;
}

.forecast-panel > p {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
}

.mastery-distribution {
  display: grid;
  gap: 8px;
}

.mastery-distribution > div {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 24px;
  gap: 8px;
  align-items: center;
}

.mastery-distribution span,
.mastery-distribution em {
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
}

.mastery-distribution i {
  display: block;
  overflow: hidden;
  height: 7px;
  border-radius: 99px;
  background: #edf2f0;
}

.mastery-distribution b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

.mastery-distribution > div:first-child b {
  background: var(--coral);
}

.diagnosis-panel {
  border-color: #d9d1ee;
  background: #faf9fd;
}

.diagnosis-head {
  display: flex;
  align-items: center;
  gap: 9px;
}

.diagnosis-head > span {
  display: grid;
  width: 37px;
  height: 37px;
  place-items: center;
  border-radius: 50%;
  background: #5e4a8f;
  color: #fff;
}

.diagnosis-head strong,
.diagnosis-head small {
  display: block;
}

.diagnosis-head strong {
  font-size: 12px;
}

.diagnosis-head small {
  color: var(--muted);
  font-size: 9px;
}

.diagnosis-panel > p {
  margin-top: 10px;
  color: #4e5563;
  font-size: 11px;
  line-height: 1.65;
}

.diagnosis-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 11px;
}

.diagnosis-meta span {
  padding: 4px 7px;
  border-radius: 999px;
  background: #ece8f8;
  color: #5e4a8f;
  font-size: 9px;
  font-weight: 700;
}

.diagnosis-empty {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.diagnosis-empty > .icon {
  color: #5e4a8f;
}

.diagnosis-empty strong {
  font-size: 12px;
}

.diagnosis-empty p {
  color: var(--muted);
  font-size: 10px;
}

.diagnosis-empty .primary-button {
  grid-column: 1 / -1;
}

.export-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.export-grid button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--primary);
  text-align: left;
}

.export-grid span {
  display: flex;
  color: var(--ink);
  flex-direction: column;
}

.export-grid strong {
  font-size: 12px;
}

.export-grid small {
  color: var(--muted);
  font-size: 9px;
}

.profile-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 16px;
  border: 1px solid #c8ddd8;
  border-radius: var(--radius);
  background: #eef6f3;
}

.profile-avatar {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 23px;
  font-weight: 800;
}

.profile-card h1 {
  font-size: 19px;
}

.profile-card p {
  color: var(--muted);
  font-size: 10px;
}

.profile-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 12px;
}

.menu-list > button {
  grid-template-columns: 30px minmax(0, 1fr) 20px;
}

.menu-list > button > .icon:first-child {
  color: var(--primary);
}

.menu-list span {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.menu-list strong {
  font-size: 12px;
}

.menu-list small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 20px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f6f8f7;
  color: var(--muted);
}

.privacy-note p {
  font-size: 9px;
}

.settings-section {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  min-height: 62px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

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

.setting-row.stacked {
  align-items: stretch;
  flex-direction: column;
  gap: 10px;
}

.setting-row > span:first-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.setting-row strong {
  font-size: 12px;
}

.setting-row small {
  color: var(--muted);
  font-size: 9px;
}

.stepper {
  display: grid;
  grid-template-columns: 34px 38px 34px;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stepper button {
  height: 34px;
  background: #f1f5f3;
  color: var(--primary);
  font-size: 18px;
}

.stepper b {
  text-align: center;
  font-size: 13px;
}

.goal-slider {
  padding: 12px;
}

.goal-slider input {
  width: 100%;
  accent-color: var(--primary);
}

.goal-slider > div {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 8px;
}

.form-section {
  display: grid;
  gap: 12px;
  padding: 13px;
}

.form-section > label,
.form-label {
  display: grid;
  gap: 5px;
}

.form-section > label > span,
.form-label > span {
  font-size: 11px;
  font-weight: 700;
}

.form-section input,
.form-label input {
  width: 100%;
  height: 41px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  outline: 0;
  background: #f9fbfa;
  font-size: 12px;
}

.form-section label small {
  color: var(--muted);
  font-size: 9px;
}

.switch-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.switch-row > span {
  display: flex;
  flex-direction: column;
}

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

.switch-row i {
  position: relative;
  width: 46px;
  height: 27px;
  border-radius: 99px;
  background: #cbd6d3;
  transition: background 0.18s ease;
}

.switch-row i::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: #fff;
  content: "";
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  transition: transform 0.18s ease;
}

.switch-row input:checked + i {
  background: var(--primary);
}

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

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

.data-actions {
  gap: 0;
  padding: 0;
}

.data-actions button {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 20px;
  gap: 8px;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: var(--primary);
  text-align: left;
}

.data-actions button:last-child {
  border: 0;
}

.data-actions span {
  display: flex;
  color: var(--ink);
  flex-direction: column;
}

.data-actions strong {
  font-size: 12px;
}

.data-actions small {
  color: var(--muted);
  font-size: 9px;
}

.data-actions button.danger {
  color: var(--danger);
}

.data-actions button.danger strong {
  color: var(--danger);
}

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: rgba(11, 28, 25, 0.48);
  opacity: 0;
  transition: opacity 0.18s ease;
}

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

.modal-panel {
  width: 100%;
  max-width: 560px;
  max-height: 92dvh;
  overflow: hidden;
  border-radius: 14px 14px 0 0;
  background: #fff;
  box-shadow: 0 -18px 60px rgba(12, 31, 28, 0.24);
  transform: translateY(16px);
  transition: transform 0.18s ease;
}

.modal-backdrop.visible .modal-panel {
  transform: translateY(0);
}

.modal-panel > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  padding: 17px 17px 12px;
  border-bottom: 1px solid var(--line);
}

.modal-panel h2 {
  font-size: 17px;
}

.modal-panel header p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.modal-body {
  max-height: 66dvh;
  overflow-y: auto;
  padding: 16px 17px;
}

.modal-panel > footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 12px 17px max(12px, env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: #fafcfb;
}

.modal-panel > footer .wide {
  flex: 1;
}

.qr-loading {
  display: flex;
  align-items: center;
  min-height: 320px;
  color: var(--muted);
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}

.qr-loading .icon {
  color: var(--primary);
  animation: pulse 1.2s infinite;
}

@keyframes pulse {
  50% {
    opacity: 0.45;
  }
}

.qr-wrap {
  display: flex;
  align-items: center;
  flex-direction: column;
}

.qr-wrap > img,
.qr-grid {
  width: 216px;
  height: 216px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.qr-grid {
  display: grid;
  grid-template-columns: repeat(21, 1fr);
  grid-template-rows: repeat(21, 1fr);
  gap: 1px;
}

.qr-grid i {
  background: #fff;
}

.qr-grid i.dark {
  background: #102a26;
}

.qr-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 8px 11px;
  border-radius: 999px;
  background: #f1f5f3;
}

.qr-status p {
  color: var(--muted);
  font-size: 9px;
}

.scan-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e39a2e;
  box-shadow: 0 0 0 4px rgba(227, 154, 46, 0.15);
}

.qr-steps {
  display: flex;
  gap: 15px;
  margin-top: 15px;
}

.qr-steps span {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 9px;
}

.qr-steps b {
  display: grid;
  width: 16px;
  height: 16px;
  place-items: center;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 8px;
}

.dictionary-word {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
}

.dictionary-word span {
  color: var(--coral);
  font-size: 10px;
  font-weight: 700;
}

.dictionary-word h3 {
  font-family: "Georgia", serif;
  font-size: 28px;
}

.dictionary-word p {
  color: var(--muted);
  font-size: 11px;
}

.dictionary-meaning {
  padding: 14px 0;
}

.dictionary-meaning strong {
  font-size: 15px;
}

.dictionary-meaning p {
  margin-top: 8px;
  padding: 10px;
  border-left: 3px solid var(--primary);
  background: #f0f7f5;
  font-family: "Georgia", serif;
  font-size: 13px;
}

.dictionary-meaning small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

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

.dictionary-actions button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8faf9;
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
}

.dictionary-loading,
.error-state,
.danger-state {
  display: flex;
  align-items: center;
  min-height: 250px;
  color: var(--muted);
  flex-direction: column;
  justify-content: center;
  text-align: center;
  gap: 10px;
}

.error-state.small {
  min-height: 120px;
}

.error-state p,
.danger-state p {
  max-width: 330px;
  color: var(--ink);
  font-size: 12px;
}

.error-state small,
.danger-state small {
  font-size: 10px;
}

.danger-state .icon {
  color: var(--danger);
}

.import-modal .modal-body {
  display: grid;
  gap: 13px;
}

.format-help {
  padding: 10px;
  border-radius: var(--radius);
  background: #f1f5f3;
}

.format-help strong {
  font-size: 11px;
}

.format-help p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.file-picker {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  width: 100%;
  padding: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: #f9fbfa;
  color: var(--primary);
  text-align: left;
}

.file-picker span {
  display: flex;
  color: var(--ink);
  flex-direction: column;
}

.file-picker strong {
  font-size: 11px;
}

.file-picker small {
  color: var(--muted);
  font-size: 9px;
}

.toast-root {
  position: fixed;
  z-index: 160;
  top: max(15px, env(safe-area-inset-top, 0px));
  left: 50%;
  display: flex;
  align-items: center;
  width: min(calc(100% - 28px), 480px);
  pointer-events: none;
  flex-direction: column;
  gap: 7px;
  transform: translateX(-50%);
}

.toast {
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 10px 13px;
  border: 1px solid #cbd6d3;
  border-radius: 999px;
  background: rgba(25, 42, 38, 0.94);
  color: #fff;
  font-size: 11px;
  opacity: 0;
  box-shadow: 0 9px 26px rgba(12, 31, 28, 0.24);
  transform: translateY(-7px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

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

.toast.success .icon {
  color: #73d3c5;
}

.toast.error .icon {
  color: #ff9d87;
}

[hidden] {
  display: none !important;
}

@media (min-width: 700px) {
  body {
    padding: 18px 0;
  }

  .app-shell {
    min-height: calc(100dvh - 36px);
    border-radius: 12px;
  }

  #app {
    min-height: calc(100dvh - 36px);
  }

  .bottom-nav {
    bottom: 18px;
    border-radius: 0 0 12px 12px;
  }
}

@media (max-width: 390px) {
  .page {
    padding-right: 14px;
    padding-left: 14px;
  }

  .hero-header {
    padding-right: 14px;
    padding-left: 14px;
  }

  .learning-hero {
    grid-template-columns: 102px minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
  }

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

  .progress-ring::before {
    width: 76px;
    height: 76px;
  }

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

  .stat-tile {
    min-height: 104px;
  }

  .current-book {
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 11px;
  }

  .book-cover.large {
    width: 82px;
    height: 116px;
  }

  .book-detail-head {
    grid-template-columns: 94px minmax(0, 1fr);
    gap: 13px;
  }

  .book-cover.xlarge {
    width: 94px;
    height: 132px;
  }

  .reading-summary strong,
  .profile-stats strong {
    font-size: 15px;
  }

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

  .notebook-summary .primary-button {
    grid-column: 1 / -1;
  }

  .profile-card {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .profile-card > .status-chip,
  .profile-card > .primary-button {
    grid-column: 1 / -1;
  }
}

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