:root {
  --ink: #173f2f;
  --ink-deep: #0e2e22;
  --ink-soft: #50695d;
  --forest: #1f5740;
  --forest-mid: #2f6e53;
  --mint: #dcebd5;
  --mint-strong: #c4dfbd;
  --mint-soft: #eef5e9;
  --cream: #f7f1e3;
  --paper: #fffdf6;
  --paper-deep: #f4ecd9;
  --gold: #f4c95d;
  --gold-deep: #a87312;
  --coral: #e7896d;
  --coral-soft: #f8dfd3;
  --line: rgba(23, 63, 47, 0.16);
  --line-strong: rgba(23, 63, 47, 0.28);
  --shadow-sm: 0 6px 20px rgba(23, 63, 47, 0.08);
  --shadow-md: 0 18px 45px rgba(23, 63, 47, 0.12);
  --shadow-lg: 0 32px 80px rgba(23, 63, 47, 0.17);
  --radius-sm: 14px;
  --radius-md: 22px;
  --radius-lg: 32px;
  --radius-xl: 42px;
  --font-body: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Hiragino Sans GB",
    "Source Han Sans SC", sans-serif;
  --font-display: "Arial Rounded MT Bold", "Trebuchet MS", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  --header-height: 86px;
}

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

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 4%, rgba(244, 201, 93, 0.18), transparent 26rem),
    radial-gradient(circle at 92% 18%, rgba(196, 223, 189, 0.5), transparent 30rem),
    linear-gradient(145deg, #faf6ea 0%, var(--cream) 48%, #f1ead9 100%);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.is-locked {
  overflow: hidden;
}

main {
  position: relative;
  z-index: 10;
}

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

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

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

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

svg {
  display: block;
}

[hidden] {
  display: none !important;
}

::selection {
  color: var(--paper);
  background: var(--forest);
}

:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 3px;
}

.svg-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 1.15em;
  height: 1.15em;
  fill: currentColor;
  flex: 0 0 auto;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 999;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-150%);
  transition: transform 180ms ease;
}

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

/* ---------- 背景装饰 ---------- */

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

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(1px);
  opacity: 0.5;
}

