:root {
  --bg-paper: #f5efe2;
  --bg-panel: rgba(255, 250, 240, 0.84);
  --bg-side: rgba(241, 232, 214, 0.96);
  --bg-side-strong: rgba(255, 248, 236, 0.98);
  --ink-main: #223127;
  --ink-soft: #4d5a50;
  --line-soft: rgba(61, 82, 68, 0.18);
  --accent-main: #bf5b39;
  --accent-alt: #3a7d63;
  --accent-warn: #bf8a39;
  --mastery-low: #cf7958;
  --mastery-mid: #c09b4f;
  --mastery-high: #3e8a63;
  --game-gold: #f3b937;
  --game-green: #58cc59;
  --game-red: #ff6b57;
  --game-blue: #3f8cff;
  --shadow: 0 18px 48px rgba(40, 36, 23, 0.12);
  --shadow-soft: 0 12px 30px rgba(48, 42, 27, 0.12);
  --radius-lg: 24px;
  --radius-md: 16px;
  --nav-width: 280px;
  --content-max: 980px;
  --ease-bounce: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "Noto Serif SC", "Source Han Serif SC", "STSong", serif;
  color: var(--ink-main);
  overflow-x: hidden;
  background:
    radial-gradient(circle at 20% 18%, rgba(232, 192, 116, 0.24), transparent 42%),
    radial-gradient(circle at 86% 14%, rgba(70, 127, 98, 0.16), transparent 36%),
    linear-gradient(140deg, #f9f3e8 0%, #f2ead9 40%, #eee3cc 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.22;
  background-image:
    linear-gradient(90deg, rgba(120, 106, 71, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(120, 106, 71, 0.08) 1px, transparent 1px);
  background-size: 26px 26px;
}

body::after {
  content: "";
  position: fixed;
  inset: -18%;
  pointer-events: none;
  opacity: 0.6;
  background:
    radial-gradient(circle at 18% 22%, rgba(255, 214, 120, 0.24), transparent 22%),
    radial-gradient(circle at 82% 18%, rgba(88, 204, 89, 0.14), transparent 24%),
    radial-gradient(circle at 52% 84%, rgba(63, 140, 255, 0.12), transparent 22%);
  filter: blur(18px);
  animation: ambient-drift 14s ease-in-out infinite alternate;
}

body.nav-open {
  overflow: hidden;
}

body.is-transitioning-out .content-shell {
  animation: page-exit-fade 600ms ease both;
}

body.is-transitioning-in .content-shell {
  animation: page-enter-fade 600ms ease both;
}

body.page-flash-success::after,
body.page-flash-warning::after,
body.page-flash-danger::after {
  animation-duration: 560ms;
  animation-fill-mode: both;
}

body.page-flash-success::after {
  animation-name: feedback-flash-success;
}

body.page-flash-warning::after {
  animation-name: feedback-flash-warning;
}

body.page-flash-danger::after {
  animation-name: feedback-flash-danger;
}

a {
  color: inherit;
}

.page-transition {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  z-index: 120;
  overflow: hidden;
  background: linear-gradient(160deg, #f5f0e8 0%, #e8e0d4 100%);
}

.page-transition::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 25%, rgba(78, 142, 105, 0.12), transparent 50%),
    radial-gradient(circle at 70% 70%, rgba(212, 168, 103, 0.1), transparent 50%);
}

.page-transition::after {
  content: none;
}

.page-transition-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  z-index: 1;
}

.page-transition-mascot {
  position: relative;
  width: 190px;
  height: 190px;
  transform: scale(0.75);
  transform-origin: center bottom;
}

.page-transition-copy {
  position: relative;
  padding: 0;
  border-radius: 0;
  color: #4e8e69;
  letter-spacing: 0.2em;
  text-transform: none;
  font-size: 15px;
  font-weight: 600;
  background: none;
  border: none;
  box-shadow: none;
  opacity: 0;
}

.page-transition.is-active {
  opacity: 1;
  animation: transition-overlay-in 400ms ease forwards;
}

.page-transition.is-active .page-transition-mascot {
  animation: transition-mascot-in 600ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.page-transition.is-active .page-transition-copy {
  animation: transition-text-in 600ms ease 120ms forwards;
}

.page-transition.is-entering {
  opacity: 1;
  animation: transition-bg-out 700ms ease forwards;
}

.page-transition.is-entering .page-transition-mascot {
  opacity: 1;
  animation: transition-mascot-out 700ms ease forwards;
}

.page-transition.is-entering .page-transition-copy {
  opacity: 1;
  animation: transition-text-out 600ms ease forwards;
}

.page-transition.is-entering::before {
  animation: transition-bg-out 700ms ease forwards;
}

button,
.btn {
  border: none;
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  color: #fffdf7;
  text-decoration: none;
  background: linear-gradient(145deg, #c26a47, #9e4526);
  box-shadow: 0 10px 22px rgba(119, 49, 22, 0.23);
  transition:
    transform 0.2s var(--ease-bounce),
    box-shadow 0.2s ease,
    filter 0.2s ease,
    background 0.2s ease;
}

button.secondary,
.btn.secondary {
  background: linear-gradient(145deg, #5a876f, #2f6850);
  box-shadow: 0 10px 22px rgba(39, 92, 70, 0.2);
}

button.ghost,
.btn.ghost {
  color: var(--ink-main);
  background: rgba(255, 251, 243, 0.7);
  border: 1px solid var(--line-soft);
  box-shadow: none;
}

button:disabled,
.btn:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  box-shadow: none;
}

button:hover,
.btn:hover {
  transform: translateY(-2px) scale(1.01);
  filter: saturate(1.06);
  box-shadow: 0 16px 28px rgba(88, 43, 21, 0.24);
}

button:active,
.btn:active {
  transform: translateY(1px) scale(0.98);
}

.app-shell {
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.side-nav {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(82vw, 300px);
  padding: 18px 14px;
  background:
    linear-gradient(180deg, rgba(255, 247, 232, 0.98), rgba(238, 228, 208, 0.98)),
    var(--bg-side);
  border-right: 1px solid rgba(91, 98, 78, 0.2);
  box-shadow: 18px 0 40px rgba(41, 36, 24, 0.16);
  transform: translateX(-104%);
  transition: transform 0.28s ease;
  z-index: 30;
}

.side-nav.is-open {
  transform: translateX(0);
}

.side-nav-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow: hidden;
}

.side-nav-brand {
  display: block;
  padding: 16px;
  border-radius: 22px;
  text-decoration: none;
  background:
    radial-gradient(circle at top right, rgba(201, 162, 80, 0.22), transparent 42%),
    linear-gradient(160deg, rgba(255, 251, 243, 0.94), rgba(248, 240, 227, 0.94));
  border: 1px solid rgba(108, 113, 88, 0.18);
  box-shadow: var(--shadow-soft);
}

.side-nav-kicker {
  display: block;
  margin-bottom: 8px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.side-nav-brand strong {
  display: block;
  font-size: 24px;
  letter-spacing: 0.08em;
}

.auth-panel {
  padding: 14px;
  border-radius: 20px;
  background:
    radial-gradient(circle at top right, rgba(92, 142, 114, 0.18), transparent 38%),
    linear-gradient(155deg, rgba(255, 250, 242, 0.95), rgba(244, 236, 222, 0.96));
  border: 1px solid rgba(93, 98, 79, 0.14);
  box-shadow: 0 14px 30px rgba(56, 54, 40, 0.08);
}

.auth-panel-head {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-alt);
}

.auth-panel-user {
  margin-top: 8px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.auth-panel-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--ink-soft);
}

.auth-panel-status {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-soft);
}

.auth-panel-status.is-success {
  color: #2f6e52;
}

.auth-panel-status.is-error {
  color: #9b3d2e;
}

.auth-panel-form {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.auth-method-switch {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.auth-field {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-soft);
}

.auth-field input {
  width: 100%;
  border: 1px solid rgba(95, 102, 81, 0.2);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 252, 245, 0.9);
  color: var(--ink-main);
  font: inherit;
  outline: none;
}

.auth-field input:focus {
  border-color: rgba(58, 125, 99, 0.52);
  box-shadow: 0 0 0 3px rgba(58, 125, 99, 0.12);
}

.auth-panel-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}

.auth-panel-actions button,
.auth-panel-actions .btn {
  flex: 1;
}

.auth-panel-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.side-nav-links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  -webkit-overflow-scrolling: touch;
}

.side-nav-links .nav-link:first-child {
  grid-column: 1 / -1;
}

.side-nav-links::-webkit-scrollbar {
  width: 4px;
}

.side-nav-links::-webkit-scrollbar-track {
  background: transparent;
}

.side-nav-links::-webkit-scrollbar-thumb {
  background: rgba(93, 98, 79, 0.2);
  border-radius: 4px;
}

.side-nav-links::-webkit-scrollbar-thumb:hover {
  background: rgba(93, 98, 79, 0.36);
}

.nav-link {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--ink-main);
  border: 1px solid rgba(93, 98, 79, 0.12);
  background: rgba(255, 251, 244, 0.72);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.nav-link strong {
  font-size: 13px;
}

