:root {
  color-scheme: light;
  --canvas: #f5f8fc;
  --surface: #ffffff;
  --surface-soft: #f7f9fd;
  --ink: #1d2a3d;
  --ink-soft: #6e7b8e;
  --ink-faint: #98a4b5;
  --line: #e3eaf4;
  --blue: #5b8def;
  --blue-deep: #4778d7;
  --blue-soft: #edf4ff;
  --blue-pale: #f7faff;
  --green-soft: #e9f7f0;
  --green: #368c68;
  --warning-soft: #fbf6ee;
  --warning: #8a6b47;
  --shadow: 0 28px 80px rgba(48, 76, 122, .10);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 5% 4%, rgba(118, 160, 244, .10), transparent 27rem),
    radial-gradient(circle at 95% 92%, rgba(124, 188, 240, .10), transparent 30rem),
    var(--canvas);
  color: var(--ink);
  font-family: Inter, "SF Pro Display", "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }

.join-page {
  display: flex;
  flex-direction: column;
  width: min(1380px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 36px 22px;
}

.join-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 56px;
  padding: 0 8px;
}

.join-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.join-brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--blue);
  box-shadow: 0 9px 20px rgba(91, 141, 239, .22);
  color: #fff;
  font-size: 17px;
  font-weight: 750;
}

.join-brand-copy { display: grid; gap: 1px; }
.join-brand-copy strong { font-size: 16px; letter-spacing: .09em; }
.join-brand-copy small { color: var(--ink-faint); font-size: 9px; letter-spacing: .1em; }
.join-login-copy { margin: 0; color: var(--ink-soft); font-size: 12px; }
.join-login-copy a { margin-left: 5px; color: var(--blue-deep); font-weight: 650; text-decoration: none; }
.join-login-copy a:hover { text-decoration: underline; text-underline-offset: 4px; }

.join-card {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(420px, .96fr);
  flex: 1;
  min-height: 680px;
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid rgba(220, 229, 241, .86);
  border-radius: 34px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.join-form-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 58px clamp(46px, 6vw, 92px) 52px;
}

.join-copy, .invite-form, .invite-help, .invite-privacy { width: min(100%, 520px); }

.join-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid #dce8fb;
  border-radius: 999px;
  background: #f5f9ff;
  color: #5d7fba;
  font-size: 10px;
  font-weight: 680;
  letter-spacing: .08em;
}

.join-eyebrow i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 4px rgba(91, 141, 239, .11);
}

.join-copy h1 {
  margin: 27px 0 20px;
  color: var(--ink);
  font-size: clamp(44px, 4.7vw, 66px);
  font-weight: 670;
  letter-spacing: -.055em;
  line-height: 1.08;
}

.join-copy h1 span { color: var(--blue); }

.join-intro {
  max-width: 470px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.85;
}

