* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif;
  background: #0b1020;
}

/* iOS Safari: 输入字体小于 16px 会触发聚焦自动放大 */
@media (max-width: 768px) {
  input,
  textarea,
  select,
  .el-input__inner,
  .el-textarea__inner {
    font-size: 16px !important;
  }
}

.login-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  width: 100%;
  background: #0b1020;
}

.page-loading {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: radial-gradient(1200px 600px at 50% 20%, rgba(255, 255, 255, 0.06), rgba(11, 16, 32, 0.98));
  color: rgba(255, 255, 255, 0.88);
  transition: opacity 220ms ease, visibility 220ms ease;
}

.page-loading.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.page-loading__spinner {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 3px solid rgba(255, 255, 255, 0.22);
  border-top-color: rgba(255, 255, 255, 0.85);
  animation: login2Spin 0.85s linear infinite;
}

.page-loading__text {
  font-size: 13px;
  letter-spacing: 0.2px;
}

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

@media (prefers-reduced-motion: reduce) {
  .page-loading__spinner { animation: none; }
  .page-loading { transition: none; }
}

.login-content {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  isolation: isolate;
  overflow: hidden;
  /* 铺满视口；默认渐变用 cover；自定义图由 .login2-has-custom-bg 改为 contain */
  min-height: 100vh;
  min-height: 100dvh;
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  /* 默认渐变调暗，避免首屏闪蓝 */
  background-image: var(--login2-bg, linear-gradient(135deg, #121a33, #0b1020));
  display: flex;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  align-items: center;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px))
    max(12px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}

/* 自定义背景：全屏铺满（可能会裁切） */
.login-container.login2-has-custom-bg .login-content {
  background-size: cover;
  background-position: center center;
  background-color: #0b1020;
}

.login-content::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: var(--login2-overlay, linear-gradient(rgba(0, 0, 0, 0.34), rgba(0, 0, 0, 0.4)));
  pointer-events: none;
}

.login-right {
  position: relative;
  z-index: 3;
  margin-top: 0;
  max-height: calc(100dvh - 32px);
  max-height: calc(100vh - 32px);
  overflow: auto;
  backdrop-filter: blur(2px);
  background: var(--login2-card-bg, rgba(16, 22, 40, 0.34));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 40px;
  width: clamp(320px, 38vw, 440px);
  max-width: calc(100vw - 28px);
  color: #fff;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
}

.login-container.tone-light .login-content {
  --login2-overlay: linear-gradient(rgba(0, 0, 0, 0.46), rgba(0, 0, 0, 0.54));
  --login2-card-bg: rgba(14, 20, 38, 0.44);
}

.login-container.tone-dark .login-content {
  --login2-overlay: linear-gradient(rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.2));
  --login2-card-bg: rgba(22, 30, 48, 0.26);
}

.login-container.login2-has-custom-bg.tone-light .login-content {
  --login2-overlay: linear-gradient(rgba(0, 0, 0, 0.34), rgba(0, 0, 0, 0.42));
}

.login-container.login2-has-custom-bg.tone-dark .login-content {
  --login2-overlay: linear-gradient(rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.14));
}

.login-box {
  width: 100%;
}

.login-header {
  text-align: center;
  margin-bottom: 36px;
}

.login-header h2 {
  font-size: 32px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 10px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.login-header p {
  font-size: 14px;
  color: #fff;
}

.login-form .el-form-item {
  margin-bottom: 22px;
}

.login-form .el-form-item__label {
  color: #fff !important;
}

.login-form .el-input__wrapper {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  box-shadow: none;
  height: 40px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 8px;
}

.login-form .el-input__inner {
  color: #fff;
}

.login-form .el-input__inner::placeholder {
  color: rgba(255, 255, 255, 0.75);
}

.login-button {
  margin: 10px auto 0;
  display: block;
  width: 100%;
  height: 44px;
  font-size: 16px;
  font-weight: 500;
  border-radius: 8px;
  border: none;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.45);
  transition: all 0.3s;
}

.login-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.55);
}

@media (max-width: 768px) {
  .login-content {
    flex-direction: column;
  }

  .login-right {
    width: calc(100vw - 20px);
    margin-top: 0;
    padding: 32px 18px;
  }

  .login-header h2 {
    font-size: 28px;
  }

  .login-button { width: 100%; }
}
