/* 涵涵数学 · 界面样式
 * 蛋仔派对风：奶油粉、糖果粉、莓果紫；圆润、亮面、少量实体投影。
 */
:root {
  --bg: #fff1f8;
  --bg-dots: #ffd9ea;
  --surface: #ffffff;
  --surface-2: #fff8fc;
  --ink: #4a263c;
  --ink-soft: #653a53;
  --muted: #7a5668;
  --line: #ffd9e8;
  --line-strong: #ffc3dd;
  --pink: #e23b86;
  --pink-dark: #a81f5e;
  --pink-deep: #781343;
  --pink-soft: #ffe3f0;
  --pink-tint: #fff3f9;
  --green: #e23b86;
  --green-dark: #a81f5e;
  --green-deep: #781343;
  --green-soft: #ffe3f0;
  --green-tint: #fff3f9;
  --mint: #24b58e;
  --mint-dark: #147a5f;
  --mint-soft: #e3faf2;
  --mint-tint: #f2fcf8;
  --yellow: #ffc83d;
  --yellow-soft: #fff3c9;
  --yellow-deep: #a96f12;
  --coral: #e8574f;
  --coral-strong: #b93a34;
  --coral-soft: #ffe7e4;
  --sky: #5fb7d8;
  --sky-soft: #eaf8fd;
  --purple: #9678d6;
  --purple-soft: #f2ebff;
  --radius-xl: 38px;
  --radius-lg: 30px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --shadow: 0 14px 34px rgba(196, 45, 114, 0.12);
  --shadow-sm: 0 5px 16px rgba(196, 45, 114, 0.08);
  --font: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  --font-display: "Yuanti SC", "YouYuan", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --ease-out: cubic-bezier(0.22, 0.8, 0.24, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(var(--bg-dots) 1.5px, transparent 1.5px),
    radial-gradient(circle at 8% -4%, #ffe0ef 0, transparent 36%),
    radial-gradient(circle at 94% 14%, #fff4d6 0, transparent 32%);
  background-size: 28px 28px, 100% 100%, 100% 100%;
  background-attachment: fixed;
  font-family: var(--font);
  font-size: 15.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.modal-open {
  overflow: hidden;
}

h1,
h2,
h3,
p,
ul,
ol,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

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

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
}

img,
svg {
  max-width: 100%;
}

.icon {
  display: inline-block;
  flex: none;
  vertical-align: -0.18em;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  transform: translateY(-160%);
  transition: transform 0.2s var(--ease-out);
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid rgba(226, 59, 134, 0.3);
  outline-offset: 2px;
}

/* ---------------- 顶栏 ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 249, 237, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.topbar-inner {
  width: min(1120px, calc(100% - 48px));
  height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex: none;
  border-radius: 14px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
}

.brand-mark svg {
  display: block;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 12px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14.5px;
  font-weight: 600;
  transition: background-color 0.18s var(--ease-out), color 0.18s var(--ease-out);
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.75);
  color: var(--ink);
}

.nav-link.is-active {
  background: var(--green-soft);
  color: var(--green-dark);
}

.nav-link.is-active .icon {
  color: var(--green);
}

.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.grade-picker {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.grade-picker select {
  appearance: none;
  -webkit-appearance: none;
  height: 40px;
  padding: 0 36px 0 16px;
  border: 1.5px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.grade-picker select:hover {
  border-color: var(--green);
}

.select-chevron {
  position: absolute;
  right: 13px;
  pointer-events: none;
  color: var(--muted);
  transform: rotate(90deg);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1.5px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  transition: background-color 0.18s var(--ease-out), color 0.18s var(--ease-out);
}

.icon-btn:hover {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}

.icon-btn.is-active {
  background: var(--green-soft);
  color: var(--green-dark);
}

/* 专注练习时收起导航与年级，减少干扰 */
.focus-mode .main-nav,
.focus-mode .grade-picker {
  display: none;
}

/* ---------------- 页面骨架 ---------------- */
.view {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 34px 0 80px;
  animation: view-in 0.35s var(--ease-out) both;
}

.view:focus,
.view:focus-visible {
  outline: none;
}

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

.page-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

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

.section-title {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.muted {
  color: var(--muted);
  font-size: 13.5px;
}

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

.section-head h2 {
  font-size: 19px;
  font-weight: 800;
}

/* ---------------- 按钮与标签 ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 22px;
  border: 0;
  border-radius: 16px;
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  transition: transform 0.12s var(--ease-out), box-shadow 0.12s var(--ease-out), background-color 0.18s var(--ease-out);
}

.btn-primary {
  background: var(--green);
  color: #fff;
  box-shadow: 0 5px 0 var(--green-dark);
}

.btn-primary:hover {
  background: #1c8a59;
  transform: translateY(-1px);
  box-shadow: 0 6px 0 var(--green-dark);
}

.btn-primary:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 var(--green-dark);
}

.btn-secondary {
  background: var(--surface);
  color: var(--green-dark);
  border: 1.5px solid #cfe7d8;
  box-shadow: 0 3px 0 #e3f0e7;
}

.btn-secondary:hover {
  background: var(--green-tint);
  transform: translateY(-1px);
}

.btn-secondary:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #e3f0e7;
}

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1.5px solid var(--line-strong);
}

.btn-ghost:hover {
  background: var(--surface);
}

.btn-danger {
  background: var(--coral);
  color: #fff;
  box-shadow: 0 4px 0 var(--coral-strong);
}

.btn-danger:hover {
  background: #d75a44;
  transform: translateY(-1px);
}

.btn-danger:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--coral-strong);
}

.btn-sm {
  min-height: 40px;
  padding: 9px 16px;
  border-radius: 13px;
  font-size: 14px;
}

.btn-hero {
  margin-top: 22px;
  padding: 15px 28px;
  border-radius: 18px;
  font-size: 17px;
}

.btn:focus-visible {
  outline-offset: 3px;
}

.text-link {
  display: inline-flex;
  align-items: center;
  padding: 0;
  border: 0;
  background: none;
  color: var(--green-dark);
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(226, 59, 134, 0.35);
  text-underline-offset: 3px;
  cursor: pointer;
}

.text-link:hover {
  color: var(--green);
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 12px;
  border: 1px solid #d8ecdd;
  border-radius: 999px;
  background: var(--green-tint);
  color: var(--green-dark);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.grade-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(220, 197, 141, 0.6);
  color: var(--yellow-deep);
  font-size: 12.5px;
  font-weight: 800;
}

.ai-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 4px 12px;
  border-radius: 999px;
  background: #edf6ff;
  border: 1px solid #d4e6f7;
  color: #2e6b8e;
  font-size: 12px;
  font-weight: 700;
}

/* ---------------- 蛋仔糖果进度 ---------------- */
.egg-row {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.egg {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 30px;
  transition: transform 0.2s var(--ease-spring);
}

.egg svg {
  display: block;
  width: 24px;
  height: 28px;
}

.egg.is-current {
  transform: translateY(-2px) scale(1.08);
}

.egg.is-ok {
  animation: egg-pop 0.32s var(--ease-spring) both;
}

@keyframes egg-pop {
  0% {
    transform: scale(0.6) rotate(-8deg);
  }
  70% {
    transform: scale(1.16) rotate(3deg);
  }
  100% {
    transform: scale(1) rotate(0);
  }
}

.difficulty {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  margin-left: auto;
  border-radius: 999px;
  background: #fffaf0;
  border: 1px solid #f0e2c2;
  padding: 3px 9px;
}

.difficulty-label {
  margin-right: 2px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
}

.level-star {
  display: inline-grid;
  place-items: center;
  width: 13px;
  height: 16px;
  opacity: 0.55;
}

.level-star.is-on {
  opacity: 1;
}

.level-star svg {
  width: 12px;
  height: 15px;
}

/* ---------------- 今日 ---------------- */
.home-view {
  padding-top: 28px;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 24px;
  align-items: center;
  padding: 40px 44px;
  border: 1.5px solid #f0dfb8;
  border-radius: var(--radius-xl);
  background: #fff4d6;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.hero::before {
  width: 260px;
  height: 260px;
  right: -70px;
  top: -120px;
  background: rgba(255, 255, 255, 0.42);
}

.hero::after {
  width: 160px;
  height: 160px;
  left: 44%;
  bottom: -104px;
  background: rgba(246, 196, 69, 0.16);
}

.hero-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(30px, 3.6vw, 44px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.hero-meta {
  margin-top: 10px;
  color: #6d5a37;
  font-size: 14.5px;
  font-weight: 500;
}

.hero .egg-row {
  margin-top: 16px;
}

.hero-art {
  position: relative;
  z-index: 1;
  justify-self: center;
  width: min(250px, 100%);
  display: grid;
  place-items: center;
}

.hero-art .mascot-svg {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 10px 16px rgba(79, 96, 60, 0.12));
  animation: mascot-float 4.2s ease-in-out infinite;
}

.hero-art .plant-svg {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 10px 16px rgba(79, 96, 60, 0.12));
  transform-origin: 50% 96%;
  animation: plant-sway 5.2s ease-in-out infinite;
}

@keyframes plant-sway {
  0%,
  100% {
    transform: rotate(-0.8deg);
  }
  50% {
    transform: rotate(1.2deg);
  }
}

@keyframes mascot-float {
  0%,
  100% {
    transform: translateY(0) rotate(-1deg);
  }
  50% {
    transform: translateY(-7px) rotate(1deg);
  }
}

.hero-spark {
  position: absolute;
  color: var(--yellow-deep);
  opacity: 0.75;
}

.hero-spark-a {
  right: 4%;
  top: 8%;
}

.hero-spark-b {
  left: 0;
  bottom: 14%;
  color: var(--green);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.stat-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
  padding: 17px 20px;
  border: 1.5px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.stat-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 15px;
}

.stat-icon.is-green {
  background: var(--green-soft);
  color: var(--green-dark);
}

.stat-icon.is-yellow {
  background: var(--yellow-soft);
  color: var(--yellow-deep);
}

.stat-icon.is-blue {
  background: var(--sky-soft);
  color: #2e7095;
}

.stat-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}

.stat-body strong {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.stat-body small {
  margin-left: 2px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
}

.stat-body span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
}

.stat-empty {
  display: inline-block;
  padding-top: 4px;
  color: var(--muted) !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em;
}

.topic-block {
  margin-top: 30px;
}

.topic-block .section-title {
  margin-bottom: 0;
}

.topic-block .chip-row {
  margin-top: 12px;
}

.print-link {
  flex: none;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
}

.print-link:hover {
  color: var(--green-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------------- 练习 ---------------- */
.practice-view {
  max-width: 1000px;
  padding-top: 24px;
}

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

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  min-height: 40px;
  padding: 8px 10px 8px 6px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  transition: background-color 0.18s var(--ease-out), color 0.18s var(--ease-out);
}

.back-btn:hover {
  background: var(--surface);
  color: var(--ink);
}

.practice-step {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.step-count {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-soft);
  white-space: nowrap;
}

.practice-step .egg-row {
  gap: 3px;
}

.practice-step .egg {
  width: 18px;
  height: 21px;
}

.practice-step .egg svg {
  width: 17px;
  height: 20px;
}

.qcard {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
  padding: 28px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.q-art {
  display: grid;
  place-items: center;
  min-height: 280px;
  padding: 16px;
  border-radius: 24px;
  background: var(--green-tint);
  border: 1px solid #e1f1e7;
}

.q-art .art-svg {
  width: 100%;
  max-width: 320px;
  height: auto;
  display: block;
}

.q-main {
  min-width: 0;
  padding-top: 4px;
}

.q-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.q-text {
  margin: 16px 0 22px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.66;
  letter-spacing: 0.005em;
  text-wrap: pretty;
}

.answer-form {
  border-top: 1px dashed var(--line-strong);
  padding-top: 20px;
}

.answer-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 700;
}

.answer-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.answer-box {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 60px;
  min-width: 190px;
  padding: 0 18px;
  border: 2px solid var(--line-strong);
  border-radius: 16px;
  background: var(--surface-2);
  transition: border-color 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out);
}

.answer-box:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(226, 59, 134, 0.12);
  background: #fff;
}

.answer-input {
  width: 140px;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-size: 27px;
  font-weight: 800;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.answer-input::placeholder {
  color: #73877b;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.answer-unit {
  color: var(--muted);
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
}

.answer-form .btn {
  height: 60px;
  padding: 0 26px;
  border-radius: 16px;
  font-size: 16px;
}

.hint-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 42px;
  margin-left: 2px;
  padding: 0 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--green-dark);
  font-size: 13.5px;
  font-weight: 700;
}

.hint-btn:hover {
  background: var(--green-soft);
}

.field-error {
  margin-top: 9px;
  color: var(--coral-strong);
  font-size: 13.5px;
  font-weight: 600;
}

.is-shaking {
  animation: shake 0.38s var(--ease-out) both;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-6px);
  }
  40% {
    transform: translateX(5px);
  }
  60% {
    transform: translateX(-3px);
  }
  80% {
    transform: translateX(2px);
  }
}

