:root {
  --bg-top: #bfefff;
  --bg-mid: #c9dafc;
  --bg-bottom: #d9c3ff;
  --status-bar-space: max(env(safe-area-inset-top), 24px);
  --ink: #1f1830;
  --muted: #7a718a;
  --primary: #8d63ff;
  --primary-deep: #6f47e8;
  --card: rgba(255, 255, 255, 0.9);
  --line: rgba(132, 102, 190, 0.16);
  --shadow: 0 18px 46px rgba(97, 74, 151, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg-bottom);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 82% 34%, rgba(236, 220, 255, 0.78), transparent 32%),
    radial-gradient(circle at 16% 24%, rgba(255, 255, 255, 0.5), transparent 26%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 48%, var(--bg-bottom) 100%);
}

button {
  border: 0;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

.page-shell {
  width: min(100%, 480px);
  min-height: 100vh;
  margin: 0 auto;
  padding: calc(var(--status-bar-space) + 18px) 18px calc(env(safe-area-inset-bottom) + 22px);
}

.hero {
  position: relative;
  min-height: 310px;
  padding: 4px 2px 0;
}

.brand-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 6px 12px 6px 8px;
  /* border: 1px solid rgba(255, 255, 255, 0.72); */
  /* border-radius: 999px;
  background: rgba(255, 255, 255, 0.5); */
  /* backdrop-filter: blur(16px); */
}

.brand-logo {
  width: 120px;
  height: 34px;
  object-fit: contain;
}

.brand-name {
  font-size: 16px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0;
}

.mascot {
  position: absolute;
  top: 72px;
  right: -12px;
  width: min(44vw, 190px);
  max-width: 190px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 18px 30px rgba(92, 70, 142, 0.2));
  pointer-events: none;
}

.copy-block {
  position: relative;
  z-index: 1;
  width: 60%;
  padding-top: 98px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--primary-deep);
  font-size: 14px;
  line-height: 20px;
  font-weight: 800;
}

h1 {
  margin: 0;
  font-size: clamp(32px, 9vw, 42px);
  line-height: 1.08;
  font-weight: 900;
  letter-spacing: 0;
}

.subtitle {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 24px;
}

.invite-card {
  position: relative;
  z-index: 2;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 28px;
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.primary-button {
  width: 100%;
  min-height: 54px;
  border-radius: 18px;
  color: #ffffff;
  background: linear-gradient(135deg, #a57cff 0%, #7a56ff 100%);
  box-shadow: 0 12px 24px rgba(115, 80, 232, 0.28);
  font-size: 16px;
  line-height: 22px;
  font-weight: 800;
}

.primary-button:active,
.copy-button:active {
  transform: scale(0.98);
}

.primary-button:disabled {
  opacity: 0.68;
}

.invite-panel {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(248, 246, 255, 0.9);
}

.panel-label {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 18px;
  font-weight: 700;
}

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

.invite-code {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  color: #181126;
  font-size: clamp(26px, 9vw, 38px);
  line-height: 1.12;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.copy-button {
  flex: 0 0 auto;
  min-width: 76px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 14px;
  color: var(--primary-deep);
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(122, 86, 255, 0.18);
  font-size: 15px;
  font-weight: 800;
}

.panel-hint {
  margin: 8px 0 0;
  color: #8e879e;
  font-size: 13px;
  line-height: 19px;
}

.claimed-panel {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.66);
}

.claimed-title {
  margin: 0;
  color: #2f2741;
  font-size: 16px;
  line-height: 22px;
  font-weight: 900;
}

.claimed-desc {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
}

.download-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  padding: 16px;
  border-radius: 22px;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(109, 86, 156, 0.1);
}

.download-title {
  margin: 0;
  font-size: 18px;
  line-height: 24px;
  font-weight: 900;
}

.download-desc {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
}

.qr-code {
  width: 104px;
  height: 104px;
  border-radius: 16px;
  object-fit: contain;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(31, 24, 48, 0.08);
}

.toast {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 10;
  max-width: calc(100vw - 40px);
  min-height: 42px;
  padding: 11px 18px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  color: #35244f;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94) 0%, rgba(239, 233, 255, 0.9) 100%),
    radial-gradient(circle at 100% 0%, rgba(165, 124, 255, 0.2), transparent 42%);
  box-shadow: 0 14px 32px rgba(93, 70, 145, 0.18);
  backdrop-filter: blur(16px);
  font-size: 14px;
  line-height: 20px;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, calc(-50% + 14px)) scale(0.98);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

@media (max-width: 360px) {
  .page-shell {
    padding-left: 14px;
    padding-right: 14px;
  }

  .copy-block {
    width: 72%;
  }

  .download-card {
    gap: 12px;
    padding: 14px;
  }

  .qr-code {
    width: 92px;
    height: 92px;
  }
}

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

  .page-shell {
    min-height: auto;
    padding-top: 32px;
    padding-bottom: 32px;
  }
}
