/* 萌宠家 · 家长版 — 家庭教育向 / 孩子友好视觉 */
:root {
  --cream: #fffbf5;
  --peach: #ffe8dc;
  --peach-deep: #ffc9a8;
  --mint: #d4f5e8;
  --sky: #c8e7ff;
  --lavender: #e8e0ff;
  --text: #3d3428;
  --muted: #7a6e63;
  --line: rgba(255, 140, 100, 0.18);
  --coral: #ff8f6b;
  --coral-dark: #e86b4a;
  --sun: #ffd93d;
  --success: #2eb872;
  --warn: #f4a020;
  --danger: #e85d5d;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 12px 40px rgba(255, 120, 80, 0.12);
  --shadow-soft: 0 6px 24px rgba(61, 52, 40, 0.08);
  --font: 'Nunito', ui-sans-serif, system-ui, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-display: 'ZCOOL KuaiLe', 'Nunito', 'PingFang SC', sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--text);
  background: var(--cream);
  position: relative;
}

/* 背景装饰：柔和色块 */
.bg-blobs {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(ellipse 120% 80% at 100% 0%, rgba(255, 200, 180, 0.45) 0%, transparent 50%),
    radial-gradient(ellipse 90% 70% at 0% 100%, rgba(200, 231, 255, 0.5) 0%, transparent 45%),
    radial-gradient(ellipse 60% 50% at 80% 90%, rgba(212, 245, 232, 0.4) 0%, transparent 40%),
    linear-gradient(180deg, #fff9f2 0%, var(--cream) 40%, #fff5eb 100%);
}

body.mode-child .bg-blobs {
  background:
    radial-gradient(ellipse 100% 60% at 50% -10%, rgba(255, 217, 61, 0.35) 0%, transparent 45%),
    radial-gradient(ellipse 80% 50% at 100% 50%, rgba(200, 240, 255, 0.55) 0%, transparent 50%),
    radial-gradient(ellipse 70% 60% at 0% 80%, rgba(255, 200, 220, 0.4) 0%, transparent 45%),
    linear-gradient(165deg, #fff8ee 0%, #e8f8ff 50%, #fff5f0 100%);
}

#app {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  padding-bottom: calc(78px + var(--safe-bottom));
}

.hidden {
  display: none !important;
}

/* —— 登录 / 注册（家庭版网关） —— */
html.auth-logged-in #auth-screen {
  display: none !important;
}

html.auth-logged-in #app.hidden {
  display: block !important;
}

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 18px calc(24px + var(--safe-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background:
    radial-gradient(ellipse 90% 55% at 50% -15%, rgba(255, 200, 160, 0.55) 0%, transparent 52%),
    radial-gradient(ellipse 70% 50% at 100% 30%, rgba(255, 180, 200, 0.35) 0%, transparent 48%),
    radial-gradient(ellipse 60% 45% at 0% 70%, rgba(180, 230, 255, 0.4) 0%, transparent 50%),
    linear-gradient(168deg, #fff6ee 0%, #ffe8dc 38%, #e8f4ff 100%);
}

.auth-screen-inner {
  width: 100%;
  max-width: 400px;
  margin: auto;
  animation: authFadeUp 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes authFadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.auth-hero-visual {
  position: relative;
  width: 112px;
  height: 112px;
  margin: 0 auto 18px;
}

.auth-hero-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 210deg, rgba(255, 200, 170, 0.9), rgba(255, 140, 120, 0.5), rgba(200, 230, 255, 0.75), rgba(255, 200, 170, 0.9));
  animation: authSpin 10s linear infinite;
  opacity: 0.85;
}

@keyframes authSpin {
  to {
    transform: rotate(360deg);
  }
}

.auth-hero-icon {
  position: absolute;
  inset: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(160deg, #fff 0%, rgba(255, 248, 240, 0.98) 100%);
  box-shadow:
    0 12px 40px rgba(255, 120, 80, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  font-size: 2.6rem;
  color: #ff7a52;
}

.auth-hero-spark {
  position: absolute;
  font-size: 1.1rem;
  opacity: 0.9;
  animation: authFloat 3.2s ease-in-out infinite;
}

.auth-hero-spark--1 {
  top: -4px;
  right: -2px;
  animation-delay: 0s;
}

.auth-hero-spark--2 {
  bottom: 6px;
  left: -8px;
  animation-delay: 0.5s;
}

.auth-hero-spark--3 {
  top: 40%;
  right: -14px;
  animation-delay: 1s;
}

@keyframes authFloat {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-5px) scale(1.06);
  }
}

.auth-kicker {
  text-align: center;
  margin: 0 0 6px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 110, 80, 0.85);
}

.auth-title {
  margin: 0 0 10px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 400;
  line-height: 1.35;
  color: var(--coral-dark);
}

.auth-title-accent {
  background: linear-gradient(120deg, #ff8a5c 0%, #ff5c6c 50%, #c978ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.auth-sub {
  margin: 0 0 22px;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.55;
  color: var(--muted);
  padding: 0 4px;
}

.auth-card {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(18px);
  border-radius: 22px;
  border: 2px solid rgba(255, 210, 185, 0.65);
  box-shadow:
    0 20px 56px rgba(255, 130, 90, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  padding: 18px 18px 20px;
}

.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  padding: 5px;
  border-radius: 14px;
  background: rgba(255, 230, 210, 0.55);
  border: 1px solid rgba(255, 200, 170, 0.45);
}

.auth-tab {
  flex: 1;
  border: none;
  padding: 10px 12px;
  border-radius: 11px;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  color: var(--muted);
  background: transparent;
  transition:
    background 0.2s,
    color 0.2s,
    box-shadow 0.2s;
}

.auth-tab.active {
  color: var(--coral-dark);
  background: #fff;
  box-shadow: 0 4px 14px rgba(255, 120, 80, 0.18);
}

.auth-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text);
}

.auth-label i {
  font-size: 1rem;
  opacity: 0.85;
  color: var(--coral);
}

.auth-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 2px solid rgba(255, 200, 170, 0.75);
  background: rgba(255, 255, 255, 0.95);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.auth-input:focus {
  outline: none;
  border-color: rgba(255, 140, 100, 0.85);
  box-shadow: 0 0 0 4px rgba(255, 160, 120, 0.2);
}

.auth-input--code {
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.auth-submit {
  margin-top: 6px;
  width: 100%;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  font-size: 1rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-weight: 800;
  font-family: var(--font-display);
  background: linear-gradient(135deg, #ff9a6b 0%, #ff7a5c 45%, #ff5c8a 100%);
  color: #fff;
  box-shadow: 0 10px 32px rgba(255, 100, 80, 0.38);
  transition:
    transform 0.15s,
    box-shadow 0.2s;
}

.auth-submit:hover {
  box-shadow: 0 12px 36px rgba(255, 90, 70, 0.45);
}

.auth-submit:active {
  transform: scale(0.98);
}

.auth-submit--reg {
  background: linear-gradient(135deg, #7ecbff 0%, #6b9fff 45%, #b58cff 100%);
  box-shadow: 0 10px 32px rgba(100, 140, 255, 0.35);
}

.auth-hint {
  margin: 4px 0 0;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--muted);
  text-align: center;
}

.auth-foot {
  margin: 20px 0 0;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(120, 100, 90, 0.75);
}

.settings-account-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 248, 240, 0.85);
  border: 1px dashed rgba(255, 190, 160, 0.65);
}

.settings-account-who {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--coral-dark);
  min-width: 0;
}

.settings-account-who i {
  font-size: 1.15rem;
  opacity: 0.85;
}

.settings-account-who span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.auth-gate-open .bg-blobs {
  opacity: 0.45;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Top bar：仅品牌条 sticky；模式切换在下方单独一块，随滚动离开视口，避免压住卡片 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 251, 245, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 3px solid transparent;
  border-image: linear-gradient(90deg, var(--peach-deep), var(--sun), var(--mint)) 1;
  padding: 10px 14px 10px;
}

.topbar-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}

.topbar-brand-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.brand {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.45rem;
  letter-spacing: 0.02em;
  color: var(--coral-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand i {
  font-size: 1.5rem;
  color: var(--coral);
  filter: drop-shadow(0 2px 4px rgba(255, 140, 100, 0.35));
}

.brand-sub {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}

/* 模式切换区：不在 sticky 内，与顶栏同宽对齐 */
.topbar-mode-block {
  position: relative;
  z-index: 1;
  margin: 10px 14px 12px;
  padding: 12px 12px 10px;
  border-radius: 18px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.92) 0%, rgba(255, 242, 232, 0.88) 100%);
  border: 2px solid rgba(255, 180, 140, 0.45);
  box-shadow: 0 4px 18px rgba(255, 140, 100, 0.12);
}

