:root {
  color-scheme: light;
  --bg: #f5f8f5;
  --bg-soft: #e8f2ef;
  --panel: #ffffff;
  --panel-blue: #edf6f3;
  --ink: #14243a;
  --muted: #627286;
  --soft: #31495f;
  --blue: #24759a;
  --blue-deep: #155473;
  --cyan: #32b7bd;
  --lime: #c5ed73;
  --green: #12a875;
  --orange: #ef8a32;
  --yellow: #ffd166;
  --red: #ff5c73;
  --red-deep: #d92749;
  --line: #d7e3e1;
  --line-strong: #8ebbc7;
  --shadow: 0 16px 34px rgba(18, 52, 103, 0.11);
  --shadow-pop: 0 7px 0 rgba(14, 45, 96, 0.09);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  font-family: "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", sans-serif;
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 8% 0%, rgba(36, 117, 154, 0.08), transparent 32rem),
    radial-gradient(circle at 100% 22%, rgba(197, 237, 115, 0.14), transparent 27rem),
    linear-gradient(rgba(20, 79, 104, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 79, 104, 0.028) 1px, transparent 1px);
  background-size: auto, auto, 30px 30px, 30px 30px;
  background-attachment: fixed;
}

button, input { font: inherit; }
button { color: inherit; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

button:focus-visible,
input:focus-visible {
  outline: 4px solid rgba(255, 138, 31, 0.55);
  outline-offset: 3px;
}

.app-shell {
  width: min(1180px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 20px 112px;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 0 13px;
  border-bottom: 1px solid rgba(36, 117, 154, 0.12);
  background: rgba(245, 248, 245, 0.92);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 49px;
  height: 49px;
  flex: 0 0 auto;
  place-items: center;
  border: 3px solid var(--ink);
  border-radius: 15px 15px 15px 5px;
  color: var(--ink);
  background: var(--lime);
  box-shadow: 5px 5px 0 var(--blue);
  font-family: "Arial Black", "Microsoft YaHei", sans-serif;
  font-size: 19px;
  font-weight: 900;
  letter-spacing: -0.08em;
  transform: rotate(-2deg);
}

.brand-copy { min-width: 0; }
.brand-copy strong,
.brand-copy span { display: block; }
.brand-copy strong {
  overflow: hidden;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.brand-copy span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.top-actions { display: flex; align-items: center; gap: 10px; }

.sound-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 8px 12px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  background: #ffffff;
  box-shadow: 3px 3px 0 rgba(20, 36, 58, 0.12);
  font-size: 13px;
  font-weight: 900;
}
.sound-button.is-on {
  border-color: #2a7b5b;
  background: #e7f5ed;
}
.sound-button[aria-pressed="false"] {
  color: var(--muted);
  border-color: #9badbb;
  background: #f2f5f4;
}
.session-top-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}
.speak-answer { margin-top: 12px; }

.streak-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 13px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  background: var(--yellow);
  box-shadow: 3px 3px 0 rgba(11, 27, 58, 0.15);
  font-size: 13px;
  font-weight: 800;
}

.bottom-nav {
  position: fixed;
  z-index: 30;
  right: 14px;
  bottom: max(14px, env(safe-area-inset-bottom));
  left: 14px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  max-width: 560px;
  margin: 0 auto;
  padding: 7px;
  border: 2px solid var(--ink);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 0 rgba(11, 27, 58, 0.10), 0 18px 48px rgba(18, 52, 103, 0.18);
  backdrop-filter: blur(22px);
}

.nav-button,
.sound-button,
.ghost-button,
.primary-button,
.secondary-button,
.choice-button {
  border: 0;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease, background 140ms ease, opacity 140ms ease;
}

.nav-button:active,
.sound-button:active,
.ghost-button:active,
.primary-button:active,
.secondary-button:active,
.choice-button:active {
  transform: translateY(3px) scale(0.99);
}

.nav-button {
  display: grid;
  gap: 2px;
  padding: 9px 6px;
  border: 2px solid transparent;
  border-radius: 15px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 800;
}
.nav-button .nav-icon { font-size: 19px; line-height: 1; }
.nav-button.active {
  border-color: var(--ink);
  color: #ffffff;
  background: var(--blue);
  box-shadow: 0 4px 0 var(--blue-deep);
}
.nav-button.active .nav-icon { filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.18)); }

main { display: block; }

