*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", -apple-system, BlinkMacSystemFont, sans-serif;
  color: #1f2937;
  min-height: 100vh;
  overflow-x: hidden;
}

.login-shell {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* ── 左侧品牌区 ── */
.login-hero {
  position: relative;
  flex: 1 1 58%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 56px 80px 160px;
  color: #fff;
  background: linear-gradient(145deg, #071428 0%, #0c2347 45%, #0a1a35 100%);
  overflow: hidden;
}

.login-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 80%, rgba(30, 90, 180, .35) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 70% 20%, rgba(20, 60, 140, .25) 0%, transparent 55%);
  pointer-events: none;
}

.login-hero__waves {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .55;
}

.login-hero__waves svg {
  position: absolute;
  width: 100%;
  height: 100%;
}

.login-hero__content {
  position: relative;
  z-index: 1;
  max-width: 520px;
  margin-left: 72px;
}

.login-hero__title {
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: .02em;
  margin-bottom: 20px;
}

.login-hero__subtitle {
  font-size: clamp(18px, 2.2vw, 26px);
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 16px;
  opacity: .95;
}

.login-hero__desc {
  font-size: 15px;
  line-height: 1.7;
  color: rgba(255, 255, 255, .72);
}

.login-copy {
  position: absolute;
  left: 160px;
  bottom: 28px;
  z-index: 2;
  font-size: 13px;
  color: rgba(255, 255, 255, .45);
}

/* ── 右侧表单区 ── */
.login-panel {
  flex: 0 0 42%;
  min-width: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
  background: linear-gradient(160deg, #0a1830 0%, #0d2040 100%);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 20px;
  padding: 40px 36px 32px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35), 0 0 0 1px rgba(255, 255, 255, .06);
}

.login-card__head {
  text-align: center;
  margin-bottom: 28px;
}

.login-card__title {
  font-size: 22px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 6px;
}

.login-card__hint {
  font-size: 13px;
  color: #9ca3af;
}

.login-tip {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #c2410c;
  font-size: 13px;
  line-height: 1.5;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 14px;
  text-align: center;
}

.login-tip--error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}

.login-tip[hidden] {
  display: none;
}

.login-field.is-invalid input {
  border-color: #fca5a5;
  box-shadow: 0 0 0 3px rgba(252, 165, 165, .25);
}

.login-fingerprint.is-warn .login-fingerprint__circle {
  animation: loginShake .45s ease;
  box-shadow: inset 0 0 0 2px #fca5a5;
}

.login-fingerprint.is-warn .login-fingerprint__label {
  color: #ea580c;
}

@keyframes loginShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

.login-alert {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  font-size: 13px;
  line-height: 1.5;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.login-field {
  margin-bottom: 18px;
}

.login-field label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 8px;
}

.login-input-wrap {
  position: relative;
}

.login-input-wrap input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 15px;
  color: #111827;
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
}

.login-input-wrap input::placeholder {
  color: #c4c9d4;
}

.login-input-wrap input:focus {
  outline: none;
  border-color: #1e3a5f;
  box-shadow: 0 0 0 3px rgba(30, 58, 95, .12);
}

.login-input-wrap--pwd input {
  padding-right: 44px;
}

.login-captcha-row {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.login-input-wrap--captcha {
  flex: 1;
  min-width: 0;
}

.login-captcha-img {
  width: 120px;
  height: 46px;
  flex: 0 0 120px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f8fafc;
  cursor: pointer;
  object-fit: cover;
  transition: border-color .2s, box-shadow .2s;
}

.login-captcha-img:hover {
  border-color: #cbd5e1;
}

.login-field.is-invalid .login-captcha-img {
  border-color: #fca5a5;
}

.login-pwd-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #9ca3af;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.login-pwd-toggle:hover {
  color: #4b5563;
  background: #f3f4f6;
}

.login-pwd-toggle svg {
  width: 20px;
  height: 20px;
}

.login-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  gap: 12px;
}

.login-row--verify-only {
  justify-content: flex-end;
}

.login-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #6b7280;
  cursor: pointer;
  user-select: none;
}

.login-remember input {
  width: 16px;
  height: 16px;
  accent-color: #1e3a5f;
  cursor: pointer;
}

.login-fingerprint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  min-width: 56px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.login-fingerprint__circle {
  position: relative;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #f8fafc;
  box-shadow: inset 0 0 0 1px #e5e7eb;
  transition: background .2s, box-shadow .2s;
}

.login-fingerprint:hover .login-fingerprint__circle {
  background: #f1f5f9;
  box-shadow: inset 0 0 0 1px #cbd5e1;
}

.login-fingerprint__ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.login-fingerprint__track {
  fill: none;
  stroke: #e5e7eb;
  stroke-width: 2.5;
}

