:root {
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", Arial, sans-serif;
  color: #22374a;
  background: #edf3f8;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: hidden;
  background: #edf3f8 url("/static/redhub-login-bg.png") center center / cover no-repeat fixed;
}

button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }

.login-stage {
  display: grid;
  place-items: center;
  flex: 1 0 auto;
  width: 100%;
  min-height: 0;
  padding: 64px 24px 16px;
}

.login-card {
  display: flex;
  flex-direction: column;
  width: min(486px, 100%);
  min-height: 656px;
  padding: 72px 45px 62px;
  background: rgba(255, 255, 255, .98);
  border: 1px solid rgba(232, 237, 244, .92);
  border-radius: 12px;
  box-shadow: 0 20px 55px rgba(47, 72, 103, .12), 0 4px 14px rgba(47, 72, 103, .04);
}

.brand-title {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: baseline;
  gap: 12px;
  margin: 0;
  color: #0b103b;
  white-space: nowrap;
  line-height: 1.35;
}

.brand-chinese { font-size: 36px; font-weight: 750; letter-spacing: -.025em; }
.brand-english { font-size: 32px; font-weight: 700; letter-spacing: -.025em; }

.login-form { margin-top: 60px; }
.login-fields { display: grid; gap: 28px; min-width: 0; margin: 0; padding: 0; border: 0; }
.form-field { display: grid; gap: 10px; }
.form-field label { font-size: 16px; line-height: 20px; font-weight: 600; color: #182044; }
.form-field input {
  display: block;
  width: 100%;
  min-width: 0;
  height: 52px;
  padding: 0 15px;
  border: 1px solid #dce4ee;
  border-radius: 6px;
  outline: none;
  background: #fff;
  color: #23394f;
  font-size: 15px;
  line-height: normal;
  transition: border-color .15s, box-shadow .15s;
}
.form-field input::placeholder { color: #a0adbc; opacity: 1; }
.form-field input:focus { border-color: #518be5; box-shadow: 0 0 0 3px rgba(61, 121, 219, .12); }
.form-field input:disabled { opacity: .72; cursor: wait; }
.password-field { position: relative; }
.password-field input { padding-right: 51px; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 5px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #91a0b2;
  transform: translateY(-50%);
}
.password-toggle:hover { color: #366fc4; background: #f1f6fd; }
.password-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.password-toggle:focus-visible, .retry-button:focus-visible, .site-footer a:focus-visible { outline: 3px solid rgba(56, 120, 220, .45); outline-offset: 3px; }

.login-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 54px;
  margin-top: 6px;
  padding: 12px 16px;
  border: 1px solid #1674ff;
  border-radius: 6px;
  background: #1674ff;
  box-shadow: 0 5px 13px rgba(57, 121, 220, .19);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .12em;
  line-height: 23px;
  transition: background .15s, box-shadow .15s;
}
.login-button:hover:not(:disabled) { background: #2d6ece; box-shadow: 0 6px 16px rgba(57, 121, 220, .25); }
.login-button:active:not(:disabled) { background: #2764bd; }
.login-button:focus-visible { outline: 3px solid rgba(56, 120, 220, .4); outline-offset: 4px; }
.login-button:disabled { opacity: .7; cursor: wait; }
.button-spinner { width: 17px; height: 17px; border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.login-help { margin: 20px 0 0; text-align: center; font-size: 13px; line-height: 20px; color: #8a98a9; }
.login-message { margin: 16px 0 0; text-align: center; font-size: 13px; line-height: 1.65; color: #7d8da0; }
.login-message p { margin: 0; overflow-wrap: anywhere; }
.login-message.is-error { color: #b34747; }
.retry-button { margin-top: 7px; padding: 2px 5px; border: 0; border-radius: 3px; background: transparent; color: #3979dc; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.retry-button:hover { color: #245cae; }
.retry-button:disabled { opacity: .65; cursor: wait; }
.noscript-message { color: #b34747; text-align: center; font-size: 13px; line-height: 1.6; }
.card-tagline { display: flex; align-items: center; gap: 12px; margin: auto 0 0; padding-top: 35px; text-align: center; white-space: nowrap; font-size: 13px; line-height: 20px; letter-spacing: .06em; color: #97a5b5; }
.card-tagline::before, .card-tagline::after { content: ""; flex: 1; height: 1px; background: #dce3ee; }

.site-footer { display: flex; flex: none; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 22px; min-height: 64px; padding: 16px 20px 22px; color: #76889a; font-size: 12px; line-height: 22px; text-align: center; }
.site-footer a { color: inherit; text-decoration: none; white-space: nowrap; }
.site-footer .police-record { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.site-footer .police-record img { display: block; flex: none; width: auto; height: 20px; object-fit: contain; }
.site-footer a:hover { color: #346ab2; text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 520px) {
  .login-stage { padding: 30px 20px 18px; }
  .login-card { min-height: 560px; padding: 38px 28px 29px; border-radius: 17px; }
  .brand-title { gap: 10px; }
  .brand-chinese { font-size: 29px; }
  .brand-english { font-size: 22px; }
  .login-form { margin-top: 43px; }
  .form-field input { font-size: 16px; }
  .site-footer { padding-right: 14px; padding-left: 14px; }
}

@media (max-width: 350px) {
  .login-stage { padding-right: 14px; padding-left: 14px; }
  .login-card { padding-right: 22px; padding-left: 22px; }
  .brand-chinese { font-size: 25px; }
  .brand-english { font-size: 20px; }
  .brand-title { gap: 8px; }

}

@media (max-height: 800px) and (min-width: 521px) {
  .login-stage { padding-top: 24px; padding-bottom: 14px; }
  .login-card { width: min(440px, 100%); min-height: 560px; padding: 40px 40px 34px; }
  .brand-chinese { font-size: 32px; }
  .brand-english { font-size: 28px; }
  .login-form { margin-top: 36px; }
  .login-fields { gap: 20px; }
  .form-field { gap: 8px; }
  .form-field label { font-size: 14px; }
  .form-field input { height: 46px; }
  .login-button { min-height: 48px; margin-top: 4px; }
  .login-help { margin-top: 16px; }
  .card-tagline { padding-top: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  .button-spinner { animation-duration: 1.5s; }
}

@media (max-width: 560px) { .site-footer { flex-direction: column; gap: 8px; } }