.hint-panel {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
  padding: 14px 16px;
  border: 1.5px solid #f1e0b2;
  border-radius: 16px;
  background: #fff8e2;
  animation: panel-in 0.22s var(--ease-out) both;
}

.hint-panel[hidden] {
  display: none;
}

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

.hint-label {
  flex: none;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--yellow-soft);
  color: var(--yellow-deep);
  font-size: 12px;
  font-weight: 800;
}

.hint-panel p {
  color: #6d5a37;
  font-size: 14.5px;
  line-height: 1.65;
}

.feedback {
  margin-top: 4px;
  padding: 20px;
  border: 1.5px solid #cfe8d8;
  border-radius: 22px;
  background: var(--green-tint);
  animation: feedback-in 0.28s var(--ease-out) both;
}

.feedback.is-wrong {
  border-color: #f2c9bd;
  background: #fff0ec;
}

@keyframes feedback-in {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.995);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.feedback-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.feedback-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 54px;
  height: 54px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--mint-dark);
}

.feedback-icon .egg-face-svg {
  display: block;
  width: 100%;
  height: 100%;
  animation: face-pop 0.36s var(--ease-spring) both;
}

@keyframes face-pop {
  0% {
    transform: scale(0.5) rotate(-8deg);
    opacity: 0;
  }
  70% {
    transform: scale(1.08) rotate(3deg);
    opacity: 1;
  }
  100% {
    transform: scale(1) rotate(0);
  }
}

