:root {
  --ink: #17324d;
  --muted: #5c6c7c;
  --paper: #fffdf7;
  --surface: #ffffff;
  --sky: #7bd8ee;
  --sun: #ffd45d;
  --leaf: #54b86a;
  --coral: #ff7078;
  --blue: #2f80ed;
  --purple: #8d65d8;
  --line: #dce7ee;
  --shadow: 0 18px 42px rgba(30, 51, 74, 0.14);
  --radius: 8px;
  --page-max: 1440px;
  --home-bg: linear-gradient(180deg, #19a9ed 0%, #8be7ff 34%, #fff4d4 78%, #62c74d 100%);
  --home-image-filter: none;
  --home-card-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 253, 247, 0.82)), #fffdf7;
  --home-card-border: rgba(13, 67, 111, 0.42);
  --home-card-shadow: 0 0.46cqw 0 rgba(8, 74, 125, 0.26), 0 1.1cqw 2.1cqw rgba(34, 106, 99, 0.13);
  --home-card-glow: rgba(255, 214, 79, 0.42);
  --home-card-sheen: linear-gradient(135deg, rgba(255, 247, 188, 0.52), transparent 48%, rgba(103, 208, 116, 0.18));
  --home-stat-bg: rgba(255, 253, 247, 0.74);
  --home-icon-green: #a8e99c;
  --home-icon-blue: #7bd8ee;
  --home-icon-pink: #ffb3b8;
  --home-icon-yellow: #ffd45d;
  --home-icon-purple: #c89aff;
  --home-cta-top: #ffba46;
  --home-cta-bottom: #ff8f35;
  --home-cta-shadow: #bd6513;
  --home-cta-border: rgba(143, 75, 14, 0.58);
}

* {
  box-sizing: border-box;
}

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

html {
  background: #fff7df;
  scroll-behavior: smooth;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background:
    linear-gradient(180deg, #dff8ff 0%, #f4fbfd 48%, #fff7de 100%);
}

body[data-skin="anime"] {
  --ink: #24304f;
  --muted: #65728c;
  --paper: #fff7ff;
  --surface: #ffffff;
  --sky: #9ee8ff;
  --sun: #ffe66d;
  --leaf: #77e0aa;
  --coral: #ff78b8;
  --blue: #6a8dff;
  --purple: #b38cff;
  --line: #ead9ff;
  --shadow: 0 18px 42px rgba(111, 87, 166, 0.2);
  --home-bg: linear-gradient(180deg, #ffd6f2 0%, #b8ecff 34%, #fff7df 78%, #a5ed94 100%);
  --home-image-filter: hue-rotate(6deg) saturate(1.08) brightness(1.02);
  --home-card-bg: linear-gradient(180deg, rgba(255, 248, 255, 0.94), rgba(250, 246, 255, 0.84)), #fff7ff;
  --home-card-border: rgba(119, 90, 190, 0.48);
  --home-card-shadow: 0 0.46cqw 0 rgba(117, 82, 176, 0.28), 0 1.1cqw 2.1cqw rgba(120, 82, 170, 0.14);
  --home-card-glow: rgba(255, 120, 184, 0.42);
  --home-card-sheen: linear-gradient(135deg, rgba(255, 216, 245, 0.58), transparent 48%, rgba(120, 210, 255, 0.18));
  --home-stat-bg: rgba(255, 248, 255, 0.78);
  --home-icon-green: #9feec8;
  --home-icon-blue: #a5dbff;
  --home-icon-pink: #ff9fd0;
  --home-icon-yellow: #ffe977;
  --home-icon-purple: #cbb0ff;
  --home-cta-top: #ff8ccd;
  --home-cta-bottom: #9d83ff;
  --home-cta-shadow: #6e58ca;
  --home-cta-border: rgba(112, 77, 180, 0.6);
  background:
    radial-gradient(circle at 12% 16%, rgba(255, 120, 184, 0.28) 0 11%, transparent 12%),
    radial-gradient(circle at 88% 22%, rgba(158, 232, 255, 0.38) 0 13%, transparent 14%),
    linear-gradient(180deg, #fceaff 0%, #edf5ff 50%, #fff7dd 100%);
}

body[data-skin="candy"] {
  --ink: #3b2545;
  --muted: #735d7c;
  --paper: #fff9fb;
  --surface: #ffffff;
  --sky: #96e6ff;
  --sun: #ffe06d;
  --leaf: #8fe39b;
  --coral: #ff6f9f;
  --blue: #4f9dff;
  --purple: #c486ff;
  --line: #f3d6e5;
  --shadow: 0 18px 42px rgba(112, 54, 108, 0.18);
  --home-bg: linear-gradient(180deg, #ffd5eb 0%, #c9f4ff 34%, #fff8df 78%, #a9e979 100%);
  --home-image-filter: hue-rotate(350deg) saturate(1.12) brightness(1.03);
  --home-card-bg: linear-gradient(180deg, rgba(255, 249, 252, 0.94), rgba(255, 246, 250, 0.84)), #fff9fb;
  --home-card-border: rgba(188, 82, 136, 0.44);
  --home-card-shadow: 0 0.46cqw 0 rgba(180, 73, 124, 0.24), 0 1.1cqw 2.1cqw rgba(126, 70, 112, 0.13);
  --home-card-glow: rgba(255, 111, 159, 0.42);
  --home-card-sheen: linear-gradient(135deg, rgba(255, 220, 236, 0.58), transparent 48%, rgba(150, 230, 255, 0.2));
  --home-stat-bg: rgba(255, 249, 251, 0.78);
  --home-icon-green: #b9f49d;
  --home-icon-blue: #a7eaff;
  --home-icon-pink: #ff9ec4;
  --home-icon-yellow: #ffe884;
  --home-icon-purple: #d8acff;
  --home-cta-top: #ff8fb9;
  --home-cta-bottom: #ff6f9f;
  --home-cta-shadow: #c74677;
  --home-cta-border: rgba(170, 58, 112, 0.58);
  background:
    linear-gradient(135deg, rgba(255, 111, 159, 0.18) 0 12%, transparent 12% 24%, rgba(150, 230, 255, 0.18) 24% 36%, transparent 36%),
    linear-gradient(180deg, #fff0f7 0%, #f3fbff 48%, #fff9de 100%);
}

body[data-skin="forest"] {
  --ink: #173b2d;
  --muted: #547063;
  --paper: #fbfff3;
  --surface: #ffffff;
  --sky: #9edfd7;
  --sun: #f6d66b;
  --leaf: #67c56f;
  --coral: #ff8f70;
  --blue: #4c95d9;
  --purple: #8e7bd1;
  --line: #d5ead6;
  --shadow: 0 18px 42px rgba(36, 79, 54, 0.18);
  --home-bg: linear-gradient(180deg, #8edfd6 0%, #c8f3d1 34%, #fff6d9 78%, #4fb457 100%);
  --home-image-filter: hue-rotate(18deg) saturate(1.05) brightness(0.99);
  --home-card-bg: linear-gradient(180deg, rgba(252, 255, 246, 0.94), rgba(247, 253, 238, 0.84)), #fbfff3;
  --home-card-border: rgba(55, 116, 69, 0.46);
  --home-card-shadow: 0 0.46cqw 0 rgba(44, 111, 56, 0.25), 0 1.1cqw 2.1cqw rgba(54, 106, 61, 0.14);
  --home-card-glow: rgba(103, 197, 111, 0.42);
  --home-card-sheen: linear-gradient(135deg, rgba(239, 255, 191, 0.56), transparent 48%, rgba(103, 197, 111, 0.22));
  --home-stat-bg: rgba(252, 255, 245, 0.78);
  --home-icon-green: #a8ed92;
  --home-icon-blue: #8fded2;
  --home-icon-pink: #ffb094;
  --home-icon-yellow: #f7dc77;
  --home-icon-purple: #b9a6f0;
  --home-cta-top: #9bd96c;
  --home-cta-bottom: #4faf55;
  --home-cta-shadow: #2c8135;
  --home-cta-border: rgba(51, 117, 48, 0.6);
  background:
    radial-gradient(ellipse at 16% 12%, rgba(103, 197, 111, 0.24) 0 16%, transparent 17%),
    radial-gradient(ellipse at 84% 18%, rgba(246, 214, 107, 0.26) 0 12%, transparent 13%),
    linear-gradient(180deg, #dff8ef 0%, #f6fbec 50%, #fff4dc 100%);
}

body[data-skin="ocean"] {
  --ink: #123652;
  --muted: #557184;
  --paper: #f4fdff;
  --surface: #ffffff;
  --sky: #77d9ff;
  --sun: #ffd86f;
  --leaf: #5fd0b8;
  --coral: #ff7f86;
  --blue: #2677e5;
  --purple: #7e8ee8;
  --line: #cdeaf4;
  --shadow: 0 18px 42px rgba(21, 92, 130, 0.18);
  --home-bg: linear-gradient(180deg, #0aa9ef 0%, #86e9ff 34%, #effdff 78%, #45bfa8 100%);
  --home-image-filter: saturate(1.12) brightness(1.02);
  --home-card-bg: linear-gradient(180deg, rgba(246, 254, 255, 0.94), rgba(238, 252, 255, 0.84)), #f4fdff;
  --home-card-border: rgba(31, 116, 156, 0.46);
  --home-card-shadow: 0 0.46cqw 0 rgba(28, 111, 153, 0.25), 0 1.1cqw 2.1cqw rgba(27, 102, 133, 0.14);
  --home-card-glow: rgba(119, 217, 255, 0.44);
  --home-card-sheen: linear-gradient(135deg, rgba(207, 247, 255, 0.62), transparent 48%, rgba(95, 208, 184, 0.22));
  --home-stat-bg: rgba(244, 253, 255, 0.78);
  --home-icon-green: #89e4cb;
  --home-icon-blue: #72dfff;
  --home-icon-pink: #ffaaa8;
  --home-icon-yellow: #ffe082;
  --home-icon-purple: #aeb8ff;
  --home-cta-top: #5edcff;
  --home-cta-bottom: #2677e5;
  --home-cta-shadow: #155aaf;
  --home-cta-border: rgba(24, 94, 158, 0.6);
  background:
    radial-gradient(ellipse at 12% 92%, rgba(95, 208, 184, 0.28) 0 20%, transparent 21%),
    radial-gradient(ellipse at 85% 16%, rgba(119, 217, 255, 0.34) 0 16%, transparent 17%),
    linear-gradient(180deg, #dff8ff 0%, #eefcff 47%, #fff2d5 100%);
}

.cartoon-sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.cartoon-sky::before {
  position: absolute;
  inset: 0;
  opacity: 0.6;
  background:
    linear-gradient(135deg, rgba(123, 216, 238, 0.22) 25%, transparent 25%) 0 0 /
      34px 34px,
    linear-gradient(225deg, rgba(255, 212, 93, 0.18) 25%, transparent 25%) 0 0 /
      34px 34px;
  animation: patternSlide 28s linear infinite;
  content: "";
}

body[data-skin="anime"] .cartoon-sky::before {
  opacity: 0.72;
  background:
    linear-gradient(135deg, rgba(255, 120, 184, 0.18) 25%, transparent 25%) 0 0 / 30px 30px,
    linear-gradient(225deg, rgba(106, 141, 255, 0.16) 25%, transparent 25%) 0 0 / 30px 30px;
}

body[data-skin="candy"] .cartoon-sky::before {
  opacity: 0.62;
  background:
    radial-gradient(circle, rgba(255, 111, 159, 0.22) 0 18%, transparent 19%) 0 0 / 36px 36px,
    radial-gradient(circle, rgba(150, 230, 255, 0.22) 0 18%, transparent 19%) 18px 18px / 36px 36px;
}

body[data-skin="forest"] .cartoon-sky::before {
  opacity: 0.56;
  background:
    linear-gradient(135deg, rgba(103, 197, 111, 0.2) 25%, transparent 25%) 0 0 / 36px 36px,
    linear-gradient(225deg, rgba(246, 214, 107, 0.17) 25%, transparent 25%) 0 0 / 36px 36px;
}

body[data-skin="ocean"] .cartoon-sky::before {
  opacity: 0.6;
  background:
    linear-gradient(135deg, rgba(119, 217, 255, 0.24) 25%, transparent 25%) 0 0 / 34px 34px,
    linear-gradient(225deg, rgba(95, 208, 184, 0.18) 25%, transparent 25%) 0 0 / 34px 34px;
}

.cartoon-sky::after {
  position: absolute;
  right: -5vw;
  bottom: -52px;
  left: -5vw;
  height: 140px;
  border-top: 3px solid rgba(23, 50, 77, 0.16);
  background:
    radial-gradient(120px 60px at 12% 10%, rgba(84, 184, 106, 0.26) 0 98%, transparent 100%),
    radial-gradient(150px 70px at 34% 22%, rgba(123, 216, 238, 0.22) 0 98%, transparent 100%),
    radial-gradient(140px 65px at 62% 14%, rgba(255, 212, 93, 0.24) 0 98%, transparent 100%),
    radial-gradient(130px 62px at 86% 18%, rgba(255, 112, 120, 0.16) 0 98%, transparent 100%);
  content: "";
}

.app-shell {
  position: relative;
  z-index: 1;
}

.cloud {
  position: absolute;
  width: 150px;
  height: 48px;
  border: 3px solid rgba(23, 50, 77, 0.16);
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.78);
  box-shadow: 8px 8px 0 rgba(123, 216, 238, 0.14);
  animation: cloudDrift 48s linear infinite;
}

.cloud::before,
.cloud::after {
  position: absolute;
  bottom: 18px;
  border: 3px solid rgba(23, 50, 77, 0.16);
  border-bottom: 0;
  border-radius: 999px 999px 0 0;
  background: rgba(255, 253, 247, 0.9);
  content: "";
}

.cloud::before {
  left: 24px;
  width: 48px;
  height: 38px;
}

.cloud::after {
  left: 66px;
  width: 58px;
  height: 46px;
}

.cloud-one {
  top: 12%;
  left: -190px;
  animation-duration: 54s;
}

.cloud-two {
  top: 38%;
  left: -260px;
  width: 190px;
  opacity: 0.72;
  animation-delay: -18s;
  animation-duration: 64s;
}

.cloud-three {
  top: 68%;
  left: -210px;
  width: 170px;
  opacity: 0.58;
  animation-delay: -34s;
  animation-duration: 58s;
}

.sky-star {
  position: absolute;
  color: rgba(47, 128, 237, 0.32);
  font-size: 2.2rem;
  font-weight: 900;
  line-height: 1;
  text-shadow: 2px 2px 0 rgba(255, 253, 247, 0.75);
  animation: floatBob 7s ease-in-out infinite;
}

.star-one {
  top: 17%;
  right: 17%;
}

.star-two {
  top: 58%;
  left: 7%;
  color: rgba(255, 112, 120, 0.28);
  animation-delay: -2s;
}

.paper-plane {
  position: absolute;
  --plane-scale: 1;
  width: 0;
  height: 0;
  border-top: 16px solid transparent;
  border-bottom: 16px solid transparent;
  border-left: 42px solid rgba(255, 253, 247, 0.78);
  filter: drop-shadow(2px 3px 0 rgba(23, 50, 77, 0.18));
  animation: planeGlide 22s linear infinite;
}

.paper-plane::after {
  position: absolute;
  top: -2px;
  left: -38px;
  width: 35px;
  height: 3px;
  background: rgba(47, 128, 237, 0.3);
  transform: rotate(-21deg);
  content: "";
}

.plane-one {
  top: 25%;
  left: -80px;
}

.plane-two {
  top: 74%;
  left: -110px;
  --plane-scale: 0.72;
  animation-delay: -11s;
  animation-duration: 28s;
}

.pencil-float {
  position: absolute;
  --pencil-angle: 0deg;
  --pencil-scale: 1;
  width: 92px;
  height: 18px;
  border: 3px solid rgba(23, 50, 77, 0.2);
  border-radius: 5px;
  background:
    linear-gradient(90deg, #ffd45d 0 72%, #fffdf7 72% 84%, #ff7078 84%);
  box-shadow: 4px 4px 0 rgba(23, 50, 77, 0.1);
  animation: pencilBob 9s ease-in-out infinite;
}

.pencil-float::before {
  position: absolute;
  top: -3px;
  left: -18px;
  width: 0;
  height: 0;
  border-top: 9px solid transparent;
  border-right: 18px solid rgba(23, 50, 77, 0.32);
  border-bottom: 9px solid transparent;
  content: "";
}

.pencil-one {
  top: 31%;
  right: 6%;
  --pencil-angle: -11deg;
}

.pencil-two {
  top: 82%;
  right: 26%;
  --pencil-angle: 9deg;
  --pencil-scale: 0.82;
  animation-delay: -4s;
}

.character-tile {
  position: absolute;
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 3px solid rgba(23, 50, 77, 0.22);
  border-radius: 12px 6px 12px 6px;
  background: rgba(255, 253, 247, 0.76);
  color: rgba(23, 50, 77, 0.42);
  font-family: "Kaiti SC", STKaiti, FangSong, SimSun, serif;
  font-size: 1.8rem;
  font-weight: 900;
  box-shadow: 5px 5px 0 rgba(255, 112, 120, 0.18);
  animation: tileFloat 11s ease-in-out infinite;
}

.tile-one {
  top: 18%;
  left: 9%;
}

.tile-two {
  top: 47%;
  right: 10%;
  animation-delay: -3s;
}

.tile-three {
  top: 77%;
  left: 16%;
  animation-delay: -7s;
}

button,
select {
  font: inherit;
}

button {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  cursor: pointer;
}

select {
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

button:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(47, 128, 237, 0.52);
  outline-offset: 3px;
}

.app-shell {
  width: min(var(--page-max), 100%);
  margin: 0 auto;
  padding: 18px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 16px;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(2px);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.brand {
  display: grid;
  flex: 1 1 360px;
  grid-template-columns: minmax(112px, 160px) minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-left {
  display: grid;
  justify-items: start;
  gap: 8px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  flex: 0 0 112px;
  width: 112px;
  height: 48px;
  appearance: none;
  padding: 0;
  border: 0;
  place-items: center;
  border-radius: 16px 8px 16px 8px;
  background: #fff2c3;
  box-shadow: 5px 5px 0 var(--coral);
  cursor: pointer;
  overflow: hidden;
}

.brand-mark:focus-visible {
  outline: 3px solid var(--sky);
  outline-offset: 4px;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
}

.brand-title {
  min-width: 0;
  justify-self: center;
  text-align: center;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(1.45rem, 2vw, 2rem);
  line-height: 1.05;
}

.brand p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
}

.top-stats {
  display: grid;
  grid-template-columns: auto minmax(170px, 250px) auto;
  align-items: center;
  gap: 10px;
}

.top-actions {
  display: flex;
  flex: 1 1 420px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  margin-left: auto;
  max-width: 100%;
  min-width: 0;
}

.active-user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 12px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
}

.active-user-chip span {
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 900;
  white-space: nowrap;
}

.logout-button {
  min-width: 92px;
  height: 42px;
  padding: 0 12px;
  font-size: 0.82rem;
  white-space: nowrap;
}

.language-control,
.skin-control {
  display: grid;
  flex: 0 0 auto;
  gap: 3px;
  min-width: 134px;
  font-weight: 900;
}

.skin-control {
  min-width: 118px;
}

.language-control span,
.skin-control span {
  color: var(--muted);
  font-size: 0.64rem;
  line-height: 1;
  text-transform: uppercase;
}

.language-control select,
.skin-control select {
  width: 100%;
  height: 40px;
  padding: 0 8px;
  border-width: 2px;
  background: var(--paper);
  font-size: 0.82rem;
}

.daily-lesson {
  display: flex;
  flex: 1 1 430px;
  align-items: center;
  gap: 10px;
  max-width: 540px;
  min-width: 310px;
  padding: 8px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(255, 212, 93, 0.32), rgba(123, 216, 238, 0.24)),
    var(--paper);
  box-shadow: 0 4px 0 var(--ink);
}

body:not([data-screen="home"]) .daily-lesson {
  display: none;
}

.daily-calendar {
  display: grid;
  flex: 0 0 54px;
  width: 54px;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
}

.daily-calendar span {
  padding: 2px 0;
  background: var(--coral);
  color: #ffffff;
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0;
}

.daily-calendar strong {
  padding: 2px 0 4px;
  font-size: 1.45rem;
  line-height: 1;
}

.daily-copy {
  display: grid;
  flex: 1 1 auto;
  min-width: 0;
  gap: 2px;
}

.daily-label {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.daily-copy strong {
  overflow: hidden;
  font-size: 0.98rem;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.daily-copy span:last-child {
  overflow: hidden;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.daily-start-button {
  flex: 0 0 auto;
  min-width: 108px;
  height: 40px;
  padding: 0 10px;
  background: var(--sun);
}

.company-logo {
  display: grid;
  width: clamp(112px, 11vw, 156px);
  max-width: 100%;
  min-height: 28px;
  overflow: hidden;
  place-items: center;
  justify-self: start;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.company-logo img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 32px;
  object-fit: contain;
}

@media (max-width: 1120px) {
  body[data-screen="home"] .topbar,
  body[data-screen="login"] .topbar {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  body[data-screen="home"] .top-actions,
  body[data-screen="login"] .top-actions {
    display: none;
  }
}

.stat-pill,
.xp-wrap {
  min-height: 58px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
}

.stat-pill {
  display: grid;
  place-items: center;
  min-width: 86px;
  padding: 6px 12px;
}

.stat-pill span,
.xp-wrap span,
.tiny-label,
.select-label,
.char-facts span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.stat-pill strong {
  font-size: 1.5rem;
  line-height: 1;
}

.xp-wrap {
  display: grid;
  gap: 7px;
  padding: 9px 12px;
}

.xp-track {
  height: 12px;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #e9f2f7;
}

.xp-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--leaf), var(--sun), var(--coral));
  transition: width 220ms ease;
}

.layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) 1fr;
  gap: 18px;
  margin-top: 18px;
}

.side-column,
.main-column {
  min-width: 0;
}

.side-column {
  display: grid;
  align-content: start;
  gap: 14px;
}

.panel,
.workspace,
.mode-tabs {
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel {
  padding: 14px;
}

.panel-head,
.lesson-strip,
.quiz-head,
.character-tools,
.action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel h2,
.lesson-strip h2,
.quiz-head h2 {
  margin-top: 2px;
  font-size: 1.15rem;
}

.feedback-copy {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.95rem;
}

.select-label {
  display: block;
  margin-top: 12px;
  margin-bottom: 6px;
}

select {
  width: 100%;
  height: 42px;
  padding: 0 10px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font-weight: 800;
}

.lesson-map {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
  max-height: 178px;
  margin-top: 12px;
  overflow: auto;
  padding-right: 4px;
}

.lesson-dot {
  display: grid;
  min-width: 0;
  height: 34px;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
}

.lesson-dot.active {
  background: var(--sky);
}

.lesson-dot.complete {
  background: var(--leaf);
  color: #06200d;
}

.sticker-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.sticker {
  display: grid;
  aspect-ratio: 1;
  min-width: 0;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  font-size: 1.3rem;
  font-weight: 900;
  animation: itemRise 360ms ease both;
  animation-delay: calc(var(--stagger, 0) * 46ms);
}

.sticker.earned {
  background: var(--sun);
  animation: stickerPop 660ms ease both;
  animation-delay: calc(var(--stagger, 0) * 52ms);
}

.source-panel summary {
  cursor: pointer;
  font-weight: 900;
}

.source-panel ul {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.88rem;
}

.main-column {
  display: grid;
  align-content: start;
  gap: 14px;
}

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  overflow: hidden;
  padding: 0;
}

.mode-tab {
  height: 54px;
  border: 0;
  border-right: 3px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font-weight: 900;
}

.mode-tab:last-child {
  border-right: 0;
}

.mode-tab.active {
  background: var(--sun);
}

.workspace {
  padding: 16px;
}

.hidden {
  display: none !important;
}

.lesson-strip {
  min-height: 72px;
  padding: 12px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: linear-gradient(90deg, rgba(84, 184, 106, 0.16), rgba(123, 216, 238, 0.16));
}

.lesson-chars,
.word-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.char-chip,
.word-chip {
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-weight: 900;
}

.char-chip {
  min-width: 46px;
  height: 46px;
  font-size: 1.45rem;
}

.char-chip.active {
  background: var(--coral);
  color: #230507;
}

.char-chip.seen {
  box-shadow: inset 0 -8px 0 rgba(84, 184, 106, 0.4);
}

.study-grid {
  display: grid;
  grid-template-columns: minmax(230px, 0.78fr) minmax(300px, 1.2fr);
  gap: 14px;
  margin-top: 14px;
}

.character-card,
.info-card,
.writing-card,
.feedback-card,
.quiz-shell {
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--surface);
}

.character-card {
  position: relative;
  display: grid;
  grid-template-rows: auto auto auto auto auto auto 1fr auto;
  align-content: stretch;
  justify-items: start;
  gap: 10px;
  min-height: 470px;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(255, 212, 93, 0.35), transparent 45%),
    var(--paper);
  overflow: hidden;
}

.character-card::after {
  position: absolute;
  inset: 16% 12% auto auto;
  width: 70px;
  height: 70px;
  border: 3px dashed rgba(255, 112, 120, 0.34);
  border-radius: 50%;
  pointer-events: none;
  animation: slowSpin 10s linear infinite;
  content: "";
}

.character-tools {
  position: relative;
  z-index: 10;
  display: flex;
  grid-row: 8;
  align-items: center;
  align-self: end;
  justify-content: space-between;
  justify-self: stretch;
  width: 100%;
  margin-top: 16px;
}

.icon-button,
.speak-button,
.small-button,
.primary-button,
.secondary-button,
.answer-option {
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  color: var(--ink);
  font-weight: 900;
  box-shadow: 0 4px 0 var(--ink);
  transition:
    transform 160ms cubic-bezier(0.2, 0.8, 0.24, 1),
    box-shadow 160ms ease,
    background 160ms ease,
    filter 160ms ease;
  will-change: transform;
}

.icon-button:hover:not(:disabled),
.speak-button:hover:not(:disabled),
.small-button:hover:not(:disabled),
.primary-button:hover:not(:disabled),
.secondary-button:hover:not(:disabled),
.answer-option:hover:not(:disabled),
.audio-button:hover:not(:disabled),
.dialogue-word-card:hover:not(:disabled),
.roleplay-reading:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--ink);
  filter: saturate(1.08);
}

.icon-button:active,
.speak-button:active,
.small-button:active,
.primary-button:active,
.secondary-button:active,
.answer-option:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--ink);
}

.icon-button::after,
.speak-button::after,
.small-button::after,
.primary-button::after,
.secondary-button::after,
.answer-option::after,
.audio-button::after,
.dialogue-word-card::after,
.roleplay-reading::after {
  position: absolute;
  inset: -42% auto auto -70%;
  z-index: 0;
  width: 54%;
  height: 180%;
  background: rgba(255, 255, 255, 0.36);
  transform: rotate(22deg) translateX(0);
  transition: transform 420ms ease;
  pointer-events: none;
  content: "";
}

.icon-button:hover:not(:disabled)::after,
.speak-button:hover:not(:disabled)::after,
.small-button:hover:not(:disabled)::after,
.primary-button:hover:not(:disabled)::after,
.secondary-button:hover:not(:disabled)::after,
.answer-option:hover:not(:disabled)::after,
.audio-button:hover:not(:disabled)::after,
.dialogue-word-card:hover:not(:disabled)::after,
.roleplay-reading:hover:not(:disabled)::after {
  transform: rotate(22deg) translateX(260%);
}

.icon-button {
  width: 44px;
  height: 44px;
  background: var(--surface);
  font-size: 2rem;
  line-height: 1;
}

.speak-button {
  position: relative;
  z-index: 11;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 122px;
  height: 44px;
  background: var(--sky);
  touch-action: manipulation;
}

.speak-button.is-playing {
  background: var(--sun);
}

.small-button.is-playing,
.dialogue-word-card.is-playing {
  background: var(--sun);
}

.cartoon-speaker-icon {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: var(--speaker-size, 24px);
  height: var(--speaker-size, 24px);
  overflow: visible;
  transform: rotate(-7deg);
  filter: drop-shadow(1.5px 2px 0 rgba(23, 50, 77, 0.22));
}

.cartoon-speaker-icon::before {
  position: absolute;
  top: 25%;
  left: 6%;
  width: 56%;
  height: 50%;
  border-radius: 4px;
  background: var(--ink);
  clip-path: polygon(0 28%, 34% 28%, 78% 0, 78% 100%, 34% 72%, 0 72%);
  content: "";
}

.cartoon-speaker-icon::after {
  position: absolute;
  top: 12%;
  right: -4%;
  width: 56%;
  height: 76%;
  background:
    radial-gradient(ellipse at 0 50%, transparent 0 42%, var(--coral) 43% 51%, transparent 52% 66%, var(--ink) 67% 76%, transparent 77%);
  clip-path: polygon(18% 0, 100% 0, 100% 100%, 18% 100%);
  content: "";
}

.speaker-icon-large {
  --speaker-size: 26px;
}

.speaker-icon-small {
  --speaker-size: 20px;
}

.speak-button.is-playing .cartoon-speaker-icon,
.audio-button.is-playing .cartoon-speaker-icon,
.dialogue-word-card.is-playing .cartoon-speaker-icon {
  animation: speakerBounce 520ms ease infinite;
}

.big-char {
  display: grid;
  grid-row: 1;
  min-height: 0;
  place-items: start;
  justify-self: start;
  color: var(--ink);
  font-family: "Kaiti SC", "KaiTi", "STKaiti", serif;
  font-size: clamp(8rem, 16vw, 13rem);
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
  text-shadow: 5px 6px 0 rgba(123, 216, 238, 0.18);
}

.big-char.char-pop {
  animation: charPop 520ms cubic-bezier(0.2, 0.8, 0.24, 1);
}

.character-card:hover .big-char {
  animation: charWobble 680ms ease;
}

.pinyin {
  text-align: center;
  color: var(--coral);
  font-size: 2.2rem;
  font-weight: 900;
  pointer-events: none;
}

.meaning {
  max-width: 100%;
  margin: 8px auto 0;
  color: var(--muted);
  text-align: center;
  font-size: 1rem;
  font-weight: 800;
  pointer-events: none;
}

.character-card .character-status-badge {
  grid-row: 2;
  justify-self: start;
}

.character-card .pinyin {
  grid-row: 3;
  justify-self: start;
  text-align: left;
}

.character-card .meaning {
  grid-row: 4;
  justify-self: start;
  margin: 0;
  text-align: left;
}

.character-card .character-evolution-section {
  z-index: 1;
  grid-row: 5;
  width: 100%;
  margin-top: 4px;
}

.character-card .evolution-video-section {
  z-index: 1;
  grid-row: 6;
  width: 100%;
}

.character-card .info-section h3 {
  font-size: 0.9rem;
}

.character-card .font-evolution-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.character-card .font-evolution-item {
  min-height: 92px;
  padding: 6px;
}

.character-card .font-evolution-item img {
  width: 52px;
  height: 52px;
}

.info-card,
.writing-card,
.feedback-card {
  padding: 16px;
}

.info-card {
  display: grid;
  gap: 16px;
}

.info-section {
  display: grid;
  gap: 8px;
}

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

.meaning-speak-button {
  grid-row: auto;
  grid-column: auto;
  width: 32px;
  height: 32px;
  justify-self: end;
}

.info-section h3,
.writing-card h3,
.feedback-card h3 {
  font-size: 1rem;
}

.info-section p {
  color: var(--muted);
  line-height: 1.5;
}

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

.font-evolution-item {
  display: grid;
  justify-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 108px;
  margin: 0;
  padding: 8px;
  border: 2px solid rgba(23, 50, 77, 0.18);
  border-radius: var(--radius-sm);
  background: var(--paper);
}

.font-evolution-item img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.font-evolution-item figcaption,
.font-evolution-empty {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1.2;
  text-align: center;
}

.compact-font-evolution .font-evolution-item {
  min-height: 92px;
  padding: 6px;
}

.compact-font-evolution .font-evolution-item img {
  width: 52px;
  height: 52px;
}

.evolution-video-section {
  align-content: start;
}

.evolution-video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  background: #111827;
  object-fit: contain;
}