.topbar-mode-block.topbar-mode-block--child {
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.95) 0%, rgba(232, 244, 255, 0.92) 100%);
  border-color: rgba(120, 180, 220, 0.5);
  box-shadow: 0 4px 18px rgba(80, 140, 200, 0.12);
}

.mode-current-banner {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}

.mode-current-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #8a3d24;
  background: linear-gradient(145deg, #fff 0%, #ffe8dc 100%);
  border: 2px solid rgba(255, 150, 110, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.mode-current-badge--child {
  color: #1a5a7a;
  background: linear-gradient(145deg, #fff 0%, #dceefa 100%);
  border-color: rgba(100, 170, 210, 0.55);
}

.mode-current-badge-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.mode-toggle-cta {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border: none;
  border-radius: 14px;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(145deg, var(--coral) 0%, #e86840 100%);
  box-shadow: 0 6px 20px rgba(255, 120, 80, 0.4);
  transition: transform 0.15s, box-shadow 0.2s;
}

.mode-toggle-cta:active:not(:disabled) {
  transform: scale(0.99);
}

.topbar-mode-block--child .mode-toggle-cta {
  background: linear-gradient(145deg, #4a9fd4 0%, #2a7ab0 100%);
  box-shadow: 0 6px 20px rgba(60, 140, 200, 0.38);
}

.mode-toggle-cta:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.mode-micro-hint {
  margin: 8px 0 0;
  padding: 0 4px;
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--muted);
  text-align: center;
  font-weight: 600;
}

/* 首页：积分兑换 + 学习 / 背诵 */
.home-core {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.home-core-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.home-core--child {
  margin-bottom: 14px;
}

/* 积分兑换 · 主按钮（流光 + 轻微浮动） */
.reward-exchange-cta {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font: inherit;
  text-align: left;
  overflow: hidden;
  box-shadow:
    0 4px 0 rgba(120, 40, 140, 0.35),
    0 18px 36px rgba(180, 60, 120, 0.28);
  transition: transform 0.18s ease, box-shadow 0.2s ease;
}

.reward-exchange-cta:active {
  transform: translateY(3px);
  box-shadow:
    0 1px 0 rgba(120, 40, 140, 0.35),
    0 8px 18px rgba(180, 60, 120, 0.2);
}

.reward-exchange-aurora {
  position: absolute;
  inset: -40%;
  background: conic-gradient(
    from 180deg at 50% 50%,
    #ff6b9d 0deg,
    #c471ed 90deg,
    #12c2e9 180deg,
    #f64f59 270deg,
    #ff6b9d 360deg
  );
  opacity: 0.55;
  animation: rewardAuroraSpin 8s linear infinite;
}

@keyframes rewardAuroraSpin {
  to {
    transform: rotate(360deg);
  }
}

.reward-exchange-cta--kid .reward-exchange-aurora {
  opacity: 0.48;
  animation-duration: 10s;
}

.reward-exchange-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 0%,
    transparent 40%,
    rgba(255, 255, 255, 0.55) 50%,
    transparent 60%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: rewardShine 3.2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes rewardShine {
  0% {
    background-position: 120% 0;
  }
  40%,
  100% {
    background-position: -80% 0;
  }
}

.reward-exchange-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 14px 14px;
  background: linear-gradient(135deg, rgba(35, 20, 45, 0.92) 0%, rgba(70, 30, 85, 0.88) 45%, rgba(25, 45, 75, 0.9) 100%);
  border-radius: 20px;
  border: 2px solid rgba(255, 255, 255, 0.22);
}

.reward-exchange-icon-wrap {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  font-size: 1.65rem;
  color: #fff;
  background: linear-gradient(145deg, #ff8a5c 0%, #ff5e9a 50%, #a855f7 100%);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.25),
    0 8px 20px rgba(255, 80, 140, 0.45);
  animation: rewardIconPulse 2.4s ease-in-out infinite;
}

@keyframes rewardIconPulse {
  0%,
  100% {
    box-shadow:
      0 0 0 2px rgba(255, 255, 255, 0.25),
      0 8px 20px rgba(255, 80, 140, 0.45);
    transform: scale(1);
  }
  50% {
    box-shadow:
      0 0 0 3px rgba(255, 200, 255, 0.35),
      0 10px 28px rgba(180, 100, 255, 0.55);
    transform: scale(1.04);
  }
}

.reward-exchange-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.reward-exchange-kicker {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: rgba(255, 220, 200, 0.75);
}

.reward-exchange-title {
  font-family: var(--font-display);
  font-size: 1.28rem;
  font-weight: 400;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
  line-height: 1.15;
}

.reward-exchange-sub {
  font-size: 0.76rem;
  font-weight: 600;
  color: rgba(200, 230, 255, 0.88);
  line-height: 1.35;
}

.reward-exchange-points {
  flex-shrink: 0;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #2a1530;
  background: linear-gradient(180deg, #fff9e6 0%, #ffd88a 100%);
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.reward-exchange-arrow {
  flex-shrink: 0;
  font-size: 1.35rem;
  color: rgba(255, 255, 255, 0.65);
}

.kid-rewards.kid-rewards--pulse {
  animation: kidRewardsPulse 0.9s ease 2;
  border-radius: 14px;
  outline: 2px solid rgba(255, 200, 120, 0.65);
  outline-offset: 4px;
}

@keyframes kidRewardsPulse {
  0%,
  100% {
    outline-offset: 4px;
    outline-color: rgba(255, 200, 120, 0.65);
  }
  50% {
    outline-offset: 8px;
    outline-color: rgba(255, 160, 200, 0.9);
  }
}

.core-tile {
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 12px 10px 12px 12px;
  border: none;
  border-radius: 18px;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: var(--text);
  box-shadow: 0 6px 20px rgba(80, 60, 40, 0.1);
  transition: transform 0.15s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.core-tile::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.12;
  pointer-events: none;
}

.core-tile:active {
  transform: scale(0.98);
}

.core-tile--learn {
  background: linear-gradient(145deg, #fff 0%, #e8f4ff 55%, #dceefa 100%);
  border: 2px solid rgba(100, 170, 220, 0.45);
}

.core-tile--learn::before {
  background: radial-gradient(circle at 100% 0%, rgba(100, 180, 255, 0.5), transparent 55%);
}

.core-tile--pet {
  background: linear-gradient(145deg, #fff8f2 0%, #ffe8dc 45%, #ffd8c8 100%);
  border: 2px solid rgba(255, 160, 120, 0.5);
}

.core-tile--pet::before {
  background: radial-gradient(circle at 0% 100%, rgba(255, 160, 100, 0.45), transparent 50%);
}

.core-tile-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  font-size: 1.45rem;
}

.core-tile--learn .core-tile-icon {
  background: linear-gradient(145deg, #5a9fd4, #7ec8e8);
  color: #fff;
  box-shadow: 0 4px 12px rgba(70, 140, 190, 0.35);
}

.core-tile--pet .core-tile-icon {
  background: linear-gradient(145deg, var(--coral) 0%, #ffb088 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(255, 120, 80, 0.35);
}

.core-tile-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.core-tile-kicker {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  opacity: 0.85;
}

.core-tile-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--coral-dark);
  line-height: 1.2;
}

.core-tile--learn .core-tile-title {
  color: #1a5a7a;
}

/* 学习挑战：与知识背诵同排，图标 + 标题 + 箭头 */
.core-tile--learn-with-icon {
  justify-content: center;
  text-align: center;
}

.core-tile--learn-with-icon .core-tile-icon {
  align-self: center;
}

.core-tile--learn-with-icon .core-tile-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-width: 0;
}

.core-tile--learn-with-icon .core-tile-title {
  width: 100%;
  text-align: center;
}

.core-tile--learn-with-icon .core-tile-arrow {
  align-self: center;
}

.core-tile-desc {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.3;
}

.core-tile-arrow {
  flex-shrink: 0;
  align-self: center;
  font-size: 1.25rem;
  opacity: 0.45;
}

#pet-hero,
#child-pet-hero {
  /* 与仅含品牌条的 sticky 顶栏高度大致对齐 */
  scroll-margin-top: 72px;
}

/* Main */
.main {
  padding: 16px;
}

.panel {
  animation: popIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#view-empty.panel:not(.hidden) {
  min-height: calc(100dvh - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 使用教程 */
#view-parent-tutorial .tutorial-doc {
  padding-bottom: calc(72px + var(--safe-bottom));
  max-width: 520px;
  margin: 0 auto;
}

.tutorial-doc .tutorial-lead {
  margin-bottom: 18px;
}

.tutorial-block {
  margin-bottom: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 200, 170, 0.45);
  line-height: 1.65;
  font-size: 0.9rem;
  color: var(--text);
}

.tutorial-block p {
  margin: 0;
}

.tutorial-h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--coral-dark);
}

.tutorial-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 8px;
  background: rgba(255, 160, 120, 0.35);
  font-size: 0.78rem;
  font-weight: 800;
}

.tutorial-block--tip {
  background: linear-gradient(135deg, rgba(255, 248, 235, 0.95) 0%, rgba(255, 235, 210, 0.4) 100%);
  border-style: dashed;
}

.pref-quiz-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.pref-quiz-label {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
  flex-shrink: 0;
}

.pref-quiz-select,
.pref-quiz-input {
  flex: 1;
  min-width: 120px;
  max-width: 240px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 2px solid rgba(255, 200, 170, 0.65);
  background: #fff;
  font: inherit;
  font-weight: 600;
  color: var(--text);
}

.pref-quiz-actions {
  margin-top: 18px;
}

.pref-quiz-actions .btn {
  width: 100%;
  justify-content: center;
  gap: 6px;
}

.empty-onboard {
  text-align: center;
  padding: 24px 20px 40px;
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
}

.empty-onboard-lead {
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--coral-dark);
  margin: 0 0 22px;
}

.empty-onboard-cta {
  width: 100%;
  max-width: 300px;
  padding: 18px 22px !important;
  font-size: 1.12rem !important;
  font-family: var(--font-display);
  font-weight: 400 !important;
  border-radius: 999px !important;
  box-shadow: 0 10px 32px rgba(255, 120, 80, 0.38);
}

.empty-onboard-hint {
  margin: 20px 0 0;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.6;
  font-weight: 600;
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.98) translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.empty-card {
  text-align: center;
  padding: 44px 22px;
  background: linear-gradient(165deg, #fff 0%, var(--peach) 100%);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 3px solid rgba(255, 255, 255, 0.9);
}

.empty-illus {
  position: relative;
  display: inline-block;
  margin-bottom: 16px;
}

.empty-big {
  font-size: 4rem;
  line-height: 1;
  filter: drop-shadow(0 6px 12px rgba(255, 150, 100, 0.35));
}

.empty-illus .spark {
  position: absolute;
  top: -4px;
  right: -12px;
  font-size: 1.5rem;
  animation: twinkle 2s ease-in-out infinite;
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.15);
  }
}

.empty-card h2 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--coral-dark);
}

