.auth-gateway,
.compliance-modal {
  font-family: Inter, "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

body.auth-active {
  overflow: hidden;
}

.auth-gateway {
  position: fixed;
  z-index: 100;
  inset: 0;
  overflow-y: auto;
  color: #17292e;
  background: #edf3ef;
}

.auth-backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(247, 250, 247, 0.98) 0 40%, rgba(247, 250, 247, 0.7) 58%, rgba(247, 250, 247, 0.12) 82%),
    url("./cunnian-personality-hero-v2.jpg") center / cover no-repeat;
}

.auth-shell {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 32px));
  min-height: 100svh;
  margin: 0 auto;
  padding: 28px 0 22px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 430px;
}

.auth-close {
  width: 40px;
  height: 40px;
  margin-left: auto;
  flex: 0 0 auto;
  border: 1px solid rgba(22, 70, 77, 0.14);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.86);
  color: #405b58;
  font-size: 25px;
  line-height: 1;
}

.auth-brand img {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(22, 70, 77, 0.16);
}

.auth-brand strong,
.auth-brand span {
  display: block;
}

.auth-brand strong {
  color: #16464d;
  font-family: "Songti SC", "STSong", "PingFang SC", serif;
  font-size: 24px;
  line-height: 1;
}

.auth-brand span {
  margin-top: 5px;
  color: #6a7773;
  font-size: 12px;
}

.auth-panel {
  width: 430px;
  margin-top: 24px;
  border: 1px solid rgba(22, 70, 77, 0.12);
  border-radius: 8px;
  padding: 26px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 30px 80px rgba(22, 70, 77, 0.14);
  backdrop-filter: blur(20px);
}

.auth-kicker {
  margin: 0;
  color: #2f8a78;
  font-size: 13px;
  font-weight: 800;
}

.auth-panel h1 {
  margin: 8px 0 0;
  color: #173b40;
  font-family: "Songti SC", "STSong", "PingFang SC", serif;
  font-size: 36px;
  line-height: 1.12;
}

.auth-lead {
  margin: 12px 0 0;
  color: #697570;
  font-size: 14px;
  line-height: 1.65;
}

.auth-form {
  margin-top: 22px;
  display: grid;
  gap: 14px;
}

.auth-field,
.identity-form > label {
  display: grid;
  gap: 7px;
  color: #40504c;
  font-size: 13px;
  font-weight: 700;
}

.auth-field > input,
.auth-field select,
.identity-form input,
.identity-form select,
.auth-phone-row,
.auth-code-row {
  width: 100%;
  min-width: 0;
  min-height: 50px;
  border: 1px solid rgba(22, 70, 77, 0.16);
  border-radius: 8px;
  background: #fbfdfb;
  color: #17292e;
  outline: 0;
}

.auth-field > input,
.auth-field select,
.identity-form input,
.identity-form select {
  padding: 0 14px;
}

.auth-field > input:focus,
.auth-field select:focus,
.identity-form input:focus,
.identity-form select:focus,
.auth-phone-row:focus-within,
.auth-code-row:focus-within {
  border-color: #2f8a78;
  box-shadow: 0 0 0 3px rgba(47, 138, 120, 0.12);
}

.auth-phone-row,
.auth-code-row {
  display: grid;
  align-items: center;
  overflow: hidden;
}

.auth-phone-row {
  grid-template-columns: 58px minmax(0, 1fr);
}

.auth-phone-row b {
  padding-left: 14px;
  color: #38524f;
  font-size: 14px;
  border-right: 1px solid rgba(22, 70, 77, 0.12);
}

.auth-phone-row input,
.auth-code-row input {
  min-width: 0;
  height: 48px;
  border: 0;
  padding: 0 14px;
  background: transparent;
  outline: 0;
}

.auth-code-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.auth-code-row button {
  min-width: 104px;
  height: 38px;
  margin-right: 6px;
  border: 0;
  border-left: 1px solid rgba(22, 70, 77, 0.12);
  background: transparent;
  color: #2f7d70;
  font-size: 13px;
  font-weight: 800;
}

.auth-code-row button:disabled {
  color: #9aa4a0;
}

.auth-check {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  color: #67736f;
  font-size: 12px;
  line-height: 1.55;
  font-weight: 500;
}

.auth-check input {
  width: 17px;
  height: 17px;
  margin: 1px 0 0;
  accent-color: #2f8a78;
}

.auth-check a,
.auth-footer a {
  color: #1f7066;
  font-weight: 700;
}

.auth-primary,
.auth-demo {
  min-height: 50px;
  border-radius: 8px;
  font-weight: 800;
}