.word-chip {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px;
  min-width: 104px;
  min-height: 62px;
  padding: 8px 10px;
  background: var(--paper);
  transition:
    transform 170ms ease,
    box-shadow 170ms ease,
    background 170ms ease;
  animation: itemRise 360ms ease both;
  animation-delay: calc(var(--stagger, 0) * 46ms);
}

.word-chip:hover {
  transform: translateY(-2px);
}

.word-chip strong {
  grid-column: 1;
  font-size: 1.25rem;
}

.word-chip span {
  grid-column: 1;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.audio-button {
  display: grid;
  grid-row: 1 / span 2;
  grid-column: 2;
  width: 34px;
  height: 34px;
  place-items: center;
  align-self: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--sky);
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 900;
  box-shadow: 0 3px 0 var(--ink);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.audio-button:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--ink);
}

.audio-button.is-playing {
  background: var(--sun);
}

.writing-card {
  display: grid;
  gap: 12px;
  min-height: 330px;
}

.writer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.small-button {
  min-width: 82px;
  height: 38px;
  background: var(--paper);
}

.stroke-target {
  display: grid;
  width: min(100%, 260px);
  aspect-ratio: 1;
  place-items: center;
  justify-self: center;
  border: 3px dashed rgba(23, 50, 77, 0.36);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, transparent 49%, rgba(23, 50, 77, 0.13) 49%, rgba(23, 50, 77, 0.13) 51%, transparent 51%),
    linear-gradient(0deg, transparent 49%, rgba(23, 50, 77, 0.13) 49%, rgba(23, 50, 77, 0.13) 51%, transparent 51%),
    var(--paper);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.stroke-target.writer-ready {
  animation: writerReady 620ms ease;
}

.stroke-target.writer-wiggle {
  animation: writerWiggle 620ms ease;
}

.stroke-target.good-stroke {
  box-shadow: 0 0 0 5px rgba(84, 184, 106, 0.18);
  animation: goodStroke 420ms ease;
}

.writer-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--muted);
  text-align: center;
  font-weight: 900;
}

.camera-panel {
  position: relative;
  display: grid;
  gap: 10px;
  width: min(100%, 680px);
  justify-self: center;
  padding: 10px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(123, 216, 238, 0.18), rgba(255, 212, 93, 0.14)),
    var(--surface);
}

.camera-video {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.camera-canvas {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  cursor: crosshair;
  touch-action: none;
}

.camera-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.camera-toolbar p {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 900;
  line-height: 1.3;
}

.camera-toolbar div {
  display: flex;
  gap: 8px;
}

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

.char-facts div {
  min-width: 0;
  padding: 10px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  animation: itemRise 360ms ease both;
  animation-delay: calc(var(--stagger, 0) * 48ms);
}

.char-facts div:nth-child(2) {
  --stagger: 1;
}

.char-facts div:nth-child(3) {
  --stagger: 2;
}

.char-facts strong {
  display: block;
  overflow-wrap: anywhere;
  margin-top: 4px;
  font-size: 1rem;
}

.feedback-card {
  display: grid;
  gap: 14px;
  background: linear-gradient(180deg, rgba(255, 112, 120, 0.1), rgba(255, 212, 93, 0.16));
}

#coachMessage {
  min-height: 56px;
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 850;
  line-height: 1.4;
}

.action-row {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.primary-button,
.secondary-button {
  min-width: 132px;
  height: 44px;
  padding: 0 14px;
}

.primary-button {
  background: var(--leaf);
}

.secondary-button {
  background: var(--surface);
}

.quiz-shell {
  display: grid;
  gap: 18px;
  min-height: 620px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(123, 216, 238, 0.2), transparent 38%),
    var(--surface);
}

.quiz-progress {
  min-width: 88px;
  padding: 10px 12px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--sun);
  text-align: center;
  font-weight: 900;
  transition:
    transform 180ms ease,
    background 180ms ease;
}

.quiz-progress.counter-bump,
.xp-fill.xp-bump,
.stat-pill.stat-bump {
  animation: counterBump 460ms ease;
}

.quiz-body {
  display: grid;
  gap: 16px;
}

.quiz-prompt {
  display: grid;
  gap: 10px;
  min-height: 170px;
  align-content: center;
  padding: 18px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  text-align: center;
  animation: promptPop 420ms cubic-bezier(0.2, 0.8, 0.24, 1);
}

.quiz-char {
  font-family: "Kaiti SC", "KaiTi", "STKaiti", serif;
  font-size: clamp(5rem, 12vw, 8rem);
  font-weight: 900;
  line-height: 1;
}

.quiz-question {
  color: var(--muted);
  font-size: 1.08rem;
  font-weight: 900;
}

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

.answer-option {
  min-height: 72px;
  padding: 10px;
  background: var(--surface);
  font-size: 1rem;
  animation: itemRise 340ms ease both;
  animation-delay: calc(var(--stagger, 0) * 54ms);
}

.answer-option.correct {
  background: var(--leaf);
  animation: correctPop 520ms ease;
}

.answer-option.wrong {
  background: var(--coral);
  animation: wrongShake 360ms ease;
}

.quiz-feedback {
  min-height: 52px;
  color: var(--ink);
  font-weight: 900;
  transition: color 160ms ease, transform 160ms ease;
}

.quiz-feedback.success {
  color: #0e6025;
  animation: feedbackPop 420ms ease;
}

.quiz-feedback.needs-review {
  color: #8d242a;
  animation: feedbackPop 420ms ease;
}

.quiz-actions {
  align-self: end;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: min(380px, calc(100vw - 36px));
  padding: 12px 14px;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--ink);
  font-weight: 900;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.celebration-layer {
  position: fixed;
  inset: 0;
  z-index: 30;
  overflow: hidden;
  pointer-events: none;
}

.sparkle-particle,
.floating-score,
.press-ripple {
  pointer-events: none;
}

.sparkle-particle {
  position: fixed;
  left: 0;
  top: 0;
  color: var(--sparkle-color, var(--coral));
  font-size: var(--sparkle-size, 1.15rem);
  font-weight: 950;
  text-shadow: 1px 2px 0 rgba(255, 253, 247, 0.85);
  transform: translate(-50%, -50%);
  animation: sparkleFly 820ms cubic-bezier(0.16, 0.82, 0.24, 1) forwards;
}

.floating-score {
  position: fixed;
  left: 0;
  top: 0;
  padding: 4px 8px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--sun);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 950;
  box-shadow: 0 3px 0 var(--ink);
  transform: translate(-50%, -50%);
  animation: scoreFloat 920ms ease forwards;
}

.press-ripple {
  position: absolute;
  z-index: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.62);
  transform: translate(-50%, -50%) scale(0);
  animation: buttonRipple 520ms ease-out forwards;
}

.flow {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

body[data-screen="home"] .top-stats,
body[data-screen="login"] .top-stats {
  display: none;
}

body[data-screen="home"] .topbar,
body[data-screen="login"] .topbar {
  justify-content: center;
}

body[data-screen="home"] .top-actions,
body[data-screen="login"] .top-actions {
  display: none;
}

.home-card,
.screen-card {
  width: min(var(--page-max), 100%);
  margin: 0 auto;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(2px);
  box-shadow: var(--shadow);
}

.home-card:not(.hidden),
.screen-card:not(.hidden) {
  animation: screenArrive 420ms cubic-bezier(0.2, 0.8, 0.24, 1);
}

.screen-enter {
  animation: screenArrive 420ms cubic-bezier(0.2, 0.8, 0.24, 1);
}

.home-card {
  display: grid;
  gap: 14px;
  max-width: 620px;
  padding: 18px;
}

.home-card .select-label {
  margin: 0;
  font-size: 0.92rem;
}

.home-card select {
  height: 54px;
  font-size: 1.02rem;
}

.start-button {
  width: 100%;
  height: 56px;
  font-size: 1.1rem;
}

.login-card {
  display: grid;
  gap: 18px;
  max-width: 960px;
  padding: 22px;
}

.login-copy {
  display: grid;
  gap: 8px;
  justify-items: center;
  text-align: center;
}

.login-copy h2 {
  font-size: clamp(1.7rem, 3vw, 2.6rem);
  line-height: 1.05;
}

.login-copy p {
  max-width: 520px;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 850;
  line-height: 1.45;
}

.login-user-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.login-user-card {
  position: relative;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 104px;
  padding: 14px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 5px 0 var(--ink);
  cursor: pointer;
  overflow: hidden;
  transition:
    transform 170ms ease,
    box-shadow 170ms ease,
    filter 170ms ease;
}

.login-user-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 0 var(--ink);
  filter: saturate(1.06);
}

.login-user-card:nth-child(3n + 1) {
  background: rgba(232, 240, 255, 0.94);
}

.login-user-card:nth-child(3n + 2) {
  background: rgba(255, 247, 224, 0.94);
}

.login-user-card:nth-child(3n) {
  background: rgba(229, 247, 223, 0.94);
}

.login-user-card.last-used {
  box-shadow: 0 5px 0 var(--ink), inset 0 0 0 4px rgba(255, 212, 93, 0.55);
}

.login-user-avatar {
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--surface);
  font-size: 1.9rem;
  font-weight: 1000;
  line-height: 1;
  box-shadow: inset 0 -8px 0 rgba(47, 128, 237, 0.08);
}

.login-user-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
  align-content: center;
}

.login-user-copy strong {
  font-size: 1.18rem;
  line-height: 1.1;
}

.login-user-copy span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
  line-height: 1.3;
}

.login-user-actions {
  display: grid;
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  width: auto;
  min-width: 0;
  margin: 0;
}

.login-profile-edit {
  display: grid;
  width: 34px;
  height: 34px;
  min-height: 0;
  place-items: center;
  padding: 0;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--sun);
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 950;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
}

.login-profile-edit {
  background: var(--surface);
}

.login-user-card em {
  position: absolute;
  top: auto;
  right: 8px;
  bottom: 8px;
  padding: 4px 8px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--leaf);
  color: #06200d;
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 950;
}