.empty-card p {
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.65;
}

/* Child bar（select 默认 min-width 很大，会挤没右侧齿轮按钮） */
.child-bar {
  display: flex;
  gap: 8px;
  align-items: stretch;
  margin-bottom: 14px;
  min-width: 0;
  width: 100%;
}

.child-bar .select-child {
  flex: 1 1 0%;
  min-width: 0;
  max-width: 100%;
}

.select-child {
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--line);
  font-size: 1rem;
  font-weight: 700;
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow-soft);
}

.child-bar > .btn {
  flex: 0 0 auto;
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 8px 12px;
  box-sizing: border-box;
}

/* Pet showcase */
.pet-showcase {
  position: relative;
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.pet-deco {
  position: absolute;
  top: 8px;
  right: 8%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 1.1rem;
  opacity: 0.85;
  animation: floaty 3s ease-in-out infinite;
}

@keyframes floaty {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

.pet-frame {
  position: relative;
  width: min(220px, 72vw);
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #fff 0%, var(--peach) 55%, #fff 100%);
  border-radius: 28px;
  border: 4px solid #fff;
  box-shadow:
    var(--shadow),
    inset 0 0 0 2px rgba(255, 200, 160, 0.5);
  overflow: hidden;
}

.pet-frame--kid {
  width: min(260px, 78vw);
  border-radius: 32px;
  border-width: 5px;
  background: linear-gradient(160deg, #fff 0%, var(--sky) 40%, var(--mint) 100%);
  box-shadow:
    0 16px 48px rgba(80, 180, 220, 0.22),
    inset 0 0 0 3px rgba(255, 255, 255, 0.8);
  animation: kidBounce 4s ease-in-out infinite;
}

@keyframes kidBounce {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-4px) rotate(-1deg);
  }
}

.pet-img {
  width: 88%;
  height: 88%;
  object-fit: contain;
  image-rendering: auto;
  filter: drop-shadow(0 8px 16px rgba(80, 60, 40, 0.12));
  transform-origin: 50% 38%;
  animation: petFaceBlink 5.2s ease-in-out infinite;
}

/* 整张插画无法拆眼皮：用轻微纵向压扁模拟眨眼（偏上为轴，更像眼睑） */
@keyframes petFaceBlink {
  0%,
  92%,
  100% {
    transform: scaleY(1);
  }
  93.2% {
    transform: scaleY(0.9);
  }
  94% {
    transform: scaleY(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pet-img {
    animation: none;
  }
}

/* 图片加载失败时的 emoji 兜底，同样轻眨一下 */
.pet-frame .pet-fallback:not([hidden]) {
  transform-origin: center 42%;
  animation: petFaceBlink 5.2s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .pet-frame .pet-fallback:not([hidden]) {
    animation: none;
  }
}

.pet-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  line-height: 1;
  background: linear-gradient(180deg, transparent 0%, rgba(255, 255, 255, 0.35) 100%);
}

.pet-frame--kid .pet-fallback {
  font-size: 5.5rem;
}

.pet-hero {
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 236, 220, 0.9) 100%);
  border-radius: var(--radius);
  padding: 18px 16px 20px;
  box-shadow: var(--shadow-soft);
  border: 2px solid rgba(255, 200, 170, 0.35);
  margin-bottom: 16px;
}

.pet-hero.kid {
  background: linear-gradient(165deg, #fff 0%, rgba(200, 240, 255, 0.5) 50%, rgba(255, 245, 230, 0.9) 100%);
  border-color: rgba(120, 200, 255, 0.25);
}

.pet-hunger-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.35;
}

.pet-hunger-banner--mild {
  background: rgba(255, 230, 180, 0.65);
  border: 2px solid rgba(245, 158, 11, 0.45);
  color: #7c4a12;
}

.pet-hunger-banner--severe {
  background: rgba(255, 200, 200, 0.75);
  border: 2px solid rgba(220, 80, 80, 0.55);
  color: #7f1d1d;
}

.pet-hunger-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.pet-hero--hunger-mild .pet-frame {
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.35);
}

.pet-hero--hunger-critical .pet-frame {
  box-shadow: 0 0 0 3px rgba(220, 80, 80, 0.45);
}

.pet-awaiting-panel {
  text-align: center;
  padding: 18px 12px 8px;
}

.pet-awaiting-egg {
  font-size: 3.2rem;
  line-height: 1;
  margin-bottom: 8px;
}

.pet-awaiting-text {
  margin: 0 0 14px;
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.45;
}

/* 与 .pet-frame 同宽居中，下方积分条等仍占满卡片宽度 */
.pet-hero-active-block {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pet-hero-active-block .pet-meta,
.pet-hero-active-block .points-row,
.pet-hero-active-block .xp-bar-wrap,
.pet-hero-active-block .xp-hint {
  align-self: stretch;
  width: 100%;
}

/* 满级提示：叠在宠物图正中，高对比易读 */
.pet-frame .pet-summon-hint {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 4;
  box-sizing: border-box;
  width: min(92%, 200px);
  margin: 0;
  padding: 11px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: clamp(0.92rem, 4.2vw, 1.05rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  color: #fff;
  text-align: center;
  line-height: 1.25;
  pointer-events: none;
  background: linear-gradient(155deg, rgba(180, 55, 8, 0.92) 0%, rgba(245, 130, 28, 0.94) 50%, rgba(220, 90, 12, 0.92) 100%);
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, 0.72);
  box-shadow:
    0 6px 22px rgba(160, 60, 10, 0.55),
    0 0 0 1px rgba(0, 0, 0, 0.12) inset,
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  animation: petSummonHintPulse 2.4s ease-in-out infinite;
}

.pet-summon-hint__line1 {
  font-size: 1.05em;
}

.pet-summon-hint__line2 {
  font-size: 0.88em;
  font-weight: 800;
  opacity: 0.98;
}

@keyframes petSummonHintPulse {
  0%,
  100% {
    box-shadow:
      0 6px 22px rgba(160, 60, 10, 0.55),
      0 0 0 1px rgba(0, 0, 0, 0.12) inset,
      inset 0 1px 0 rgba(255, 255, 255, 0.35);
  }
  50% {
    box-shadow:
      0 8px 28px rgba(245, 140, 30, 0.65),
      0 0 0 1px rgba(0, 0, 0, 0.12) inset,
      inset 0 1px 0 rgba(255, 255, 255, 0.4);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pet-frame .pet-summon-hint {
    animation: none;
  }
}

.parent-summon-guardian-btn {
  display: block;
  box-sizing: border-box;
  width: min(220px, 72vw);
  max-width: 100%;
  margin: 0 0 12px;
  padding: 10px 12px;
  font-size: 0.86rem;
  font-weight: 800;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
  text-align: center;
}

.parent-summon-guardian-btn:active {
  transform: scale(0.98);
}

.settings-block--hunger .hunger-days-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin: 12px 0;
}

.settings-block--hunger .hunger-days-row label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
}

