:root {
  --pink: #ff7eb3;
  --pink-light: #ffc1d6;
  --cream: #fff5f7;
  --accent: #ff8fab;
  --text: #5a3d4d;
  --card: #ffffff;
  --shadow: 0 8px 24px rgba(255, 126, 179, 0.22);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--text);
  background-color: #fff0f5;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='70' height='70' viewBox='0 0 70 70'%3E%3Cg fill='%23ffc9d9'%3E%3Cellipse cx='35' cy='44' rx='12' ry='10'/%3E%3Ccircle cx='20' cy='26' r='6'/%3E%3Ccircle cx='35' cy='21' r='6'/%3E%3Ccircle cx='50' cy='26' r='6'/%3E%3Ccircle cx='27' cy='35' r='5.5'/%3E%3Ccircle cx='43' cy='35' r='5.5'/%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(135deg, #ffe4ee 0%, #fff0f5 45%, #ffe9e3 100%);
  background-size: 70px 70px, cover;
  background-repeat: repeat, no-repeat;
  background-attachment: scroll, fixed;
  min-height: 100vh;
  overflow-x: hidden;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  padding-top: calc(14px + env(safe-area-inset-top));
  padding-left: calc(20px + env(safe-area-inset-left));
  padding-right: calc(20px + env(safe-area-inset-right));
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { font-size: 20px; font-weight: 800; letter-spacing: 1px; }
.wallet { display: flex; align-items: center; gap: 10px; }
.badge {
  padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: #e8e8f0; color: #777;
}
.badge.vip { background: linear-gradient(90deg, #ffd86f, #ff9d6f); color: #7a3b00; }
.balance { font-size: 14px; font-weight: 700; }
.vip-badge {
  display: inline-block; margin-left: 3px; padding: 1px 7px; border-radius: 999px;
  font-size: 11px; font-weight: 800; color: #7a3b00; vertical-align: middle;
  background: linear-gradient(90deg, #ffd86f, #ff9d6f);
}

.btn {
  border: none; cursor: pointer; border-radius: 999px; font-weight: 700;
  background: linear-gradient(90deg, var(--pink), var(--accent)); color: #fff;
  padding: 10px 22px; font-size: 15px; transition: transform .12s, box-shadow .12s;
  display: inline-block; text-decoration: none; text-align: center;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(255, 126, 179, .4); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-ghost { background: #fff; color: var(--pink); border: 1.5px solid var(--pink-light); }

.screen {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 120px;
}

.card {
  background: var(--card);
  border-radius: 24px;
  padding: 26px;
  box-shadow: var(--shadow);
  animation: pop .35s ease;
}
@keyframes pop { from { transform: translateY(14px) scale(.98); } to { transform: none; } }

h2.title { font-size: 22px; margin-bottom: 6px; }
p.sub { color: #b08a99; font-size: 14px; margin-bottom: 18px; }

.step-hint { display: inline-block; font-size: 12px; color: var(--pink); font-weight: 700; margin-bottom: 8px; }

/* 卡片头部：左=步骤，右=风格切换 */
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.card-head .step-hint { margin-bottom: 0; }
.style-switch { display: flex; gap: 6px; }
.style-btn {
  border: none; cursor: pointer; border-radius: 999px; font-weight: 700;
  padding: 5px 12px; font-size: 12px; color: #fff; opacity: .45;
  transition: transform .12s, opacity .12s;
}
.style-btn.active { opacity: 1; transform: scale(1.06); box-shadow: 0 4px 10px rgba(0,0,0,.18); }
.style-detail { background: #ff7eb3; }
.style-bright { background: #f5a623; }
.style-25d { background: #6f7bff; }

.grid { display: grid; gap: 12px; }
.grid.cols-2 { grid-template-columns: 1fr 1fr; }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }

.opt {
  border: 2px solid #ffe1eb; border-radius: 18px; padding: 14px 8px;
  text-align: center; cursor: pointer; background: #fff; transition: all .15s;
}
.opt:hover { border-color: var(--pink-light); transform: translateY(-2px); }
.opt.selected { border-color: var(--pink); background: #fff0f6; box-shadow: 0 6px 16px rgba(255,126,179,.25); }
.opt .emoji { font-size: 30px; display: block; margin-bottom: 6px; }
.opt .name { font-size: 14px; font-weight: 700; }
.opt .desc { font-size: 11px; color: #b08a99; margin-top: 4px; line-height: 1.4; }

.gender-opt .emoji { font-size: 52px; }
.gender-opt .name { font-size: 18px; }

.row { display: flex; gap: 10px; margin-top: 20px; }
.row.center { justify-content: center; }
.row .btn { flex: 1; }

.wait-box { text-align: center; padding: 30px 10px; }
.spinner {
  width: 64px; height: 64px; margin: 0 auto 18px;
  border: 6px solid var(--pink-light); border-top-color: var(--pink);
  border-radius: 50%; animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.eta { font-size: 15px; color: #b08a99; margin-top: 8px; }

.result-img { width: 100%; border-radius: 18px; display: block; box-shadow: var(--shadow); }
video.result-video { width: 100%; border-radius: 18px; box-shadow: var(--shadow); }

.mascot { position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 30; display: flex; align-items: flex-end; gap: 10px; }
.mascot-avatar {
  width: 64px; height: 64px; border-radius: 50%; background: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 36px;
  box-shadow: 0 6px 18px rgba(255,126,179,.35); cursor: pointer; border: 3px solid var(--pink-light);
}
.mascot-bubble {
  max-width: 220px; background: #fff; border-radius: 16px 16px 16px 4px;
  padding: 10px 14px; font-size: 14px; box-shadow: var(--shadow);
  position: relative; animation: pop .3s ease;
}

.furry-banner {
  background: #fff0e6;
  color: #8b4a2b;
  border: 2px solid #ffc9a3;
  border-radius: 14px;
  padding: 10px 16px;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.toast {
  position: fixed; top: 70px; left: 50%; transform: translateX(-50%);
  background: rgba(90, 61, 77, .92); color: #fff; padding: 10px 18px;
  border-radius: 999px; font-size: 14px; opacity: 0; pointer-events: none;
  transition: opacity .25s; z-index: 50;
}
.toast.show { opacity: 1; }

.gallery-item { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 16px; background: #fff; box-shadow: var(--shadow); margin-bottom: 12px; }
.gallery-item img, .gallery-item video { width: 96px; height: 96px; object-fit: cover; border-radius: 12px; }

.recharge-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.recharge-tier {
  border: 2px solid #ffe1eb; border-radius: 18px; padding: 16px 10px;
  text-align: center; background: #fff; transition: all .15s;
}
.recharge-tier .tier-price { font-size: 20px; font-weight: 800; color: var(--pink); }
.recharge-tier .tier-points { font-size: 14px; font-weight: 700; margin: 6px 0 4px; }
.recharge-tier .tier-bonus { font-size: 12px; color: #ff9d6f; }
.recharge-tier .tier-desc { font-size: 12px; color: #b08a99; margin-bottom: 12px; }

@media (max-width: 520px) {
  .grid.cols-4 { grid-template-columns: 1fr 1fr; }
  .grid.cols-3 { grid-template-columns: 1fr; }
  .grid.cols-2 { grid-template-columns: 1fr; }
  .card { padding: 20px 16px; border-radius: 20px; }
  h2.title { font-size: 19px; }
  .recharge-grid { grid-template-columns: 1fr; }
  .wallet { gap: 6px; }
  .balance { display: none; }
  .mascot-avatar { width: 54px; height: 54px; font-size: 30px; }
  .mascot-bubble { max-width: 170px; }
}