body[data-screen="login"] {
  background:
    linear-gradient(180deg, #12a8ef 0%, #72ddff 34%, #fff5d7 78%, #67cb4a 100%);
}

body[data-screen="login"] .cartoon-sky,
body[data-screen="login"] .topbar {
  display: none;
}

body[data-screen="login"] .app-shell {
  padding: 0;
}

body[data-screen="login"] .flow {
  margin-top: 0;
}

.quest-login {
  position: relative;
  display: grid;
  gap: 18px;
  min-height: 100vh;
  max-width: none;
  padding: 0 28px 24px;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(180deg, #4dcffa 0 24%, #fff8e3 24% 78%, #7fd454 100%);
  box-shadow: none;
  overflow: hidden;
}

.quest-login::before,
.quest-login::after {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  content: "";
}

.quest-login::before {
  right: -40px;
  bottom: -20px;
  left: -40px;
  height: 180px;
  background:
    radial-gradient(130px 70px at 7% 82%, #32bd43 0 68%, transparent 69%),
    radial-gradient(170px 75px at 91% 82%, #3fc34a 0 70%, transparent 71%),
    linear-gradient(180deg, transparent 0 34%, #80d94a 35% 100%);
}

.quest-login::after {
  inset: 0;
  background:
    radial-gradient(62px 30px at 17% 13%, rgba(255, 255, 255, 0.86) 0 98%, transparent 100%),
    radial-gradient(92px 38px at 24% 15%, rgba(255, 255, 255, 0.78) 0 98%, transparent 100%),
    radial-gradient(70px 32px at 70% 8%, rgba(255, 255, 255, 0.8) 0 98%, transparent 100%);
  opacity: 0.78;
}

.login-hero,
.login-panel,
.login-footer {
  position: relative;
  z-index: 1;
}

.login-hero {
  min-height: 330px;
  margin: 0 -28px;
  padding: 28px 28px 18px;
  background:
    radial-gradient(170px 92px at 2% 95%, #73d847 0 72%, transparent 73%),
    radial-gradient(230px 118px at 96% 92%, #6ed446 0 72%, transparent 73%),
    radial-gradient(250px 130px at 50% 98%, #55c83f 0 68%, transparent 69%),
    linear-gradient(180deg, #08a9ef 0%, #63d9ff 58%, #abe961 100%);
  overflow: hidden;
}

.login-hero::before,
.login-hero::after {
  position: absolute;
  top: -82px;
  width: 285px;
  height: 185px;
  border-radius: 0 0 145px 145px;
  background:
    radial-gradient(circle at 18% 30%, #83d745 0 18%, transparent 19%),
    radial-gradient(circle at 43% 22%, #55b72f 0 20%, transparent 21%),
    radial-gradient(circle at 66% 42%, #77d33f 0 19%, transparent 20%),
    radial-gradient(circle at 84% 20%, #3fa826 0 16%, transparent 17%),
    #287321;
  box-shadow: 0 8px 0 rgba(20, 91, 36, 0.2);
  content: "";
}

.login-hero::before {
  left: -58px;
  transform: rotate(8deg);
}

.login-hero::after {
  right: -58px;
  transform: rotate(-8deg);
}

.login-sign {
  position: absolute;
  top: 22px;
  left: 28px;
  display: grid;
  width: 184px;
  min-height: 76px;
  place-items: center;
  padding: 8px 14px;
  border: 4px solid #93531f;
  border-radius: 26px 12px 26px 12px;
  background: linear-gradient(180deg, #ffe7a0, #ffd06d);
  color: #0d3152;
  box-shadow: 0 8px 0 rgba(82, 45, 18, 0.35);
  transform: rotate(1deg);
}

.login-sign strong {
  font-size: 1.78rem;
  font-weight: 1000;
  line-height: 1;
}

.login-sign span {
  color: #123652;
  font-size: 0.78rem;
  font-weight: 950;
}

.login-lantern {
  position: absolute;
  top: 80px;
  right: 68px;
  width: 50px;
  height: 62px;
  border: 3px solid #b33416;
  border-radius: 50% 50% 42% 42%;
  background:
    linear-gradient(90deg, transparent 0 18%, rgba(255, 242, 150, 0.45) 19% 22%, transparent 23% 47%, rgba(255, 242, 150, 0.45) 48% 52%, transparent 53% 78%, rgba(255, 242, 150, 0.45) 79% 82%, transparent 83%),
    #ff6c2c;
  box-shadow: 0 8px 0 rgba(119, 48, 16, 0.18);
}

.login-lantern::before,
.login-lantern::after {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  content: "";
}

.login-lantern::before {
  top: -34px;
  width: 2px;
  height: 34px;
  background: #6f421c;
}

.login-lantern::after {
  bottom: -22px;
  width: 18px;
  height: 22px;
  border-radius: 0 0 999px 999px;
  background: #ffcf45;
}

.quest-login .login-copy {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  max-width: 700px;
  margin: 0 auto;
  padding-top: 12px;
  text-align: center;
}

.login-title {
  color: #ffffff;
  font-size: 6.1rem;
  font-weight: 1000;
  line-height: 0.95;
  text-shadow:
    0 8px 0 rgba(17, 99, 166, 0.34),
    0 11px 24px rgba(11, 91, 150, 0.28);
}

.login-ribbon {
  margin-top: 14px;
  padding: 10px 34px;
  border: 3px solid #f2a829;
  border-radius: 999px;
  background: #ffd968;
  color: #d85818;
  font-size: 1.45rem;
  font-weight: 1000;
  box-shadow: 0 5px 0 rgba(169, 98, 19, 0.25);
}

.quest-login .login-copy strong {
  margin-top: 12px;
  color: #083b6b;
  font-size: 1.9rem;
  line-height: 1;
}

.quest-login .login-copy p {
  margin-top: 8px;
  max-width: none;
  color: #123652;
  font-size: 1rem;
  font-weight: 850;
}

.login-mascot {
  position: absolute;
  z-index: 2;
  filter: drop-shadow(0 8px 0 rgba(21, 74, 43, 0.18));
  line-height: 1;
  pointer-events: none;
}

.login-panda {
  bottom: 14px;
  left: 30px;
  font-size: 9.2rem;
}

.login-bird {
  top: 58px;
  right: 245px;
  font-size: 3.4rem;
  transform: rotate(-8deg);
}

.login-fox {
  right: 250px;
  bottom: 38px;
  font-size: 5.7rem;
}

.login-rabbit {
  right: 120px;
  bottom: 34px;
  font-size: 5.8rem;
}

.login-duck {
  right: 20px;
  bottom: 38px;
  font-size: 5.2rem;
}

.login-panel {
  display: grid;
  gap: 16px;
  margin-top: -6px;
  padding: 20px;
  border: 2px solid rgba(23, 50, 77, 0.34);
  border-radius: 24px 24px 8px 8px;
  background: rgba(255, 253, 247, 0.95);
  box-shadow: 0 8px 20px rgba(63, 64, 34, 0.18);
}

.login-panel-head {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.login-panel-icon {
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 18px 8px 18px 8px;
  background: #ff747d;
  color: #ffffff;
  font-size: 2.4rem;
  font-weight: 1000;
  box-shadow: 4px 4px 0 #fff2c3;
}

.login-panel h2 {
  color: #123652;
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  line-height: 1.08;
}

.login-panel p {
  margin-top: 6px;
  color: #244763;
  font-size: 1rem;
  font-weight: 850;
  line-height: 1.35;
}

.quest-login .login-user-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.quest-login .login-user-card {
  grid-template-columns: 58px minmax(0, 1fr);
  min-height: 176px;
  align-content: start;
  align-items: start;
  padding: 14px;
  background: linear-gradient(180deg, #fff6dc, #fffdf7);
}

.quest-login .login-user-card:nth-child(3n + 1) {
  background: linear-gradient(180deg, #eaf8ff, #fffdf7);
}

.quest-login .login-user-card:nth-child(3n + 2) {
  background: linear-gradient(180deg, #fff0dd, #fffdf7);
}

.quest-login .login-user-card:nth-child(3n) {
  background: linear-gradient(180deg, #e9f8df, #fffdf7);
}

.quest-login .login-user-card::after {
  position: absolute;
  right: 10px;
  bottom: 54px;
  font-size: 3rem;
  line-height: 1;
  filter: drop-shadow(0 5px 0 rgba(23, 50, 77, 0.12));
  content: "📚";
}

.quest-login .login-user-card:nth-child(2n)::after {
  content: "✏️";
}

.quest-login .login-user-card:nth-child(3n)::after {
  content: "⭐";
}

.quest-login .login-user-avatar {
  width: 56px;
  height: 56px;
  border-radius: var(--radius);
  background: #a8e99c;
  color: #00375d;
}

.quest-login .login-user-card:nth-child(2n) .login-user-avatar {
  background: #ff9fb0;
}

.quest-login .login-user-card:nth-child(3n) .login-user-avatar {
  background: #ffd15f;
}

.quest-login .login-user-card:nth-child(4n) .login-user-avatar {
  background: #c89aff;
}

.quest-login .login-user-copy {
  gap: 7px;
}

.quest-login .login-user-copy strong {
  color: #123652;
  font-size: 1.22rem;
}

.quest-login .login-user-copy span {
  color: #183f62;
  font-size: 0.8rem;
}

.quest-login .login-user-actions {
  top: 10px;
  right: 10px;
}

.quest-login .login-profile-edit {
  background: #ffd45d;
}

.login-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 18px;
  min-height: 76px;
  margin: 0 auto;
  padding: 12px 20px;
  border: 3px solid #f4a233;
  border-radius: 999px;
  background: #ff8f35;
  color: #ffffff;
  box-shadow: 0 8px 0 rgba(148, 76, 15, 0.25);
  text-align: center;
}

.login-footer span {
  display: inline-grid;
  place-items: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: var(--radius);
  background: #9b6124;
  font-weight: 950;
}

.login-footer strong {
  font-size: 1.65rem;
  line-height: 1.05;
}

@media (max-width: 1180px) {
  .quest-login .login-user-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .login-panda {
    font-size: 7rem;
  }

  .login-fox {
    right: 205px;
    font-size: 4.8rem;
  }

  .login-rabbit {
    right: 95px;
    font-size: 4.8rem;
  }

  .login-duck {
    font-size: 4.3rem;
  }
}

@media (max-width: 760px) {
  .quest-login {
    padding: 0 14px 18px;
  }

  .login-hero {
    min-height: 410px;
    margin: 0 -14px;
    padding: 96px 16px 18px;
  }

  .login-sign {
    left: 16px;
    width: 144px;
    min-height: 60px;
  }

  .login-sign strong {
    font-size: 1.32rem;
  }

  .login-lantern {
    top: 62px;
    right: 26px;
    width: 38px;
    height: 48px;
  }

  .login-title {
    font-size: 4rem;
  }

  .login-ribbon {
    padding: 8px 18px;
    font-size: 1.02rem;
  }

  .quest-login .login-copy strong {
    font-size: 1.42rem;
  }

  .login-panda {
    left: 12px;
    bottom: 38px;
    font-size: 4.9rem;
  }

  .login-bird {
    top: 76px;
    right: 76px;
    font-size: 2.45rem;
  }

  .login-fox {
    right: 132px;
    bottom: 64px;
    font-size: 3.6rem;
  }

  .login-rabbit {
    right: 60px;
    bottom: 62px;
    font-size: 3.6rem;
  }

  .login-duck {
    right: 6px;
    bottom: 64px;
    font-size: 3.2rem;
  }

  .login-panel {
    padding: 14px;
  }

  .login-panel-head {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .login-panel-icon {
    width: 58px;
    height: 58px;
    font-size: 1.8rem;
  }

  .quest-login .login-user-grid {
    grid-template-columns: 1fr;
  }

  .quest-login .login-user-card {
    min-height: 142px;
  }

  .login-footer {
    border-radius: var(--radius);
  }

  .login-footer strong {
    font-size: 1.25rem;
  }
}

.help-button {
  min-width: 112px;
  height: 40px;
  background: #e8f0ff;
}

.function-home {
  width: 100%;
  max-width: none;
}

.function-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(218px, 1fr));
  gap: 12px;
}

.function-card {
  position: relative;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  min-width: 0;
  min-height: 188px;
  align-content: stretch;
  align-items: start;
  gap: 8px;
  padding: 14px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: rgba(255, 253, 247, 0.92);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 5px 0 var(--ink);
  overflow: hidden;
  transform-origin: center bottom;
  transition:
    transform 180ms cubic-bezier(0.2, 0.8, 0.24, 1),
    box-shadow 180ms ease,
    filter 180ms ease;
  animation: itemRise 420ms ease both;
  animation-delay: calc(var(--stagger, 0) * 58ms);
}

.function-card::before {
  position: absolute;
  inset: 8px 8px auto auto;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 212, 93, 0.76) 0 10%, transparent 12%),
    radial-gradient(circle at 78% 52%, rgba(47, 128, 237, 0.32) 0 9%, transparent 11%),
    radial-gradient(circle at 28% 72%, rgba(255, 112, 120, 0.34) 0 8%, transparent 10%);
  opacity: 0.7;
  transform: rotate(0deg);
  transition: transform 320ms ease, opacity 180ms ease;
  content: "";
}

.function-card:hover {
  transform: translateY(-5px) rotate(-0.6deg);
  box-shadow: 0 9px 0 var(--ink);
  filter: saturate(1.08);
}

.function-card:hover::before {
  opacity: 1;
  transform: rotate(24deg) scale(1.08);
}

.function-card:hover .function-logo,
.function-card:hover .daily-calendar {
  animation: softBounce 520ms ease;
}

.function-card:nth-child(2) {
  background: rgba(255, 247, 224, 0.92);
  --stagger: 1;
}

.function-card:nth-child(3) {
  background: rgba(255, 247, 224, 0.92);
  --stagger: 2;
}

.function-card:nth-child(4) {
  background: rgba(229, 247, 223, 0.92);
  --stagger: 3;
}

.function-card:nth-child(5) {
  background: rgba(240, 234, 255, 0.92);
  --stagger: 4;
}

.function-card:nth-child(6) {
  background: rgba(229, 249, 244, 0.92);
  --stagger: 5;
}

.function-card:nth-child(7) {
  background: rgba(255, 240, 232, 0.92);
  --stagger: 6;
}

.function-card:nth-child(8) {
  background: rgba(232, 248, 255, 0.92);
  --stagger: 7;
}

.function-card:nth-child(9) {
  background: rgba(240, 234, 255, 0.92);
  --stagger: 8;
}

.function-card:nth-child(10) {
  --stagger: 9;
}

.database-card {
  grid-column: 1 / -1;
  min-height: 166px;
  background: rgba(255, 247, 224, 0.94);
  --stagger: 0;
}

.daily-function {
  background: rgba(255, 253, 247, 0.92);
  --stagger: 1;
}

.profile-function {
  background: rgba(232, 248, 255, 0.92);
  --stagger: 1;
}

.course-function {
  background: rgba(232, 240, 255, 0.92);
  --stagger: 2;
}

.dialogue-function {
  background: rgba(229, 247, 223, 0.92);
  --stagger: 3;
}

.roleplay-function {
  background: rgba(240, 234, 255, 0.92);
  --stagger: 4;
}

.how-to-play-card {
  background: rgba(229, 249, 244, 0.92);
  --stagger: 5;
}

.custom-function {
  background: rgba(255, 240, 232, 0.92);
  --stagger: 6;
}

.search-function {
  background: rgba(232, 248, 255, 0.92);
  --stagger: 7;
}

.idiom-function {
  background: rgba(240, 234, 255, 0.92);
  --stagger: 8;
}

.language-function {
  background: rgba(255, 247, 224, 0.92);
  --stagger: 9;
}

.skin-function {
  background: rgba(232, 240, 255, 0.92);
  --stagger: 10;
}

.function-card strong {
  font-size: 1.2rem;
  line-height: 1.1;
}

.function-card span {
  color: var(--muted);
  font-size: 0.93rem;
  font-weight: 850;
  line-height: 1.35;
}

.function-card .daily-calendar {
  flex-basis: 58px;
  width: 58px;
}

.function-logo {
  display: grid;
  width: 58px;
  min-height: 72px;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: #fffdf7;
  box-shadow: 4px 4px 0 var(--coral);
}

.function-logo span {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--sun);
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 950;
  line-height: 1;
}

.symbol-icon {
  display: block;
  width: 29px;
  height: 29px;
}

.course-logo {
  background: linear-gradient(180deg, #d9f3ff, #fffdf7);
}

.dialogue-logo {
  background: linear-gradient(180deg, #fff2c3, #fffdf7);
}

.roleplay-logo {
  background: linear-gradient(180deg, #e7f7df, #fffdf7);
}

.guide-logo {
  background: linear-gradient(180deg, #f0eaff, #fffdf7);
}

.custom-logo {
  background: linear-gradient(180deg, #dff8ff, #fffdf7);
}

.search-logo {
  background: linear-gradient(180deg, #ffe9d9, #fffdf7);
}

.idiom-logo {
  background: linear-gradient(180deg, #e2f7ff, #fffdf7);
}

.database-logo {
  background: linear-gradient(180deg, #fff2c3, #fffdf7);
}

.language-logo {
  background: linear-gradient(180deg, #fff2c3, #fffdf7);
}

.skin-logo {
  background: linear-gradient(180deg, #e8f0ff, #fffdf7);
}

.course-logo span {
  background: #7bd8ee;
}

.dialogue-logo span {
  background: #ffd45d;
}

.roleplay-logo span {
  background: #54b86a;
}

.guide-logo span {
  background: #ff7078;
}

.custom-logo span {
  background: #54b86a;
}

.search-logo span {
  background: #ffd45d;
}

.idiom-logo span {
  background: #7bd8ee;
}

.database-logo span {
  background: #ff7078;
}

.language-logo span {
  background: #ffd45d;
}

.skin-logo span {
  background: #8d65d8;
  color: #ffffff;
}

.database-total-grid {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 8px;
  margin: 4px 0 0;
}

.database-total-grid div {
  min-width: 0;
  padding: 10px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 3px 3px 0 rgba(23, 50, 77, 0.18);
}

.database-total-grid dt {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 950;
  line-height: 1.1;
  text-transform: uppercase;
}

.database-total-grid dd {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 1.45rem;
  font-variant-numeric: tabular-nums;
  font-weight: 950;
  line-height: 1;
}

.function-meta {
  margin-top: 3px;
  color: var(--ink) !important;
  font-size: 0.8rem !important;
}

.function-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  grid-column: 1 / -1;
  grid-row: 3;
  align-self: end;
  justify-self: stretch;
  margin-top: auto;
  min-height: 44px;
  width: 100%;
  padding: 7px 12px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--leaf);
  color: var(--ink);
  font-style: normal;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
  box-shadow: 0 4px 0 var(--ink);
}

.daily-function .function-action {
  background: var(--sun);
}

.course-function .function-action,
.idiom-function .function-action {
  background: var(--sky);
}

.dialogue-function .function-action {
  background: #ffb3b8;
}

.roleplay-function .function-action,
.custom-function .function-action {
  background: var(--leaf);
}

.how-to-play-card .function-action,
.search-function .function-action {
  background: #fff2c3;
}

.function-select-action {
  display: grid;
  grid-column: 1 / -1;
  grid-row: 3;
  align-self: end;
  gap: 4px;
  margin-top: auto;
}

.function-select-action span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
}

.function-select-action select {
  width: 100%;
  min-height: 44px;
  padding: 0 10px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 900;
  box-shadow: 0 4px 0 var(--ink);
}

.daily-function {
  align-items: center;
}

.daily-function .function-action {
  grid-column: 1 / -1;
  min-width: 0;
}

.function-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

body[data-screen="home"] {
  background: var(--home-bg);
}

body[data-screen="home"] .cartoon-sky,
body[data-screen="home"] .topbar {
  display: none;
}

body[data-screen="login"] .topbar {
  display: none;
}

body[data-screen="login"] {
  background:
    radial-gradient(circle at 16% 18%, rgba(255, 230, 109, 0.38) 0 8%, transparent 9%),
    linear-gradient(180deg, #18a8ee 0%, #7ee4ff 36%, #fff5d2 72%, #63c94f 100%);
}

body[data-screen="login"] .cartoon-sky {
  display: block;
}

body[data-screen="login"] .app-shell {
  padding: clamp(12px, 2.4vw, 28px);
}

body[data-screen="login"] .flow {
  display: grid;
  min-height: calc(100vh - clamp(24px, 4.8vw, 56px));
  margin-top: 0;
  place-items: center;
}

body[data-screen="login"] .app-footer {
  display: none;
}

body[data-screen="login"] .cartoon-sky {
  display: none;
}

.login-card {
  display: block;
  position: relative;
  width: min(1536px, 100%, calc((100svh - 24px) * 1.5));
  max-width: 1536px;
  min-height: 0;
  aspect-ratio: 3 / 2;
  padding: 0;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(24, 168, 238, 0.35), rgba(126, 228, 255, 0.3) 40%, rgba(99, 201, 79, 0.32)),
    #dff8ff;
  box-shadow: none;
  overflow: hidden;
}

.login-card::before {
  display: none;
}

.login-art {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
}

.login-card .login-scene {
  z-index: 0;
}

.login-card .login-copy {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

.login-card .login-user-grid {
  position: absolute;
  z-index: 2;
  top: 45.65%;
  left: 7.45%;
  display: grid;
  width: 85.18%;
  height: 36.55%;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  column-gap: 1.18%;
  row-gap: 4.3%;
}

.login-card .login-user-card {
  display: grid;
  height: 100%;
  min-height: 0;
  grid-template-columns: 4.6rem minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  padding: 1rem 3.05rem 1rem 1rem;
  border: 2px solid #0b4f91;
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 253, 247, 0.96)),
    #fffdf7;
  box-shadow: 0 5px 0 #063f72;
  color: #123652;
}

.login-card .login-user-card:nth-child(3n + 1),
.login-card .login-user-card:nth-child(3n + 2),
.login-card .login-user-card:nth-child(3n) {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 253, 247, 0.96)),
    #fffdf7;
}

.login-card .login-user-card:hover {
  box-shadow: 0 7px 0 #063f72;
}

.login-card .login-user-card.last-used {
  border-color: #ffad1f;
  box-shadow:
    0 5px 0 #d17a00,
    inset 0 0 0 4px rgba(255, 212, 93, 0.44);
}

.login-card .login-user-avatar {
  width: 4.6rem;
  height: 4.6rem;
  border-color: rgba(11, 79, 145, 0.72);
  background:
    radial-gradient(circle at 36% 28%, rgba(255, 255, 255, 0.88), transparent 42%),
    #d9f3f6;
  font-size: 2.35rem;
}

.login-card .login-user-copy strong {
  color: #123652;
  font-size: 1.55rem;
  line-height: 1;
}

.login-card .login-user-actions {
  top: 0.9rem;
  right: 0.95rem;
}

.login-card .login-profile-edit {
  width: 2rem;
  height: 2rem;
  border-color: #2f97df;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.92);
  color: #1688dc;
  font-size: 1rem;
}

.login-card .login-user-card em {
  right: 0.9rem;
  bottom: 0.8rem;
  border-color: rgba(30, 122, 22, 0.5);
  background: #62bd35;
  color: #fff;
  font-size: 0.72rem;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.16);
}

@media (max-width: 900px) {
  .login-card .login-user-card {
    grid-template-columns: 3rem minmax(0, 1fr);
    gap: 0.65rem;
    padding: 0.65rem 2.35rem 0.65rem 0.65rem;
    border-width: 2px;
    border-radius: 9px;
  }

  .login-card .login-user-avatar {
    width: 3rem;
    height: 3rem;
    font-size: 1.65rem;
  }

  .login-card .login-user-copy strong {
    font-size: 1rem;
  }

  .login-card .login-user-actions {
    top: 0.5rem;
    right: 0.5rem;
  }

  .login-card .login-profile-edit {
    width: 1.65rem;
    height: 1.65rem;
    border-width: 2px;
    font-size: 0.85rem;
  }

  .login-card .login-user-card em {
    right: 0.45rem;
    bottom: 0.45rem;
    padding: 2px 5px;
    border-width: 1px;
    font-size: 0.58rem;
  }
}

body[data-screen="login"] .cartoon-sky,
body[data-screen="login"] .topbar,
body[data-screen="login"] .app-footer {
  display: none;
}

body[data-screen="login"] .app-shell {
  padding: clamp(8px, 1.4vw, 18px);
}

body[data-screen="login"] .flow {
  display: grid;
  min-height: calc(100svh - clamp(16px, 2.8vw, 36px));
  margin-top: 0;
  place-items: center;
}

#loginView.login-card {
  display: block;
  position: relative;
  isolation: isolate;
  width: min(1536px, 100%, calc((100svh - clamp(16px, 2.8vw, 36px)) * 1.5));
  max-width: 1536px;
  min-height: 0;
  aspect-ratio: 3 / 2;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #7ee4ff;
  box-shadow: none;
  overflow: hidden;
}

#loginView.login-card::before {
  display: none;
}

#loginView .login-art {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
}

#loginView .login-scene {
  display: none;
}

#loginView .login-copy {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

#loginView .login-user-grid {
  position: absolute;
  z-index: 2;
  top: 48.5%;
  left: 21.6%;
  display: grid;
  width: 56.8%;
  height: 31.8%;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  column-gap: 1.55%;
  row-gap: 7.5%;
}

#loginView .login-user-card {
  display: grid;
  height: 100%;
  min-height: 0;
  grid-template-columns: clamp(2.35rem, 5vw, 3.45rem) minmax(0, 1fr);
  align-items: center;
  gap: clamp(0.45rem, 1.2vw, 0.8rem);
  padding: clamp(0.55rem, 1.15vw, 0.82rem) clamp(2.05rem, 3.2vw, 2.7rem) clamp(0.55rem, 1.15vw, 0.82rem) clamp(0.55rem, 1.15vw, 0.82rem);
  border: 2px solid #0b4f91;
  border-radius: 12px;
  background: rgba(255, 253, 247, 0.94);
  box-shadow: 0 5px 0 #063f72;
  color: #123652;
  backdrop-filter: blur(3px);
}

#loginView .login-user-card:nth-child(3n + 1),
#loginView .login-user-card:nth-child(3n + 2),
#loginView .login-user-card:nth-child(3n) {
  background: rgba(255, 253, 247, 0.94);
}

#loginView .login-user-card:hover {
  box-shadow: 0 7px 0 #063f72;
}

#loginView .login-user-card.last-used {
  border-color: #ffad1f;
  box-shadow:
    0 5px 0 #d17a00,
    inset 0 0 0 4px rgba(255, 212, 93, 0.44);
}

#loginView .login-user-avatar {
  width: clamp(2.35rem, 5vw, 3.45rem);
  height: clamp(2.35rem, 5vw, 3.45rem);
  border-color: rgba(11, 79, 145, 0.72);
  background:
    radial-gradient(circle at 36% 28%, rgba(255, 255, 255, 0.88), transparent 42%),
    #d9f3f6;
  font-size: clamp(1.45rem, 3vw, 2rem);
}

#loginView .login-user-copy strong {
  color: #123652;
  font-size: clamp(1rem, 2.15vw, 1.38rem);
  line-height: 1;
}

#loginView .login-user-actions {
  top: clamp(0.35rem, 0.9vw, 0.65rem);
  right: clamp(0.35rem, 0.9vw, 0.65rem);
  width: auto;
}

#loginView .login-profile-edit {
  width: clamp(1.35rem, 2.5vw, 1.8rem);
  height: clamp(1.35rem, 2.5vw, 1.8rem);
  min-height: 0;
  border-color: #2f97df;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: #1688dc;
  font-size: clamp(0.72rem, 1.5vw, 0.95rem);
}

#loginView .login-user-card em {
  right: clamp(0.45rem, 1vw, 0.7rem);
  bottom: clamp(0.42rem, 0.9vw, 0.62rem);
  padding: 3px 8px;
  border-color: rgba(30, 122, 22, 0.5);
  background: #62bd35;
  color: #fff;
  font-size: clamp(0.48rem, 1vw, 0.66rem);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.16);
}

@media (max-width: 700px) {
  #loginView .login-user-grid {
    top: 47.8%;
    left: 18%;
    width: 64%;
    height: 34%;
    column-gap: 1.8%;
    row-gap: 5.5%;
  }

  #loginView .login-user-card {
    border-radius: 8px;
    border-width: 1px;
    box-shadow: 0 3px 0 #063f72;
  }

  #loginView .login-user-card:hover {
    box-shadow: 0 4px 0 #063f72;
  }

  #loginView .login-user-card em {
    display: none;
  }
}