.hunger-num {
  width: 4.5rem;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--line);
  font-weight: 700;
}

.pethall-card-badge--spirit {
  background: linear-gradient(135deg, #f59e0b, #ea580c);
}

.pet-meta {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}

.pet-name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.15rem;
  color: var(--coral-dark);
}

.pet-level {
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 700;
}

.points-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(255, 217, 61, 0.2) 0%, rgba(255, 200, 160, 0.25) 100%);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  border: 2px dashed rgba(255, 180, 120, 0.45);
}

.points-row.kid {
  justify-content: center;
  flex-direction: column;
  gap: 2px;
  background: linear-gradient(135deg, rgba(180, 235, 255, 0.45) 0%, rgba(255, 240, 200, 0.5) 100%);
  border-color: rgba(100, 200, 255, 0.35);
}

.points-label {
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 700;
}

.points-val {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--coral-dark);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.8);
}

.points-row.kid .points-val {
  font-size: 2.35rem;
  color: #2a8fc4;
}

.xp-bar-wrap {
  height: 12px;
  background: rgba(255, 200, 160, 0.35);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
  border: 2px solid rgba(255, 255, 255, 0.8);
}

.xp-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--sun), var(--coral), #ff6b9d);
  border-radius: 999px;
  transition: width 0.45s cubic-bezier(0.34, 1.3, 0.64, 1);
}

.xp-hint {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
  font-weight: 600;
}

.kid-name {
  margin: 10px 0 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--text);
}

.quick-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}

.quick-actions .btn {
  flex: 1 1 0;
  min-width: 0;
  padding: 12px 4px;
  font-size: 0.76rem;
  white-space: nowrap;
  justify-content: center;
}

.quick-actions .btn i {
  font-size: 1.05rem;
  flex-shrink: 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.98rem;
  font-family: var(--font);
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn:active {
  transform: scale(0.97);
}

.btn.primary {
  background: linear-gradient(145deg, var(--coral) 0%, var(--coral-dark) 100%);
  color: #fff;
  box-shadow: 0 6px 20px rgba(255, 120, 80, 0.45);
}

.btn.success {
  background: linear-gradient(145deg, #5adf9a 0%, var(--success) 100%);
  color: #fff;
  box-shadow: 0 6px 20px rgba(46, 184, 114, 0.35);
}

.btn.warn {
  background: linear-gradient(145deg, #ffd07a 0%, var(--warn) 100%);
  color: #5c3d10;
  box-shadow: 0 6px 18px rgba(244, 160, 32, 0.3);
}

.btn.secondary.outline {
  background: #fff;
  color: var(--coral-dark);
  border: 2px solid rgba(255, 160, 120, 0.55);
  box-shadow: 0 2px 10px rgba(255, 140, 100, 0.12);
}

.btn.secondary.outline:active {
  box-shadow: none;
}

.btn.ghost {
  background: #fff;
  border: 2px solid var(--line);
  color: var(--text);
}

.btn.sm {
  padding: 9px 16px;
  font-size: 0.86rem;
}

.btn.danger.outline {
  background: rgba(255, 240, 240, 0.9);
  color: var(--danger);
  border: 2px dashed rgba(232, 93, 93, 0.45);
  width: 100%;
}

.btn-block {
  width: 100%;
}

/* Sections */
.section-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--coral-dark);
}

.section-title i {
  color: var(--coral);
}

.section-desc {
  margin: 0 0 14px;
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.55;
}

.settings-hub-desc {
  margin-top: -4px;
}

/* 设置 · 二级菜单 */
.settings-menu {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.settings-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: 2px solid rgba(255, 200, 170, 0.55);
  border-radius: 16px;
  background: linear-gradient(145deg, #fff 0%, rgba(255, 248, 240, 0.95) 100%);
  font: inherit;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  box-shadow: var(--shadow-soft);
  transition:
    border-color 0.2s,
    transform 0.15s;
}

.settings-menu-item:active {
  transform: scale(0.99);
}

.settings-menu-item:hover {
  border-color: rgba(255, 160, 120, 0.55);
}

.settings-menu-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(255, 200, 170, 0.35);
  color: var(--coral-dark);
  font-size: 1.25rem;
}

.settings-menu-text {
  flex: 1;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--coral-dark);
}

.settings-menu-arrow {
  flex-shrink: 0;
  opacity: 0.4;
  font-size: 1.2rem;
}

.settings-subpanel {
  animation: popIn 0.3s ease;
}

.settings-subpanel .settings-back {
  margin-bottom: 14px;
}

.pet-pick-hint {
  margin-top: -4px;
}

.template-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.chip {
  padding: 9px 14px;
  border-radius: 999px;
  border: 2px dashed rgba(255, 160, 120, 0.5);
  background: #fff;
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--text);
  font-weight: 600;
  transition: border-color 0.2s, background 0.2s;
}

.chip:hover {
  border-color: var(--coral);
  background: var(--peach);
}

.rule-list,
.reward-list {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
}

.rule-item,
.reward-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  background: #fff;
  border-radius: var(--radius-sm);
  border: 2px solid rgba(255, 200, 170, 0.35);
  margin-bottom: 10px;
  box-shadow: var(--shadow-soft);
}

.rule-main {
  flex: 1;
  min-width: 0;
}

.rule-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.rule-val {
  font-size: 0.82rem;
  color: var(--success);
  font-weight: 700;
}

.rule-item.disabled .rule-title {
  color: var(--muted);
  text-decoration: line-through;
}

.rule-actions,
.reward-actions {
  display: flex;
  gap: 6px;
}

.icon-toggle,
.icon-del {
  border: none;
  background: var(--peach);
  width: 38px;
  height: 38px;
  border-radius: 12px;
  cursor: pointer;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-toggle.on {
  color: var(--success);
  background: var(--mint);
}

.icon-del:hover {
  color: var(--danger);
  background: rgba(255, 220, 220, 0.8);
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.inline-form input {
  flex: 1;
  min-width: 120px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--line);
  font-size: 0.95rem;
  background: #fff;
}

.inline-form input[type='number'] {
  max-width: 92px;
}

/* Log */
.log-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.log-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 14px;
  background: #fff;
  border-radius: var(--radius-sm);
  border: 2px solid rgba(230, 220, 210, 0.6);
  font-size: 0.9rem;
}

.log-item .delta {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.log-item .delta.pos {
  color: var(--success);
}

.log-item .delta.neg {
  color: var(--danger);
}

.log-meta {
  color: var(--muted);
  font-size: 0.75rem;
  margin-top: 4px;
}

/* Settings */
.settings-block {
  margin-bottom: 22px;
}

.settings-block .label {
  display: block;
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin-bottom: 8px;
  color: var(--coral-dark);
}

.toggle {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text);
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: var(--radius-sm);
  border: 2px solid var(--line);
}

.toggle input {
  margin-top: 4px;
  width: 20px;
  height: 20px;
  accent-color: var(--coral);
}

.toggle--sub {
  margin-top: 10px;
  margin-left: 8px;
  border-style: dashed;
}

.toggle-hint {
  font-weight: 500;
  color: var(--muted);
  font-size: 0.86rem;
}

.toggle--disabled {
  opacity: 0.55;
  pointer-events: none;
}

.levelup-preview-hint {
  margin-top: 10px;
  font-size: 0.82rem;
}

.level-threshold-table {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
}

.level-threshold-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.88);
  border-radius: var(--radius-sm);
  border: 2px solid var(--line);
}

.level-threshold-row-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ltr-label {
  font-weight: 800;
  color: var(--coral-dark);
  font-size: 0.95rem;
}

.ltr-detail {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.45;
}

.ltr-input {
  width: 100%;
  max-width: 200px;
  padding: 10px 12px;
  font-size: 1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  border-radius: var(--radius-sm);
  border: 2px solid var(--line);
}

.level-threshold-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.pet-pick-wrap {
  max-height: 360px;
  overflow-y: auto;
  padding: 4px;
  margin: 0 -4px;
  border-radius: var(--radius-sm);
  -webkit-overflow-scrolling: touch;
}