.nav-link span {
  font-size: 10px;
  color: var(--ink-soft);
}

.side-nav-links .nav-link:first-child strong {
  font-size: 15px;
}

.side-nav-links .nav-link:first-child span {
  font-size: 11px;
}

.nav-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(44, 51, 34, 0.08);
}

.nav-link.active {
  color: #fff8ef;
  border-color: transparent;
  background:
    radial-gradient(circle at top right, rgba(255, 216, 139, 0.24), transparent 34%),
    linear-gradient(145deg, #487f64, #2f5e49);
  box-shadow: 0 14px 28px rgba(35, 82, 63, 0.24);
}

.nav-link.active span {
  color: rgba(255, 248, 239, 0.8);
}

.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 26, 20, 0.38);
  backdrop-filter: blur(3px);
  z-index: 20;
}

.content-shell {
  min-width: 0;
}

.mobile-bar {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(250, 245, 235, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(90, 96, 77, 0.16);
  z-index: 10;
}

.nav-toggle {
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 14px;
  background: linear-gradient(145deg, #557861, #355842);
  box-shadow: 0 12px 22px rgba(33, 66, 50, 0.2);
}

.nav-toggle span {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: #fff8ef;
}

.mobile-bar-copy {
  display: grid;
  gap: 2px;
}

.mobile-bar-tail {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.mobile-bar-copy strong {
  font-size: 15px;
  letter-spacing: 0.06em;
}

.mobile-bar-copy span {
  font-size: 11px;
  color: var(--ink-soft);
}

.qibao-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 225, 159, 0.42), transparent 32%),
    linear-gradient(145deg, #5f9c76, #37694f);
  box-shadow: 0 8px 16px rgba(42, 79, 60, 0.2);
}

.qibao-avatar-face {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translateX(-50%);
  width: 22px;
  height: 20px;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffe8c9, #ffd7aa);
}

.qibao-avatar-face::before,
.qibao-avatar-face::after {
  content: "";
  position: absolute;
  top: 8px;
  width: 3.5px;
  height: 3.5px;
  border-radius: 50%;
  background: #453220;
}

.qibao-avatar-face::before {
  left: 5px;
}

.qibao-avatar-face::after {
  right: 5px;
}

.qibao-avatar-hat {
  position: absolute;
  left: 50%;
  top: 18%;
  transform: translateX(-50%);
  width: 18px;
  height: 10px;
  border-radius: 8px 8px 2px 2px;
  background: linear-gradient(180deg, #3a6b4f, #2a5240);
}

.qibao-avatar-hat::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: -3px;
  right: -3px;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, #2f5a44, #4a8060, #2f5a44);
}

.qibao-avatar-mouth {
  position: absolute;
  left: 50%;
  bottom: 28%;
  transform: translateX(-50%);
  width: 6px;
  height: 3px;
  border-bottom: 2px solid #d77269;
  border-radius: 0 0 6px 6px;
}

.page {
  width: min(var(--content-max), calc(100vw - 28px));
  margin: 12px auto 20px;
  position: relative;
  animation: page-enter 680ms var(--ease-bounce) both;
}

.page-single {
  display: grid;
  gap: 14px;
}

.page-hero {
  display: grid;
  gap: 10px;
  animation: hero-enter 760ms var(--ease-bounce) both;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-alt);
}

.brand {
  font-size: clamp(28px, 5.6vw, 40px);
  letter-spacing: 0.08em;
  margin: 0;
}

.subtle {
  color: var(--ink-soft);
  margin: 8px 0 0;
}

.search-wrap {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 16px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 252, 246, 0.88);
  box-shadow: 0 8px 26px rgba(70, 72, 63, 0.08);
}

.search-wrap input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: 15px;
  color: var(--ink-main);
  font-family: inherit;
}

.panel {
  background: var(--bg-panel);
  border: 1px solid rgba(113, 120, 93, 0.18);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 14px;
  animation: rise 0.55s var(--ease-bounce) both;
}

.panel-full {
  display: grid;
  gap: 12px;
}

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

.section-head h2,
.section-head h3 {
  margin: 0;
  font-size: 19px;
}

.page-single > .panel:nth-of-type(1) {
  animation-delay: 90ms;
}

.page-single > .panel:nth-of-type(2) {
  animation-delay: 160ms;
}