@media (max-width: 560px) {
  body[data-screen="login"] .app-shell {
    padding: 8px;
  }

  body[data-screen="login"] .flow {
    min-height: calc(100svh - 16px);
  }

  .login-card {
    width: min(100%, calc((100svh - 16px) * 1.5));
  }

  .login-card .login-user-card {
    grid-template-columns: 1.7rem minmax(0, 1fr);
    gap: 0.3rem;
    padding: 0.36rem 1.45rem 0.36rem 0.36rem;
    border-width: 1px;
    border-radius: 6px;
    box-shadow: 0 3px 0 #063f72;
  }

  .login-card .login-user-card:hover {
    box-shadow: 0 4px 0 #063f72;
  }

  .login-card .login-user-avatar {
    width: 1.7rem;
    height: 1.7rem;
    border-width: 1px;
    font-size: 1rem;
  }

  .login-card .login-user-copy strong {
    font-size: 0.74rem;
  }

  .login-card .login-user-actions {
    top: 0.25rem;
    right: 0.25rem;
  }

  .login-card .login-profile-edit {
    width: 1.1rem;
    height: 1.1rem;
    border-width: 1px;
    border-radius: 4px;
    font-size: 0.62rem;
  }

  .login-card .login-user-card em {
    display: none;
  }
}

.login-card {
  position: relative;
  isolation: isolate;
  width: min(1120px, 100%);
  max-width: 1120px;
  min-height: min(780px, calc(100vh - 36px));
  align-content: end;
  gap: 20px;
  padding: clamp(18px, 3vw, 34px);
  border: 3px solid rgba(23, 50, 77, 0.78);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.38), rgba(255, 253, 247, 0.76) 52%, rgba(255, 253, 247, 0.94)),
    rgba(255, 253, 247, 0.68);
  box-shadow:
    0 18px 0 rgba(23, 50, 77, 0.12),
    0 26px 62px rgba(23, 50, 77, 0.22);
  overflow: hidden;
}

.login-card::before {
  position: absolute;
  inset: 12px;
  z-index: -1;
  border: 2px dashed rgba(23, 50, 77, 0.18);
  border-radius: var(--radius);
  content: "";
}

.login-scene {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

.login-scene::before,
.login-scene::after {
  position: absolute;
  height: 62px;
  border: 3px solid rgba(23, 50, 77, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow:
    42px -16px 0 18px rgba(255, 255, 255, 0.72),
    92px 2px 0 9px rgba(255, 255, 255, 0.66),
    8px 11px 0 rgba(47, 128, 237, 0.1);
  content: "";
  animation: loginCloudSail 28s linear infinite;
}

.login-scene::before {
  top: 11%;
  left: -180px;
  width: 156px;
}

.login-scene::after {
  top: 24%;
  right: -210px;
  width: 190px;
  opacity: 0.72;
  animation-delay: -14s;
  animation-duration: 34s;
}

.login-sun {
  position: absolute;
  top: 34px;
  right: clamp(36px, 8vw, 92px);
  width: 128px;
  height: 128px;
  border: 4px solid rgba(23, 50, 77, 0.2);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 34%, #fff8b0 0 16%, transparent 17%),
    #ffd45d;
  box-shadow:
    0 0 0 18px rgba(255, 212, 93, 0.24),
    0 0 0 38px rgba(255, 212, 93, 0.12);
  animation: loginSunPulse 4.8s ease-in-out infinite;
}

.login-hill {
  position: absolute;
  right: -8%;
  left: -8%;
  border: 3px solid rgba(23, 50, 77, 0.12);
  border-bottom: 0;
  border-radius: 50% 50% 0 0;
}

.hill-back {
  bottom: 26%;
  height: 210px;
  background:
    radial-gradient(120px 70px at 20% 20%, rgba(255, 212, 93, 0.2), transparent 70%),
    #8bd66a;
  opacity: 0.78;
}

.hill-front {
  bottom: 14%;
  height: 230px;
  background:
    radial-gradient(140px 76px at 70% 22%, rgba(255, 255, 255, 0.22), transparent 70%),
    #57bf55;
}

.login-river {
  position: absolute;
  right: -12%;
  bottom: 6%;
  left: -12%;
  height: 170px;
  border-top: 3px solid rgba(23, 50, 77, 0.16);
  background:
    repeating-linear-gradient(-8deg, rgba(255, 255, 255, 0.36) 0 12px, transparent 13px 42px),
    linear-gradient(180deg, #72ddff, #2f9de8);
  clip-path: polygon(0 38%, 18% 24%, 38% 45%, 62% 30%, 82% 47%, 100% 34%, 100% 100%, 0 100%);
  animation: loginRiverFlow 7s linear infinite;
}

.login-bridge {
  position: absolute;
  bottom: 18%;
  left: 7%;
  width: 260px;
  height: 72px;
  border: 5px solid rgba(130, 74, 29, 0.86);
  border-bottom: 0;
  border-radius: 999px 999px 0 0;
  transform: rotate(-3deg);
}

.login-bridge::before,
.login-bridge::after {
  position: absolute;
  bottom: -34px;
  width: 20px;
  height: 54px;
  border: 4px solid rgba(130, 74, 29, 0.86);
  border-radius: 7px;
  background: #ffd18a;
  content: "";
}

.login-bridge::before {
  left: 56px;
}

.login-bridge::after {
  right: 56px;
}

.login-lantern {
  position: absolute;
  --lantern-scale: 1;
  width: 42px;
  height: 52px;
  border: 3px solid #a83216;
  border-radius: 50% 50% 44% 44%;
  background:
    linear-gradient(90deg, transparent 0 21%, rgba(255, 238, 139, 0.58) 22% 26%, transparent 27% 47%, rgba(255, 238, 139, 0.58) 48% 53%, transparent 54% 77%, rgba(255, 238, 139, 0.58) 78% 82%, transparent 83%),
    #ff6b2f;
  box-shadow: 0 8px 0 rgba(117, 53, 21, 0.16);
  transform-origin: top center;
  animation: loginLanternSwing 3.8s ease-in-out infinite;
}

.login-lantern::before {
  position: absolute;
  top: -58px;
  left: 50%;
  width: 2px;
  height: 58px;
  background: rgba(23, 50, 77, 0.42);
  content: "";
}

.login-lantern::after {
  position: absolute;
  right: 13px;
  bottom: -18px;
  left: 13px;
  height: 20px;
  border-radius: 0 0 999px 999px;
  background: #ffd45d;
  content: "";
}

.lantern-one {
  top: 16%;
  left: 12%;
}

.lantern-two {
  top: 12%;
  right: 24%;
  --lantern-scale: 0.82;
  animation-delay: -1.7s;
}

.login-kite {
  position: absolute;
  top: 22%;
  left: 50%;
  width: 58px;
  height: 58px;
  border: 3px solid rgba(23, 50, 77, 0.22);
  background:
    linear-gradient(135deg, #ff7078 0 50%, #ffd45d 51%);
  transform: rotate(45deg);
  animation: loginKiteGlide 9s ease-in-out infinite;
}

.login-kite::after {
  position: absolute;
  top: 56px;
  left: 48px;
  width: 100px;
  height: 82px;
  border-bottom: 3px dashed rgba(23, 50, 77, 0.34);
  border-left: 3px dashed rgba(23, 50, 77, 0.34);
  border-radius: 0 0 0 100%;
  transform: rotate(-45deg);
  content: "";
}

.login-stroke,
.login-floating-card,
.login-spark {
  position: absolute;
  display: grid;
  place-items: center;
  color: var(--ink);
  font-weight: 1000;
  line-height: 1;
  text-shadow: 2px 2px 0 rgba(255, 253, 247, 0.8);
}

.login-stroke {
  width: 50px;
  height: 50px;
  border: 2px solid rgba(23, 50, 77, 0.16);
  border-radius: 50%;
  background: rgba(255, 253, 247, 0.44);
  font-family: "Kaiti SC", "KaiTi", "STKaiti", serif;
  font-size: 2rem;
  opacity: 0.78;
  animation: loginStrokeDrift 8.5s ease-in-out infinite;
}

.stroke-one {
  top: 31%;
  left: 12%;
}

.stroke-two {
  top: 40%;
  right: 10%;
  animation-delay: -2.2s;
}

.stroke-three {
  top: 19%;
  left: 32%;
  animation-delay: -5s;
}

.login-floating-card {
  width: 76px;
  height: 76px;
  border: 3px solid rgba(23, 50, 77, 0.22);
  border-radius: 18px 8px 18px 8px;
  background: rgba(255, 253, 247, 0.78);
  box-shadow: 6px 6px 0 rgba(23, 50, 77, 0.1);
  font-family: "Kaiti SC", "KaiTi", "STKaiti", serif;
  font-size: 2.8rem;
  animation: loginCardFloat 7.2s ease-in-out infinite;
}

.floating-card-one {
  top: 18%;
  left: 6%;
}

.floating-card-two {
  top: 9%;
  left: 42%;
  background: rgba(232, 248, 255, 0.82);
  animation-delay: -2s;
}

.floating-card-three {
  top: 36%;
  left: 4%;
  background: rgba(255, 247, 224, 0.82);
  animation-delay: -4.2s;
}

.floating-card-four {
  top: 34%;
  right: 5%;
  background: rgba(229, 247, 223, 0.82);
  animation-delay: -1.1s;
}

.login-spark {
  width: 28px;
  height: 28px;
  color: #2f80ed;
  font-size: 1.7rem;
  animation: loginSparkBlink 2.6s ease-in-out infinite;
}

.spark-one {
  top: 13%;
  left: 26%;
}

.spark-two {
  top: 30%;
  right: 18%;
  color: #ff7078;
  animation-delay: -0.8s;
}

.spark-three {
  top: 48%;
  left: 31%;
  color: #54b86a;
  animation-delay: -1.7s;
}

.login-copy,
.login-user-grid {
  position: relative;
  z-index: 1;
}

.login-copy {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 16px 18px;
  border: 2px solid rgba(23, 50, 77, 0.2);
  border-radius: var(--radius);
  background: rgba(255, 253, 247, 0.82);
  box-shadow: 0 8px 0 rgba(23, 50, 77, 0.1);
  backdrop-filter: blur(5px);
}

.login-copy h2 {
  color: #123652;
  text-shadow: 2px 3px 0 rgba(255, 212, 93, 0.42);
}

.login-user-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 253, 247, 0.95)),
    var(--paper);
  backdrop-filter: blur(4px);
}

.login-user-card:nth-child(3n + 1) {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 253, 247, 0.95)),
    #e8f0ff;
}

.login-user-card:nth-child(3n + 2) {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 253, 247, 0.95)),
    #fff2c3;
}

.login-user-card:nth-child(3n) {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 253, 247, 0.95)),
    #e5f7df;
}

@media (max-width: 760px) {
  .login-card {
    min-height: auto;
    padding: 14px;
  }

  .login-copy {
    padding: 14px;
  }

  .login-floating-card {
    width: 54px;
    height: 54px;
    font-size: 2rem;
  }

  .login-sun {
    top: 24px;
    right: 26px;
    width: 86px;
    height: 86px;
  }

  .login-bridge,
  .lantern-two,
  .floating-card-three,
  .floating-card-four {
    display: none;
  }
}

@keyframes loginSunPulse {
  0%,
  100% {
    transform: scale(1);
    filter: saturate(1);
  }

  50% {
    transform: scale(1.05);
    filter: saturate(1.18);
  }
}

@keyframes loginCloudSail {
  from {
    transform: translateX(-8vw);
  }

  to {
    transform: translateX(132vw);
  }
}

@keyframes loginRiverFlow {
  from {
    background-position: 0 0, 0 0;
  }

  to {
    background-position: 86px 0, 0 0;
  }
}

@keyframes loginLanternSwing {
  0%,
  100% {
    transform: rotate(-4deg) scale(var(--lantern-scale));
  }

  50% {
    transform: rotate(5deg) scale(var(--lantern-scale));
  }
}

@keyframes loginKiteGlide {
  0%,
  100% {
    transform: translate(-18px, 8px) rotate(41deg);
  }

  50% {
    transform: translate(24px, -16px) rotate(49deg);
  }
}

@keyframes loginStrokeDrift {
  0%,
  100% {
    transform: translateY(0) rotate(-4deg);
  }

  50% {
    transform: translateY(-18px) rotate(6deg);
  }
}

@keyframes loginCardFloat {
  0%,
  100% {
    transform: translateY(0) rotate(-3deg);
  }

  50% {
    transform: translateY(-16px) rotate(4deg);
  }
}

@keyframes loginSparkBlink {
  0%,
  100% {
    opacity: 0.28;
    transform: scale(0.86) rotate(0deg);
  }

  50% {
    opacity: 1;
    transform: scale(1.16) rotate(12deg);
  }
}

