/* ===== 全站登录/注册弹窗 ===== */
.auth-modal {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: min(420px, calc(100vw - 32px));
  width: 100%;
  overflow: visible
}

.auth-modal::backdrop {
  background: rgba(16, 20, 18, .5);
  backdrop-filter: blur(3px)
}

.auth-toast {
  position: absolute;
  z-index: 1;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  box-sizing: border-box;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 10px 18px;
  border-radius: 14px;
  background: #1a1a1a;
  color: #fff;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  overflow-wrap: anywhere;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
  pointer-events: none;
}

.auth-modal-inner {
  position: relative;
  background: #fff;
  border-radius: 20px;
  padding: 26px 28px 24px;
  box-shadow: 0 24px 64px rgba(16, 24, 20, .22)
}

.auth-close {
  position: absolute;
  top: -13px;
  right: -13px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 0;
  background: #fff;
  color: #646464;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(16, 24, 20, .18);
  transition: background .25s, color .25s
}

.auth-close:hover {
  background: #e8ecea;
  color: #1a1a1a
}

.auth-tabs {
  display: flex;
  gap: 8px;
  background: #f3f5f4;
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 20px
}

.auth-tabs button {
  flex: 1;
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 9px 0;
  font-size: 14px;
  font-weight: 600;
  color: #646464;
  cursor: pointer;
  transition: background .25s, color .25s, box-shadow .25s
}

.auth-tabs button.on {
  background: #fff;
  color: #1a1a1a;
  box-shadow: 0 2px 8px rgba(16, 24, 20, .1)
}

.auth-form .field {
  margin-bottom: 14px
}

.auth-form label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: #3a3f45;
  margin-bottom: 6px
}

.auth-form input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #e3e8e6;
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 14px;
  color: #1a1a1a;
  background: #fafbfa;
  outline: none;
  transition: border-color .25s, background .25s
}

.auth-form input:focus {
  border-color: #22b07c;
  background: #fff
}

.auth-form .rowline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  margin: 0 0 16px
}

.auth-form .remember {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #646464;
  margin: 0
}

.auth-form .remember input {
  width: auto
}

.auth-form .forgot {
  color: #1b9668;
  text-decoration: none
}

.auth-form .btn.submit {
  width: 100%;
  background: #22b07c;
  color: #fff;
  border: 0;
  border-radius: 12px;
  padding: 13px 0;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .25s
}

.auth-form .btn.submit:hover {
  background: #1b9668
}

.auth-form .code-row {
  display: flex;
  gap: 8px;
  align-items: stretch
}

.auth-form .code-row input {
  flex: 1 1 auto;
  min-width: 0;
  width: auto
}

.auth-form .code-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  border: 1px solid #cfe8df;
  background: #f1f9f5;
  color: #1b9668;
  border-radius: 10px;
  padding: 0 14px;
  height: 42px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer
}

.auth-form .code-btn:hover {
  background: #e6f4ee
}

.auth-title {
  font-size: 18px;
  font-weight: 700;
  color: #1a1a1a;
  text-align: center;
  margin-bottom: 20px
}

.auth-form .captcha-img {
  flex: 0 0 auto;
  height: 42px;
  width: 116px;
  border: 1px solid #e3e8e6;
  border-radius: 10px;
  cursor: pointer;
  background: #fafbfa;
  object-fit: cover
}

.auth-form .switch {
  text-align: center;
  font-size: 12.5px;
  color: #646464;
  margin: 14px 0 0
}

.auth-form .switch a {
  color: #1b9668;
  font-weight: 500;
  text-decoration: none
}

.auth-form .terms {
  text-align: center;
  font-size: 11.5px;
  color: #a3a3a3;
  margin: 12px 0 0
}

/* 官方控制台内嵌层（与原 login.html 一致） */
.ext-login {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(10, 14, 12, .55);
  display: flex;
  flex-direction: column;
  padding: 18px
}

.ext-login[hidden] {
  display: none
}

.ext-login-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: #fff;
  border-radius: 14px 14px 0 0;
  padding: 12px 18px;
  font-size: 13px;
  color: #1a1a1a;
  font-weight: 500
}

.ext-login-bar .ext-acts {
  display: flex;
  gap: 8px;
  flex: 0 0 auto
}

.ext-login-bar .btn {
  padding: 8px 16px;
  font-size: 12.5px
}

.ext-login iframe {
  flex: 1;
  width: 100%;
  border: 0;
  background: #fff;
  border-radius: 0 0 14px 14px
}

@media(max-width:480px) {
  .auth-modal-inner {
    padding: 22px 20px 20px
  }

  .ext-login {
    padding: 8px
  }

  .ext-login-bar {
    font-size: 12px;
    flex-wrap: wrap
  }
}

@media (max-height: 540px) {
  .auth-modal {
    max-height: calc(100% - 32px);
    overflow-y: auto;
  }

  .auth-toast {
    position: static;
    margin: 12px auto 0;
    transform: none;
  }

  .auth-close {
    top: 8px;
    right: 8px;
  }
}