.page-single > .panel:nth-of-type(3) {
  animation-delay: 230ms;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes page-enter {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes hero-enter {
  from {
    opacity: 0;
    transform: translateY(26px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes card-bounce-in {
  0% {
    opacity: 0;
    transform: translateY(24px) scale(0.94);
  }
  60% {
    opacity: 1;
    transform: translateY(-4px) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes line-flow {
  from {
    stroke-dashoffset: 0;
  }
  to {
    stroke-dashoffset: 72;
  }
}

.network-board {
  position: relative;
  min-height: 390px;
  overflow: hidden;
  border-radius: 20px;
  background:
    radial-gradient(circle at 20% 18%, rgba(226, 200, 134, 0.2), transparent 38%),
    linear-gradient(160deg, rgba(255, 253, 247, 0.92), rgba(247, 240, 227, 0.88));
  border: 1px solid rgba(108, 113, 88, 0.15);
}

.network-board-home {
  min-height: clamp(380px, 56vh, 680px);
  background:
    radial-gradient(circle at 20% 18%, rgba(226, 200, 134, 0.2), transparent 38%),
    linear-gradient(160deg, rgba(255, 253, 247, 0.92), rgba(247, 240, 227, 0.88));
  position: relative;
  overflow: hidden;
}

.network-board-graph {
  min-height: clamp(420px, 62vh, 760px);
}

.network-board-related {
  min-height: clamp(420px, 58vh, 700px);
  background:
    radial-gradient(circle at 20% 18%, rgba(226, 200, 134, 0.2), transparent 38%),
    linear-gradient(160deg, rgba(255, 253, 247, 0.92), rgba(247, 240, 227, 0.88));
  position: relative;
  overflow: hidden;
}

.network-board > div {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.network-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.network-line {
  stroke: rgba(55, 85, 67, 0.34);
  stroke-width: 2;
  stroke-dasharray: 8 10;
  animation: line-flow 16s linear infinite;
}

.network-line-highlighted {
  stroke: rgba(76, 175, 80, 0.75);
  stroke-width: 5;
  stroke-dasharray: none;
  animation: none;
}

.node {
  position: absolute;
  min-width: 108px;
  max-width: 132px;
  padding: 10px;
  border-radius: 14px;
  text-align: center;
  line-height: 1.2;
  cursor: grab;
  user-select: none;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(255, 250, 244, 0.95);
  box-shadow: 0 10px 20px rgba(35, 37, 29, 0.16);
  transform: translate(-50%, -50%);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  animation: node-pop 0.35s ease both;
  z-index: 2;
}

@keyframes node-pop {
  from {
    opacity: 0;
    transform: translate(-50%, -38%) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.node:hover {
  box-shadow: 0 16px 28px rgba(40, 53, 44, 0.25);
  transform: translate(-50%, calc(-50% - 4px)) scale(1.03);
}

.node.is-active {
  color: #fffdf7;
  border-color: rgba(164, 68, 36, 0.38);
  background: linear-gradient(145deg, #c26a47, #9e4526);
  box-shadow: 0 0 0 3px rgba(194, 106, 71, 0.24), 0 18px 32px rgba(119, 49, 22, 0.28);
  transform: translate(-50%, calc(-50% - 4px)) scale(1.05);
}

.node.is-active .node-title {
  color: #fffdf7;
}

.node.is-active .node-meta {
  color: rgba(255, 248, 239, 0.82);
}

.node.is-anchor:not(.is-active) {
  background: linear-gradient(145deg, rgba(255, 248, 228, 0.98), rgba(255, 242, 205, 0.96));
}

.node[data-mastery="low"] {
  border-left: 6px solid var(--mastery-low);
}

.node[data-mastery="mid"] {
  border-left: 6px solid var(--mastery-mid);
}

.node[data-mastery="high"] {
  border-left: 6px solid var(--mastery-high);
}

.node-title {
  font-size: 15px;
  margin-bottom: 4px;
}

.node-meta {
  font-size: 12px;
  color: var(--ink-soft);
}

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

.push-list-large {
  gap: 10px;
}

.push-card {
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 252, 246, 0.92);
  box-shadow: 0 10px 22px rgba(65, 61, 48, 0.06);
  animation: card-bounce-in 560ms var(--ease-bounce) both;
  transition: transform 0.22s var(--ease-bounce), box-shadow 0.22s ease, border-color 0.22s ease;
}

.push-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 34px rgba(65, 61, 48, 0.12);
  border-color: rgba(191, 138, 57, 0.24);
}

.push-card .btn,
.push-card button {
  margin-top: 10px;
}

.push-title {
  margin: 0 0 6px;
  font-weight: 700;
}

.push-meta {
  color: var(--ink-soft);
  font-size: 12px;
  margin: 0 0 6px;
}

.relation-graph-panel {
  overflow: hidden;
}

.relation-graph-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.95fr);
  gap: 16px;
  align-items: start;
}

.relation-graph-stage {
  min-width: 0;
}

.relation-sidecard {
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(108, 113, 88, 0.14);
  background:
    radial-gradient(circle at top right, rgba(226, 200, 134, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(255, 251, 241, 0.96), rgba(247, 241, 231, 0.92));
  box-shadow: 0 18px 32px rgba(65, 61, 48, 0.08);
}

.relation-sidecard h3 {
  margin: 6px 0 8px;
}

.relation-detail-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.relation-detail-card {
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(120, 111, 87, 0.14);
  background: rgba(255, 252, 246, 0.92);
}

.relation-detail-card strong,
.relation-detail-card span,
.relation-detail-card p {
  display: block;
}

.relation-detail-card strong {
  margin-bottom: 4px;
}

.relation-detail-card span,
.relation-detail-card p {
  font-size: 12px;
  color: var(--ink-soft);
  margin: 0 0 4px;
}

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

.practice-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  padding: 0 4px;
}

.practice-tab {
  flex: 1;
  border-radius: 16px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  background: rgba(249, 244, 235, 0.95);
  color: var(--ink-main);
  border: 1px solid var(--line-soft);
  box-shadow: none;
  cursor: pointer;
  transition: background 0.24s ease, color 0.24s ease, box-shadow 0.24s ease;
  font-family: inherit;
}

.practice-tab.active {
  color: #fff8ef;
  border-color: transparent;
  background: linear-gradient(145deg, #4b805f, #2f5f49);
  box-shadow: 0 9px 18px rgba(35, 82, 63, 0.24);
}

.tab-btn {
  width: 100%;
  border-radius: 16px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.35;
  background: rgba(249, 244, 235, 0.95);
  color: var(--ink-main);
  border: 1px solid var(--line-soft);
  box-shadow: none;
  animation: card-bounce-in 560ms var(--ease-bounce) both;
}

.tab-btn.active {
  color: #fff8ef;
  border-color: transparent;
  background: linear-gradient(145deg, #4b805f, #2f5f49);
  box-shadow: 0 9px 18px rgba(35, 82, 63, 0.24);
}

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

.learning-card {
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255, 251, 243, 0.95);
  animation: card-bounce-in 560ms var(--ease-bounce) both;
  transition: transform 0.24s var(--ease-bounce), box-shadow 0.24s ease, border-color 0.24s ease;
  display: flex;
  flex-direction: column;
  min-height: 0;
  cursor: pointer;
}

.learning-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 30px rgba(65, 61, 48, 0.1);
  border-color: rgba(88, 204, 89, 0.22);
}

.learning-card:focus-visible {
  outline: 2px solid rgba(63, 140, 255, 0.5);
  outline-offset: 2px;
}

.learning-card h4 {
  margin: 0 0 6px;
  font-size: 15px;
}

.learning-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.45;
}

.learning-card-copy {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.learning-card-meta {
  margin-top: 8px;
  font-size: 11px;
  color: var(--accent-alt);
}

.learning-card-action {
  margin-top: 14px;
}

.learning-card-action .btn {
  width: 100%;
  text-align: center;
}

.radar-panel {
  justify-items: center;
}

.radar-wrap {
  width: 100%;
  display: grid;
  gap: 14px;
  justify-items: center;
  text-align: center;
  animation: card-bounce-in 600ms var(--ease-bounce) both;
}

.radar-wrap canvas {
  max-width: 100%;
  display: block;
  margin: 0 auto;
}

.progress-legend {
  width: min(100%, 420px);
  display: grid;
  gap: 7px;
  text-align: left;
}

.progress-legend .row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 13px;
  animation: card-bounce-in 620ms var(--ease-bounce) both;
}

.push-card:nth-child(2),
.learning-card:nth-child(2),
.tab-btn:nth-child(2),
.progress-legend .row:nth-child(2) {
  animation-delay: 80ms;
}

.push-card:nth-child(3),
.learning-card:nth-child(3),
.tab-btn:nth-child(3),
.progress-legend .row:nth-child(3) {
  animation-delay: 140ms;
}

.push-card:nth-child(4),
.learning-card:nth-child(4),
.tab-btn:nth-child(4) {
  animation-delay: 200ms;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot.low {
  background: var(--mastery-low);
}

.dot.mid {
  background: var(--mastery-mid);
}

.dot.high {
  background: var(--mastery-high);
}

.practice-panel {
  position: relative;
  overflow: hidden;
  gap: 10px;
}

.practice-panel::before {
  content: "";
  position: absolute;
  right: -10%;
  top: 14%;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 216, 139, 0.24), transparent 68%);
  pointer-events: none;
}

.xp-stage {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 251, 239, 0.96), rgba(253, 241, 212, 0.92));
  border: 1px solid rgba(202, 159, 74, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  animation: card-bounce-in 620ms var(--ease-bounce) both;
}

.practice-status-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 76px;
  gap: 8px;
  align-items: stretch;
}

.xp-stage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.xp-stage-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(110, 83, 31, 0.74);
}

#practiceProgressLabel {
  letter-spacing: 0.03em;
  text-transform: none;
}

.question-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  color: #fffdf7;
  font-size: 12px;
  background: linear-gradient(145deg, #c26a47, #9e4526);
  box-shadow: 0 10px 20px rgba(119, 49, 22, 0.23);
}

.xp-track {
  position: relative;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 248, 230, 0.88);
  border: 1px solid rgba(187, 147, 66, 0.18);
}

.xp-fill {
  position: relative;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(255, 206, 76, 0.96), rgba(255, 157, 55, 0.98));
  box-shadow: inset 0 0 0 1px rgba(255, 240, 196, 0.34);
  transition: width 0.48s var(--ease-bounce);
}

.xp-fill::after {
  content: "";
  position: absolute;
  top: 1px;
  right: 10px;
  width: 64px;
  height: calc(100% - 2px);
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  animation: xp-shimmer 2s linear infinite;
}

.reward-stage {
  position: relative;
  margin-bottom: 18px;
  padding: 14px 16px 58px;
  border-radius: 20px;
  background:
    radial-gradient(circle at top left, rgba(255, 220, 132, 0.36), transparent 42%),
    linear-gradient(135deg, rgba(255, 251, 235, 0.96), rgba(249, 239, 213, 0.9));
  border: 1px solid rgba(199, 151, 63, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  animation: card-bounce-in 680ms var(--ease-bounce) both;
  animation-delay: 80ms;
}

.reward-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.reward-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 14px;
  color: #5a3b16;
  background: rgba(255, 253, 246, 0.92);
  border: 1px solid rgba(180, 138, 46, 0.16);
  box-shadow: 0 8px 16px rgba(120, 87, 21, 0.08);
  transform-origin: center;
  transition: transform 0.2s var(--ease-bounce), box-shadow 0.2s ease;
}

.reward-pill:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 22px rgba(120, 87, 21, 0.14);
}

.reward-pill strong,
.reward-pill span {
  display: block;
}

.reward-pill strong {
  font-size: 18px;
  line-height: 1;
  margin-bottom: 1px;
}

.reward-pill span:last-child {
  font-size: 11px;
  color: rgba(90, 59, 22, 0.76);
}

.reward-pill-stars {
  background: linear-gradient(135deg, rgba(255, 248, 224, 0.98), rgba(255, 232, 176, 0.94));
}

.reward-pill-streak {
  background: linear-gradient(135deg, rgba(255, 247, 234, 0.98), rgba(255, 221, 187, 0.94));
}

.reward-icon {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 16px;
  color: #fff9ef;
  background: linear-gradient(145deg, #e9ae3d, #d07b1f);
  box-shadow: 0 8px 14px rgba(177, 104, 25, 0.22);
}

.treasure-button {
  min-height: 0;
  padding: 0;
  border-radius: 16px;
  background:
    radial-gradient(circle at 30% 24%, rgba(255, 225, 144, 0.32), transparent 34%),
    linear-gradient(145deg, rgba(255, 252, 244, 0.98), rgba(246, 232, 193, 0.94));
  border: 1px solid rgba(191, 148, 61, 0.24);
  box-shadow: 0 10px 18px rgba(125, 91, 22, 0.12);
}

.treasure-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 24px rgba(125, 91, 22, 0.18);
}

.treasure-button.is-pulsing {
  animation: reward-pill-pulse 620ms ease;
}

.treasure-button.is-empty {
  opacity: 0.7;
  filter: saturate(0.84);
}