body[data-screen="login"] {
  background:
    linear-gradient(180deg, #dff8ff 0%, #f4fbfd 48%, #fff7de 100%);
}

body[data-screen="login"] .cartoon-sky {
  display: block;
}

body[data-screen="login"] .topbar {
  display: flex;
}

body[data-screen="login"] .app-shell {
  padding: 18px;
}

body[data-screen="login"] .flow {
  margin-top: 18px;
}

body[data-screen="login"] .topbar {
  display: none;
}

body[data-screen="login"] .topbar {
  display: none;
}

body[data-screen="home"] .app-shell {
  padding: 0;
}

body[data-screen="home"] .flow {
  margin-top: 0;
}

.quest-home {
  position: relative;
  display: grid;
  gap: 18px;
  min-height: 100vh;
  padding: 0 28px 24px;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(180deg, #48ccfb 0 22%, #fff7df 22% 78%, #7bd24c 100%);
  box-shadow: none;
  overflow: hidden;
}

.quest-home::before,
.quest-home::after {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  content: "";
}

.quest-home::before {
  right: -40px;
  bottom: -18px;
  left: -40px;
  height: 190px;
  background:
    radial-gradient(160px 70px at 8% 84%, #2ab83d 0 68%, transparent 69%),
    radial-gradient(170px 70px at 88% 82%, #3dba46 0 70%, transparent 71%),
    linear-gradient(180deg, transparent 0 36%, #86d84a 37% 100%);
}

.quest-home::after {
  inset: 0;
  background:
    radial-gradient(54px 28px at 15% 9%, rgba(255, 255, 255, 0.86) 0 98%, transparent 100%),
    radial-gradient(74px 32px at 22% 11%, rgba(255, 255, 255, 0.8) 0 98%, transparent 100%),
    radial-gradient(58px 26px at 77% 12%, rgba(255, 255, 255, 0.78) 0 98%, transparent 100%);
  opacity: 0.68;
}

.quest-hero,
.quest-database-card,
.quest-function-grid,
.quest-footer {
  position: relative;
  z-index: 1;
}

.quest-hero {
  min-height: 360px;
  margin: 0 -28px;
  padding: 30px 30px 20px;
  background:
    radial-gradient(170px 92px at 2% 95%, #74d848 0 72%, transparent 73%),
    radial-gradient(230px 120px at 96% 90%, #6ed446 0 72%, transparent 73%),
    radial-gradient(250px 140px at 50% 96%, #55c83f 0 68%, transparent 69%),
    linear-gradient(180deg, #0aa9ef 0%, #60d8ff 58%, #a9e960 100%);
  overflow: hidden;
}

.quest-hero::before,
.quest-hero::after {
  position: absolute;
  top: -72px;
  width: 250px;
  height: 170px;
  border-radius: 0 0 130px 130px;
  background:
    radial-gradient(circle at 20% 30%, #83d745 0 18%, transparent 19%),
    radial-gradient(circle at 44% 24%, #55b72f 0 20%, transparent 21%),
    radial-gradient(circle at 66% 42%, #77d33f 0 19%, transparent 20%),
    radial-gradient(circle at 82% 20%, #3fa826 0 16%, transparent 17%),
    #287321;
  box-shadow: 0 8px 0 rgba(20, 91, 36, 0.2);
  content: "";
}

.quest-hero::before {
  left: -44px;
  transform: rotate(8deg);
}

.quest-hero::after {
  right: -46px;
  transform: rotate(-8deg);
}

.hero-sign {
  position: absolute;
  top: 22px;
  left: 28px;
  display: grid;
  width: 190px;
  height: 78px;
  place-items: center;
  padding: 9px;
  border: 4px solid #93531f;
  border-radius: 28px 14px 28px 14px;
  background: #ffd777;
  box-shadow: 0 8px 0 rgba(82, 45, 18, 0.35);
  transform: rotate(1deg);
}

.hero-sign img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hero-board {
  position: absolute;
  bottom: 96px;
  left: 134px;
  display: grid;
  width: 142px;
  height: 176px;
  place-items: center;
  padding: 16px;
  border: 8px solid #8d5a2a;
  border-radius: var(--radius);
  background: #266840;
  color: #fff8d3;
  box-shadow: 0 8px 0 rgba(47, 24, 8, 0.24);
  transform: rotate(-1.5deg);
}

.hero-board span {
  align-self: end;
  color: #fff8d3;
  font-size: 1.35rem;
  font-weight: 950;
}

.hero-board strong {
  color: #fff8d3;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 5rem;
  line-height: 0.9;
}

.hero-copy {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  max-width: 700px;
  margin: 0 auto;
  padding-top: 18px;
  text-align: center;
}

.hero-title {
  color: #ffffff;
  font-size: 6.5rem;
  font-weight: 1000;
  line-height: 0.96;
  text-shadow:
    0 8px 0 rgba(17, 99, 166, 0.34),
    0 11px 24px rgba(11, 91, 150, 0.28);
}

.hero-ribbon {
  margin-top: 14px;
  padding: 10px 34px;
  border: 3px solid #f2a829;
  border-radius: 999px;
  background: #ffd968;
  color: #d85818;
  font-size: 1.5rem;
  font-weight: 1000;
  box-shadow: 0 5px 0 rgba(169, 98, 19, 0.25);
}

.hero-copy strong {
  margin-top: 12px;
  color: #083b6b;
  font-size: 2rem;
  line-height: 1;
}

.hero-copy p {
  margin-top: 9px;
  color: #123652;
  font-size: 1rem;
  font-weight: 850;
}

.hero-mascot {
  position: absolute;
  z-index: 2;
  filter: drop-shadow(0 8px 0 rgba(21, 74, 43, 0.18));
  line-height: 1;
  pointer-events: none;
}

.hero-panda {
  bottom: 16px;
  left: 30px;
  font-size: 9.5rem;
}

.hero-bird {
  top: 70px;
  right: 235px;
  font-size: 3.6rem;
  transform: rotate(-8deg);
}

.hero-fox {
  right: 245px;
  bottom: 42px;
  font-size: 6rem;
}

.hero-rabbit {
  right: 110px;
  bottom: 38px;
  font-size: 6rem;
}

.hero-duck {
  right: 18px;
  bottom: 40px;
  font-size: 5.4rem;
}

.home-user-strip {
  position: absolute;
  right: 28px;
  bottom: 18px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 320px;
  padding: 8px;
  border: 2px solid rgba(23, 50, 77, 0.58);
  border-radius: var(--radius);
  background: rgba(255, 253, 247, 0.86);
  box-shadow: 0 5px 0 rgba(23, 50, 77, 0.22);
}

.home-user-strip span {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-user-strip .compact-button {
  min-width: 92px;
  height: 36px;
  padding: 0 10px;
}

.quest-database-card {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 12px;
  min-height: 0;
  margin-top: -2px;
  padding: 18px;
  border-width: 2px;
  background: rgba(255, 253, 247, 0.95);
  box-shadow: 0 8px 18px rgba(63, 64, 34, 0.18);
}

.quest-database-card:hover {
  transform: none;
  box-shadow: 0 8px 18px rgba(63, 64, 34, 0.18);
}

.quest-database-card::before,
.quest-home .function-card::before {
  display: none;
}

.quest-database-card .function-logo {
  width: 76px;
  min-height: 76px;
}

.quest-database-card .function-logo span {
  width: 52px;
  height: 52px;
}

.quest-database-card .function-copy strong {
  color: #11385f;
  font-size: 1.45rem;
}

.quest-database-card .function-copy span {
  color: #244763;
  font-size: 1rem;
  line-height: 1.35;
}

.quest-database-card .database-total-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 2px;
}

.quest-database-card .database-total-grid div {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 86px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: none;
}

.quest-database-card .database-total-grid dt {
  display: contents;
}

.quest-database-card .database-total-grid dt span {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: #a8e99c;
  color: #00375d;
  font-size: 1.9rem;
  font-style: normal;
  font-weight: 1000;
  line-height: 1;
}

.quest-database-card .database-total-grid div:nth-child(2) dt span {
  background: #ff9fb0;
}

.quest-database-card .database-total-grid div:nth-child(3) dt span {
  background: #ffd15f;
}

.quest-database-card .database-total-grid div:nth-child(4) dt span {
  background: #c89aff;
}

.quest-database-card .database-total-grid dt em {
  align-self: end;
  color: #123652;
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 1000;
  line-height: 1.1;
  text-transform: uppercase;
}

.quest-database-card .database-total-grid dd {
  grid-column: 2;
  margin: -2px 0 0;
  font-size: 1.8rem;
}

.quest-function-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.quest-action-card {
  grid-template-columns: 58px minmax(0, 1fr);
  min-height: 370px;
  padding: 14px;
  background: rgba(255, 253, 247, 0.94);
  box-shadow: 0 5px 0 rgba(23, 50, 77, 0.9), 0 10px 16px rgba(20, 75, 102, 0.12);
}

.quest-action-card:hover {
  transform: translateY(-4px);
}

.quest-action-card .function-logo,
.quest-action-card .daily-calendar {
  z-index: 2;
}

.quest-action-card .function-logo span {
  font-size: 1.45rem;
}

.quest-action-card .function-copy {
  position: relative;
  z-index: 2;
  align-self: start;
  gap: 8px;
}

.quest-action-card .function-copy strong {
  color: #123652;
  font-size: 1.12rem;
  line-height: 1.1;
}

.quest-action-card .function-copy span {
  color: #183f62;
  font-size: 0.88rem;
  line-height: 1.35;
}

.quest-action-card .function-meta {
  margin-top: 4px;
  font-size: 0.76rem !important;
}

.quest-action-card .function-action,
.quest-action-card .function-select-action {
  position: relative;
  z-index: 3;
}

.quest-action-card .function-action {
  min-height: 48px;
}

.quest-action-card .function-select-action select {
  background: #fffdf7;
}

.card-mascot,
.speech-bubble {
  position: absolute;
  z-index: 1;
  pointer-events: none;
}

.card-mascot {
  right: 12px;
  bottom: 56px;
  font-size: 5.2rem;
  line-height: 1;
  filter: drop-shadow(0 7px 0 rgba(23, 50, 77, 0.12));
}

.speech-bubble {
  right: 70px;
  bottom: 118px;
  display: grid;
  min-width: 74px;
  padding: 9px 10px;
  border: 2px solid var(--ink);
  border-radius: 18px 18px 18px 4px;
  background: #ffffff;
  color: #123652;
  font-size: 1.05rem;
  font-weight: 950;
  line-height: 1.05;
  text-align: center;
}

.speech-bubble small {
  font-size: 0.7rem;
  font-weight: 850;
}

.daily-function.quest-action-card {
  background: linear-gradient(180deg, #fff6dc, #fffdf7);
}

.course-function.quest-action-card {
  background: linear-gradient(180deg, #f8eddf, #fffdf7);
}

.dialogue-function.quest-action-card {
  background: linear-gradient(180deg, #fff2df, #fff8f2);
}

.roleplay-function.quest-action-card {
  background: linear-gradient(180deg, #e9f8df, #fffdf7);
}

.how-to-play-card.quest-action-card {
  background: linear-gradient(180deg, #f7efff, #fffdf7);
}

.custom-function.quest-action-card {
  background: linear-gradient(180deg, #e7f9e6, #fffdf7);
}

.search-function.quest-action-card {
  background: linear-gradient(180deg, #fff0dd, #fffdf7);
}

.idiom-function.quest-action-card {
  background: linear-gradient(180deg, #e0f8ff, #fffdf7);
}

.language-function.quest-action-card {
  background: linear-gradient(180deg, #f3e9ff, #fffdf7);
}

.skin-function.quest-action-card {
  background: linear-gradient(180deg, #efe6ff, #fffdf7);
}

.quest-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 18px;
  min-height: 82px;
  margin: 0 auto;
  padding: 12px 20px;
  border: 3px solid #f4a233;
  border-radius: 999px;
  background: #ff8f35;
  color: #ffffff;
  box-shadow: 0 8px 0 rgba(148, 76, 15, 0.25);
  text-align: center;
}

.quest-footer span {
  display: inline-grid;
  place-items: center;
  min-height: 46px;
  padding: 0 14px;
  border-radius: var(--radius);
  background: #9b6124;
  font-weight: 950;
}

  .quest-footer strong {
  font-size: 1.8rem;
  line-height: 1.05;
}

.quest-footer a {
  color: #ffffff;
  font-weight: 900;
  text-decoration: none;
}

@media (max-width: 1180px) {
  .hero-board {
    left: 54px;
    width: 118px;
    height: 150px;
  }

  .hero-board strong {
    font-size: 4.1rem;
  }

  .hero-panda {
    font-size: 7.2rem;
  }

  .hero-fox {
    right: 205px;
    font-size: 5rem;
  }

  .hero-rabbit {
    right: 92px;
    font-size: 5rem;
  }

  .hero-duck {
    font-size: 4.5rem;
  }

  .quest-database-card .database-total-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 860px) {
  .quest-home {
    padding: 0 14px 18px;
  }

  .quest-hero {
    min-height: 430px;
    margin: 0 -14px;
    padding: 100px 16px 18px;
  }

  .hero-title {
    font-size: 4rem;
  }

  .hero-ribbon {
    padding: 8px 18px;
    font-size: 1.05rem;
  }

  .hero-copy strong {
    font-size: 1.45rem;
  }

  .hero-board {
    display: none;
  }

  .hero-sign {
    left: 16px;
    width: 144px;
    height: 60px;
  }

  .hero-panda {
    left: 12px;
    bottom: 48px;
    font-size: 5rem;
  }

  .hero-bird {
    top: 84px;
    right: 54px;
    font-size: 2.8rem;
  }

  .hero-fox {
    right: 132px;
    bottom: 76px;
    font-size: 3.8rem;
  }

  .hero-rabbit {
    right: 60px;
    bottom: 74px;
    font-size: 3.8rem;
  }

  .hero-duck {
    right: 6px;
    bottom: 76px;
    font-size: 3.4rem;
  }

  .home-user-strip {
    right: 14px;
    bottom: 16px;
    left: 14px;
    max-width: none;
  }

  .quest-database-card {
    grid-template-columns: 1fr;
  }

  .quest-database-card .database-total-grid {
    grid-template-columns: 1fr;
  }

  .quest-action-card {
    min-height: 292px;
  }

  .quest-action-card .function-copy span {
    font-size: 0.82rem;
  }

  .card-mascot {
    right: 12px;
    bottom: 54px;
    font-size: 3.8rem;
  }

  .speech-bubble {
    display: none;
  }

  .quest-footer {
    border-radius: var(--radius);
  }

  .quest-footer strong {
    font-size: 1.28rem;
  }
}

.image-home {
  width: min(1536px, 100%);
  max-width: 1536px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.home-image-stage {
  position: relative;
  width: 100%;
  margin: 0 auto;
  container-type: inline-size;
  line-height: 0;
}

.home-image {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
}

.home-hotspot {
  --hotspot-x: 50%;
  --hotspot-y: 50%;
  position: absolute;
  z-index: 2;
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: transparent;
  box-shadow: none;
  color: transparent;
  cursor: pointer;
  isolation: isolate;
  line-height: 1;
  text-indent: -9999px;
  transform: translateZ(0);
  transition:
    filter 160ms ease,
    transform 160ms cubic-bezier(0.2, 0.8, 0.24, 1);
  touch-action: manipulation;
  appearance: none;
  overflow: hidden;
}

.home-hotspot:focus-visible {
  outline: 4px solid rgba(255, 205, 62, 0.95);
  outline-offset: 2px;
}

.home-hotspot::before,
.home-hotspot::after {
  position: absolute;
  pointer-events: none;
  content: "";
}

.home-hotspot::before {
  inset: 0;
  z-index: -1;
  border: 3px solid rgba(255, 207, 61, 0);
  border-radius: inherit;
  background: transparent;
  box-shadow:
    0 0 0 0 rgba(255, 205, 62, 0),
    0 12px 24px rgba(12, 89, 142, 0);
  opacity: 0;
  transform: scale(1);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease,
    transform 160ms ease;
}

.home-hotspot::after {
  left: var(--hotspot-x);
  top: var(--hotspot-y);
  z-index: -1;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.72) 0 16%, rgba(255, 224, 91, 0.44) 17% 46%, transparent 47%);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0);
}

.home-hotspot:hover,
.home-hotspot:focus-visible {
  filter: saturate(1.08) brightness(1.03);
  transform: translateZ(0);
}

.home-hotspot:hover::before,
.home-hotspot:focus-visible::before {
  border-color: rgba(255, 207, 61, 0.96);
  box-shadow:
    0 0 0 4px rgba(255, 246, 179, 0.36),
    0 12px 24px rgba(12, 89, 142, 0.2);
  opacity: 1;
  transform: scale(1);
}

.home-hotspot:active {
  filter: saturate(1.12) brightness(1.05);
  transform: translateZ(0);
}

.home-hotspot.hotspot-press::after {
  animation: homeHotspotRipple 520ms ease-out;
}

.home-hotspot.hotspot-sound::before {
  animation: homeSoundPulse 420ms ease-out;
}

.home-card-hotspot {
  border-radius: 18px;
}

.home-pill-hotspot {
  z-index: 3;
  border-radius: 999px;
}

.home-pill-hotspot::before {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.24), rgba(255, 188, 76, 0.2));
}

.home-sign-hotspot {
  z-index: 3;
  border-radius: 22px 12px 22px 12px;
}

.home-footer-hotspot {
  z-index: 3;
  border-radius: 999px;
}

.home-select-hotspot {
  display: block;
  overflow: hidden;
  text-indent: 0;
}

.home-select-hotspot span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.home-select-hotspot select {
  position: absolute;
  top: 85.3%;
  right: 6%;
  bottom: 2.4%;
  left: 6%;
  z-index: 2;
  width: auto;
  height: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: transparent;
  opacity: 0;
  cursor: pointer;
}

.home-select-hotspot select option {
  background: var(--paper);
  color: var(--ink);
  font-weight: 800;
}

.home-data-nodes {
  position: absolute;
  inset: 0;
  z-index: 4;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  line-height: 1;
  pointer-events: none;
  white-space: normal;
}

.home-data-nodes > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.home-copy-patch {
  position: absolute;
  z-index: 5;
  clip: auto;
  overflow: hidden;
  color: #0d2f55;
  font-size: clamp(0.34rem, 1.2cqw, 0.88rem);
  font-weight: 650;
  line-height: 1.22;
  letter-spacing: 0;
  pointer-events: none;
  white-space: normal;
}

.home-database-hint-patch {
  top: 29.3%;
  left: 13.45%;
  width: 61.4%;
  height: 3.05%;
  padding: 0.12cqw 0.25cqw;
  background: #fff9ec;
}

#databaseCharacterCount,
#databaseWordCount,
#databaseIdiomCount {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 2.7%;
  padding: 0;
  overflow: hidden;
  clip: auto;
  border-radius: 0.08em;
  background: #fff9ec;
  box-shadow: none;
  color: #092c55;
  font-size: 1.38rem;
  font-size: clamp(0.68rem, 2.78cqw, 1.76rem);
  font-weight: 950;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
  letter-spacing: 0;
  white-space: nowrap;
}

#databaseCharacterCount {
  top: 36.75%;
  left: 13.43%;
  width: 8.2%;
}

#databaseWordCount {
  top: 36.75%;
  left: 44.2%;
  width: 11.5%;
}

#databaseIdiomCount {
  top: 36.75%;
  left: 75.65%;
  width: 8.2%;
}

.hotspot-daily {
  top: 48.37%;
  left: 2.25%;
  width: 18.2%;
  height: 22.95%;
}

.hotspot-known {
  top: 48.37%;
  left: 21.15%;
  width: 17.75%;
  height: 22.95%;
}

.hotspot-course {
  top: 48.37%;
  left: 40.05%;
  width: 18.25%;
  height: 22.95%;
}

.hotspot-dialogue {
  top: 48.37%;
  left: 59.45%;
  width: 18.25%;
  height: 22.95%;
}

.hotspot-roleplay {
  top: 48.37%;
  left: 78.8%;
  width: 18.7%;
  height: 22.95%;
}

.hotspot-custom {
  top: 72.15%;
  left: 2.25%;
  width: 18.2%;
  height: 20.95%;
}

.hotspot-search {
  top: 72.15%;
  left: 21.15%;
  width: 17.75%;
  height: 20.95%;
}

.hotspot-idioms {
  top: 72.15%;
  left: 40.05%;
  width: 18.25%;
  height: 20.95%;
}

.hotspot-language {
  top: 72.15%;
  left: 59.45%;
  width: 18.25%;
  height: 20.95%;
}

.hotspot-guide {
  top: 72.15%;
  left: 78.8%;
  width: 18.7%;
  height: 20.95%;
}

.hotspot-main-cta {
  top: 94.02%;
  left: 31.7%;
  width: 36.7%;
  height: 4.1%;
}

.hotspot-contact {
  display: none;
}

body[data-screen="home"] .app-shell {
  display: grid;
  min-height: 100svh;
  padding: clamp(8px, 1.4vw, 18px);
  place-items: center;
}

body[data-screen="home"] .flow {
  display: grid;
  width: 100%;
  place-items: center;
}

.image-home {
  width: min(1997px, 100%, calc(130svh - clamp(20.8px, 3.64vw, 46.8px)));
  max-width: 1997px;
}

.home-image-stage {
  aspect-ratio: 2 / 3;
  overflow: hidden;
}

.home-image {
  height: auto;
  filter: var(--home-image-filter);
  object-fit: contain;
  transition: filter 180ms ease;
}

.home-brand-link {
  position: absolute;
  top: 20.4%;
  left: 50%;
  z-index: 7;
  display: block;
  width: clamp(120px, 17.5cqw, 250px);
  padding: 0.28cqw 0.62cqw;
  border: 0.12cqw solid rgba(13, 67, 111, 0.24);
  border-radius: 0.7cqw;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 0.38cqw 1.1cqw rgba(12, 89, 142, 0.16);
  line-height: 0;
  transform: translateX(-50%);
  transition:
    box-shadow 160ms ease,
    transform 160ms ease;
}

.home-brand-link img {
  display: block;
  width: 100%;
  height: auto;
}

.home-brand-link:hover,
.home-brand-link:focus-visible {
  box-shadow: 0 0.45cqw 1.3cqw rgba(12, 89, 142, 0.22);
  transform: translateX(-50%) scale(1.02);
}

.home-brand-link:focus-visible {
  outline: 4px solid rgba(255, 205, 62, 0.95);
  outline-offset: 2px;
}

.home-ambient-layer {
  position: absolute;
  inset: 0;
  z-index: 6;
  overflow: hidden;
  pointer-events: none;
  line-height: 1;
  contain: paint;
}

.home-float {
  position: absolute;
  top: var(--top);
  left: 0;
  display: block;
  color: #ffffff;
  font-size: var(--size);
  opacity: var(--opacity);
  text-shadow:
    0 0.08cqw 0.18cqw rgba(255, 255, 255, 0.6),
    0 0.24cqw 0.7cqw rgba(13, 67, 111, 0.18);
  will-change: transform;
  animation: homeFloatForward var(--duration) linear var(--delay) infinite;
}

.home-float-reverse {
  animation-name: homeFloatReverse;
}

.home-float-glyph {
  display: block;
  transform-origin: 50% 65%;
  will-change: transform;
  animation: homeFloatBob var(--bob-duration) ease-in-out var(--bob-delay) infinite alternate;
}

.home-float-cloud {
  color: rgba(255, 255, 255, 0.92);
  filter: blur(0.02cqw);
  mix-blend-mode: screen;
}

.home-float-bird {
  filter: drop-shadow(0 0.16cqw 0.24cqw rgba(21, 85, 128, 0.22));
}

.home-float-animal {
  filter: drop-shadow(0 0.18cqw 0.28cqw rgba(54, 92, 61, 0.26));
}

.home-hotspot {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1.2cqw;
  min-height: 0;
  padding: 1.15cqw 1.35cqw;
  border: 0.22cqw solid var(--home-card-border);
  border-radius: 1.55cqw;
  background: var(--home-card-bg);
  box-shadow: var(--home-card-shadow);
  color: #123652;
  line-height: 1.12;
  text-align: left;
  text-indent: 0;
  backdrop-filter: blur(2px);
}

.home-hotspot::before {
  z-index: 0;
  border: 0;
  background: var(--home-card-sheen);
  box-shadow:
    inset 0 0 0 0.2cqw rgba(255, 255, 255, 0.5),
    0 0 0 0 rgba(255, 205, 62, 0);
}

.home-hotspot::after {
  z-index: 0;
}

.home-hotspot:hover,
.home-hotspot:focus-visible {
  filter: saturate(1.06) brightness(1.02);
  transform: translateY(-0.35cqw) scale(1.01);
}

.home-hotspot:hover::before,
.home-hotspot:focus-visible::before {
  box-shadow:
    inset 0 0 0 0.2cqw rgba(255, 255, 255, 0.64),
    0 0 0 0.42cqw var(--home-card-glow);
}

.home-hotspot:active {
  transform: translateY(0.18cqw) scale(0.994);
}

.home-action-card > *,
.home-pill-hotspot > *,
.home-data-nodes > * {
  position: relative;
  z-index: 1;
}

.home-action-icon,
.home-mini-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 0.22cqw solid rgba(13, 67, 111, 0.4);
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.92), transparent 42%),
    var(--home-icon-green);
  color: #0b3d6f;
  font-family: "Kaiti SC", "KaiTi", "STKaiti", serif;
  font-weight: 1000;
  line-height: 1;
  text-shadow: 0 0.12cqw 0 rgba(255, 255, 255, 0.68);
}

.home-action-icon {
  width: 5.4cqw;
  height: 5.4cqw;
  border-radius: 1.25cqw;
  font-size: 2.7cqw;
  box-shadow: inset 0 -0.3cqw 0 rgba(0, 0, 0, 0.08);
}

.home-calendar-icon {
  overflow: hidden;
  grid-template-rows: 1.75cqw minmax(0, 1fr);
  background: var(--paper);
  font-family: inherit;
}

.home-calendar-icon span {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  background: var(--coral);
  color: #ffffff;
  font-size: 1.03cqw;
  font-weight: 1000;
  line-height: 1;
}

.home-calendar-icon strong {
  color: #0b3d6f;
  font-size: 2.35cqw;
  line-height: 1;
}

.home-action-copy {
  display: grid;
  min-width: 0;
  gap: 0.35cqw;
}

.home-action-copy strong {
  overflow: hidden;
  color: #0c3256;
  font-size: clamp(0.56rem, 2.15cqw, 1.28rem);
  font-weight: 1000;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-action-copy > span,
.home-action-copy em {
  overflow: hidden;
  color: #244b70;
  font-size: clamp(0.44rem, 1.25cqw, 0.78rem);
  font-style: normal;
  font-weight: 760;
  line-height: 1.16;
  letter-spacing: 0;
}

.home-action-copy > span:not(.home-action-detail) {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.home-action-copy em {
  color: #0a5b2f;
  font-weight: 950;
}

.home-action-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38cqw;
}

.home-action-detail span:first-child {
  font-weight: 950;
}

.home-action-detail span:last-child {
  color: #b35b00;
  font-family: "Kaiti SC", "KaiTi", "STKaiti", serif;
  font-size: clamp(0.5rem, 1.55cqw, 0.92rem);
  font-weight: 1000;
}

.home-action-card .home-action-copy > span,
.home-action-card .home-action-copy em {
  display: none;
}

.home-action-arrow {
  margin-left: auto;
  color: #1c679c;
  font-size: 2.6cqw;
  font-weight: 1000;
  line-height: 1;
}

.hotspot-course .home-action-icon,
.hotspot-search .home-action-icon,
.hotspot-exam .home-action-icon {
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.92), transparent 42%),
    var(--home-icon-blue);
}

.hotspot-dialogue .home-action-icon,
.hotspot-guide .home-action-icon,
.hotspot-ai-teacher .home-action-icon,
.hotspot-ai-interaction .home-action-icon,
.hotspot-wrong .home-action-icon {
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.92), transparent 42%),
    var(--home-icon-pink);
}

.hotspot-roleplay .home-action-icon,
.hotspot-idioms .home-action-icon,
.hotspot-language .home-action-icon {
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.92), transparent 42%),
    var(--home-icon-yellow);
}

.hotspot-known .home-action-icon {
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.92), transparent 42%),
    var(--home-icon-purple);
}

.home-data-nodes {
  top: 28.85%;
  right: 8%;
  bottom: auto;
  left: 8%;
  z-index: 3;
  display: grid;
  height: 6.05%;
  grid-template-columns: 1.55fr repeat(3, minmax(0, 1fr));
  gap: 1.1cqw;
  pointer-events: none;
}

.home-learner-chip,
.home-known-progress,
.home-stat-item {
  display: flex;
  align-items: center;
  gap: 0.82cqw;
  min-width: 0;
  padding: 0.8cqw 1cqw;
  border: 0.2cqw solid var(--home-card-border);
  border-radius: 1.25cqw;
  background: var(--home-stat-bg);
  box-shadow: 0 0.45cqw 1.3cqw rgba(36, 103, 102, 0.1);
  backdrop-filter: blur(2px);
}

.home-known-progress {
  display: grid;
  align-content: center;
  gap: 0.46cqw;
}

.home-known-progress-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.72cqw;
  min-width: 0;
}

.home-known-progress-copy {
  display: grid;
  gap: 0.1cqw;
  min-width: 0;
}

.home-known-progress-copy em {
  overflow: hidden;
  color: #46617a;
  font-size: clamp(0.32rem, 0.78cqw, 0.54rem);
  font-style: normal;
  font-weight: 950;
  line-height: 1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.home-known-progress-copy strong,
.home-known-progress-percent {
  color: #0c3256;
  font-weight: 1000;
  line-height: 1;
  white-space: nowrap;
}

.home-known-progress-copy strong {
  overflow: hidden;
  font-size: clamp(0.48rem, 1.52cqw, 0.96rem);
  text-overflow: ellipsis;
}

.home-known-progress-percent {
  display: block;
  padding: 0.22cqw 0.44cqw;
  border-radius: 999px;
  background: rgba(86, 186, 111, 0.18);
  color: #0a5b2f;
  font-size: clamp(0.42rem, 1.1cqw, 0.72rem);
}

.home-known-progress-track {
  height: clamp(5px, 0.72cqw, 10px);
  overflow: hidden;
  border: 0.12cqw solid rgba(13, 67, 111, 0.3);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0.1cqw 0.16cqw rgba(13, 67, 111, 0.12);
}

.home-known-progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #54b86a, #ffd45d);
  transition: width 260ms ease;
}

.home-mini-icon {
  width: 3.4cqw;
  height: 3.4cqw;
  border-radius: 0.95cqw;
  font-size: 1.8cqw;
}

.home-learner-chip strong {
  display: block;
  overflow: visible;
  color: #0c3256;
  font-size: clamp(0.44rem, 1.34cqw, 0.86rem);
  font-weight: 1000;
  line-height: 1.16;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
}

.home-stat-item strong {
  overflow: hidden;
  color: #0c3256;
  font-size: clamp(0.48rem, 1.75cqw, 1.02rem);
  font-weight: 1000;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-stat-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: center;
  align-items: center;
  column-gap: 0.72cqw;
  row-gap: 0.12cqw;
}

.home-stat-item .home-mini-icon {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
}

.home-stat-item strong {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
}

.home-stat-item em {
  grid-column: 2;
  grid-row: 2;
  align-self: start;
  overflow: hidden;
  color: #46617a;
  font-size: clamp(0.34rem, 0.92cqw, 0.58rem);
  font-style: normal;
  font-weight: 950;
  line-height: 1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

#databaseCharacterCount,
#databaseWordCount,
#databaseIdiomCount {
  position: static;
  display: block;
  width: auto;
  height: auto;
  padding: 0;
  overflow: hidden;
  clip: auto;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: clamp(0.5rem, 1.75cqw, 1.02rem);
  line-height: 1;
}

.home-menu-section {
  position: absolute;
  left: 6%;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: 0.78cqw;
  width: 88%;
  padding: 0.62cqw 1.1cqw;
  border: 0.2cqw solid rgba(13, 67, 111, 0.22);
  border-radius: 1.45cqw;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 253, 244, 0.72)),
    rgba(255, 255, 255, 0.72);
  box-shadow:
    inset 0 0.15cqw 0 rgba(255, 255, 255, 0.72),
    0 0.45cqw 1.25cqw rgba(36, 103, 102, 0.1);
  color: #0c3256;
  line-height: 1;
  pointer-events: none;
}

.home-menu-section strong,
.home-menu-section span {
  display: block;
  overflow: hidden;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-menu-section strong {
  flex: 0 0 auto;
  color: #0a335f;
  font-size: clamp(0.52rem, 1.42cqw, 0.9rem);
  font-weight: 1000;
}

.home-menu-section span {
  min-width: 0;
  color: #49657b;
  font-size: clamp(0.38rem, 0.96cqw, 0.64rem);
  font-weight: 850;
}

.home-menu-section-ai {
  top: 37.45%;
  height: 8.7%;
  border-color: rgba(151, 82, 170, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 248, 255, 0.9), rgba(248, 242, 255, 0.72)),
    rgba(255, 255, 255, 0.74);
}

.home-menu-section-tools {
  top: 46.65%;
  height: 28.1%;
}

.home-menu-section-support {
  top: 75.25%;
  height: 10.25%;
  border-color: rgba(222, 161, 63, 0.32);
  background:
    linear-gradient(180deg, rgba(255, 251, 235, 0.9), rgba(255, 246, 219, 0.72)),
    rgba(255, 255, 255, 0.74);
}

.hotspot-ai-teacher,
.hotspot-ai-interaction {
  top: 40.25%;
  width: 40.5%;
  height: 5.65%;
}

.hotspot-ai-teacher {
  left: 8%;
}

.hotspot-ai-interaction {
  left: 51.5%;
}

.hotspot-ai-teacher .home-action-copy > span,
.hotspot-ai-interaction .home-action-copy > span {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.hotspot-daily,
.hotspot-exam,
.hotspot-dialogue,
.hotspot-idioms {
  left: 6%;
}

.hotspot-course,
.hotspot-wrong,
.hotspot-roleplay {
  left: 36.2%;
}

.hotspot-known,
.hotspot-search,
.hotspot-custom {
  left: 66.4%;
}

.hotspot-daily,
.hotspot-course,
.hotspot-known {
  top: 50%;
}

.hotspot-exam,
.hotspot-wrong,
.hotspot-search {
  top: 56.2%;
}

.hotspot-dialogue,
.hotspot-roleplay,
.hotspot-custom {
  top: 62.4%;
}

.hotspot-idioms {
  top: 68.6%;
}

.hotspot-daily,
.hotspot-known,
.hotspot-course,
.hotspot-exam,
.hotspot-wrong,
.hotspot-dialogue,
.hotspot-roleplay,
.hotspot-custom,
.hotspot-search,
.hotspot-idioms {
  width: 27.6%;
}

.hotspot-language,
.hotspot-guide {
  top: 79%;
  width: 42.6%;
  height: 6.35%;
}

.hotspot-language {
  left: 6%;
}

.hotspot-guide {
  left: 51.4%;
}

.home-action-card {
  height: 5.55%;
}

.hotspot-ai-teacher.home-action-card,
.hotspot-ai-interaction.home-action-card {
  height: 5.65%;
}

.hotspot-language.home-action-card,
.hotspot-guide.home-action-card {
  height: 6.35%;
}

.hotspot-main-cta {
  display: none;
}

.home-select-hotspot {
  display: grid;
  grid-template-columns: 5.4cqw minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 1.2cqw;
  row-gap: 0.32cqw;
  overflow: hidden;
}

.home-select-hotspot > .home-action-icon,
.home-select-hotspot .home-action-copy,
.home-select-hotspot .home-action-copy span {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

.home-select-hotspot > .home-action-icon {
  grid-column: 1;
  grid-row: 1 / 3;
  align-self: center;
  width: 5.4cqw;
  height: 5.4cqw;
}

.home-select-hotspot .home-action-copy {
  grid-column: 2;
  grid-row: 1;
  align-self: end;
  flex: 1 1 auto;
}

.home-select-hotspot select {
  position: static;
  grid-column: 2;
  grid-row: 2;
  z-index: 2;
  display: block;
  width: 100%;
  height: clamp(22px, 2.1cqw, 30px);
  min-height: 0;
  margin: 0;
  padding: 0 0.7cqw;
  border: 0.16cqw solid var(--home-card-border);
  border-radius: 0.72cqw;
  background: var(--paper);
  box-shadow: inset 0 -0.14cqw 0 rgba(0, 0, 0, 0.05);
  color: #123652;
  font-size: clamp(0.44rem, 1.15cqw, 0.76rem);
  font-weight: 900;
  opacity: 1;
}

.home-pill-hotspot {
  top: 24.5%;
  left: 26.5%;
  z-index: 4;
  justify-content: center;
  width: 47%;
  height: 4.8%;
  padding: 0.5cqw 2.2cqw;
  border-color: var(--home-cta-border);
  border-radius: 999px;
  background:
    linear-gradient(180deg, var(--home-cta-top), var(--home-cta-bottom)),
    var(--home-cta-bottom);
  box-shadow:
    inset 0 0.2cqw 0 rgba(255, 255, 255, 0.52),
    0 0.55cqw 0 var(--home-cta-shadow),
    0 1.25cqw 2.4cqw rgba(130, 74, 29, 0.25);
  color: #ffffff;
  text-align: center;
}

.home-pill-hotspot span {
  display: grid;
  width: 3.2cqw;
  height: 3.2cqw;
  flex: 0 0 auto;
  place-items: center;
  border: 0.18cqw solid rgba(255, 255, 255, 0.74);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  color: #ffffff;
  font-size: 1.7cqw;
  line-height: 1;
}

.home-pill-hotspot strong {
  overflow: hidden;
  color: #ffffff;
  font-size: clamp(0.74rem, 2.25cqw, 1.36rem);
  font-weight: 1000;
  line-height: 1;
  text-shadow: 0 0.16cqw 0 rgba(143, 75, 14, 0.34);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hotspot-logout {
  top: 91.8%;
  left: 36.2%;
  z-index: 5;
  justify-content: center;
  width: 27.6%;
  height: 4.7%;
  padding: 0.55cqw 1.4cqw;
  border-color: rgba(180, 70, 70, 0.48);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 250, 248, 0.95), rgba(255, 226, 219, 0.86)),
    #fff8f5;
  box-shadow:
    inset 0 0.18cqw 0 rgba(255, 255, 255, 0.62),
    0 0.42cqw 0 rgba(175, 75, 64, 0.34),
    0 1cqw 2cqw rgba(98, 48, 42, 0.16);
  color: #8b2f25;
  text-align: center;
}

.hotspot-logout span {
  display: grid;
  width: 3.2cqw;
  height: 3.2cqw;
  flex: 0 0 auto;
  place-items: center;
  border: 0.18cqw solid rgba(139, 47, 37, 0.32);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #8b2f25;
  font-family: "Kaiti SC", "KaiTi", "STKaiti", serif;
  font-size: 1.8cqw;
  font-weight: 1000;
  line-height: 1;
}

.hotspot-logout strong {
  overflow: hidden;
  color: #8b2f25;
  font-size: clamp(0.66rem, 1.75cqw, 1rem);
  font-weight: 1000;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@container (max-width: 520px) {
  .home-float-cloud {
    opacity: 0.22;
  }

  .home-data-nodes {
    top: 28.55%;
    grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr));
    height: 6.25%;
  }

  .home-learner-chip {
    display: none;
  }

  .home-action-card {
    height: 5.55%;
    padding: 1cqw 1.05cqw;
  }

  .hotspot-ai-teacher.home-action-card,
  .hotspot-ai-interaction.home-action-card {
    height: 5.65%;
  }

  .hotspot-language.home-action-card,
  .hotspot-guide.home-action-card {
    height: 6.35%;
  }

  .home-action-icon {
    width: 6.2cqw;
    height: 6.2cqw;
    font-size: 3.1cqw;
  }

  .home-select-hotspot > .home-action-icon {
    width: 6.2cqw;
    height: 6.2cqw;
  }

  .home-select-hotspot {
    grid-template-columns: 6.2cqw minmax(0, 1fr);
  }

  .home-action-copy > span:not(.home-action-detail) {
    display: none;
  }

  .home-select-hotspot select {
    height: 2.8cqw;
    min-height: 20px;
    padding: 0 0.45cqw;
  }

  .home-action-arrow {
    display: none;
  }
}

@keyframes homeFloatForward {
  0% {
    transform: translate3d(-16cqw, 0, 0) scale(var(--scale)) rotate(var(--tilt-start));
  }

  50% {
    transform: translate3d(52cqw, var(--drift-y), 0) scale(var(--scale)) rotate(var(--tilt-mid));
  }

  100% {
    transform: translate3d(116cqw, var(--drift-y-end), 0) scale(var(--scale)) rotate(var(--tilt-end));
  }
}

@keyframes homeFloatReverse {
  0% {
    transform: translate3d(116cqw, 0, 0) scale(var(--scale)) rotate(var(--tilt-start));
  }

  50% {
    transform: translate3d(52cqw, var(--drift-y), 0) scale(var(--scale)) rotate(var(--tilt-mid));
  }

  100% {
    transform: translate3d(-16cqw, var(--drift-y-end), 0) scale(var(--scale)) rotate(var(--tilt-end));
  }
}

@keyframes homeFloatBob {
  0% {
    transform: translateY(-0.35cqw) rotate(-2deg);
  }

  100% {
    transform: translateY(0.42cqw) rotate(2deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-float {
    animation: none;
    transform: translate3d(var(--rest-x), 0, 0) scale(var(--scale)) rotate(var(--tilt-mid));
  }

  .home-float-glyph {
    animation: none;
  }
}

@keyframes homeHotspotRipple {
  0% {
    opacity: 0.76;
    transform: translate(-50%, -50%) scale(0);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(22);
  }
}

@keyframes homeSoundPulse {
  0%,
  100% {
    box-shadow:
      inset 0 0 0 999px rgba(255, 247, 194, 0.12),
      0 0 0 4px rgba(255, 246, 179, 0.36),
      0 12px 24px rgba(12, 89, 142, 0.2);
  }

  45% {
    box-shadow:
      inset 0 0 0 999px rgba(255, 247, 194, 0.18),
      0 0 0 9px rgba(255, 214, 79, 0.42),
      0 18px 30px rgba(12, 89, 142, 0.24);
  }
}

.lesson-picker-card {
  display: grid;
  gap: 14px;
  max-width: 760px;
  padding: 16px;
}

.lesson-picker-card .select-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 900;
  text-transform: uppercase;
}

.lesson-picker-card select {
  height: 58px;
  font-size: 1.06rem;
}

.custom-character-card {
  display: grid;
  gap: 16px;
  max-width: 1040px;
  padding: 16px;
}

.custom-notice {
  margin: 0;
  padding: 12px 14px;
  border: 2px dashed rgba(23, 50, 77, 0.34);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--muted);
  font-weight: 850;
  line-height: 1.45;
}

.custom-form {
  display: grid;
  gap: 14px;
}

.custom-form fieldset {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 14px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--surface);
}