.blob-one {
  top: -14rem;
  left: -10rem;
  width: 34rem;
  height: 34rem;
  background: radial-gradient(circle at 40% 45%, #f7d785, #f4c95d 45%, transparent 72%);
  opacity: 0.18;
}

.blob-two {
  top: 8rem;
  right: -16rem;
  width: 42rem;
  height: 42rem;
  background: radial-gradient(circle at 45% 50%, #b9d8b3, transparent 68%);
  opacity: 0.34;
}

.blob-three {
  bottom: -20rem;
  left: 24%;
  width: 42rem;
  height: 30rem;
  background: radial-gradient(ellipse at center, #d7e6cc, transparent 70%);
  opacity: 0.28;
}

.dot-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(23, 63, 47, 0.12) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.28;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

.float-leaf {
  position: absolute;
  display: block;
  width: 24px;
  height: 24px;
  background: linear-gradient(145deg, #8ab18c, #4f7f61);
  border-radius: 100% 0 100% 0;
  opacity: 0.32;
  animation: leaf-drift 14s ease-in-out infinite;
}

.leaf-one {
  top: 18%;
  left: 5%;
  transform: rotate(24deg) scale(1.2);
}

.leaf-two {
  top: 12%;
  right: 12%;
  width: 18px;
  height: 18px;
  transform: rotate(-48deg);
  animation-delay: -4s;
}

.leaf-three {
  top: 54%;
  left: 2.5%;
  width: 16px;
  height: 16px;
  transform: rotate(72deg);
  animation-delay: -7s;
}

.leaf-four {
  bottom: 13%;
  right: 6%;
  transform: rotate(-16deg) scale(1.4);
  animation-delay: -10s;
}

@keyframes leaf-drift {
  0%,
  100% {
    translate: 0 0;
    rotate: 0deg;
  }
  50% {
    translate: 8px -18px;
    rotate: 12deg;
  }
}

/* ---------- 顶栏 ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 16px 24px 0;
}

.header-inner {
  width: min(1180px, 100%);
  min-height: 70px;
  margin: 0 auto;
  padding: 9px 13px 9px 16px;
  display: flex;
  align-items: center;
  gap: 20px;
  border: 1.5px solid rgba(23, 63, 47, 0.13);
  border-radius: 24px;
  background: rgba(255, 253, 246, 0.84);
  box-shadow: 0 10px 30px rgba(23, 63, 47, 0.07);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex: 0 0 auto;
  border-radius: 16px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--ink);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.14);
  transition: transform 200ms ease;
}

.brand:hover .brand-mark {
  transform: rotate(-5deg) scale(1.04);
}

.brand-mark svg {
  width: 35px;
  height: 35px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.12;
}

.brand-text strong {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.brand-text small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 10.5px;
  letter-spacing: 0.14em;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  padding: 4px;
  border-radius: 999px;
  background: rgba(220, 235, 213, 0.58);
}

.main-nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 700;
  transition:
    color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.main-nav a:hover {
  color: var(--ink);
  background: rgba(255, 253, 246, 0.85);
}

.main-nav a.is-active {
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 3px 10px rgba(23, 63, 47, 0.1);
}

.main-nav .icon {
  width: 16px;
  height: 16px;
}

.user-area {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
}

.star-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 52px;
  justify-content: center;
  padding: 7px 10px;
  border: 1.5px solid rgba(168, 115, 18, 0.2);
  border-radius: 999px;
  color: #7b5209;
  background: #fff4cc;
  font-size: 14px;
  font-weight: 800;
}

.star-chip .icon {
  width: 15px;
  height: 15px;
  color: #d59a20;
}

.user-name {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-left: 3px;
  font-size: 14px;
  font-weight: 700;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 9px;
  border: 0;
  border-radius: 12px;
  color: var(--ink-soft);
  background: transparent;
  font-size: 12px;
  cursor: pointer;
  transition:
    background 160ms ease,
    color 160ms ease;
}

.icon-button:hover {
  color: var(--ink);
  background: var(--mint-soft);
}

.icon-button .icon {
  width: 16px;
  height: 16px;
}

/* ---------- 通用控件 ---------- */

.button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 12px 22px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 5px 0 var(--ink);
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease;
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 0 var(--ink);
}

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

.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 3px 0 var(--ink);
}

.button-primary {
  color: var(--paper);
  background: var(--forest);
}

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

.button-gold {
  color: var(--ink-deep);
  background: var(--gold);
}

.button-gold:hover {
  background: #f8d779;
}

.button-quiet {
  background: rgba(255, 253, 246, 0.58);
}

.button-block {
  width: 100%;
}

.button .icon {
  width: 17px;
  height: 17px;
}

.text-button {
  padding: 0;
  border: 0;
  color: var(--forest);
  background: transparent;
  font-size: inherit;
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  cursor: pointer;
}

.text-button:hover {
  color: var(--coral);
}

.eyebrow {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.form-alert {
  padding: 11px 14px;
  border: 1.5px solid rgba(184, 77, 48, 0.24);
  border-radius: var(--radius-sm);
  color: #8f3d27;
  background: #fbe6dc;
  font-size: 13.5px;
  font-weight: 600;
}

.form-alert.is-success {
  border-color: rgba(47, 110, 83, 0.22);
  color: var(--forest);
  background: var(--mint-soft);
}

/* ---------- 登录 / 注册 ---------- */

.view {
  animation: view-in 460ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

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

.auth-view {
  display: grid;
  place-items: center;
  min-height: calc(100vh - var(--header-height));
  padding: 44px 24px 66px;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr);
  width: min(1060px, 100%);
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 38px;
  background: var(--paper);
  box-shadow:
    13px 13px 0 rgba(23, 63, 47, 0.12),
    var(--shadow-lg);
}

.auth-art {
  position: relative;
  overflow: hidden;
  padding: clamp(32px, 4.2vw, 54px);
  color: var(--paper);
  background:
    radial-gradient(circle at 86% 18%, rgba(244, 201, 93, 0.19), transparent 15rem),
    radial-gradient(circle at 10% 88%, rgba(139, 178, 143, 0.24), transparent 18rem),
    var(--forest);
  isolation: isolate;
}

.auth-art::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(rgba(255, 253, 246, 0.16) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: 0.36;
  mask-image: linear-gradient(135deg, black, transparent 72%);
}

.auth-art::after {
  content: "";
  position: absolute;
  right: -6rem;
  bottom: -9rem;
  z-index: -1;
  width: 22rem;
  height: 22rem;
  border: 1px solid rgba(255, 253, 246, 0.16);
  border-radius: 50%;
  box-shadow:
    0 0 0 2.5rem rgba(255, 253, 246, 0.035),
    0 0 0 5rem rgba(255, 253, 246, 0.025);
}

.art-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border: 1px solid rgba(255, 253, 246, 0.24);
  border-radius: 999px;
  color: #f7e4ad;
  background: rgba(255, 253, 246, 0.08);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.art-label .icon {
  width: 14px;
  height: 14px;
}

.auth-art h1 {
  margin-top: 25px;
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 4.4vw, 3.9rem);
  font-weight: 900;
  line-height: 1.13;
  letter-spacing: -0.04em;
}

.auth-art h1 em {
  color: var(--gold);
  font-style: normal;
  white-space: nowrap;
}

.art-lead {
  max-width: 31rem;
  margin-top: 18px;
  color: rgba(255, 253, 246, 0.72);
  font-size: 14px;
  line-height: 1.8;
}

.auth-koala {
  width: min(250px, 58%);
  margin: 28px auto 10px;
  filter: drop-shadow(0 24px 24px rgba(7, 35, 24, 0.22));
  animation: gentle-bob 6s ease-in-out infinite;
}

.auth-koala svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

@keyframes gentle-bob {
  0%,
  100% {
    transform: translateY(0) rotate(-1deg);
  }
  50% {
    transform: translateY(-8px) rotate(1deg);
  }
}

.auth-art blockquote {
  margin-top: 20px;
  padding-left: 16px;
  border-left: 2px solid rgba(244, 201, 93, 0.6);
  color: rgba(255, 253, 246, 0.86);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.85;
}

.art-stamp {
  display: inline-block;
  margin-top: 24px;
  color: rgba(255, 253, 246, 0.45);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.auth-panel {
  padding: clamp(28px, 4.2vw, 52px);
  background:
    radial-gradient(circle at 100% 0, rgba(220, 235, 213, 0.34), transparent 18rem),
    var(--paper);
}

.auth-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1.5px solid rgba(23, 63, 47, 0.1);
  border-radius: 999px;
  background: var(--mint-soft);
}

.auth-tab {
  min-width: 78px;
  padding: 9px 18px;
  border: 0;
  border-radius: 999px;
  color: var(--ink-soft);
  background: transparent;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition:
    color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.auth-tab.is-active {
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 3px 9px rgba(23, 63, 47, 0.1);
}

.auth-heading {
  margin-top: 28px;
}

.auth-heading h2 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.1vw, 2.55rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.2;
}

.auth-heading p {
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 13.5px;
}

#auth-error {
  margin-top: 20px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 19px;
  margin-top: 25px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.field input {
  width: 100%;
  height: 54px;
  padding: 0 16px;
  border: 1.5px solid var(--line);
  border-radius: 15px;
  background: #fffefa;
  color: var(--ink);
  font-size: 15px;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.field input::placeholder {
  color: #a5b0a8;
}

.field input:focus {
  outline: 0;
  border-color: var(--forest-mid);
  background: var(--paper);
  box-shadow: 0 0 0 4px rgba(47, 110, 83, 0.11);
}

.field-hint {
  color: var(--ink-soft);
  font-size: 11.5px;
  line-height: 1.5;
}

.pin-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.pin-row .pin-digit {
  height: 58px;
  padding: 0;
  border: 1.5px solid var(--line);
  border-radius: 15px;
  background: #fffefa;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 900;
  text-align: center;
  letter-spacing: 0;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.pin-row .pin-digit:focus {
  outline: 0;
  border-color: var(--forest-mid);
  box-shadow: 0 0 0 4px rgba(47, 110, 83, 0.11);
  transform: translateY(-1px);
}

.pin-row .pin-digit.has-value {
  border-color: rgba(47, 110, 83, 0.38);
  background: var(--mint-soft);
}

.auth-form .button-block {
  margin-top: 3px;
}

.auth-switch {
  color: var(--ink-soft);
  font-size: 12.5px;
  text-align: center;
}

.auth-note {
  color: #8b6a33;
  font-size: 11.5px;
  text-align: center;
}

/* ---------- 首页 ---------- */

.home-view {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 50px 0 76px;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(390px, 0.94fr);
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
}

.hero-copy {
  position: relative;
  z-index: 2;
}

.hero-copy h1 {
  max-width: 9.4em;
  margin-top: 15px;
  font-family: var(--font-display);
  font-size: clamp(3rem, 6vw, 5.55rem);
  font-weight: 900;
  line-height: 0.99;
  letter-spacing: -0.055em;
}

.marker {
  position: relative;
  z-index: 0;
  display: inline-block;
}

.marker::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: -0.05em;
  bottom: 0.06em;
  left: -0.05em;
  height: 0.34em;
  border-radius: 999px;
  background: var(--gold);
  opacity: 0.72;
  transform: rotate(-1.2deg);
}

.hero-lead {
  max-width: 35rem;
  margin-top: 24px;
  color: var(--ink-soft);
  font-size: 15.5px;
  line-height: 1.85;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 13px;
  margin-top: 30px;
}

.hero-actions .button {
  min-height: 54px;
  padding-inline: 25px;
}

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

.stat-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 13px;
  border: 1.5px solid var(--line);
  border-radius: 19px;
  background: rgba(255, 253, 246, 0.72);
  box-shadow: 0 8px 22px rgba(23, 63, 47, 0.045);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
}

.stat-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 13px;
}

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

.stat-icon-gold {
  color: #8e5e07;
  background: #fff0be;
}

.stat-icon-mint {
  color: var(--forest);
  background: var(--mint);
}

.stat-icon-coral {
  color: #9d4b32;
  background: var(--coral-soft);
}

.stat-label {
  display: block;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
}

.stat-card p {
  display: flex;
  align-items: baseline;
  gap: 3px;
  margin-top: 2px;
}

.stat-card strong {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

.stat-card small {
  color: var(--ink-soft);
  font-size: 10px;
}

/* ---------- 考拉舞台 ---------- */

.koala-stage {
  position: relative;
  width: min(100%, 540px);
  aspect-ratio: 1 / 1;
  justify-self: end;
  border: 2px solid var(--ink);
  border-radius: 45% 55% 48% 52% / 52% 45% 55% 48%;
  background:
    radial-gradient(circle at 48% 38%, rgba(255, 253, 246, 0.94), transparent 45%),
    linear-gradient(150deg, #e9f3e2 0%, #d8ead1 48%, #c6ddbf 100%);
  box-shadow:
    inset 0 -22px 40px rgba(47, 110, 83, 0.1),
    0 28px 70px rgba(23, 63, 47, 0.18);
  cursor: pointer;
  isolation: isolate;
  transition: transform 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.koala-stage:hover {
  transform: rotate(0.8deg) scale(1.008);
}

.koala-stage:active {
  transform: scale(0.995);
}

.stage-ring {
  position: absolute;
  inset: 18px;
  z-index: -1;
  border: 1.5px dashed rgba(23, 63, 47, 0.22);
  border-radius: 50%;
  animation: slow-spin 52s linear infinite;
}

@keyframes slow-spin {
  to {
    transform: rotate(360deg);
  }
}

.koala-stage::before {
  content: "";
  position: absolute;
  inset: 11%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 253, 246, 0.55), transparent 68%);
}

.koala-illustration {
  position: absolute;
  bottom: 3.5%;
  left: 50%;
  width: 94%;
  height: 94%;
  transform: translateX(-50%);
  overflow: visible;
}

.koala-float {
  animation: koala-float 6.5s ease-in-out infinite;
  transform-origin: 240px 430px;
}

@keyframes koala-float {
  0%,
  100% {
    transform: translateY(0) rotate(-0.4deg);
  }
  50% {
    transform: translateY(-9px) rotate(0.5deg);
  }
}

.koala-eye {
  transform-box: fill-box;
  transform-origin: center;
  animation: koala-blink 5.6s infinite;
}

.koala-eye-right {
  animation-delay: 0.12s;
}

@keyframes koala-blink {
  0%,
  43%,
  47%,
  100% {
    transform: scaleY(1);
  }
  45% {
    transform: scaleY(0.08);
  }
}

.koala-ear {
  transform-box: fill-box;
  transform-origin: center;
  animation: ear-wiggle 7s ease-in-out infinite;
}

.koala-ear-right {
  animation-delay: -1.3s;
}

@keyframes ear-wiggle {
  0%,
  86%,
  100% {
    transform: rotate(0);
  }
  90% {
    transform: rotate(-4deg);
  }
  94% {
    transform: rotate(3deg);
  }
}

.speech-bubble {
  position: absolute;
  top: 4%;
  right: -2%;
  z-index: 4;
  max-width: 220px;
  padding: 12px 16px;
  border: 1.5px solid var(--ink);
  border-radius: 18px 18px 18px 5px;
  background: var(--paper);
  box-shadow: 0 5px 0 rgba(23, 63, 47, 0.12);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.5;
  transform: rotate(2deg);
  animation: bubble-float 5s ease-in-out infinite;
}

.speech-bubble.is-talking {
  animation: bubble-pop 300ms ease;
}

@keyframes bubble-float {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -4px;
  }
}

@keyframes bubble-pop {
  0% {
    transform: rotate(2deg) scale(1);
  }
  50% {
    transform: rotate(-1deg) scale(1.045);
  }
  100% {
    transform: rotate(2deg) scale(1);
  }
}

.stage-hint {
  position: absolute;
  bottom: 4.2%;
  left: 50%;
  z-index: 4;
  padding: 4px 10px;
  border: 1px solid rgba(23, 63, 47, 0.12);
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(255, 253, 246, 0.66);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  transform: translateX(-50%);
  backdrop-filter: blur(4px);
}

.stage-sparkle {
  position: absolute;
  z-index: 3;
  color: #dca522;
  font-size: 18px;
  animation: twinkle 3.2s ease-in-out infinite;
}

.sparkle-one {
  top: 15%;
  left: 14%;
}

.sparkle-two {
  top: 35%;
  right: 5%;
  font-size: 24px;
  animation-delay: -1.2s;
}

.sparkle-three {
  bottom: 22%;
  left: 7%;
  font-size: 13px;
  animation-delay: -2.1s;
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.3;
    transform: scale(0.8) rotate(0);
  }
  50% {
    opacity: 1;
    transform: scale(1.15) rotate(16deg);
  }
}