.treasure-button-visual {
  width: 74px;
  height: 56px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.treasure-chest-mini {
  transform: scale(0.34);
  transform-origin: center center;
  margin: 0;
}

.treasure-button-visual .treasure-chest-mini {
  animation: none;
}

.treasure-button-visual .treasure-chest-mini .treasure-glow {
  display: none;
}

.treasure-button .treasure-chest {
  animation-duration: 2.6s;
}

.reward-toast {
  position: relative;
  left: auto;
  bottom: auto;
  max-width: none;
  padding: 8px 12px;
  border-radius: 14px;
  color: #fffaf0;
  background: linear-gradient(135deg, rgba(69, 126, 97, 0.98), rgba(43, 94, 75, 0.98));
  box-shadow: 0 10px 18px rgba(33, 72, 57, 0.2);
  font-size: 12px;
  opacity: 0;
  transform: translateY(-8px) scale(0.96);
}

.reward-toast.is-visible {
  animation: reward-toast-in 2.2s ease forwards;
}

.reward-toast.is-warning {
  background: linear-gradient(135deg, rgba(198, 138, 52, 0.98), rgba(151, 93, 29, 0.98));
  box-shadow: 0 16px 28px rgba(128, 82, 24, 0.24);
}

.reward-toast.is-neutral {
  background: linear-gradient(135deg, rgba(124, 102, 72, 0.98), rgba(94, 74, 50, 0.98));
  box-shadow: 0 16px 28px rgba(84, 63, 41, 0.24);
}

.celebration-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.celebration-star {
  position: absolute;
  top: 54px;
  left: 0;
  font-size: 18px;
  line-height: 1;
  opacity: 0;
  filter: drop-shadow(0 8px 10px rgba(180, 115, 27, 0.22));
  animation: star-float var(--duration, 1300ms) ease-out forwards;
}

.celebration-particle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  opacity: 0;
  background: var(--particle-color, rgba(255, 214, 120, 0.92));
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
  animation: particle-burst var(--duration, 900ms) ease-out forwards;
}

.celebration-badge {
  position: absolute;
  left: 50%;
  top: 44%;
  min-width: 168px;
  padding: 14px 18px;
  border-radius: 20px;
  text-align: center;
  color: #fffaf0;
  background: linear-gradient(145deg, rgba(48, 126, 86, 0.96), rgba(88, 204, 89, 0.98));
  box-shadow: 0 18px 34px rgba(33, 82, 60, 0.24);
  transform: translate(-50%, -50%);
  animation: badge-pop var(--duration, 1200ms) var(--ease-bounce) forwards;
}

.celebration-badge.is-warning {
  background: linear-gradient(145deg, rgba(194, 133, 46, 0.96), rgba(243, 185, 55, 0.98));
  box-shadow: 0 18px 34px rgba(150, 94, 26, 0.24);
}

.celebration-badge.is-danger {
  background: linear-gradient(145deg, rgba(185, 73, 59, 0.96), rgba(255, 107, 87, 0.98));
  box-shadow: 0 18px 34px rgba(148, 55, 39, 0.24);
}

.reward-pill.is-pulsing {
  animation: reward-pill-pulse 620ms ease;
}

.practice-question-card {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 16px 16px 14px;
  overflow: hidden;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 254, 250, 0.98), rgba(252, 245, 229, 0.96));
  border: 1px solid rgba(205, 169, 94, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 14px 30px rgba(49, 45, 30, 0.08);
  animation: question-card-enter 720ms var(--ease-bounce) both;
  transition: transform 0.28s var(--ease-bounce), box-shadow 0.28s ease, border-color 0.28s ease;
}

.practice-question-card.is-loading {
  animation: question-card-swap 540ms var(--ease-bounce);
}

.practice-question-card.is-success {
  animation: question-success-burst 680ms var(--ease-bounce);
  border-color: rgba(88, 204, 89, 0.4);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 28px 54px rgba(53, 129, 74, 0.18);
}

.practice-question-card.is-almost {
  animation: question-almost-burst 640ms var(--ease-bounce);
  border-color: rgba(243, 185, 55, 0.38);
}

.practice-question-card.is-wrong {
  animation: question-wrong-shake 560ms ease;
  border-color: rgba(255, 107, 87, 0.34);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 24px 46px rgba(180, 67, 47, 0.16);
}

.practice-question-glow {
  position: absolute;
  inset: -24% auto auto 64%;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 215, 133, 0.3), transparent 64%);
  pointer-events: none;
}

@keyframes reward-toast-in {
  0% {
    opacity: 0;
    transform: translateY(-8px) scale(0.96);
  }
  12%,
  72% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-14px) scale(0.98);
  }
}

@keyframes star-float {
  0% {
    opacity: 0;
    transform: translate3d(0, 10px, 0) scale(0.4) rotate(0deg);
  }
  18% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1) rotate(10deg);
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--drift-x, 0px), var(--drift-y, -92px), 0) scale(0.82) rotate(var(--rotate, 18deg));
  }
}

@keyframes particle-burst {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.4);
  }
  20% {
    opacity: 1;
    transform: translate(calc(-50% + var(--x, 0px) * 0.25), calc(-50% + var(--y, 0px) * 0.25)) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--x, 0px)), calc(-50% + var(--y, 0px))) scale(0.7);
  }
}

@keyframes badge-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -44%) scale(0.75);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.08);
  }
  75% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -58%) scale(0.94);
  }
}

@keyframes chest-hover {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes chest-open {
  0% {
    transform: translateX(-50%) rotate(0deg);
  }
  100% {
    transform: translateX(-50%) rotate(-28deg) translateY(-18px);
  }
}

@keyframes chest-pulse {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.12);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes bubble-wobble {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-4px) rotate(-1deg);
  }
}

@keyframes mascot-frame-cycle {
  0%,
  24% {
    opacity: 1;
  }
  25%,
  100% {
    opacity: 0;
  }
}

@keyframes mascot-bounce {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  32% {
    transform: translateY(-10px) scale(1.04);
  }
  58% {
    transform: translateY(0) scale(1.01);
  }
}

@keyframes mascot-wave-right {
  0%,
  100% {
    transform: rotate(-26deg);
  }
  20% {
    transform: rotate(-74deg) translateY(-8px);
  }
  40% {
    transform: rotate(-20deg) translateY(-2px);
  }
  60% {
    transform: rotate(-78deg) translateY(-8px);
  }
  80% {
    transform: rotate(-24deg) translateY(-2px);
  }
}

@keyframes mascot-cheer-head {
  0%,
  100% {
    transform: translateX(-50%) translateY(0) rotate(0deg);
  }
  30% {
    transform: translateX(-50%) translateY(-4px) rotate(4deg);
  }
  60% {
    transform: translateX(-50%) translateY(-2px) rotate(-3deg);
  }
}

@keyframes mascot-think-tilt {
  0%,
  100% {
    transform: translateX(-50%) translateY(0) rotate(0deg);
  }
  40% {
    transform: translateX(-50%) translateY(-2px) rotate(-8deg);
  }
  70% {
    transform: translateX(-50%) translateY(0) rotate(5deg);
  }
}

@keyframes mascot-no-head {
  0%,
  100% {
    transform: translateX(-50%) translateY(0) rotate(0deg);
  }
  18% {
    transform: translateX(-50%) translateY(0) rotate(-10deg);
  }
  36% {
    transform: translateX(-50%) translateY(0) rotate(10deg);
  }
  54% {
    transform: translateX(-50%) translateY(0) rotate(-8deg);
  }
  72% {
    transform: translateX(-50%) translateY(0) rotate(7deg);
  }
}

@keyframes mascot-sad-arm-left {
  0%,
  100% {
    transform: rotate(24deg);
  }
  50% {
    transform: rotate(8deg) translateY(4px);
  }
}

@keyframes mascot-sad-arm-right {
  0%,
  100% {
    transform: rotate(-26deg);
  }
  50% {
    transform: rotate(-8deg) translateY(4px);
  }
}