.auth-demo-banner {
  position: sticky;
  z-index: 25;
  top: 0;
  width: 100%;
  min-height: 36px;
  margin-bottom: 14px;
  border: 1px solid rgba(180, 122, 43, 0.24);
  border-radius: 8px;
  display: grid;
  place-items: center;
  padding: 6px 12px;
  background: rgba(255, 247, 223, 0.96);
  color: #76572f;
  box-shadow: 0 12px 30px rgba(22, 70, 77, 0.12);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.auth-primary {
  border: 1px solid #16464d;
  background: #16464d;
  color: white;
  box-shadow: 0 14px 28px rgba(22, 70, 77, 0.18);
}

.auth-primary:disabled {
  border-color: #aab4b0;
  background: #aab4b0;
  box-shadow: none;
}

.auth-divider {
  position: relative;
  margin: 22px 0 16px;
  text-align: center;
  color: #87918e;
  font-size: 12px;
}

.auth-divider::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: rgba(22, 70, 77, 0.1);
}

.auth-divider span {
  position: relative;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.96);
}

.social-login {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.social-login button {
  min-width: 0;
  min-height: 70px;
  border: 1px solid rgba(22, 70, 77, 0.12);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 6px;
  background: #fbfdfb;
  color: #3f4f4b;
  font-size: 14px;
  font-weight: 700;
}

.social-login button span {
  white-space: nowrap;
}

.social-login button:hover {
  border-color: rgba(22, 70, 77, 0.24);
  background: #ffffff;
}

.social-login button:active {
  background: #f3f7f5;
}

.social-brand-icon {
  display: block;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  flex: 0 0 auto;
  object-fit: contain;
}

@media (max-width: 430px) {
  .social-login button {
    gap: 6px;
  }

  .social-brand-icon {
    width: 34px;
    height: 34px;
  }
}

.auth-status {
  min-height: 20px;
  margin: 14px 0 0;
  color: #8a6840;
  font-size: 12px;
  line-height: 1.55;
}

.auth-status.ready {
  color: #247668;
}

.auth-status.error {
  color: #b14b3b;
}

.auth-demo {
  width: 100%;
  margin-top: 8px;
  border: 1px solid rgba(22, 70, 77, 0.15);
  background: transparent;
  color: #31534f;
}

.auth-footer {
  width: 430px;
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: #7b8783;
  font-size: 11px;
}

.auth-footer-links {
  display: flex;
  align-items: center;
  gap: 14px;
}

.auth-footer-links a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.emergency-panel {
  margin-top: 36px;
}

.compliance-modal {
  position: fixed;
  z-index: 220;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(10, 31, 33, 0.56);
  backdrop-filter: blur(12px);
}

.compliance-modal[hidden],
.auth-panel[hidden],
.auth-gateway[hidden] {
  display: none !important;
}

.compliance-sheet,
.usage-reminder-sheet,
.release-notes-sheet {
  position: relative;
  width: min(560px, 100%);
  max-height: min(760px, calc(100svh - 40px));
  overflow-y: auto;
  border: 1px solid rgba(47, 138, 120, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.99), rgba(242, 249, 245, 0.99) 58%, rgba(255, 248, 232, 0.99)),
    #fbfdfb;
  box-shadow: 0 36px 90px rgba(5, 24, 26, 0.28);
}

.compliance-sheet::before,
.usage-reminder-sheet::before,
.release-notes-sheet::before {
  content: "";
  position: sticky;
  z-index: 3;
  top: 0;
  display: block;
  width: 76px;
  height: 3px;
  margin: 0 auto 12px;
  border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, #c58f30, #2f8a78, #bb5b47);
}

.compliance-sheet {
  padding: 24px;
}

.release-notes-sheet {
  padding: 26px;
}

.compliance-sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.compliance-sheet-head span,
.usage-reminder-sheet > span {
  color: #2f8a78;
  font-size: 12px;
  font-weight: 800;
}

.compliance-sheet h2,
.usage-reminder-sheet h2,
.release-notes-sheet h2 {
  margin: 6px 0 0;
  color: #173b40;
  font-family: "Songti SC", "STSong", "PingFang SC", serif;
  font-size: 28px;
  line-height: 1.18;
}

.compliance-sheet-head button {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 1px solid rgba(22, 70, 77, 0.12);
  border-radius: 50%;
  background: white;
  color: #4e625d;
  font-size: 24px;
  line-height: 1;
}

.beta-version-mark {
  min-width: 58px;
  min-height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(47, 138, 120, 0.24);
  border-radius: 6px;
  background: rgba(47, 138, 120, 0.08);
  color: #246f62;
  font-size: 11px;
  font-weight: 900;
}