.pet-pick {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

@media (min-width: 400px) {
  .pet-pick {
    grid-template-columns: repeat(4, 1fr);
  }
}

.pet-opt {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px 8px;
  border: 3px solid rgba(255, 200, 170, 0.45);
  border-radius: 16px;
  background: linear-gradient(180deg, #fff 0%, var(--cream) 100%);
  cursor: pointer;
  transition: transform 0.15s, border-color 0.2s, box-shadow 0.2s;
  min-height: 0;
}

.pet-opt:hover {
  border-color: var(--coral);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 140, 100, 0.15);
}

.pet-opt.selected {
  border-color: var(--coral);
  background: linear-gradient(180deg, var(--peach) 0%, #fff 100%);
  box-shadow: 0 0 0 3px rgba(255, 143, 107, 0.25);
}

.pet-opt-img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
}

.pet-opt-emoji {
  font-size: 2rem;
  line-height: 56px;
  height: 56px;
  text-align: center;
}

.pet-opt-name {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
  line-height: 1.25;
  max-width: 100%;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Kid view */
.kid-section-title {
  font-family: var(--font-display);
  font-size: 1rem;
  margin: 22px 0 12px;
  color: #2a7ab8;
  text-align: center;
}

.kid-tasks {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.kid-task {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px;
  background: linear-gradient(135deg, #fff 0%, rgba(200, 240, 255, 0.35) 100%);
  border-radius: 18px;
  border: 3px solid rgba(120, 200, 255, 0.35);
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform 0.12s;
}

.kid-task:active {
  transform: scale(0.99);
}

.kid-task .tag {
  font-size: 0.9rem;
  color: var(--success);
  font-weight: 900;
  background: var(--mint);
  padding: 4px 10px;
  border-radius: 999px;
}

.kid-task.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.2);
}

.kid-rewards {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.kid-reward {
  padding: 14px 16px;
  background: linear-gradient(90deg, rgba(255, 230, 200, 0.6) 0%, rgba(255, 245, 220, 0.9) 100%);
  border-radius: 14px;
  font-size: 0.92rem;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border: 2px dashed rgba(255, 180, 120, 0.5);
}

.kid-reward .cost {
  color: var(--coral-dark);
  white-space: nowrap;
}

.kid-lock {
  font-size: 0.88rem;
  color: #c77a20;
  margin: 10px 0 0;
  text-align: center;
  font-weight: 600;
}

/* Bottom nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  display: flex;
  background: rgba(255, 251, 245, 0.96);
  backdrop-filter: blur(16px);
  border-top: 3px solid rgba(255, 200, 170, 0.5);
  padding: 10px 8px calc(10px + var(--safe-bottom));
  z-index: 40;
  box-shadow: 0 -8px 32px rgba(255, 150, 100, 0.1);
}

.bottom-nav.hidden {
  display: none;
}

.bottom-nav--three .nav-item {
  font-size: 0.72rem;
}

.bottom-nav--four .nav-item {
  font-size: 0.62rem;
  padding: 6px 2px;
  gap: 2px;
}

.bottom-nav--four .nav-item i {
  font-size: 1.18rem;
}

.bottom-nav--kid .nav-item {
  flex: 1;
  min-width: 0;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 8px 6px;
  gap: 4px;
}

.bottom-nav--kid .nav-item i {
  font-size: 1.35rem;
}

.view-child-page {
  padding-bottom: 4px;
}

.kid-pethall-doc {
  padding: 4px 0 calc(12px + var(--safe-bottom));
}

.kid-pethall-doc .section-title {
  margin-bottom: 8px;
}

.pethall-card-pet--solo {
  display: block;
  width: 100%;
  text-align: center;
}

/* 已养成宠物 · 满级橱窗（两列，全部满级宠） */
.pethall-doc {
  padding-bottom: calc(8px + var(--safe-bottom));
}

.pethall-lead {
  margin-bottom: 14px;
}

.pethall-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 4px;
}

.pethall-empty {
  margin-top: 12px;
  text-align: center;
}

.pethall-empty.hidden {
  display: none !important;
}

.pethall-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(165deg, #fff 0%, rgba(255, 240, 228, 0.92) 100%);
  border: 2px solid rgba(255, 190, 150, 0.55);
  box-shadow: var(--shadow-soft);
}

.pethall-card-visual {
  position: relative;
  aspect-ratio: 1;
  background: linear-gradient(160deg, rgba(255, 252, 248, 1) 0%, rgba(255, 228, 210, 0.65) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pethall-card-img {
  width: 82%;
  height: 82%;
  object-fit: contain;
  image-rendering: auto;
  filter: drop-shadow(0 6px 14px rgba(80, 60, 40, 0.14));
}

.pethall-card-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.35);
  letter-spacing: 0.02em;
}

.pethall-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 10px 12px;
  min-width: 0;
}

.pethall-card-child {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--coral-dark);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pethall-card-pet {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 4px;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  border-radius: 12px;
  transition: color 0.2s, background 0.2s;
}

.nav-item i {
  font-size: 1.4rem;
}

.nav-item.active {
  color: var(--coral-dark);
  background: rgba(255, 230, 210, 0.65);
}

/* Modal：须高于 #toast(200)，且放在 #app 外，否则整层被压在 toast 下导致「加分」等弹层/网格看不见 */
.modal {
  position: fixed;
  inset: 0;
  z-index: 260;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  padding-top: max(16px, env(safe-area-inset-top, 0px));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s;
}

.modal.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(45, 38, 32, 0.45);
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  max-height: 85vh;
  overflow: auto;
  background: linear-gradient(180deg, #fff 0%, var(--cream) 100%);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 18px;
  box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.12);
  border: 3px solid rgba(255, 200, 170, 0.4);
  border-bottom: none;
}

.modal-card.sm {
  border-radius: var(--radius);
  margin-bottom: auto;
  margin-top: auto;
  align-self: center;
  border-bottom: 3px solid rgba(255, 200, 170, 0.4);
}

.modal-card--shop {
  display: flex;
  flex-direction: column;
  max-height: min(88vh, 720px);
  overflow: hidden;
}

.reward-shop-modal .modal-card--shop {
  background: linear-gradient(180deg, #fffbf7 0%, #fff5ec 45%, #ffe8dc 100%);
}

.reward-shop-head {
  align-items: flex-start;
  margin-bottom: 8px;
  gap: 10px;
  min-width: 0;
}

.reward-shop-head > div:first-child {
  flex: 1 1 0%;
  min-width: 0;
}

.reward-shop-head h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.reward-shop-tagline {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}

.reward-shop-wallet {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  margin-bottom: 12px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 217, 61, 0.38) 0%, rgba(255, 200, 160, 0.42) 100%);
  border: 2px dashed rgba(255, 160, 90, 0.55);
}

.reward-shop-wallet-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted);
}

.reward-shop-wallet-val {
  font-size: 1.65rem;
  font-variant-numeric: tabular-nums;
  color: var(--coral-dark);
}

.reward-shop-body {
  flex: 1;
  min-height: 100px;
  max-height: min(46vh, 380px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -4px;
  padding: 0 4px 4px;
}

.reward-shop-shelf {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.reward-shop-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px 10px 12px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid rgba(255, 200, 170, 0.6);
  box-shadow: 0 4px 14px rgba(200, 120, 80, 0.08);
}

.reward-shop-item--can {
  border-color: rgba(80, 180, 120, 0.42);
  box-shadow: 0 4px 16px rgba(80, 160, 100, 0.12);
}

.reward-shop-item-icon {
  font-size: 1.75rem;
  line-height: 1;
}

.reward-shop-item-title {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.35;
}

.reward-shop-item-price {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--coral-dark);
  margin-top: 4px;
}

.reward-shop-item-price i {
  vertical-align: -2px;
  margin-right: 2px;
  opacity: 0.85;
}

.reward-shop-buy:disabled {
  opacity: 0.7;
}

.reward-shop-empty {
  text-align: center;
  padding: 28px 16px;
  color: var(--muted);
  font-weight: 600;
  list-style: none;
}

.reward-shop-empty-ico {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 8px;
}

.reward-shop-empty-hint {
  margin: 8px 0 0;
  font-size: 0.84rem;
  font-weight: 600;
}

.reward-shop-footnote {
  margin: 10px 0 0;
  font-size: 0.76rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.45;
}

.reward-shop-history-block {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 2px dashed rgba(255, 180, 140, 0.55);
}

.reward-shop-history-top {
  margin-bottom: 10px;
}

.reward-shop-history-heading {
  margin: 0 0 8px;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--coral-dark);
  display: flex;
  align-items: center;
  gap: 6px;
}

.reward-shop-history-heading i {
  font-size: 1.05rem;
  opacity: 0.9;
}

.rsh-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.rsh-filter-chip {
  border: 2px solid rgba(255, 200, 170, 0.75);
  background: rgba(255, 255, 255, 0.85);
  color: var(--muted);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s;
}