@keyframes reward-pill-pulse {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes xp-shimmer {
  from {
    transform: translateX(-78px);
  }
  to {
    transform: translateX(132px);
  }
}

@keyframes question-card-enter {
  0% {
    opacity: 0;
    transform: translateY(26px) scale(0.96);
  }
  65% {
    opacity: 1;
    transform: translateY(-4px) scale(1.01);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes question-card-swap {
  0% {
    opacity: 0.4;
    transform: translateY(8px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes question-success-burst {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.02) translateY(-4px);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes question-almost-burst {
  0% {
    transform: scale(1);
  }
  30% {
    transform: translateY(-3px) scale(1.01);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes question-wrong-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-10px);
  }
  40% {
    transform: translateX(8px);
  }
  60% {
    transform: translateX(-6px);
  }
  80% {
    transform: translateX(4px);
  }
}

@keyframes feedback-enter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes ambient-drift {
  from {
    transform: translate3d(-2%, -2%, 0) scale(1);
  }
  to {
    transform: translate3d(2%, 2%, 0) scale(1.06);
  }
}

@keyframes page-exit-fade {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-12px);
  }
}

@keyframes page-enter-fade {
  0% {
    opacity: 0;
    transform: translateY(12px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes transition-overlay-in {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes transition-mascot-in {
  0% {
    opacity: 0;
    transform: scale(0.55) translateY(16px);
  }
  100% {
    opacity: 1;
    transform: scale(0.75) translateY(0);
  }
}

@keyframes transition-text-in {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes transition-mascot-out {
  0% {
    opacity: 1;
    transform: scale(0.75) translateY(0);
  }
  100% {
    opacity: 0;
    transform: scale(0.65) translateY(-12px);
  }
}

@keyframes transition-text-out {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-8px);
  }
}

@keyframes transition-bg-out {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes transition-mascot-float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

@keyframes feedback-flash-success {
  0% {
    opacity: 0.1;
    background:
      radial-gradient(circle at 18% 22%, rgba(255, 214, 120, 0.24), transparent 22%),
      radial-gradient(circle at 82% 18%, rgba(88, 204, 89, 0.14), transparent 24%),
      radial-gradient(circle at 52% 84%, rgba(63, 140, 255, 0.12), transparent 22%);
  }
  35% {
    opacity: 0.9;
    background:
      radial-gradient(circle at 50% 50%, rgba(98, 219, 107, 0.34), transparent 30%),
      linear-gradient(180deg, rgba(240, 255, 234, 0.68), rgba(255, 246, 215, 0.18));
  }
  100% {
    opacity: 0.6;
  }
}

@keyframes feedback-flash-warning {
  0% {
    opacity: 0.1;
  }
  35% {
    opacity: 0.82;
    background:
      radial-gradient(circle at 50% 50%, rgba(255, 201, 91, 0.32), transparent 32%),
      linear-gradient(180deg, rgba(255, 248, 226, 0.58), rgba(255, 240, 207, 0.18));
  }
  100% {
    opacity: 0.6;
  }
}

@keyframes feedback-flash-danger {
  0% {
    opacity: 0.1;
  }
  35% {
    opacity: 0.82;
    background:
      radial-gradient(circle at 50% 50%, rgba(255, 128, 108, 0.34), transparent 32%),
      linear-gradient(180deg, rgba(255, 236, 231, 0.6), rgba(255, 224, 219, 0.18));
  }
  100% {
    opacity: 0.6;
  }
}

.question-title {
  margin: 0 0 8px;
  position: relative;
  z-index: 1;
  font-size: 18px;
}

.question-body {
  margin: 0;
  position: relative;
  z-index: 1;
  font-size: 14px;
  line-height: 1.45;
}

.option-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.option-item {
  position: relative;
  border: 1px solid rgba(201, 172, 111, 0.22);
  border-radius: 18px;
  padding: 0;
  background:
    linear-gradient(180deg, rgba(255, 254, 250, 0.98), rgba(250, 242, 223, 0.92));
  box-shadow: 0 12px 26px rgba(57, 51, 34, 0.08);
  animation: card-bounce-in 520ms var(--ease-bounce) both;
  transition: transform 0.18s var(--ease-bounce), box-shadow 0.18s ease, border-color 0.18s ease;
}

.option-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 30px rgba(57, 51, 34, 0.12);
}

.option-item.is-selected {
  border-color: rgba(63, 140, 255, 0.46);
  box-shadow: 0 18px 30px rgba(63, 140, 255, 0.12);
  transform: translateY(-2px) scale(1.01);
}

.option-item.is-correct {
  border-color: rgba(88, 204, 89, 0.42);
  background: linear-gradient(180deg, rgba(239, 255, 239, 0.98), rgba(220, 248, 221, 0.94));
}

.option-item.is-wrong {
  border-color: rgba(255, 107, 87, 0.34);
  background: linear-gradient(180deg, rgba(255, 244, 241, 0.98), rgba(252, 227, 221, 0.94));
}

.option-item label {
  display: flex;
  gap: 10px;
  align-items: center;
  cursor: pointer;
  padding: 10px 12px;
}

.option-item input {
  margin: 0;
}

.option-marker {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  color: #6b521f;
  background: rgba(255, 236, 191, 0.94);
  box-shadow: inset 0 -2px 0 rgba(188, 137, 44, 0.18);
}

.option-copy {
  flex: 1;
  min-width: 0;
  line-height: 1.55;
}

textarea,
input[type="text"] {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  padding: 9px 10px;
  background: rgba(255, 253, 247, 0.88);
  color: var(--ink-main);
  font-family: inherit;
  font-size: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

textarea:focus,
input[type="text"]:focus {
  border-color: rgba(63, 140, 255, 0.42);
  box-shadow: 0 0 0 4px rgba(63, 140, 255, 0.12);
  transform: translateY(-1px);
}

textarea {
  min-height: 76px;
  resize: vertical;
}

.submit-btn {
  margin-top: 8px;
  min-height: 42px;
  font-size: 14px;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.submit-btn.is-loading::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: rgba(255, 255, 255, 0.96);
  animation: submit-spinner 0.7s linear infinite;
}

@keyframes submit-spinner {
  to {
    transform: rotate(360deg);
  }
}

.practice-adapt-panel {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(61, 82, 68, 0.16);
  background: rgba(255, 252, 245, 0.78);
  display: grid;
  gap: 8px;
}

.practice-adapt-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.practice-adapt-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.practice-adapt-copy strong {
  font-size: 13px;
  color: var(--ink-main);
}

.practice-adapt-copy span {
  font-size: 12px;
  color: var(--ink-soft);
}

.practice-mode-tabs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.practice-mode-btn {
  border: 1px solid rgba(61, 82, 68, 0.2);
  background: rgba(247, 241, 229, 0.9);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  line-height: 1;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.practice-mode-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(58, 73, 62, 0.16);
}

.practice-mode-btn.is-active {
  color: #fffef9;
  border-color: rgba(48, 103, 78, 0.34);
  background: linear-gradient(145deg, #5a876f, #2f6850);
  box-shadow: 0 9px 18px rgba(49, 106, 80, 0.2);
}

.practice-adapt-number-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 10px;
  border: 1px solid rgba(61, 82, 68, 0.16);
  background: rgba(255, 255, 255, 0.8);
}

.practice-adapt-number-wrap.is-disabled {
  opacity: 0.6;
  filter: grayscale(0.16);
}

.practice-adapt-number-wrap em {
  font-style: normal;
  font-size: 12px;
  color: var(--ink-soft);
}

.practice-adapt-number {
  width: 62px;
  border: 1px solid rgba(63, 94, 74, 0.22);
  border-radius: 8px;
  padding: 4px 6px;
  background: #fffdf8;
  color: var(--ink-main);
  font-family: inherit;
  font-size: 13px;
  text-align: right;
}

.practice-adapt-number:focus {
  outline: none;
  border-color: rgba(191, 91, 57, 0.42);
  box-shadow: 0 0 0 3px rgba(191, 91, 57, 0.12);
}

@media (max-width: 760px) {
  .practice-mode-tabs {
    width: 100%;
  }

  .practice-mode-btn {
    flex: 1 1 calc(33.33% - 4px);
    text-align: center;
    min-height: 30px;
  }

  .practice-adapt-number-wrap {
    margin-left: auto;
  }
}

.feedback-box {
  margin-top: 8px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(74, 100, 84, 0.28);
  background: rgba(245, 255, 248, 0.68);
  transition: transform 0.28s ease, box-shadow 0.28s ease, background 0.28s ease, border-color 0.28s ease;
  animation: feedback-enter 420ms var(--ease-bounce) both;
  font-size: 13px;
}

.feedback-box p {
  margin: 4px 0;
}

.feedback-box.is-correct {
  background: linear-gradient(135deg, rgba(232, 255, 239, 0.92), rgba(218, 247, 229, 0.92));
  border-color: rgba(59, 123, 91, 0.34);
  box-shadow: 0 14px 28px rgba(49, 110, 82, 0.12);
  transform: translateY(-2px);
}

.feedback-box.is-almost {
  background: linear-gradient(135deg, rgba(255, 247, 221, 0.92), rgba(250, 236, 196, 0.92));
  border-color: rgba(191, 138, 57, 0.3);
  box-shadow: 0 14px 28px rgba(157, 114, 36, 0.12);
}

.feedback-box.is-wrong {
  background: linear-gradient(135deg, rgba(255, 241, 235, 0.94), rgba(251, 228, 219, 0.94));
  border-color: rgba(191, 91, 57, 0.3);
}

.treasure-copy h3,
.treasure-copy p {
  margin: 0;
}

.treasure-kicker {
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(148, 104, 25, 0.84);
}

.treasure-chest {
  position: relative;
  width: 170px;
  height: 132px;
  margin: 0 auto;
  animation: chest-hover 2.2s ease-in-out infinite;
}

.treasure-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(33, 28, 20, 0.42);
  backdrop-filter: blur(6px);
  z-index: 70;
}

.treasure-overlay[hidden] {
  display: none !important;
}

.treasure-dialog {
  position: relative;
  width: min(100%, 360px);
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 22px;
  background:
    radial-gradient(circle at 22% 18%, rgba(255, 224, 143, 0.26), transparent 28%),
    linear-gradient(135deg, rgba(255, 249, 232, 0.98), rgba(247, 232, 192, 0.96));
  border: 1px solid rgba(201, 149, 53, 0.22);
  box-shadow: 0 22px 44px rgba(39, 31, 18, 0.22);
  animation: card-bounce-in 300ms var(--ease-bounce) both;
  pointer-events: auto;
}

.treasure-dialog-head {
  display: grid;
  gap: 12px;
  justify-items: center;
  text-align: center;
}

.treasure-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 999px;
  background: rgba(255, 251, 243, 0.8);
  color: var(--ink-main);
  border: 1px solid var(--line-soft);
  box-shadow: none;
  z-index: 2;
  pointer-events: auto;
}

.treasure-close:hover {
  transform: none;
  box-shadow: none;
  background: rgba(255, 251, 243, 0.96);
}

body.modal-open {
  overflow: hidden;
}

.room-hero-actions {
  align-items: center;
  justify-content: flex-end;
}

.treasure-lid,
.treasure-base,
.treasure-lock,
.treasure-glow {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.treasure-lid {
  top: 18px;
  width: 132px;
  height: 44px;
  border-radius: 26px 26px 18px 18px;
  background: linear-gradient(180deg, #ffdb77, #d98d22);
  box-shadow: inset 0 -6px 0 rgba(126, 72, 16, 0.22);
  transform-origin: center bottom;
}

.treasure-base {
  top: 54px;
  width: 152px;
  height: 70px;
  border-radius: 24px 24px 18px 18px;
  background:
    linear-gradient(180deg, #ffc94f 0%, #e39a27 60%, #cc7716 100%);
  box-shadow:
    inset 0 -8px 0 rgba(128, 71, 15, 0.28),
    0 18px 28px rgba(154, 93, 25, 0.22);
}

.treasure-lock {
  top: 58px;
  width: 34px;
  height: 42px;
  border-radius: 16px;
  background: linear-gradient(180deg, #fff7d2, #eacb67);
  box-shadow: inset 0 -4px 0 rgba(140, 101, 20, 0.24);
  z-index: 2;
}

.treasure-lock::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -18px;
  width: 24px;
  height: 20px;
  border: 6px solid #f1d57b;
  border-bottom: none;
  border-radius: 14px 14px 0 0;
  transform: translateX(-50%);
}

.treasure-glow {
  inset: auto auto -6px 50%;
  width: 180px;
  height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 213, 97, 0.52), transparent 64%);
  filter: blur(8px);
}

.treasure-chest.is-opened .treasure-lid {
  animation: chest-open 760ms var(--ease-bounce) forwards;
}

.treasure-chest.is-pulsing {
  animation: chest-pulse 720ms var(--ease-bounce);
}

.chest-vault,
.shop-grid,
.inventory-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.chest-card,
.shop-card,
.inventory-card {
  display: grid;
  gap: 10px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(188, 157, 97, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 254, 250, 0.98), rgba(248, 240, 223, 0.94));
  box-shadow: 0 18px 30px rgba(54, 48, 33, 0.08);
  animation: card-bounce-in 720ms var(--ease-bounce) both;
}

.chest-card.is-opened {
  background: linear-gradient(180deg, rgba(242, 255, 236, 0.96), rgba(229, 248, 223, 0.94));
  border-color: rgba(88, 204, 89, 0.24);
}

.chest-card-icon,
.shop-card-icon,
.inventory-icon {
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  font-size: 22px;
  color: #fff8ef;
  background: linear-gradient(145deg, #f0b53f, #cb7a17);
  box-shadow: 0 12px 22px rgba(177, 104, 25, 0.22);
}

.chest-card-copy,
.inventory-card,
.shop-card {
  align-content: start;
}

.chest-card-copy strong,
.shop-card h3,
.inventory-card strong {
  font-size: 18px;
}

.chest-card-copy span,
.shop-card p,
.inventory-card span,
.inventory-card em {
  color: var(--ink-soft);
  font-style: normal;
  line-height: 1.55;
}

.shop-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-soft);
}

.shop-card.is-locked {
  opacity: 0.72;
}

.shop-hero-panel {
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 360px);
  align-items: center;
}

.shop-hero-panel-room {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 251, 241, 0.96), rgba(241, 232, 211, 0.94)),
    rgba(255, 252, 246, 0.94);
}

.shop-hero-panel-room::after {
  content: "";
  position: absolute;
  inset: auto -8% -28% 48%;
  height: 220px;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(104, 170, 112, 0.14), transparent 58%),
    radial-gradient(circle at 40% 40%, rgba(237, 182, 94, 0.16), transparent 52%);
  pointer-events: none;
}

