/* 爱尚背单词：手机、平板、电脑通用响应式设计变量 */
:root {
  --bg: #f8f1d7;
  --bg-deep: #f0e2ad;
  --card: #fffdf4;
  --card-strong: #fffaf0;
  --text: #343126;
  --muted: #8b8165;
  --primary: #e8a436;
  --primary-dark: #b97216;
  --green: #67a978;
  --green-soft: #e5f1df;
  --orange-soft: #fbe3b7;
  --red: #d77b67;
  --red-soft: #f6ded7;
  --line: rgba(111, 91, 44, 0.13);
  --shadow: 0 12px 34px rgba(113, 83, 27, 0.1);
  --radius-lg: 28px;
  --radius-md: 20px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  overscroll-behavior: none;
}

button {
  color: inherit;
  font: inherit;
  border: 0;
  cursor: pointer;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.is-hidden {
  display: none !important;
}

.app-shell {
  width: 100%;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 90% 2%, rgba(255, 255, 255, 0.76), transparent 24%),
    var(--bg);
}

.app-header {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  height: calc(68px + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 18px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(248, 241, 215, 0.9);
  border-bottom: 1px solid rgba(111, 91, 44, 0.08);
  backdrop-filter: blur(14px);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.account-button {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px 5px 5px;
  color: var(--primary-dark);
  background: rgba(255, 253, 244, 0.7);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.account-button span {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--green);
  border-radius: 50%;
  font-size: 10px;
  font-weight: 800;
}

.account-button em {
  max-width: 52px;
  overflow: hidden;
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-header__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
}

.app-header__brand strong,
.app-header__brand small {
  display: block;
}

.app-header__brand strong {
  font-size: 16px;
  letter-spacing: 0.04em;
}

.app-header__brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.mini-brand,
.brand-mark {
  position: relative;
  display: block;
  overflow: hidden;
  flex: 0 0 auto;
  background: #fff;
  box-shadow: 0 3px 10px rgba(34, 113, 106, 0.14);
}

/*
 * 原始品牌图包含大面积留白和下方文字。
 * 这里放大并居中定位图片，只展示上方的彩色图形标志。
 */
.mini-brand img,
.brand-mark img {
  position: absolute;
  top: -61%;
  left: 50%;
  width: 306%;
  max-width: none;
  height: auto;
  transform: translateX(-50%);
}

.mini-brand {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(25, 126, 117, 0.1);
  border-radius: 12px;
}

.icon-button {
  width: 42px;
  height: 42px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  background: transparent;
  border-radius: 14px;
}

.icon-button:active {
  background: rgba(232, 164, 54, 0.13);
  transform: scale(0.95);
}

#backButton {
  margin-right: 8px;
}

.main-content {
  min-height: 100dvh;
  padding: 84px 16px calc(92px + var(--safe-bottom));
}

.membership-banner {
  margin-bottom: 14px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff8e7;
  background: linear-gradient(135deg, #2f7773, #0d5556);
  border-radius: 19px;
  box-shadow: 0 10px 25px rgba(20, 91, 88, 0.17);
}

.membership-banner.is-member {
  background: linear-gradient(135deg, #d29a37, #9f6515);
}

.membership-banner__icon {
  width: 39px;
  height: 39px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  color: #785014;
  background: #ffd97e;
  border-radius: 13px;
  font-family: Georgia, serif;
  font-size: 10px;
  font-weight: 900;
}

.membership-banner > div:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.membership-banner strong,
.membership-banner p {
  display: block;
  margin: 0;
}

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

.membership-banner p {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 8px;
  line-height: 1.45;
}

.membership-banner button {
  padding: 7px 9px;
  color: #805410;
  background: #ffdda0;
  border-radius: 10px;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.view {
  display: none;
  animation: view-in 0.28s ease both;
}

.view.is-active {
  display: block;
}

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

.welcome-card,
.mistake-summary,
.stats-hero {
  position: relative;
  overflow: hidden;
  padding: 23px;
  background: linear-gradient(135deg, #fff9e5, #f3dfa3);
  border: 1px solid rgba(138, 103, 31, 0.12);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.welcome-card h2,
.mistake-summary h2,
.stats-hero h2 {
  max-width: 78%;
  margin: 7px 0;
  font-family: STKaiti, KaiTi, serif;
  font-size: 24px;
  line-height: 1.25;
}

.welcome-card p,
.mistake-summary p,
.stats-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.eyebrow,
.section-kicker {
  color: var(--primary-dark) !important;
  font-size: 9px !important;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.sun-decoration {
  position: absolute;
  width: 94px;
  height: 94px;
  right: -12px;
  bottom: -22px;
  border: 1px dashed rgba(190, 126, 25, 0.34);
  border-radius: 50%;
}

.sun-decoration::before,
.sun-decoration span {
  content: "";
  position: absolute;
  border-radius: 50%;
}

.sun-decoration::before {
  inset: 17px;
  background: #efb654;
  box-shadow: 0 0 0 9px rgba(239, 182, 84, 0.17);
}

.sun-decoration span {
  inset: -13px;
  border: 1px dotted rgba(190, 126, 25, 0.25);
}

.section-block {
  margin-top: 24px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-heading h3 {
  margin: 2px 0 0;
  font-size: 18px;
}

.section-heading > span {
  color: var(--muted);
  font-size: 11px;
}

.soft-tag,
.level-tag {
  padding: 5px 10px;
  color: var(--primary-dark);
  background: rgba(232, 164, 54, 0.13);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.textbook-card {
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
  background: rgba(255, 253, 244, 0.82);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(113, 83, 27, 0.06);
}

.textbook-card label span,
.form-field span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 9px;
}

.textbook-card select,
.form-field input,
.activation-row input {
  width: 100%;
  height: 42px;
  padding: 0 11px;
  color: var(--text);
  background: #f8f0d8;
  border: 1px solid rgba(111, 91, 44, 0.12);
  border-radius: 12px;
  font: inherit;
  font-size: 11px;
  outline: none;
}

.textbook-card select:focus,
.form-field input:focus,
.activation-row input:focus {
  border-color: var(--primary);
}

.unit-field,
.sync-result {
  grid-column: 1 / -1;
}

.sync-result {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px;
  color: #3f7550;
  background: var(--green-soft);
  border-radius: 13px;
}

.sync-result__icon {
  width: 25px;
  height: 25px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  color: white;
  background: var(--green);
  border-radius: 9px;
  font-size: 10px;
}

.sync-result p,
.sync-result strong,
.sync-result small {
  display: block;
  margin: 0;
}

.sync-result strong {
  font-size: 10px;
}

.sync-result small {
  margin-top: 2px;
  opacity: 0.72;
  font-size: 8px;
}

.book-card.is-locked::after {
  content: "VIP";
  position: absolute;
  top: 9px;
  right: 8px;
  padding: 3px 5px;
  color: white;
  background: #b77a25;
  border-radius: 6px;
  font-size: 7px;
  font-weight: 900;
}

.book-card {
  position: relative;
  min-height: 112px;
  padding: 13px 10px;
  text-align: left;
  background: rgba(255, 253, 244, 0.72);
  border: 1px solid var(--line);
  border-radius: 18px;
  transition: 0.2s ease;
}

.book-card.is-selected {
  background: #fffaf0;
  border-color: rgba(232, 164, 54, 0.65);
  box-shadow: 0 9px 22px rgba(145, 99, 22, 0.1);
  transform: translateY(-2px);
}

.book-card__grade {
  display: grid;
  width: 33px;
  height: 33px;
  place-items: center;
  margin-bottom: 11px;
  color: #fff;
  background: var(--primary);
  border-radius: 11px 11px 11px 4px;
  font-weight: 800;
}

.book-card:nth-child(2) .book-card__grade {
  background: var(--green);
}

.book-card:nth-child(3) .book-card__grade {
  background: #ba8b64;
}

.book-card strong,
.book-card small {
  display: block;
}

.book-card strong {
  font-size: 14px;
}

.book-card small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.book-card__check {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 17px;
  height: 17px;
  display: none;
  place-items: center;
  color: white;
  background: var(--primary);
  border-radius: 50%;
  font-size: 10px;
}

.book-card.is-selected .book-card__check {
  display: grid;
}

.primary-action {
  width: 100%;
  min-height: 70px;
  margin-top: 20px;
  padding: 14px 17px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fffaf0;
  text-align: left;
  background: linear-gradient(135deg, #dfa044, #bd791e);
  border-radius: 21px;
  box-shadow: 0 13px 26px rgba(180, 112, 23, 0.23);
}

.primary-action:active,
.secondary-action:active,
.answer-button:active {
  transform: scale(0.98);
}

.primary-action small,
.primary-action strong {
  display: block;
}

.primary-action small {
  margin-bottom: 3px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.primary-action strong {
  font-size: 17px;
}

.action-arrow {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  font-size: 20px;
}

.checkin-card,
.data-card {
  padding: 17px;
  background: rgba(255, 253, 244, 0.82);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(113, 83, 27, 0.06);
}

.game-dashboard {
  margin-top: 14px;
  padding: 14px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  background: rgba(255, 253, 244, 0.8);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.bean-balance {
  display: flex;
  align-items: center;
  gap: 7px;
}

.bean-balance > span {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  color: #805410;
  background: #ffd66f;
  border-radius: 50%;
  font-family: STKaiti, KaiTi, serif;
  font-weight: 800;
}

.bean-balance small,
.bean-balance strong {
  display: block;
}

.bean-balance small {
  color: var(--muted);
  font-size: 7px;
}

.bean-balance strong {
  font-size: 16px;
}

.level-progress > div:first-child {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 8px;
}

.achievement-badge {
  padding: 6px 8px;
  color: #477b54;
  background: var(--green-soft);
  border-radius: 9px;
  font-size: 8px;
  font-weight: 800;
}

.supervision-card {
  margin-top: 22px;
  padding: 17px;
  background: linear-gradient(135deg, #f0f7e9, #dfeeda);
  border: 1px solid rgba(76, 133, 88, 0.13);
  border-radius: var(--radius-md);
}

.supervision-card__head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.supervision-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--green);
  border-radius: 14px;
  font-family: STKaiti, KaiTi, serif;
  font-size: 16px;
}

.supervision-card__head strong,
.supervision-card__head p {
  display: block;
  margin: 0;
}

.supervision-card__head p,
.supervision-note {
  color: #66806b;
  font-size: 9px;
}

.supervision-note {
  margin: 12px 0 0;
  line-height: 1.65;
}

.outline-action {
  margin-top: 10px;
  padding: 9px 13px;
  color: #477b54;
  background: transparent;
  border: 1px solid rgba(71, 123, 84, 0.28);
  border-radius: 11px;
  font-size: 9px;
  font-weight: 800;
}

.week-row {
  display: flex;
  justify-content: space-between;
  gap: 5px;
}

.week-day {
  min-width: 36px;
  text-align: center;
}

.week-day span,
.week-day small {
  display: block;
}

.week-day span {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  margin: 0 auto 5px;
  color: var(--muted);
  background: #f4ecd2;
  border-radius: 50%;
  font-size: 11px;
}

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

.week-day.is-done span {
  color: white;
  background: var(--green);
}

.week-day.is-today span {
  outline: 2px solid rgba(232, 164, 54, 0.36);
  outline-offset: 2px;
}

.secondary-action {
  width: 100%;
  min-height: 48px;
  margin-top: 15px;
  color: var(--primary-dark);
  background: var(--orange-soft);
  border-radius: 15px;
  font-size: 13px;
  font-weight: 800;
}

.secondary-action.is-done {
  color: #477b54;
  background: var(--green-soft);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
}

.stat-card {
  min-height: 112px;
  padding: 13px 9px;
  text-align: center;
  background: rgba(255, 253, 244, 0.78);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.stat-card__icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  margin: 0 auto 8px;
  color: var(--primary-dark);
  background: var(--orange-soft);
  border-radius: 9px;
  font-family: STKaiti, KaiTi, serif;
  font-size: 12px;
}

.stat-card strong,
.stat-card small {
  display: block;
}

.stat-card strong {
  font-size: 21px;
}

.stat-card small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

/* 背词页 */
.study-progress {
  margin-bottom: 14px;
}

.study-progress__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
}

.study-progress__meta strong {
  color: var(--text);
}

.progress-track {
  height: 7px;
  overflow: hidden;
  background: rgba(116, 91, 40, 0.12);
  border-radius: 999px;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #e6ad50, #d48d2d);
  border-radius: inherit;
  transition: width 0.3s ease;
}

.word-card,
.quiz-card {
  position: relative;
  padding: 25px 20px 20px;
  text-align: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 30px;
  box-shadow: var(--shadow);
}

.word-card .level-tag {
  position: absolute;
  top: 16px;
  right: 16px;
}

.word-card h2,
.quiz-card h2 {
  margin: 14px 0 2px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(38px, 12vw, 52px);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.phonetic {
  margin: 6px 0 17px;
  color: var(--muted);
  font-family: Georgia, serif;
  font-size: 15px;
}

.pronunciation-row {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.pronounce-button {
  padding: 8px 12px;
  color: var(--primary-dark);
  background: #f8edcd;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
}

.pronounce-button span {
  display: inline-grid;
  min-width: 25px;
  height: 19px;
  place-items: center;
  margin-right: 4px;
  color: white;
  background: var(--primary);
  border-radius: 7px;
  font-size: 8px;
}

.meaning-panel,
.memory-panel,
.example-panel {
  margin-top: 17px;
  padding: 15px;
  text-align: left;
  border-radius: 17px;
}

.meaning-panel {
  background: #f7efd8;
}

.meaning-panel span,
.example-panel span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 9px;
}

.meaning-panel strong {
  font-size: 17px;
}

.memory-panel {
  background: linear-gradient(135deg, #fff0cf, #f8dca4);
  border-left: 4px solid var(--primary);
}

.memory-panel__title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.memory-panel__title > div {
  min-width: 0;
}

.memory-panel__title small {
  display: block;
  margin-top: 2px;
  color: #9a6b24;
  font-size: 8px;
}

.spark-icon {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--primary);
  border-radius: 9px;
  font-family: STKaiti, KaiTi, serif;
  font-size: 11px;
}

.memory-panel__title strong {
  color: var(--primary-dark);
  font-size: 12px;
}

.memory-panel p {
  margin: 9px 0 0;
  font-family: STKaiti, KaiTi, serif;
  font-size: 15px;
  line-height: 1.65;
}

.memory-method-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}

.memory-method-tags span {
  padding: 4px 7px;
  color: var(--primary-dark);
  background: rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  font-size: 7px;
  font-weight: 800;
}

.memory-analysis {
  margin-top: 11px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.memory-analysis > div {
  min-width: 0;
  padding: 8px;
  background: rgba(255, 253, 244, 0.58);
  border: 1px solid rgba(151, 95, 18, 0.1);
  border-radius: 10px;
}

.memory-analysis > div:last-child {
  grid-column: 1 / -1;
}

.memory-analysis small,
.memory-analysis strong {
  display: block;
}

.memory-analysis small {
  color: #a4742b;
  font-size: 7px;
}

.memory-analysis strong {
  margin-top: 3px;
  overflow: hidden;
  font-size: 9px;
  line-height: 1.4;
  text-overflow: ellipsis;
}

.memory-path {
  margin-top: 13px;
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 5px;
}

.memory-path > i {
  color: rgba(151, 95, 18, 0.55);
  font-size: 12px;
  font-style: normal;
}

.memory-path__step {
  min-width: 0;
  min-height: 82px;
  padding: 8px 5px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-direction: column;
  text-align: center;
  background: rgba(255, 253, 244, 0.62);
  border: 1px solid rgba(151, 95, 18, 0.1);
  border-radius: 12px;
}

.memory-path__step > span {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--primary);
  border-radius: 50%;
  font-size: 8px;
  font-weight: 800;
}

.memory-path__step small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 7px;
}

.memory-path__step strong {
  max-width: 100%;
  margin-top: 3px;
  overflow: hidden;
  font-size: 8px;
  line-height: 1.35;
  text-overflow: ellipsis;
}

.memory-path__step.is-picture {
  background: rgba(229, 241, 223, 0.76);
}

.memory-path__step.is-picture > span {
  background: var(--green);
}

.memory-scene-toggle {
  width: 100%;
  margin-top: 10px;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--primary-dark);
  background: rgba(255, 253, 244, 0.5);
  border-radius: 10px;
  font-size: 9px;
  font-weight: 800;
}

.memory-scene-toggle b {
  font-size: 14px;
}

.memory-scene {
  max-height: 520px;
  margin-top: 9px;
  padding: 11px;
  display: flex;
  align-items: stretch;
  flex-direction: column;
  gap: 11px;
  overflow: hidden;
  color: #446b4e;
  background: rgba(229, 241, 223, 0.88);
  border-radius: 13px;
  opacity: 1;
  transition: max-height 0.25s ease, padding 0.25s ease, margin 0.25s ease, opacity 0.2s ease;
}

@media (max-width: 420px) {
  .memory-path {
    grid-template-columns: repeat(7, max-content);
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .memory-path::-webkit-scrollbar {
    display: none;
  }

  .memory-path__step {
    width: 82px;
  }
}

.memory-scene.is-collapsed {
  max-height: 0;
  margin-top: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
}

.memory-scene__image-wrap {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #fff;
  border: 2px solid rgba(52, 49, 38, 0.12);
  border-radius: 14px;
}

.memory-scene__image-wrap img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #fff;
}

.memory-scene__fallback {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #343126;
  background: #fff;
}

.memory-scene__fallback span {
  position: relative;
  z-index: 2;
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  background: #fff6d8;
  border: 4px solid #343126;
  border-radius: 50%;
  font-family: STKaiti, KaiTi, serif;
  font-size: 31px;
  transform: rotate(-6deg);
}

.memory-scene__fallback i {
  position: absolute;
  width: 28px;
  height: 4px;
  background: var(--primary);
  border-radius: 999px;
}

.memory-scene__fallback i:nth-child(2) {
  margin: -72px 0 0 105px;
  transform: rotate(-28deg);
}

.memory-scene__fallback i:nth-child(3) {
  margin-left: 126px;
}

.memory-scene__fallback i:nth-child(4) {
  margin: 72px 0 0 105px;
  transform: rotate(28deg);
}

.memory-scene small {
  display: block;
  color: #5d8567;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.memory-scene p {
  margin: 4px 0 0;
  color: #3e6247;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 9px;
  line-height: 1.55;
}

.drawing-data-panel {
  margin-top: 10px;
  padding: 11px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px dashed rgba(92, 115, 79, 0.28);
  border-radius: 13px;
}

.drawing-data-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.drawing-data-panel__head strong,
.drawing-data-panel__head small {
  display: block;
}

.drawing-data-panel__head strong {
  color: #43694d;
  font-size: 10px;
}

.drawing-data-panel__head small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 7px;
}

.drawing-data-panel__head button {
  padding: 6px 8px;
  color: #477b54;
  background: var(--green-soft);
  border-radius: 8px;
  font-size: 8px;
  font-weight: 800;
}

.drawing-data-panel label {
  display: block;
  margin-top: 9px;
}

.drawing-data-panel label span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 7px;
}

.drawing-data-panel textarea {
  width: 100%;
  min-height: 56px;
  padding: 8px;
  resize: vertical;
  color: #494437;
  background: #fff;
  border: 1px solid rgba(111, 91, 44, 0.12);
  border-radius: 9px;
  font: 8px/1.55 "PingFang SC", "Microsoft YaHei", sans-serif;
  outline: none;
}

.drawing-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 9px;
}

.drawing-actions button {
  min-height: 36px;
  color: #fff;
  background: var(--green);
  border-radius: 10px;
  font-size: 8px;
  font-weight: 800;
}

.drawing-actions button:last-child {
  color: var(--primary-dark);
  background: var(--orange-soft);
}

.drawing-actions button.is-loading {
  opacity: 0.58;
  pointer-events: none;
}

.example-panel {
  border: 1px dashed rgba(111, 91, 44, 0.22);
}

.example-panel p {
  margin: 0 0 4px;
  font-family: Georgia, serif;
  font-size: 13px;
  line-height: 1.5;
}

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

.answer-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 13px;
}

.answer-button {
  min-height: 63px;
  padding: 9px 5px;
  border-radius: 17px;
}

.answer-button strong,
.answer-button small {
  display: block;
}

.answer-button strong {
  font-size: 13px;
}

.answer-button small {
  margin-top: 4px;
  opacity: 0.68;
  font-size: 8px;
}

.answer-button.know {
  color: #477b54;
  background: var(--green-soft);
}

.answer-button.fuzzy {
  color: #9a6417;
  background: var(--orange-soft);
}

.answer-button.unknown {
  color: #a65647;
  background: var(--red-soft);
}

/* 错题本与自测 */
.mistake-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mistake-summary h2 {
  max-width: 100%;
  font-size: 22px;
}

.mistake-summary > strong {
  width: 60px;
  height: 60px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  color: white;
  background: var(--red);
  border-radius: 22px 22px 22px 8px;
  font-size: 25px;
}

.mistake-actions {
  margin-bottom: 18px;
}

.primary-action.compact {
  min-height: 62px;
  margin-top: 14px;
}

.mistake-list {
  display: grid;
  gap: 10px;
}

.mistake-item {
  padding: 15px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 253, 244, 0.8);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.mistake-item__letter {
  width: 43px;
  height: 43px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  color: var(--primary-dark);
  background: var(--orange-soft);
  border-radius: 14px;
  font-family: Georgia, serif;
  font-size: 20px;
  text-transform: uppercase;
}

.mistake-item__content {
  min-width: 0;
  flex: 1;
}

.mistake-item__content strong,
.mistake-item__content span,
.mistake-item__content small {
  display: block;
}

.mistake-item__content strong {
  font-family: Georgia, serif;
  font-size: 17px;
}

.mistake-item__content span {
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mistake-item__content small {
  margin-top: 5px;
  color: var(--red);
  font-size: 8px;
}

.mistake-speak {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--primary-dark);
  background: transparent;
  border-radius: 12px;
}

.empty-state {
  padding: 55px 20px;
  color: var(--muted);
  text-align: center;
}

.empty-state__mark,
.complete-mark {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  color: white;
  background: var(--green);
  border-radius: 23px 23px 23px 8px;
  font-size: 27px;
}

.empty-state h3 {
  margin: 0 0 7px;
  color: var(--text);
}

.empty-state p {
  margin: 0;
  font-size: 11px;
  line-height: 1.7;
}

.quiz-options {
  display: grid;
  gap: 10px;
  margin-top: 22px;
  text-align: left;
}

.quiz-option {
  min-height: 53px;
  padding: 12px 15px;
  background: #f7f0db;
  border: 1px solid transparent;
  border-radius: 16px;
  font-size: 13px;
}

.quiz-option.is-correct {
  color: #477b54;
  background: var(--green-soft);
  border-color: #7db68a;
}

.quiz-option.is-wrong {
  color: #9a4f40;
  background: var(--red-soft);
  border-color: #dc8a78;
}

.quiz-feedback {
  min-height: 24px;
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 11px;
}

/* 数据页 */
.stats-hero {
  margin-bottom: 14px;
}

.data-card {
  margin-top: 12px;
}

.data-card h3 {
  margin: 0 0 14px;
  font-size: 16px;
}

.smart-score-card {
  display: flex;
  align-items: center;
  gap: 18px;
}

.score-ring {
  width: 105px;
  height: 105px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  align-content: center;
  color: white;
  background: linear-gradient(145deg, #e9ac4b, #bd771d);
  border-radius: 50%;
  box-shadow: inset 0 0 0 8px rgba(255, 255, 255, 0.22);
}

.score-ring strong,
.score-ring span {
  display: block;
}

.score-ring strong {
  font-size: 28px;
}

.score-ring span {
  font-size: 8px;
}

.smart-score-card h3 {
  margin-bottom: 5px;
}

.smart-score-card p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
}

.donut-wrap {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 15px;
}

.donut-chart {
  width: 128px;
  height: 128px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  background: conic-gradient(var(--green) 0deg, #e4d9b9 0deg);
  border-radius: 50%;
}

.donut-chart::before {
  content: "";
  position: absolute;
  width: 86px;
  height: 86px;
  background: var(--card);
  border-radius: 50%;
}

.donut-chart span {
  position: relative;
  z-index: 1;
  font-size: 21px;
  font-weight: 800;
}

.legend p {
  margin: 9px 0;
  color: var(--muted);
  font-size: 10px;
}

.legend i {
  width: 8px;
  height: 8px;
  display: inline-block;
  margin-right: 6px;
  border-radius: 3px;
}

.legend strong {
  margin-left: 5px;
  color: var(--text);
}

.legend-mastered { background: var(--green); }
.legend-learning { background: var(--primary); }
.legend-new { background: #e4d9b9; }

.weekly-chart {
  height: 145px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
}

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

.chart-day strong {
  color: var(--muted);
  font-size: 8px;
}

.chart-bar {
  width: min(24px, 70%);
  min-height: 5px;
  background: linear-gradient(#edb85e, #d78e2c);
  border-radius: 8px 8px 3px 3px;
  transition: height 0.5s ease;
}

.chart-day span {
  color: var(--muted);
  font-size: 8px;
}

.danger-link {
  width: 100%;
  margin-top: 24px;
  padding: 12px;
  color: var(--red);
  background: transparent;
  font-size: 11px;
}

/* 底部导航 */
.bottom-nav {
  position: fixed;
  z-index: 20;
  left: 12px;
  right: 12px;
  bottom: calc(10px + var(--safe-bottom));
  height: 66px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: rgba(255, 253, 244, 0.94);
  border: 1px solid rgba(111, 91, 44, 0.1);
  border-radius: 22px;
  box-shadow: 0 10px 30px rgba(91, 68, 24, 0.16);
  backdrop-filter: blur(16px);
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 3px;
  color: #9b9277;
  background: transparent;
  font-size: 9px;
}

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

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

.nav-item.is-active svg {
  fill: rgba(232, 164, 54, 0.16);
}

/* 弹层与消息提示 */
.modal {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(47, 39, 22, 0.45);
  backdrop-filter: blur(5px);
}

.modal__card {
  position: relative;
  width: 100%;
  padding: 27px 20px 20px;
  text-align: center;
  background: var(--card);
  border-radius: 27px;
  box-shadow: 0 26px 70px rgba(48, 35, 11, 0.28);
  animation: modal-in 0.28s ease both;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 34px;
  height: 34px;
  color: var(--muted);
  background: transparent;
  font-size: 22px;
}

.account-modal-card,
.membership-modal-card,
.service-modal-card {
  max-width: 420px;
}

.form-field {
  display: block;
  margin-top: 12px;
  text-align: left;
}

.prototype-note {
  display: block;
  margin-top: 13px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.55;
}

.vip-pill {
  display: inline-block;
  padding: 5px 10px;
  color: #805410;
  background: #ffdda0;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 900;
}

.price-line {
  margin: 8px 0 15px;
  color: var(--primary-dark);
}

.price-line strong {
  font-family: Georgia, serif;
  font-size: 40px;
}

.price-line span {
  color: var(--muted);
  font-size: 12px;
}

.benefit-list {
  margin: 0;
  padding: 14px 14px 14px 31px;
  color: #55503f;
  text-align: left;
  background: #f8f0d8;
  border-radius: 15px;
  font-size: 10px;
  line-height: 2;
}

.activation-row {
  display: flex;
  gap: 7px;
  margin-top: 10px;
}

.activation-row button {
  padding: 0 16px;
  color: white;
  background: var(--green);
  border-radius: 12px;
  font-size: 10px;
  font-weight: 800;
}

.request-status {
  min-height: 16px;
  margin: 9px 0 0;
  color: var(--primary-dark) !important;
  font-size: 9px !important;
}

.service-mark {
  width: 55px;
  height: 55px;
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
  color: white;
  background: var(--green);
  border-radius: 20px;
  font-family: STKaiti, KaiTi, serif;
  font-size: 22px;
}

.service-info {
  margin-top: 9px;
  padding: 11px;
  display: flex;
  justify-content: space-between;
  background: #f8f0d8;
  border-radius: 12px;
  font-size: 9px;
}

.service-info span {
  color: var(--muted);
}

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

.modal__card h2 {
  margin: 8px 0;
  font-family: STKaiti, KaiTi, serif;
}

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

.complete-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 19px;
}

.complete-stats div {
  padding: 12px 5px;
  background: #f6eed8;
  border-radius: 15px;
}

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

.complete-stats strong {
  font-size: 20px;
}

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

.toast {
  position: fixed;
  z-index: 80;
  left: 50%;
  bottom: calc(91px + var(--safe-bottom));
  max-width: calc(100% - 40px);
  padding: 10px 15px;
  color: white;
  background: rgba(50, 45, 33, 0.9);
  border-radius: 999px;
  font-size: 10px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: 0.22s ease;
}

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

/* 超小屏适配 */
@media (max-width: 360px) {
  .main-content {
    padding-left: 12px;
    padding-right: 12px;
  }

  .word-card {
    padding-left: 14px;
    padding-right: 14px;
  }

  .memory-panel p {
    font-size: 14px;
  }

  .book-card {
    padding-left: 8px;
    padding-right: 8px;
  }

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

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

  .achievement-badge {
    grid-column: 1 / -1;
    text-align: center;
  }
}

/* iPad 与电脑：保留同一功能结构，扩大工作区并改为多列排版。 */
@media (min-width: 769px) {
  body {
    min-height: 100vh;
    background: #efe8d2;
  }

  .app-shell {
    max-width: 1120px;
    min-height: 100vh;
    margin: 0 auto;
    border-left: 1px solid rgba(111, 91, 44, 0.08);
    border-right: 1px solid rgba(111, 91, 44, 0.08);
    box-shadow: 0 0 60px rgba(76, 55, 14, 0.08);
  }

  .app-header {
    left: 50%;
    width: min(1120px, 100%);
    transform: translateX(-50%);
  }

  .main-content {
    padding: 92px 34px 110px;
  }

  #homeView.is-active {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: 20px 24px;
  }

  #homeView > * {
    margin-top: 0;
    align-self: start;
  }

  .book-grid {
    gap: 12px;
  }

  .bottom-nav {
    left: 50%;
    width: min(760px, calc(100% - 40px));
    transform: translateX(-50%);
  }

  .word-card,
  .quiz-card,
  #mistakesView,
  #statsView,
  .study-progress,
  .answer-actions {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
  }

  .modal__card {
    width: min(430px, 100%);
  }
}