.feedback.is-wrong .feedback-icon {
  color: var(--coral);
  border-color: transparent;
}

.feedback-head h2 {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.35;
}

.feedback-line {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.65;
}

.feedback-line b {
  font-size: 16px;
  font-weight: 800;
}

.solution {
  margin: 14px 0;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.solution-steps {
  counter-reset: step;
}

.solution-steps li {
  position: relative;
  padding-left: 22px;
  color: var(--ink-soft);
  font-size: 15.5px;
  line-height: 1.8;
  font-variant-numeric: tabular-nums;
}

.solution-steps li::before {
  counter-increment: step;
  content: counter(step) ".";
  position: absolute;
  left: 0;
  color: var(--green);
  font-weight: 800;
}

.feedback.is-wrong .solution-steps li::before {
  color: var(--coral);
}

.feedback-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.ai-btn {
  border-color: #cfe1f2;
  color: #2e6b8e;
  background: #f6fbff;
}

.ai-box {
  margin: 12px 0;
  padding: 13px 15px;
  border: 1.5px solid #d7e8f6;
  border-radius: 16px;
  background: #f4faff;
  animation: panel-in 0.24s var(--ease-out) both;
}

.ai-box-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  color: #2e6b8e;
  font-size: 13px;
  font-weight: 800;
}

.ai-box p {
  color: #315568;
  font-size: 15.5px;
  line-height: 1.75;
}

.ai-error {
  color: var(--coral-strong) !important;
}

.ai-dots {
  display: flex;
  gap: 5px;
  padding: 6px 2px;
}

.ai-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7fb6d4;
  animation: dot-bounce 1s ease-in-out infinite;
}

