:root {
  --brand: #2c3e50;
  --brand-dark: #1f2d3d;
  --brand-soft: #edf1f5;
  --ink: #17202b;
  --muted: #7c8794;
  --line: #e5e9ef;
  --danger: #c63f4b;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 10% 8%, rgba(44, 62, 80, .12), transparent 30%),
    radial-gradient(circle at 92% 80%, rgba(38, 194, 165, .12), transparent 32%),
    linear-gradient(145deg, #eef3f7 0%, #f8fbfc 58%, #edf4f2 100%);
}

button, input { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.login-page {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 18px;
}

.back-button {
  position: fixed;
  top: 22px;
  left: 24px;
  width: 42px;
  height: 42px;
  padding: 0 0 4px;
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 50%;
  color: var(--brand);
  background: rgba(255,255,255,.72);
  box-shadow: 0 8px 26px rgba(35, 50, 66, .10);
  font-size: 32px;
  line-height: 1;
  backdrop-filter: blur(10px);
}

.login-card {
  width: min(440px, 100%);
  padding: 30px 34px 22px;
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 30px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 28px 70px rgba(35, 50, 66, .13), 0 4px 18px rgba(35, 50, 66, .05);
}

.brand-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 56px;
}

.brand-logo {
  width: 54px;
  height: 54px;
  object-fit: contain;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(35, 50, 66, .10);
}

.brand-head h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 750;
  letter-spacing: .02em;
}

.brand-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.login-copy { margin: 28px 0 20px; }

.login-copy h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: -.03em;
}

.login-copy p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.alert {
  margin-bottom: 14px;
  padding: 11px 13px;
  border-left: 3px solid var(--danger);
  border-radius: 10px;
  color: #a02f3a;
  background: #fff2f3;
  font-size: 13px;
  line-height: 1.5;
}

.alert:empty { display: none; }

.input-shell {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 54px;
  margin: 12px 0;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: #f5f7fa;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.input-shell:focus-within {
  border-color: color-mix(in srgb, var(--brand) 52%, white);
  background: #fff;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 10%, transparent);
}

.input-prefix, .input-icon {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.input-icon { width: 18px; text-align: center; color: var(--brand); }

.input-shell input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 15px;
}

.input-shell input::placeholder { color: #a5adb8; }

.text-button {
  flex: 0 0 auto;
  padding: 3px 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
}

.text-button:hover { color: var(--brand); }

.helper-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 2px 16px;
  font-size: 12px;
}

.remember {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--brand);
}

.agreement {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 2px 2px 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.agreement input { margin-top: 2px; }

.agreement-link {
  padding: 0;
  border: 0;
  color: var(--brand);
  background: transparent;
  font-size: inherit;
}

.primary-button {
  width: 100%;
  min-height: 54px;
  border: 0;
  border-radius: 17px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 78%, #4f718e));
  box-shadow: 0 13px 25px color-mix(in srgb, var(--brand) 22%, transparent);
  font-size: 16px;
  font-weight: 750;
  letter-spacing: .04em;
  transition: transform .15s ease, filter .15s ease, opacity .15s ease;
}

.primary-button:hover { filter: brightness(1.04); }
.primary-button:active { transform: translateY(1px); }
.primary-button:disabled { cursor: wait; opacity: .6; }

.other-login { margin-top: 26px; }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #9ca5af;
  font-size: 12px;
}

.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.method-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
}

.method-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: #45515f;
  background: #fff;
  font-size: 13px;
  transition: border-color .16s ease, background .16s ease;
}

.method-button:hover { border-color: color-mix(in srgb, var(--brand) 34%, white); background: #f9fbfc; }

.method-mark {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.sms-mark { background: var(--brand); }
.wechat-mark { background: #07c160; }

.wechat-note {
  margin: 12px 0 0;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.login-footer {
  min-height: 20px;
  margin-top: 24px;
  color: #a2aab4;
  text-align: center;
  font-size: 11px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(20, 29, 39, .48);
  backdrop-filter: blur(4px);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(430px, 100%);
  max-height: min(720px, calc(100vh - 36px));
  padding: 28px 26px 24px;
  overflow: auto;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 28px 70px rgba(17, 26, 36, .22);
}

.modal-card h3 {
  margin: 0 36px 6px 0;
  font-size: 21px;
}

.modal-tip {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  color: #7e8791;
  background: #f1f3f6;
  font-size: 21px;
  line-height: 1;
}

.compact { min-height: 46px; margin-top: 12px; }

.doc-card { width: min(520px, 100%); }

.doc-content {
  margin-top: 16px;
  color: #4e5966;
  font-size: 13px;
  line-height: 1.85;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 38px;
  z-index: 40;
  max-width: min(460px, calc(100vw - 36px));
  padding: 11px 16px;
  border-radius: 12px;
  color: #fff;
  background: rgba(28, 37, 48, .92);
  box-shadow: 0 12px 32px rgba(0,0,0,.18);
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
  transform: translate(-50%, 18px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

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

@media (max-width: 520px) {
  .login-page { align-items: flex-start; padding: 68px 14px 24px; }
  .login-card { padding: 24px 22px 18px; border-radius: 24px; }
  .back-button { top: 14px; left: 14px; }
  .login-copy h2 { font-size: 27px; }
}