.custom-form legend {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 6px;
  font-weight: 950;
}

.custom-form legend em {
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 850;
}

.custom-form-grid,
.custom-repeat-grid {
  display: grid;
  gap: 12px;
}

.custom-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.custom-form label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.custom-form input,
.custom-form textarea {
  width: 100%;
  min-width: 0;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-weight: 850;
}

.custom-form input {
  height: 44px;
  padding: 0 10px;
}

.custom-form textarea {
  min-height: 72px;
  padding: 9px 10px;
  resize: vertical;
  line-height: 1.35;
}

.wide-field {
  grid-column: 1 / -1;
}

.custom-validation {
  min-height: 24px;
  margin: 0;
  color: var(--muted);
  font-weight: 900;
}

.custom-validation.success {
  color: #0e6025;
}

.custom-validation.needs-review {
  color: #8d242a;
}

.custom-actions {
  align-items: center;
}

.custom-saved-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: rgba(255, 253, 247, 0.82);
}

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

.custom-saved-empty {
  margin: 0;
  color: var(--muted);
  font-weight: 850;
}

.custom-saved-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 10px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--surface);
  animation: itemRise 360ms ease both;
}

.custom-saved-item strong {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--sun);
  font-family: "Kaiti SC", "KaiTi", "STKaiti", serif;
  font-size: 1.65rem;
  line-height: 1;
}