.ai-dots span:nth-child(2) {
  animation-delay: 0.14s;
}

.ai-dots span:nth-child(3) {
  animation-delay: 0.28s;
}

@keyframes dot-bounce {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.55;
  }
  50% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

/* ---------------- 结果 ---------------- */
.result-view {
  max-width: 1000px;
}

.result-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 24px;
  align-items: center;
  padding: 34px 40px;
  border: 1.5px solid #d6ecdf;
  border-radius: var(--radius-xl);
  background: var(--green-tint);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.result-hero::before {
  content: "";
  position: absolute;
  width: 300px;
  height: 300px;
  right: -110px;
  top: -150px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
}

.result-copy {
  position: relative;
  z-index: 1;
}

.result-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.result-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  line-height: 1.3;
}

.score-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 2px 0 6px;
}

.score-label {
  align-self: center;
  margin-right: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.score-number {
  color: var(--green-dark);
  font-size: clamp(60px, 8vw, 82px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.score-unit {
  color: var(--green-dark);
  font-size: 20px;
  font-weight: 800;
}

.stars {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 38px;
}

.star {
  width: 34px;
  height: 32px;
  color: #ddd4c1;
  transform: scale(0.92);
}

.star.is-on {
  color: var(--yellow);
  animation: star-pop 0.4s var(--ease-spring) both;
  animation-delay: var(--d, 0ms);
}

@keyframes star-pop {
  0% {
    transform: scale(0.4) rotate(-12deg);
    opacity: 0;
  }
  70% {
    transform: scale(1.16) rotate(4deg);
    opacity: 1;
  }
  100% {
    transform: scale(1) rotate(0);
    opacity: 1;
  }
}

.star svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 2px 0 rgba(41, 69, 53, 0.12));
}

.result-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.result-hero .egg-row {
  margin-top: 12px;
}

.result-print-mini {
  margin-top: 14px;
  background: rgba(255, 255, 255, 0.84);
}

.result-hero .egg {
  width: 28px;
  height: 33px;
}

.result-hero .egg svg {
  width: 26px;
  height: 30px;
}

.result-art {
  position: relative;
  z-index: 1;
  justify-self: center;
  width: min(230px, 100%);
}

.result-art .mascot-svg {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 10px 18px rgba(55, 95, 70, 0.14));
}

.result-art .plant-svg {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 10px 18px rgba(55, 95, 70, 0.14));
}

.result-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.85fr);
  align-items: start;
  gap: 18px;
  margin-top: 20px;
}

.card {
  padding: 24px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.report-head {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 12px;
}

.report-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--green-soft);
}

.report-head > div {
  min-width: 0;
}

.report-head h2 {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.35;
}

.report-sub {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.ai-badge {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 999px;
  background: #edf6ff;
  color: #2e6b8e;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.report-headline {
  margin-bottom: 6px;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.5;
}

.report-text {
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.8;
}

.advice-list {
  display: grid;
  gap: 7px;
  margin: 12px 0;
}

.advice-list li {
  position: relative;
  padding-left: 18px;
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.7;
}

.advice-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 7px;
  height: 7px;
  border-radius: 50% 50% 50% 0;
  background: var(--green);
  transform: rotate(-45deg);
}

.focus-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--yellow-soft);
  color: #6b4c10;
  font-size: 12px;
  font-weight: 700;
}

.report-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line-strong);
  color: var(--coral-strong);
  font-size: 12.5px;
}

.skeleton {
  display: grid;
  gap: 9px;
  padding: 4px 0;
}

.skeleton span {
  height: 11px;
  border-radius: 999px;
  background: linear-gradient(90deg, #f0f4ee 25%, #e3ece2 37%, #f0f4ee 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}

.skeleton span:nth-child(1) {
  width: 42%;
  height: 16px;
}

.skeleton span:nth-child(3) {
  width: 78%;
}

@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: 0 0;
  }
}

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

.breakdown-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
  font-size: 13px;
  font-weight: 600;
}

.breakdown-num {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.mini-track {
  height: 8px;
  border-radius: 999px;
  background: #f3edde;
  overflow: hidden;
}

.mini-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.wrong-section {
  margin-top: 26px;
}

.wrong-item {
  margin-bottom: 10px;
  border: 1.5px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  overflow: hidden;
}

.wrong-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
}

.wrong-item summary::-webkit-details-marker,
.wrong-detail-inline summary::-webkit-details-marker {
  display: none;
}

.wrong-text {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.6;
}

.wrong-answers {
  flex: none;
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
}

.wrong-answers b {
  color: var(--ink);
  font-size: 14px;
}

.wrong-mine {
  color: var(--coral-strong) !important;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.answer-right {
  color: var(--mint-dark) !important;
}

.answer-compare .wrong-mine {
  color: var(--coral-strong) !important;
}

.wrong-open {
  flex: none;
  padding: 4px 9px;
  border-radius: 999px;
  background: #f5eedf;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
}

.wrong-open::after {
  content: " +";
}

.wrong-item[open] .wrong-open {
  background: var(--green-soft);
  color: var(--green-dark);
}

.wrong-item[open] .wrong-open::after {
  content: " −";
}

.wrong-detail {
  padding: 0 18px 16px;
  border-top: 1px dashed var(--line);
}

.wrong-detail .solution-steps {
  margin-top: 10px;
}

.all-right {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
  padding: 20px;
  border: 1.5px dashed #cfe8d8;
  border-radius: 20px;
  background: var(--green-tint);
  color: var(--green-dark);
  font-size: 15px;
  font-weight: 600;
}

.all-right-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  color: var(--green);
}