.stage-leaf {
  position: absolute;
  z-index: 2;
  width: 28px;
  height: 28px;
  border-radius: 100% 0 100% 0;
  background: linear-gradient(145deg, #8db38f, #4d7c5f);
  opacity: 0.7;
}

.stage-leaf-one {
  bottom: 8%;
  right: 9%;
  transform: rotate(-20deg);
}

.stage-leaf-two {
  top: 12%;
  right: 24%;
  width: 18px;
  height: 18px;
  transform: rotate(55deg);
}

/* ---------- 首页下方 ---------- */

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.85fr);
  gap: 20px;
  margin-top: 40px;
}

.panel {
  padding: clamp(24px, 3vw, 34px);
  border: 1.5px solid var(--line);
  border-radius: 30px;
  background: rgba(255, 253, 246, 0.82);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.panel-heading h2 {
  margin-top: 3px;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 2.3vw, 2rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.panel-badge {
  flex: 0 0 auto;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.5);
  font-size: 10px;
  font-weight: 700;
}

.steps {
  display: grid;
  gap: 4px;
  margin-top: 20px;
}

.steps li {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 15px;
  align-items: start;
  padding: 15px 0;
  border-top: 1px solid rgba(23, 63, 47, 0.09);
}

.steps li:first-child {
  border-top: 0;
}

.step-number {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1.5px solid rgba(23, 63, 47, 0.12);
  border-radius: 50%;
  color: var(--forest);
  background: var(--mint-soft);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 900;
}

.steps h3 {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.5;
}

.steps p {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.65;
}

.odds-note {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px dashed rgba(168, 115, 18, 0.32);
  border-radius: 18px;
  background: linear-gradient(120deg, #fff5cf, #fffaf0);
}

.odds-star {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 50%;
  color: #9b6a0e;
  background: #ffe8a5;
}

.odds-star .icon {
  width: 20px;
  height: 20px;
}

.odds-note p {
  font-size: 12.5px;
  font-weight: 700;
}

.odds-note strong {
  color: #9b6400;
  font-size: 14px;
}

.odds-note span {
  display: block;
  margin-top: 1px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 500;
}

.mini-board {
  display: grid;
  gap: 3px;
  margin-top: 17px;
}

.mini-board-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px 8px;
  border-radius: 14px;
  transition: background 160ms ease;
}

.mini-board-item:hover {
  background: rgba(220, 235, 213, 0.4);
}

.mini-rank {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 9px;
  color: var(--ink-soft);
  background: var(--mint-soft);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 900;
}

.mini-board-item:first-child .mini-rank {
  color: #7b5209;
  background: #ffe9a8;
}

.mini-board-item:nth-child(2) .mini-rank {
  color: #4d5866;
  background: #e9eef1;
}

.mini-board-item:nth-child(3) .mini-rank {
  color: #875433;
  background: #f4dfd1;
}

.mini-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
}

