/* 英语闯关 · 网页版
   目标设备是 12 寸平板横屏：左侧导航 + 右侧内容，按钮和字号都比小程序大一档。
   手机竖屏会自动收成底部导航 + 单栏。 */

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

:root {
  --bg: #f5f2ed;
  --card: #ffffff;
  --text: #3a3a3a;
  --muted: #8a8a8a;
  --line: #e8e4df;
  --primary: #5b7a9a;
  --primary-dark: #4a6a8a;
  --green: #4f9d69;
  --red: #d9635f;
  --gold: #e8a33d;
  --purple: #8b6fb3;
  --orange: #e39145;
  --cyan: #4f9fa8;
  --radius: 18px;
  --shadow: 0 4px 18px rgba(58, 58, 58, 0.07);
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", Roboto, sans-serif;
  font-size: 17px;
  color: var(--text);
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}

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

button {
  border: 0;
  background: none;
  cursor: pointer;
}

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

[hidden] {
  display: none !important;
}

#app {
  min-height: 100vh;
  min-height: 100dvh;
}

/* ───────────────────────── 主题（商城买的背景） ───────────────────────── */

body[data-theme="theme-rainbow"] { --bg: linear-gradient(135deg, #f5f0eb 0%, #f0e8e0 100%); }
body[data-theme="theme-pink"] { --bg: #fdf6f6; }
body[data-theme="theme-candy"] { --bg: #fdf8f0; }
body[data-theme="theme-ocean"] { --bg: #f0f4f8; }
body[data-theme="theme-sunset"] { --bg: #f8f2e8; }
body[data-theme="theme-space"] { --bg: #eef0f3; }
body[data-theme="theme-jungle"] { --bg: #f0f5f0; }
body[data-theme="theme-night"] { --bg: #eef0f4; }
body[data-theme="theme-fire"] { --bg: #fdf6f0; }
body[data-theme="theme-ice"] { --bg: #f0f6f8; }
body[data-theme="theme-cherry"] { --bg: #fdf5f5; }
body[data-theme="theme-gold"] { --bg: #fcf8f0; }

/* ───────────────────────── 应用壳：左侧导航 ───────────────────────── */

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

.nav-rail {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 224px;
  flex: 0 0 224px;
  height: 100vh;
  height: 100dvh;
  padding: 22px 16px 16px;
  background: rgba(255, 255, 255, 0.66);
  border-right: 1px solid var(--line);
}

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

.brand-icon {
  font-size: 30px;
  line-height: 1;
}

.brand-text b {
  display: block;
  font-size: 20px;
  letter-spacing: 1px;
}

.brand-text small {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
}

.avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8fb0ca, #5b7a9a);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
}

.user-text {
  min-width: 0;
}

.user-text b {
  display: block;
  font-size: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-text small {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.coin-chip {
  padding: 8px 12px;
  border-radius: 12px;
  background: #fdf6e8;
  color: #a9741c;
  font-size: 16px;
  text-align: center;
}

.coin-chip b {
  font-size: 20px;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 0 14px;
  border-radius: 14px;
  font-size: 18px;
  color: #555;
  transition: background 0.15s, color 0.15s;
}

.nav-item:hover {
  background: #fff;
}

.nav-item.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(91, 122, 154, 0.28);
}

.nav-icon {
  font-size: 22px;
  line-height: 1;
}

.nav-foot {
  margin-top: auto;
  padding: 8px 6px;
  font-size: 12px;
  color: #b0aca7;
}

.page-host {
  flex: 1;
  min-width: 0;
  padding: 26px 34px 42px;
}

@media (min-width: 1500px) {
  .page-host {
    padding: 34px 56px 56px;
  }
}

/* ───────────────────────── 通用组件 ───────────────────────── */

.page {
  max-width: 1180px;
  margin: 0 auto;
}

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

.page-title {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 1px;
}

.page-sub {
  margin: 4px 0 0;
  font-size: 15px;
  color: var(--muted);
}

.page-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}

.card h2 {
  margin: 0 0 14px;
  font-size: 20px;
}

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

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

.btn,
.btn-primary,
.btn-secondary,
.btn-ghost,
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 20px;
  border-radius: 13px;
  font-size: 17px;
  font-weight: 600;
  transition: transform 0.1s, background 0.15s, border-color 0.15s;
}

.btn:active,
.btn-primary:active,
.btn-secondary:active,
.btn-ghost:active,
.btn-danger:active {
  transform: scale(0.98);
}

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

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

.btn-secondary {
  background: #fff;
  border: 1.5px solid var(--line);
  color: var(--text);
}

.btn-secondary:hover {
  border-color: #c8c4bf;
}

.btn-ghost {
  background: #f3efea;
  color: #5a5a5a;
}

.btn-danger {
  background: #fdeceb;
  color: #b94a46;
}

.btn-small {
  min-height: 40px;
  padding: 0 14px;
  font-size: 15px;
  border-radius: 11px;
}

.btn-block {
  width: 100%;
}

.stat-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.stat {
  min-width: 118px;
  flex: 1;
  padding: 14px 16px;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
  text-align: center;
}

.stat b {
  display: block;
  font-size: 26px;
  line-height: 1.2;
}

.stat span {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  color: var(--muted);
}

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.filter-btn {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  background: #fff;
  border: 1.5px solid var(--line);
  font-size: 15px;
  color: #666;
}

.filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 16px;
}

.app-loading,
.app-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50vh;
  color: var(--muted);
  font-size: 17px;
}

.app-error span:first-child {
  font-size: 34px;
}

.toast-host {
  position: fixed;
  left: 50%;
  bottom: 34px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  padding: 12px 20px;
  border-radius: 12px;
  background: rgba(45, 45, 45, 0.9);
  color: #fff;
  font-size: 16px;
  animation: toast-in 0.18s ease-out;
}

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

/* ───────────────────────── 登录 ───────────────────────── */

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px;
}

.login-card {
  width: min(460px, 100%);
  padding: 34px 34px 28px;
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 10px 40px rgba(58, 58, 58, 0.1);
}

.login-hero {
  text-align: center;
  margin-bottom: 26px;
}

.login-hero .hero-icon {
  display: block;
  font-size: 54px;
  line-height: 1;
  margin-bottom: 10px;
}

.login-hero h1 {
  margin: 0;
  font-size: 30px;
  letter-spacing: 2px;
}

.login-hero p {
  margin: 6px 0 0;
  font-size: 15px;
  color: var(--muted);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field label {
  font-size: 14px;
  color: #6a6a6a;
}

.field input {
  width: 100%;
  min-height: 56px;
  padding: 0 16px;
  border: 1.5px solid var(--line);
  border-radius: 13px;
  background: #fbf9f6;
  font-size: 20px;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}

.field input:focus {
  border-color: var(--primary);
  background: #fff;
}

.field input.password {
  letter-spacing: 10px;
  font-size: 26px;
}

.login-error {
  min-height: 20px;
  margin: 0;
  color: var(--red);
  font-size: 14px;
  text-align: center;
}

.login-links {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 4px;
}

.link-btn {
  padding: 6px 4px;
  color: var(--primary);
  font-size: 15px;
  text-decoration: underline;
}

.login-tip {
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  font-size: 12.5px;
  line-height: 1.7;
  color: #9b9b9b;
  text-align: center;
}

/* ───────────────────────── 首页 ───────────────────────── */

.menu-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 22px;
  align-items: start;
}

.bank-groups {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bank-group h3 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

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

.bank-chip {
  min-height: 48px;
  padding: 0 8px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fbf9f6;
  font-size: 15px;
  color: #666;
  transition: all 0.15s;
}

.bank-chip.selected {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  box-shadow: 0 3px 10px rgba(91, 122, 154, 0.24);
}

.mode-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mode-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 66px;
  padding: 10px 16px;
  border: 1.5px solid var(--line);
  border-left: 6px solid var(--primary);
  border-radius: 14px;
  background: #fff;
  text-align: left;
  transition: transform 0.1s, box-shadow 0.15s;
}

.mode-btn:hover {
  box-shadow: var(--shadow);
}

.mode-btn:active {
  transform: scale(0.99);
}

.mode-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 13px;
  background: #f4f0eb;
  font-size: 24px;
}

.mode-text b {
  display: block;
  font-size: 18px;
}

.mode-text small {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  color: var(--muted);
}

.mode-btn.color-adventure { border-left-color: var(--primary); }
.mode-btn.color-timed { border-left-color: var(--orange); }
.mode-btn.color-flash { border-left-color: var(--purple); }
.mode-btn.color-review { border-left-color: var(--green); }
.mode-btn.color-listen { border-left-color: var(--cyan); }

.mode-btn.color-timed .mode-icon { background: #fdf3e6; }
.mode-btn.color-flash .mode-icon { background: #f3eef9; }
.mode-btn.color-review .mode-icon { background: #ebf5ee; }
.mode-btn.color-listen .mode-icon { background: #e9f4f5; }

.menu-side {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.tip-card {
  padding: 16px 18px;
  border-radius: 16px;
  background: #fffaf0;
  border: 1px solid #f2e3c7;
  color: #8a6b2f;
  font-size: 14px;
  line-height: 1.7;
}

.pet-stage {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow);
}

.pet-stage .pet-icon {
  font-size: 40px;
  line-height: 1;
}

.pet-stage small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

/* ───────────────────────── 答题 ───────────────────────── */

.page-quiz {
  max-width: 1180px;
}

.quiz-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow);
  font-size: 24px;
  color: #5a5a5a;
}

.quiz-mode {
  flex: 1;
  font-size: 20px;
  font-weight: 700;
}

.quiz-score {
  padding: 8px 16px;
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--shadow);
  font-size: 18px;
  font-weight: 700;
}

.quiz-progress {
  display: flex;
  justify-content: space-between;
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 8px;
}

.timer {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--orange);
}

.timer.urgent {
  color: var(--red);
  animation: pulse 0.9s infinite;
}

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

.progress-bar {
  height: 8px;
  margin-bottom: 22px;
  border-radius: 999px;
  background: #e8e4df;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--primary);
  transition: width 0.3s;
}

.quiz-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
  gap: 30px;
  align-items: start;
}

.question-side {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 440px;
  padding: 34px 28px;
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow);
}

.q-badge {
  padding: 7px 16px;
  border-radius: 999px;
  background: #eef3f8;
  color: var(--primary);
  font-size: 15px;
  font-weight: 600;
}

.q-badge.flash { background: #f3eef9; color: var(--purple); }
.q-badge.listen { background: #e9f4f5; color: var(--cyan); }
.q-badge.spell { background: #fdf3e6; color: var(--orange); }

.q-word {
  margin: 26px 0 10px;
  font-size: clamp(38px, 5.6vw, 66px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 2px;
  text-align: center;
  word-break: break-word;
}

.q-hint {
  font-size: 16px;
  color: var(--muted);
  text-align: center;
}

.pet-buddy {
  position: absolute;
  right: 18px;
  bottom: 14px;
  font-size: 34px;
  opacity: 0.85;
}

.answer-side {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  min-height: 440px;
}

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

.option-btn {
  min-height: 78px;
  padding: 10px 14px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: #fff;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.25;
  word-break: break-word;
  transition: transform 0.1s, border-color 0.15s, background 0.15s;
}

.option-btn:hover {
  border-color: #b9c9d8;
}

.option-btn:active {
  transform: scale(0.98);
}

.option-btn.correct {
  border-color: var(--green);
  background: #eaf6ee;
  color: #2f7d4b;
}

.option-btn.wrong {
  border-color: var(--red);
  background: #fdecea;
  color: #b94a46;
}

.option-btn.reveal {
  border-color: var(--green);
  background: #f2fbf5;
  color: #2f7d4b;
}

.option-btn.disabled {
  opacity: 0.5;
}

.spell-box,
.listen-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--shadow);
}

.spell-label {
  font-size: 17px;
  font-weight: 600;
}

.input-row {
  display: flex;
  gap: 10px;
}

.spell-input {
  flex: 1;
  min-width: 0;
  min-height: 64px;
  padding: 0 18px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #fbf9f6;
  font-size: 26px;
  letter-spacing: 1px;
  outline: none;
}

.spell-input:focus {
  border-color: var(--primary);
  background: #fff;
}

.spell-input.correct { border-color: var(--green); background: #f2fbf5; }
.spell-input.wrong { border-color: var(--red); background: #fdecea; }

.spell-submit {
  display: grid;
  place-items: center;
  width: 64px;
  min-height: 64px;
  border-radius: 14px;
  background: var(--primary);
  color: #fff;
  font-size: 26px;
}

.spell-submit.disabled {
  opacity: 0.45;
  pointer-events: none;
}

.speaker-btn {
  align-self: center;
  display: grid;
  place-items: center;
  width: 108px;
  height: 108px;
  border-radius: 50%;
  background: #eef4f7;
  font-size: 48px;
  box-shadow: inset 0 0 0 2px #d8e5ec;
  transition: transform 0.15s;
}

.speaker-btn:active,
.speaker-btn.speaking {
  transform: scale(1.06);
  background: #dfeef4;
}

.feedback {
  min-height: 62px;
  padding: 14px 18px;
  border-radius: 16px;
  font-size: 20px;
  font-weight: 600;
  text-align: center;
}

.feedback:empty {
  visibility: hidden;
}

.feedback.correct {
  background: #eaf6ee;
  color: #2f7d4b;
}

.feedback.wrong {
  background: #fdecea;
  color: #b94a46;
}

.feedback.show-answer {
  background: #fff6e8;
  color: #a9741c;
}

/* 答对时的粒子 */
.fx-layer {
  position: fixed;
  inset: 0;
  z-index: 70;
  overflow: hidden;
  pointer-events: none;
}

.fx-particle {
  position: absolute;
  bottom: 16%;
  animation: fx-float 1.7s ease-out forwards;
}

@keyframes fx-float {
  0% { opacity: 0; transform: translate(0, 0) scale(0.5); }
  18% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--drift, 0), -72vh) scale(1.15) rotate(28deg); }
}

/* ───────────────────────── 结算 ───────────────────────── */

.page-result {
  display: flex;
  justify-content: center;
}

.result-card {
  width: min(660px, 100%);
  padding: 30px 30px 26px;
  border-radius: 26px;
  background: #fff;
  box-shadow: var(--shadow);
  text-align: center;
}

.result-title {
  font-size: 28px;
  font-weight: 700;
}

.result-ring {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  margin: 18px 0 6px;
}

.result-ring .score {
  font-size: 72px;
  font-weight: 800;
  line-height: 1;
  color: var(--primary);
}

.result-ring .of {
  font-size: 24px;
  color: var(--muted);
}

.result-stats {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 16px 0 22px;
}

.result-stats .pill {
  padding: 9px 18px;
  border-radius: 999px;
  background: #f6f2ec;
  font-size: 16px;
}

.result-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.wrong-details {
  margin-top: 22px;
  text-align: left;
}

.wrong-details summary {
  cursor: pointer;
  padding: 12px 16px;
  border-radius: 12px;
  background: #fbf7f2;
  font-size: 16px;
  font-weight: 600;
}

.wrong-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #f2eee9;
  font-size: 16px;
}

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

.wrong-item b {
  color: var(--red);
}

/* ───────────────────────── 商城 ───────────────────────── */

.shop-layout {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.shop-tabs {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shop-tab {
  min-height: 54px;
  padding: 0 16px;
  border-radius: 13px;
  background: #fff;
  border: 1.5px solid var(--line);
  font-size: 17px;
  text-align: left;
  color: #666;
}

.shop-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}

.shop-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px 14px 16px;
  border-radius: 18px;
  background: #fff;
  border: 2px solid transparent;
  box-shadow: var(--shadow);
  text-align: center;
}

.shop-item.equipped {
  border-color: var(--primary);
  background: #fbfdff;
}

.shop-item .item-icon {
  font-size: 44px;
  line-height: 1;
}

.shop-item .item-name {
  font-size: 16px;
  font-weight: 600;
}

.item-rarity {
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.rarity-common { background: #eff3f0; color: #6b7b70; }
.rarity-rare { background: #eaf1fa; color: #4a72a8; }
.rarity-epic { background: #f3eef9; color: #7b5ba8; }
.rarity-legendary { background: #fdf3e0; color: #a9741c; }

.item-price {
  font-size: 16px;
  color: var(--gold);
  font-weight: 700;
}

.item-state {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
}

.item-state.owned {
  background: #e6efe9;
  color: #4f7d60;
}

/* ───────────────────────── 成绩 ───────────────────────── */

.history-layout {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.stats-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stats-panel .stat {
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 58px;
}

.stats-panel .stat b {
  order: 2;
  font-size: 24px;
}

.stats-panel .stat span {
  order: 1;
  margin: 0;
  font-size: 15px;
}

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

.record-row {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 0.8fr 1fr;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(58, 58, 58, 0.05);
  font-size: 16px;
}

.record-row .record-mode {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.record-row .record-score {
  font-weight: 700;
}

.record-row .record-coins {
  color: var(--gold);
  font-weight: 600;
}

.record-row .record-time {
  color: var(--muted);
  font-size: 14px;
  text-align: right;
}

/* ───────────────────────── 错题本 ───────────────────────── */

.word-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(236px, 1fr));
  gap: 12px;
}

.word-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow);
}

.word-card.mastered {
  opacity: 0.62;
}

.word-card .word-en {
  font-size: 22px;
  font-weight: 700;
  word-break: break-word;
}

.word-card .word-cn {
  font-size: 15px;
  color: #666;
}

.word-card .word-meta {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}

.word-card .word-actions {
  margin-top: 8px;
}

/* ───────────────────────── 我的 ───────────────────────── */

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 16px;
}

.profile-avatar {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  flex: 0 0 76px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8fb0ca, #5b7a9a);
  color: #fff;
  font-size: 34px;
  font-weight: 700;
}

.profile-name {
  font-size: 24px;
  font-weight: 700;
}

.profile-title {
  margin-top: 4px;
  font-size: 15px;
  color: var(--primary);
}

.profile-coins {
  margin-top: 6px;
  font-size: 15px;
  color: var(--gold);
  font-weight: 600;
}

.equip-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.equip-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 4px;
  font-size: 16px;
}

.equip-row .equip-icon {
  font-size: 24px;
  width: 34px;
  text-align: center;
}

.equip-row .equip-name {
  flex: 1;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-row .field input {
  min-height: 50px;
  font-size: 18px;
}

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}

/* ───────────────────────── 平板竖屏 / 手机 ───────────────────────── */

@media (max-width: 1100px) {
  .menu-grid,
  .quiz-layout {
    gap: 18px;
  }

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

@media (max-width: 899px) {
  body {
    font-size: 16px;
  }

  .app-shell {
    flex-direction: column-reverse;
  }

  .nav-rail {
    position: fixed;
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    z-index: 40;
    flex-direction: row;
    align-items: center;
    justify-content: space-around;
    width: 100%;
    height: 70px;
    padding: 6px 8px;
    border-right: 0;
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
  }

  .brand,
  .user-chip,
  .coin-chip,
  .nav-foot {
    display: none;
  }

  .nav-list {
    flex-direction: row;
    width: 100%;
    justify-content: space-around;
  }

  .nav-item {
    flex-direction: column;
    gap: 3px;
    min-height: 56px;
    padding: 6px 10px;
    font-size: 11px;
  }

  .nav-item.active {
    background: transparent;
    color: var(--primary);
    box-shadow: none;
  }

  .nav-icon {
    font-size: 22px;
  }

  .page-host {
    padding: 18px 16px 96px;
  }

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

  .menu-grid,
  .quiz-layout,
  .shop-layout,
  .history-layout,
  .profile-grid {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .shop-tabs {
    flex-direction: row;
    overflow-x: auto;
  }

  .shop-tab {
    flex: 0 0 auto;
    min-height: 46px;
    text-align: center;
    padding: 0 14px;
  }

  .question-side {
    min-height: 250px;
    padding: 24px 18px;
  }

  .q-word {
    font-size: clamp(34px, 10vw, 46px);
    margin: 16px 0 6px;
  }

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

  .option-btn {
    min-height: 62px;
    font-size: 20px;
  }

  .record-row {
    grid-template-columns: 1.3fr 0.8fr 1fr;
  }

  .record-row .record-time {
    grid-column: 1 / -1;
    text-align: left;
    font-size: 12.5px;
  }

  .result-ring .score {
    font-size: 58px;
  }

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

@media (max-width: 420px) {
  .bank-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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