/* Login popup — Figma PC 39327:125424/125682 · H5 39050:113978/111218 */

body.login-layer-open {
  overflow: hidden;
}

/* inset/flex-gap 老 Safari(<14.5/<14.1)不支持,一律用 longhand + margin */
.login-layer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10002;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  overflow-y: auto;
}

.login-layer--open {
  display: flex;
}

.login-layer__backdrop {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.7);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

.login-layer__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: auto;
}

.login-layer__panel {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  width: 440px;
  max-width: 100%;
  padding: 24px 20px;
  border-radius: 20px;
  /* Figma 描边为 OUTSIDE,用 box-shadow 环避免挤占 440 内容盒 */
  box-shadow: 0 0 0 1px var(--color-black-alpha-20);
  background: var(--surface-foreground);
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
}

/* 顶部柔光：面板圆角内被裁剪的两个高斯模糊圆(Figma LAYER_BLUR 150) */
.login-layer__glow {
  position: absolute;
  z-index: -1;
  width: 95px;
  height: 95px;
  border-radius: 50%;
  -webkit-filter: blur(75px);
  filter: blur(75px);
  pointer-events: none;
}

.login-layer__glow--pink {
  left: 40px;
  top: -76px;
  background: #ff2d55;
}

/* 金斑锚右侧,面板收窄时不外漂 */
.login-layer__glow--gold {
  right: 39px;
  top: -66px;
  background: #fcd417;
}

.login-layer__logo {
  height: 28px;
  width: auto;
  display: block;
  object-fit: contain;
}

.login-layer__tabs {
  width: 100%;
  margin-top: 18px;
  display: flex;
  align-items: flex-start;
}

.login-layer__tab {
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text-primary);
  font-size: 16px;
  font-family: PingFang SC, sans-serif;
  font-weight: 400;
  line-height: 22px;
}

.login-layer__tab + .login-layer__tab {
  margin-left: 24px;
}

.login-layer__tab::after {
  content: "";
  width: 16px;
  height: 6px;
  margin-top: 4px;
  border-radius: 3px;
  background: var(--color-primary-500);
  opacity: 0;
}

.login-layer__tab--active {
  font-size: 18px;
  font-weight: 600;
  line-height: 24px;
}

.login-layer__tab--active::after {
  opacity: 1;
}

.login-layer__form {
  width: 100%;
  margin-top: 20px;
  display: flex;
  flex-direction: column;
}

.login-layer__fields {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.login-layer__field {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.login-layer__field + .login-layer__field {
  margin-top: 12px;
}

.login-layer__field--register {
  display: none;
}

.login-layer--register .login-layer__field--register {
  display: flex;
}

.login-layer__label {
  color: var(--text-primary);
  font-size: 14px;
  font-family: PingFang SC, sans-serif;
  font-weight: 400;
  line-height: 20px;
}

.login-layer__input {
  width: 100%;
  margin-top: 6px;
  height: 48px;
  padding: 12px 18px;
  border: 1px solid var(--color-black-alpha-5);
  border-radius: 6px;
  background: var(--color-black-alpha-5);
  /* 半透明边框别叠深半透明底色 */
  background-clip: padding-box;
  color: var(--text-primary);
  /* ≥16px:iOS Safari 聚焦 <16px 输入框会自动放大页面 */
  font-size: 16px;
  font-family: PingFang SC, sans-serif;
  font-weight: 500;
  line-height: 22px;
  box-sizing: border-box;
}

.login-layer__input::placeholder {
  color: var(--text-placeholder);
  font-weight: 400;
}

.login-layer__input:focus {
  border-color: var(--color-primary-500);
  outline: none;
}

.login-layer__error {
  display: none;
  margin: 6px 0 0;
  color: #ff272b;
  font-size: 12px;
  font-family: PingFang SC, sans-serif;
  font-weight: 500;
  line-height: 18px;
}

.login-layer__error--visible {
  display: block;
}

.login-layer__form-message {
  width: 100%;
  margin: 12px 0 0;
  font-size: 14px;
  font-family: PingFang SC, sans-serif;
  line-height: 20px;
  text-align: center;
}

.login-layer__form-message--error {
  color: #fd2e33;
}

.login-layer__form-message--success {
  color: #1f9d55;
}

.login-layer__submit {
  width: 100%;
  margin-top: 18px;
  height: 48px;
  border: none;
  border-radius: 12px;
  background: var(--color-primary-500);
  color: rgba(0, 0, 0, 0.9);
  font-size: 16px;
  font-family: PingFang SC, sans-serif;
  font-weight: 500;
  line-height: 22px;
  text-align: center;
  cursor: pointer;
}

.login-layer__submit:hover {
  opacity: 0.9;
}

.login-layer--submitting .login-layer__submit {
  opacity: 0.7;
  cursor: wait;
}

.login-layer__tips {
  width: 100%;
  margin-top: 18px;
}

.login-layer__tips-title {
  margin: 0;
  color: var(--text-primary);
  font-size: 14px;
  font-family: PingFang SC, sans-serif;
  font-weight: 500;
  line-height: 20px;
}

.login-layer__tips-text {
  margin: 12px 0 0;
  color: var(--text-secondary);
  font-size: 14px;
  font-family: PingFang SC, sans-serif;
  font-weight: 400;
  line-height: 20px;
}

.login-layer__close {
  width: 36px;
  height: 36px;
  margin-top: 24px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-layer__close:hover {
  opacity: 0.85;
}

.login-layer__close-icon {
  display: block;
}

@media (max-width: 768px) {
  .login-layer__backdrop {
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
  }

  .login-layer__panel {
    width: min(350px, calc(100vw - 32px));
  }

  .login-layer__glow--pink {
    left: -25px;
    top: -75px;
  }

  .login-layer__glow--gold {
    right: -36px;
    top: -66px;
  }

  .login-layer__label {
    font-size: 12px;
    line-height: 18px;
  }

  .login-layer__input {
    height: 47px;
  }

  .login-layer__error {
    font-weight: 400;
  }

  .login-layer__submit {
    height: 50px;
    font-size: 18px;
    font-weight: 400;
    line-height: 24px;
  }

  .login-layer__tips-text {
    margin-top: 6px;
    font-size: 12px;
    line-height: 18px;
  }
}