.mini-stats {
  color: var(--ink-soft);
  font-size: 11px;
  white-space: nowrap;
}

.mini-stats strong {
  color: var(--ink);
  font-size: 13px;
}

.mini-board-placeholder {
  padding: 28px 10px;
  color: var(--ink-soft);
  font-size: 12px;
  text-align: center;
}

.mini-board-foot {
  margin-top: 13px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  color: var(--ink-soft);
  font-size: 10.5px;
  text-align: center;
}

/* ---------- 答题 ---------- */

.quiz-view {
  width: min(980px, calc(100% - 48px));
  margin: 0 auto;
  padding: 42px 0 82px;
}

.quiz-topbar {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) 120px;
  align-items: center;
  gap: 20px;
  margin-bottom: 22px;
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  justify-self: start;
  padding: 9px 12px 9px 9px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 246, 0.65);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition:
    color 160ms ease,
    background 160ms ease;
}

.back-button:hover {
  color: var(--ink);
  background: var(--paper);
}

.back-button .icon {
  width: 15px;
  height: 15px;
}

.quiz-progress {
  display: flex;
  align-items: center;
  gap: 13px;
}

.progress-track {
  height: 9px;
  flex: 1;
  overflow: hidden;
  border: 1px solid rgba(23, 63, 47, 0.12);
  border-radius: 999px;
  background: rgba(23, 63, 47, 0.08);
}

.progress-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--forest-mid), #79a77d);
  transition: width 480ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.progress-label {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.quiz-correct {
  justify-self: end;
  padding: 7px 12px;
  border: 1px solid rgba(47, 110, 83, 0.16);
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(220, 235, 213, 0.5);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.quiz-correct strong {
  color: var(--forest);
  font-size: 15px;
}

.quiz-body {
  min-height: 480px;
}

.quiz-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 480px;
  color: var(--ink-soft);
}

.quiz-loading span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--forest-mid);
  animation: loading-dot 1.1s ease-in-out infinite;
}

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

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

.quiz-loading p {
  flex-basis: 100%;
  margin-top: 6px;
  font-size: 12px;
  text-align: center;
}

@keyframes loading-dot {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.35;
  }
  50% {
    transform: translateY(-6px);
    opacity: 1;
  }
}

.question-card {
  position: relative;
  min-height: 480px;
  padding: clamp(28px, 5vw, 56px);
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 36px;
  background:
    radial-gradient(circle at 100% 0, rgba(220, 235, 213, 0.5), transparent 20rem),
    var(--paper);
  box-shadow:
    10px 10px 0 rgba(23, 63, 47, 0.08),
    var(--shadow-md);
  animation: card-in 420ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.992);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.question-card::after {
  content: "";
  position: absolute;
  right: -5rem;
  bottom: -6rem;
  z-index: 0;
  width: 15rem;
  height: 15rem;
  border: 1.5px dashed rgba(23, 63, 47, 0.13);
  border-radius: 50%;
  pointer-events: none;
}

.question-meta {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.question-index,
.question-points {
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.question-index {
  color: var(--forest);
  background: var(--mint);
}

.question-points {
  color: #8f640d;
  background: #fff2c5;
}

.question-prompt {
  position: relative;
  z-index: 1;
  max-width: 16em;
  margin-top: 26px;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 4vw, 3rem);
  font-weight: 900;
  line-height: 1.32;
  letter-spacing: -0.035em;
}

.question-hint {
  position: relative;
  z-index: 1;
  margin-top: 13px;
  color: var(--ink-soft);
  font-size: 12px;
}

.answer-form {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-top: 35px;
}

.answer-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.answer-input-wrap span {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
}

.answer-input {
  width: 170px;
  height: 62px;
  padding: 0 18px;
  border: 2px solid var(--ink);
  border-radius: 17px;
  background: #fffefa;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 900;
  text-align: center;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.answer-input:focus {
  outline: 0;
  border-color: var(--forest-mid);
  box-shadow: 0 0 0 5px rgba(47, 110, 83, 0.12);
}

.answer-input::-webkit-outer-spin-button,
.answer-input::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

.answer-input {
  appearance: textfield;
  -moz-appearance: textfield;
}

.answer-form .form-alert {
  margin-top: 12px;
}

.feedback-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.feedback-mark {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  border-radius: 22px;
  color: var(--paper);
  background: var(--forest);
  box-shadow: 0 7px 0 var(--ink-deep);
}

.feedback-mark .icon {
  width: 32px;
  height: 32px;
}

.feedback-card.is-wrong .feedback-mark {
  color: #fff5ed;
  background: var(--coral);
  box-shadow: 0 7px 0 #a34f35;
}

.feedback-card .eyebrow {
  position: relative;
  z-index: 1;
  margin-top: 25px;
}

.feedback-card h2 {
  position: relative;
  z-index: 1;
  margin-top: 7px;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.6vw, 2.9rem);
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: -0.04em;
}

.feedback-text {
  position: relative;
  z-index: 1;
  margin-top: 13px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.8;
}

.feedback-text strong {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  height: 36px;
  margin: 0 3px;
  padding: 0 8px;
  border-radius: 10px;
  color: var(--ink);
  background: var(--gold);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 900;
}

.feedback-card.is-wrong .feedback-text strong {
  background: var(--coral-soft);
}

.feedback-actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.finish-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.finish-card .finish-star {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 80px;
  height: 80px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  color: #9b6400;
  background: var(--gold);
  box-shadow: 0 7px 0 var(--ink);
}

.finish-card .finish-star .icon {
  width: 38px;
  height: 38px;
}

.finish-card h2 {
  position: relative;
  z-index: 1;
  margin-top: 25px;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.8vw, 3rem);
  font-weight: 900;
  letter-spacing: -0.04em;
}