.rsh-filter-chip:hover {
  border-color: rgba(255, 160, 120, 0.65);
  color: var(--text);
}

.rsh-filter-chip.active {
  border-color: rgba(255, 130, 90, 0.85);
  background: rgba(255, 230, 210, 0.95);
  color: var(--coral-dark);
}

.rsh-filter-custom {
  margin-top: 4px;
}

.rsh-filter-custom-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}

.rsh-date-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
}

.rsh-date-input {
  padding: 6px 8px;
  border-radius: 10px;
  border: 2px solid rgba(255, 200, 170, 0.65);
  background: #fff;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  max-width: 148px;
}

.reward-shop-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: min(200px, 28vh);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.reward-shop-history-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 6px 10px;
  align-items: center;
  padding: 8px 10px;
  font-size: 0.82rem;
  background: rgba(255, 255, 255, 0.72);
  border-radius: 12px;
  border: 1px solid rgba(255, 200, 170, 0.45);
}

.rsh-time {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.rsh-label {
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  min-width: 0;
  word-break: break-word;
}

.rsh-cost {
  font-weight: 800;
  font-size: 0.78rem;
  color: #c24a30;
  white-space: nowrap;
}

.reward-shop-history-empty {
  list-style: none;
  margin: 0;
  padding: 12px 10px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.5);
  border-radius: 12px;
  border: 1px dashed rgba(200, 180, 160, 0.6);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
  min-width: 0;
  position: relative;
  z-index: 2;
}

.modal-head h3 {
  margin: 0;
  flex: 1 1 0%;
  min-width: 0;
  padding-right: 4px;
  font-family: var(--font-display);
  font-size: 1.2rem;
  line-height: 1.3;
  color: var(--coral-dark);
  word-break: break-word;
}

.icon-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 2px solid rgba(232, 120, 80, 0.35);
  background: linear-gradient(165deg, #fff 0%, var(--peach) 100%);
  border-radius: 12px;
  cursor: pointer;
  color: var(--coral-dark);
  box-shadow: 0 2px 10px rgba(200, 100, 60, 0.18);
  font-size: 1.35rem;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}

.icon-btn i {
  display: block;
  line-height: 1;
}

.icon-btn:hover {
  border-color: rgba(232, 120, 80, 0.55);
  color: #7a2e18;
}

.child-manage-list {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
}

.child-manage-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 2px dashed var(--line);
  font-weight: 700;
}

.modal-form {
  display: flex;
  gap: 8px;
}

.modal-form input {
  flex: 1;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--line);
  font-size: 1rem;
}

.form-row {
  margin-bottom: 14px;
}

.form-row label {
  display: block;
  font-size: 0.86rem;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 6px;
}

.form-row input {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--line);
}

/* Toast */
.toast {
  position: fixed;
  bottom: calc(96px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(24px);
  padding: 12px 22px;
  background: linear-gradient(135deg, rgba(45, 40, 35, 0.94) 0%, rgba(60, 50, 45, 0.95) 100%);
  color: #fff;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s, transform 0.28s;
  z-index: 200;
  max-width: 90%;
  text-align: center;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* 学习挑战弹层 */
.lc-modal .lc-modal-card {
  max-height: min(88vh, 720px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.lc-modal .lc-modal-card .modal-head {
  flex-shrink: 0;
}

.lc-modal-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 2px;
  flex: 1;
  min-height: 0;
}

.lc-wrap {
  max-width: 100%;
}

.lc-intro {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.lc-intro-prefs strong {
  color: var(--coral-dark);
}

.lc-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (min-width: 400px) {
  .lc-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.lc-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--line);
  background: linear-gradient(180deg, #fff 0%, var(--cream) 100%);
  cursor: pointer;
  font: inherit;
  color: var(--text);
  transition: transform 0.15s, border-color 0.15s;
}

.lc-card:hover {
  transform: translateY(-2px);
  border-color: var(--coral);
}

.lc-card-emoji {
  font-size: 1.75rem;
  line-height: 1;
}

.lc-card-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--coral-dark);
}

.lc-card-meta {
  font-size: 0.7rem;
  color: var(--muted);
}

.lc-quiz-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.lc-progress {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 700;
}

.lc-question {
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.55;
  margin-bottom: 12px;
  color: var(--text);
}

.lc-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lc-opt {
  text-align: left;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--line);
  background: #fff;
  font: inherit;
  font-size: 0.92rem;
  cursor: pointer;
  color: var(--text);
  transition: border-color 0.12s, background 0.12s;
}

.lc-opt:hover:not(:disabled) {
  border-color: rgba(255, 143, 107, 0.45);
  background: var(--peach);
}

.lc-opt:disabled {
  cursor: default;
}

.lc-opt.lc-correct {
  border-color: rgba(5, 150, 105, 0.55);
  background: rgba(5, 150, 105, 0.12);
}

.lc-opt.lc-wrong {
  border-color: rgba(220, 38, 38, 0.45);
  background: rgba(254, 226, 226, 0.5);
}

.lc-tip {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 200, 160, 0.25);
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text);
}

.lc-tip.hidden {
  display: none;
}

.lc-tip-ok {
  color: var(--success);
  font-weight: 800;
}

.lc-tip-bad {
  color: var(--danger);
  font-weight: 800;
}

.lc-quiz-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.lc-score-mini {
  font-size: 0.88rem;
  color: var(--muted);
}

.lc-score-mini strong {
  color: var(--coral-dark);
  font-size: 1.1rem;
}

.lc-result {
  text-align: center;
  padding: 8px 0 4px;
}

.lc-result-icon {
  font-size: 2.75rem;
  line-height: 1;
  margin-bottom: 8px;
}

.lc-result-title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--coral-dark);
}

.lc-result-score {
  margin-bottom: 10px;
  font-size: 1rem;
  color: var(--muted);
}

.lc-result-num {
  font-size: 2rem;
  font-weight: 900;
  color: var(--coral);
}

.lc-result-praise {
  margin: 0 0 16px;
  line-height: 1.5;
  color: var(--text);
}

.lc-result-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lc-result-actions .btn {
  width: 100%;
}

/* 多宠物 · 两列 */
.pet-grid-section {
  margin-top: 14px;
}

.pet-grid-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--coral-dark);
}

.pet-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.pet-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 8px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--line);
  background: #fff;
  cursor: pointer;
  font: inherit;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.pet-tile:hover {
  border-color: rgba(255, 143, 107, 0.45);
}

.pet-tile.selected {
  border-color: var(--coral);
  box-shadow: 0 0 0 3px rgba(255, 143, 107, 0.2);
}

.pet-tile-img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.pet-tile-fallback {
  font-size: 2.2rem;
  line-height: 64px;
  height: 64px;
}

.pet-tile-name {
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.2;
  max-width: 100%;
}

.pet-tile-lv {
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 700;
}

/* 孩子模式任务只读 */
.kid-task-static {
  cursor: default;
  opacity: 0.95;
  pointer-events: none;
}

.kid-section-sub {
  margin: -4px 0 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.45;
  padding: 0 2px;
}

.kid-section-title--quiz {
  margin-top: 18px;
}

.kid-task-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.92);
  border: 2px solid rgba(255, 200, 170, 0.45);
  box-shadow: 0 2px 10px rgba(255, 150, 120, 0.08);
}

.kid-task-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.kid-task-label {
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--text);
}

.kid-task-row .tag {
  align-self: flex-start;
}

.kid-task-done-btn {
  flex-shrink: 0;
  white-space: nowrap;
}

.kid-quiz-recent {
  margin-bottom: 6px;
}

.kid-quiz-empty {
  margin: 0 !important;
}

.kid-quiz-ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kid-quiz-li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(236, 248, 255, 0.75);
  border: 1px solid rgba(120, 180, 220, 0.28);
  font-size: 0.86rem;
}

.kid-quiz-subj {
  font-weight: 800;
  color: #2c6a8e;
}

.kid-quiz-score {
  font-weight: 800;
  color: var(--coral-dark);
  font-variant-numeric: tabular-nums;
}

.kid-quiz-time {
  margin-left: auto;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--muted);
}

/* 家长首页：任务确认 / 答题记录入口 */
.parent-home-review-actions {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.parent-home-review-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  width: 100%;
  padding: 12px 14px;
  font-weight: 800;
  font-size: 0.9rem;
}

.parent-home-review-btn i {
  font-size: 1.15rem;
  opacity: 0.9;
}

.home-review-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #fff;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
}

.home-review-badge--soft {
  background: rgba(44, 106, 142, 0.15);
  color: #2c6a8e;
  box-shadow: none;
}

