/* 视觉参考: pastel 主屏 — 柔和渐变氛围 + 玻璃拟态圆角 */

/* 蜜桃主色取自 image/logo.svg 渐变 (#F38CC1 / #F6CE60 等) */

:root {
  --text-1: #453840;
  --text-2: #6f5f68;
  --text-3: #a8949e;
  --bg-white-100: rgba(255, 255, 255, 0.92);
  --glass-border: rgba(255, 255, 255, 0.58);
  --glass-surface: rgba(255, 250, 248, 0.42);
  --glass-surface-strong: rgba(255, 248, 245, 0.55);

  --accent: #f2b8c8;
  --accent-mid: #e88dae;
  --accent-deep: #d7668f;
  --accent-focus: #f5c4d6;
  --accent-ring: rgba(243, 140, 193, 0.5);

  --btn-main: #cf5a78;
  --btn-main-deep: #b84a65;
  --text1-google: #453840;

  --shadow-warm: 0 20px 52px rgba(200, 110, 130, 0.14);
  --shadow-card: var(--shadow-warm), 0 1px 0 rgba(255, 255, 255, 0.7) inset;
  --shadow-float: 0 4px 20px rgba(190, 100, 120, 0.1);
  --shadow-glass: 0 4px 16px rgba(190, 105, 125, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
  --shadow-primary: 0 4px 18px rgba(220, 100, 140, 0.38);
  --shadow-primary-hover: 0 6px 22px rgba(220, 100, 140, 0.44);

  --font: "PingFang SC", "PingFang TC", -apple-system, BlinkMacSystemFont,
    "Segoe UI", "Microsoft YaHei", "Inter", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  font-family: var(--font);
  color: var(--text-1);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-transition-delay: 111111s;
  -webkit-transition:
    color 11111s ease-out,
    background-color 111111s ease-out;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.lang-switch {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 200;
  display: flex;
  align-items: center;
}

.lang-switch__shell {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass-surface-strong);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-float);
  cursor: pointer;
}

.lang-switch__icon-globe,
.lang-switch__icon-down {
  flex-shrink: 0;
  display: block;
}

.lang-switch__select {
  padding: 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  appearance: none;
}

.lang-switch__select:focus {
  outline: none;
}

.page {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  overflow: hidden;
}