.shop-wallet-card {
  display: grid;
  gap: 14px;
}

.shop-wallet-card-room {
  position: relative;
  z-index: 1;
}

.shop-wallet-label {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(79, 95, 87, 0.74);
}

.shop-wallet-row {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.shop-wallet-pill {
  padding: 16px;
  border-radius: 20px;
  background:
    radial-gradient(circle at top right, rgba(255, 221, 145, 0.22), transparent 34%),
    rgba(255, 252, 243, 0.94);
  border: 1px solid rgba(186, 156, 97, 0.18);
  box-shadow: 0 16px 28px rgba(54, 48, 33, 0.08);
}

.shop-wallet-pill span,
.shop-wallet-pill strong {
  display: block;
}

.shop-wallet-pill span {
  font-size: 12px;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.shop-wallet-pill strong {
  font-size: 30px;
  line-height: 1;
}

.shop-hero-copy {
  display: grid;
  gap: 10px;
  max-width: 58ch;
}

.shop-room-intro-label,
.shop-room-note-label {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(92, 82, 60, 0.62);
}

.shop-hero-copy h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.08;
}

.shop-hero-copy p,
.shop-hero-aside p,
.shop-room-note p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.7;
}

.shop-hero-aside {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  align-content: start;
  padding: 24px;
  min-height: 100%;
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(75, 120, 86, 0.9), rgba(54, 97, 70, 0.96)),
    rgba(58, 125, 99, 0.94);
  color: #f8f7ef;
  box-shadow: 0 22px 40px rgba(41, 74, 54, 0.22);
}

.shop-hero-badge {
  width: fit-content;
  padding: 9px 14px;
  border-radius: 999px;
  color: #2f563e;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: linear-gradient(145deg, #f5d37f, #f7e8b8);
}

.shop-room-panel {
  gap: 18px;
}

.shop-room-layout {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.28fr) minmax(280px, 0.72fr);
  align-items: start;
}

.shop-room-stage {
  display: grid;
  gap: 12px;
}

.shop-room-viewport {
  position: relative;
  min-height: 560px;
  overflow: hidden;
  touch-action: none;
  border-radius: 28px;
  background:
    radial-gradient(circle at 22% 18%, rgba(255, 230, 164, 0.3), transparent 22%),
    linear-gradient(180deg, #d7edff 0%, #d5efea 46%, #8bc17f 100%);
  border: 1px solid rgba(114, 139, 104, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 24px 42px rgba(44, 58, 36, 0.16);
}

.shop-room-viewport canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.shop-room-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  text-align: center;
  color: rgba(37, 62, 48, 0.82);
  font-size: 15px;
  letter-spacing: 0.04em;
}

.shop-room-hud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.shop-room-hud span,
.shop-card-placement,
.inventory-placement {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.3;
  color: rgba(46, 65, 53, 0.88);
  background: rgba(247, 242, 230, 0.92);
  border: 1px solid rgba(124, 107, 79, 0.14);
}

.shop-room-sidebar {
  display: grid;
  gap: 14px;
}

.shop-room-note {
  display: grid;
  gap: 10px;
  padding: 22px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.96), rgba(244, 235, 216, 0.96));
  border: 1px solid rgba(181, 155, 102, 0.18);
  box-shadow: 0 18px 32px rgba(55, 48, 35, 0.08);
}

.shop-room-note h3 {
  margin: 0;
  font-size: 28px;
  line-height: 1.14;
}

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

.shop-room-touchpad button {
  min-height: 56px;
  padding: 14px 16px;
  border-radius: 18px;
  font-size: 15px;
  background: linear-gradient(145deg, #5d8f74, #326d54);
  box-shadow: 0 14px 24px rgba(46, 89, 67, 0.2);
}

.shop-room-touchpad button:active,
.shop-room-touchpad button.is-pressed {
  transform: translateY(1px) scale(0.98);
  filter: saturate(1.08);
}

.shop-card,
.inventory-card {
  align-content: start;
}

.shop-card-placement,
.inventory-placement {
  width: fit-content;
}

.mascot-dock {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  width: min(320px, calc(100vw - 28px));
  pointer-events: none;
}

.mascot-trigger-floating {
  position: fixed;
  top: 16px;
  right: 18px;
  width: 44px;
  height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 999px;
  z-index: 35;
  background: rgba(255, 252, 244, 0.92);
  border: 1px solid rgba(63, 94, 74, 0.22);
  box-shadow: 0 12px 22px rgba(43, 74, 59, 0.22);
}

.mascot-trigger-floating .qibao-avatar {
  width: 34px;
  height: 34px;
  box-shadow: 0 7px 14px rgba(42, 79, 60, 0.2);
}

.mascot-trigger-floating:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 18px 28px rgba(43, 74, 59, 0.26);
}

.qibao-avatar.is-actionable {
  cursor: pointer;
  transition: transform 0.18s var(--ease-bounce), box-shadow 0.18s ease;
}

