@import url("https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&family=Nunito:wght@400;500;600;700;800&display=swap");

:root {
  color-scheme: light;
  /* Claymorphism 暖橙 + 信任蓝配色 */
  --bg: #fff7ed;
  --bg-soft: #ffeed8;
  --panel: #ffffff;
  --panel-border: #fce3c8;
  --text: #3b2a1d;
  --muted: #9a7b62;
  --accent: #f97316;
  --accent-strong: #ea580c;
  --accent-soft: #ffe7d1;
  --blue: #2563eb;
  --blue-soft: #e3edff;
  --mint: #84b59f;
  --gold: #f0b949;
  --danger: #dc2626;
  --shadow: 0 18px 40px rgba(234, 88, 12, 0.12);
  /* 黏土风双层阴影 */
  --clay: 0 14px 28px rgba(234, 88, 12, 0.12), 0 4px 10px rgba(154, 52, 18, 0.08);
  --clay-soft: 0 8px 18px rgba(234, 88, 12, 0.1);
  --clay-inset: inset 0 2px 3px rgba(255, 255, 255, 0.9), inset 0 -4px 8px rgba(234, 88, 12, 0.08);
  --radius: 26px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Nunito", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 8%, rgba(253, 186, 116, 0.45), transparent 32%),
    radial-gradient(circle at 88% 0%, rgba(147, 197, 253, 0.38), transparent 30%),
    linear-gradient(180deg, #fff8ee 0%, #ffeed9 100%);
  min-height: 100dvh;
}

button,
select {
  font: inherit;
}

h1,
h2,
h3 {
  font-family: "Fredoka", "Nunito", "PingFang SC", sans-serif;
}

.app-shell {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 48px;
}

/* 顶部栏 */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  margin-bottom: 18px;
  border-radius: 24px;
  background: var(--panel);
  border: 2px solid var(--panel-border);
  box-shadow: var(--clay-soft);
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(150deg, #fb923c, #ea580c);
  box-shadow: var(--clay-soft), var(--clay-inset);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.brand-mark:hover {
  transform: translateY(-2px) rotate(-4deg);
}

.brand-mark:active {
  transform: scale(0.94);
}

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

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

.wallet-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px 8px 11px;
  border-radius: 999px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  box-shadow: var(--clay-inset);
}

.wallet-pill svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wallet-coin {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.wallet-gem {
  background: var(--blue-soft);
  color: var(--blue);
}

.icon-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 2px solid var(--panel-border);
  border-radius: 16px;
  background: var(--panel);
  color: var(--accent-strong);
  cursor: pointer;
  box-shadow: var(--clay-soft);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.icon-btn svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 主舞台 */
.stage-layout {
  display: grid;
  gap: 18px;
}

.stage-title h2 {
  margin: 0;
  font-size: 1.25rem;
}

.stage-sub {
  margin: 4px 0 0;
  font-size: 0.86rem;
  color: var(--muted);
}

/* 左侧功能抽屉 */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 40;
  visibility: hidden;
}

.drawer.open {
  visibility: visible;
}

.drawer-mask {
  position: absolute;
  inset: 0;
  background: rgba(60, 33, 12, 0.5);
  backdrop-filter: blur(5px);
  opacity: 0;
  transition: opacity 240ms ease;
}

.drawer.open .drawer-mask {
  opacity: 1;
}

.drawer-panel {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: min(320px, 84vw);
  padding: 20px;
  background: var(--panel);
  border-right: 2px solid var(--panel-border);
  box-shadow: 24px 0 48px rgba(60, 33, 12, 0.18);
  transform: translateX(-104%);
  transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
  overflow-y: auto;
}

.drawer.open .drawer-panel {
  transform: translateX(0);
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.drawer-head h2 {
  margin: 0;
  font-size: 1.2rem;
}

.drawer-list {
  display: grid;
  gap: 12px;
}

.drawer-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  border: 2px solid var(--panel-border);
  border-radius: 20px;
  padding: 14px;
  background: var(--bg-soft);
  color: var(--text);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.drawer-item:hover {
  transform: translateX(4px);
  box-shadow: var(--clay-soft);
  background: #fff;
}

.drawer-item:active {
  transform: scale(0.98);
}

.drawer-text strong {
  display: block;
  font-size: 1.02rem;
}

.drawer-text small {
  display: block;
  margin-top: 2px;
  font-size: 0.78rem;
  color: var(--muted);
}

.drawer-badge {
  position: absolute;
  top: 12px;
  right: 14px;
}

/* 互动图标工具栏（位于舞台下方） */
.arena-actions {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.arena-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 12px 4px;
  border: 2px solid var(--panel-border);
  border-radius: 18px;
  background: var(--bg-soft);
  color: var(--accent-strong);
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.arena-action-btn:hover {
  background: #fff;
  border-color: var(--accent);
  box-shadow: var(--clay-soft);
}

.arena-action-btn:active {
  background: var(--accent-soft);
}

.arena-action-btn svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.arena-action-btn span {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text);
}

.utility-icon {
  width: 46px;
  height: 46px;
  display: inline-grid;
  place-items: center;
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  box-shadow: var(--clay-inset);
}

.utility-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.utility-badge {
  position: absolute;
  top: 8px;
  right: 10px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  box-shadow: 0 4px 10px rgba(220, 38, 38, 0.4);
}

/* 修复：hidden 属性需覆盖上面的 display，否则红点无法隐藏 */
.utility-badge[hidden] {
  display: none;
}

.sub-head {
  margin-bottom: 12px;
}

.sub-head h3 {
  margin: 0;
  font-size: 1rem;
}

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

.module-grid.single {
  grid-template-columns: minmax(0, 1fr);
}

.page-grid {
  margin-top: 18px;
}

.profile-shell {
  display: grid;
  gap: 18px;
}

.profile-hero {
  background:
    radial-gradient(circle at right top, rgba(255, 214, 170, 0.28), transparent 24%),
    linear-gradient(135deg, rgba(255, 251, 245, 0.98), rgba(246, 238, 227, 0.96));
}

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

.profile-stat-card,
.profile-highlight-row {
  border-radius: 20px;
  border: 1px solid rgba(86, 58, 28, 0.08);
  background: rgba(255, 255, 255, 0.78);
  padding: 14px;
}

.profile-stat-card span,
.profile-highlight-row span {
  display: block;
  font-size: 0.84rem;
  color: var(--muted);
}

.profile-stat-card strong,
.profile-highlight-row strong {
  display: block;
  margin-top: 6px;
  font-size: 1.12rem;
}

.profile-highlights {
  display: grid;
  gap: 10px;
}

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

.feature-card {
  padding: 16px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(247, 239, 226, 0.92));
  border: 1px solid rgba(86, 58, 28, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.feature-card strong {
  display: block;
  font-size: 1rem;
}

.feature-card p {
  margin: 10px 0 14px;
  color: var(--muted);
  line-height: 1.55;
}

.feature-link {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(217, 108, 71, 0.12);
  color: var(--accent-strong);
  font-weight: 700;
  cursor: pointer;
}

.modal-shell {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 30;
}

.modal-shell.open {
  display: block;
}

.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(60, 33, 12, 0.55);
  backdrop-filter: blur(6px);
}

.modal-card {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(760px, calc(100% - 28px));
  max-height: min(82vh, 900px);
  overflow: auto;
  padding: 24px;
  border-radius: 30px;
  background: var(--panel);
  border: 2px solid var(--panel-border);
  box-shadow: 0 32px 60px rgba(60, 33, 12, 0.28);
  animation: modalIn 240ms ease;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translate(-50%, -46%) scale(0.96);
  }
}

.modal-card-wide {
  width: min(980px, calc(100% - 28px));
}

.modal-close {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: transform 160ms ease;
}

.modal-actions {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* 通用提示弹框 */
.alert-card {
  width: min(360px, calc(100% - 40px));
  padding: 28px 24px 22px;
  text-align: center;
}

.alert-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  box-shadow: var(--clay-inset);
}

.alert-icon svg {
  width: 32px;
  height: 32px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.alert-card h3 {
  margin: 0 0 8px;
  font-size: 1.16rem;
}

.alert-card p {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.96rem;
}

.alert-ok {
  width: 100%;
}

.primary-btn,
.secondary-btn,
.action-row button,
.claim-btn,
.buy-btn,
.equip-btn {
  border: 0;
  border-radius: 16px;
  padding: 12px 18px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.primary-btn,
.buy-btn,
.claim-btn {
  background: linear-gradient(150deg, #fb923c, #ea580c);
  color: #fff;
  box-shadow: var(--clay-soft), var(--clay-inset);
}

.secondary-btn,
.equip-btn,
.action-row button {
  background: var(--bg-soft);
  color: var(--accent-strong);
  border: 2px solid var(--panel-border);
}

.primary-btn:hover,
.secondary-btn:hover,
.buy-btn:hover,
.claim-btn:hover,
.equip-btn:hover,
.action-row button:hover,
.modal-close:hover {
  transform: translateY(-2px);
}

.primary-btn:active,
.secondary-btn:active,
.action-row button:active {
  transform: translateY(0) scale(0.97);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.panel {
  background: var(--panel);
  border: 2px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--clay);
  padding: 22px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-head h2,
.offline-box h3 {
  margin: 0;
  font-size: 1.1rem;
}

select {
  border: 2px solid var(--panel-border);
  border-radius: 14px;
  padding: 10px 14px;
  background: var(--bg-soft);
  color: var(--accent-strong);
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease;
}

select:hover {
  transform: translateY(-1px);
}

.pet-arena {
  position: relative;
  height: 430px;
  border-radius: 24px;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 26%, rgba(255, 234, 161, 0.22), transparent 22%),
    radial-gradient(circle at 78% 16%, rgba(255, 255, 255, 0.22), transparent 20%),
    linear-gradient(180deg, rgba(126, 204, 243, 0.92) 0%, rgba(197, 238, 255, 0.72) 58%, rgba(223, 244, 210, 0.76) 58%, rgba(196, 231, 165, 0.94) 100%);
  border: 1px solid rgba(86, 58, 28, 0.08);
}

.pet-arena::before,
.pet-arena::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  opacity: 0.5;
}

.pet-arena::before {
  width: 220px;
  height: 220px;
  background: rgba(255, 255, 255, 0.25);
  top: -40px;
  right: -20px;
}

.pet-arena::after {
  width: 160px;
  height: 160px;
  background: rgba(255, 204, 138, 0.18);
  bottom: 20px;
  left: -10px;
}

.arena-backdrop-window {
  position: absolute;
  inset: 22px 110px 86px 110px;
  border-radius: 28px;
  border: 10px solid rgba(255, 249, 239, 0.78);
  background:
    linear-gradient(180deg, rgba(153, 218, 248, 0.58), rgba(220, 248, 255, 0.2)),
    rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(150, 191, 215, 0.18);
}

.arena-backdrop-window::before,
.arena-backdrop-window::after {
  content: "";
  position: absolute;
  background: rgba(255, 251, 245, 0.72);
}

.arena-backdrop-window::before {
  width: 8px;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
}

.arena-backdrop-window::after {
  height: 8px;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

.arena-curtain {
  position: absolute;
  top: 26px;
  width: 54px;
  height: 214px;
  border-radius: 26px;
  background:
    linear-gradient(90deg, rgba(223, 144, 104, 0.95), rgba(244, 190, 132, 0.95), rgba(225, 141, 109, 0.95));
  box-shadow: 0 18px 28px rgba(118, 71, 42, 0.12);
}

.arena-curtain::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: 106px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 242, 216, 0.86);
}

.curtain-left {
  left: 34px;
}

.curtain-right {
  right: 34px;
}

.arena-floor-prop {
  position: absolute;
  bottom: 34px;
}

.arena-bed {
  left: 32px;
  width: 106px;
  height: 40px;
  border-radius: 26px;
  background: linear-gradient(180deg, #f0b8c3, #de8ea0);
  box-shadow: 0 14px 24px rgba(97, 66, 66, 0.14);
}

.arena-bed::before {
  content: "";
  position: absolute;
  inset: 8px 12px 8px 12px;
  border-radius: 20px;
  background: rgba(255, 248, 248, 0.86);
}

.arena-lamp {
  right: 42px;
  width: 16px;
  height: 92px;
  border-radius: 999px;
  background: linear-gradient(180deg, #d7c4a0, #9f815c);
}

.arena-lamp::before {
  content: "";
  position: absolute;
  width: 46px;
  height: 34px;
  left: 50%;
  top: -18px;
  transform: translateX(-50%);
  border-radius: 50% 50% 26% 26%;
  background: linear-gradient(180deg, #fff6dd, #efcf95);
}

.arena-lamp::after {
  content: "";
  position: absolute;
  width: 42px;
  height: 10px;
  left: 50%;
  bottom: -4px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(131, 102, 70, 0.28);
  filter: blur(2px);
}

.pet-sprite {
  --pet-color: #f6f0dc;
  --pet-accent: #f1cf84;
  --pet-inner-ear: #f7d5be;
  --pet-mark: rgba(255, 255, 255, 0.32);
  position: absolute;
  width: 220px;
  height: 220px;
  left: 50%;
  top: 53%;
  transform: translate(-50%, -50%);
  transition: left 240ms ease, top 240ms ease, transform 240ms ease, filter 240ms ease;
  animation: floaty 3.6s ease-in-out infinite;
  z-index: 2;
}

.pet-shadow {
  position: absolute;
  width: 130px;
  height: 30px;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: radial-gradient(circle, rgba(73, 93, 38, 0.28), rgba(73, 93, 38, 0.02));
  filter: blur(8px);
}

.pet-tail {
  position: absolute;
  width: 74px;
  height: 26px;
  right: 14px;
  bottom: 78px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--pet-accent), var(--pet-color));
  transform-origin: 8px 50%;
  transform: rotate(12deg);
  animation: wag 1.8s ease-in-out infinite;
}

.pet-body {
  position: absolute;
  width: 130px;
  height: 108px;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  border-radius: 46% 46% 40% 40%;
  background:
    radial-gradient(circle at 50% 24%, rgba(255, 255, 255, 0.44), transparent 26%),
    linear-gradient(180deg, var(--pet-color), color-mix(in srgb, var(--pet-color) 78%, #d5b07b));
  box-shadow: 0 22px 30px rgba(83, 62, 37, 0.14);
}

.pet-body-mark {
  position: absolute;
  width: 68px;
  height: 56px;
  left: 50%;
  top: 20px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: var(--pet-mark);
}

.pet-paw {
  position: absolute;
  bottom: -8px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--pet-color) 82%, #d4b07e);
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.05);
}

.paw-left {
  left: 18px;
}

.paw-right {
  right: 18px;
}

.pet-head {
  position: absolute;
  width: 146px;
  height: 132px;
  left: 50%;
  top: 32px;
  transform: translateX(-50%);
}

.pet-head::before,
.pet-head::after {
  content: "";
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pet-ear {
  position: absolute;
  top: -6px;
  width: 44px;
  height: 58px;
  border-radius: 80% 20% 70% 30%;
  background: linear-gradient(180deg, var(--pet-color), color-mix(in srgb, var(--pet-color) 70%, #d7b487));
}

.pet-ear span {
  position: absolute;
  inset: 10px 10px 14px 10px;
  border-radius: inherit;
  background: linear-gradient(180deg, var(--pet-inner-ear), rgba(255, 255, 255, 0.35));
}

.ear-left {
  left: 10px;
  transform: rotate(-18deg);
}

.ear-right {
  right: 10px;
  transform: rotate(18deg) scaleX(-1);
}

.pet-face {
  position: absolute;
  inset: 18px 0 0;
  margin: 0 auto;
  width: 136px;
  height: 110px;
  border-radius: 43% 43% 38% 38%;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.5), transparent 28%),
    linear-gradient(180deg, var(--pet-color), color-mix(in srgb, var(--pet-color) 78%, #dcc090));
  box-shadow: 0 18px 28px rgba(92, 74, 50, 0.14);
}

.eye {
  position: absolute;
  top: 44px;
  width: 12px;
  height: 16px;
  border-radius: 999px;
  background: #3a2b19;
  animation: blink 5s infinite;
}

.eye-left {
  left: 38px;
}

.eye-right {
  right: 38px;
}

.nose {
  position: absolute;
  left: 50%;
  top: 58px;
  width: 12px;
  height: 9px;
  transform: translateX(-50%);
  border-radius: 50% 50% 60% 60%;
  background: #8a5d46;
}

.mouth {
  position: absolute;
  left: 50%;
  top: 71px;
  width: 28px;
  height: 14px;
  transform: translateX(-50%);
  border-bottom: 3px solid #6f4630;
  border-radius: 0 0 18px 18px;
}

.blush {
  position: absolute;
  top: 60px;
  width: 16px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 159, 159, 0.32);
}

.blush-left {
  left: 18px;
}

.blush-right {
  right: 18px;
}

.pet-action-prop {
  position: absolute;
  top: 4px;
  right: 20px;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 12px 24px rgba(66, 52, 31, 0.12);
  opacity: 0;
  transform: scale(0.6) translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.prop-icon {
  font-size: 1.4rem;
}

.pet-action-caption {
  position: absolute;
  left: 50%;
  top: 14px;
  transform: translateX(-50%);
  z-index: 5;
  max-width: calc(100% - 32px);
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(6px);
  color: #4f3b2c;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 10px 20px rgba(87, 72, 43, 0.12);
}

.pet-sprite.cat {
  --pet-color: #fbf0d5;
  --pet-accent: #efc977;
}

.pet-sprite.cat .pet-head::before,
.pet-sprite.cat .pet-head::after {
  opacity: 1;
  width: 30px;
  height: 2px;
  background: rgba(81, 61, 48, 0.8);
  top: 74px;
}

.pet-sprite.cat .pet-head::before {
  left: -6px;
  transform: rotate(-10deg);
}

.pet-sprite.cat .pet-head::after {
  right: -6px;
  transform: rotate(10deg);
}

.pet-sprite.temper-cat {
  animation-duration: 4.2s;
}

.pet-sprite.shiba {
  --pet-color: #e7a96e;
  --pet-accent: #fff0d3;
  --pet-inner-ear: #f4c8b1;
  --pet-mark: rgba(255, 244, 220, 0.62);
}

.pet-sprite.temper-shiba {
  animation-duration: 3.2s;
}

.pet-sprite.shiba .pet-face {
  border-radius: 40% 40% 34% 34%;
}

.pet-sprite.shiba .pet-face::before {
  content: "";
  position: absolute;
  inset: 34px 22px 10px 22px;
  border-radius: 48% 48% 38% 38%;
  background: rgba(255, 244, 221, 0.82);
}

.pet-sprite.shiba .pet-body::before {
  content: "";
  position: absolute;
  width: 72px;
  height: 54px;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  border-radius: 46% 46% 38% 38%;
  background: rgba(255, 246, 226, 0.78);
}

.pet-sprite.dino {
  --pet-color: #9bc17a;
  --pet-accent: #d6ef93;
  --pet-inner-ear: #c0e39c;
  --pet-mark: rgba(224, 255, 183, 0.38);
}

.pet-sprite.temper-dino {
  animation-duration: 4.8s;
}

.pet-sprite.dino .pet-ear {
  border-radius: 30% 70% 0 100%;
}

.pet-sprite.dino .pet-tail {
  width: 88px;
  height: 32px;
  border-radius: 80% 20% 60% 20%;
}

.pet-sprite.dino .pet-head::before {
  opacity: 1;
  width: 18px;
  height: 38px;
  left: 50%;
  top: -10px;
  transform: translateX(-50%);
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
  background: linear-gradient(180deg, #d7f3a1, #8eb95e);
}

.pet-sprite.dino .pet-body::before {
  content: "";
  position: absolute;
  width: 14px;
  height: 26px;
  left: 20px;
  top: -10px;
  border-radius: 10px 10px 4px 4px;
  background: #d6ef93;
  box-shadow:
    22px 4px 0 #d6ef93,
    44px 10px 0 #d6ef93,
    66px 18px 0 #d6ef93;
}

.pet-sprite.hungry .mouth {
  width: 18px;
  border-bottom-style: dashed;
}

.pet-sprite.hungry {
  filter: saturate(0.88) brightness(0.95);
}

.pet-sprite.sad {
  transform: translate(-50%, -50%) scale(0.96);
}

.pet-sprite.dirty {
  filter: saturate(0.84) contrast(0.94);
}

.pet-sprite.dirty .pet-body::after,
.pet-sprite.dirty .pet-face::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 10px;
  border-radius: 50%;
  background: rgba(108, 82, 57, 0.22);
}

.pet-sprite.dirty .pet-body::after {
  top: 30px;
  right: 12px;
}

.pet-sprite.dirty .pet-face::after {
  top: 22px;
  left: 12px;
}

.pet-sprite.is-acting .pet-action-prop {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.pet-sprite.action-tap {
  animation: hop 420ms ease;
}

.pet-sprite.temper-shiba.action-tap {
  animation: shibaHop 520ms ease;
}

.pet-sprite.temper-dino.action-tap {
  animation: dinoStomp 560ms ease;
}

.pet-sprite.action-pet .pet-head {
  animation: cuddle 680ms ease;
}

.pet-sprite.temper-shiba.action-pet .pet-tail {
  animation: wagFast 480ms ease 2;
}

.pet-sprite.temper-dino.action-pet .pet-head {
  animation: dinoNod 760ms ease;
}

.pet-sprite.action-feed .pet-action-prop {
  background: rgba(255, 245, 219, 0.94);
}

.pet-sprite.action-feed .mouth {
  animation: chew 640ms ease 2;
}

.pet-sprite.temper-dino.action-feed .pet-head {
  animation: dinoReach 920ms ease;
}

.pet-sprite.action-bath .pet-action-prop {
  background: rgba(217, 243, 255, 0.94);
}

.pet-sprite.action-bath .pet-body,
.pet-sprite.action-bath .pet-face {
  animation: sparkleWash 1s ease;
}

.pet-sprite.action-play {
  animation: spinPlay 900ms ease;
}

.pet-sprite.temper-shiba.action-play {
  animation: shibaDash 960ms ease;
}

.pet-sprite.temper-dino.action-play {
  animation: dinoBounce 1s ease;
}

.pet-sprite.action-sleep .eye {
  height: 4px;
  top: 50px;
}

.pet-sprite.action-sleep .pet-action-prop {
  background: rgba(229, 223, 255, 0.94);
}

.pet-sprite.action-sleep {
  animation: sleepBounce 1.4s ease infinite;
}

.pet-sprite.temper-cat.action-sleep .pet-tail {
  transform: rotate(44deg);
}

.pet-sprite.temper-shiba.action-sleep {
  animation-duration: 1.2s;
}

.pet-sprite.temper-dino.action-sleep .pet-body {
  transform: translateX(-50%) scale(1.02, 0.98);
}

.action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.status-grid,
.summary-cards,
.achievement-list,
.leaderboard,
.sign-board,
.shop-list,
.list-block {
  display: grid;
  gap: 12px;
}

.status-grid {
  margin-top: 18px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.status-card,
.summary-card,
.achievement-card,
.leaderboard-row,
.sign-day,
.shop-card,
.task-card,
.inventory-card {
  border-radius: 18px;
  border: 2px solid var(--panel-border);
  background: var(--bg-soft);
  padding: 14px;
}

.status-card {
  text-align: center;
  background: linear-gradient(180deg, #fff, var(--bg-soft));
  box-shadow: var(--clay-inset);
}

.status-card strong {
  color: var(--accent-strong);
}

.status-card span,
.summary-card span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.status-card strong,
.summary-card strong {
  font-size: 1.15rem;
}

.summary-cards {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.offline-box {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 2px solid var(--blue-soft);
  background: linear-gradient(135deg, var(--blue-soft), var(--accent-soft));
}

.offline-box p {
  margin: 8px 0 0;
  color: var(--text);
  line-height: 1.55;
}

.task-card,
.shop-card,
.inventory-card,
.leaderboard-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.task-title,
.shop-title {
  display: block;
  margin-bottom: 4px;
}

.task-meta,
.shop-meta,
.inventory-meta,
.achievement-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* 签到步骤条 */
.sign-hero {
  margin-bottom: 22px;
  padding: 18px 20px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--accent-soft), var(--blue-soft));
  border: 2px solid var(--panel-border);
}

.sign-hero-info {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.sign-hero-info span {
  font-size: 0.9rem;
  color: var(--muted);
}

.sign-hero-info strong {
  font-family: "Fredoka", sans-serif;
  font-size: 1.6rem;
  color: var(--accent-strong);
}

.sign-hero-track {
  margin: 12px 0 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  overflow: hidden;
}

.sign-hero-bar {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #fb923c, #ea580c);
  transition: width 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.sign-hero-tip {
  margin: 0;
  font-size: 0.84rem;
  color: var(--accent-strong);
  font-weight: 600;
}

.sign-stepper {
  display: flex;
  align-items: flex-start;
  gap: 0;
}

.sign-step {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}

/* 连接线 */
.sign-step::before {
  content: "";
  position: absolute;
  top: 21px;
  right: 50%;
  width: 100%;
  height: 4px;
  background: var(--panel-border);
  z-index: 0;
}

.sign-step:first-child::before {
  display: none;
}

.sign-step.claimed::before {
  background: var(--mint);
}

.sign-node {
  position: relative;
  z-index: 1;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 3px solid var(--panel-border);
  color: var(--muted);
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
  font-size: 0.92rem;
}

.sign-node svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sign-step.claimed .sign-node {
  background: var(--mint);
  border-color: var(--mint);
  color: #fff;
}

.sign-step.active .sign-node {
  background: #fff;
  border-color: var(--accent);
  color: var(--accent-strong);
  box-shadow: 0 0 0 5px rgba(249, 115, 22, 0.18);
  animation: signPulse 1.8s ease-in-out infinite;
}

@keyframes signPulse {
  0%,
  100% {
    box-shadow: 0 0 0 5px rgba(249, 115, 22, 0.18);
  }
  50% {
    box-shadow: 0 0 0 9px rgba(249, 115, 22, 0.08);
  }
}

.sign-day-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text);
}

.sign-step.active .sign-day-label {
  color: var(--accent-strong);
}

.sign-reward {
  font-size: 0.68rem;
  line-height: 1.35;
  color: var(--muted);
}

.sign-step.special .sign-reward {
  color: var(--accent-strong);
  font-weight: 700;
}

.achievement-card.locked {
  opacity: 0.62;
}

.leaderboard-row strong:first-child {
  width: 48px;
  color: var(--accent-strong);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: rgba(47, 36, 24, 0.94);
  color: white;
  padding: 12px 16px;
  border-radius: 14px;
  box-shadow: var(--shadow);
  z-index: 10;
}

@keyframes floaty {
  0%,
  100% {
    transform: translate(-50%, -50%) translateY(0);
  }
  50% {
    transform: translate(-50%, -50%) translateY(-10px);
  }
}

@keyframes wag {
  0%,
  100% {
    transform: rotate(10deg);
  }
  50% {
    transform: rotate(34deg);
  }
}

@keyframes hop {
  0%,
  100% {
    transform: translate(-50%, -50%) translateY(0);
  }
  35% {
    transform: translate(-50%, -58%) scale(1.03);
  }
}

@keyframes cuddle {
  0%,
  100% {
    transform: translateX(-50%) rotate(0deg);
  }
  35% {
    transform: translateX(-50%) rotate(-8deg);
  }
  70% {
    transform: translateX(-50%) rotate(8deg);
  }
}

@keyframes chew {
  0%,
  100% {
    transform: translateX(-50%) scaleY(1);
  }
  50% {
    transform: translateX(-50%) scaleY(0.4);
  }
}

@keyframes sparkleWash {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.14) saturate(1.08);
  }
}

@keyframes spinPlay {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  35% {
    transform: translate(-50%, -62%) rotate(-14deg);
  }
  70% {
    transform: translate(-50%, -44%) rotate(12deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
}

@keyframes sleepBounce {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    transform: translate(-50%, -47%) scale(0.985);
  }
}

@keyframes shibaHop {
  0%,
  100% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  35% {
    transform: translate(-50%, -60%) rotate(-4deg) scale(1.02);
  }
  70% {
    transform: translate(-50%, -48%) rotate(4deg);
  }
}

@keyframes dinoStomp {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
  }
  30% {
    transform: translate(-50%, -56%) scale(1.01, 0.98);
  }
  55% {
    transform: translate(-50%, -46%) scale(0.99, 1.02);
  }
}

@keyframes wagFast {
  0%,
  100% {
    transform: rotate(10deg);
  }
  50% {
    transform: rotate(50deg);
  }
}

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

@keyframes dinoReach {
  0%,
  100% {
    transform: translateX(-50%);
  }
  45% {
    transform: translateX(-50%) translateY(8px) scale(1.02);
  }
}

@keyframes shibaDash {
  0%,
  100% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  25% {
    transform: translate(-46%, -56%) rotate(-10deg);
  }
  60% {
    transform: translate(-54%, -44%) rotate(10deg);
  }
}

@keyframes dinoBounce {
  0%,
  100% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  30% {
    transform: translate(-50%, -58%) rotate(-6deg);
  }
  62% {
    transform: translate(-50%, -46%) rotate(6deg);
  }
}

@keyframes blink {
  0%,
  46%,
  100% {
    transform: scaleY(1);
  }
  48%,
  52% {
    transform: scaleY(0.15);
  }
}

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

  .profile-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 20px, 1080px);
    padding-top: 14px;
  }

  .topbar {
    padding: 10px 14px;
  }

  .brand-text small {
    display: none;
  }

  .feature-dock {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
  }

  .utility-chip {
    padding: 12px 4px;
    border-radius: 18px;
  }

  .utility-icon {
    width: 40px;
    height: 40px;
  }

  .utility-label {
    font-size: 0.78rem;
  }

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

  .summary-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pet-arena {
    height: 360px;
  }

  .sign-stepper {
    overflow-x: auto;
    padding-bottom: 6px;
    margin: 0 -4px;
  }

  .sign-step {
    flex: 0 0 64px;
  }

  .task-card,
  .shop-card,
  .inventory-card,
  .leaderboard-row {
    flex-direction: column;
    align-items: start;
  }

  .modal-card {
    top: auto;
    bottom: 10px;
    transform: translateX(-50%);
    max-height: 78vh;
    border-radius: 24px;
  }

  @keyframes modalIn {
    from {
      opacity: 0;
      transform: translateX(-50%) translateY(20px);
    }
  }
}

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