.custom-saved-item span {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-weight: 900;
}

.custom-saved-item em {
  color: var(--muted);
  font-size: 0.8rem;
  font-style: normal;
  font-weight: 900;
}

.known-characters-card {
  display: grid;
  gap: 16px;
  max-width: 1180px;
  padding: 16px;
}

.known-characters-head {
  grid-template-columns: minmax(0, 1fr) auto;
}

.known-characters-summary {
  display: grid;
  min-width: 116px;
  min-height: 48px;
  place-items: center;
  padding: 8px 12px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--sun);
  box-shadow: 0 4px 0 var(--ink);
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 1000;
  line-height: 1;
}

.known-characters-form {
  display: grid;
  gap: 14px;
}

.known-characters-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--surface);
}

.known-characters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
  gap: 10px;
}

.known-character-option {
  position: relative;
  display: grid;
  grid-template-columns: auto 50px minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 3px 8px;
  align-items: center;
  min-height: 76px;
  min-width: 0;
  padding: 9px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  animation: itemRise 320ms ease both;
  animation-delay: calc(var(--stagger, 0) * 18ms);
}

.known-character-option:has(input:checked) {
  border-color: var(--ink);
  background: #eaf7ef;
  box-shadow: 0 3px 0 var(--ink);
}

.known-character-option input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.known-character-check {
  grid-row: 1 / span 2;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: var(--surface);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 1000;
  line-height: 1;
}

.known-character-option input:checked + .known-character-check {
  background: var(--leaf);
}

.known-character-option input:checked + .known-character-check::after {
  content: "✓";
}

.known-character-option input:focus-visible + .known-character-check {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

.known-character-option strong {
  grid-row: 1 / span 2;
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--sun);
  font-family: "Kaiti SC", "KaiTi", "STKaiti", serif;
  font-size: 2rem;
  line-height: 1;
}

.known-character-option span:not(.known-character-check),
.known-character-option em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.known-character-option span:not(.known-character-check) {
  font-size: 0.92rem;
  font-weight: 950;
  white-space: nowrap;
}

.known-character-option em {
  display: -webkit-box;
  color: var(--muted);
  font-size: 0.74rem;
  font-style: normal;
  font-weight: 850;
  line-height: 1.2;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.wrong-words-card {
  display: grid;
  gap: 16px;
  max-width: 1180px;
  padding: 16px;
}

.wrong-words-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.wrong-word-item {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 8px 10px;
  align-items: center;
  min-width: 0;
  padding: 11px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 3px 0 rgba(23, 50, 77, 0.18);
  animation: itemRise 320ms ease both;
  animation-delay: calc(var(--stagger, 0) * 26ms);
}

.wrong-word-item > strong {
  grid-row: 1 / span 2;
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: #ffd7dc;
  font-family: "Kaiti SC", "KaiTi", "STKaiti", serif;
  font-size: 2rem;
  line-height: 1;
}

.wrong-word-body {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.wrong-word-body > span {
  color: var(--ink);
  font-weight: 950;
}

.wrong-word-body em {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.82rem;
  font-style: normal;
  font-weight: 850;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.wrong-word-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.wrong-word-meta b,
.wrong-word-meta small {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  max-width: 100%;
  padding: 3px 8px;
  border: 2px solid rgba(23, 50, 77, 0.16);
  border-radius: 999px;
  background: #fff3d6;
  color: #8a4b03;
  font-size: 0.74rem;
  font-weight: 950;
  line-height: 1;
}

.wrong-word-meta small {
  background: #eef6ff;
  color: #244b70;
}

.login-auth-layout {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(250px, 0.78fr) minmax(320px, 1.22fr);
  gap: 14px;
  align-items: start;
}

.auth-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: rgba(255, 253, 247, 0.92);
  box-shadow: 0 8px 0 rgba(23, 50, 77, 0.12);
}

.auth-panel h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1.04rem;
}

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

.auth-panel label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.auth-panel input,
.auth-panel select,
.auth-panel textarea {
  width: 100%;
  min-width: 0;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-weight: 850;
}

.auth-panel input,
.auth-panel select {
  height: 44px;
  padding: 0 10px;
}

.auth-panel textarea {
  min-height: 76px;
  padding: 9px 10px;
  resize: vertical;
  line-height: 1.35;
}

.auth-panel button {
  justify-self: start;
}

.register-panel {
  background:
    linear-gradient(135deg, rgba(123, 216, 238, 0.2), rgba(255, 212, 93, 0.16)),
    rgba(255, 253, 247, 0.94);
}

.register-cta-panel {
  align-content: center;
  min-height: 184px;
}

.register-cta-panel p {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 850;
  line-height: 1.42;
}

.auth-actions {
  align-items: center;
}

.login-auth-layout.is-registering {
  grid-template-columns: minmax(250px, 0.72fr) minmax(340px, 1.28fr);
}

.search-card,
.idiom-card {
  display: grid;
  gap: 16px;
  max-width: 1120px;
  padding: 16px;
}

.search-form,
.idiom-toolbar {
  display: grid;
  grid-template-columns: minmax(120px, auto) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--surface);
}

.search-form label,
.idiom-toolbar label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.search-form input,
.idiom-toolbar input {
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-weight: 850;
}

.search-count {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 900;
}

.search-layout {
  display: grid;
  grid-template-columns: minmax(240px, 0.72fr) minmax(0, 1.28fr);
  gap: 14px;
  align-items: start;
}

.search-results {
  display: grid;
  gap: 8px;
  align-content: start;
}

.search-result-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 10px;
  align-items: center;
  min-height: 64px;
  padding: 9px 10px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  text-align: left;
  box-shadow: none;
  animation: itemRise 320ms ease both;
  animation-delay: calc(var(--stagger, 0) * 34ms);
}

.search-result-card strong {
  grid-row: 1 / span 2;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--sun);
  font-family: "Kaiti SC", "KaiTi", "STKaiti", serif;
  font-size: 1.65rem;
  line-height: 1;
}

.search-result-card span,
.search-result-card em {
  min-width: 0;
  overflow-wrap: anywhere;
}

.search-result-card span {
  font-weight: 950;
}

.search-result-card em {
  color: var(--muted);
  font-size: 0.82rem;
  font-style: normal;
  font-weight: 850;
}

.search-result-card.is-selected {
  border-color: var(--ink);
  background: #e8f7ff;
  box-shadow: 0 3px 0 var(--ink);
}

.character-meta-line,
.daily-char-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex-wrap: wrap;
}

.daily-char-status {
  margin-right: 6px;
}

.daily-char-status strong {
  font-family: "Kaiti SC", "KaiTi", "STKaiti", serif;
  font-weight: 1000;
}

.learned-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  max-width: 100%;
  padding: 3px 7px;
  border: 2px solid rgba(23, 50, 77, 0.35);
  border-radius: 999px;
  background: #fff3d6;
  color: #8a4b03;
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 950;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}

.learned-status-badge.compact {
  padding: 2px 6px;
  font-size: 0.68rem;
}

.known-character-option .learned-status-badge.compact {
  font-size: 0.64rem;
}

.learned-status-badge.is-learned {
  border-color: rgba(14, 96, 37, 0.36);
  background: #e7f6ec;
  color: #0e6025;
}

.learned-status-badge.is-new {
  border-color: rgba(141, 36, 42, 0.24);
  background: #fff3d6;
  color: #8a4b03;
}

.character-status-badge {
  justify-self: center;
  margin: -4px 0 4px;
  font-size: 0.82rem;
}

.search-detail-card {
  gap: 14px;
}

.search-empty {
  margin: 0;
  padding: 12px;
  border: 2px dashed rgba(23, 50, 77, 0.28);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--muted);
  font-weight: 850;
}

.search-detail-body {
  display: grid;
  gap: 14px;
}

.search-character-overview,
.idiom-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.search-character-overview > div,
.idiom-head > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.search-big-char {
  font-family: "Kaiti SC", "KaiTi", "STKaiti", serif;
  color: var(--ink);
  font-size: 4.4rem;
  line-height: 0.95;
}

.compact-speak-button {
  min-width: 104px;
}

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

.search-stroke-target {
  width: min(100%, 230px);
}

.zdic-panel {
  gap: 10px;
  padding-top: 4px;
}

.zdic-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.zdic-header h3 {
  margin: 0;
}

.zdic-header span {
  flex: 0 0 auto;
  padding: 4px 8px;
  border: 2px solid rgba(23, 50, 77, 0.18);
  border-radius: var(--radius-sm);
  background: #eaf7ef;
  color: #26583a;
  font-size: 0.72rem;
  font-weight: 950;
  line-height: 1.2;
}

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

.zdic-fact-grid div {
  min-width: 0;
  padding: 8px;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.zdic-fact-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.zdic-fact-grid strong {
  display: block;
  overflow-wrap: anywhere;
  margin-top: 3px;
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.2;
}

.zdic-section {
  border: 2px solid rgba(23, 50, 77, 0.16);
  border-radius: var(--radius-sm);
  background: var(--paper);
}

.zdic-section summary {
  min-height: 42px;
  padding: 10px 12px;
  color: var(--ink);
  cursor: pointer;
  font-weight: 950;
}

.zdic-section summary::marker {
  color: var(--coral);
}

.zdic-section-body {
  display: grid;
  gap: 10px;
  max-height: 260px;
  overflow: auto;
  padding: 0 12px 12px;
}

.zdic-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.zdic-definition-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 1.3rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.45;
}

.zdic-translation-grid {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 10px;
  align-items: start;
  padding: 8px;
  border-radius: var(--radius-sm);
  background: #f7f0df;
}

.zdic-translation-grid span {
  color: #715522;
  font-size: 0.76rem;
  font-weight: 950;
}

.zdic-translation-grid strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 0.84rem;
  line-height: 1.35;
}

.zdic-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.zdic-chip-label {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 950;
}

.zdic-chip {
  max-width: 100%;
  padding: 5px 8px;
  border: 2px solid rgba(23, 50, 77, 0.14);
  border-radius: 999px;
  background: #eef6ff;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 900;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.idiom-toolbar {
  grid-template-columns: minmax(120px, auto) minmax(0, 1fr) auto;
}

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

.idiom-item {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 4px 0 rgba(23, 50, 77, 0.18);
  animation: itemRise 320ms ease both;
  animation-delay: calc(var(--stagger, 0) * 28ms);
}

.idiom-head strong {
  color: var(--ink);
  font-size: 1.38rem;
  line-height: 1.1;
}

.idiom-item p {
  margin: 0;
  color: var(--muted);
  font-weight: 820;
  line-height: 1.45;
}

.idiom-item b {
  color: var(--ink);
  font-weight: 950;
}

.idiom-source {
  font-size: 0.86rem;
}

.guide-button {
  width: 100%;
  height: 48px;
  background: #e8f0ff;
}

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

.practice-mode-button {
  display: grid;
  gap: 4px;
  min-height: 94px;
  align-content: center;
  padding: 12px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 4px 0 var(--ink);
}

.practice-mode-button:nth-child(2) {
  background: #e5f7df;
}

.practice-mode-button strong {
  font-size: 1rem;
}

.practice-mode-button span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
  line-height: 1.25;
}

.practice-card {
  display: grid;
  gap: 16px;
  padding: 16px;
}

.practice-head {
  align-items: center;
}

.practice-select-label {
  display: grid;
  gap: 4px;
  min-width: min(100%, 340px);
  font-weight: 900;
}

.practice-select-label span {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.practice-select-label select {
  height: 44px;
  background: var(--paper);
}

.practice-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.1fr);
  gap: 14px;
}

.practice-reader,
.practice-list-card {
  min-width: 0;
}

.practice-reader {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 16px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 212, 93, 0.28), transparent 56%),
    var(--paper);
  animation: screenArrive 420ms ease both;
}

.dialogue-reader {
  text-align: center;
}

.practice-icon {
  display: grid;
  width: 74px;
  height: 74px;
  place-items: center;
  justify-self: center;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 2.3rem;
  box-shadow: 0 4px 0 var(--ink);
  animation: iconFloat 4.5s ease-in-out infinite;
}

.practice-icon.pop-attention {
  animation: softBounce 540ms ease, iconFloat 4.5s ease-in-out 540ms infinite;
}

.practice-reader h3 {
  font-size: clamp(1.55rem, 4vw, 2.3rem);
  line-height: 1.05;
}

.pinyin-line {
  color: var(--coral);
  font-weight: 900;
}

.practice-english {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 850;
}

.practice-speak-button {
  justify-self: center;
}

.practice-phrase {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 2px dashed rgba(23, 50, 77, 0.28);
  border-radius: var(--radius);
  background: var(--surface);
}

.practice-phrase strong {
  font-size: 1.2rem;
}

.practice-phrase span {
  color: var(--coral);
  font-weight: 900;
}

.dialogue-word-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.dialogue-word-card {
  position: relative;
  display: grid;
  gap: 4px;
  min-height: 112px;
  align-content: center;
  padding: 10px 38px 10px 12px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 3px 0 var(--ink);
  transition:
    transform 170ms ease,
    box-shadow 170ms ease,
    background 170ms ease;
  animation: itemRise 360ms ease both;
  animation-delay: calc(var(--stagger, 0) * 48ms);
}

.dialogue-word-card strong {
  font-size: 1.18rem;
}

.word-audio-icon {
  position: absolute;
  top: 10px;
  right: 10px;
}

.roleplay-reading {
  display: grid;
  gap: 10px;
  width: 100%;
  padding: 14px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 4px 0 var(--ink);
  transition:
    transform 170ms ease,
    box-shadow 170ms ease,
    background 170ms ease;
}

.roleplay-reading.is-playing {
  background: #fff2c3;
  animation: speakingPulse 920ms ease-in-out infinite;
}

.roleplay-reading .practice-icon {
  justify-self: start;
}

.roleplay-reading strong,
.roleplay-reading em,
.roleplay-reading span {
  display: block;
}

.roleplay-reading em {
  color: var(--coral);
  font-style: normal;
  font-weight: 900;
}

.roleplay-text {
  color: var(--ink);
  font-size: clamp(1.15rem, 3vw, 1.55rem);
  font-weight: 900;
  line-height: 1.45;
}

.reading-hint {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.ai-teacher-card,
.ai-interaction-card {
  display: grid;
  gap: 16px;
  max-width: 1120px;
  padding: 16px;
}

.ai-teacher-head,
.ai-interaction-head {
  grid-template-columns: minmax(0, 1fr) auto;
}

.ai-interaction-card {
  max-width: 960px;
}

.ai-interaction-chat-card {
  min-height: min(620px, calc(100svh - 190px));
}

.ai-interaction-card .ai-teacher-chat-log {
  max-height: min(56svh, 520px);
  min-height: 280px;
}

.ai-teacher-toolbar {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--surface);
}

.ai-teacher-toolbar .custom-validation {
  min-width: 0;
}

.ai-teacher-reader {
  display: grid;
  gap: 16px;
  min-width: 0;
  padding: 16px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 212, 93, 0.24), rgba(123, 216, 238, 0.14)),
    var(--paper);
  box-shadow: 0 5px 0 rgba(23, 50, 77, 0.16);
  color: var(--ink);
  cursor: pointer;
}

.ai-teacher-reader:focus-visible {
  outline: 3px solid var(--sky);
  outline-offset: 3px;
}

.ai-teacher-reader.is-loading {
  opacity: 0.74;
}

.ai-teacher-title-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.ai-teacher-title-row h3 {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 1.28rem;
  line-height: 1.12;
}

.ai-teacher-icon {
  width: 64px;
  height: 64px;
  font-size: 2rem;
}

.ai-teacher-article-text {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 6px;
  align-items: flex-end;
  min-height: 116px;
}

.ai-reader-character {
  display: grid;
  width: 52px;
  min-height: 66px;
  grid-template-rows: auto 1fr;
  gap: 4px;
  place-items: center;
  padding: 6px 4px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: #fffdf7;
  color: var(--ink);
  box-shadow: 0 3px 0 rgba(23, 50, 77, 0.18);
  text-align: center;
}

.ai-reader-character:hover,
.ai-reader-character:focus-visible {
  background: #e8f7ff;
}

.ai-reader-pinyin {
  max-width: 100%;
  overflow-wrap: anywhere;
  color: var(--coral);
  font-size: 0.68rem;
  font-weight: 950;
  line-height: 1.08;
}

.ai-reader-character strong {
  font-family: "Kaiti SC", "KaiTi", "STKaiti", serif;
  font-size: 1.8rem;
  font-weight: 1000;
  line-height: 1;
}

.ai-reader-punctuation {
  display: inline-grid;
  min-width: 18px;
  min-height: 42px;
  align-items: end;
  color: var(--muted);
  font-size: 1.4rem;
  font-weight: 950;
  line-height: 1;
}

.ai-teacher-vocab-card {
  gap: 10px;
}

.ai-teacher-word-grid {
  margin-top: 0;
}

.ai-teacher-word-grid .search-empty {
  grid-column: 1 / -1;
}

.ai-teacher-chat-card {
  display: grid;
  gap: 12px;
}

.ai-teacher-chat-card .panel-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 850;
}

.ai-teacher-chat-log {
  display: grid;
  max-height: 360px;
  min-height: 180px;
  gap: 10px;
  align-content: start;
  overflow: auto;
  padding: 12px;
  border: 2px solid rgba(23, 50, 77, 0.18);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(123, 216, 238, 0.12), rgba(255, 212, 93, 0.12)),
    var(--paper);
}

.ai-teacher-chat-log.is-loading {
  opacity: 0.76;
}

.ai-chat-message {
  display: grid;
  width: min(86%, 680px);
  gap: 5px;
  padding: 10px 12px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 3px 0 rgba(23, 50, 77, 0.18);
  animation: itemRise 360ms ease both;
  animation-delay: calc(var(--stagger, 0) * 42ms);
}

.ai-chat-message.from-user {
  justify-self: end;
  background: #e8f7ff;
}

.ai-chat-message.from-teacher {
  justify-self: start;
  background: #fff8dc;
}

.ai-chat-role {
  color: var(--coral);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.ai-chat-content {
  margin: 0;
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.ai-chat-read-button {
  justify-self: start;
  min-height: 34px;
  padding: 6px 10px;
}

.ai-teacher-chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: end;
}

.ai-teacher-chat-form textarea {
  width: 100%;
  min-height: 84px;
  resize: vertical;
}

.ai-teacher-mic-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 104px;
  min-height: 44px;
  white-space: nowrap;
}

.ai-teacher-mic-button.is-listening {
  background: #fff2c3;
  animation: speakingPulse 920ms ease-in-out infinite;
}

.profile-dialog,
.guide-dialog {
  width: min(680px, calc(100% - 24px));
  max-height: min(86vh, 760px);
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
}

.profile-dialog {
  width: min(520px, calc(100% - 24px));
}

.guide-dialog {
  width: min(980px, calc(100% - 24px));
  max-height: min(90vh, 860px);
}

.profile-dialog::backdrop,
.guide-dialog::backdrop {
  background: rgba(23, 50, 77, 0.48);
  backdrop-filter: blur(2px);
}

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

.dialog-close {
  width: 40px;
  height: 40px;
  background: var(--surface);
  font-size: 1.45rem;
}

.profile-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.profile-panel.guide-pop {
  animation: guidePop 360ms cubic-bezier(0.2, 0.8, 0.24, 1);
}

.profile-panel h2 {
  font-size: 1.35rem;
  line-height: 1.1;
}

.profile-hint {
  margin: 0;
  color: var(--muted);
  font-weight: 850;
  line-height: 1.45;
}

.profile-form-grid {
  display: grid;
  gap: 12px;
}

.profile-form-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.profile-form-grid input,
.profile-form-grid select {
  width: 100%;
  height: 46px;
  min-width: 0;
  padding: 0 10px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-weight: 900;
}

.profile-avatar-select {
  font-size: 1.08rem;
}

.profile-form-grid em {
  color: var(--muted);
  font-size: 0.75rem;
  font-style: normal;
  font-weight: 800;
  line-height: 1.35;
  text-transform: none;
}

.profile-actions {
  align-items: center;
}

.home-guide {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.home-guide.guide-pop {
  animation: guidePop 360ms cubic-bezier(0.2, 0.8, 0.24, 1);
}

.home-guide h2 {
  font-size: 1.02rem;
}

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

.guide-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: center;
  min-width: 0;
  min-height: 58px;
  padding: 8px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  animation: itemRise 360ms ease both;
  animation-delay: calc(var(--stagger, 0) * 52ms);
}

.guide-step:nth-child(2) {
  background: #e8f0ff;
  --stagger: 1;
}

.guide-step:nth-child(3) {
  background: #d9f3ff;
  --stagger: 2;
}