.parent-home-review-hint {
  margin: 4px 0 0 !important;
  font-size: 0.78rem !important;
  line-height: 1.5 !important;
}

.modal-card--scroll {
  max-width: 420px;
}

.modal-task-review-body {
  font-size: 0.88rem;
  padding-bottom: 8px;
}

.task-review-section {
  margin-bottom: 18px;
}

.task-review-section:last-child {
  margin-bottom: 0;
}

.task-review-h4 {
  margin: 0 0 10px;
  font-size: 0.88rem;
  font-weight: 800;
  color: #2c6a8e;
}

.task-review-empty {
  margin: 0 !important;
}

.task-review-ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.task-review-li {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid rgba(120, 180, 220, 0.3);
}

.task-review-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px dashed rgba(120, 170, 210, 0.35);
}

.task-review-toolbar-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: #3a7aa5;
}

.task-review-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.task-review-chip {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  border: 2px solid rgba(120, 170, 210, 0.4);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.task-review-chip:hover {
  border-color: rgba(44, 106, 142, 0.55);
}

.task-review-chip.active {
  border-color: rgba(245, 158, 11, 0.75);
  background: linear-gradient(145deg, #fff7ed 0%, #fff 100%);
  color: #c2410c;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.2);
}

.task-review-li--pending {
  border-color: rgba(245, 158, 11, 0.45);
  background: linear-gradient(145deg, #fffbf5 0%, #fff 100%);
  flex-direction: column;
  align-items: stretch;
}

.task-review-li-main {
  flex: 1;
  min-width: 0;
}

.task-review-li-main strong {
  display: block;
  font-size: 0.92rem;
  margin-bottom: 4px;
}

.task-review-li-sub {
  font-size: 0.76rem;
  color: var(--muted);
  font-weight: 600;
}

.task-review-li-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  width: 100%;
  padding-top: 4px;
  border-top: 1px dashed rgba(255, 200, 170, 0.5);
  margin-top: 4px;
}

.task-review-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  width: 100%;
}

.task-review-pts {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--coral-dark);
  align-self: flex-end;
}

.task-review-day-block {
  margin-bottom: 16px;
}

.task-review-day-block:last-child {
  margin-bottom: 0;
}

.task-review-day-title {
  font-size: 0.82rem;
  font-weight: 900;
  color: #2c6a8e;
  margin: 0 0 8px;
  padding: 6px 0;
  border-bottom: 2px solid rgba(120, 180, 220, 0.25);
}

.task-review-ul--hist {
  gap: 8px;
}

.task-review-li--hist-row {
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
}

.task-review-li-hist-label {
  font-weight: 800;
  color: var(--text);
  flex: 1;
  min-width: 0;
}

.task-review-tag--ok {
  color: var(--success, #16a34a) !important;
  font-weight: 700;
}

.task-review-tag--bad {
  color: var(--warn, #d97706) !important;
  font-weight: 700;
}

.task-review-li--rejected {
  border-style: dashed;
  opacity: 0.95;
}

.kid-task-wait-btn {
  opacity: 0.95;
  cursor: not-allowed;
  font-weight: 800;
}

.kid-task-done-today-btn {
  cursor: default;
  font-weight: 900;
  box-shadow: 0 2px 10px rgba(34, 197, 94, 0.25);
}

.task-review-li--done {
  align-items: center;
}

.task-review-ul--done .task-review-li--done {
  border-style: dashed;
  opacity: 0.95;
}

.task-review-done-meta {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}

.modal-quiz-review-lead {
  margin-top: 0 !important;
}

.modal-quiz-review-stats {
  margin-bottom: 8px;
}

.modal-quiz-review-stats .learning-stats-grid {
  margin-bottom: 8px;
}

#modal-quiz-review-list {
  margin-top: 8px;
  padding-top: 4px;
  border-top: 1px dashed var(--line);
}

/* 学习与答题概况（家长首页） */
.learning-overview-card {
  margin-top: 18px;
  padding: 14px 14px 16px;
  border-radius: var(--radius-sm);
  border: 2px solid rgba(120, 180, 220, 0.35);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.95) 0%, rgba(236, 248, 255, 0.75) 100%);
  box-shadow: 0 4px 14px rgba(80, 140, 190, 0.08);
}

.learning-overview-title {
  margin: 0 0 10px;
  font-size: 0.95rem;
  font-weight: 800;
  color: #2c6a8e;
  display: flex;
  align-items: center;
  gap: 6px;
}

.learning-overview-body {
  font-size: 0.88rem;
}

.learning-overview-empty {
  margin: 0;
  line-height: 1.55;
  color: var(--muted);
  font-size: 0.84rem;
}

.learning-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.learning-stat-tile {
  padding: 12px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(120, 170, 210, 0.25);
  text-align: center;
}

.learning-stat-tile.accent {
  background: linear-gradient(145deg, #e8f4fc 0%, #fff 100%);
  border-color: rgba(90, 159, 212, 0.35);
}

.learning-stat-tile.muted .learning-stat-num {
  color: var(--muted);
  font-size: 1.35rem;
}

.learning-stat-num {
  display: block;
  font-size: 1.65rem;
  font-weight: 800;
  color: #2c6a8e;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.learning-stat-label {
  display: block;
  margin-top: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
}

.learning-stat-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  padding: 10px 0;
  border-top: 1px dashed rgba(120, 170, 210, 0.35);
  font-size: 0.84rem;
}

.learning-stat-k {
  flex-shrink: 0;
  font-weight: 800;
  color: #3a7aa5;
  font-size: 0.78rem;
}

.learning-stat-v {
  color: var(--text);
  font-weight: 600;
  line-height: 1.45;
}

.learning-stat-time {
  display: inline-block;
  margin-left: 4px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--muted);
}

.learning-subjects {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px dashed rgba(120, 170, 210, 0.35);
}

.learning-subjects-label {
  display: block;
  font-size: 0.76rem;
  font-weight: 800;
  color: #3a7aa5;
  margin-bottom: 8px;
}

.learning-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.learning-chip {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(120, 170, 210, 0.35);
  color: var(--text);
}

/* 答题记录与家长加减分 */
.quiz-parent-card {
  margin-top: 18px;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 2px dashed rgba(255, 200, 160, 0.6);
  background: rgba(255, 255, 255, 0.65);
}

.quiz-card-title {
  margin: 0 0 8px;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--coral-dark);
  display: flex;
  align-items: center;
  gap: 6px;
}

.quiz-record-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.quiz-record-row:last-child {
  border-bottom: none;
}

.quiz-rec-meta {
  font-size: 0.88rem;
  line-height: 1.45;
}

.quiz-rec-meta strong {
  color: var(--text);
}

.quiz-rec-time {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 4px;
}

.quiz-rec-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* 家长密码表单 */
.pin-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.pin-form input {
  flex: 1;
  min-width: 120px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--line);
}

.pin-status {
  margin: 8px 0 0;
  font-size: 0.82rem;
}

.pin-modal-forgot {
  margin: -2px 0 12px;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}

.pin-modal-logout-btn {
  margin-top: 10px;
}

.settings-child-lead {
  margin-bottom: 14px;
}

.pet-manage-ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pet-manage-li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.9rem;
}

.pet-manage-li--single {
  flex-wrap: wrap;
  align-items: flex-start;
}

.pet-manage-note {
  flex-basis: 100%;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.4;
}

.topbar-hint {
  margin: 0 0 10px;
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.4;
}

#modal-points .select-child {
  width: 100%;
}

.points-quick-hint {
  margin: 0 0 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.45;
}

.points-quick-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.points-quick-grid .points-quick-btn {
  flex: 1 1 calc(33.33% - 8px);
  min-width: 72px;
  justify-content: center;
  font-weight: 800;
}

.points-quick-grid .points-quick-btn.points-quick-btn--rule {
  flex: 1 1 calc(50% - 8px);
  min-width: 0;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  padding: 10px 8px;
  min-height: auto;
}

.points-quick-btn--rule .points-quick-amt {
  font-size: 1.02rem;
  font-weight: 800;
}