.finish-card p {
  position: relative;
  z-index: 1;
  max-width: 28rem;
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: 14px;
}

.finish-card .button {
  position: relative;
  z-index: 1;
  margin-top: 28px;
}

.result-card {
  position: relative;
  overflow: hidden;
  padding: clamp(28px, 5vw, 52px);
  border: 2px solid var(--ink);
  border-radius: 38px;
  background:
    radial-gradient(circle at 100% 0, rgba(244, 201, 93, 0.3), transparent 22rem),
    var(--paper);
  box-shadow:
    12px 12px 0 rgba(23, 63, 47, 0.09),
    var(--shadow-md);
  animation: card-in 480ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.result-card.is-perfect {
  background:
    radial-gradient(circle at 88% 8%, rgba(244, 201, 93, 0.62), transparent 20rem),
    linear-gradient(145deg, #fffdf4, #fff8dd);
}

.result-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.result-score {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-top: 7px;
}

.result-score strong {
  font-family: var(--font-display);
  font-size: clamp(5rem, 11vw, 8rem);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.09em;
}

.result-score span {
  color: var(--ink-soft);
  font-size: 16px;
  font-weight: 700;
}

.result-grade {
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  flex: 0 0 auto;
  border: 2px solid var(--ink);
  border-radius: 28px;
  color: var(--paper);
  background: var(--forest);
  box-shadow: 0 7px 0 var(--ink);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  transform: rotate(3deg);
}

.result-card.is-perfect .result-grade {
  color: #7b4d00;
  background: var(--gold);
}

.result-card h2 {
  max-width: 17em;
  margin-top: 25px;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.6vw, 2.6rem);
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: -0.04em;
}

.result-lead {
  max-width: 34rem;
  margin-top: 9px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.8;
}

.result-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 24px;
}

.result-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 246, 0.72);
  font-size: 11.5px;
  font-weight: 700;
}

.result-stat .icon {
  width: 14px;
  height: 14px;
  color: var(--gold-deep);
}

.result-stat strong {
  font-size: 14px;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

/* ---------- 翻牌 ---------- */

.draw-view {
  width: min(1080px, calc(100% - 48px));
  margin: 0 auto;
  padding: 34px 0 72px;
}

.draw-heading {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.draw-heading h1 {
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 5.2vw, 4.3rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.055em;
}

.star-word {
  position: relative;
  display: inline-block;
  color: #9b6400;
}

.star-word::after {
  content: "✦";
  position: absolute;
  top: -0.35em;
  right: -0.55em;
  color: var(--gold);
  font-size: 0.34em;
  animation: twinkle 3s ease-in-out infinite;
}

.draw-heading > p:last-child {
  margin-top: 18px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.8;
}

.draw-heading strong {
  color: #916000;
  font-size: 16px;
}

.draw-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 25px auto 0;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.draw-stats strong {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 900;
}

.draw-stats i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--line-strong);
}

.draw-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  width: fit-content;
  max-width: 90%;
  margin: 25px auto 0;
  padding: 10px 16px;
  border: 1px solid rgba(168, 115, 18, 0.22);
  border-radius: 999px;
  color: #7f5b1c;
  background: #fff5d6;
  font-size: 11.5px;
  font-weight: 600;
  text-align: center;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 192px));
  justify-content: center;
  gap: clamp(12px, 3vw, 34px);
  margin-top: 30px;
  perspective: 1600px;
}

.flip-card {
  display: block;
  width: 100%;
  aspect-ratio: 0.68;
  padding: 0;
  border: 0;
  border-radius: 27px;
  background: transparent;
  cursor: pointer;
  perspective: 1200px;
  transition:
    transform 260ms ease,
    filter 260ms ease;
}

.flip-card:hover:not(:disabled) {
  transform: translateY(-9px) rotate(-1deg);
}

.flip-card:nth-child(2):hover:not(:disabled) {
  transform: translateY(-9px) rotate(1deg);
}

.flip-card:focus-visible {
  outline-offset: 6px;
}

.flip-card:disabled {
  cursor: default;
}

.cards-grid.is-busy .flip-card:not(.is-flipped) {
  filter: saturate(0.85) brightness(0.96);
}

.flip-inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 900ms cubic-bezier(0.2, 0.75, 0.2, 1);
}

.flip-card.is-flipped .flip-inner {
  transform: rotateY(180deg);
}

.flip-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 27px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.card-back {
  color: var(--cream);
  background:
    radial-gradient(circle at 50% 38%, rgba(244, 201, 93, 0.15), transparent 40%),
    var(--forest);
  box-shadow:
    0 9px 0 var(--ink-deep),
    0 22px 38px rgba(23, 63, 47, 0.2);
}

.card-back::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(244, 201, 93, 0.35);
  border-radius: 18px;
  pointer-events: none;
}

.card-back::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(rgba(255, 253, 246, 0.14) 1px, transparent 1px),
    radial-gradient(circle at 50% 50%, transparent 38%, rgba(7, 35, 24, 0.18) 100%);
  background-size:
    16px 16px,
    100% 100%;
  opacity: 0.7;
}