.qibao-avatar.is-actionable:hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 12px 20px rgba(42, 79, 60, 0.26);
}

.mascot-overlay {
  position: fixed;
  inset: 0;
  padding: 18px;
  display: grid;
  place-items: center;
  background: transparent;
  backdrop-filter: none;
  z-index: 78;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.mascot-overlay[hidden] {
  display: none !important;
}

.mascot-overlay.is-visible,
.mascot-overlay.is-closing {
  opacity: 1;
  pointer-events: auto;
}

.mascot-dialog {
  position: relative;
  width: min(100%, 390px);
  padding: 20px 16px 16px;
  border-radius: 24px;
  border: 1px solid rgba(70, 99, 80, 0.2);
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 229, 156, 0.24), transparent 28%),
    linear-gradient(140deg, rgba(255, 251, 238, 0.96), rgba(240, 248, 239, 0.94));
  box-shadow: 0 26px 48px rgba(21, 36, 30, 0.28);
  transform: translateY(18px) scale(0.94);
  opacity: 0;
  overflow: visible;
  transition: transform 360ms var(--ease-bounce), opacity 220ms ease;
}

.mascot-overlay.is-visible .mascot-dialog {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.mascot-overlay.is-closing .mascot-dialog {
  opacity: 0;
  transform: translateY(12px) scale(0.96);
}

.mascot-dialog .mascot-shell {
  justify-items: center;
  gap: 6px;
}

.mascot-dialog .mascot-bubble {
  max-width: 100%;
  border-radius: 18px;
  text-align: left;
}

.mascot-dialog .mascot-character {
  width: 196px;
  height: 196px;
  transform: translateY(-10px);
  filter: drop-shadow(0 16px 24px rgba(75, 57, 23, 0.16));
  isolation: isolate;
}

.mascot-dialog .mascot-frame {
  z-index: 3;
  opacity: 0;
  animation: none;
}

.mascot-dialog .mascot-frame.frame-a {
  opacity: 1 !important;
}

.mascot-dialog .mascot-frame:not(.frame-a) {
  display: none;
}

.mascot-dialog .mascot-character::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 158px;
  height: 48px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 35% 35%, rgba(255, 244, 196, 0.9), rgba(255, 215, 124, 0.92) 62%, rgba(239, 171, 65, 0.88));
  box-shadow:
    inset 0 -6px 0 rgba(176, 111, 32, 0.24),
    0 10px 18px rgba(109, 78, 29, 0.22);
  transform: translateX(-50%);
  z-index: 1;
}

.mascot-dialog .mascot-head {
  background-color: #ffd7aa;
}

.mascot-dialog .mascot-hat {
  background-color: #3f7f5d;
}

.mascot-dialog .mascot-body {
  background-color: #61b758;
}

.mascot-dialog .mascot-arm {
  background-color: #5bae5a;
}

.mascot-dialog .mascot-herb {
  background-color: #e3af45;
}

.mascot-dialog .mascot-shop-link {
  width: 100%;
  text-align: center;
}

.mascot-dialog-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 999px;
  background: rgba(255, 251, 243, 0.86);
  color: var(--ink-main);
  border: 1px solid var(--line-soft);
  box-shadow: none;
  z-index: 2;
}

.mascot-dialog-close:hover {
  transform: none;
  box-shadow: none;
  background: rgba(255, 251, 243, 0.98);
}