.screen-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin: 22px 0 20px;
}
.screen-head h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.045em;
}
.eyebrow {
  display: inline-block;
  margin-bottom: 9px;
  padding: 4px 8px;
  border: 2px solid var(--ink);
  border-radius: 7px;
  color: var(--ink);
  background: var(--lime);
  box-shadow: 3px 3px 0 rgba(11, 27, 58, 0.12);
  font-family: "Arial Black", "Microsoft YaHei", sans-serif;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.10em;
}
.screen-head p,
.section-copy,
.muted { color: var(--muted); }
.screen-head p {
  max-width: 670px;
  margin: 9px 0 0;
  line-height: 1.7;
}

.primary-button,
.secondary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 12px 19px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  font-weight: 900;
}
.primary-button {
  color: #ffffff;
  background: var(--blue);
  box-shadow: 0 5px 0 var(--blue-deep);
}
.primary-button:hover { background: #2e87ad; }
.secondary-button {
  color: var(--ink);
  background: var(--yellow);
  box-shadow: 0 5px 0 #c88e00;
}
.secondary-button:hover { background: #ffe16c; }
.ghost-button {
  color: var(--ink);
  background: #ffffff;
  box-shadow: 0 5px 0 #c6d5ea;
}
.ghost-button:hover { background: var(--panel-blue); }
.primary-button:disabled,
.secondary-button:disabled,
.ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  box-shadow: none;
}

.hero-panel {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(240px, 0.6fr);
  gap: 24px;
  padding: clamp(25px, 5vw, 44px);
  border: 3px solid var(--ink);
  border-radius: var(--radius-xl);
  color: #ffffff;
  background:
    linear-gradient(115deg, rgba(255,255,255,0.06) 0 2px, transparent 2px 18px),
    linear-gradient(135deg, #235e79, #2a8190 64%, #48a297);
  background-size: 18px 18px, auto;
  box-shadow: 10px 11px 0 rgba(20, 36, 58, 0.11);
}
.hero-panel::before {
  position: absolute;
  top: -85px;
  right: 27%;
  width: 170px;
  height: 170px;
  border: 22px solid rgba(200, 255, 61, 0.22);
  border-radius: 50%;
  content: "";
}
.hero-panel::after {
  position: absolute;
  right: -80px;
  bottom: -105px;
  width: 290px;
  height: 290px;
  border-radius: 50%;
  background: rgba(255, 212, 59, 0.23);
  content: "";
}
.hero-copy { position: relative; z-index: 1; }
.hero-copy .eyebrow {
  border-color: #ffffff;
  color: var(--ink);
  background: var(--lime);
  box-shadow: 3px 3px 0 rgba(5, 29, 90, 0.28);
}
.hero-copy h2 {
  max-width: 650px;
  margin: 9px 0 14px;
  font-size: clamp(29px, 4.4vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.05em;
}
.hero-copy p {
  max-width: 650px;
  margin: 0;
  color: #e8f3f1;
  line-height: 1.8;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 25px;
}
.hero-panel .primary-button {
  color: var(--ink);
  background: var(--lime);
  box-shadow: 0 5px 0 #749d00;
}
.hero-panel .secondary-button {
  border-color: #ffffff;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 5px 0 rgba(5, 28, 86, 0.35);
}

.hero-orbit {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 230px;
}
.hero-orbit::before,
.hero-orbit::after {
  position: absolute;
  width: 190px;
  height: 190px;
  border: 2px dashed rgba(255, 255, 255, 0.45);
  border-radius: 50%;
  content: "";
  transform: rotate(18deg);
}
.hero-orbit::after {
  width: 226px;
  height: 112px;
  border-style: solid;
  border-color: rgba(200, 255, 61, 0.58);
  transform: rotate(-24deg);
}
.orbit-core {
  position: relative;
  z-index: 2;
  display: grid;
  width: 142px;
  height: 142px;
  place-items: center;
  border: 4px solid var(--ink);
  border-radius: 50%;
  color: var(--ink);
  background: var(--lime);
  box-shadow: 8px 9px 0 rgba(5, 29, 90, 0.33), inset -9px -10px 0 rgba(116, 157, 0, 0.18);
  font-family: "Arial Black", "Microsoft YaHei", sans-serif;
  font-size: 55px;
  font-weight: 900;
}
.orbit-note {
  position: relative;
  z-index: 2;
  margin-top: 21px;
  padding: 6px 11px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  background: #ffffff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 28px;
}
.metric-card,
.panel,
.batch-card,
.element-card,
.question-card,
.result-card {
  border: 2px solid var(--ink);
  background: var(--panel);
  box-shadow: var(--shadow-pop), var(--shadow);
}
.metric-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border-radius: var(--radius-md);
}
.metric-card::before {
  position: absolute;
  inset: 0 0 auto;
  height: 6px;
  background: var(--blue);
  content: "";
}
.metric-card:nth-child(2)::before { background: var(--lime); }
.metric-card:nth-child(3)::before { background: var(--orange); }
.metric-card:nth-child(4)::before { background: var(--cyan); }
.metric-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.metric-value {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-family: "Arial Black", "Microsoft YaHei", sans-serif;
  font-size: 27px;
  font-weight: 900;
  letter-spacing: -0.04em;
}
.metric-value small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
}

.section { margin-top: 34px; }
.section-title-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 15px;
}
.section-title-row h2 {
  margin: 0;
  font-size: 23px;
  letter-spacing: -0.025em;
}
.section-title-row p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.batch-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
}
.batch-card {
  position: relative;
  overflow: hidden;
  padding: 17px;
  border-radius: var(--radius-lg);
}
.batch-card::before {
  position: absolute;
  inset: 0 0 auto;
  height: 7px;
  background: var(--blue);
  content: "";
}
.batch-card:nth-child(6n+2)::before { background: var(--orange); }
.batch-card:nth-child(6n+3)::before { background: var(--green); }
.batch-card:nth-child(6n+4)::before { background: var(--cyan); }
.batch-card:nth-child(6n+5)::before { background: var(--yellow); }
.batch-card:nth-child(6n+6)::before { background: #7b61ff; }
.batch-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 13px;
}
.batch-card h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.8;
}
.batch-status {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.batch-status.done { color: var(--green); }
.element-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}
.element-tile {
  position: relative;
  display: grid;
  min-width: 0;
  aspect-ratio: 0.86;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: #f7faff;
  cursor: pointer;
  box-shadow: 0 3px 0 #d8e4f6;
}
.element-tile:hover {
  border-color: var(--blue);
  background: #eaf2ff;
  transform: translateY(-2px);
}
.element-tile .tile-symbol {
  font-family: "Arial Black", "Microsoft YaHei", sans-serif;
  font-size: clamp(18px, 3vw, 25px);
  font-weight: 900;
}
.element-tile .tile-name {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.element-tile .tile-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border: 1px solid rgba(11, 27, 58, 0.24);
  border-radius: 50%;
  background: #cdd9ea;
}
.element-tile[data-mastery="1"] { background: #fff5d8; }
.element-tile[data-mastery="1"] .tile-dot { background: var(--yellow); }
.element-tile[data-mastery="2"] { background: #ddfbec; }
.element-tile[data-mastery="2"] .tile-dot { background: var(--green); }
.element-tile[data-mastery="3"] {
  border-color: var(--blue);
  background: #e8efff;
  box-shadow: 0 3px 0 #afc7ff;
}
.element-tile[data-mastery="3"] .tile-dot {
  background: var(--blue);
  box-shadow: 0 0 0 3px rgba(19, 93, 255, 0.18);
}

.progress-two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 16px;
}
.panel {
  padding: 22px;
  border-radius: var(--radius-lg);
}
.panel h2,
.panel h3 { margin: 0; }
.panel h3 { font-size: 18px; }
.mastery-list {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}
.mastery-row { display: grid; gap: 8px; }
.mastery-meta {
  display: flex;
  justify-content: space-between;
  color: var(--soft);
  font-size: 13px;
  font-weight: 700;
}
.mastery-bar,
.session-progress {
  overflow: hidden;
  height: 10px;
  border: 1px solid #c5d5ee;
  border-radius: 999px;
  background: #e8effa;
}
.mastery-bar span,
.session-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  transition: width 300ms ease;
}
.history-list { display: grid; gap: 10px; margin-top: 16px; }
.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.history-item:last-child { border-bottom: 0; }
.history-item strong { display: block; font-size: 14px; }
.history-item small { color: var(--muted); }
.history-score {
  color: var(--blue);
  font-family: "Arial Black", "Microsoft YaHei", sans-serif;
  font-size: 22px;
  font-weight: 900;
}
.empty-state {
  padding: 28px 12px;
  color: var(--muted);
  text-align: center;
  line-height: 1.7;
}