.result-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 26px;
}

.result-actions .btn {
  min-width: 150px;
}

.print-tip {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}

/* ---------------- 错题本 ---------------- */
.wrong-view {
  max-width: 900px;
}

.tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 18px;
  border-radius: 999px;
  background: #f4ecdb;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 7px 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.tab.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(50, 67, 56, 0.08);
}

.tab-count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 800;
}

.wrong-list {
  display: grid;
  gap: 14px;
}

.wrong-card {
  padding: 20px 22px;
  border: 1.5px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.wrong-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.wrong-date {
  color: var(--muted);
  font-size: 12px;
}

.resolved-badge {
  margin-left: auto;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 800;
}

.wrong-card-text {
  margin: 10px 0 12px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.7;
}

.answer-compare {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  padding: 10px 14px;
  border-radius: 13px;
  background: #fbf6ea;
  color: var(--muted);
  font-size: 12.5px;
}

.answer-compare b {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}
.wrong-detail-inline {
  margin-top: 10px;
  flex: 1;
  min-width: 0;
}

.wrong-card-foot {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-top: 10px;
}

.wrong-card-foot .btn {
  flex: none;
}

.wrong-card-foot .wrong-detail-inline {
  margin-top: 6px;
}

.wrong-detail-inline summary {
  display: inline-flex;
  align-items: center;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.wrong-detail-inline summary::after {
  content: "＋";
  margin-left: 4px;
  font-size: 12px;
}

.wrong-detail-inline[open] summary::after {
  content: "－";
}

.wrong-detail-inline .solution-steps {
  margin-top: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--green-tint);
}

.wrong-card-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 52px 24px 40px;
  text-align: center;
}

.empty-art {
  width: 150px;
  margin-bottom: 10px;
  opacity: 0.95;
}

.empty-art .mascot-svg {
  width: 100%;
  height: auto;
}

.empty-state h2 {
  font-size: 21px;
  font-weight: 800;
}

.empty-state p {
  margin: 8px 0 20px;
  max-width: 360px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

/* ---------------- 学习进度 ---------------- */
.progress-view {
  max-width: 960px;
}

.progress-view .stat-grid {
  margin-top: 20px;
}

.chart-card,
.mastery-card,
.recent-card {
  margin-top: 18px;
}

.chart-card h2,
.mastery-card h2,
.recent-card h2 {
  font-size: 18px;
  font-weight: 800;
}

.week-chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.day-col {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.bar-value {
  height: 15px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.bar-track {
  display: flex;
  align-items: flex-end;
  width: 100%;
  max-width: 52px;
  height: 128px;
  border-radius: 12px;
  background: #fbf7ec;
  box-shadow: inset 0 0 0 1px #f3ecdd;
  overflow: hidden;
}

.bar-fill {
  display: block;
  width: 100%;
  min-height: 0;
  border-radius: 12px;
  background: #9fd6b4;
  transition: height 0.35s var(--ease-out);
}

.day-col.is-today .bar-fill {
  background: var(--green);
}

.day-col.is-today .day-label {
  color: var(--green-dark);
  font-weight: 800;
}

.day-label {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.mastery-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 30px;
  margin-top: 16px;
}

.mastery-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 13.5px;
  font-weight: 600;
}

.mastery-value {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.mastery-track {
  height: 9px;
  border-radius: 999px;
  background: #f3edde;
  overflow: hidden;
}

.mastery-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 0.4s var(--ease-out);
}

.recent-list {
  display: grid;
  margin-top: 6px;
}

.recent-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 13.5px;
}

.recent-list li:last-child {
  border-bottom: 0;
}

.recent-date {
  font-weight: 600;
}

.recent-score {
  color: var(--ink-soft);
}

.empty-line {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13.5px;
}

/* ---------------- 设置 ---------------- */
.settings-view {
  max-width: 760px;
}

.settings-form {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.setting-section h2 {
  font-size: 18px;
  font-weight: 800;
}

.setting-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.field {
  display: block;
  margin-top: 14px;
}

.field > span {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
}

.field input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: 13px;
  background: var(--surface-2);
  font-size: 14.5px;
  transition: border-color 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out);
}

.field input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(226, 59, 134, 0.12);
  background: #fff;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}

.field.span-2 {
  grid-column: 1 / -1;
}

.field-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
}

.test-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.test-status {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.test-status.is-ok {
  color: var(--green-dark);
  font-weight: 600;
}

.test-status.is-bad {
  color: var(--coral-strong);
  font-weight: 600;
}

.switch {
  position: relative;
  display: inline-flex;
  flex: none;
  width: 48px;
  height: 28px;
  cursor: pointer;
}

.switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.switch-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #ded5c3;
  transition: background-color 0.2s var(--ease-out);
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(32, 52, 42, 0.18);
  transition: transform 0.2s var(--ease-out);
}

.switch input:checked + .switch-track {
  background: var(--green);
}

.switch input:checked + .switch-track::after {
  transform: translateX(20px);
}

.switch input:focus-visible + .switch-track {
  outline: 3px solid rgba(226, 59, 134, 0.28);
  outline-offset: 2px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
  color: var(--ink-soft);
  font-size: 14px;
  cursor: pointer;
}