@keyframes mascot-modal-in {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.94);
  }
  60% {
    opacity: 1;
    transform: translateY(-3px) scale(1.01);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes mascot-modal-out {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
}

.mascot-shell {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.mascot-shell.is-large {
  justify-items: center;
}

.mascot-bubble {
  max-width: 260px;
  padding: 12px 16px;
  border-radius: 20px 20px 6px 20px;
  color: #294336;
  background: rgba(255, 252, 244, 0.96);
  border: 1px solid rgba(91, 110, 95, 0.16);
  box-shadow: 0 18px 28px rgba(56, 53, 39, 0.12);
  animation: bubble-wobble 4.5s ease-in-out infinite;
}

.mascot-character {
  position: relative;
  width: 190px;
  height: 190px;
  pointer-events: auto;
}

.shop-mascot-hero .mascot-character,
.mascot-shell.is-large .mascot-character {
  width: 250px;
  height: 250px;
}

.mascot-frame {
  position: absolute;
  inset: 0;
  opacity: 0;
  animation: mascot-frame-cycle 1.6s steps(1, end) infinite;
  animation-fill-mode: both;
}

.mascot-frame.frame-a {
  opacity: 1;
}

.mascot-frame.frame-b {
  animation-delay: 0.4s;
}

.mascot-frame.frame-c {
  animation-delay: 0.8s;
}

.mascot-frame.frame-d {
  animation-delay: 1.2s;
}

.mascot-head,
.mascot-hat,
.mascot-body,
.mascot-arm,
.mascot-herb {
  position: absolute;
}

.mascot-head {
  left: 50%;
  top: 26px;
  width: 92px;
  height: 88px;
  border-radius: 42px;
  background: linear-gradient(180deg, #ffe8c9, #ffd7aa);
  box-shadow: inset 0 -6px 0 rgba(216, 164, 103, 0.18);
  transform: translateX(-50%);
  z-index: 4;
}

.mascot-head .mouth {
  position: absolute;
  left: 50%;
  bottom: 18px;
  width: 22px;
  height: 10px;
  border-bottom: 4px solid #d77269;
  border-radius: 0 0 20px 20px;
  transform: translateX(-50%);
  z-index: 6;
}

.mascot-head .eye {
  position: absolute;
  top: 38px;
  width: 12px;
  height: 12px;
  display: block;
  border-radius: 50%;
  background: #453220;
  box-shadow: 0 0 0 2px rgba(255, 244, 228, 0.18);
  z-index: 7;
}

.mascot-head .eye::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
}

.mascot-head .eye.left {
  left: 22px;
}

.mascot-head .eye.right {
  right: 22px;
}

.mascot-hat {
  left: 50%;
  top: 12px;
  width: 120px;
  height: 32px;
  border-radius: 20px;
  background: linear-gradient(180deg, #4e8e69, #2e694e);
  transform: translateX(-50%);
  box-shadow: 0 10px 18px rgba(39, 92, 70, 0.22);
  z-index: 5;
}

.mascot-hat::after {
  content: "";
  position: absolute;
  right: 14px;
  top: -8px;
  width: 18px;
  height: 24px;
  border-radius: 18px 18px 4px 18px;
  background: linear-gradient(180deg, #76cb6b, #57a846);
  transform: rotate(18deg);
}

.mascot-body {
  left: 50%;
  bottom: 26px;
  width: 112px;
  height: 96px;
  border-radius: 34px 34px 26px 26px;
  background:
    linear-gradient(180deg, #8cd36f 0%, #61b758 44%, #4f8f54 100%);
  transform: translateX(-50%);
  box-shadow: inset 0 -10px 0 rgba(51, 105, 55, 0.2);
  z-index: 2;
}

.mascot-body::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 18px;
  width: 42px;
  height: 52px;
  border-radius: 0 0 22px 22px;
  background: rgba(255, 250, 236, 0.78);
  transform: translateX(-50%);
}

.mascot-arm {
  top: 100px;
  width: 26px;
  height: 64px;
  border-radius: 18px;
  background: linear-gradient(180deg, #73c964, #4e9a54);
  z-index: 3;
}

.mascot-arm.left {
  left: 34px;
  transform: rotate(24deg);
}

.mascot-arm.right {
  right: 34px;
  transform: rotate(-26deg);
}

.mascot-herb {
  right: 20px;
  top: 118px;
  width: 34px;
  height: 46px;
  border-radius: 18px;
  background: linear-gradient(180deg, #f4d377, #d99c2c);
  box-shadow: 0 10px 18px rgba(149, 102, 27, 0.18);
  z-index: 4;
}

.mascot-herb::before,
.mascot-herb::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 14px;
  height: 22px;
  border-radius: 14px 14px 2px 14px;
  background: linear-gradient(180deg, #78d866, #4caa4f);
}

.mascot-herb::before {
  top: -10px;
  transform: translateX(-80%) rotate(-26deg);
}

.mascot-herb::after {
  top: -8px;
  transform: translateX(-8%) rotate(22deg);
}

.frame-a .mascot-head { transform: translateX(-50%) translateY(0); }
.frame-b .mascot-head { transform: translateX(-50%) translateY(-4px) rotate(-3deg); }
.frame-c .mascot-head { transform: translateX(-50%) translateY(2px) rotate(3deg); }
.frame-d .mascot-head { transform: translateX(-50%) translateY(-2px) rotate(-2deg); }

.frame-b .mascot-arm.left { transform: rotate(40deg) translateY(-8px); }
.frame-c .mascot-arm.right { transform: rotate(-40deg) translateY(-8px); }
.frame-d .mascot-herb { transform: rotate(-10deg) translateY(-8px); }

.mascot-character.is-celebrating {
  animation: mascot-bounce 920ms var(--ease-bounce);
}

.mascot-character.is-celebrating .mascot-arm.right {
  animation: mascot-wave-right 920ms ease-in-out;
  transform-origin: top center;
}

.mascot-character.is-celebrating .mascot-head {
  animation: mascot-cheer-head 920ms ease-in-out;
}

.mascot-character.is-thinking .mascot-head {
  animation: mascot-think-tilt 900ms ease-in-out;
}

.mascot-character.is-failing .mascot-head {
  animation: mascot-no-head 820ms ease-in-out;
}

.mascot-character.is-failing .mascot-arm.left {
  animation: mascot-sad-arm-left 820ms ease-in-out;
}

.mascot-character.is-failing .mascot-arm.right {
  animation: mascot-sad-arm-right 820ms ease-in-out;
}

.mascot-shop-link {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 18px;
  border-radius: 999px;
  color: #fff9ef;
  text-decoration: none;
  background: linear-gradient(145deg, #f0b53f, #cb7a17);
  box-shadow: 0 14px 24px rgba(177, 104, 25, 0.22);
}

.stat-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.metric-card {
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--line-soft);
  background:
    radial-gradient(circle at top right, rgba(235, 203, 133, 0.16), transparent 36%),
    rgba(255, 251, 243, 0.92);
  animation: card-bounce-in 620ms var(--ease-bounce) both;
  transition: transform 0.22s var(--ease-bounce), box-shadow 0.22s ease;
}

.metric-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 34px rgba(57, 51, 34, 0.1);
}

.metric-card span {
  display: block;
  font-size: 12px;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.metric-card strong {
  font-size: 24px;
  line-height: 1.1;
}

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

.stats-section {
  display: grid;
  gap: 10px;
}

.stats-section h3 {
  margin: 0;
}

.stats-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.lesson-panel {
  gap: 10px;
}

.lesson-back-link {
  white-space: nowrap;
}

.lesson-focus-card {
  display: grid;
  gap: 12px;
}

.lesson-focus-head {
  display: grid;
  gap: 6px;
}

.lesson-title {
  margin: 0;
  font-size: clamp(24px, 5vw, 34px);
  line-height: 1.15;
}

.lesson-intro {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.5;
}

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

.lesson-pill {
  padding: 10px 8px;
  border-radius: 14px;
  background: rgba(255, 251, 243, 0.92);
  border: 1px solid var(--line-soft);
  text-align: center;
}

.lesson-pill span {
  display: block;
  font-size: 11px;
  color: var(--ink-soft);
  margin-bottom: 4px;
}

.lesson-pill strong {
  font-size: 18px;
  line-height: 1.1;
}

.lesson-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lesson-tag {
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(77, 122, 100, 0.1);
  color: var(--accent-alt);
  font-size: 11px;
}

.lesson-block {
  display: grid;
  gap: 8px;
}

.lesson-block h3 {
  margin: 0;
  font-size: 15px;
}

.lesson-point-list {
  display: grid;
  gap: 8px;
}

.lesson-point {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 252, 246, 0.9);
  font-size: 13px;
  line-height: 1.45;
}

.lesson-reference {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.5;
}

.lesson-actions .btn {
  flex: 1 1 180px;
  text-align: center;
}

.stats-row {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 251, 243, 0.92);
  animation: card-bounce-in 620ms var(--ease-bounce) both;
}

.stats-row strong {
  font-size: 16px;
}

.stats-row span {
  font-size: 13px;
  color: var(--ink-soft);
}

.score {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
}

@media (min-width: 760px) {
  .page-hero {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    align-items: end;
  }

  .page-hero > div:only-child {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1040px) {
  body.nav-open {
    overflow: auto;
  }

  .app-shell {
    display: grid;
    grid-template-columns: var(--nav-width) minmax(0, 1fr);
  }

  .side-nav {
    position: sticky;
    top: 0;
    width: var(--nav-width);
    height: 100vh;
    transform: none;
    box-shadow: none;
    background:
      linear-gradient(180deg, rgba(244, 236, 219, 0.96), rgba(235, 226, 207, 0.96)),
      var(--bg-side-strong);
  }

  .nav-overlay {
    display: none !important;
  }

  .mobile-bar {
    display: none;
  }

  .page {
    width: min(var(--content-max), calc(100vw - var(--nav-width) - 72px));
    margin: 34px auto 40px;
  }
}

@media (max-width: 1039px) {
  .mascot-trigger-floating {
    display: none;
  }
}

@media (max-width: 760px) {
  .page {
    width: calc(100vw - 24px);
    margin-top: 10px;
  }

  .panel {
    padding: 13px;
  }

  .search-wrap {
    flex-wrap: nowrap;
    border-radius: 18px;
  }

  .search-wrap button {
    width: auto;
  }

  .reward-toast {
    position: relative;
    left: auto;
    top: auto;
    bottom: auto;
    margin-top: 12px;
    max-width: 100%;
  }

  .treasure-panel,
  .shop-hero-panel {
    grid-template-columns: 1fr;
  }

  .shop-room-layout {
    grid-template-columns: 1fr;
  }

  .relation-graph-layout {
    grid-template-columns: 1fr;
  }

  .shop-hero-aside,
  .shop-room-note,
  .relation-sidecard {
    padding: 18px;
  }

  .shop-hero-copy h1 {
    font-size: 30px;
  }

  .shop-room-viewport {
    min-height: 400px;
  }

  .mascot-dock {
    right: 12px;
    bottom: 12px;
    width: min(260px, calc(100vw - 24px));
  }

  .action-row .btn,
  .action-row button {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 640px) {
  .side-nav {
    width: min(86vw, 294px);
    padding: 14px 12px;
  }

  .side-nav-brand {
    padding: 16px;
  }

  .brand {
    font-size: 26px;
  }

  .section-head h2,
  .section-head h3 {
    font-size: 18px;
  }

  .shop-room-touchpad {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .network-board {
    min-height: 360px;
  }

  .network-board-related {
    min-height: 380px;
  }

  .node {
    min-width: 92px;
    max-width: 104px;
    padding: 8px;
  }

  .node-title {
    font-size: 13px;
  }

  .node-meta {
    font-size: 11px;
  }

  .reward-pill {
    padding: 8px;
  }

  .reward-pill strong {
    font-size: 16px;
  }

  .practice-question-card {
    padding: 16px 14px;
  }

  .practice-status-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 72px;
  }

  .xp-stage-head {
    flex-direction: row;
    align-items: center;
  }

  .mascot-bubble {
    max-width: 210px;
    font-size: 13px;
  }

  .mascot-character {
    width: 160px;
    height: 160px;
  }
}

@media (max-width: 430px) {
  .page {
    width: calc(100vw - 16px);
    margin-top: 8px;
    margin-bottom: 14px;
  }

  .page-single {
    gap: 10px;
  }

  .panel {
    padding: 12px;
    border-radius: 18px;
  }

  .section-head h2,
  .section-head h3 {
    font-size: 17px;
  }

  .mobile-bar {
    padding: 8px 10px;
  }

  .search-wrap input,
  .question-body {
    font-size: 14px;
  }

  .practice-status-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 68px;
    gap: 6px;
  }

  .reward-pill {
    gap: 6px;
    padding: 7px 8px;
  }

  .reward-icon {
    width: 26px;
    height: 26px;
    font-size: 14px;
  }

  .treasure-button-visual {
    width: 68px;
    height: 52px;
  }

  .treasure-dialog {
    padding: 16px 14px;
  }

  .mascot-dialog {
    padding: 18px 14px 14px;
  }

  .card-list {
    gap: 8px;
  }

  .learning-card {
    padding: 10px;
  }

  .learning-card h4 {
    font-size: 14px;
  }

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

  .lesson-pill {
    padding: 9px 6px;
  }

  .metric-card strong {
    font-size: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body::after,
  .panel,
  .node,
  .reward-toast.is-visible,
  .celebration-star,
  .celebration-particle,
  .celebration-badge,
  .reward-pill.is-pulsing,
  .practice-question-card,
  .page,
  .page-hero,
  .push-card,
  .learning-card,
  .metric-card,
  .stats-row,
  .treasure-panel,
  .treasure-chest,
  .mascot-bubble,
  .mascot-frame,
  .mascot-overlay.is-visible .mascot-dialog,
  .mascot-overlay.is-closing .mascot-dialog,
  .tab-btn,
  .xp-fill::after,
  .page-transition.is-active::before,
  .page-transition.is-entering::before,
  .page-transition.is-active .page-transition-mascot,
  .page-transition.is-entering .page-transition-mascot,
  .page-transition.is-active .page-transition-copy,
  .page-transition.is-entering .page-transition-copy {
    animation: none;
  }

  .mascot-frame {
    opacity: 0;
  }

  .mascot-frame.frame-a {
    opacity: 1;
  }

  .side-nav,
  .nav-link,
  .feedback-box,
  .reward-toast,
  .xp-fill,
  .practice-question-card,
  button,
  .btn,
  .page-transition,
  .option-item,
  .mascot-overlay {
    transition: none;
  }

  .mascot-overlay.is-visible .mascot-dialog {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  .mascot-overlay.is-closing .mascot-dialog {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
}