.guide-step:nth-child(4) {
  background: #e5f7df;
  --stagger: 3;
}

.guide-step span {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--sun);
  font-weight: 900;
}

.guide-step p {
  min-width: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.3;
}

.guide-step strong {
  color: var(--ink);
}

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

.guide-modules > h3 {
  grid-column: 1 / -1;
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 1.06rem;
  line-height: 1.15;
}

.guide-module-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-width: 0;
  padding: 10px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 3px 0 rgba(23, 50, 77, 0.16);
  animation: itemRise 360ms ease both;
  animation-delay: calc(var(--stagger, 0) * 34ms);
}

.guide-module-card:nth-of-type(3n + 1) {
  background: #fff3d6;
}

.guide-module-card:nth-of-type(3n + 2) {
  background: #eaf7ef;
}

.guide-module-card:nth-of-type(3n) {
  background: #eef6ff;
}

.guide-module-card > span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: var(--sun);
  color: var(--ink);
  font-family: "Kaiti SC", "KaiTi", "STKaiti", serif;
  font-size: 1.45rem;
  font-weight: 1000;
  line-height: 1;
}

.guide-module-card div {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.guide-module-card h4,
.guide-module-card p {
  margin: 0;
}

.guide-module-card h4 {
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.12;
}

.guide-module-card p {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 820;
  line-height: 1.35;
}

.guide-module-card strong {
  color: var(--ink);
}

.camera-guide {
  display: grid;
  grid-template-columns: minmax(150px, 0.95fr) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(123, 216, 238, 0.2), rgba(255, 212, 93, 0.16)),
    var(--surface);
}

.camera-guide-art {
  display: block;
  width: 100%;
  max-width: 260px;
  justify-self: center;
}

.camera-guide h3 {
  margin-bottom: 4px;
  font-size: 1rem;
}

.camera-guide p {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.4;
}

.camera-guide strong {
  color: var(--ink);
}

.screen-card {
  padding: 16px;
}

.screen-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 70px;
  padding: 12px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: linear-gradient(90deg, rgba(84, 184, 106, 0.16), rgba(123, 216, 238, 0.16));
}

.screen-title-link {
  min-width: 0;
  margin: -4px -6px;
  padding: 4px 6px;
  border-radius: 10px;
  color: inherit;
  cursor: pointer;
}

.screen-title-link:hover {
  background: rgba(255, 253, 247, 0.56);
}

.screen-title-link:focus-visible {
  outline: 3px solid var(--sky);
  outline-offset: 3px;
}

.screen-head h2 {
  margin-top: 2px;
  font-size: 1.2rem;
}

.compact-button {
  min-width: 88px;
}

.lesson-stage {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr);
  gap: 14px;
  margin-top: 14px;
}

.lesson-stage .writing-card {
  grid-column: 1 / -1;
}

.lesson-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
}

.lesson-footer p {
  color: var(--ink);
  font-weight: 900;
}

.lesson-footer .primary-button {
  min-width: 150px;
}

.result-card {
  max-width: 780px;
}

.result-card.is-celebrating {
  animation: resultCelebrate 760ms ease;
}

.result-body {
  display: grid;
  gap: 14px;
  justify-items: center;
  padding: 18px 0 6px;
  text-align: center;
}

.result-body p {
  max-width: 560px;
  color: var(--ink);
  font-size: 1.1rem;
  font-weight: 900;
  line-height: 1.45;
}

.result-actions {
  justify-content: center;
  margin-top: 14px;
}

.app-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 18px;
  padding: 12px 14px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(2px);
  box-shadow: var(--shadow);
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 850;
}

.app-footer span {
  color: var(--ink);
}

.app-footer a {
  color: var(--blue);
  text-decoration: none;
}

.app-footer a:hover {
  text-decoration: underline;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

@keyframes screenArrive {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes itemRise {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes softBounce {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }

  45% {
    transform: translateY(-7px) scale(1.04);
  }
}

@keyframes charPop {
  0% {
    transform: scale(0.78) rotate(-4deg);
    opacity: 0.2;
  }

  60% {
    transform: scale(1.08) rotate(2deg);
    opacity: 1;
  }

  100% {
    transform: scale(1) rotate(0);
  }
}

@keyframes charWobble {
  0%,
  100% {
    transform: rotate(0deg) scale(1);
  }

  30% {
    transform: rotate(-2deg) scale(1.03);
  }

  62% {
    transform: rotate(2deg) scale(1.02);
  }
}

@keyframes slowSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes iconFloat {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-6px);
  }
}

@keyframes speakingPulse {
  0%,
  100% {
    box-shadow: 0 4px 0 var(--ink), 0 0 0 0 rgba(47, 128, 237, 0.18);
  }

  50% {
    box-shadow: 0 4px 0 var(--ink), 0 0 0 8px rgba(47, 128, 237, 0.08);
  }
}

@keyframes writerReady {
  0% {
    transform: scale(0.97);
    border-color: rgba(255, 112, 120, 0.6);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes writerWiggle {
  0%,
  100% {
    transform: rotate(0deg);
  }

  25% {
    transform: rotate(-1deg);
  }

  75% {
    transform: rotate(1deg);
  }
}

@keyframes goodStroke {
  0% {
    transform: scale(0.98);
  }

  60% {
    transform: scale(1.02);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes speakerBounce {
  0%,
  100% {
    transform: rotate(-7deg) scale(1);
  }

  45% {
    transform: rotate(-3deg) scale(1.1);
  }
}

@keyframes promptPop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes correctPop {
  0% {
    transform: translateY(0) scale(1);
  }

  48% {
    transform: translateY(-4px) scale(1.04);
  }

  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes wrongShake {
  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-6px);
  }

  75% {
    transform: translateX(6px);
  }
}

@keyframes feedbackPop {
  from {
    transform: translateY(5px);
    opacity: 0.3;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes stickerPop {
  0% {
    transform: scale(0.72) rotate(-8deg);
  }

  62% {
    transform: scale(1.12) rotate(5deg);
  }

  100% {
    transform: scale(1) rotate(0);
  }
}

@keyframes counterBump {
  0%,
  100% {
    transform: scale(1);
  }

  45% {
    transform: scale(1.08);
  }
}

@keyframes resultCelebrate {
  0%,
  100% {
    transform: translateY(0) rotate(0);
  }

  38% {
    transform: translateY(-4px) rotate(-0.5deg);
  }

  70% {
    transform: translateY(0) rotate(0.5deg);
  }
}

@keyframes guidePop {
  from {
    opacity: 0;
    transform: scale(0.96);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes sparkleFly {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.4) rotate(0deg);
  }

  18% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform:
      translate(calc(-50% + var(--dx, 0px)), calc(-50% + var(--dy, -80px)))
      scale(1.08)
      rotate(var(--rot, 90deg));
  }
}

@keyframes scoreFloat {
  0% {
    opacity: 0;
    transform: translate(-50%, -40%) scale(0.86);
  }

  18% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate(-50%, calc(-50% - 56px)) scale(1.08);
  }
}

@keyframes buttonRipple {
  to {
    opacity: 0;
    transform: translate(-50%, -50%) scale(18);
  }
}

@keyframes patternSlide {
  from {
    background-position: 0 0, 0 0;
  }

  to {
    background-position: 68px 34px, -68px 34px;
  }
}

@keyframes cloudDrift {
  from {
    transform: translateX(-12vw);
  }

  to {
    transform: translateX(128vw);
  }
}

@keyframes floatBob {
  0%,
  100% {
    transform: translateY(0) rotate(-8deg);
  }

  50% {
    transform: translateY(-14px) rotate(8deg);
  }
}

@keyframes planeGlide {
  from {
    transform: translateX(-12vw) translateY(0) rotate(8deg) scale(var(--plane-scale));
  }

  48% {
    transform: translateX(58vw) translateY(-24px) rotate(1deg) scale(var(--plane-scale));
  }

  to {
    transform: translateX(126vw) translateY(10px) rotate(9deg) scale(var(--plane-scale));
  }
}

@keyframes pencilBob {
  0%,
  100% {
    transform: translateY(0) rotate(var(--pencil-angle)) scale(var(--pencil-scale));
  }

  50% {
    transform: translateY(-16px) rotate(calc(var(--pencil-angle) + 4deg)) scale(var(--pencil-scale));
  }
}

@keyframes tileFloat {
  0%,
  100% {
    transform: translateY(0) rotate(-4deg);
  }

  50% {
    transform: translateY(-18px) rotate(5deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cartoon-sky *,
  .cartoon-sky::before,
  .login-scene *,
  .login-scene::before,
  .login-scene::after,
  .home-card:not(.hidden),
  .screen-card:not(.hidden),
  .function-card,
  .practice-icon,
  .word-chip,
  .dialogue-word-card,
  .ai-reader-character,
  .ai-chat-message,
  .answer-option,
  .sticker,
  .sparkle-particle,
  .floating-score,
  .press-ripple {
    animation: none !important;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

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

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

  .source-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 8px;
  }

  .panel-head,
  .lesson-strip,
  .quiz-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 126px);
    gap: 8px;
    align-items: center;
    padding: 8px 10px;
    border-width: 2px;
  }

  body[data-screen="home"] .topbar,
  body[data-screen="login"] .topbar {
    display: flex;
    justify-content: center;
  }

  body[data-screen="home"] .top-actions,
  body[data-screen="login"] .top-actions {
    display: none;
  }

  .brand {
    gap: 8px;
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .brand-left {
    gap: 4px;
  }

  .brand-mark {
    flex-basis: 78px;
    width: 78px;
    height: 34px;
    border-radius: 12px 6px 12px 6px;
    box-shadow: 3px 3px 0 var(--coral);
  }

  h1 {
    font-size: 1.08rem;
  }

  .brand p {
    display: none;
  }

  .top-stats {
    display: none;
    grid-template-columns: none;
    gap: 6px;
    align-items: center;
    justify-content: flex-end;
    min-width: 0;
    overflow: hidden;
  }

  .top-actions {
    display: contents;
  }

  .active-user-chip {
    grid-column: 1 / -1;
    justify-content: space-between;
    min-height: 42px;
    padding: 6px;
  }

  .help-button {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
    min-width: 102px;
    height: 34px;
    padding: 0 8px;
    white-space: nowrap;
  }

  .language-control,
  .skin-control {
    grid-column: 1;
    grid-row: 2;
    min-width: 110px;
    width: min(190px, 100%);
  }

  .skin-control {
    grid-column: 2;
    justify-self: end;
    width: min(130px, 100%);
  }

  .language-control span,
  .skin-control span {
    display: none;
  }

  .language-control select,
  .skin-control select {
    height: 34px;
    padding: 0 6px;
    font-size: 0.72rem;
  }

  .company-logo {
    justify-self: start;
    width: 78px;
    min-height: 18px;
  }

  .company-logo img {
    width: 100%;
    max-width: 100%;
    max-height: 18px;
    object-position: center;
  }

  .stat-pill,
  .xp-wrap {
    min-height: 34px;
    border-width: 2px;
  }

  .stat-pill {
    min-width: 42px;
    padding: 3px 5px;
  }

  .stat-pill span,
  .xp-wrap span {
    font-size: 0.56rem;
  }

  .stat-pill strong {
    font-size: 0.92rem;
  }

  .xp-wrap {
    width: 56px;
    gap: 3px;
    padding: 4px 5px;
  }

  .xp-track {
    height: 7px;
    border-width: 1px;
  }

  .top-stats,
  .side-column,
  .study-grid,
  .answer-grid,
  .guide-grid,
  .guide-modules,
  .function-grid,
  .login-user-grid,
  .camera-guide,
  .practice-mode-grid,
  .practice-layout,
  .dialogue-word-grid,
  .custom-form-grid,
  .custom-repeat-grid,
  .custom-saved-list,
  .login-auth-layout,
  .auth-form-grid,
  .known-characters-grid,
  .wrong-words-list,
  .search-layout,
  .idiom-list {
    grid-template-columns: 1fr;
  }

  .search-form,
  .idiom-toolbar,
  .ai-teacher-toolbar,
  .ai-teacher-chat-form,
  .known-characters-toolbar {
    grid-template-columns: 1fr;
  }

  .daily-function {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .camera-guide {
    text-align: center;
  }

  .lesson-map {
    grid-template-columns: repeat(6, 1fr);
  }

  .character-card {
    min-height: 390px;
  }

  .char-facts {
    grid-template-columns: 1fr;
  }

  .camera-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .camera-toolbar div {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mode-tab {
    height: 50px;
  }

  .screen-head,
  .ai-teacher-title-row,
  .lesson-stage {
    grid-template-columns: 1fr;
  }

  .lesson-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .lesson-footer .primary-button {
    width: 100%;
  }

  .ai-reader-character {
    width: 46px;
    min-height: 62px;
  }

  .ai-chat-message {
    width: 100%;
  }

  .zdic-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .zdic-fact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .zdic-translation-grid {
    grid-template-columns: 1fr;
  }

  .login-card {
    padding: 16px;
  }

  .login-user-card {
    grid-template-columns: 48px minmax(0, 1fr);
    min-height: 118px;
  }

  .login-user-avatar {
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
  }

  .login-user-actions {
    top: 8px;
    right: 8px;
    width: auto;
  }
}

body[data-screen="home"] .topbar {
  display: none;
}

body[data-screen="login"] .topbar {
  display: none;
}

body[data-screen="login"] {
  background:
    radial-gradient(circle at 16% 18%, rgba(255, 230, 109, 0.38) 0 8%, transparent 9%),
    linear-gradient(180deg, #18a8ee 0%, #7ee4ff 36%, #fff5d2 72%, #63c94f 100%);
}

body[data-screen="login"] .app-shell {
  padding: clamp(12px, 2.4vw, 28px);
}

body[data-screen="login"] .flow {
  display: grid;
  min-height: calc(100vh - clamp(24px, 4.8vw, 56px));
  margin-top: 0;
  place-items: center;
}

body[data-screen="login"] .app-footer {
  display: none;
}

body[data-screen="login"] .cartoon-sky {
  display: none;
}

.login-card {
  display: block;
  width: min(1536px, 100%, calc((100svh - 24px) * 1.5));
  max-width: 1536px;
  min-height: 0;
  aspect-ratio: 3 / 2;
  padding: 0;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(24, 168, 238, 0.35), rgba(126, 228, 255, 0.3) 40%, rgba(99, 201, 79, 0.32)),
    #dff8ff;
  box-shadow: none;
}

.login-card::before {
  display: none;
}

.login-art {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
}

@media (max-width: 560px) {
  body[data-screen="login"] .app-shell {
    padding: 8px;
  }

  body[data-screen="login"] .flow {
    min-height: calc(100svh - 16px);
  }

  .login-card {
    width: min(100%, calc((100svh - 16px) * 1.5));
    padding: 0;
  }

  .zdic-fact-grid {
    grid-template-columns: 1fr;
  }
}

body[data-screen="login"] .cartoon-sky,
body[data-screen="login"] .topbar,
body[data-screen="login"] .app-footer {
  display: none;
}

body[data-screen="login"] .app-shell {
  padding: clamp(8px, 1.4vw, 18px);
}

body[data-screen="login"] .flow {
  display: grid;
  min-height: calc(100svh - clamp(16px, 2.8vw, 36px));
  margin-top: 0;
  place-items: center;
}

#loginView.login-card {
  display: block;
  position: relative;
  isolation: isolate;
  width: min(1536px, 100%, calc((100svh - clamp(16px, 2.8vw, 36px)) * 1.5));
  max-width: 1536px;
  min-height: 0;
  aspect-ratio: 3 / 2;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #7ee4ff;
  box-shadow: none;
  overflow: hidden;
}

#loginView.login-card::before,
#loginView .login-scene {
  display: none;
}

#loginView .login-art {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
}

#loginView .login-copy {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

#loginView .login-user-grid {
  position: absolute;
  z-index: 2;
  top: 48.5%;
  left: 21.6%;
  display: grid;
  width: 56.8%;
  height: 31.8%;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  column-gap: 1.55%;
  row-gap: 7.5%;
}

#loginView .login-user-card {
  display: grid;
  height: 100%;
  min-height: 0;
  grid-template-columns: clamp(2.35rem, 5vw, 3.45rem) minmax(0, 1fr);
  align-items: center;
  gap: clamp(0.45rem, 1.2vw, 0.8rem);
  padding: clamp(0.55rem, 1.15vw, 0.82rem) clamp(2.05rem, 3.2vw, 2.7rem) clamp(0.55rem, 1.15vw, 0.82rem) clamp(0.55rem, 1.15vw, 0.82rem);
  border: 2px solid #0b4f91;
  border-radius: 12px;
  background: rgba(255, 253, 247, 0.94);
  box-shadow: 0 5px 0 #063f72;
  color: #123652;
  backdrop-filter: blur(3px);
}

#loginView .login-user-card:nth-child(3n + 1),
#loginView .login-user-card:nth-child(3n + 2),
#loginView .login-user-card:nth-child(3n) {
  background: rgba(255, 253, 247, 0.94);
}

#loginView .login-user-card:hover {
  box-shadow: 0 7px 0 #063f72;
}

#loginView .login-user-card.last-used {
  border-color: #ffad1f;
  box-shadow:
    0 5px 0 #d17a00,
    inset 0 0 0 4px rgba(255, 212, 93, 0.44);
}

#loginView .login-user-avatar {
  width: clamp(2.35rem, 5vw, 3.45rem);
  height: clamp(2.35rem, 5vw, 3.45rem);
  border-color: rgba(11, 79, 145, 0.72);
  background:
    radial-gradient(circle at 36% 28%, rgba(255, 255, 255, 0.88), transparent 42%),
    #d9f3f6;
  font-size: clamp(1.45rem, 3vw, 2rem);
}

#loginView .login-user-copy strong {
  color: #123652;
  font-size: clamp(1rem, 2.15vw, 1.38rem);
  line-height: 1;
}

#loginView .login-user-actions {
  top: clamp(0.35rem, 0.9vw, 0.65rem);
  right: clamp(0.35rem, 0.9vw, 0.65rem);
  width: auto;
}

#loginView .login-profile-edit {
  width: clamp(1.35rem, 2.5vw, 1.8rem);
  height: clamp(1.35rem, 2.5vw, 1.8rem);
  min-height: 0;
  border-color: #2f97df;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: #1688dc;
  font-size: clamp(0.72rem, 1.5vw, 0.95rem);
}

#loginView .login-user-card em {
  right: clamp(0.45rem, 1vw, 0.7rem);
  bottom: clamp(0.42rem, 0.9vw, 0.62rem);
  padding: 3px 8px;
  border-color: rgba(30, 122, 22, 0.5);
  background: #62bd35;
  color: #fff;
  font-size: clamp(0.48rem, 1vw, 0.66rem);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.16);
}

@media (max-width: 700px) {
  #loginView .login-user-grid {
    top: 47.8%;
    left: 18%;
    width: 64%;
    height: 34%;
    column-gap: 1.8%;
    row-gap: 5.5%;
  }

  #loginView .login-user-card {
    border-radius: 8px;
    border-width: 1px;
    box-shadow: 0 3px 0 #063f72;
  }

  #loginView .login-user-card:hover {
    box-shadow: 0 4px 0 #063f72;
  }

  #loginView .login-user-card em {
    display: none;
  }
}

@media (max-width: 760px) {
  html:has(body[data-screen="login"]) {
    background: #63c94f;
  }

  body[data-screen="login"] {
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    overflow-y: auto;
  }

  body[data-screen="login"]::before {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
      linear-gradient(180deg, #18a8ee 0%, #7ee4ff 34%, #fff5d2 72%, #63c94f 100%);
    content: "";
  }

  body[data-screen="login"] .app-shell {
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    padding: 0;
  }

  body[data-screen="login"] .flow {
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    align-items: stretch;
    justify-items: stretch;
    place-items: stretch;
  }

  #loginView.login-card {
    display: grid;
    width: 100%;
    max-width: none;
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    aspect-ratio: auto;
    align-content: start;
    padding: clamp(132px, 40vw, 190px) 14px 24px;
    overflow: visible;
    background:
      linear-gradient(180deg, rgba(24, 168, 238, 0.12), rgba(126, 228, 255, 0.22) 30%, rgba(255, 245, 210, 0.88) 72%, rgba(99, 201, 79, 0.9)),
      #7ee4ff;
  }

  #loginView .login-art {
    right: 0;
    bottom: auto;
    height: clamp(210px, 58vw, 300px);
    object-fit: cover;
    object-position: top center;
  }

  #loginView .login-auth-layout {
    position: relative;
    z-index: 2;
    width: min(480px, 100%);
    margin: 0 auto;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  #loginView .auth-panel {
    padding: 14px;
    border-width: 2px;
    background: rgba(255, 253, 247, 0.94);
    box-shadow: 0 6px 0 rgba(23, 50, 77, 0.14);
  }

  #loginView .auth-panel button {
    width: 100%;
    justify-self: stretch;
  }

  #loginView .register-cta-panel {
    min-height: auto;
  }
}

@media (max-width: 420px) {
  #loginView.login-card {
    padding: clamp(112px, 36vw, 150px) 10px 20px;
  }

  #loginView .login-art {
    height: clamp(178px, 52vw, 230px);
  }

  #loginView .auth-panel {
    padding: 12px;
  }
}
