/* ==========================================================================
   爪爪星球 · ClawVerse — 全局主题与壳层样式
   仅 Lead 维护；页面级样式放 css/game.css / css/showcase.css
   ========================================================================== */

:root {
  --bg: #0e0b16;
  --bg-2: #171126;
  --bg-3: #1d1530;
  --panel: #211936;
  --panel-2: #2b2144;
  --ink: #f7f1e8;
  --ink-dim: #ded5e8;
  --muted: #a99cc4;
  --line: rgba(255, 255, 255, 0.09);
  --line-soft: rgba(255, 255, 255, 0.055);
  --coral: #ff5d8f;
  --coral-deep: #e03b6f;
  --coral-soft: rgba(255, 93, 143, 0.16);
  --mint: #5cf2c5;
  --mint-soft: rgba(92, 242, 197, 0.14);
  --violet: #8b6cff;
  --violet-soft: rgba(139, 108, 255, 0.16);
  --gold: #ffd166;
  --gold-soft: rgba(255, 209, 102, 0.15);
  --danger: #ff6b6b;
  --rarity-n: #b9c6d8;
  --rarity-r: #7fb2ff;
  --rarity-sr: #ffd166;
  --radius-s: 10px;
  --radius-m: 16px;
  --radius-l: 24px;
  --radius-xl: 32px;
  --shadow-1: 0 8px 24px rgba(0, 0, 0, 0.28);
  --shadow-2: 0 20px 60px rgba(0, 0, 0, 0.45);
  --font: "PingFang SC", "Noto Sans SC", "Hiragino Sans GB", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-round: "PingFang SC", "Hiragino Sans GB", "Segoe UI", sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --tabbar-h: 66px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overscroll-behavior: none;
}

html {
  -webkit-text-size-adjust: 100%;
  background: #0a0810;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1000px 700px at 10% -5%, rgba(139, 108, 255, 0.22), transparent 60%),
    radial-gradient(900px 650px at 95% 5%, rgba(255, 93, 143, 0.16), transparent 55%),
    radial-gradient(700px 500px at 50% 105%, rgba(92, 242, 197, 0.1), transparent 60%),
    linear-gradient(160deg, #0e0b16 0%, #100c1c 55%, #0a0810 100%);
  line-height: 1.5;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--mint);
  text-decoration: none;
}

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

img, svg, canvas {
  display: block;
  max-width: 100%;
}

::selection {
  background: rgba(255, 93, 143, 0.4);
}

/* ---------- App frame ---------- */
#app.app {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(14, 11, 22, 0.2), rgba(14, 11, 22, 0.65));
}

.view {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.view.is-switching {
  animation: view-in 0.32s var(--ease);
}

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

.view-scroll {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: calc(var(--safe-t) + 20px) 18px calc(28px + var(--safe-b));
  scrollbar-width: thin;
}

@media (min-width: 720px) {
  body {
    display: grid;
    place-items: center;
    padding: 24px;
  }

  #app.app {
    width: 438px;
    height: min(900px, calc(100dvh - 40px));
    border-radius: 38px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
      0 0 0 10px rgba(255, 255, 255, 0.025),
      0 40px 120px rgba(0, 0, 0, 0.6),
      inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  }

  #app.app::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    box-shadow: inset 0 0 80px rgba(12, 8, 22, 0.55);
    z-index: 60;
  }
}

/* ---------- Boot ---------- */
.boot {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background:
    radial-gradient(600px 500px at 50% 30%, rgba(139, 108, 255, 0.2), transparent 60%),
    #0e0b16;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

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

.boot-mark {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  background: linear-gradient(145deg, #ff7ba6, #e03b6f 55%, #8b6cff);
  box-shadow: 0 18px 50px rgba(255, 93, 143, 0.35), inset 0 2px 0 rgba(255, 255, 255, 0.35);
  animation: boot-float 2.4s var(--ease) infinite;
}

.boot-claw {
  font-size: 34px;
  color: #fff;
  transform: rotate(-8deg);
}

@keyframes boot-float {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-8px) rotate(2deg); }
}