.page__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("image/bg.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.card {
  position: relative;
  width: min(444px, 100%);
  padding: 36px 32px;
  border-radius: 32px;
  border: 1px solid var(--glass-border);
  background: var(--glass-surface);
  backdrop-filter: blur(28px) saturate(1.15);
  -webkit-backdrop-filter: blur(28px) saturate(1.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  box-shadow: var(--shadow-card);
}

/* 保证与 .card 的 display 不冲突，只展示登录或注销其一 */
.card[hidden] {
  display: none !important;
}

.card__head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.brand {
  position: relative;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: var(--shadow-glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.brand__logo {
  display: block;
  width: 68px;
  height: 68px;
}

.card__title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--text-1);
  text-align: center;
}

.form {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.form__fields {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.field__label {
  font-size: 14px;
  font-weight: 500;
  line-height: 22px;
  color: var(--text-2);
}

.input {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.35);
  box-shadow: 0 2px 10px rgba(190, 105, 120, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.52);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input:focus-within {
  border-color: var(--accent-ring);
  box-shadow: 0 2px 14px rgba(243, 140, 193, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

.input__icon {
  flex-shrink: 0;
  display: block;
}

.input__control {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  outline: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  line-height: 22px;
  color: var(--text-1);
}

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

.input__toggle {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: -4px -8px -4px 0;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
}

.input__toggle:hover {
  background: rgba(255, 255, 255, 0.45);
}

.input__toggle:focus-visible {
  outline: 2px solid var(--accent-focus);
  outline-offset: 2px;
}

.input__toggle-img {
  display: block;
  width: 20px;
  height: 20px;
  object-fit: contain;
}

/* Toast — Figma Message 5193:29499 + check / warning 图标 */
.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  z-index: var(--toast-z, 320);
  max-width: min(420px, calc(100vw - 32px));
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text-1);
  font-size: 14px;
  font-weight: 400;
  line-height: 22px;
  box-shadow: 0 8px 26px rgba(200, 110, 130, 0.14);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
}

.toast__icon {
  flex-shrink: 0;
  display: block;
  width: 16px;
  height: 16px;
  object-fit: contain;
  margin-top: 3px;
}

.toast__text {
  flex: 1;
  min-width: 0;
  text-align: left;
}

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

.toast.toast--out {
  opacity: 0;
  transform: translate(-50%, -8px);
}

/* 登录后账户卡片 — Figma 8782:106441 */
.card--account {
  gap: 32px;
}

.account-card__profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.account-card__avatar-wrap {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: var(--shadow-glass);
  display: flex;
  align-items: center;
  justify-content: center;
}

.account-card__avatar {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-card__meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.account-card__name {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-1);
  text-align: center;
}

.account-card__id {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 22px;
  color: var(--text-2);
}

.account-card__actions {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.btn--deactivate {
  background: linear-gradient(
    180deg,
    #e895a8 0%,
    var(--btn-main) 48%,
    var(--btn-main-deep) 100%
  );
  color: #fff;
  box-shadow: 0 4px 16px rgba(200, 80, 105, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.btn--deactivate:not(:disabled):hover {
  filter: brightness(1.04);
  box-shadow: 0 6px 20px rgba(200, 80, 105, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.btn--deactivate:disabled {
  cursor: not-allowed;
  opacity: 0.65;
  filter: none;
}

.account-card__signout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 20px;
  padding: 0;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 22px;
  color: var(--text-2);
  cursor: pointer;
}

.account-card__signout:hover {
  color: var(--text-1);
}

.account-card__signout:focus-visible {
  outline: 2px solid var(--accent-focus);
  outline-offset: 2px;
  border-radius: 999px;
}

.account-card__signout-icon {
  display: block;
  flex-shrink: 0;
}

.form__actions {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 48px;
  padding: 14px 24px;
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  line-height: 22px;
  cursor: pointer;
  transition: background-color 0.2s ease, opacity 0.2s ease, transform 0.15s ease,
    box-shadow 0.2s ease;
}

.btn--primary {
  background: linear-gradient(
    165deg,
    #ffe8d9 0%,
    #f9c4d2 28%,
    var(--accent-mid) 58%,
    var(--accent-deep) 100%
  );
  color: #fff;
  text-shadow: 0 1px 0 rgba(180, 60, 90, 0.12);
  box-shadow: var(--shadow-primary), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.btn--primary:not(:disabled) {
  background: linear-gradient(
    165deg,
    #ffdfc8 0%,
    #f5b8cc 22%,
    #e87da3 55%,
    #d75684 100%
  );
}

.btn--primary:not(:disabled):hover {
  filter: brightness(1.03);
  box-shadow: var(--shadow-primary-hover),
    inset 0 1px 0 rgba(255, 255, 255, 0.38);
}

.btn--primary:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  filter: saturate(0.65);
  box-shadow: none;
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 48px;
  padding: 14px 20px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  font-family: inherit;
  text-decoration: none;
  color: var(--text1-google);
  font-size: 15px;
  font-weight: 500;
  line-height: 22px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transition: background-color 0.2s ease, opacity 0.2s ease;
}

.btn-google:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.btn-google:hover {
  background: rgba(255, 255, 255, 0.48);
}

.btn-google:focus-visible {
  outline: 2px solid var(--accent-focus);
  outline-offset: 2px;
}

.btn-google__icon {
  display: block;
  flex-shrink: 0;
}

.btn-google__arrow {
  display: inline-flex;
  width: 16px;
  height: 16px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  line-height: 0;
}

.btn-google__arrow-img {
  display: block;
  width: 16px;
  height: 16px;
}

/* 确认弹窗 — Figma Container 6878:50807 + 遮罩 6878:50806 */
.modal-root {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.modal-root__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(120, 72, 88, 0.26);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-dialog {
  position: relative;
  z-index: 1;
  width: min(400px, 100%);
  padding: 32px 32px 12px;
  border-radius: 28px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(24px) saturate(1.12);
  -webkit-backdrop-filter: blur(24px) saturate(1.12);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: var(--text1-google);
}

.modal-dialog__close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, background 0.15s ease;
}

.modal-dialog__close:not(:disabled):hover {
  color: var(--text-1);
  background: rgba(255, 255, 255, 0.55);
}

.modal-dialog__close:disabled {
  cursor: not-allowed;
  opacity: 0.35;
  color: var(--text-3);
}

.modal-dialog__close:focus-visible {
  outline: 2px solid var(--accent-focus);
  outline-offset: 2px;
}

.modal-dialog__close-icon {
  display: block;
}

.modal-dialog__title {
  margin: 0;
  padding: 0 28px 0 12px;
  font-size: 18px;
  font-weight: 600;
  line-height: 24px;
  text-align: center;
  color: var(--text-1);
}

.modal-dialog__body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  text-align: center;
  color: var(--text-2);
}

/* 与「注销账号」共用 .btn .btn--deactivate */
.modal-dialog__primary {
  width: 100%;
  margin-top: 4px;
}

.modal-dialog__cancel {
  margin: 0;
  padding: 6px 12px;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 22px;
  color: var(--text-2);
  cursor: pointer;
  text-decoration: none;
}

.modal-dialog__cancel:not(:disabled):hover {
  color: var(--text-1);
}

.modal-dialog__cancel:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  color: var(--text-2);
}

.modal-dialog__cancel:focus-visible {
  outline: 2px solid var(--accent-focus);
  outline-offset: 2px;
  border-radius: 999px;
}

@media (max-width: 400px) {
  .card {
    padding: 28px 20px;
    border-radius: 26px;
  }

  .modal-dialog {
    width: min(400px, 100%);
    padding: 20px 16px 16px;
    border-radius: 22px;
  }

  .modal-dialog__title {
    font-size: 16px;
    line-height: 22px;
    padding: 0 24px 0 8px;
  }

  .modal-dialog__body {
    font-size: 12px;
    line-height: 18px;
  }
}