.check input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.danger-section .btn {
  margin-top: 12px;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.form-error {
  margin: 0;
  padding: 12px 14px;
  border: 1.5px solid #f0c1b5;
  border-radius: 13px;
  background: var(--coral-soft);
  color: var(--coral-strong);
  font-size: 13px;
  font-weight: 600;
}

.form-error[hidden] {
  display: none;
}

/* ---------------- 提示与弹窗 ---------------- */
.toast-root {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(92vw, 460px);
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  max-width: 100%;
  padding: 11px 18px;
  border-radius: 14px;
  background: #243b2f;
  color: #fff7e8;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.5;
  box-shadow: 0 10px 28px rgba(24, 40, 31, 0.24);
  animation: toast-in 0.28s var(--ease-spring) both;
}

.toast.is-warn {
  background: #a93a27;
}

.toast.is-out {
  animation: toast-out 0.3s var(--ease-out) both;
}

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

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(6px);
  }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(26, 42, 33, 0.45);
  backdrop-filter: blur(3px);
  animation: fade-in 0.2s var(--ease-out) both;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal {
  width: min(420px, 100%);
  padding: 28px;
  border-radius: 26px;
  background: var(--surface);
  box-shadow: 0 26px 60px rgba(20, 36, 27, 0.28);
  text-align: center;
  animation: modal-in 0.28s var(--ease-spring) both;
}

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

.modal-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--coral-soft);
  color: var(--coral-strong);
}

.modal h2 {
  font-size: 21px;
  font-weight: 800;
}

.modal p {
  margin: 8px auto 20px;
  max-width: 320px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.modal-actions .btn {
  min-width: 112px;
}

/* ---------------- 底部导航 ---------------- */
.bottom-nav {
  display: none;
}

/* ---------------- 打印 ---------------- */
#printSheet {
  display: none;
}

body.print-preview #app,
body.print-preview .bottom-nav {
  display: none;
}

body.print-preview #printSheet {
  display: block;
  padding: 24px 0 40px;
}

.print-page {
  width: 210mm;
  min-height: 297mm;
  margin: 0 auto 22px;
  padding: 14mm 14mm 12mm;
  background: #fff;
  color: #3a2433;
  box-shadow: 0 12px 40px rgba(84, 26, 56, 0.16);
  font-family: var(--font);
}

.print-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #4a2b3d;
}

.print-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12pt;
  font-weight: 800;
}

.print-brand svg {
  width: 30px;
  height: 30px;
}

.print-brand strong {
  padding-left: 8px;
  border-left: 1px solid #e7a9c4;
  font-size: 12pt;
}

.print-meta {
  display: flex;
  gap: 16px;
  color: #6b4b5b;
  font-size: 9.5pt;
}

.print-info {
  display: flex;
  gap: 26px;
  padding: 10px 2px 8px;
  color: #5a3b4b;
  font-size: 10pt;
}

.print-list {
  display: grid;
  gap: 0;
}

.print-q {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px;
  gap: 5px 14px;
  padding: 13px 0 12px;
  border-bottom: 1px dashed #cfd8d1;
  break-inside: avoid;
}

.print-q-text {
  font-size: 11pt;
  line-height: 1.62;
}

.print-num {
  font-weight: 800;
}

.print-art {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
}

.print-art .art-svg {
  width: 88px;
  height: auto;
  display: block;
  border-radius: 10px;
}

.print-answer {
  margin-top: 5px;
  color: #5a3b4b;
  font-size: 10pt;
}

.print-unit {
  color: #6a776f;
  font-size: 9.5pt;
}

.print-tip-box {
  margin-top: 14px;
  padding: 10px 13px;
  border: 1px solid #ffd0e4;
  border-radius: 8px;
  background: #fff7fb;
  color: #6b4b5b;
  font-size: 9pt;
  line-height: 1.6;
  break-inside: avoid;
}

.print-tip-box b {
  margin-right: 8px;
  color: #4a2b3d;
}

.print-foot {
  margin-top: 12px;
  padding-top: 7px;
  border-top: 1px solid #f3d7e4;
  color: #9a7688;
  font-size: 9pt;
  text-align: center;
}

.print-key-page {
  break-before: page;
}

.print-key {
  margin-top: 16px;
  columns: 2;
  column-gap: 26px;
}

.print-key li {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 9px;
  break-inside: avoid;
  font-size: 9.5pt;
  line-height: 1.55;
}

.key-num {
  color: #6a776f;
}

.print-key b {
  white-space: nowrap;
}

.key-solution {
  color: #8b6b7d;
  font-size: 8.5pt;
}

/* ---------------- 响应式 ---------------- */
/* ---------------- 蛋仔派对主题覆盖 ---------------- */
.topbar {
  background: rgba(255, 247, 251, 0.94);
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.82);
}

