:root {
  --page-bg: #f7f1e6;
  --card-bg: #ffffff;
  --primary-text: #171717;
  --secondary-text: #9d9d9d;
  --placeholder: #c6c6c6;
  --input-bg: #f7f6f3;
  --line: #e9e4da;
  --gold: #d9aa21;
  --gold-dark: #bf8e0e;
  --button: #10192e;
  --shadow: rgba(68, 52, 24, 0.10);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

html {
  background: var(--page-bg);
}

body {
  min-height: 100dvh;
  background:
    radial-gradient(circle at 50% -8%, rgba(255, 252, 234, 0.95) 0%, rgba(255, 252, 234, 0.34) 34%, rgba(255, 255, 255, 0) 58%),
    var(--page-bg);
  color: var(--primary-text);
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "PingFang SC",
    "Hiragino Sans GB",
    "Microsoft YaHei",
    Arial,
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.page-shell {
  width: min(100%, 520px);
  margin: 0 auto;
  padding:
    calc(46px + env(safe-area-inset-top))
    28px
    calc(36px + env(safe-area-inset-bottom));
}

.brand {
  text-align: center;
}

.brand-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.brand-logo {
  width: 42px;
  height: 42px;
  display: block;
}

.brand-name {
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: 38px;
  font-weight: 650;
  letter-spacing: 8px;
  transform: translateX(4px);
}

.brand-slogan {
  margin-top: 16px;
  color: var(--gold);
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: 15px;
  letter-spacing: 4px;
}

.inviter-card {
  margin-top: 46px;
  text-align: center;
}

.avatar-wrap {
  position: relative;
  width: 108px;
  height: 142px;
  margin: 0 auto;
  border: 3px solid var(--gold);
  border-radius: 16px;
  background: #ece8df;
  box-shadow: 0 7px 18px rgba(80, 61, 24, 0.08);
}

.inviter-avatar {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 12px;
}

.verified-badge {
  position: absolute;
  right: -18px;
  bottom: -4px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--gold);
  color: #fff;
  font-size: 24px;
  font-weight: 400;
  box-shadow: 0 5px 14px rgba(130, 93, 0, 0.18);
}

.inviter-name-line {
  margin-top: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.inviter-name {
  max-width: 270px;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: 33px;
  line-height: 1.1;
  font-weight: 600;
}

.inviter-tag {
  padding: 7px 15px 8px;
  border: 1.5px solid var(--gold);
  border-radius: 13px;
  color: var(--gold-dark);
  font-size: 14px;
  line-height: 1;
}

.invite-title {
  margin: 24px 0 0;
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: 25px;
  line-height: 1.35;
}

.invite-subtitle {
  margin: 18px 0 0;
  color: var(--secondary-text);
  font-size: 16px;
  letter-spacing: 0.3px;
}

.form-card {
  margin-top: 42px;
  padding: 34px 30px 38px;
  border: 1px solid rgba(220, 215, 204, 0.75);
  border-radius: 30px;
  background: var(--card-bg);
  box-shadow: 0 20px 38px var(--shadow);
}

.field-block-code {
  margin-top: 29px;
}

.field-label {
  display: block;
  margin-bottom: 17px;
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: 18px;
  font-weight: 600;
}

.input-shell {
  min-height: 72px;
  display: flex;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 20px;
  background: var(--input-bg);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.input-shell:focus-within {
  border-color: rgba(217, 170, 33, 0.62);
  box-shadow: 0 0 0 3px rgba(217, 170, 33, 0.08);
}

.input-icon {
  width: 62px;
  flex: 0 0 62px;
  display: grid;
  place-items: center;
  color: #bfc0c2;
}

.text-input {
  min-width: 0;
  width: 100%;
  height: 70px;
  padding: 0 16px 0 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--primary-text);
  font-size: 18px;
  caret-color: var(--gold-dark);
}

.text-input::placeholder {
  color: var(--placeholder);
}

.phone-shell .text-input {
  padding-right: 8px;
}

.sms-button {
  flex: 0 0 auto;
  min-width: 132px;
  height: 54px;
  margin-right: 9px;
  padding: 0 18px;
  border: 1.5px solid var(--gold);
  border-radius: 16px;
  background: #fff;
  color: #161616;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.sms-button:active:not(:disabled) {
  transform: scale(0.985);
}

.sms-button:disabled {
  opacity: 0.48;
  cursor: default;
}

.countdown {
  min-height: 21px;
  margin-top: 13px;
  color: var(--gold-dark);
  text-align: right;
  font-size: 14px;
}

.submit-button {
  width: 100%;
  height: 72px;
  margin-top: 31px;
  border: 0;
  border-radius: 38px;
  background: var(--button);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: 22px;
  font-weight: 600;
  box-shadow: 0 14px 28px rgba(16, 25, 46, 0.14);
  cursor: pointer;
}

.submit-button:active:not(:disabled) {
  transform: translateY(1px);
}

.submit-button:disabled {
  opacity: 0.58;
  cursor: default;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.34);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.agreement {
  margin: 36px 0 0;
  color: #a8a8a8;
  text-align: center;
  font-size: 13px;
  line-height: 1.8;
}

.agreement a {
  color: inherit;
  text-decoration: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(42px + env(safe-area-inset-bottom));
  z-index: 1000;
  max-width: calc(100vw - 48px);
  padding: 11px 17px;
  border-radius: 10px;
  background: rgba(18, 18, 18, 0.88);
  color: #fff;
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 14px);
  transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
}

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

.wechat-guide {
  position: fixed;
  inset: 0;
  z-index: 2000;
  padding:
    calc(30px + env(safe-area-inset-top))
    24px
    calc(28px + env(safe-area-inset-bottom));
  background: rgba(8, 12, 22, 0.90);
  color: #fff;
}

.wechat-arrow {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top));
  right: 20px;
  font-size: 44px;
  transform: rotate(-12deg);
}

.wechat-guide-card {
  width: min(100%, 420px);
  margin: 115px auto 0;
  padding: 28px 24px 24px;
  border-radius: 22px;
  background: #fff;
  color: var(--primary-text);
  text-align: center;
}

.wechat-guide-title {
  font-size: 21px;
  font-weight: 700;
}

.wechat-guide-text {
  margin-top: 13px;
  color: #666;
  font-size: 15px;
  line-height: 1.75;
}

.wechat-guide-button {
  width: 100%;
  height: 48px;
  margin-top: 22px;
  border: 0;
  border-radius: 24px;
  background: var(--button);
  color: #fff;
  font-size: 16px;
}

.is-hidden {
  display: none !important;
}

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

  .form-card {
    padding-left: 22px;
    padding-right: 22px;
  }

  .brand-name {
    font-size: 35px;
  }

  .inviter-name {
    font-size: 29px;
  }

  .sms-button {
    min-width: 118px;
    padding: 0 12px;
    font-size: 15px;
  }
}

@media (min-width: 700px) {
  .page-shell {
    padding-top: 66px;
  }
}
