:root {
  color-scheme: light;
  --white: #ffffff;
  --surface: #f6f9fb;
  --surface-strong: #eef5f8;
  --line: #d9e3ea;
  --line-focus: #72c7dc;
  --text: #142033;
  --text-soft: #536476;
  --text-muted: #8190a0;
  --primary: #1597b7;
  --primary-dark: #0b7895;
  --green: #16805a;
  --danger: #cf3756;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}
* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--white);
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: .64;
}

.icon-sprite,
.system-contract {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.lucide {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-stage {
  display: grid;
  min-height: 100vh;
  place-items: center;
  background: var(--white);
}

.panel-frame {
  width: min(100%, 360px);
  min-height: 100vh;
}

.login-panel {
  display: grid;
  align-content: center;
  gap: 12px;
  width: 100%;
  min-height: 100vh;
  padding: 18px 28px 20px;
  background: var(--white);
}

.panel-brand {
  display: flex;
  justify-content: center;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
}

.brand-lockup img {
  display: block;
  width: 28px;
  height: 14px;
  object-fit: contain;
}

.brand-lockup strong {
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}

.account-identity {
  display: grid;
  justify-items: center;
  gap: 9px;
  padding: 3px 0 2px;
  text-align: center;
}

.identity-avatar {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border: 1px solid #dfe8ee;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(38, 72, 92, .09), inset 0 0 0 6px var(--white);
}

.identity-avatar img {
  display: block;
  width: 52px;
  height: auto;
}

.panel-head h1 {
  margin: 0;
  color: var(--text);
  font-size: 21px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0;
}

.panel-head p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.35;
}

.login-form {
  display: grid;
  gap: 9px;
  width: 100%;
  animation: contentIn .34s var(--ease-out) both;
}

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

.field {
  display: block;
}

.field-name {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.field-shell {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  min-height: 43px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  transition: border-color .18s ease, background .18s ease, box-shadow .22s ease;
}

.field-shell:focus-within {
  border-color: var(--line-focus);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(21, 151, 183, .09);
}

.field-icon {
  justify-self: center;
  width: 16px;
  height: 16px;
  color: var(--primary);
}

.field input {
  width: 100%;
  min-width: 0;
  min-height: 41px;
  padding: 0 10px 0 0;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: none;
  font-size: 12px;
  font-weight: 650;
}

.field input::placeholder {
  color: #93a2b1;
  font-weight: 500;
}

.password-wrap {
  grid-template-columns: 40px minmax(0, 1fr) 38px;
}

.password-wrap input {
  padding-right: 2px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 7px;
  color: var(--text-muted);
  background: transparent;
  transition: color .16s ease, background .16s ease;
}

.icon-button:hover,
.icon-button:focus-visible {
  color: var(--primary-dark);
  background: var(--surface-strong);
  outline: none;
}

.icon-button .lucide {
  grid-area: 1 / 1;
  width: 15px;
  height: 15px;
}

.icon-eye-off,
.icon-button.is-visible .icon-eye {
  display: none;
}

.icon-button.is-visible .icon-eye-off {
  display: block;
}

.form-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 18px;
}

.login-meta {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 6px;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 650;
}

.login-meta > .lucide {
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  color: var(--green);
}

.login-meta .kyl-loading-chip {
  min-width: 0;
  font-size: 9px;
}

.forgot-button {
  flex: 0 0 auto;
  padding: 3px 0;
  color: var(--primary-dark);
  background: transparent;
  font-size: 9px;
  font-weight: 700;
}

.forgot-button:hover,
.forgot-button:focus-visible {
  color: var(--text);
  outline: none;
}

.form-message {
  min-height: 14px;
  margin: -5px 0 0;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 9px;
  line-height: 14px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.form-message.error {
  color: var(--danger);
}

.form-message.success {
  color: var(--green);
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  min-width: 0;
  border-radius: 8px;
  font-weight: 800;
  transition: color .18s ease, background .18s ease, border-color .18s ease, transform .2s var(--ease-out), box-shadow .2s ease;
}

.primary-button {
  min-height: 43px;
  padding: 0 14px;
  color: var(--white);
  background: var(--primary);
  box-shadow: 0 11px 24px rgba(21, 151, 183, .18);
  font-size: 12px;
}

.primary-button:hover,
.primary-button:focus-visible {
  background: var(--primary-dark);
  box-shadow: 0 13px 28px rgba(11, 120, 149, .22);
  transform: translateY(-1px);
  outline: none;
}

.secondary-button {
  min-height: 32px;
  padding: 0 12px;
  color: var(--primary-dark);
  background: transparent;
  font-size: 10px;
}

.secondary-button:hover,
.secondary-button:focus-visible {
  color: var(--text);
  background: var(--surface);
  outline: none;
}

.primary-button .lucide,
.secondary-button .lucide {
  width: 14px;
  height: 14px;
}

.button-spinner {
  display: none;
  width: 13px;
  height: 13px;
  border: 2px solid rgba(255, 255, 255, .36);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

.primary-button.is-loading .button-spinner {
  display: inline-block;
}

.signed-in-panel {
  display: grid;
  gap: 14px;
  width: 100%;
  animation: contentIn .34s var(--ease-out) both;
}

.signed-in-panel[hidden] {
  display: none;
}

.signed-in-copy {
  display: grid;
  justify-items: center;
  gap: 7px;
  text-align: center;
}

.signed-in-copy > .lucide {
  width: 30px;
  height: 30px;
  padding: 6px;
  color: var(--green);
  border-radius: 50%;
  background: rgba(22, 128, 90, .08);
}

.signed-in-copy strong,
.signed-in-copy span {
  display: block;
}

.signed-in-copy strong {
  max-width: 280px;
  overflow: hidden;
  color: var(--text);
  font-size: 16px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.signed-in-copy span {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 10px;
}

.signed-in-actions {
  display: grid;
  gap: 7px;
}

body.has-saved-session .panel-head {
  display: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 20;
  max-width: calc(100vw - 32px);
  padding: 9px 13px;
  color: var(--white);
  background: rgba(20, 32, 51, .94);
  border-radius: 8px;
  box-shadow: 0 14px 32px rgba(20, 32, 51, .18);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity .18s ease, transform .24s var(--ease-out);
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
}

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

body.login-success .primary-button {
  background: var(--green);
}

@keyframes contentIn {
  from {
    opacity: 0;
    transform: translateY(7px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 380px) {
  .login-panel {
    padding-inline: 24px;
  }
}

@media (max-height: 430px) {
  body {
    overflow-y: auto;
  }

  .login-panel {
    align-content: start;
    min-height: 430px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