.points-quick-btn--rule .points-quick-lbl {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.25;
  max-width: 100%;
  overflow: hidden;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* 学习挑战入口：仅「学习挑战」四字（家长首页与孩子一致） */
.core-tile--child-textonly {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 14px;
  min-height: 96px;
  grid-column: auto;
}

.core-tile--child-textonly .core-tile-title-only {
  font-family: var(--font-display);
  font-size: 1.22rem;
  font-weight: 400;
  color: #1a5a7a;
  text-align: center;
}

.core-tile--poetry {
  justify-content: center;
  text-align: center;
  background: linear-gradient(145deg, #faf6ff 0%, #ede8ff 50%, #e0f5f0 100%);
  border: 2px solid rgba(140, 120, 200, 0.35);
}

.core-tile--poetry::before {
  background: radial-gradient(circle at 100% 0%, rgba(160, 140, 255, 0.35), transparent 55%);
}

.core-tile--poetry .core-tile-icon {
  align-self: center;
  background: linear-gradient(145deg, #8b7fd8, #6bc4c9);
  color: #fff;
  box-shadow: 0 4px 12px rgba(100, 120, 200, 0.35);
}

.core-tile--poetry .core-tile-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-width: 0;
}

.core-tile--poetry .core-tile-title {
  width: 100%;
  text-align: center;
  color: #3d3566;
}

.core-tile--poetry .core-tile-arrow {
  align-self: center;
}

/* 知识背诵弹层 */
.poetry-recite-modal .poetry-recite-card {
  max-height: min(92vh, 640px);
  display: flex;
  flex-direction: column;
  max-width: 420px;
  overflow: hidden;
}

.poetry-recite-modal .poetry-recite-card .modal-head {
  flex-shrink: 0;
}

.poetry-recite-timer-wrap {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  padding: 10px 12px 14px;
  margin: 0 -4px 8px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 248, 235, 0.95), rgba(232, 244, 255, 0.9));
  border: 1px dashed rgba(120, 160, 200, 0.45);
}

.poetry-recite-timer-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--muted);
}

.poetry-recite-timer {
  font-size: 1.85rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #2a6a9e;
  letter-spacing: 0.04em;
}

.poetry-recite-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 2px 12px;
}

.poetry-recite-h {
  margin: 0 0 6px;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--coral-dark);
  text-align: center;
}

.poetry-recite-author {
  margin: 0 0 14px;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

.poetry-recite-lines .poetry-line {
  margin: 0 0 10px;
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text);
  text-align: center;
}

.poetry-recite-hint {
  margin: 0 0 12px;
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.45;
  text-align: center;
}

.poetry-recite-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 4px;
}

.poetry-recite-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.poetry-recite-actions .btn {
  width: 100%;
  justify-content: center;
}

@media (min-width: 520px) {
  .modal {
    align-items: center;
  }

  .modal-card {
    border-radius: var(--radius);
    border-bottom: 3px solid rgba(255, 200, 170, 0.4);
  }

  .lc-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* 宠物升级庆祝层 */
.level-up-overlay {
  position: fixed;
  inset: 0;
  z-index: 280;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(ellipse at 50% 30%, rgba(255, 240, 200, 0.97) 0%, rgba(255, 180, 140, 0.55) 45%, rgba(40, 30, 50, 0.65) 100%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.level-up-overlay.level-up-overlay--visible {
  opacity: 1;
  pointer-events: auto;
}

.level-up-overlay--simple {
  background: radial-gradient(ellipse at 50% 35%, rgba(255, 252, 245, 0.99) 0%, rgba(255, 220, 195, 0.55) 55%, rgba(90, 70, 85, 0.45) 100%);
}

.level-up-rays {
  position: absolute;
  inset: -20%;
  background: repeating-conic-gradient(
    from 0deg,
    rgba(255, 255, 255, 0.06) 0deg 8deg,
    transparent 8deg 16deg
  );
  animation: levelUpRays 10s linear infinite;
  pointer-events: none;
}

@keyframes levelUpRays {
  to {
    transform: rotate(360deg);
  }
}

.level-up-confetti-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.level-up-confetti {
  position: absolute;
  top: -12px;
  left: var(--x);
  width: 10px;
  height: 14px;
  border-radius: 2px;
  background: hsl(var(--hue, 320), 85%, 62%);
  opacity: 0.95;
  transform: rotate(var(--r)) scale(var(--s));
  animation: levelUpConfettiFall var(--d, 2.5s) linear forwards;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.5);
}

@keyframes levelUpConfettiFall {
  0% {
    transform: translateY(0) rotate(var(--r)) scale(var(--s));
    opacity: 1;
  }
  100% {
    transform: translateY(110vh) rotate(calc(var(--r) + 180deg)) scale(var(--s));
    opacity: 0.35;
  }
}

.level-up-card {
  position: relative;
  z-index: 2;
  max-width: 380px;
  width: 100%;
  padding: 26px 22px 22px;
  background: linear-gradient(165deg, #fffef8 0%, #fff5e8 48%, #ffe8dc 100%);
  border-radius: 24px;
  border: 3px solid rgba(255, 200, 120, 0.85);
  box-shadow:
    0 4px 0 rgba(255, 160, 100, 0.35),
    0 24px 48px rgba(180, 80, 60, 0.28);
  text-align: center;
  animation: levelUpCardIn 0.55s cubic-bezier(0.34, 1.35, 0.64, 1) both;
}

@keyframes levelUpCardIn {
  0% {
    opacity: 0;
    transform: scale(0.88) translateY(24px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.level-up-badge {
  display: inline-block;
  padding: 6px 14px;
  margin-bottom: 10px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #fff;
  background: linear-gradient(90deg, #ff8a5c, #ff5e9a, #a855f7);
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(255, 100, 140, 0.45);
  animation: levelUpBadgePulse 1.6s ease-in-out infinite;
}

@keyframes levelUpBadgePulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.04);
  }
}

.level-up-title {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 1.65rem;
  color: var(--text);
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.9);
}

.level-up-sub {
  margin: 0 0 14px;
  font-size: 0.95rem;
  color: var(--muted);
  font-weight: 700;
}

.level-up-lv-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 12px;
  margin-bottom: 16px;
}

.level-up-lv-old {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: rgba(0, 0, 0, 0.2);
}

.level-up-arrow {
  font-size: 1.4rem;
  color: #ff6b4a;
  font-weight: 800;
}

.level-up-lv-new {
  font-size: 1.85rem;
  font-weight: 800;
  color: #e84830;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.9);
}

.level-up-jumps {
  width: 100%;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 800;
  color: #a855f7;
}

.level-up-preview {
  margin: 0 auto 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.65);
  border-radius: 18px;
  border: 2px dashed rgba(255, 180, 120, 0.55);
}

.level-up-preview-img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  display: block;
  margin: 0 auto 8px;
  filter: drop-shadow(0 6px 12px rgba(255, 140, 100, 0.35));
  animation: levelUpImgPop 0.7s cubic-bezier(0.34, 1.4, 0.64, 1) both;
}

.level-up-preview-fallback {
  width: 120px;
  height: 120px;
  margin: 0 auto 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.2rem;
  animation: levelUpImgPop 0.7s cubic-bezier(0.34, 1.4, 0.64, 1) both;
}

@keyframes levelUpImgPop {
  0% {
    transform: scale(0.6) rotate(-8deg);
    opacity: 0;
  }
  60% {
    transform: scale(1.08) rotate(3deg);
  }
  100% {
    transform: scale(1) rotate(0);
    opacity: 1;
  }
}

.level-up-preview-cap {
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 700;
}

.level-up-effects {
  margin: 0 0 12px;
  padding: 0 0 0 1.1rem;
  text-align: left;
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--text);
}

.level-up-effects li {
  margin-bottom: 8px;
  list-style: none;
  position: relative;
  padding-left: 1.35rem;
}

.level-up-effects li i {
  position: absolute;
  left: 0;
  top: 0.15em;
  color: #ff8a5c;
  font-size: 1rem;
}

.level-up-next {
  margin: 0 0 16px;
  font-size: 0.86rem;
  color: var(--muted);
  font-weight: 600;
}

.level-up-next--max {
  color: #c4a000;
  font-weight: 700;
}

.level-up-dismiss {
  width: 100%;
  justify-content: center;
  padding: 14px;
  font-size: 1rem;
}

.pet-hero.pet-level-up-burst .pet-frame {
  animation: petLevelBurst 1s cubic-bezier(0.34, 1.4, 0.64, 1);
  box-shadow: 0 0 0 0 rgba(255, 220, 120, 0.9);
}

@keyframes petLevelBurst {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 220, 120, 0.85);
    transform: scale(1);
  }
  35% {
    box-shadow: 0 0 0 16px rgba(255, 200, 100, 0.25);
    transform: scale(1.06);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 220, 120, 0);
    transform: scale(1);
  }
}

.pet-hero.pet-level-up-burst .pet-deco span {
  animation: petDecoSpin 0.8s ease;
}

@keyframes petDecoSpin {
  0% {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(15deg) scale(1.2);
  }
  100% {
    transform: rotate(0deg) scale(1);
  }
}

/* Remix Icon：防止被按钮/标题的 font 简写或继承覆盖导致图标变空白 */
[class^='ri-'],
[class*=' ri-'] {
  font-family: 'remixicon' !important;
  font-style: normal !important;
  font-weight: normal !important;
}
