:root {
  color-scheme: light;
  --brand: #0b3158;
  --ink: #132b43;
  --muted: #586b7e;
  --control-line: #9aaabc;
  --focus: #226eb7;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  display: flex;
  flex-direction: column;
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: radial-gradient(ellipse at 15% 12%, #e2ebf4, transparent 60%), #f1f4f7;
  color: var(--ink);
  line-height: 1.5;
}
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.site-header {
  flex: none;
  padding: max(14px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 14px max(20px, env(safe-area-inset-left));
  border-bottom: 3px solid #c9433f;
  background: linear-gradient(112deg, #09294c, #103d67 65%, #185681);
  color: white;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 1240px;
  margin: 0 auto;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid #ffffff42;
  border-radius: 12px;
  background: #ffffff14;
  font: 700 24px/1 "FangSong", "STFangsong", serif;
}
.brand-copy strong, .brand-copy span { display: block; }
.brand-copy strong { font-size: 17px; font-weight: 600; letter-spacing: .04em; }
.brand-copy span { color: #cfdeed; font-size: 12px; letter-spacing: .06em; }

main {
  flex: 1;
  display: grid;
  align-content: start;
  justify-items: center;
  padding: clamp(22px, 5vh, 42px) max(14px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
}
.login-panel {
  width: 100%;
  max-width: 440px;
  padding: clamp(22px, 6vw, 38px);
  background: #fff;
  border: 1px solid #dbe3eb;
  border-radius: 18px;
  box-shadow: 0 12px 42px #193a580e;
}
h1 { margin: 0; font-size: clamp(26px, 4vw, 30px); line-height: 1.3; font-weight: 650; }
.intro { margin: 8px 0 26px; color: var(--muted); font-size: 14px; }
form { display: grid; gap: 19px; }
.field { display: grid; gap: 7px; }
label { font-size: 15px; font-weight: 600; }
input {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  border: 1px solid var(--control-line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 10px 13px;
  font-size: 16px;
}
input::placeholder { color: #66778a; font-size: 15px; }
input:focus { outline: 2px solid var(--focus); outline-offset: 1px; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 60px; }
#togglePassword {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 52px;
  min-height: 44px;
  padding: 0 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #295b87;
  font-size: 14px;
}
#togglePassword .hide-label, #togglePassword[aria-pressed="true"] .show-label { display: none; }
#togglePassword[aria-pressed="true"] .hide-label { display: inline; }
.captcha-label, .captcha-row { display: flex; align-items: center; gap: 8px; }
.captcha-label { justify-content: space-between; }
.captcha-label span { font-size: 12px; color: var(--muted); }
.captcha-row input { flex: 1; }
#refreshCaptcha {
  display: grid;
  place-items: center;
  min-width: 0;
  width: 38%;
  max-width: 124px;
  height: 48px;
  border: 1px solid var(--control-line);
  border-radius: 8px;
  background: #f4f7fa;
  padding: 2px;
}
#captchaImage { display: block; width: 100%; height: 42px; object-fit: contain; }
#loginStatus { margin: 0; font-size: 14px; overflow-wrap: anywhere; color: var(--muted); }
#loginStatus:empty { display: none; }
#loginStatus[data-kind="error"] { color: #a53232; }
.retry { justify-self: start; min-height: 44px; padding: 0 12px; background: #fff; color: var(--brand); border: 1px solid var(--control-line); border-radius: 8px; }
#submitLogin {
  width: 100%;
  min-height: 48px;
  margin-top: 4px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #fff;
  background: var(--brand);
  font-size: 16px;
  font-weight: 600;
}
#submitLogin:hover:not(:disabled) { background: #164b78; }
#submitLogin:disabled { background: #e0e7ee; color: #526477; }
noscript p { margin: 0; color: #a53232; font-size: 14px; }

@media (min-width: 640px) {
  .site-header { padding: 17px 28px; }
  main { padding-top: clamp(40px, 10vh, 110px); }
  .intro { margin-bottom: 30px; }
}