.beta-notice-list {
  margin: 18px 0;
  padding: 0;
  display: grid;
  gap: 10px;
  list-style: none;
}

.beta-notice-list li {
  border-left: 3px solid rgba(47, 138, 120, 0.32);
  padding: 2px 0 2px 11px;
  color: #536965;
  font-size: 13px;
  line-height: 1.62;
}

.beta-notice-list strong {
  color: #173b40;
}

.beta-notice-confirm {
  margin: 4px 0 16px;
}

.native-upgrade-actions {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.native-upgrade-download {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 8px;
  text-align: center;
  text-decoration: none;
}

.native-upgrade-later {
  width: auto;
  min-width: 108px;
  margin-top: 0;
  padding: 0 16px;
}

.auth-primary:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.compliance-intro,
.usage-reminder-sheet p {
  margin: 14px 0 0;
  color: #65736f;
  font-size: 14px;
  line-height: 1.7;
}

.release-notes-list {
  margin-top: 18px;
  display: grid;
  gap: 12px;
}

.release-note-section {
  border: 1px solid rgba(22, 70, 77, 0.11);
  border-radius: 8px;
  background: #f2f7f4;
  padding: 14px 16px;
}

.release-note-section strong {
  display: block;
  color: #24544f;
  font-size: 14px;
}

.release-note-section ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: #5f706b;
  font-size: 13px;
  line-height: 1.65;
}

.release-notes-sheet > .auth-primary {
  width: 100%;
  margin-top: 18px;
}

.feedback-form {
  margin-top: 18px;
  display: grid;
  gap: 14px;
}

.feedback-form > label:not(.auth-check) {
  display: grid;
  gap: 7px;
  color: #38524f;
  font-size: 13px;
  font-weight: 800;
}

.feedback-form select,
.feedback-form textarea {
  width: 100%;
  border: 1px solid rgba(22, 70, 77, 0.16);
  border-radius: 7px;
  background: white;
  color: #173b40;
  padding: 11px 12px;
  font: inherit;
}

.feedback-form textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.55;
}

.identity-form {
  margin-top: 20px;
  display: grid;
  gap: 14px;
}

.identity-form fieldset {
  margin: 0;
  border: 1px solid rgba(22, 70, 77, 0.12);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 16px;
}

.identity-form legend {
  padding: 0 7px;
  color: #38524f;
  font-size: 13px;
  font-weight: 800;
}

.usage-reminder-sheet {
  padding: 28px;
}

.usage-reminder-sheet .auth-primary {
  width: 100%;
  margin-top: 22px;
}

.delete-confirm-field {
  margin-top: 20px;
  display: grid;
  gap: 8px;
  color: #38524f;
  font-size: 13px;
  font-weight: 800;
}

.delete-confirm-field input {
  min-height: 46px;
  border: 1px solid rgba(22, 70, 77, 0.18);
  border-radius: 7px;
  background: white;
  padding: 0 12px;
  color: #173b40;
  font: inherit;
}

.delete-account-actions {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.delete-account-actions button {
  min-height: 46px;
  border: 1px solid rgba(22, 70, 77, 0.14);
  border-radius: 7px;
  background: white;
  color: #35504d;
  font-weight: 800;
}

.delete-account-actions button:last-child {
  border-color: #a65343;
  background: #a65343;
  color: white;
}

@media (max-width: 720px) {
  .native-upgrade-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .native-upgrade-later {
    width: 100%;
  }

  .auth-backdrop {
    background:
      linear-gradient(180deg, rgba(247, 250, 247, 0.82), rgba(247, 250, 247, 0.98) 38%),
      url("./cunnian-personality-hero-v2.jpg") 62% top / auto 46% no-repeat,
      #edf3ef;
  }

  .auth-shell {
    width: 100%;
    padding: 16px;
    align-items: stretch;
  }

  .auth-brand,
  .auth-panel,
  .auth-footer {
    width: 100%;
  }

  .auth-brand {
    padding: 0 2px;
  }

  .auth-panel {
    margin-top: 22px;
    padding: 22px 18px;
  }

  .auth-panel h1 {
    font-size: 32px;
  }

  .auth-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .compliance-modal {
    align-items: end;
    padding: 0;
  }

  .compliance-sheet,
  .usage-reminder-sheet {
    width: 100%;
    max-height: 92svh;
    border-radius: 8px 8px 0 0;
  }
}

@media (max-width: 360px) {
  .auth-panel {
    padding-inline: 14px;
  }

  .social-login button {
    min-height: 58px;
    flex-direction: column;
    gap: 3px;
  }

  .social-brand-icon {
    width: 34px;
    height: 34px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-gateway *,
  .compliance-modal * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