.card-corner {
  position: absolute;
  top: 22px;
  left: 23px;
  z-index: 1;
  color: rgba(244, 201, 93, 0.75);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.card-emblem {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 35%;
  aspect-ratio: 1;
  border: 1px solid rgba(244, 201, 93, 0.45);
  border-radius: 50%;
  color: var(--gold);
  background: rgba(255, 253, 246, 0.05);
  box-shadow:
    0 0 0 7px rgba(244, 201, 93, 0.045),
    0 0 0 14px rgba(244, 201, 93, 0.025);
}

.card-emblem .icon {
  width: 46%;
  height: 46%;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.card-pattern {
  position: absolute;
  right: 17%;
  bottom: 21%;
  width: 32%;
  aspect-ratio: 1;
  border: 1px dashed rgba(244, 201, 93, 0.28);
  border-radius: 50%;
}

.card-caption {
  position: absolute;
  bottom: 25px;
  z-index: 1;
  color: rgba(255, 253, 246, 0.52);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
}

.card-front {
  background:
    radial-gradient(circle at 50% 40%, rgba(244, 201, 93, 0.2), transparent 58%),
    var(--paper);
  box-shadow:
    0 9px 0 #b8a77f,
    0 22px 38px rgba(23, 63, 47, 0.14);
  transform: rotateY(180deg);
}

.card-reveal {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 100%;
  padding: 20px;
  text-align: center;
}

.reveal-star {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}

.reveal-star .icon {
  width: clamp(56px, 8vw, 82px);
  height: clamp(56px, 8vw, 82px);
  color: #d69a1d;
  filter: drop-shadow(0 8px 8px rgba(168, 115, 18, 0.2));
  animation: star-pop 750ms cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

.reveal-star strong {
  font-family: var(--font-display);
  font-size: clamp(18px, 2.6vw, 27px);
  font-weight: 900;
}

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

.reveal-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
}

.reveal-empty .icon {
  width: clamp(38px, 5vw, 54px);
  height: clamp(38px, 5vw, 54px);
  color: #96ad99;
}

.reveal-empty strong {
  font-size: clamp(12px, 1.6vw, 15px);
  font-weight: 800;
}

.reveal-empty span {
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.5;
}

.flip-card.is-win .card-front {
  background:
    radial-gradient(circle at 50% 42%, #fff4c5, transparent 64%),
    #fffaf0;
  box-shadow:
    0 9px 0 #d2a22c,
    0 0 50px rgba(244, 201, 93, 0.7);
}

@keyframes star-pop {
  from {
    opacity: 0;
    transform: scale(0.35) rotate(-25deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

.draw-result {
  width: min(620px, 100%);
  margin: 26px auto 0;
  padding: 18px 24px;
  border: 1.5px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 253, 246, 0.86);
  box-shadow: var(--shadow-sm);
  text-align: center;
  animation: view-in 420ms ease both;
}

.draw-result.is-win {
  border-color: rgba(168, 115, 18, 0.28);
  background:
    radial-gradient(circle at 50% 0, #fff1b9, transparent 75%),
    var(--paper);
}

.draw-result h2 {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 2.8vw, 2rem);
  font-weight: 900;
  letter-spacing: -0.03em;
}

.draw-result p {
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 12.5px;
}

.draw-result .result-star-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-bottom: 8px;
  color: #a87312;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.draw-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 22px;
}

.draw-fineprint {
  margin-top: 26px;
  color: rgba(80, 105, 93, 0.75);
  font-size: 10.5px;
  text-align: center;
}

/* ---------- 排行榜 ---------- */

.leaderboard-view {
  width: min(1020px, calc(100% - 48px));
  margin: 0 auto;
  padding: 48px 0 82px;
}

.board-heading {
  max-width: 650px;
}

.board-heading h1 {
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: clamp(2.7rem, 5.6vw, 4.8rem);
  font-weight: 900;
  line-height: 1.04;
  letter-spacing: -0.055em;
}

.board-heading p:last-child {
  margin-top: 14px;
  color: var(--ink-soft);
  font-size: 14px;
}

.board-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin-top: 31px;
  padding: 0 5px;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 600;
}

.board-summary strong {
  color: var(--ink);
  font-size: 14px;
}

.board-table {
  margin-top: 10px;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 30px;
  background: var(--paper);
  box-shadow:
    9px 9px 0 rgba(23, 63, 47, 0.08),
    var(--shadow-md);
}

.board-head-row,
.board-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 148px 148px;
  align-items: center;
  gap: 10px;
}

.board-head-row {
  padding: 15px 28px;
  color: var(--ink-soft);
  background: var(--mint-soft);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.board-head-row span:last-child {
  text-align: right;
}

.board-head-row span:nth-child(3) {
  text-align: right;
}

.board-row {
  padding: 15px 28px;
  border-top: 1px solid rgba(23, 63, 47, 0.09);
  transition: background 170ms ease;
}

.board-row:hover {
  background: #fbf7eb;
}

.board-row.is-me {
  background: linear-gradient(90deg, rgba(220, 235, 213, 0.62), rgba(255, 253, 246, 0.4));
}

.board-row.is-top-1 {
  background: linear-gradient(90deg, #fff4c8, rgba(255, 253, 246, 0.7));
}

.board-row.is-top-2 {
  background: linear-gradient(90deg, #edf1f2, rgba(255, 253, 246, 0.7));
}

.board-row.is-top-3 {
  background: linear-gradient(90deg, #f7e7db, rgba(255, 253, 246, 0.7));
}

.board-row.is-me.is-top-1,
.board-row.is-me.is-top-2,
.board-row.is-me.is-top-3 {
  box-shadow: inset 4px 0 0 var(--forest);
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  min-width: 38px;
  justify-content: center;
  padding: 5px 8px;
  border-radius: 10px;
  color: var(--ink-soft);
  background: rgba(23, 63, 47, 0.055);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 900;
}

.rank-badge .icon {
  width: 13px;
  height: 13px;
}

.is-top-1 .rank-badge {
  color: #7b5209;
  background: #ffe9a8;
}

.is-top-2 .rank-badge {
  color: #4d5866;
  background: #e4eaed;
}

.is-top-3 .rank-badge {
  color: #875433;
  background: #f2ddcf;
}

.board-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.avatar {
  display: grid;
  place-items: center;
  width: 37px;
  height: 37px;
  flex: 0 0 auto;
  border: 1.5px solid rgba(23, 63, 47, 0.12);
  border-radius: 13px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.avatar-0 {
  background: #dcebd5;
}
.avatar-1 {
  background: #f8e4ba;
}
.avatar-2 {
  background: #f6dfd5;
}
.avatar-3 {
  background: #dfe7ee;
}
.avatar-4 {
  background: #e9e0f0;
}
.avatar-5 {
  background: #d9ece8;
}

.board-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 700;
}

.me-tag {
  display: inline-block;
  flex: 0 0 auto;
  margin-left: 5px;
  padding: 1px 6px;
  border-radius: 999px;
  color: var(--forest);
  background: var(--mint);
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
  vertical-align: 1px;
}

.board-cell {
  text-align: right;
  white-space: nowrap;
}

.board-cell strong {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 900;
}

.board-cell small {
  margin-left: 2px;
  color: var(--ink-soft);
  font-size: 10px;
}

.board-cell.stars-cell strong {
  color: #9b6400;
}

.board-cell .icon {
  display: inline-block;
  width: 13px;
  height: 13px;
  margin-right: 3px;
  color: #d59a20;
  vertical-align: -1px;
}

.board-loading {
  padding: 38px 20px;
  color: var(--ink-soft);
  font-size: 12px;
  text-align: center;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 64px 24px;
  margin-top: 28px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 28px;
  text-align: center;
}

.empty-star {
  color: var(--gold);
  font-size: 44px;
  line-height: 1;
}

.empty-state h2 {
  margin-top: 16px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 900;
}

.empty-state p {
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 13px;
}

.empty-state .button {
  margin-top: 22px;
}

/* ---------- 页脚、提示、彩纸、启动页 ---------- */

.site-footer {
  position: relative;
  z-index: 10;
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 26px 0 34px;
  border-top: 1px solid rgba(23, 63, 47, 0.1);
  color: rgba(80, 105, 93, 0.72);
  font-size: 10.5px;
  text-align: center;
}

.site-footer p + p {
  margin-top: 3px;
  opacity: 0.7;
}

.toast-region {
  position: fixed;
  right: 20px;
  bottom: 22px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}

.toast {
  max-width: min(360px, calc(100vw - 40px));
  padding: 11px 16px;
  border: 1.5px solid var(--ink);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: 0 5px 0 rgba(23, 63, 47, 0.16);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 700;
  animation: toast-in 260ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.toast.is-error {
  border-color: #9d4b32;
  color: #873d28;
  background: #fff2ea;
}

.toast.is-leaving {
  animation: toast-out 220ms ease both;
}

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

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

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

.confetti-piece {
  position: absolute;
  top: -18px;
  left: var(--x);
  width: 9px;
  height: 15px;
  border-radius: 2px;
  background: var(--color);
  opacity: 0;
  animation: confetti-fall var(--duration) cubic-bezier(0.16, 0.7, 0.3, 1) var(--delay) forwards;
}

.confetti-piece.is-star {
  width: 13px;
  height: 13px;
  border-radius: 0;
  clip-path: polygon(
    50% 0%,
    61% 35%,
    98% 35%,
    68% 57%,
    79% 92%,
    50% 70%,
    21% 92%,
    32% 57%,
    2% 35%,
    39% 35%
  );
}

@keyframes confetti-fall {
  0% {
    opacity: 0;
    transform: translate3d(0, -20px, 0) rotate(0);
  }
  8% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--drift), 105vh, 0) rotate(var(--spin));
  }
}

.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 42%, #eef5e7, transparent 24rem),
    var(--cream);
  transition:
    opacity 420ms ease,
    visibility 420ms ease;
}

.boot-screen.is-hidden {
  visibility: hidden;
  opacity: 0;
}

.boot-koala {
  position: relative;
  width: 96px;
  height: 88px;
  animation: gentle-bob 2.6s ease-in-out infinite;
}

.boot-ear {
  position: absolute;
  top: 2px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #9eb1a4;
}

.boot-ear-left {
  left: 3px;
}

.boot-ear-right {
  right: 3px;
}

.boot-face {
  position: absolute;
  right: 8px;
  bottom: 0;
  left: 8px;
  height: 68px;
  border-radius: 48% 48% 46% 46%;
  background: #aabbb0;
}

.boot-face i {
  position: absolute;
  top: 28px;
  width: 8px;
  height: 10px;
  border-radius: 50%;
  background: #26352d;
}

.boot-face i:first-child {
  left: 18px;
}

.boot-face i:nth-child(2) {
  right: 18px;
}

.boot-face b {
  position: absolute;
  top: 41px;
  left: 50%;
  width: 21px;
  height: 16px;
  border-radius: 50%;
  background: #3b3a36;
  transform: translateX(-50%);
}

.boot-screen p {
  margin-top: 21px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.boot-dots {
  display: flex;
  gap: 5px;
  margin-top: 10px;
}

.boot-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--forest-mid);
  animation: loading-dot 1s ease-in-out infinite;
}

.boot-dots i:nth-child(2) {
  animation-delay: 0.15s;
}

.boot-dots i:nth-child(3) {
  animation-delay: 0.3s;
}

/* ---------- 响应式 ---------- */

@media (max-width: 1020px) {
  .home-hero {
    grid-template-columns: minmax(0, 1.08fr) minmax(330px, 0.92fr);
    gap: 25px;
  }

  .koala-stage {
    width: 100%;
  }

  .speech-bubble {
    right: 0;
    font-size: 11.5px;
  }

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

  .mini-board-panel {
    min-height: 0;
  }
}

@media (max-width: 860px) {
  .header-inner {
    flex-wrap: wrap;
    gap: 9px;
  }

  .main-nav {
    order: 3;
    width: 100%;
    margin-left: 0;
    justify-content: center;
  }

  .user-area {
    margin-left: auto;
  }

  .auth-shell {
    grid-template-columns: 1fr;
    max-width: 620px;
  }

  .auth-art {
    padding: 30px 32px 26px;
  }

  .auth-art h1 {
    margin-top: 18px;
    font-size: clamp(2rem, 6vw, 2.8rem);
  }

  .auth-koala,
  .auth-art blockquote,
  .art-stamp {
    display: none;
  }

  .art-lead {
    max-width: 40rem;
    margin-top: 10px;
  }

  .auth-panel {
    padding: 30px 32px 36px;
  }

  .home-view,
  .quiz-view,
  .draw-view,
  .leaderboard-view {
    width: min(100% - 36px, 720px);
  }

  .home-hero {
    grid-template-columns: 1fr;
  }

  .hero-copy h1 {
    max-width: 12em;
    font-size: clamp(2.8rem, 10vw, 4.8rem);
  }

  .koala-stage {
    width: min(100%, 470px);
    justify-self: center;
    margin-top: 10px;
  }

  .home-grid {
    margin-top: 30px;
  }

  .quiz-topbar {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
  }

  .quiz-correct {
    display: none;
  }

  .question-card {
    min-height: 420px;
  }

  .board-head-row,
  .board-row {
    grid-template-columns: 70px minmax(0, 1fr) 108px 108px;
    padding-inline: 20px;
  }
}

@media (max-width: 620px) {
  :root {
    --header-height: 120px;
  }

  body {
    font-size: 15px;
  }

  .site-header {
    padding: 10px 12px 0;
  }

  .header-inner {
    padding: 8px 10px 8px 12px;
    border-radius: 19px;
  }

  .brand-mark {
    width: 39px;
    height: 39px;
    border-radius: 12px;
  }

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

  .brand-text strong {
    font-size: 15px;
  }

  .brand-text small {
    display: none;
  }

  .main-nav {
    gap: 2px;
  }

  .main-nav a {
    padding: 8px 12px;
    font-size: 12px;
  }

  .user-name {
    display: none;
  }

  .icon-button span {
    display: none;
  }

  .icon-button {
    padding: 7px;
  }

  .auth-view {
    min-height: auto;
    padding: 25px 12px 46px;
  }

  .auth-shell {
    border-radius: 27px;
    box-shadow:
      7px 7px 0 rgba(23, 63, 47, 0.1),
      var(--shadow-md);
  }

  .auth-art {
    padding: 24px 23px 21px;
  }

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

  .auth-art h1 {
    font-size: 1.85rem;
  }

  .art-lead {
    font-size: 12px;
    line-height: 1.7;
  }

  .auth-panel {
    padding: 23px 21px 28px;
  }

  .auth-tab {
    min-width: 68px;
    padding: 8px 15px;
  }

  .auth-heading {
    margin-top: 20px;
  }

  .auth-heading h2 {
    font-size: 1.7rem;
  }

  .auth-form {
    gap: 15px;
    margin-top: 19px;
  }

  .pin-row {
    gap: 7px;
  }

  .pin-row .pin-digit {
    height: 52px;
    border-radius: 13px;
    font-size: 22px;
  }

  .field input {
    height: 50px;
  }

  .home-view,
  .quiz-view,
  .draw-view,
  .leaderboard-view {
    width: calc(100% - 28px);
    padding-top: 31px;
  }

  .home-view {
    padding-bottom: 55px;
  }

  .hero-copy h1 {
    font-size: clamp(2.6rem, 13vw, 3.75rem);
  }

  .hero-lead {
    margin-top: 18px;
    font-size: 13.5px;
  }

  .hero-actions {
    margin-top: 23px;
  }

  .hero-actions .button {
    flex: 1;
    min-height: 50px;
    padding-inline: 16px;
    font-size: 13px;
  }

  .stat-strip {
    gap: 6px;
    margin-top: 27px;
  }

  .stat-card {
    display: block;
    padding: 10px 8px;
    text-align: center;
  }

  .stat-icon {
    width: 31px;
    height: 31px;
    margin: 0 auto 6px;
    border-radius: 10px;
  }

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

  .stat-label {
    font-size: 9.5px;
  }

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

  .koala-stage {
    width: 100%;
    max-width: 390px;
  }

  .speech-bubble {
    top: 2.5%;
    right: 1%;
    max-width: 170px;
    padding: 9px 12px;
    font-size: 10.5px;
  }

  .stage-hint {
    display: none;
  }

  .home-grid {
    gap: 13px;
  }

  .panel {
    padding: 21px;
    border-radius: 24px;
  }

  .panel-heading {
    align-items: flex-start;
  }

  .panel-badge {
    display: none;
  }

  .steps li {
    grid-template-columns: 39px minmax(0, 1fr);
    gap: 11px;
    padding: 13px 0;
  }

  .step-number {
    width: 35px;
    height: 35px;
    font-size: 10px;
  }

  .odds-note {
    align-items: flex-start;
  }

  .quiz-view {
    padding-bottom: 55px;
  }

  .quiz-topbar {
    margin-bottom: 14px;
  }

  .progress-label {
    font-size: 10px;
  }

  .question-card,
  .result-card {
    border-radius: 27px;
    box-shadow:
      6px 6px 0 rgba(23, 63, 47, 0.08),
      var(--shadow-sm);
  }

  .question-prompt {
    margin-top: 21px;
    font-size: clamp(1.6rem, 7vw, 2.15rem);
    line-height: 1.38;
  }

  .answer-form {
    flex-direction: column;
    align-items: stretch;
    margin-top: 29px;
  }

  .answer-input {
    width: 100%;
    height: 58px;
  }

  .answer-form .button {
    width: 100%;
  }

  .feedback-card {
    justify-content: flex-start;
    padding-top: 38px;
  }

  .feedback-actions {
    width: 100%;
  }

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

  .result-top {
    gap: 12px;
  }

  .result-score strong {
    font-size: clamp(4.4rem, 21vw, 6.7rem);
  }

  .result-grade {
    width: 70px;
    height: 70px;
    border-radius: 21px;
    font-size: 17px;
  }

  .result-actions .button {
    flex: 1;
    min-width: 0;
    padding-inline: 12px;
    font-size: 12px;
  }

  .draw-heading h1 {
    font-size: clamp(2.4rem, 12vw, 3.4rem);
  }

  .draw-heading > p:last-child {
    font-size: 12.5px;
  }

  .draw-stats {
    margin-top: 18px;
    font-size: 11px;
  }

  .cards-grid {
    gap: 7px;
    margin-top: 28px;
  }

  .flip-card {
    border-radius: 18px;
  }

  .flip-face {
    border-radius: 18px;
  }

  .card-back::before {
    inset: 7px;
    border-radius: 12px;
  }

  .card-corner {
    top: 14px;
    left: 13px;
    font-size: 8px;
  }

  .card-caption {
    bottom: 14px;
    font-size: 7.5px;
  }

  .card-emblem .icon {
    width: 50%;
    height: 50%;
  }

  .card-reveal {
    padding: 6px;
    gap: 4px;
  }

  .reveal-star strong {
    font-size: 14px;
  }

  .reveal-star span,
  .reveal-empty span {
    display: none;
  }

  .reveal-empty strong {
    font-size: 10px;
  }

  .draw-result {
    margin-top: 26px;
    padding: 18px;
  }

  .draw-actions .button {
    flex: 1;
    font-size: 12px;
    padding-inline: 12px;
  }

  .board-heading h1 {
    font-size: clamp(2.4rem, 12vw, 3.4rem);
  }

  .board-heading p:last-child {
    font-size: 12.5px;
  }

  .board-summary {
    margin-top: 22px;
  }

  .board-table {
    border-radius: 22px;
    box-shadow:
      5px 5px 0 rgba(23, 63, 47, 0.08),
      var(--shadow-sm);
  }

  .board-head-row {
    display: none;
  }

  .board-row {
    grid-template-columns: 41px minmax(0, 1fr) 64px 64px;
    gap: 7px;
    padding: 13px 13px;
  }

  .rank-badge {
    min-width: 30px;
    padding: 4px 5px;
    font-size: 10px;
  }

  .avatar {
    display: none;
  }

  .board-name {
    font-size: 12.5px;
  }

  .board-cell strong {
    font-size: 15px;
  }

  .board-cell small {
    font-size: 8px;
  }

  .board-cell .icon {
    display: none;
  }

  .site-footer {
    width: calc(100% - 36px);
    padding-top: 21px;
  }

  .toast-region {
    right: 12px;
    bottom: 12px;
    left: 12px;
    align-items: stretch;
  }

  .toast {
    max-width: none;
    text-align: center;
  }
}

@media (max-width: 390px) {
  .main-nav a {
    padding-inline: 9px;
  }

  .main-nav .icon {
    display: none;
  }

  .hero-actions {
    flex-direction: column;
  }

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

  .stat-card {
    padding-inline: 4px;
  }
}

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