.boot-name {
  margin-top: 10px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.boot-sub {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.5em;
  padding-left: 0.5em;
}

.boot-bar {
  width: 92px;
  height: 3px;
  margin-top: 18px;
  border-radius: 3px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.boot-bar i {
  display: block;
  width: 46%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--coral), var(--gold));
  animation: boot-slide 1.1s ease-in-out infinite;
}

@keyframes boot-slide {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(240%); }
}

/* ---------- Typography & utils ---------- */
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.page-kicker {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.page-title {
  margin-top: 6px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.page-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12.5px;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 12px 0 6px;
  margin: -6px 0 12px -6px;
  color: var(--ink-dim);
  font-size: 14px;
  border-radius: 999px;
}

.back-btn:active {
  background: rgba(255, 255, 255, 0.06);
}

.muted { color: var(--muted); }
.ink-dim { color: var(--ink-dim); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.bold { font-weight: 700; }
.grow { flex: 1 1 auto; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.col { display: flex; flex-direction: column; gap: 10px; }
.wrap { flex-wrap: wrap; }
.center { text-align: center; }
.hidden { display: none !important; }
.spacer-8 { height: 8px; }
.spacer-16 { height: 16px; }
.spacer-24 { height: 24px; }

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.16s var(--ease), filter 0.2s ease, background 0.2s ease;
  user-select: none;
  touch-action: manipulation;
}

.btn:active { transform: scale(0.97); }

.btn--primary {
  color: #2a0d1a;
  border: 0;
  background: linear-gradient(135deg, #ff8db0 0%, #ff5d8f 45%, #f53d74 100%);
  box-shadow: 0 12px 28px rgba(255, 61, 116, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.btn--mint {
  color: #06231c;
  border: 0;
  background: linear-gradient(135deg, #9dffdf, #5cf2c5 60%, #33d6a6);
  box-shadow: 0 12px 28px rgba(92, 242, 197, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.btn--gold {
  color: #3a2403;
  border: 0;
  background: linear-gradient(135deg, #ffe7a8, #ffd166 55%, #f7b733);
  box-shadow: 0 12px 28px rgba(255, 209, 102, 0.24);
}

.btn--ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.btn--soft {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.btn--danger {
  color: #fff;
  background: linear-gradient(135deg, #ff8a8a, #ff5d5d);
  box-shadow: 0 10px 24px rgba(255, 93, 93, 0.24);
}

.btn--sm {
  min-height: 38px;
  padding: 0 14px;
  font-size: 13px;
}

.btn--block { width: 100%; }
.btn--icon {
  width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 50%;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.42;
  filter: saturate(0.4);
  pointer-events: none;
}

/* ---------- Cards / panels ---------- */
.card {
  position: relative;
  border-radius: var(--radius-m);
  background: linear-gradient(155deg, rgba(43, 33, 68, 0.88), rgba(30, 23, 49, 0.9));
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
}

.card--pad { padding: 16px; }

.card__title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.card__hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.glass {
  background: rgba(21, 16, 36, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.divider {
  height: 1px;
  background: var(--line-soft);
  margin: 14px 0;
}

/* ---------- Chips / badges ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--ink-dim);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.chip--mint { color: var(--mint); background: var(--mint-soft); border-color: rgba(92, 242, 197, 0.2); }
.chip--coral { color: #ffb3c8; background: var(--coral-soft); border-color: rgba(255, 93, 143, 0.22); }
.chip--gold { color: var(--gold); background: var(--gold-soft); border-color: rgba(255, 209, 102, 0.22); }
.chip--violet { color: #cabcff; background: var(--violet-soft); border-color: rgba(139, 108, 255, 0.24); }

.rarity-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 21px;
  padding: 0 8px;
  border-radius: 7px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #12101a;
  background: var(--rarity-n);
}

.rarity-badge[data-rarity="R"] { background: var(--rarity-r); }
.rarity-badge[data-rarity="SR"] {
  background: linear-gradient(120deg, #ffe7a8, #ffd166 45%, #ffb347);
  box-shadow: 0 0 14px rgba(255, 209, 102, 0.35);
}

.coin-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px 0 9px;
  border-radius: 999px;
  background: rgba(255, 209, 102, 0.1);
  border: 1px solid rgba(255, 209, 102, 0.24);
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.coin-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff3c4, #ffd166 55%, #d99b1f);
  box-shadow: inset 0 -2px 2px rgba(140, 90, 0, 0.35), 0 0 8px rgba(255, 209, 102, 0.35);
}

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }

.field > label,
.field-label {
  color: var(--ink-dim);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.input {
  width: 100%;
  height: 50px;
  padding: 0 15px;
  color: var(--ink);
  font-size: 15px;
  border-radius: 13px;
  background: rgba(10, 7, 18, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.input::placeholder { color: rgba(169, 156, 196, 0.55); }

.input:focus {
  border-color: rgba(255, 93, 143, 0.65);
  box-shadow: 0 0 0 3px rgba(255, 93, 143, 0.14);
}

.input[aria-invalid="true"] {
  border-color: rgba(255, 107, 107, 0.7);
}

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 44px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  cursor: pointer;
  user-select: none;
}

.checkbox input {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(10, 7, 18, 0.5);
  transition: all 0.16s ease;
}

.checkbox input:checked {
  background: linear-gradient(135deg, var(--coral), var(--coral-deep));
  border-color: transparent;
  box-shadow: 0 0 0 3px rgba(255, 93, 143, 0.16);
}

.checkbox input:checked::after {
  content: "✓";
  display: grid;
  place-items: center;
  height: 100%;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.checkbox a { color: var(--coral); text-decoration: underline; text-underline-offset: 2px; }

.form-error {
  min-height: 18px;
  color: #ff9d9d;
  font-size: 12px;
  line-height: 1.45;
}

/* ---------- Tabbar ---------- */
.tabbar {
  position: relative;
  flex: none;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding: 6px 10px var(--safe-b);
  background: rgba(16, 12, 27, 0.92);
  border-top: 1px solid rgba(255, 255, 255, 0.075);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 52px;
  border-radius: 14px;
  color: rgba(222, 213, 232, 0.5);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  transition: color 0.2s ease;
}

.tab svg { width: 22px; height: 22px; }

.tab.is-active { color: var(--ink); }

.tab.is-active::before {
  content: "";
  position: absolute;
  top: 3px;
  width: 46px;
  height: 34px;
  border-radius: 12px;
  background: linear-gradient(150deg, rgba(255, 93, 143, 0.24), rgba(139, 108, 255, 0.16));
  border: 1px solid rgba(255, 93, 143, 0.22);
  z-index: -1;
}

.tab.is-active svg { filter: drop-shadow(0 0 8px rgba(255, 93, 143, 0.45)); }

.tab:active { transform: scale(0.94); }

/* ---------- Modal ---------- */
.modal-root {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(8, 5, 14, 0.66);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: auto;
  opacity: 0;
  transition: opacity 0.24s ease;
}

.modal-backdrop.is-open { opacity: 1; }

.modal {
  position: relative;
  width: min(400px, 100%);
  max-height: min(84vh, 720px);
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-l);
  background: linear-gradient(160deg, #2a2042 0%, #1c152e 60%, #181124 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow-2), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: translateY(16px) scale(0.97);
  opacity: 0;
  transition: transform 0.3s var(--ease), opacity 0.24s ease;
  overflow: hidden;
}

.modal-backdrop.is-open .modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.modal--sheet { border-radius: 26px 26px 0 0; }

.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 10px;
}

.modal__title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.modal__close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  font-size: 18px;
  line-height: 1;
}

.modal__body {
  padding: 4px 20px 18px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  font-size: 13.5px;
  color: var(--ink-dim);
  line-height: 1.7;
}

.modal__body p + p { margin-top: 10px; }

.modal__foot {
  display: flex;
  gap: 10px;
  padding: 0 20px calc(18px + env(safe-area-inset-bottom, 0px));
}

.modal__foot .btn { flex: 1 1 0; }

body.modal-open { overflow: hidden; }

/* ---------- Toast ---------- */
.toast-root {
  position: fixed;
  top: calc(var(--safe-t) + 14px);
  left: 0;
  right: 0;
  z-index: 150;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  max-width: min(360px, calc(100vw - 40px));
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(36, 27, 56, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow-1);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  animation: toast-in 0.3s var(--ease);
  backdrop-filter: blur(12px);
}

.toast.is-out { animation: toast-out 0.26s ease forwards; }
.toast--success { border-color: rgba(92, 242, 197, 0.3); color: var(--mint); }
.toast--error { border-color: rgba(255, 107, 107, 0.34); color: #ffb3b3; }

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

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

/* ---------- States ---------- */
.skeleton {
  border-radius: 12px;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.04) 30%, rgba(255, 255, 255, 0.09) 50%, rgba(255, 255, 255, 0.04) 70%);
  background-size: 220% 100%;
  animation: shimmer 1.4s linear infinite;
}

@keyframes shimmer {
  from { background-position: 120% 0; }
  to { background-position: -120% 0; }
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 42px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.empty__art {
  width: 92px;
  height: 92px;
  border-radius: 28px;
  display: grid;
  place-items: center;
  font-size: 40px;
  background: radial-gradient(circle at 30% 20%, rgba(255, 93, 143, 0.2), rgba(139, 108, 255, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.error-box {
  padding: 14px 16px;
  border-radius: var(--radius-m);
  background: rgba(255, 107, 107, 0.08);
  border: 1px solid rgba(255, 107, 107, 0.22);
  color: #ffb3b3;
  font-size: 13px;
}

/* ---------- Login / welcome ---------- */
.auth {
  position: relative;
  min-height: 100%;
  padding: calc(var(--safe-t) + 30px) 24px calc(26px + var(--safe-b));
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background:
    radial-gradient(440px 340px at 82% 6%, rgba(255, 93, 143, 0.16), transparent 70%),
    radial-gradient(380px 320px at 4% 40%, rgba(139, 108, 255, 0.18), transparent 70%),
    radial-gradient(320px 300px at 50% 100%, rgba(92, 242, 197, 0.09), transparent 70%);
}

.auth__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #ff7ba6, #e03b6f 60%, #8b6cff);
  box-shadow: 0 10px 26px rgba(224, 59, 111, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  overflow: hidden;
}

.brand-mark img { width: 100%; height: 100%; object-fit: cover; }

.brand-name {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.brand-en {
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.42em;
}

.auth__hero {
  margin: 26px 0 22px;
}

.auth__title {
  font-size: clamp(28px, 8vw, 34px);
  line-height: 1.18;
  font-weight: 900;
  letter-spacing: 0.01em;
}

.auth__title em {
  font-style: normal;
  background: linear-gradient(100deg, #ffd166, #ff8db0 55%, #c8b6ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.auth__sub {
  margin-top: 10px;
  max-width: 300px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.cabinet {
  position: relative;
  width: 132px;
  height: 148px;
  margin: 4px auto 26px;
  perspective: 800px;
}

.cabinet__cab {
  position: absolute;
  inset: 6px 8px 0;
  border-radius: 16px 16px 10px 10px;
  background: linear-gradient(160deg, #ff92b4, #e4597f 45%, #b83a63);
  box-shadow: 0 20px 44px rgba(224, 59, 111, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transform: rotateX(4deg) rotateY(-4deg);
}

.cabinet__glass {
  position: absolute;
  inset: 20px 18px 30px;
  border-radius: 10px;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.28), transparent 34%),
    linear-gradient(180deg, #2b2144, #171126);
  border: 2px solid rgba(255, 255, 255, 0.42);
  overflow: hidden;
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.45);
}

.cabinet__glass::before {
  content: "";
  position: absolute;
  left: -20%;
  top: -40%;
  width: 60%;
  height: 160%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  transform: rotate(18deg);
}

.plush {
  position: absolute;
  border-radius: 50%;
  background: var(--plush, #ffd166);
  box-shadow: inset -4px -5px 0 rgba(0, 0, 0, 0.14), 0 4px 8px rgba(0, 0, 0, 0.25);
}

.plush::before,
.plush::after {
  content: "";
  position: absolute;
  width: 30%;
  height: 30%;
  top: -13%;
  border-radius: 50%;
  background: inherit;
  box-shadow: inset -2px -2px 0 rgba(0, 0, 0, 0.12);
}

.plush::before { left: 8%; }
.plush::after { right: 8%; }

.cabinet__clawline {
  position: absolute;
  top: 6px;
  left: 50%;
  width: 2px;
  height: 40px;
  background: linear-gradient(#e6e1ef, #8f86a6);
}

.cabinet__claw {
  position: absolute;
  top: 42px;
  left: 50%;
  width: 26px;
  height: 22px;
  transform: translateX(-50%);
}

.cabinet__claw::before,
.cabinet__claw::after {
  content: "";
  position: absolute;
  width: 4px;
  height: 18px;
  top: 0;
  border-radius: 3px;
  background: linear-gradient(#f4f0fa, #9a90b0);
}

.cabinet__claw::before { left: 3px; transform: rotate(20deg); }
.cabinet__claw::after { right: 3px; transform: rotate(-20deg); }

.cabinet__btn {
  position: absolute;
  bottom: 8px;
  left: 50%;
  width: 24px;
  height: 10px;
  transform: translateX(-50%);
  border-radius: 5px;
  background: linear-gradient(#ffe7a8, #ffb347);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}

.auth__panel {
  margin-top: auto;
}

.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(10, 7, 18, 0.5);
  border: 1px solid var(--line);
}

.seg__btn {
  height: 40px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  transition: all 0.2s ease;
}

.seg__btn.is-active {
  color: var(--ink);
  background: linear-gradient(150deg, rgba(255, 93, 143, 0.22), rgba(139, 108, 255, 0.16));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

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

.gift-note {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 13px;
  border-radius: 13px;
  background: rgba(255, 209, 102, 0.08);
  border: 1px dashed rgba(255, 209, 102, 0.28);
  color: #ffe3a3;
  font-size: 12px;
  line-height: 1.5;
}

.gift-note b { color: var(--gold); }

.auth__alt {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 11.5px;
}

.auth__alt::before,
.auth__alt::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line-soft);
}

.auth__foot {
  margin-top: 16px;
  color: rgba(169, 156, 196, 0.55);
  font-size: 10.5px;
  text-align: center;
  line-height: 1.6;
}

/* ---------- Me page ---------- */
.me-hero {
  position: relative;
  padding: 20px;
  border-radius: var(--radius-l);
  overflow: hidden;
  background:
    radial-gradient(200px 140px at 90% 0%, rgba(255, 209, 102, 0.16), transparent 65%),
    radial-gradient(220px 160px at 0% 100%, rgba(139, 108, 255, 0.2), transparent 65%),
    linear-gradient(150deg, #2c2149, #1c142d);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
}

.me-avatar {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 800;
  color: #2a0d1a;
  background: linear-gradient(145deg, #ffd166, #ff8db0 65%, #c8b6ff);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 8px 20px rgba(0, 0, 0, 0.3);
}

.me-name {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.me-meta {
  color: var(--muted);
  font-size: 11.5px;
  margin-top: 3px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 16px;
}

.stat {
  padding: 12px 6px;
  border-radius: 13px;
  background: rgba(10, 7, 18, 0.32);
  border: 1px solid var(--line-soft);
  text-align: center;
}

.stat b {
  display: block;
  font-size: 18px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.stat span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.menu-list {
  margin-top: 16px;
  border-radius: var(--radius-m);
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 54px;
  padding: 0 16px;
  color: var(--ink-dim);
  font-size: 13.5px;
  text-align: left;
}

.menu-item + .menu-item {
  border-top: 1px solid var(--line-soft);
}

.menu-item:active { background: rgba(255, 255, 255, 0.05); }

.menu-item__icon {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.06);
  font-size: 14px;
}

.menu-item__arrow {
  margin-left: auto;
  color: rgba(169, 156, 196, 0.5);
  font-size: 16px;
}

.danger-zone {
  margin-top: 22px;
  padding: 16px;
  border-radius: var(--radius-m);
  border: 1px solid rgba(255, 107, 107, 0.18);
  background: rgba(255, 107, 107, 0.04);
}

.prob-card {
  margin-top: 16px;
  padding: 15px 16px;
  border-radius: var(--radius-m);
  background: rgba(255, 209, 102, 0.05);
  border: 1px solid rgba(255, 209, 102, 0.16);
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.7;
}

.prob-card b { color: var(--gold); }

/* ---------- Agreement / doc ---------- */
.doc {
  padding: 4px 2px 20px;
  color: var(--ink-dim);
  font-size: 13px;
  line-height: 1.8;
}

.doc h2 {
  margin: 22px 0 8px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.doc h3 {
  margin: 16px 0 6px;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 700;
}

.doc p + p { margin-top: 8px; }
.doc ul { margin: 6px 0 0; padding-left: 18px; }
.doc li { margin: 4px 0; }
.doc li::marker { color: var(--coral); }

.doc-meta {
  margin: 10px 0 18px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 11px;
}

.doc-callout {
  margin: 14px 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 93, 143, 0.06);
  border-left: 3px solid var(--coral);
  color: var(--ink-dim);
  font-size: 12.5px;
}

/* ---------- Scrollbars ---------- */
.view-scroll::-webkit-scrollbar,
.modal__body::-webkit-scrollbar {
  width: 4px;
}

.view-scroll::-webkit-scrollbar-thumb,
.modal__body::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
}

/* ---------- Responsive / a11y ---------- */
@media (max-height: 700px) {
  .cabinet { width: 112px; height: 122px; margin-bottom: 16px; }
  .auth__hero { margin: 16px 0 14px; }
  .auth__title { font-size: 26px; }
  .auth__sub { font-size: 12px; }
  .auth { padding-top: calc(var(--safe-t) + 18px); }
}

@media (orientation: landscape) and (max-height: 560px) {
  .boot-name { font-size: 18px; }
  #app.app { height: 100dvh; border-radius: 0; width: 100%; }
  body { padding: 0; }
}

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

/* ---------- Doll thumb (shared) ---------- */
.doll-thumb {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 28%, rgba(255, 255, 255, 0.1), transparent 58%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.055), rgba(10, 7, 18, 0.32));
}

.doll-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.32));
}

.doll-thumb__fallback {
  display: grid;
  place-items: center;
  width: 74%;
  height: 74%;
  border-radius: 50%;
  font-size: clamp(20px, 9vw, 38px);
  box-shadow: inset -4px -6px 0 rgba(0, 0, 0, 0.12), 0 10px 18px rgba(0, 0, 0, 0.24);
}

.tabbar[hidden] { display: none; }
#app.is-bare .tabbar { display: none; }

/* 注册模式：收起展示柜，保证主按钮在首屏可见 */
.auth--register .cabinet { display: none; }
.auth--register .auth__hero { margin: 16px 0 14px; }
.auth--register .auth__title { font-size: clamp(24px, 7vw, 29px); }
.auth--register .auth__sub { display: none; }