.login-fingerprint__bar {
  fill: none;
  stroke: #2563eb;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 150.8;
  stroke-dashoffset: 150.8;
}

.login-fingerprint__icon {
  width: 26px;
  height: 26px;
  color: #64748b;
  transition: color .2s, transform .15s, opacity .2s;
}

.login-fingerprint__check {
  position: absolute;
  width: 22px;
  height: 22px;
  color: #059669;
  display: none;
}

.login-fingerprint__label {
  font-size: 11px;
  color: #6b7280;
  line-height: 1.2;
  white-space: nowrap;
}

.login-fingerprint.is-holding .login-fingerprint__circle {
  background: #eff6ff;
  box-shadow: inset 0 0 0 1px #bfdbfe;
}

.login-fingerprint.is-holding .login-fingerprint__icon {
  color: #2563eb;
  transform: scale(0.92);
}

.login-fingerprint.is-holding .login-fingerprint__label {
  color: #2563eb;
}

.login-fingerprint.is-done {
  cursor: default;
  pointer-events: none;
}

.login-fingerprint.is-done .login-fingerprint__circle {
  background: #ecfdf5;
  box-shadow: inset 0 0 0 1px #a7f3d0;
}

.login-fingerprint.is-done .login-fingerprint__bar {
  stroke: #059669;
  stroke-dashoffset: 0;
}

.login-fingerprint.is-done .login-fingerprint__icon {
  opacity: 0;
}

.login-fingerprint.is-done .login-fingerprint__check {
  display: block;
}

.login-fingerprint.is-done .login-fingerprint__label {
  color: #059669;
}

.login-submit {
  display: block;
  width: 100%;
  height: 48px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #0f2744 0%, #1a3d6b 100%);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .08em;
  cursor: pointer;
  transition: opacity .2s, transform .15s, box-shadow .2s;
  box-shadow: 0 4px 14px rgba(15, 39, 68, .35);
}

.login-submit:hover:not(:disabled) {
  box-shadow: 0 6px 20px rgba(15, 39, 68, .45);
  transform: translateY(-1px);
}

.login-submit:active:not(:disabled) {
  transform: translateY(0);
}

.login-submit.is-locked {
  opacity: .55;
  cursor: not-allowed;
}

.login-submit.is-locked:hover {
  box-shadow: 0 4px 14px rgba(15, 39, 68, .35);
  transform: none;
}

.login-submit:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.login-card__foot {
  margin-top: 20px;
  text-align: center;
}

.login-security-tip {
  font-size: 13px;
  color: #2563eb;
  margin-bottom: 10px;
  line-height: 1.5;
}

.login-agreement {
  font-size: 12px;
  color: #9ca3af;
  line-height: 1.6;
}

.login-agreement a {
  color: #2563eb;
  text-decoration: none;
}

.login-agreement a:hover {
  text-decoration: underline;
}

/* ── 响应式 ── */
@media (max-width: 900px) {
  .login-shell {
    flex-direction: column;
  }

  .login-hero {
    flex: none;
    min-height: auto;
    padding: 36px 24px 24px;
  }

  .login-hero__content {
    margin-left: 0;
  }

  .login-copy {
    position: static;
    order: 3;
    flex-shrink: 0;
    text-align: center;
    padding: 12px 24px 20px;
    background: #0a1830;
  }

  .login-panel {
    flex: 1;
    min-width: 0;
    padding: 16px 16px 24px;
    background: #0a1830;
  }

  .login-card {
    padding: 32px 24px 28px;
  }
}

@media (max-width: 420px) {
  .login-row {
    flex-wrap: wrap;
  }
}


/* 登录协议弹窗 */
body.login-agree-open { overflow: hidden; }
.login-agree-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-agree-modal[hidden] { display: none !important; }
.login-agree-modal__mask {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}
.login-agree-modal__panel {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  max-height: min(78vh, 640px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
  overflow: hidden;
}
.login-agree-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #e5e7eb;
}
.login-agree-modal__head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #111827;
}
.login-agree-modal__close {
  border: 0;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  color: #9ca3af;
  cursor: pointer;
  padding: 2px 6px;
}
.login-agree-modal__close:hover { color: #4b5563; }
.login-agree-modal__body {
  padding: 16px 18px;
  overflow: auto;
  font-size: 14px;
  line-height: 1.7;
  color: #374151;
}
.login-agree-modal__body p { margin: 0 0 12px; }
.login-agree-modal__body img { max-width: 100%; height: auto; }
.login-agree-modal__empty { color: #9ca3af; }
.login-agree-modal__foot {
  padding: 12px 16px 16px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: flex-end;
}
.login-agree-modal__btn {
  min-width: 96px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: #2563eb;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.login-agree-modal__btn:hover { background: #1d4ed8; }