.invite-form { margin-top: 42px; }
.invite-label { display: block; margin-bottom: 9px; color: #46556b; font-size: 12px; font-weight: 650; }

.invite-field {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 58px;
  padding: 0 17px;
  border: 1px solid #dfe7f2;
  border-radius: 15px;
  background: var(--surface-soft);
  transition: border-color .22s ease, background .22s ease, box-shadow .22s ease;
}

.invite-field:focus-within {
  border-color: #9abaf6;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(91, 141, 239, .10);
}

.invite-field.has-error { border-color: #e2c9ab; background: #fffdf9; }
.invite-field.has-success { border-color: #a8d8c2; background: #fbfffd; }

.invite-field-icon { width: 20px; height: 20px; flex: 0 0 auto; color: #8aa1c4; }
.invite-field input {
  width: 100%;
  min-width: 0;
  padding: 17px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  letter-spacing: .01em;
}

.invite-field input::placeholder { color: #a8b2c1; }
.invite-field-status { display: grid; place-items: center; width: 20px; height: 20px; flex: 0 0 auto; }
.invite-field-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c8d2e0;
  transition: width .22s ease, height .22s ease, background .22s ease;
}

.invite-field.has-success .invite-field-status::before {
  width: 18px;
  height: 18px;
  background: var(--green-soft);
  box-shadow: inset 0 0 0 2px #58a982;
}

.invite-field.has-error .invite-field-status::before { width: 10px; height: 10px; background: #d4a875; }

.invite-message {
  min-height: 20px;
  margin: 9px 2px 18px;
  color: var(--ink-faint);
  font-size: 11px;
  line-height: 1.7;
}

.invite-message.is-error { color: var(--warning); }
.invite-message.is-success { color: var(--green); }

.invite-submit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: 58px;
  padding: 0 13px 0 23px;
  border: 0;
  border-radius: 15px;
  background: var(--blue);
  box-shadow: 0 13px 25px rgba(91, 141, 239, .22);
  color: #fff;
  font-size: 13px;
  font-weight: 680;
  letter-spacing: .01em;
  transition: transform .24s ease, background .24s ease, box-shadow .24s ease, opacity .24s ease;
}

.invite-submit:hover { transform: translateY(-2px); background: #5688e8; box-shadow: 0 17px 31px rgba(91, 141, 239, .27); }
.invite-submit:active { transform: translateY(0); }
.invite-submit:focus-visible { outline: 3px solid rgba(91, 141, 239, .25); outline-offset: 3px; }
.invite-submit:disabled { cursor: wait; opacity: .68; transform: none; }

.invite-submit-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .16);
}

.invite-submit-icon svg { width: 19px; height: 19px; transition: transform .24s ease; }
.invite-submit:hover .invite-submit-icon svg { transform: translateX(2px); }
.invite-submit.is-success { background: #4d9d7c; box-shadow: 0 13px 25px rgba(77, 157, 124, .20); }
.invite-submit.is-success:disabled { cursor: default; opacity: 1; }
.invite-submit.is-success .invite-submit-icon { background: rgba(255, 255, 255, .19); }

.invite-help { margin: 20px 0 0; color: var(--ink-soft); font-size: 11px; }
.invite-help a { color: var(--blue-deep); font-weight: 650; text-decoration: none; }
.invite-help a:hover { text-decoration: underline; text-underline-offset: 3px; }

.invite-privacy {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 38px;
  padding-top: 20px;
  border-top: 1px solid #edf1f6;
  color: #98a4b4;
  font-size: 10px;
}

.invite-privacy svg { width: 17px; height: 17px; flex: 0 0 auto; color: #a6b3c3; }

.mascot-stage {
  position: relative;
  min-height: 620px;
  margin: 14px 14px 14px 0;
  overflow: hidden;
  border-radius: 27px;
  background: #eff5ff;
  isolation: isolate;
}

.stage-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(.2px);
}

.stage-orb-a { width: 300px; height: 300px; top: -120px; right: -80px; background: rgba(151, 187, 247, .16); }
.stage-orb-b { width: 230px; height: 230px; bottom: 40px; left: -120px; background: rgba(123, 177, 238, .10); }

.stage-grid {
  position: absolute;
  inset: 0;
  opacity: .42;
  background-image: radial-gradient(rgba(91, 141, 239, .15) .8px, transparent .8px);
  background-size: 27px 27px;
  mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 76%, transparent);
}

.mascot-status {
  position: absolute;
  z-index: 4;
  top: 23px;
  left: 24px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 999px;
  background: rgba(255, 255, 255, .62);
  box-shadow: 0 8px 22px rgba(74, 111, 167, .07);
  color: #7184a0;
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: .06em;
  backdrop-filter: blur(10px);
}

.mascot-status-dot { width: 6px; height: 6px; border-radius: 50%; background: #62b28c; box-shadow: 0 0 0 4px rgba(98, 178, 140, .11); }
.mascot-scene { position: absolute; z-index: 2; inset: 0; }

.mascot-svg {
  position: absolute;
  bottom: -24px;
  left: 50%;
  width: 135%;
  transform: translateX(-50%);
  overflow: visible;
}

.mascot-breathe {
  transform-box: fill-box;
  transform-origin: center bottom;
  animation: mascot-breathe 2.5s ease-in-out infinite;
}

.mascot-tilt {
  transform-box: fill-box;
  transform-origin: 50% 82%;
  transition: transform .32s cubic-bezier(.2, .85, .32, 1.2);
}

.mascot-body { fill: #5B8DEF; }
.mascot-body-tone { fill: #4A80E8; opacity: .74; }
.mascot-eye-white, .mascot-eye-highlight { transform-box: fill-box; transform-origin: center; }
.mascot-eye-white { fill: #fff; transform-origin: center; transition: transform .2s ease-out; }
.mascot-pupil { transform: translate3d(var(--eye-x, 0px), var(--eye-y, 0px), 0); will-change: transform; }
.mascot-eye-highlight { opacity: .78; transition: transform .25s ease-out, opacity .25s ease-out; }
.mascot-happy-eyes { opacity: 0; transform-box: fill-box; transform-origin: center; }
.mascot-mouth-smile { opacity: 1; transform-box: fill-box; transform-origin: center; }
.mascot-mouth-curious, .mascot-mouth-happy { opacity: 0; transform-box: fill-box; transform-origin: center; transition: opacity .2s ease-out, transform .24s cubic-bezier(.2, .9, .3, 1.2); }

.mascot-stage[data-state="hover"] .mascot-tilt { transform: translateY(-2px); }
.mascot-stage[data-state="hover"] .mascot-eye-white { transform: scale(1.045); }
.mascot-stage[data-state="hover"] .mascot-eye-highlight { transform: scale(1.28); opacity: 1; }

.mascot-stage[data-state="clicking"] .mascot-tilt { transform: translateY(-4px); }
.mascot-stage[data-state="clicking"] .mascot-eye-white { transform: scale(1.06); }
.mascot-stage[data-state="clicking"] .mascot-eye-highlight { transform: scale(1.35); opacity: 1; }
.mascot-stage[data-state="clicking"] .mascot-mouth-smile { opacity: 0; }
.mascot-stage[data-state="clicking"] .mascot-mouth-curious { opacity: 1; }

.mascot-stage[data-state="typing"] .mascot-tilt { transform: rotate(var(--head-tilt, -3deg)) translateY(-2px); }
.mascot-stage[data-state="typing"] .mascot-eye-white { transform: scale(1.03); }
.mascot-stage[data-state="typing"] .mascot-mouth-smile { opacity: 0; }
.mascot-stage[data-state="typing"] .mascot-mouth-curious { opacity: 1; transform: scale(.92); }

.mascot-stage[data-state="success"] .mascot-tilt { animation: mascot-celebrate .4s cubic-bezier(.2, 1.25, .35, 1) both; }
.mascot-stage[data-state="success"] .mascot-eyes { opacity: 0; }
.mascot-stage[data-state="success"] .mascot-happy-eyes { opacity: 1; animation: happy-blink .52s ease-out both; }
.mascot-stage[data-state="success"] .mascot-mouth-smile,
.mascot-stage[data-state="success"] .mascot-mouth-curious { opacity: 0; }
.mascot-stage[data-state="success"] .mascot-mouth-happy { opacity: 1; animation: happy-mouth-in .4s cubic-bezier(.2, .9, .3, 1.25) both; }
.mascot-stage[data-state="success"] .mascot-confetti { opacity: 1; }
.mascot-stage[data-state="success"] .spark-a,
.mascot-stage[data-state="success"] .spark-b,
.mascot-stage[data-state="success"] .spark-c { animation-duration: 1.1s; opacity: 1; }

.mascot-stage.is-bouncing .mascot-tilt { animation: mascot-bounce .3s ease-out; }
.mascot-stage.is-nudging .mascot-breathe { animation: mascot-nudge .42s ease-in-out; }

.mascot-spark { position: absolute; z-index: 1; width: 8px; height: 8px; border-radius: 3px; background: #8eb2f4; opacity: .48; }
.spark-a { top: 24%; left: 18%; transform: rotate(14deg); animation: spark-float 3.8s ease-in-out infinite; }
.spark-b { top: 35%; right: 15%; width: 6px; height: 6px; border-radius: 50%; background: #f3b08b; animation: spark-float 4.5s ease-in-out -1.4s infinite; }
.spark-c { bottom: 29%; right: 20%; width: 10px; height: 10px; background: #a9c5fa; animation: spark-float 4.1s ease-in-out -2.2s infinite; }

.mascot-confetti { position: absolute; z-index: 3; inset: 0; opacity: 0; pointer-events: none; transition: opacity .2s ease; }
.mascot-confetti i { position: absolute; top: 16%; left: 50%; width: 7px; height: 13px; border-radius: 3px; background: #7fa9f5; transform: translate(-50%, -50%); }
.mascot-confetti i:nth-child(2) { background: #f2b28f; }
.mascot-confetti i:nth-child(3) { background: #8dc9ae; }
.mascot-confetti i:nth-child(4) { background: #9ebcf7; }
.mascot-confetti i:nth-child(5) { background: #f0c996; }
.mascot-confetti i:nth-child(6) { background: #74a6f2; }
.mascot-stage[data-state="success"] .mascot-confetti i { animation: confetti-pop .75s cubic-bezier(.2, .8, .35, 1) both; }
.mascot-stage[data-state="success"] .mascot-confetti i:nth-child(1) { --tx: -135px; --ty: -92px; --r: -30deg; }
.mascot-stage[data-state="success"] .mascot-confetti i:nth-child(2) { --tx: -84px; --ty: -143px; --r: 42deg; }
.mascot-stage[data-state="success"] .mascot-confetti i:nth-child(3) { --tx: 116px; --ty: -124px; --r: -54deg; }
.mascot-stage[data-state="success"] .mascot-confetti i:nth-child(4) { --tx: 148px; --ty: -66px; --r: 28deg; }
.mascot-stage[data-state="success"] .mascot-confetti i:nth-child(5) { --tx: 74px; --ty: -155px; --r: 60deg; }
.mascot-stage[data-state="success"] .mascot-confetti i:nth-child(6) { --tx: -24px; --ty: -164px; --r: -16deg; }

.mascot-bubble {
  position: absolute;
  z-index: 4;
  top: 22px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: min(250px, calc(100% - 140px));
  padding: 10px 13px;
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 13px;
  background: rgba(255, 255, 255, .76);
  box-shadow: 0 14px 34px rgba(59, 92, 145, .08);
  backdrop-filter: blur(14px);
}

.mascot-bubble-mark {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 6px rgba(91, 141, 239, .10);
  transition: transform .26s ease, background .26s ease;
}

.mascot-bubble p { margin: 0; color: #596b83; font-size: 11.5px; line-height: 1.55; }
.mascot-stage[data-state="success"] .mascot-bubble-mark { transform: scale(1.2); background: #56a982; box-shadow: 0 0 0 6px rgba(86, 169, 130, .12); }

.join-footer { padding: 18px 4px 0; color: #9aa7b8; font-size: 9px; letter-spacing: .07em; text-align: center; }

@keyframes mascot-breathe {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes mascot-bounce {
  0% { transform: translateY(0) scale(1); }
  34% { transform: translateY(-13px) scale(1.06); }
  68% { transform: translateY(2px) scale(.992); }
  100% { transform: translateY(0) scale(1); }
}

@keyframes mascot-celebrate {
  0% { transform: translateY(0) scale(1); }
  42% { transform: translateY(-15px) scale(1.045); }
  72% { transform: translateY(2px) scale(.994); }
  100% { transform: translateY(-4px) scale(1); }
}

@keyframes mascot-nudge {
  0%, 100% { transform: translateX(0) rotate(0); }
  28% { transform: translateX(-7px) rotate(-.7deg); }
  58% { transform: translateX(6px) rotate(.6deg); }
}

@keyframes happy-blink {
  0% { opacity: 0; transform: scale(.82, .82); }
  24% { opacity: 1; transform: scale(1, .72); }
  43% { opacity: 1; transform: scale(1, .18); }
  62% { opacity: 1; transform: scale(1, 1); }
  100% { opacity: 1; transform: scale(1, 1); }
}

@keyframes happy-mouth-in {
  from { opacity: 0; transform: scale(.55, .45); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes spark-float {
  0%, 100% { transform: translateY(0) rotate(10deg); opacity: .35; }
  50% { transform: translateY(-13px) rotate(22deg); opacity: .78; }
}

@keyframes confetti-pop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.5) rotate(0); }
  25% { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(1) rotate(var(--r)); }
}

.page-confetti { position: fixed; z-index: 9999; inset: 0; overflow: hidden; pointer-events: none; }
.page-confetti i {
  position: absolute;
  top: 64%;
  left: 50%;
  width: var(--w, 8px);
  height: var(--h, 13px);
  border-radius: 2px;
  background: var(--color, #5b8def);
  opacity: 0;
  animation: page-confetti-burst var(--duration, 1.15s) cubic-bezier(.18, .72, .28, 1) var(--delay, 0ms) forwards;
  will-change: transform, opacity;
}

@keyframes page-confetti-burst {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.35) rotate(0deg); }
  12% { opacity: 1; transform: translate(var(--launch-x), var(--launch-y)) scale(1) rotate(var(--spin-a)); }
  62% { opacity: 1; transform: translate(var(--peak-x), var(--peak-y)) scale(1) rotate(var(--spin-b)); }
  100% { opacity: 0; transform: translate(var(--end-x), var(--end-y)) scale(.92) rotate(var(--spin-c)); }
}

@media (max-width: 1040px) {
  .join-page { padding: 20px 24px 18px; }
  .join-card { grid-template-columns: minmax(0, 1fr) minmax(360px, .84fr); }
  .join-form-panel { padding: 50px 42px 46px; }
  .join-copy h1 { font-size: clamp(42px, 5.4vw, 58px); }
  .mascot-stage { min-height: 600px; }
}

@media (max-width: 820px) {
  .join-page { padding: 16px 18px 18px; }
  .join-card { grid-template-columns: 1fr; min-height: 0; }
  .join-form-panel { order: 1; padding: 42px 34px 34px; }
  .mascot-stage { order: 2; min-height: 460px; margin: 0 14px 14px; }
  .join-copy, .invite-form, .invite-help, .invite-privacy { width: 100%; }
  .mascot-svg { width: 135%; }
  .mascot-bubble { top: 18px; right: 18px; }
}

@media (max-width: 560px) {
  .join-page { padding: 0 0 18px; }
  .join-topbar { padding: 16px 20px 10px; }
  .join-brand-mark { width: 38px; height: 38px; border-radius: 12px; }
  .join-brand-copy small { display: none; }
  .join-login-copy { font-size: 11px; }
  .join-card { margin-top: 4px; border-right: 0; border-left: 0; border-radius: 0; box-shadow: none; }
  .join-form-panel { padding: 38px 22px 30px; }
  .join-copy h1 { margin-top: 23px; font-size: 39px; }
  .join-intro { font-size: 13px; }
  .invite-form { margin-top: 34px; }
  .invite-field { min-height: 56px; border-radius: 14px; }
  .invite-submit { min-height: 56px; border-radius: 14px; }
  .invite-privacy { margin-top: 28px; }
  .mascot-stage { min-height: 400px; margin: 0 10px 12px; border-radius: 24px; }
  .mascot-svg { width: 135%; }
  .mascot-status { top: 17px; left: 17px; }
  .mascot-bubble { top: 16px; right: 16px; max-width: 218px; padding: 9px 11px; }
  .mascot-bubble p { font-size: 10.5px; }
  .join-footer { padding-top: 12px; }
}

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