.session-shell { width: min(790px, 100%); margin: 8px auto 0; }
.session-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 15px;
}
.session-label { color: var(--soft); font-size: 13px; font-weight: 900; }
.session-progress { height: 9px; margin-bottom: 22px; }
.learn-stage,
.question-stage,
.result-stage { animation: fade-rise 220ms ease both; }

.learn-card {
  position: relative;
  min-height: 430px;
  padding: clamp(24px, 6vw, 52px);
  border: 3px solid var(--ink);
  border-radius: var(--radius-xl);
  cursor: pointer;
  box-shadow: 10px 11px 0 rgba(20, 36, 58, 0.11);
}
.learn-card[data-card-side="front"] {
  color: #ffffff;
  background:
    radial-gradient(circle at 85% 12%, rgba(200, 255, 61, 0.34), transparent 170px),
    linear-gradient(145deg, #235e79, #2a8190 62%, #48a297);
}
.learn-card[data-card-side="back"] { color: var(--ink); background: #ffffff; }
.learn-card .flip-hint {
  position: absolute;
  right: 24px;
  bottom: 22px;
  padding: 5px 9px;
  border: 2px solid currentColor;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  opacity: 0.82;
}
.learn-front,
.learn-back {
  display: grid;
  min-height: 330px;
  align-content: center;
}
.learn-front { justify-items: center; text-align: center; }
.learn-symbol {
  color: var(--lime);
  font-family: "Arial Black", "Microsoft YaHei", sans-serif;
  font-size: clamp(88px, 18vw, 150px);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.08em;
  text-shadow: 7px 7px 0 rgba(5, 29, 90, 0.28);
}
.learn-sequence {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin-top: 32px;
  color: #ffffff;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0;
}
.learn-sequence small {
  color: #dbe9ff;
  font-size: 12px;
  letter-spacing: 0.16em;
}
.learn-sequence strong {
  font-size: clamp(23px, 6vw, 34px);
  letter-spacing: 0.12em;
}
.learn-back h2 { margin: 0; font-size: clamp(36px, 8vw, 64px); }
.learn-back .pinyin { margin: 8px 0 24px; color: var(--blue); font-size: 22px; font-weight: 800; }
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.detail-box {
  padding: 15px;
  border: 2px solid var(--line);
  border-radius: 15px;
  background: #f7faff;
}
.detail-box span,
.detail-box strong { display: block; }
.detail-box span { color: var(--muted); font-size: 11px; font-weight: 800; }
.detail-box strong { margin-top: 6px; font-size: 17px; }
.memory-note {
  margin-top: 14px;
  padding: 15px;
  border: 2px solid #edc34b;
  border-left: 7px solid var(--orange);
  border-radius: 7px 15px 15px 7px;
  color: #4b3410;
  background: #fff6cf;
  line-height: 1.7;
}
.memory-note b { color: #8b4d00; }
.learn-actions,
.question-actions,
.result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

.question-card {
  position: relative;
  overflow: hidden;
  padding: clamp(22px, 5vw, 42px);
  border-radius: var(--radius-xl);
}
.question-card::before {
  position: absolute;
  inset: 0 0 auto;
  height: 8px;
  background: linear-gradient(90deg, var(--blue), var(--cyan), var(--lime));
  content: "";
}
.question-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.category-tag {
  padding: 6px 10px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  color: #ffffff;
  background: var(--blue);
  font-weight: 900;
}
.question-prompt {
  margin: 0 0 26px;
  color: var(--ink);
  font-size: clamp(24px, 5vw, 38px);
  line-height: 1.35;
  letter-spacing: -0.025em;
}
.question-focus { color: var(--blue); font-weight: 900; }
.choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.choice-button {
  min-height: 78px;
  padding: 16px;
  border: 2px solid #c8d8f0;
  border-radius: 18px;
  color: var(--ink);
  background: #f4f8ff;
  box-shadow: 0 4px 0 #c8d8f0;
  font-size: 18px;
  font-weight: 900;
}
.choice-button:hover:not(:disabled) {
  border-color: var(--blue);
  background: #e5f1f1;
  box-shadow: 0 4px 0 #9fcbd0;
}
.choice-button.correct {
  border-color: var(--green);
  color: #003c2c;
  background: #c8ffe9;
  box-shadow: 0 4px 0 #77dcb7;
}
.choice-button.wrong {
  border-color: var(--red-deep);
  color: #7a0d26;
  background: #ffe0e6;
  box-shadow: 0 4px 0 #efa0af;
}
.choice-button:disabled { cursor: default; }
.input-row { display: flex; gap: 12px; }
.input-row input {
  min-width: 0;
  flex: 1;
  padding: 15px 17px;
  border: 3px solid var(--blue);
  border-radius: 16px;
  color: var(--ink);
  background: #ffffff;
  box-shadow: inset 0 -4px 0 #e6efff;
  font-size: 22px;
  font-weight: 900;
}
.input-row input::placeholder { color: #8b9bb2; font-size: 15px; font-weight: 600; }
.feedback-panel {
  margin-top: 18px;
  padding: 16px 17px;
  border: 2px solid var(--line);
  border-radius: 17px;
  background: #f7faff;
  animation: fade-rise 180ms ease both;
}
.feedback-panel.correct { border-color: var(--green); background: #dffdf2; }
.feedback-panel.wrong { border-color: var(--red); background: #fff0f3; }
.feedback-title { margin: 0; font-size: 18px; }
.feedback-copy { margin: 8px 0 0; color: var(--soft); line-height: 1.7; }

.result-card {
  position: relative;
  overflow: hidden;
  padding: clamp(24px, 5vw, 42px);
  border-radius: var(--radius-xl);
}
.result-card::before {
  position: absolute;
  inset: 0 0 auto;
  height: 9px;
  background: linear-gradient(90deg, var(--blue), var(--cyan), var(--lime), var(--orange));
  content: "";
}
.result-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
}
.result-score {
  color: var(--blue);
  font-family: "Arial Black", "Microsoft YaHei", sans-serif;
  font-size: clamp(72px, 15vw, 120px);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.07em;
}
.result-score small { color: var(--muted); font-size: 21px; }
.result-copy h2 { margin: 0 0 8px; font-size: 30px; }
.result-copy p { margin: 0; color: var(--soft); line-height: 1.7; }
.result-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 26px;
}
.result-stat {
  padding: 15px;
  border: 2px solid var(--line);
  border-radius: 15px;
  background: #f7faff;
}
.result-stat span,
.result-stat strong { display: block; }
.result-stat span { color: var(--muted); font-size: 11px; font-weight: 800; }
.result-stat strong { margin-top: 7px; font-size: 19px; }
.poster-wrap {
  margin-top: 24px;
  padding: 12px;
  border: 2px dashed #a9c2e7;
  border-radius: 22px;
  background: #eef5ff;
}
.poster-preview {
  display: block;
  width: min(100%, 380px);
  margin: 0 auto;
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(18, 52, 103, 0.20);
}
.review-list { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 12px; }
.review-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border: 2px solid var(--orange);
  border-radius: 999px;
  color: #7a3d00;
  background: #fff1d8;
  font-size: 13px;
  font-weight: 800;
}

.modal-backdrop {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(11, 27, 58, 0.52);
  backdrop-filter: blur(12px);
}
.modal {
  width: min(520px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  overflow: auto;
  padding: 25px;
  border: 3px solid var(--ink);
  border-radius: 26px;
  background: #ffffff;
  box-shadow: 10px 11px 0 rgba(11, 27, 58, 0.18);
  animation: fade-rise 180ms ease both;
}
.modal h2,
.modal h3,
.modal p { margin-top: 0; }
.modal-close { float: right; }
.element-detail-symbol {
  margin: 2px 0 4px;
  color: var(--blue);
  font-family: "Arial Black", "Microsoft YaHei", sans-serif;
  font-size: 58px;
  font-weight: 900;
  line-height: 1;
}
.element-detail-name { margin: 0 0 8px; font-size: 25px; }
.element-detail-pinyin { color: var(--orange); font-weight: 800; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.danger-button {
  border-color: var(--red-deep) !important;
  color: #790b24 !important;
  background: #ffe2e8 !important;
  box-shadow: 0 5px 0 #e99bad !important;
}

.toast-stack {
  position: fixed;
  z-index: 100;
  top: 82px;
  right: 18px;
  display: grid;
  gap: 8px;
  width: min(330px, calc(100vw - 36px));
  pointer-events: none;
}
.toast {
  padding: 13px 15px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  color: var(--ink);
  background: #ffffff;
  box-shadow: 5px 6px 0 rgba(11, 27, 58, 0.14);
  animation: fade-rise 180ms ease both;
}
.sr-only {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  margin: -1px;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@keyframes fade-rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.review-hub {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr);
  gap: 22px;
  margin: 16px 0 28px;
  padding: clamp(20px, 4vw, 30px);
  border: 3px solid var(--ink);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 88% 18%, rgba(255, 138, 31, 0.13), transparent 220px),
    #ffffff;
  box-shadow: 7px 8px 0 rgba(11, 27, 58, 0.10), var(--shadow);
}
.review-hub h2 { margin: 0 0 8px; font-size: 24px; }
.review-hub p { margin: 0; color: var(--soft); line-height: 1.75; }
.review-hub-actions { display: grid; align-content: center; gap: 10px; }
.next-review {
  padding: 14px 16px;
  border: 2px solid #e4b83c;
  border-radius: 15px;
  background: #fff8df;
}
.next-review small,
.next-review strong { display: block; }
.next-review small { color: var(--muted); font-size: 11px; font-weight: 800; }
.next-review strong { margin-top: 5px; color: #8b4d00; font-size: 17px; }
.ebbinghaus-track {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  margin-top: 18px;
}
.ebbinghaus-track span {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 10px 5px;
  border: 2px solid #cbdaf1;
  border-radius: 12px;
  text-align: center;
  background: #f4f8ff;
}
.ebbinghaus-track b { color: var(--blue); font-size: 13px; }
.ebbinghaus-track small { color: var(--muted); font-size: 10px; }
.calendar-list { display: grid; gap: 9px; margin: 18px 0; }
.calendar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #f7faff;
}
.calendar-row strong { color: var(--blue); font-size: 14px; }
.calendar-row span { color: var(--muted); font-size: 13px; text-align: right; }

ruby { ruby-position: over; ruby-align: center; }
ruby rt {
  color: var(--orange);
  font-size: 0.58em;
  font-weight: 800;
  letter-spacing: 0;
}
.batch-homophone {
  margin: -2px 0 13px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.batch-homophone b { color: #9a4b00; font-size: 14px; letter-spacing: 0.06em; }
.homophone-ruby {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  color: inherit;
  font-size: 15px;
  font-weight: 700;
}
.homophone-ruby ruby { padding: 0 2px; }
.learn-card[data-card-side="front"] ruby rt { color: var(--yellow); }
.review-chip ruby rt { color: #b85400; }
.memory-ruby { justify-content: flex-start; margin: 9px 0; font-size: 14px; }

@media (max-width: 900px) {
  .batch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .progress-two-col { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .app-shell { padding: 0 14px 104px; }
  .topbar { padding: 12px 0 10px; }
  .topbar { gap: 8px; }
  .brand { gap: 8px; }
  .brand-copy strong { font-size: 16px; }
  .brand-copy span,
  .sound-label { display: none; }
  .brand-mark { width: 43px; height: 43px; border-radius: 13px 13px 13px 5px; }
  .sound-button { min-height: 38px; padding: 7px 10px; }
  .streak-chip { padding: 8px 9px; font-size: 12px; }
  .screen-head { display: block; margin: 8px 0 14px; }
  .screen-head h1 { font-size: clamp(28px, 8vw, 36px); line-height: 1.08; }
  .screen-head p { margin-top: 7px; font-size: 14px; line-height: 1.62; }
  .screen-head .primary-button,
  .screen-head .secondary-button { margin-top: 12px; }
  .hero-panel { grid-template-columns: 1fr; gap: 0; padding: 20px 18px; }
  .hero-copy > .eyebrow { display: none; }
  .hero-copy h2 { margin: 7px 0 10px; font-size: 30px; line-height: 1.08; }
  .hero-copy p { font-size: 14px; line-height: 1.66; }
  .hero-actions { display: grid; gap: 10px; margin-top: 18px; }
  .hero-actions > .primary-button,
  .hero-actions > .secondary-button { width: 100%; }
  .hero-actions > .secondary-button { display: none; }
  .hero-orbit { display: none; }
  .metric-grid,
  .result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-grid { gap: 10px; margin: 14px 0 22px; }
  .metric-card { padding: 14px; }
  .metric-value { font-size: 24px; }
  .batch-grid { grid-template-columns: 1fr; }
  .learn-card { min-height: 390px; padding: 22px; }
  .learn-front,
  .learn-back { min-height: 300px; }
  .choices { grid-template-columns: 1fr; }
  .choice-button { min-height: 62px; }
  .input-row,
  .result-hero { display: grid; grid-template-columns: 1fr; }
  .result-score { text-align: left; }
  .review-hub { grid-template-columns: 1fr; }
  .ebbinghaus-track { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .calendar-row { align-items: flex-start; flex-direction: column; }
  .calendar-row span { text-align: left; }
}

@media (max-width: 390px) {
  .element-row { gap: 5px; }
  .element-tile { border-radius: 10px; }
  .element-tile .tile-name { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.bottom-nav[hidden] { display: none; }

