:root {
  color-scheme: light;
  font-family: Roboto, "Noto Sans SC", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-synthesis: none;
  --page-background: #f0f0f2;
  --text-primary: #111216;
  --text-secondary: #898990;
  --link: #1459bd;
  --button: #75c3f9;
  --button-ready: #0099ff;
  --panel-width: min(76%, 410px);
  /* 修改这个值即可调节输入光标粗细，例如 3px 会更粗。 */
  --caret-width: 2px;
  --caret-height: 21px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 280px;
  min-height: 100%;
  margin: 0;
}

body {
  overflow-x: hidden;
  background: var(--page-background);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button,
input {
  font: inherit;
}

.login-page {
  position: relative;
  isolation: isolate;
  min-height: calc(100vh - 42px);
  min-height: calc(100svh - 42px);
  overflow: hidden;
  background: var(--page-background);
}
.login-filing-footer {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  color: #697180;
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
}
.login-filing-footer a { color: inherit; text-decoration: none; }
.login-filing-footer img { display: inline-block; width: 14px; height: 14px; margin-right: 4px; vertical-align: -2px; object-fit: contain; }

.aurora {
  position: absolute;
  z-index: -1;
  inset: 0 0 auto;
  height: min(60vh, 520px);
  height: min(60svh, 520px);
  background:
    radial-gradient(ellipse 54% 74% at 39% 32%, rgba(211, 215, 255, 0.78) 0%, rgba(218, 220, 250, 0.54) 40%, rgba(229, 229, 245, 0.17) 72%, transparent 100%),
    radial-gradient(ellipse 45% 68% at 72% 34%, rgba(213, 238, 251, 0.86) 0%, rgba(220, 235, 248, 0.55) 42%, rgba(232, 234, 243, 0.15) 76%, transparent 100%),
    linear-gradient(180deg, #eceef4 0%, #e8eaf4 43%, #efeff2 88%, #f0f0f2 100%);
}

.login-panel {
  width: 100%;
  padding-top: clamp(62px, 10.42svh, 94px);
}

h1 {
  margin: 0 auto;
  color: var(--text-primary);
  font-size: clamp(21px, 5.84vw, 32px);
  font-weight: 400;
  line-height: 1.38;
  text-align: center;
  letter-spacing: 0;
}

#login-form {
  width: var(--panel-width);
  margin: clamp(28px, 4.93svh, 44px) auto 0;
}

.fields {
  display: grid;
  gap: clamp(17px, 2.86svh, 23px);
}

.input-wrap {
  position: relative;
  width: 100%;
  height: clamp(54px, 8.39svh, 66px);
}

.fields input {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0 clamp(18px, 6%, 30px);
  border: 0;
  border-radius: clamp(12px, 3.24vw, 17px);
  outline: 0;
  background: #fff;
  box-shadow: 0 10px 25px rgba(102, 115, 145, 0.018);
  color: #25262a;
  caret-color: transparent;
  font-size: clamp(16px, 4.45vw, 20px);
  font-weight: 400;
  line-height: normal;
  text-align: center;
  transition: box-shadow 160ms ease;
  appearance: none;
  -webkit-appearance: none;
}

.fields input::placeholder {
  color: #d1d1d3;
  opacity: 1;
  transition: opacity 0s;
}

.fields input:focus::placeholder {
  opacity: 0;
}

.fields input:focus {
  box-shadow: 0 0 0 1px rgba(0, 153, 255, 0.16), 0 12px 28px rgba(75, 110, 152, 0.045);
}

.custom-caret {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  display: none;
  width: var(--caret-width);
  height: var(--caret-height);
  background: #0099ff;
  pointer-events: none;
  transform: translateY(-50%);
}

.input-wrap.caret-visible .custom-caret {
  display: block;
  animation: caret-blink 1s steps(1, end) infinite;
}

.password-toggle {
  position: absolute;
  z-index: 4;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: clamp(43px, 12.04vw, 52px);
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #a4a4a7;
  opacity: 0;
  cursor: pointer;
  pointer-events: none;
  transition: opacity 80ms linear;
  -webkit-tap-highlight-color: transparent;
  appearance: none;
  -webkit-appearance: none;
}

.password-wrap:focus-within .password-toggle {
  opacity: 1;
  pointer-events: auto;
}

.password-toggle:focus-visible {
  border-radius: 50%;
  outline: 2px solid rgba(0, 153, 255, 0.25);
  outline-offset: -8px;
}

.eye-icon {
  width: clamp(16px, 4.55vw, 19px);
  height: clamp(16px, 4.55vw, 19px);
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.eye-open {
  display: none;
}

.password-toggle.showing-password .eye-closed {
  display: none;
}

.password-toggle.showing-password .eye-open {
  display: block;
}

@keyframes caret-blink {
  0%,
  48% {
    opacity: 1;
  }

  49%,
  100% {
    opacity: 0;
  }
}

.recover-link {
  display: block;
  width: max-content;
  margin-top: clamp(17px, 2.76svh, 24px);
  color: var(--link);
  font-size: clamp(13px, 3.71vw, 17px);
  font-weight: 400;
  line-height: 1.7;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.login-button {
  display: block;
  width: 100%;
  height: clamp(43px, 6.78svh, 56px);
  margin-top: clamp(19px, 3.09svh, 27px);
  padding: 0;
  border: 0;
  border-radius: clamp(12px, 3.24vw, 17px);
  background: var(--button);
  color: rgba(255, 255, 255, 0.51);
  font-size: clamp(16px, 4.45vw, 21px);
  font-weight: 400;
  line-height: 1;
  text-align: center;
  cursor: default;
  transition: background-color 160ms ease, color 160ms ease, transform 100ms ease;
  appearance: none;
  -webkit-appearance: none;
}

.login-button:not(:disabled) {
  background: var(--button-ready);
  color: #fff;
  cursor: pointer;
}

.login-button:not(:disabled):active {
  transform: scale(0.992);
}

.agreement {
  display: flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  max-width: calc(100vw - 24px);
  margin: clamp(15px, 2.35svh, 20px) auto 0;
  color: var(--text-secondary);
  font-size: clamp(12px, 3.52vw, 16px);
  font-weight: 400;
  line-height: 1.45;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.agreement > input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.checkmark {
  position: relative;
  flex: 0 0 auto;
  width: clamp(14px, 3.98vw, 18px);
  height: clamp(14px, 3.98vw, 18px);
  margin-right: clamp(5px, 1.2vw, 7px);
  border: 1px solid #c8c8ca;
  border-radius: 50%;
  background: transparent;
}

.agreement > input:focus-visible + .checkmark {
  outline: 2px solid rgba(0, 153, 255, 0.28);
  outline-offset: 2px;
}

.agreement > input:checked + .checkmark {
  border-color: #0099ff;
  background: #0099ff;
}

.agreement > input:checked + .checkmark::after {
  position: absolute;
  top: 21%;
  left: 34%;
  width: 24%;
  height: 43%;
  border: solid #fff;
  border-width: 0 1.5px 1.5px 0;
  content: "";
  transform: rotate(45deg);
}

.agreement-text a {
  color: var(--link);
  text-decoration: none;
}

.policy-link {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--link);
  cursor: pointer;
}

.login-error {
  margin: 14px 0 -4px;
  padding: 10px 13px;
  border: 1px solid rgba(211, 78, 92, 0.28);
  border-radius: 12px;
  background: rgba(255, 241, 243, 0.8);
  color: #b42335;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

.policy-dialog {
  width: min(520px, calc(100% - 28px));
  max-height: min(720px, calc(100svh - 28px));
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: #fff;
  color: var(--text-primary);
  box-shadow: 0 28px 90px rgba(54, 62, 88, 0.24);
}

.policy-dialog::backdrop {
  background: rgba(35, 39, 51, 0.32);
  backdrop-filter: blur(4px);
}

.policy-dialog article {
  display: grid;
  max-height: inherit;
}

.policy-dialog header,
.policy-dialog footer {
  display: flex;
  align-items: center;
  padding: 16px 20px;
}

.policy-dialog header {
  justify-content: space-between;
  border-bottom: 1px solid #ececf0;
}

.policy-dialog h2 {
  margin: 0;
  font-size: 19px;
}

.policy-dialog header button,
.policy-dialog footer button {
  border: 0;
  background: transparent;
  color: #59616f;
  cursor: pointer;
}

.policy-dialog header button {
  width: 34px;
  height: 34px;
  font-size: 24px;
}

.policy-dialog footer {
  justify-content: flex-end;
  border-top: 1px solid #ececf0;
}

.policy-dialog footer button {
  min-width: 92px;
  min-height: 38px;
  border-radius: 10px;
  background: var(--button-ready);
  color: #fff;
}

#policy-content {
  overflow: auto;
  padding: 18px 20px;
  color: #59616f;
  font-size: 14px;
  line-height: 1.7;
}

#policy-content h3 {
  margin: 18px 0 6px;
  color: #25262a;
  font-size: 15px;
}

#policy-content h3:first-child { margin-top: 0; }
#policy-content p { margin: 0 0 10px; }

.toast {
  position: fixed;
  z-index: 10;
  bottom: max(28px, env(safe-area-inset-bottom));
  left: 50%;
  max-width: calc(100% - 40px);
  padding: 9px 14px;
  border-radius: 7px;
  background: rgba(24, 24, 28, 0.84);
  color: #fff;
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity 180ms ease, transform 180ms ease;
}

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

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (min-width: 700px) {
  :root {
    --panel-width: min(410px, calc(100% - 64px));
  }

  .aurora {
    height: min(68vh, 610px);
    height: min(68svh, 610px);
    background:
      radial-gradient(ellipse 31% 75% at 44% 30%, rgba(211, 215, 255, 0.76) 0%, rgba(219, 221, 249, 0.44) 48%, transparent 100%),
      radial-gradient(ellipse 28% 70% at 60% 34%, rgba(213, 239, 251, 0.83) 0%, rgba(220, 235, 248, 0.42) 47%, transparent 100%),
      linear-gradient(180deg, #eceef4 0%, #e9eaf4 46%, #efeff2 90%, #f0f0f2 100%);
  }
}

@media (max-height: 540px) and (orientation: landscape) {
  .login-page {
    min-height: 520px;
    overflow-y: auto;
  }

  .login-panel {
    padding-top: 42px;
  }

  #login-form {
    margin-top: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