.btn-primary {
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  top: 4px;
  height: 36%;
  border-radius: 999px;
  background: linear-gradient(rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.btn-primary:hover {
  background: #ef4b93;
}

.btn-secondary {
  border-color: #ffc9df;
  box-shadow: 0 3px 0 #ffe0ee;
}

.btn-secondary:hover {
  background: var(--pink-tint);
}

.btn-secondary:active {
  box-shadow: 0 1px 0 #ffe0ee;
}

.chip {
  border-color: #ffc9df;
  background: var(--pink-tint);
  color: var(--pink-dark);
}

.hero {
  border-color: #ffc9df;
  background: linear-gradient(135deg, #ffd9e9 0%, #fff7fc 54%, #ffe9d2 100%);
  box-shadow: 0 18px 42px rgba(226, 59, 134, 0.14);
}

.hero::before {
  background: rgba(255, 255, 255, 0.55);
}

.hero::after {
  background: rgba(255, 200, 61, 0.2);
}

.hero-meta {
  color: #8b3a63;
}

.difficulty {
  background: #fff5fa;
  border-color: #ffd2e5;
}

.stat-icon.is-green {
  background: var(--pink-soft);
  color: var(--pink-dark);
}

.q-art {
  background: linear-gradient(135deg, #fff0f7, #f4fbff);
  border-color: #ffd6e7;
}

.answer-box:focus-within {
  box-shadow: 0 0 0 4px rgba(226, 59, 134, 0.13);
}

.answer-input::placeholder {
  color: #937183;
}

.feedback {
  border-color: #bfeedf;
  background: var(--mint-tint);
}

.feedback-icon {
  color: var(--mint-dark);
  border-color: transparent;
}

.feedback.is-wrong {
  border-color: #f2c9bd;
  background: #fff0ec;
}

.feedback.is-wrong .feedback-icon {
  color: var(--coral);
  border-color: transparent;
}

.solution-steps li::before {
  color: var(--pink);
}

.feedback.is-wrong .solution-steps li::before {
  color: var(--coral);
}

.result-hero {
  border-color: #ffc9df;
  background: linear-gradient(135deg, #ffe0ee 0%, #fff7fc 58%, #fff0d8 100%);
}

.result-hero::before {
  background: rgba(255, 255, 255, 0.62);
}

.score-number,
.score-unit {
  color: var(--pink-deep);
}

.star {
  color: #ffd9e8;
}

.mini-track,
.mastery-track {
  background: #ffeaf4;
}

.mini-track span,
.mastery-fill {
  background: var(--pink);
}

.all-right {
  border-color: #bfeedf;
  background: var(--mint-tint);
  color: var(--mint-dark);
}

.all-right-icon {
  color: var(--mint);
}

.wrong-open,
.tabs,
.answer-compare {
  background: #fff1f8;
}

.bar-track {
  background: #fff6fb;
  box-shadow: inset 0 0 0 1px #ffe3f0;
}

.bar-fill {
  background: #ffb3d4;
}

.day-col.is-today .bar-fill {
  background: var(--pink);
}

.switch-track {
  background: #ffd0e4;
}

.switch input:checked + .switch-track {
  background: var(--pink);
}

.check input {
  accent-color: var(--pink);
}

.skeleton span {
  background: linear-gradient(90deg, #fff1f8 25%, #ffe0ee 37%, #fff1f8 63%);
}

.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  color: var(--ink);
  border: 1.5px solid #ffc9df;
  box-shadow: 0 10px 28px rgba(168, 31, 94, 0.16);
}

.toast::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pink);
}

.toast.is-warn {
  background: #fff5f2;
  border-color: #f2c9bd;
  color: var(--coral-strong);
}

.toast.is-warn::before {
  background: var(--coral);
}

@media (max-width: 879px) {
  .bottom-nav {
    background: rgba(255, 247, 251, 0.97);
  }

  .hero .egg,
  .result-hero .egg {
    width: 24px;
    height: 28px;
  }

  .hero .egg svg,
  .result-hero .egg svg {
    width: 22px;
    height: 26px;
  }

  .hero .egg-row,
  .result-hero .egg-row {
    gap: 4px;
  }
}

@media (max-width: 1080px) {
  .topbar-inner,
  .view {
    width: calc(100% - 40px);
  }

  .hero {
    padding: 34px;
    grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.8fr);
  }

  .qcard {
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 24px;
    padding: 24px;
  }

  .q-art {
    min-height: 240px;
  }
}

@media (max-width: 900px) {
  .result-grid {
    grid-template-columns: 1fr;
  }

  .mastery-list {
    grid-template-columns: 1fr;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .field.span-2 {
    grid-column: auto;
  }
}

@media (max-width: 879px) {
  body {
    padding-bottom: 82px;
    font-size: 15px;
  }

  body.focus-mode {
    padding-bottom: 0;
  }

  .topbar-inner {
    width: calc(100% - 28px);
    height: 64px;
    gap: 10px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .brand-name {
    font-size: 19px;
  }

  .main-nav {
    display: none;
  }

  .top-actions {
    gap: 6px;
  }

  .grade-picker select {
    height: 38px;
    padding: 0 32px 0 13px;
    font-size: 13px;
  }

  .select-chevron {
    right: 11px;
  }

  .icon-btn {
    width: 38px;
    height: 38px;
  }

  .view {
    width: calc(100% - 32px);
    padding: 20px 0 28px;
  }

  .focus-mode .main-nav,
  .focus-mode .grade-picker,
  .focus-mode .bottom-nav {
    display: none !important;
  }

  .bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    gap: 4px;
    padding: 7px 14px calc(7px + env(safe-area-inset-bottom));
    background: rgba(255, 247, 251, 0.97);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(12px);
  }

  .bottom-nav .nav-link {
    flex: 1;
    flex-direction: column;
    gap: 2px;
    justify-content: center;
    padding: 6px 4px;
    border-radius: 14px;
    font-size: 11.5px;
  }

  .bottom-nav .nav-link .icon {
    width: 21px;
    height: 21px;
  }

  .bottom-nav .nav-link.is-active {
    background: var(--green-soft);
  }

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

  .home-view {
    padding-top: 16px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 26px 24px 20px;
    border-radius: 28px;
  }

  .hero-title {
    font-size: clamp(27px, 8vw, 34px);
  }

  .hero-meta {
    font-size: 13.5px;
  }

  .hero-art {
    width: 170px;
    margin: 6px auto -8px;
  }

  .hero .egg-row {
    margin-top: 14px;
  }

  .btn-hero {
    width: 100%;
    margin-top: 18px;
  }

  .stat-grid {
    gap: 9px;
    margin-top: 14px;
  }

  .stat-grid.four {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .stat-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 13px 13px 12px;
    border-radius: 18px;
  }

  .stat-icon {
    width: 34px;
    height: 34px;
    border-radius: 11px;
  }

  .stat-icon .icon {
    width: 18px;
    height: 18px;
  }

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

  .stat-body span {
    margin-top: 3px;
    font-size: 12px;
  }

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

  .practice-view {
    padding-top: 16px;
  }

  .practice-head {
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-bottom: 12px;
  }

  .back-btn {
    padding-left: 2px;
  }

  .practice-step {
    order: 3;
    flex-basis: 100%;
    justify-content: space-between;
    gap: 4px 10px;
  }

  .practice-step .egg-row {
    gap: 2px;
    flex-wrap: nowrap;
    padding-right: 4px;
  }

  .practice-step .egg {
    width: 16px;
    height: 19px;
  }

  .practice-step .egg svg {
    width: 15px;
    height: 18px;
  }

  .qcard {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 18px;
    border-radius: 26px;
  }

  .q-art {
    min-height: 0;
    padding: 10px;
    border-radius: 20px;
  }

  .q-art .art-svg {
    max-width: 100%;
    max-height: 190px;
  }

  .q-text {
    margin: 13px 0 18px;
    font-size: 20px;
    line-height: 1.7;
  }

  .answer-form {
    padding-top: 16px;
  }

  .answer-row {
    gap: 8px;
  }

  .answer-box {
    flex: 1;
    min-width: 150px;
    height: 56px;
    padding: 0 13px;
  }

  .answer-input {
    width: 100%;
    min-width: 0;
    font-size: 24px;
  }

  .answer-form .btn {
    height: 56px;
    padding: 0 20px;
    font-size: 15px;
  }

  .hint-btn {
    width: 100%;
    justify-content: flex-start;
    margin-left: 0;
    padding-left: 4px;
  }

  .feedback {
    padding: 16px;
  }

  .feedback-head h2 {
    font-size: 18px;
  }

  .feedback-actions {
    justify-content: stretch;
  }

  .feedback-actions .btn {
    flex: 1;
  }

  .result-hero {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 26px 24px 18px;
    border-radius: 28px;
  }

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

  .score-number {
    font-size: 66px;
  }

  .result-art {
    width: 150px;
    margin: 4px auto -6px;
  }

  .result-grid {
    gap: 12px;
    margin-top: 14px;
  }

  .card {
    padding: 18px;
    border-radius: 22px;
  }

  .wrong-item summary {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 14px;
  }

  .wrong-answers {
    white-space: normal;
  }

  .wrong-detail {
    padding: 0 14px 14px;
  }

  .result-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .result-actions .btn {
    width: 100%;
  }

  .tabs {
    display: flex;
    width: 100%;
  }

  .tab {
    flex: 1;
    justify-content: center;
  }

  .wrong-card {
    padding: 16px 17px;
    border-radius: 20px;
  }

  .wrong-card-text {
    font-size: 15px;
  }

  .week-chart {
    gap: 6px;
  }

  .bar-track {
    height: 104px;
    border-radius: 10px;
  }

  .bar-value {
    height: 13px;
    font-size: 10.5px;
  }

  .day-label {
    font-size: 10.5px;
  }

  .recent-list li {
    grid-template-columns: 1fr auto;
    gap: 4px 10px;
    padding: 10px 0;
  }

  .settings-form {
    gap: 12px;
    margin-top: 16px;
  }

  .setting-section {
    padding: 18px;
  }

  .modal {
    padding: 24px 20px;
    border-radius: 22px;
  }

  .toast-root {
    bottom: 92px;
  }

  body.focus-mode .toast-root {
    bottom: 24px;
  }
}

@media (max-width: 420px) {
  .stat-card {
    padding: 11px 11px 10px;
  }

  .stat-icon {
    width: 30px;
    height: 30px;
  }

  .stat-body strong {
    font-size: 19px;
  }

  .stat-body span {
    font-size: 12px;
  }

  .hero {
    padding: 22px 20px 16px;
  }

  .hero-art {
    width: 150px;
  }

  .answer-box {
    min-width: 130px;
  }

  .answer-form .btn {
    padding: 0 16px;
  }
}

@media (max-width: 600px) {
  .breakdown {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------------- 打印媒体 ---------------- */
@media print {
  @page {
    size: A4;
    margin: 12mm 13mm;
  }

  html,
  body {
    margin: 0;
    padding: 0;
    background: #fff !important;
    background-image: none !important;
    color: #3a2433;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  #app,
  #toastRoot,
  #modalRoot,
  .bottom-nav,
  .skip-link {
    display: none !important;
  }

  #printSheet {
    display: block !important;
    padding: 0;
  }

  .print-page {
    width: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    box-shadow: none;
    break-after: page;
  }

  .print-page:last-child {
    break-after: auto;
  }

  .print-q {
    break-inside: avoid;
  }

  .print-art .art-svg {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
