/* ============================================================
   单词闯关 · 全局样式
   ============================================================ */
:root {
  --bg: #f4f2ff;
  --bg-2: #eef0ff;
  --card: #ffffff;
  --ink: #221c42;
  --muted: #767092;
  --line: #eae6f8;
  --primary: #6c5ce7;
  --primary-2: #9b8cff;
  --primary-deep: #4d3fd0;
  --accent: #ff9f43;
  --accent-2: #ffc46b;
  --green: #10b981;
  --green-soft: #e7fbf3;
  --red: #ef4444;
  --red-soft: #fdecec;
  --blue: #3d9bfd;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 14px 36px rgba(73, 55, 168, 0.10);
  --shadow-sm: 0 6px 18px rgba(73, 55, 168, 0.08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 700px at 12% -10%, #e7e2ff 0%, transparent 60%),
    radial-gradient(900px 600px at 100% 0%, #ffe9d6 0%, transparent 55%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font-family: inherit; }
button { cursor: pointer; }
a { color: inherit; }

::selection { background: rgba(108, 92, 231, .2); }

/* ------------------------------- 通用组件 ------------------------------- */
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, .7);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 14px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  background: #f2effe;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, opacity .2s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, #8a79ff 60%, #a394ff 100%);
  box-shadow: 0 10px 24px rgba(108, 92, 231, .32);
}
.btn-primary:hover { box-shadow: 0 14px 30px rgba(108, 92, 231, .4); }

.btn-accent {
  color: #5a3200;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  box-shadow: 0 10px 24px rgba(255, 159, 67, .32);
}

.btn-ghost { background: transparent; border: 1.5px solid var(--line); }
.btn-ghost:hover { background: #f8f6ff; }
.btn-danger { background: var(--red-soft); color: #c62b2b; }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 11px; }
.btn-lg { padding: 16px 28px; font-size: 17px; border-radius: 16px; }
.btn-block { width: 100%; }

.icon-btn {
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px; border: 0; background: #f4f1ff; color: var(--primary);
  transition: background .2s, transform .15s;
}
.icon-btn:hover { background: #e9e4ff; transform: translateY(-1px); }
.icon-btn.danger { color: var(--red); background: var(--red-soft); }
.icon-btn.danger:hover { background: #fbdada; }

.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 700; color: #5b5478; }
.field input, .field textarea, .field select {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 13px;
  padding: 12px 14px;
  font-size: 14px;
  color: var(--ink);
  background: #fbfaff;
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--primary-2);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(108, 92, 231, .1);
}
.field textarea { resize: vertical; min-height: 120px; line-height: 1.7; }
.field input::placeholder, .field textarea::placeholder { color: #b9b3cf; }
input::placeholder, textarea::placeholder { color: #b9b3cf; }
.field .hint-text { font-size: 12px; color: var(--muted); line-height: 1.6; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px;
  background: #f2effe; color: var(--primary-deep);
}
.badge.green { background: var(--green-soft); color: #079b6b; }
.badge.orange { background: #fff3e2; color: #c4720a; }
.badge.red { background: var(--red-soft); color: #c62b2b; }
.badge.gray { background: #f2f2f7; color: #6f6a8a; }

.section-title {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin: 0 0 16px;
}
.section-title h2 { margin: 0; font-size: 19px; letter-spacing: .2px; }
.section-title p { margin: 4px 0 0; font-size: 13px; color: var(--muted); }

.empty {
  padding: 40px 20px; text-align: center; color: var(--muted); font-size: 14px;
}
.empty .empty-icon {
  width: 52px; height: 52px; border-radius: 50%; margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  background: #f3f0ff; color: var(--primary-2);
}

.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  animation: spin .7s linear infinite;
}
.spinner.dark { border-color: rgba(108, 92, 231, .2); border-top-color: var(--primary); }
@keyframes spin { to { transform: rotate(360deg); } }

/* --------------------------------- 顶栏 --------------------------------- */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(16px);
  background: rgba(255, 255, 255, .82);
  border-bottom: 1px solid rgba(234, 230, 248, .9);
}
.topbar-inner {
  display: flex; align-items: center; gap: 20px;
  height: 66px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, #a394ff 100%);
  box-shadow: 0 8px 18px rgba(108, 92, 231, .3);
}
.brand small { display: block; font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .4px; }

.nav { display: flex; gap: 6px; margin-left: 10px; }
.nav a {
  text-decoration: none; font-size: 14px; font-weight: 700; color: var(--muted);
  padding: 9px 14px; border-radius: 11px; display: inline-flex; align-items: center; gap: 7px;
  transition: background .2s, color .2s;
}
.nav a:hover { background: #f4f1ff; color: var(--primary); }
.nav a.active { background: #efebff; color: var(--primary-deep); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.user-chip {
  display: flex; align-items: center; gap: 9px; padding: 6px 12px 6px 6px;
  border-radius: 999px; background: #f6f3ff;
}
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #ffd18f, #ff9f43);
  color: #7a3d00; font-weight: 800; font-size: 14px;
}
.user-chip span { font-size: 13px; font-weight: 700; }
.user-chip .role-tag { font-size: 10px; color: var(--primary); background: #eae4ff; padding: 2px 7px; border-radius: 999px; }

.page { flex: 1; padding: 30px 0 60px; }

/* --------------------------------- 登录页 -------------------------------- */
.auth-page {
  min-height: 100vh; display: grid;
  grid-template-columns: 1.05fr .95fr;
  background: #fff;
}
.auth-hero {
  position: relative; overflow: hidden; padding: 54px 64px;
  color: #fff;
  background: linear-gradient(150deg, #5b4bd6 0%, #7b6bf0 45%, #a48dff 100%);
  display: flex; flex-direction: column; justify-content: center;
}
.auth-hero::before, .auth-hero::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(2px); opacity: .45;
}
.auth-hero::before {
  width: 420px; height: 420px; right: -140px; top: -120px;
  background: radial-gradient(circle, rgba(255, 255, 255, .45), transparent 65%);
}
.auth-hero::after {
  width: 380px; height: 380px; left: -120px; bottom: -160px;
  background: radial-gradient(circle, rgba(255, 200, 120, .55), transparent 65%);
}
.auth-hero-inner { position: relative; z-index: 2; max-width: 480px; }
.auth-logo { display: flex; align-items: center; gap: 12px; font-size: 22px; font-weight: 800; }
.auth-logo .brand-mark { background: rgba(255, 255, 255, .2); box-shadow: none; }
.auth-hero h1 { font-size: 40px; line-height: 1.25; margin: 34px 0 14px; letter-spacing: 1px; }
.auth-hero h1 em { font-style: normal; color: #ffe0a8; }
.auth-hero p { color: rgba(255, 255, 255, .82); font-size: 15px; line-height: 1.9; margin: 0; }
.auth-features { margin-top: 36px; display: grid; gap: 14px; }
.auth-feature { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: rgba(255, 255, 255, .92); }
.auth-feature i {
  width: 28px; height: 28px; border-radius: 9px; flex: none;
  background: rgba(255, 255, 255, .18);
  display: flex; align-items: center; justify-content: center;
}
.auth-feature b { display: block; margin-bottom: 2px; }
.auth-feature small { color: rgba(255, 255, 255, .68); font-size: 12px; }

.hero-words { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.hero-word {
  position: absolute; padding: 9px 16px; border-radius: 999px;
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22);
  backdrop-filter: blur(6px); font-size: 13px; font-weight: 700; color: rgba(255, 255, 255, .9);
  animation: floaty 7s ease-in-out infinite;
}
.hero-word:nth-child(1) { top: 14%; right: 12%; animation-delay: .2s; }
.hero-word:nth-child(2) { top: 30%; right: 30%; animation-delay: 1.4s; }
.hero-word:nth-child(3) { bottom: 22%; right: 8%; animation-delay: .7s; }
.hero-word:nth-child(4) { bottom: 10%; left: 12%; animation-delay: 2s; }
.hero-word:nth-child(5) { top: 66%; right: 38%; animation-delay: 2.6s; }
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

.auth-panel {
  display: flex; align-items: center; justify-content: center;
  padding: 40px 24px; background: #fdfcff;
}
.auth-box { width: 100%; max-width: 400px; }
.auth-box h2 { margin: 0 0 6px; font-size: 26px; }
.auth-box .sub { margin: 0 0 26px; color: var(--muted); font-size: 14px; }
.auth-tabs {
  display: flex; gap: 6px; background: #f3f0ff; padding: 5px;
  border-radius: 13px; margin-bottom: 24px;
}
.auth-tabs button {
  flex: 1; border: 0; background: transparent; padding: 10px;
  border-radius: 10px; font-weight: 700; font-size: 14px; color: var(--muted);
  transition: background .2s, color .2s, box-shadow .2s;
}
.auth-tabs button.active { background: #fff; color: var(--primary); box-shadow: var(--shadow-sm); }
.auth-submit { margin-top: 8px; }
.auth-foot { margin-top: 20px; font-size: 12px; color: var(--muted); text-align: center; line-height: 1.8; }
.auth-error {
  background: var(--red-soft); color: #b42323; font-size: 13px; font-weight: 600;
  padding: 10px 14px; border-radius: 11px; margin-bottom: 14px;
}

/* --------------------------------- 首页 --------------------------------- */
.home-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.home-head h1 { margin: 0; font-size: 27px; letter-spacing: .3px; }
.home-head p { margin: 7px 0 0; color: var(--muted); font-size: 14px; }
.greeting-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; padding: 9px 16px; border-radius: 999px;
  font-size: 13px; font-weight: 700; color: var(--muted); box-shadow: var(--shadow-sm);
}
.greeting-pill b { color: var(--primary); }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--card); border-radius: 18px; padding: 18px 20px;
  box-shadow: var(--shadow-sm); display: flex; align-items: center; gap: 14px;
  border: 1px solid #fff;
}
.stat-ico {
  width: 44px; height: 44px; border-radius: 14px; flex: none;
  display: flex; align-items: center; justify-content: center;
}
.stat-ico.violet { background: #efeaff; color: var(--primary); }
.stat-ico.orange { background: #fff2e0; color: #e88a14; }
.stat-ico.green { background: var(--green-soft); color: #0a9e6e; }
.stat-ico.blue { background: #e8f3ff; color: #2c86e0; }
.stat-card em { display: block; font-style: normal; font-size: 23px; font-weight: 800; line-height: 1.15; }
.stat-card span { font-size: 12px; color: var(--muted); font-weight: 600; }

.home-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 22px; align-items: start; }
.home-col { display: flex; flex-direction: column; gap: 22px; }

.panel { padding: 24px; }

.import-preview {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 12px; color: var(--muted); margin-top: 10px; flex-wrap: wrap;
}
.import-preview b { color: var(--primary); }
.sample-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.sample-chip {
  border: 1px dashed #d9d2ff; background: #faf8ff; color: var(--primary-deep);
  font-size: 12px; font-weight: 700; padding: 7px 12px; border-radius: 999px;
  transition: background .2s;
}
.sample-chip:hover { background: #f0ebff; }
.import-actions { display: flex; gap: 10px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.import-actions .btn { flex: none; }
.import-actions .grow { flex: 1; }

.scheme-list { display: flex; flex-direction: column; gap: 12px; }
.scheme-card {
  position: relative; border: 1.5px solid var(--line); border-radius: 18px;
  padding: 17px 18px; cursor: pointer; background: #fff;
  transition: border-color .2s, box-shadow .2s, transform .15s, background .2s;
}
.scheme-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.scheme-card.selected {
  border-color: var(--primary-2);
  background: linear-gradient(180deg, #fbf9ff, #fff);
  box-shadow: 0 10px 26px rgba(108, 92, 231, .14);
}
.scheme-top { display: flex; align-items: center; gap: 10px; }
.scheme-name { font-weight: 800; font-size: 16px; }
.scheme-sub { font-size: 12px; color: var(--muted); margin-left: auto; }
.scheme-desc { font-size: 12.5px; color: #645d84; line-height: 1.7; margin: 8px 0 11px; }
.scheme-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.scheme-check {
  width: 20px; height: 20px; border-radius: 50%; border: 2px solid #d8d2f3;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  background: #fff; color: #fff;
}
.scheme-card.selected .scheme-check { background: var(--primary); border-color: var(--primary); }

.lib-select { margin-bottom: 18px; }
#scheme-panel { scroll-margin-top: 86px; }
.lib-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.lib-chip {
  border: 1.5px solid var(--line); background: #fff; border-radius: 12px;
  padding: 9px 14px; font-size: 13px; font-weight: 700; color: #5b5478;
  display: flex; align-items: center; gap: 8px; transition: all .18s;
}
.lib-chip small { color: var(--muted); font-weight: 600; }
.lib-chip:hover { border-color: #cfc6ff; }
.lib-chip.active { border-color: var(--primary); background: #f4f1ff; color: var(--primary-deep); }
.lib-chip.active small { color: var(--primary); }

.start-bar {
  display: flex; align-items: center; gap: 14px; margin-top: 18px;
  padding-top: 18px; border-top: 1px dashed var(--line); flex-wrap: wrap;
}
.start-bar .meta { font-size: 12px; color: var(--muted); line-height: 1.7; flex: 1 1 220px; min-width: 0; }
.start-bar .meta b { color: var(--ink); }

.recent-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 0;
  border-bottom: 1px dashed var(--line);
}
.recent-item:last-child { border-bottom: 0; }
.recent-ico {
  width: 40px; height: 40px; border-radius: 13px; flex: none;
  background: #f3f0ff; color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.recent-main { flex: 1; min-width: 0; }
.recent-main b { font-size: 14px; display: block; }
.recent-main span { font-size: 12px; color: var(--muted); }
.recent-right { text-align: right; font-size: 12px; color: var(--muted); }
.stars-mini { display: flex; gap: 2px; justify-content: flex-end; color: #f0b429; }

.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.lib-card {
  border: 1.5px solid var(--line); border-radius: 17px; padding: 16px;
  background: #fff; transition: border-color .2s, box-shadow .2s;
}
.lib-card:hover { border-color: #d9d1ff; box-shadow: var(--shadow-sm); }
.lib-card-top { display: flex; align-items: flex-start; gap: 10px; }
.lib-card-top .lib-ico {
  width: 38px; height: 38px; border-radius: 12px; background: #f4f1ff; color: var(--primary);
  display: flex; align-items: center; justify-content: center; flex: none;
}
.lib-card h4 { margin: 2px 0 3px; font-size: 15px; word-break: break-all; }
.lib-card .lib-meta { font-size: 12px; color: var(--muted); }
.lib-progress { height: 6px; border-radius: 99px; background: #f1eefb; margin: 13px 0 12px; overflow: hidden; }
.lib-progress i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #8f7dff, #c2b6ff); transition: width .4s; }
.lib-actions { display: flex; gap: 8px; }

.hard-word {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 13px;
}
.hard-word:last-child { border-bottom: 0; }
.hard-word b { font-size: 14px; }
.hard-word small { color: var(--muted); display: block; margin-top: 2px; }

.footnote { text-align: center; color: #a29fbd; font-size: 12px; margin-top: 26px; }

/* --------------------------------- 闯关页 -------------------------------- */
.practice-page { min-height: 100vh; display: flex; flex-direction: column; }
.practice-top {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255, 255, 255, .9); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.practice-top-inner {
  max-width: 880px; margin: 0 auto; padding: 14px 22px;
  display: flex; align-items: center; gap: 14px;
}
.practice-top .icon-btn { background: #f3f0ff; }
.practice-progress { flex: 1; }
.progress-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 6px; font-weight: 700; }
.progress-meta b { color: var(--primary); }
.progress-track { height: 9px; border-radius: 99px; background: #eeeafb; overflow: hidden; }
.progress-track i {
  display: block; height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, #7b68ff, #b1a3ff);
  transition: width .35s cubic-bezier(.4, 0, .2, 1);
}
.practice-score { display: flex; align-items: center; gap: 6px; font-weight: 800; color: var(--primary); font-size: 14px; }
.practice-score small { color: var(--muted); font-weight: 600; }

.practice-main { flex: 1; display: flex; justify-content: center; padding: 34px 20px 60px; }
.practice-card { width: 100%; max-width: 720px; }

.q-card {
  background: #fff; border-radius: 28px; padding: 34px 38px 30px;
  box-shadow: 0 24px 60px rgba(72, 54, 165, .13);
  position: relative; overflow: hidden;
}
.q-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 5px;
  background: linear-gradient(90deg, #7b68ff, #ffb26b, #52d6b0);
}
.q-head { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; justify-content: space-between; }
.q-type {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 800; letter-spacing: .3px;
  color: var(--primary-deep); background: #f1edff; padding: 7px 13px; border-radius: 999px;
}
.q-type.review { color: #b1600a; background: #fff3e2; }
.q-timer {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 800; font-size: 14px; color: var(--primary);
  background: #f4f1ff; padding: 7px 13px; border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.q-timer.warn { color: #c62b2b; background: var(--red-soft); animation: pulse .9s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.06); } }

.q-body { text-align: center; padding: 6px 0 4px; }
.audio-btn {
  width: 92px; height: 92px; border-radius: 50%; border: 0; margin: 6px auto 16px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; background: linear-gradient(140deg, #7461ff, #a998ff);
  box-shadow: 0 16px 32px rgba(108, 92, 231, .32);
  position: relative; transition: transform .15s;
}
.audio-btn:hover { transform: scale(1.05); }
.audio-btn:active { transform: scale(.96); }
.audio-btn::after, .audio-btn::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid rgba(140, 120, 255, .5);
  animation: ripple 2.4s ease-out infinite;
}
.audio-btn::before { animation-delay: 1.2s; }
.audio-btn.playing::after, .audio-btn.playing::before { border-color: rgba(255, 159, 67, .55); }
@keyframes ripple {
  0% { transform: scale(1); opacity: .8; }
  100% { transform: scale(1.55); opacity: 0; }
}
.audio-tip { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.q-word {
  font-size: 42px; font-weight: 800; letter-spacing: 1px; margin: 4px 0 8px;
  word-break: break-word; line-height: 1.2;
}
.q-phonetic { color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.q-prompt { font-size: 17px; font-weight: 700; color: #4d466b; margin: 10px 0 4px; line-height: 1.5; }
.q-sub { font-size: 13px; color: var(--muted); margin-top: 6px; }

.options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 22px; }
.option {
  display: flex; align-items: center; gap: 12px;
  border: 1.8px solid var(--line); background: #fff; border-radius: 16px;
  padding: 15px 16px; font-size: 16px; font-weight: 700; color: var(--ink);
  text-align: left; transition: all .18s; min-height: 62px;
}
.option .opt-key {
  width: 26px; height: 26px; border-radius: 8px; flex: none;
  background: #f3f0ff; color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800;
}
.option:hover:not(:disabled) { border-color: var(--primary-2); background: #fbf9ff; transform: translateY(-1px); }
.option:disabled { cursor: default; }
.option.correct { border-color: var(--green); background: #effcf6; }
.option.correct .opt-key { background: var(--green); color: #fff; }
.option.wrong { border-color: #f4a6a6; background: var(--red-soft); }
.option.wrong .opt-key { background: #f4a6a6; color: #fff; }
.option.dim { opacity: .55; }

.fill-area { margin-top: 22px; }
.fill-input {
  width: 100%; text-align: center; font-size: 24px; font-weight: 800; letter-spacing: 2px;
  border: 2px solid var(--line); border-radius: 16px; padding: 16px;
  background: #fbfaff; outline: none; transition: border-color .2s, box-shadow .2s;
}
.fill-input:focus { border-color: var(--primary-2); box-shadow: 0 0 0 4px rgba(108, 92, 231, .1); background: #fff; }
.fill-input.correct { border-color: var(--green); background: #effcf6; }
.fill-input.wrong { border-color: #f4a6a6; background: var(--red-soft); }
.fill-input:disabled { color: var(--ink); }
.fill-hint { display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 13px; color: var(--muted); margin-top: 10px; flex-wrap: wrap; }
.fill-hint code {
  background: #f3f0ff; color: var(--primary-deep); border-radius: 8px;
  padding: 4px 10px; font-size: 14px; letter-spacing: 2px; font-weight: 800;
}
.letter-bank { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 14px; }
.letter-chip {
  width: 42px; height: 46px; border-radius: 12px; border: 1.8px solid var(--line);
  background: #fff; font-size: 18px; font-weight: 800; color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  transition: all .15s; text-transform: lowercase;
}
.letter-chip:hover:not(:disabled) { border-color: var(--primary-2); background: #f7f4ff; transform: translateY(-2px); }
.letter-chip.used { opacity: .25; }
.letter-preview { letter-spacing: 4px; font-size: 22px; font-weight: 800; min-height: 30px; margin-top: 12px; color: var(--primary-deep); }
.letter-preview .ghost { color: #cfc9ea; }

.q-actions { display: flex; gap: 10px; margin-top: 18px; }
.q-actions .btn { flex: 1; }

.feedback {
  margin-top: 18px; border-radius: 16px; padding: 14px 18px;
  display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 700;
  animation: fadeUp .25s ease;
}
.feedback.ok { background: var(--green-soft); color: #067a52; }
.feedback.no { background: var(--red-soft); color: #b42323; }
.feedback .fb-ico {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.feedback.ok .fb-ico { background: var(--green); }
.feedback.no .fb-ico { background: var(--red); }
.feedback .fb-main { flex: 1; }
.feedback .fb-main small { display: block; font-weight: 600; opacity: .8; margin-top: 2px; }
.feedback b { font-size: 16px; letter-spacing: .5px; }

.review-note {
  margin-top: 14px; text-align: center; font-size: 12px; color: var(--muted);
  display: flex; align-items: center; justify-content: center; gap: 6px;
}

.practice-hint-bar {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  margin-top: 18px; font-size: 12px; color: var(--muted); flex-wrap: wrap;
}
.key-hint kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 6px; margin: 0 2px;
  border-radius: 6px; background: #fff; border: 1px solid var(--line);
  font-size: 11px; font-family: inherit; color: #5b5478; box-shadow: 0 1px 0 #e6e1f7;
}

/* 结算页 */
.result-card { text-align: center; padding: 40px 38px 32px; }
.result-emoji {
  width: 84px; height: 84px; border-radius: 50%; margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(140deg, #fff0d6, #ffe0aa); color: #d98a1a;
  box-shadow: 0 16px 32px rgba(255, 171, 64, .28);
}
.result-card h2 { margin: 6px 0 4px; font-size: 26px; }
.result-card .result-sub { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.star-row { display: flex; justify-content: center; gap: 12px; margin: 8px 0 6px; }
.star-row svg { transition: transform .3s; }
.star-row .lit { color: #f7b731; filter: drop-shadow(0 6px 10px rgba(247, 183, 49, .4)); animation: pop .5s cubic-bezier(.2, 1.6, .4, 1) both; }
.star-row .lit:nth-child(2) { animation-delay: .15s; }
.star-row .lit:nth-child(3) { animation-delay: .3s; }
.star-row .dim { color: #e6e2f3; }
@keyframes pop { 0% { transform: scale(.2) rotate(-30deg); opacity: 0; } 100% { transform: scale(1) rotate(0); opacity: 1; } }

.result-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 24px 0; }
.result-stat { background: #faf9ff; border-radius: 16px; padding: 14px 8px; }
.result-stat b { display: block; font-size: 21px; color: var(--primary-deep); }
.result-stat span { font-size: 12px; color: var(--muted); }
.result-words { text-align: left; margin-top: 20px; }
.result-words h4 { font-size: 13px; color: var(--muted); margin: 0 0 10px; display: flex; align-items: center; gap: 6px; }
.wrong-list { display: flex; flex-wrap: wrap; gap: 8px; }
.wrong-chip {
  background: var(--red-soft); color: #b42323; border-radius: 10px;
  padding: 7px 12px; font-size: 12.5px; font-weight: 700;
}
.wrong-chip small { color: #c96a6a; font-weight: 600; margin-left: 4px; }
.mastered-list { display: flex; flex-wrap: wrap; gap: 8px; }
.mastered-chip {
  background: var(--green-soft); color: #067a52; border-radius: 10px;
  padding: 7px 12px; font-size: 12.5px; font-weight: 700;
}
.result-actions { display: flex; gap: 10px; margin-top: 26px; }
.result-actions .btn { flex: 1; }

/* --------------------------------- 后台 --------------------------------- */
.admin-page { padding: 26px 0 60px; }
.admin-layout { display: grid; grid-template-columns: 216px 1fr; gap: 22px; align-items: start; }
.admin-nav {
  background: #fff; border-radius: 20px; padding: 12px;
  box-shadow: var(--shadow-sm); position: sticky; top: 88px;
}
.admin-nav-title {
  font-size: 11px; font-weight: 800; letter-spacing: 1px; color: #a5a0bf;
  padding: 10px 12px 8px; text-transform: uppercase;
}
.admin-nav button {
  width: 100%; display: flex; align-items: center; gap: 10px;
  border: 0; background: transparent; text-align: left;
  padding: 11px 12px; border-radius: 12px; font-size: 13.5px; font-weight: 700; color: #5b5478;
  transition: background .18s, color .18s;
}
.admin-nav button:hover { background: #f7f4ff; color: var(--primary); }
.admin-nav button.active { background: #f0ebff; color: var(--primary-deep); }
.admin-nav .admin-user {
  margin-top: 10px; padding: 12px; border-top: 1px dashed var(--line);
  font-size: 12px; color: var(--muted); line-height: 1.7;
}
.admin-main { min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.admin-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.admin-head h1 { margin: 0; font-size: 22px; }
.admin-head p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.admin-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.admin-toolbar .search {
  display: flex; align-items: center; gap: 8px; background: #fff;
  border: 1.5px solid var(--line); border-radius: 12px; padding: 0 12px; min-width: 220px;
}
.admin-toolbar .search input {
  border: 0; outline: none; background: transparent; padding: 10px 0; font-size: 13px; width: 100%;
}
.admin-toolbar select {
  border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px;
  font-size: 13px; background: #fff; outline: none; color: var(--ink);
}

.table-wrap { background: #fff; border-radius: 18px; box-shadow: var(--shadow-sm); overflow: hidden; }
.table-scroll { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; min-width: 640px; }
.table th, .table td {
  padding: 13px 16px; text-align: left; font-size: 13px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table th { background: #fbfaff; font-size: 12px; color: var(--muted); font-weight: 800; letter-spacing: .3px; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fcfbff; }
.table .actions { display: flex; gap: 6px; }
.table .cell-strong { font-weight: 700; }
.table .cell-sub { color: var(--muted); font-size: 12px; }
.table .wrap { white-space: normal; max-width: 260px; }

.pager {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted);
  flex-wrap: wrap;
}
.pager .pager-btns { display: flex; gap: 6px; }
.pager button {
  border: 1.5px solid var(--line); background: #fff; border-radius: 9px;
  padding: 5px 11px; font-size: 12px; font-weight: 700; color: #5b5478;
}
.pager button:disabled { opacity: .45; cursor: not-allowed; }
.pager button:not(:disabled):hover { border-color: var(--primary-2); color: var(--primary); }

.admin-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.admin-stat {
  background: #fff; border-radius: 17px; padding: 17px 18px; box-shadow: var(--shadow-sm);
}
.admin-stat span { font-size: 12px; color: var(--muted); font-weight: 700; }
.admin-stat b { display: block; font-size: 25px; margin-top: 6px; font-weight: 800; }
.admin-stat small { font-size: 11px; color: #a5a0bf; }

.chart-bars { display: flex; align-items: flex-end; gap: 12px; height: 150px; padding: 10px 6px 0; }
.chart-bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.chart-bar i {
  width: 100%; max-width: 38px; border-radius: 9px 9px 4px 4px; min-height: 4px;
  background: linear-gradient(180deg, #8f7dff, #c9bfff);
  transition: height .4s;
}
.chart-bar span { font-size: 10px; color: var(--muted); }
.chart-bar em { font-size: 11px; font-style: normal; font-weight: 800; color: var(--primary-deep); }

.admin-split { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.sub-card { background: #fff; border-radius: 18px; padding: 20px; box-shadow: var(--shadow-sm); }
.sub-card h3 { margin: 0 0 14px; font-size: 15px; }
.rank-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 0;
  border-bottom: 1px dashed var(--line); font-size: 13px;
}
.rank-row:last-child { border-bottom: 0; }
.rank-no {
  width: 24px; height: 24px; border-radius: 8px; background: #f3f0ff; color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; flex: none;
}
.rank-row b { flex: 1; font-weight: 700; }
.rank-row span { color: var(--muted); font-size: 12px; }

.scheme-admin-card {
  background: #fff; border-radius: 18px; padding: 20px; box-shadow: var(--shadow-sm);
  border: 1.5px solid transparent;
}
.scheme-admin-card.off { opacity: .68; }
.scheme-admin-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.scheme-admin-head h3 { margin: 0; font-size: 16px; }
.scheme-admin-head .badge { margin-left: auto; }
.scheme-admin-card p { font-size: 12.5px; color: var(--muted); line-height: 1.8; margin: 0 0 12px; }
.scheme-admin-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.scheme-admin-actions { display: flex; gap: 8px; }
.scheme-editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stage-editor {
  border: 1.5px dashed var(--line); border-radius: 14px; padding: 28px 14px 14px;
  position: relative; margin-bottom: 12px;
}
.stage-editor > .stage-remove { position: absolute; top: 8px; right: 8px; }
.stage-title { position: absolute; top: 10px; left: 14px; font-size: 11px; font-weight: 800; color: var(--muted); letter-spacing: .5px; }
.weight-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.weight-item label { font-size: 12px; font-weight: 700; color: #5b5478; display: block; margin-bottom: 4px; }
.weight-item input {
  width: 100%; border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 10px;
  font-size: 13px; outline: none; background: #fbfaff;
}
.weight-item input:focus { border-color: var(--primary-2); }

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.settings-group { background: #fff; border-radius: 18px; padding: 20px; box-shadow: var(--shadow-sm); }
.settings-group h3 { margin: 0 0 16px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; }
.switch-row span { font-size: 13px; font-weight: 700; }
.switch-row small { display: block; color: var(--muted); font-weight: 500; margin-top: 3px; }
.switch { position: relative; width: 44px; height: 25px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i {
  position: absolute; inset: 0; background: #ded9f2; border-radius: 99px; transition: background .2s;
}
.switch i::after {
  content: ""; position: absolute; width: 19px; height: 19px; border-radius: 50%;
  background: #fff; top: 3px; left: 3px; transition: transform .2s; box-shadow: 0 2px 5px rgba(0,0,0,.15);
}
.switch input:checked + i { background: var(--primary); }
.switch input:checked + i::after { transform: translateX(19px); }

.log-detail { color: var(--muted); font-size: 12px; max-width: 320px; white-space: normal; }

/* --------------------------------- 弹层 --------------------------------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 100; background: rgba(30, 24, 60, .45);
  backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center;
  padding: 20px; animation: fadeIn .18s ease;
}
.modal {
  width: 100%; max-width: 560px; max-height: min(86vh, 760px);
  background: #fff; border-radius: 22px; box-shadow: 0 30px 80px rgba(20, 12, 60, .3);
  display: flex; flex-direction: column; animation: fadeUp .22s ease;
}
.modal.wide { max-width: 760px; }
.modal-head {
  display: flex; align-items: center; gap: 10px; padding: 20px 24px 14px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 { margin: 0; font-size: 17px; flex: 1; }
.modal-body { padding: 18px 24px; overflow-y: auto; }
.modal-foot {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 14px 24px 20px; border-top: 1px solid var(--line);
}
.word-manage-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}
.word-manage-row .wm-main { flex: 1; min-width: 0; }
.word-manage-row b { font-size: 14px; }
.word-manage-row span { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.word-manage-row .wm-actions { display: flex; gap: 4px; }
.mastery-dots { display: flex; gap: 3px; }
.mastery-dots i { width: 6px; height: 6px; border-radius: 50%; background: #e4dff5; }
.mastery-dots i.on { background: var(--green); }
.modal-list-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.modal-list-head span { font-size: 12px; color: var(--muted); }
.inline-add { display: flex; gap: 8px; margin-top: 14px; }
.inline-add input {
  flex: 1; border: 1.5px solid var(--line); border-radius: 11px; padding: 10px 12px;
  font-size: 13px; outline: none; background: #fbfaff;
}
.inline-add input:focus { border-color: var(--primary-2); }

.detail-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 0;
  border-bottom: 1px dashed var(--line); font-size: 13px;
}
.detail-item:last-child { border-bottom: 0; }
.detail-item .di-seq {
  width: 24px; height: 24px; border-radius: 7px; background: #f3f0ff; color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; flex: none;
}
.detail-item .di-main { flex: 1; }
.detail-item .di-main b { font-weight: 700; }
.detail-item .di-main span { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }

/* --------------------------------- 提示条 -------------------------------- */
.toast-stack {
  position: fixed; top: 18px; right: 18px; z-index: 200;
  display: flex; flex-direction: column; gap: 10px; max-width: 340px;
}
.toast {
  background: #fff; border-radius: 13px; padding: 12px 16px;
  box-shadow: 0 16px 40px rgba(40, 28, 100, .18);
  font-size: 13px; font-weight: 700; color: #3b3363;
  border-left: 4px solid var(--primary);
  animation: slideIn .25s ease;
}
.toast.success { border-left-color: var(--green); }
.toast.error { border-left-color: var(--red); }
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }

.boot-screen {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; color: var(--muted); font-size: 13px;
}
.boot-logo {
  width: 62px; height: 62px; border-radius: 18px;
  background: linear-gradient(135deg, var(--primary), #a394ff); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 16px 36px rgba(108, 92, 231, .3);
  animation: breathe 1.6s ease-in-out infinite;
}
@keyframes breathe { 50% { transform: scale(1.06); } }

@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.fade-up { animation: fadeUp .35s ease; }

/* --------------------------------- 响应式 -------------------------------- */
@media (max-width: 1080px) {
  .auth-hero { padding: 44px 40px; }
  .auth-hero h1 { font-size: 33px; }
  .home-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-nav { position: static; display: flex; gap: 4px; overflow-x: auto; padding: 8px; }
  .admin-nav-title, .admin-nav .admin-user { display: none; }
  .admin-nav button { width: auto; white-space: nowrap; }
}

@media (max-width: 820px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .auth-panel { min-height: 100vh; }
  .q-card { padding: 26px 22px 24px; border-radius: 24px; }
  .q-word { font-size: 34px; }
  .options { grid-template-columns: 1fr; }
  .result-stats { grid-template-columns: repeat(2, 1fr); }
  .admin-split { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .admin-stat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
  .container { padding: 0 16px; }
  .page { padding: 20px 0 44px; }
  .topbar-inner { gap: 8px; height: auto; min-height: 60px; padding-top: 4px; padding-bottom: 4px; }
  .brand { min-height: 44px; }
  .brand small { display: none; }
  .nav {
    flex: 1 1 auto; min-width: 0; margin-left: 2px;
    overflow-x: auto; overflow-y: hidden;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a span { display: none; }
  .nav a { flex: 0 0 auto; min-width: 44px; min-height: 44px; justify-content: center; padding: 0 11px; }
  .topbar-right { flex: 0 0 auto; gap: 4px; }
  .icon-btn { width: 44px; height: 44px; min-width: 44px; min-height: 44px; }
  .btn-sm { min-height: 44px; }
  .lib-chip { min-height: 44px; }
  .user-chip span { display: none; }
  .user-chip .avatar { display: flex; width: 36px; height: 36px; }
  .user-chip { padding: 4px; background: transparent; }
  .sample-chip { min-height: 44px; }
  .section-title .badge { flex: none; white-space: nowrap; }
  .home-head h1 { font-size: 22px; }
  .panel { padding: 18px; }
  .stat-card { padding: 14px; }
  .stat-card em { font-size: 19px; }
  .result-card { padding: 30px 20px 24px; }
  .practice-top-inner { padding: 12px 14px; gap: 8px; }
  .practice-score small { display: none; }
  .letter-chip { width: 36px; height: 42px; }
  .scheme-editor-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .modal { max-height: 92vh; }
  .table th, .table td { padding: 11px 12px; }
  .result-actions { flex-direction: column; }
  .start-bar .meta { flex: 1 1 100%; order: 1; }
  .start-bar > label.field { order: 2; flex: 1; }
  .start-bar > .btn { order: 3; flex: 1 1 100%; width: 100%; }
  .start-bar select { width: 100%; }
}

/* ---------------------------- 儿童学习乐园与游戏 ---------------------------- */
.learning-hub {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 24px;
}
.learning-hub a {
  min-height: 112px;
  padding: 16px 12px;
  border: 1px solid rgba(108, 92, 231, .1);
  border-radius: 18px;
  background: rgba(255, 255, 255, .88);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  transition: transform .2s ease, border-color .2s ease;
}
.learning-hub a:hover { transform: translateY(-3px); border-color: var(--primary-2); }
.learning-hub a > span { display: block; font-size: 25px; margin-bottom: 9px; }
.learning-hub strong { display: block; font-size: 14px; }
.learning-hub small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.5; }

.game-shell { width: min(1080px, calc(100% - 32px)); margin: 0 auto; padding: 22px 0 48px; }
.game-switcher { display: flex; gap: 7px; margin-bottom: 18px; overflow-x: auto; padding: 4px; }
.game-switcher a {
  flex: 1; min-width: 104px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 13px; color: var(--muted); background: rgba(255,255,255,.72); text-decoration: none; font-size: 13px; font-weight: 800;
}
.game-switcher a.active { color: #fff; background: var(--ink); box-shadow: 0 8px 20px rgba(34,28,66,.18); }
.game-header {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 22px 24px; border-radius: 22px 22px 0 0; background: #fff; box-shadow: var(--shadow-sm);
}
.game-header h1 { margin: 3px 0 4px; font-size: 27px; letter-spacing: -.6px; }
.game-header p { margin: 0; color: var(--muted); font-size: 13px; }
.eyebrow { color: var(--primary) !important; font-size: 11px !important; font-weight: 900; letter-spacing: 1.6px; }
.game-stats { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.game-stats > span { padding: 9px 12px; border-radius: 12px; background: #f5f2ff; font-size: 13px; font-weight: 800; white-space: nowrap; }
.progress-bar { height: 9px; overflow: hidden; border-radius: 99px; background: #e8e3f7; }
.progress-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), #ff9f43); transition: width .3s ease; }
.game-progress-text { margin: 10px 4px 16px; color: var(--muted); font-size: 13px; font-weight: 700; }

.match-grid, .flip-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 22px; border-radius: 0 0 22px 22px; background: rgba(255,255,255,.6); }
.match-card {
  position: relative; min-height: 98px; padding: 15px 10px; border: 2px solid transparent; border-radius: 17px;
  color: var(--ink); background: #fff; box-shadow: var(--shadow-sm); transition: transform .16s ease, border-color .16s ease, opacity .2s;
}
.match-card:hover:not(:disabled) { transform: translateY(-3px) rotate(-.5deg); border-color: var(--primary-2); }
.match-card small { display: block; margin-bottom: 8px; color: var(--primary); font-size: 10px; font-weight: 900; letter-spacing: 1px; }
.match-card strong { display: block; overflow-wrap: anywhere; font-size: 17px; line-height: 1.35; }
.match-card.meaning { background: #fffbf4; }
.match-card.selected { border-color: var(--primary); background: #f0ebff; transform: translateY(-3px); }
.match-card.matched { border-color: #8ce0bd; background: var(--green-soft); opacity: .65; }
.match-card.wrong { border-color: var(--red); animation: gameShake .3s linear; }
@keyframes gameShake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

.flip-card { min-height: 118px; padding: 0; border: 0; border-radius: 17px; background: transparent; perspective: 700px; }
.flip-inner { position: relative; display: block; width: 100%; height: 118px; transition: transform .35s ease; transform-style: preserve-3d; }
.flip-card.revealed .flip-inner { transform: rotateY(180deg); }
.flip-front, .flip-back {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: 17px; backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: var(--shadow-sm);
}
.flip-front { color: #fff; background: linear-gradient(145deg, var(--primary), #40328f); font-size: 34px; font-weight: 900; }
.flip-back { padding: 10px; color: var(--ink); background: #fff; transform: rotateY(180deg); font-size: 17px; font-weight: 900; overflow-wrap: anywhere; }
.flip-back small { display: block; margin-top: 7px; color: var(--muted); font-size: 11px; font-weight: 600; }

.game-finished, .game-intro {
  padding: 54px 24px; border-radius: 26px; background: #fff; box-shadow: var(--shadow); text-align: center;
  animation: fadeUp .35s ease;
}
.game-finished h1, .game-intro h1 { margin: 8px 0 12px; font-size: 30px; }
.game-finished p, .game-intro p { color: var(--muted); }
.fin-emoji, .maze-castle { font-size: 64px; filter: drop-shadow(0 10px 12px rgba(108,92,231,.18)); }
.fin-score { margin: 18px 0 8px; color: var(--primary-deep); font-size: 54px; font-weight: 900; letter-spacing: -2px; }
.fin-score small { font-size: 16px; letter-spacing: 0; }
.fin-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.fin-actions .btn { min-height: 46px; }
.game-feedback { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 16px; padding: 17px 20px; border-radius: 17px; background: var(--green-soft); color: #087b57; }
.game-feedback.wrong { color: #9a4d13; background: #fff3e2; }
.game-feedback .btn { min-height: 44px; flex: none; }

.maze-path { display: flex; align-items: center; justify-content: space-between; gap: 5px; margin: 22px 0; }
.maze-path span { position: relative; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); background: #e7e2f3; font-size: 12px; font-weight: 900; }
.maze-path span:not(:last-child)::after { content: ''; position: absolute; left: 38px; width: calc((min(100vw, 1080px) - 390px) / 8); height: 3px; background: #ddd6ee; }
.maze-path span.done { color: #fff; background: var(--green); }
.maze-path span.current { color: #fff; background: var(--primary); box-shadow: 0 0 0 7px rgba(108,92,231,.13); }
.maze-question { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 24px; border-radius: 22px; color: #fff; background: var(--ink); }
.maze-question h2 { margin: 0 0 4px; }
.maze-question p { margin: 0; color: #cfc7eb; font-size: 13px; }
.sound-orb { width: 70px; height: 70px; border: 0; border-radius: 50%; background: var(--accent); font-size: 28px; box-shadow: 0 0 0 9px rgba(255,159,67,.14); }
.maze-options { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.maze-option-wrap { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.maze-option { flex: 1; width: 100%; min-height: 130px; padding: 18px; border: 2px solid transparent; border-radius: 19px; color: var(--ink); background: #fff; box-shadow: var(--shadow-sm); }
.maze-option:hover:not(:disabled) { border-color: var(--primary-2); transform: translateY(-2px); }
/* 点中的选项必须被框住：选中描边 + 答题结果配色 */
.maze-option.selected { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(108, 92, 231, .18); transform: translateY(-2px); }
.maze-option.selected.correct { border-color: var(--green); box-shadow: 0 0 0 4px rgba(46, 204, 113, .2); background: #f0fbf4; }
.maze-option.selected.wrong { border-color: var(--red); box-shadow: 0 0 0 4px rgba(235, 87, 87, .18); background: #fff5f5; }
.maze-option > span { display: block; font-size: 24px; }
.maze-option strong { display: block; margin: 7px 0; font-size: 20px; }
.maze-option small { color: var(--muted); }
.maze-meaning-mask { color: var(--muted); opacity: .6; letter-spacing: 2px; }
.maze-peek { min-height: 40px; border: 1.5px dashed var(--line); border-radius: 12px; color: var(--primary); background: #f8f6ff; font-family: inherit; font-size: 13px; font-weight: 800; cursor: pointer; }
.maze-peek:disabled { opacity: .5; cursor: default; }
.maze-hint-btn { margin-top: 8px; min-height: 36px; padding: 6px 14px; border: 1.5px solid rgba(255,255,255,.45); border-radius: 99px; color: #fff; background: rgba(255,255,255,.12); font-family: inherit; font-size: 13px; font-weight: 800; cursor: pointer; }
.maze-hint-btn:hover { background: rgba(255,255,255,.22); }
/* 选项数量随方案词量变化：PC 一行 5 个，窄屏递减，避免溢出 */
@media (max-width: 1100px) { .maze-options { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 860px) { .maze-options { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.puzzle-card { margin-top: 20px; padding: 30px; border-radius: 24px; background: #fff; box-shadow: var(--shadow); text-align: center; }
.puzzle-meaning { margin: 0 0 24px; font-size: 23px; font-weight: 900; }
.puzzle-slots { min-height: 70px; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; padding: 12px; border: 2px dashed #d9d0f4; border-radius: 17px; background: #faf8ff; }
.puzzle-slots button, .puzzle-slots > span { width: 46px; height: 50px; display: grid; place-items: center; border-radius: 11px; font-size: 23px; font-weight: 900; text-transform: uppercase; }
.puzzle-slots button { border: 0; color: #fff; background: var(--primary); }
.puzzle-slots > span { border-bottom: 3px solid #cfc4ec; }
.letter-bank { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin: 24px 0; }
.letter-bank button { width: 52px; height: 54px; border: 0; border-radius: 13px; color: var(--ink); background: #ffe3ad; box-shadow: 0 5px 0 #e8b45e; font-size: 24px; font-weight: 900; text-transform: uppercase; touch-action: manipulation; }
.letter-bank button:disabled { opacity: .2; box-shadow: none; }
.puzzle-tools { display: flex; justify-content: center; flex-wrap: wrap; gap: 9px; }
.puzzle-tools .btn { min-height: 44px; }
.puzzle-hint { color: #9a5a12; font-weight: 700; }

@media (max-width: 1080px) {
  .learning-hub { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 700px) {
  .learning-hub { grid-template-columns: repeat(2, 1fr); }
  .learning-hub a { min-height: 96px; }
  .game-shell { width: min(100% - 20px, 1080px); padding-top: 10px; }
  .game-header { align-items: flex-start; flex-direction: column; padding: 18px; }
  .game-stats { justify-content: flex-start; }
  .match-grid, .flip-grid { grid-template-columns: repeat(2, 1fr); gap: 9px; padding: 12px; }
  .match-card { min-height: 88px; }
  .flip-card, .flip-inner { min-height: 104px; height: 104px; }
  .maze-options { grid-template-columns: 1fr; }
  .maze-option { min-height: 88px; }
  .maze-path span:not(:last-child)::after { display: none; }
  .maze-question { padding: 20px 14px; }
  .puzzle-card { padding: 20px 12px; }
  .game-feedback { align-items: stretch; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ------------------------- 复习、语法、对话与主题页面 ------------------------- */
.grammar-view, .scene-view, .theme-view, .expression-view, .review-view, .kids-dashboard {
  width: min(1040px, calc(100% - 32px)); margin: 0 auto; padding: 22px 0 48px;
}
.grammar-view button, .scene-view button, .theme-view button, .expression-view button, .review-view button, .kids-dashboard button { min-height: 44px; }
.grammar-view .btn-primary, .scene-view .btn-primary, .theme-view .btn-primary, .expression-view .btn-primary, .review-view .btn-primary, .kids-dashboard .btn-primary,
.grammar-view .btn-ghost, .scene-view .btn-ghost, .theme-view .btn-ghost, .expression-view .btn-ghost, .review-view .btn-ghost, .kids-dashboard .btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 11px 18px; border-radius: 13px; font-weight: 800;
}
.grammar-view .btn-primary, .scene-view .btn-primary, .theme-view .btn-primary, .expression-view .btn-primary, .review-view .btn-primary, .kids-dashboard .btn-primary { border: 0; }
.grammar-mode-bar, .kd-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px; }
.mode-btn { padding: 16px; border: 2px solid transparent; border-radius: 17px; color: var(--ink); background: #fff; box-shadow: var(--shadow-sm); }
.mode-btn.active { border-color: var(--primary); background: #f0ebff; }
.mode-name { font-weight: 900; }
.mode-desc { margin-top: 5px; color: var(--muted); font-size: 12px; }
.grammar-header, .review-header { padding: 18px 20px; border-radius: 18px 18px 0 0; background: #fff; }
.grammar-meta, .review-meta { display: flex; justify-content: space-between; gap: 10px; margin-top: 12px; color: var(--muted); font-size: 13px; font-weight: 700; }
.grammar-card, .review-card, .item-card { padding: 30px; border-radius: 0 0 22px 22px; background: #fff; box-shadow: var(--shadow); text-align: center; }
.q-type-badge, .item-type { display: inline-flex; padding: 5px 11px; border-radius: 99px; color: var(--primary-deep); background: #eee9ff; font-size: 11px; font-weight: 900; }
.q-prompt, .item-prompt { margin: 18px 0; font-size: 24px; line-height: 1.5; }
.q-hint, .item-hint { margin-bottom: 14px; color: #9a5a12; font-size: 13px; }
.q-word-row { display: flex; justify-content: center; align-items: center; gap: 10px; margin: 12px; }
.q-word { font-size: 28px; font-weight: 900; }
.speak-mini { min-width: 44px; border: 0; border-radius: 12px; background: #f0ebff; }
.q-options, .item-options, .scene-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px; margin-top: 20px; }
.q-option, .item-option, .scene-option { display: flex; align-items: center; gap: 10px; padding: 15px; border: 2px solid var(--line); border-radius: 15px; color: var(--ink); background: #fbfaff; text-align: left; font-weight: 700; }
.q-option:hover:not(:disabled), .item-option:hover:not(:disabled), .scene-option:hover:not(:disabled) { border-color: var(--primary-2); }
.q-option.correct, .item-option.correct { border-color: var(--green); background: var(--green-soft); }
.q-option.wrong { border-color: var(--red); background: var(--red-soft); }
.opt-letter { width: 28px; height: 28px; display: grid; place-items: center; flex: none; border-radius: 8px; background: #ebe5ff; color: var(--primary); font-size: 12px; font-weight: 900; }
.grammar-feedback, .scene-feedback, .theme-feedback, .review-feedback { margin-top: 16px; padding: 20px; border-radius: 18px; background: var(--green-soft); text-align: center; }
.grammar-feedback.wrong, .scene-feedback.wrong, .theme-feedback.wrong, .review-feedback.wrong { background: #fff3e2; }
.fb-emoji { font-size: 35px; }
.fb-text { margin: 8px 0 14px; font-weight: 800; }
.fb-actions { margin-top: 12px; }
.grammar-finished, .scene-finished, .theme-finished { padding: 45px 22px; border-radius: 24px; background: #fff; box-shadow: var(--shadow); text-align: center; }
.fin-title { margin: 10px 0 20px; font-size: 26px; font-weight: 900; }
.fin-stats { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.fin-stat { min-width: 120px; padding: 16px; border-radius: 16px; background: #f6f3ff; }
.fin-stat .num { display: block; color: var(--primary-deep); font-size: 28px; font-weight: 900; }
.fin-stat .lbl { color: var(--muted); font-size: 12px; }

.scene-select-title, .theme-hero, .exp-hero { text-align: center; font-size: 30px; font-weight: 900; }
.scene-select-desc, .theme-subtitle, .exp-desc { margin: 8px 0 22px; color: var(--muted); text-align: center; }
.scene-grid, .theme-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.scene-grid { grid-template-columns: repeat(2, 1fr); }
.scene-card, .theme-card { padding: 23px; border: 2px solid transparent; border-radius: 22px; background: #fff; box-shadow: var(--shadow-sm); transition: transform .2s, border-color .2s; }
.scene-card:hover { transform: translateY(-3px); border-color: var(--primary-2); cursor: pointer; }
.scene-icon, .theme-emoji { font-size: 44px; }
.scene-name, .theme-name { margin: 10px 0; font-size: 20px; font-weight: 900; }
.scene-desc, .theme-intro { min-height: 44px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.scene-intro { margin: 13px 0; color: var(--primary-deep); font-size: 13px; }
.scene-header { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 16px 20px; border-radius: 18px; background: #fff; }
.scene-header .progress-bar { grid-column: 1/-1; }
.scene-title { text-align: center; font-weight: 900; }
.btn-back { border: 0; border-radius: 12px; color: var(--muted); background: #f3f0fa; padding: 10px 14px; }
.dialogue-area { min-height: 230px; margin-top: 16px; padding: 28px; border-radius: 24px; background: linear-gradient(145deg,#e9f8f2,#f2edff); }
.dialogue-system, .dialogue-user { display: flex; align-items: flex-start; gap: 10px; }
.dialogue-user { justify-content: flex-end; margin-top: 20px; }
.speaker-badge { flex: none; padding: 6px 10px; border-radius: 99px; color: #fff; background: var(--primary); font-size: 11px; font-weight: 800; }
.speaker-badge.you { background: var(--green); }
.bubble { max-width: 75%; padding: 16px 18px; border-radius: 6px 18px 18px 18px; background: #fff; box-shadow: var(--shadow-sm); font-size: 18px; line-height: 1.6; }
.bubble.you { border-radius: 18px 6px 18px 18px; background: #e7fbf3; }
.scene-question { grid-column: 1/-1; font-weight: 900; }

.theme-meta { margin: 12px 0; color: var(--muted); font-size: 12px; }
.theme-list-progress { margin-bottom: 14px; }
.theme-list-progress small { display: block; margin-top: 7px; color: var(--muted); }
.theme-header { display: flex; align-items: center; gap: 16px; padding: 17px; border-radius: 18px; background: #fff; }
.theme-bar { flex: 1; }
.theme-title { margin-bottom: 8px; font-weight: 900; }
.theme-score { margin-top: 5px; color: var(--primary); font-weight: 900; }
.stage-card { display: flex; align-items: center; gap: 12px; margin: 16px 0; padding: 17px 20px; border-radius: 17px; color: #fff; background: var(--ink); }
.stage-badge { font-weight: 900; }
.stage-desc { flex: 1; color: #d4cce9; font-size: 13px; }
.stage-sub { white-space: nowrap; }
.item-card { border-radius: 22px; }
.item-audio { margin-bottom: 16px; }
.fill-area { display: flex; gap: 10px; max-width: 560px; margin: 20px auto 0; }
.fill-input { flex: 1; min-height: 46px; border: 2px solid var(--line); border-radius: 13px; padding: 10px 14px; font-size: 17px; }

.exp-input-row { padding: 22px; border-radius: 22px; background: #fff; box-shadow: var(--shadow); }
.exp-textarea { width: 100%; min-height: 130px; resize: vertical; border: 0; outline: none; color: var(--ink); background: #fff; font-size: 22px; line-height: 1.7; }
.exp-live { display: flex; justify-content: space-between; gap: 8px; padding: 10px 14px; color: var(--muted); font-size: 12px; }
.exp-btn-row { display: flex; gap: 9px; flex-wrap: wrap; }
.exp-feedback, .exp-history { margin-top: 18px; padding: 22px; border-radius: 20px; background: #fff; box-shadow: var(--shadow-sm); }
.exp-feedback.ok { border-left: 5px solid var(--green); }
.exp-feedback.err { border-left: 5px solid var(--accent); }
.fb-title { margin: 8px 0; font-weight: 900; }
.fb-stats, .exp-history-meta { display: flex; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 12px; }
.exp-issues { padding-left: 20px; color: #92520f; line-height: 1.8; }
.exp-history-title { margin-bottom: 12px; font-weight: 900; }
.exp-history-item { padding: 13px 0; border-bottom: 1px solid var(--line); }
.exp-history-sentence { margin-bottom: 6px; font-size: 16px; font-weight: 700; }

.review-card { border-radius: 22px; }
.review-speak-btn { width: 150px; height: 150px; border: 0; border-radius: 50%; color: #fff; background: linear-gradient(145deg,var(--primary),#4938b8); box-shadow: 0 15px 35px rgba(108,92,231,.28); }
.speak-icon, .speak-label { display: block; }
.speak-icon { font-size: 40px; }
.speak-label { margin-top: 8px; font-weight: 800; }
.review-meaning { margin-top: 22px; font-size: 26px; font-weight: 900; }
.review-word-hint { margin-top: 7px; color: var(--muted); }
.review-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.review-btn { min-height: 58px !important; border: 0; border-radius: 16px; font-weight: 900; }
.wrong-btn { color: #9a4d13; background: #fff0da; }
.correct-btn { color: #fff; background: var(--green); }
.mark-weak { display: block; margin: 14px auto; border: 0; color: var(--muted); background: transparent; }

/* 复习方案侧边栏：桌面端固定在最右侧 */
.review-layout { width: 100%; padding: 0 324px 0 24px; box-sizing: border-box; }
.review-main { max-width: 840px; margin: 0 auto; min-width: 0; transition: opacity .16s ease; }
.review-layout.is-switching .review-main { opacity: .35; }
.review-sidebar { position: fixed; top: 66px; right: 0; bottom: 0; width: 300px; z-index: 20; overflow-y: auto; padding: 18px 16px 24px; border-left: 1px solid var(--line); border-radius: 0; background: #fff; box-shadow: -10px 0 30px rgba(60, 40, 120, .07); }
.rs-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; font-weight: 900; }
.rs-head-count { color: var(--muted); font-size: 12px; font-weight: 700; }
.rs-list { display: flex; flex-direction: column; gap: 8px; }
.rs-item { display: flex; flex-direction: column; gap: 3px; width: 100%; min-height: 56px; padding: 11px 12px; border: 1.5px solid transparent; border-radius: 13px; background: #f6f4fb; color: inherit; font-family: inherit; text-align: left; cursor: pointer; transition: background .15s, border-color .15s; }
.rs-item:hover { border-color: var(--primary-2); }
.rs-item.active { border-color: var(--primary); background: #efe9ff; }
.rs-name { font-weight: 900; font-size: 14px; }
.rs-meta { color: var(--muted); font-size: 12px; }
.rs-tag { align-self: flex-start; margin-top: 3px; padding: 2px 8px; border-radius: 99px; background: #fff0da; color: #9a4d13; font-size: 11px; font-weight: 800; }
.rs-tag.done { background: #dcf6e6; color: #1c6b3f; }
.rs-time { color: var(--muted); font-size: 11px; }
.rs-empty { margin: 4px 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.rs-empty-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }

@media (max-width: 960px) {
  .review-layout { padding: 0 16px; }
  .review-sidebar { position: static; width: auto; top: auto; right: auto; bottom: auto; z-index: auto; overflow: visible; padding: 16px; border-left: 0; border-radius: 20px; box-shadow: var(--shadow-sm); }
  .rs-list { flex-direction: row; overflow-x: auto; min-width: 0; padding-bottom: 6px; }
  .rs-item { flex: 0 0 auto; min-width: 168px; max-width: 240px; }
}

.kd-tabs { grid-template-columns: repeat(4, 1fr); }
.kd-tabs button { border: 0; border-radius: 13px; color: var(--muted); background: #fff; font-weight: 800; }
.kd-tabs button.active { color: #fff; background: var(--primary); }
.kd-profile { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.kd-level-card, .kd-heatmap, .kd-badge-wall, .kd-ranking, .kd-all-badges, .kd-groups { padding: 22px; border-radius: 21px; background: #fff; box-shadow: var(--shadow-sm); }
.kd-level-card { text-align: center; }
.kd-level-emoji { font-size: 48px; }
.kd-level-name { margin: 8px; font-size: 23px; font-weight: 900; }
.kd-bar { height: 10px; border-radius: 99px; background: #e9e3f7; overflow: hidden; }
.kd-bar-fill { height: 100%; background: linear-gradient(90deg,var(--primary),var(--accent)); }
.kd-bar-label { margin: 8px; color: var(--muted); font-size: 12px; }
.kd-heatmap-title, .kd-section-title { margin-bottom: 14px; font-size: 17px; font-weight: 900; }
.kd-heat-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; }
.kd-heat-cell { aspect-ratio: 1; border-radius: 5px; background: #eeeaf6; }
.kd-heat-cell.heat-1 { background: #c7bfff; }.kd-heat-cell.heat-2 { background: #8d7cf3; }.kd-heat-cell.heat-3 { background: #5540c9; }
.kd-heat-legend { display: flex; align-items: center; justify-content: flex-end; gap: 5px; margin-top: 10px; color: var(--muted); font-size: 11px; }
.kd-heat-legend span:not(:first-child):not(:last-child) { width: 13px; height: 13px; border-radius: 3px; }
.kd-badge-wall { grid-column: 1/-1; }
.kd-badges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 11px; }
.kd-badge { padding: 17px 10px; border-radius: 16px; background: #f6f4fb; text-align: center; opacity: .55; }
.kd-badge.earned { background: #fff7db; opacity: 1; }
.kd-badge-icon { font-size: 34px; }.kd-badge-name { margin-top: 7px; font-weight: 900; }.kd-badge-desc, .kd-badge-status { margin-top: 5px; color: var(--muted); font-size: 11px; }
.kd-rank-item, .kd-group-item { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.kd-ranking-controls { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.kd-ranking-controls button.active { color: #fff; background: var(--primary); }
.kd-pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 18px; color: var(--muted); font-size: 13px; }
.kd-badge { cursor: pointer; border: 0; width: 100%; color: inherit; font-family: inherit; }
.kd-badge-detail { margin-top: 16px; padding: 16px; border-radius: 14px; background: #f6f3ff; }
.kd-badge-detail p { margin: 8px 0; color: var(--muted); line-height: 1.6; }
.kd-group-manage { flex-wrap: wrap; }
.kd-group-members { flex-basis: 100%; padding: 10px 12px; border-radius: 12px; background: #f8f6ff; }
.kd-group-member { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.kd-group-member-name { flex: 1; }
.kd-discover-title { margin: 26px 0 4px; font-size: 16px; }
.kd-rank-item.me { padding: 13px; border-radius: 13px; background: #f0ebff; }
.kd-rank-num { width: 35px; font-weight: 900; }.kd-rank-name { flex: 1; font-weight: 800; }.kd-rank-title { color: var(--muted); font-size: 12px; }.kd-rank-score { font-weight: 900; }
.kd-group-name { flex: 1; font-weight: 900; }.kd-group-meta { color: var(--muted); font-size: 12px; }
.kd-group-actions { margin-top: 18px; }.kd-group-row { display: flex; gap: 9px; margin-top: 10px; }
.kd-group-row .input { flex: 1; min-height: 44px; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.kd-empty { padding: 28px 12px; color: var(--muted); text-align: center; }

@media (max-width: 760px) {
  .grammar-mode-bar, .scene-grid, .theme-grid { grid-template-columns: 1fr; }
  .mode-btn { padding: 12px; }
  .q-options, .item-options, .scene-options { grid-template-columns: 1fr; }
  .grammar-card, .review-card, .item-card { padding: 22px 15px; }
  .q-prompt, .item-prompt { font-size: 20px; }
  .scene-header { grid-template-columns: 1fr 1fr; }.scene-title { grid-column: 1/-1; grid-row: 1; }
  .dialogue-area { padding: 18px 12px; }.bubble { max-width: 88%; font-size: 16px; }
  .theme-header, .stage-card { align-items: stretch; flex-direction: column; }
  .fill-area { flex-direction: column; }
  .kd-tabs { grid-template-columns: repeat(2, 1fr); }
  .kd-profile { grid-template-columns: 1fr; }.kd-badge-wall { grid-column: auto; }
  .kd-badges { grid-template-columns: repeat(2, 1fr); }
  .kd-rank-title { display: none; }
  .exp-live { flex-direction: column; }
}


