.login-terminal {
  --login-canvas: #edf4fc;
  --login-canvas-deep: #dbe8f7;
  --login-surface: rgba(255, 255, 255, 0.88);
  --login-line: #a9c3e5;
  --login-line-strong: #5b8fce;
  --login-ink: #102a4b;
  --login-muted: #526f93;
  --login-blue: #126cff;
  --login-blue-deep: #0754d6;
  --login-success: #16866b;
  --login-danger: #c53d4d;
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: 44px minmax(0, 1fr) 34px;
  width: 100%;
  height: 100dvh;
  min-height: 640px;
  overflow: hidden;
  color: var(--login-ink);
  background:
    linear-gradient(132deg, transparent 0 41%, rgba(115, 155, 205, 0.1) 41% 56%, transparent 56% 100%),
    linear-gradient(45deg, rgba(255, 255, 255, 0.62) 0 18%, transparent 18% 100%),
    var(--login-canvas);
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  letter-spacing: 0;
}

.login-terminal,
.login-terminal *,
.login-terminal *::before,
.login-terminal *::after {
  box-sizing: border-box;
}

.login-terminal::before,
.login-terminal::after {
  position: absolute;
  z-index: -1;
  content: "";
  pointer-events: none;
}

.login-terminal::before {
  inset: 0;
  opacity: 0.45;
  background-image:
    linear-gradient(rgba(44, 94, 154, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(44, 94, 154, 0.08) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent);
}

.login-terminal::after {
  top: 0;
  bottom: 0;
  left: -12%;
  width: 18%;
  background: linear-gradient(90deg, transparent, rgba(18, 108, 255, 0.12), transparent);
  transform: skewX(-18deg);
  animation: login-terminal-scan 9s linear infinite;
}

@keyframes login-terminal-scan {
  to {
    left: 112%;
  }
}

.login-terminal__hud {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  height: 44px;
  padding: 0 clamp(18px, 3vw, 52px);
  color: var(--login-muted);
  border-bottom: 1px solid rgba(74, 118, 170, 0.22);
  background: rgba(241, 247, 254, 0.76);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.login-terminal__hud-center {
  display: flex;
  align-items: center;
  gap: 14px;
}

.login-terminal__hud-right {
  justify-self: end;
}

.login-terminal__signal {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--login-success);
}

.login-terminal__signal::before {
  width: 6px;
  height: 6px;
  content: "";
  border: 1px solid currentColor;
  background: currentColor;
  box-shadow: 0 0 0 3px rgba(22, 134, 107, 0.12);
}

.login-terminal__workspace {
  display: grid;
  grid-template-columns: minmax(360px, 0.92fr) minmax(560px, 1.08fr);
  min-height: 0;
  padding: clamp(28px, 4vw, 72px) clamp(24px, 5.6vw, 104px);
}

.login-terminal__brand,
.login-terminal__auth {
  position: relative;
  min-width: 0;
  padding: clamp(24px, 3.7vw, 62px);
}

.login-terminal__brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid rgba(74, 118, 170, 0.28);
}

.login-terminal__brand::before,
.login-terminal__brand::after,
.login-terminal__auth::before,
.login-terminal__auth::after {
  position: absolute;
  width: 28px;
  height: 28px;
  content: "";
  pointer-events: none;
}

.login-terminal__brand::before {
  top: 0;
  left: 0;
  border-top: 1px solid var(--login-line-strong);
  border-left: 1px solid var(--login-line-strong);
}

.login-terminal__brand::after {
  bottom: 0;
  left: 0;
  border-bottom: 1px solid var(--login-line-strong);
  border-left: 1px solid var(--login-line-strong);
}

.login-terminal__auth::before {
  top: 0;
  right: 0;
  border-top: 1px solid var(--login-line-strong);
  border-right: 1px solid var(--login-line-strong);
}

.login-terminal__auth::after {
  right: 0;
  bottom: 0;
  border-right: 1px solid var(--login-line-strong);
  border-bottom: 1px solid var(--login-line-strong);
}

.login-terminal__brand-heading {
  display: flex;
  align-items: center;
  gap: 24px;
}

.login-terminal__logo {
  position: relative;
  width: clamp(104px, 8.5vw, 148px);
  aspect-ratio: 1;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid rgba(18, 108, 255, 0.52);
  background: #dcecff;
  box-shadow: 14px 18px 36px rgba(25, 73, 130, 0.16);
}

.login-terminal__logo::after {
  position: absolute;
  inset: 7px;
  content: "";
  border: 1px solid rgba(255, 255, 255, 0.76);
  pointer-events: none;
}

.login-terminal__logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.login-terminal__brand h1 {
  max-width: 6em;
  margin: 0;
  color: var(--login-blue);
  font-size: clamp(40px, 4.6vw, 70px);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: 0;
  text-wrap: balance;
}

.login-terminal__brand-code {
  margin: 12px 0 0;
  color: var(--login-muted);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.7;
}

.login-terminal__summary {
  max-width: 520px;
  margin: clamp(34px, 5vw, 70px) 0 0;
  color: #36597f;
  font-size: 15px;
  line-height: 1.85;
}

.login-terminal__telemetry {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 520px;
  margin-top: 34px;
  border-top: 1px solid var(--login-line);
  border-bottom: 1px solid var(--login-line);
}

.login-terminal__telemetry > div {
  min-width: 0;
  padding: 14px 16px;
  border-right: 1px solid var(--login-line);
}

.login-terminal__telemetry > div:first-child {
  padding-left: 0;
}

.login-terminal__telemetry > div:last-child {
  border-right: 0;
}

.login-terminal__telemetry span,
.login-terminal__telemetry strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.login-terminal__telemetry span {
  color: var(--login-muted);
  font-size: 11px;
}

.login-terminal__telemetry strong {
  margin-top: 6px;
  color: var(--login-ink);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.login-terminal__auth {
  display: grid;
  grid-template-columns: minmax(300px, 420px) minmax(180px, 1fr);
  align-items: center;
  gap: clamp(34px, 4vw, 68px);
}

.login-terminal__panel {
  width: 100%;
  min-width: 0;
}

.login-terminal__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--login-line-strong);
}

.login-terminal__heading h2 {
  margin: 0;
  color: var(--login-ink);
  font-size: clamp(24px, 2.2vw, 34px);
  font-weight: 760;
  line-height: 1.2;
  letter-spacing: 0;
}

.login-terminal__heading p {
  margin: 7px 0 0;
  color: var(--login-muted);
  font-size: 13px;
  line-height: 1.6;
}

.login-terminal__heading > span {
  flex: 0 0 auto;
  padding-top: 5px;
  color: var(--login-success);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.login-terminal__alert.ant-alert {
  margin-top: 18px;
  padding: 10px 12px !important;
  border: 1px solid rgba(197, 61, 77, 0.38) !important;
  border-radius: 2px !important;
  background: rgba(255, 246, 247, 0.92) !important;
}

.login-terminal__alert .ant-alert-message {
  color: #9f2938 !important;
  font-size: 12px !important;
}

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

.login-terminal__field.ant-form-item {
  margin-bottom: 18px !important;
}

.login-terminal__field .ant-form-item-label {
  padding-bottom: 8px !important;
}

.login-terminal__field .ant-form-item-label > label {
  width: 100%;
  height: auto !important;
  color: var(--login-ink) !important;
  font-size: 13px !important;
  font-weight: 700 !important;
}

.login-terminal__field .ant-form-item-label > label > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 16px;
}

.login-terminal__field .ant-form-item-label small {
  color: var(--login-muted);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 10px;
  font-weight: 500;
}

.login-terminal .ant-input-affix-wrapper {
  width: 100%;
  height: 48px;
  padding: 0 14px !important;
  color: var(--login-ink) !important;
  border: 1px solid var(--login-line) !important;
  border-radius: 2px !important;
  outline: 0 !important;
  background: rgba(255, 255, 255, 0.9) !important;
  box-shadow: none !important;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease !important;
}

.login-terminal .ant-input-affix-wrapper:hover {
  border-color: var(--login-line-strong) !important;
  background: #fff !important;
}

.login-terminal .ant-input-affix-wrapper-focused,
.login-terminal .ant-input-affix-wrapper:focus-within {
  border-color: var(--login-blue) !important;
  background: #fff !important;
  box-shadow: 0 0 0 4px rgba(18, 108, 255, 0.18) !important;
}

.login-terminal .ant-input-affix-wrapper .ant-input {
  height: 44px;
  padding: 0 8px !important;
  color: var(--login-ink) !important;
  caret-color: var(--login-blue);
  background: transparent !important;
  font-size: 14px !important;
}

.login-terminal .ant-input::placeholder {
  color: #667f9e !important;
  opacity: 1;
}

.login-terminal .ant-input-prefix,
.login-terminal .ant-input-suffix,
.login-terminal .ant-input-password-icon {
  color: #6684a9 !important;
}

.login-terminal .ant-form-item-explain-error {
  padding-top: 3px;
  color: var(--login-danger) !important;
  font-size: 12px;
}

.login-terminal__remember.ant-form-item {
  margin: 2px 0 20px !important;
}

.login-terminal__remember .ant-checkbox-wrapper {
  color: var(--login-muted) !important;
  font-size: 12px !important;
}

.login-terminal__remember .ant-checkbox-inner {
  border-color: var(--login-line-strong) !important;
  border-radius: 2px !important;
  background: rgba(255, 255, 255, 0.9) !important;
}

.login-terminal__remember .ant-checkbox-checked .ant-checkbox-inner {
  border-color: var(--login-blue) !important;
  background: var(--login-blue) !important;
}

.login-terminal__submit-item.ant-form-item {
  margin-bottom: 14px !important;
}

.login-terminal__submit.ant-btn,
.login-terminal__submit.ant-btn-primary {
  width: 100%;
  height: 50px !important;
  padding: 0 18px !important;
  color: #fff !important;
  border: 1px solid var(--login-blue) !important;
  border-radius: 2px !important;
  outline: 0 !important;
  background: var(--login-blue) !important;
  box-shadow: 0 8px 20px rgba(18, 108, 255, 0.2) !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease !important;
}

.login-terminal__submit.ant-btn:hover,
.login-terminal__submit.ant-btn-primary:hover {
  border-color: var(--login-blue-deep) !important;
  background: var(--login-blue-deep) !important;
  box-shadow: 0 10px 24px rgba(7, 84, 214, 0.24) !important;
}

.login-terminal__submit.ant-btn:active {
  transform: translateY(1px);
}

.login-terminal__submit.ant-btn:focus-visible,
.login-terminal .ant-input-affix-wrapper:focus-visible,
.login-terminal .ant-checkbox-input:focus-visible + .ant-checkbox-inner {
  outline: 3px solid rgba(18, 108, 255, 0.3) !important;
  outline-offset: 3px !important;
}

.login-terminal__submit.ant-btn[disabled] {
  color: #dce9fb !important;
  border-color: #648fc5 !important;
  background: #648fc5 !important;
  box-shadow: none !important;
  cursor: progress !important;
}

.login-terminal__form-note {
  margin: 0;
  color: var(--login-muted);
  font-size: 11px;
  line-height: 1.7;
}

.login-terminal__feed {
  min-width: 0;
  padding-left: clamp(24px, 3vw, 46px);
  border-left: 1px solid rgba(91, 143, 206, 0.45);
}

.login-terminal__feed h3 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 22px;
  color: var(--login-blue-deep);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
  white-space: nowrap;
}

.login-terminal__feed h3::before,
.login-terminal__feed h3::after {
  height: 1px;
  content: "";
  background: var(--login-line-strong);
}

.login-terminal__feed h3::before {
  width: 34px;
}

.login-terminal__feed h3::after {
  flex: 1;
  min-width: 18px;
}

.login-terminal__feed ul {
  display: grid;
  gap: 13px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.login-terminal__feed li {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 11px;
  align-items: start;
  color: #6a829f;
  font-size: 12px;
  line-height: 1.55;
}

.login-terminal__feed li::before {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  content: "";
  border: 1px solid #8daed4;
  background: transparent;
}

.login-terminal__feed li.is-active {
  color: var(--login-blue-deep);
  font-weight: 700;
}

.login-terminal__feed li.is-active::before {
  border-color: var(--login-blue);
  background: var(--login-blue);
  box-shadow: 0 0 0 3px rgba(18, 108, 255, 0.12);
  animation: login-terminal-pulse 1.6s ease-in-out infinite;
}

.login-terminal__feed li.is-complete {
  color: var(--login-success);
}

.login-terminal__feed li.is-complete::before {
  border-color: var(--login-success);
  background: var(--login-success);
}

.login-terminal__feed li.is-error {
  color: var(--login-danger);
}

.login-terminal__feed li.is-error::before {
  border-color: var(--login-danger);
  background: var(--login-danger);
}

@keyframes login-terminal-pulse {
  50% {
    opacity: 0.45;
  }
}

.login-terminal__feed > p {
  margin: 24px 0 0;
  padding-top: 14px;
  color: var(--login-muted);
  border-top: 1px solid rgba(169, 195, 229, 0.72);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 10px;
  line-height: 1.7;
}

.login-terminal__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 clamp(18px, 3vw, 52px);
  color: #6f88a7;
  border-top: 1px solid rgba(74, 118, 170, 0.22);
  background: rgba(241, 247, 254, 0.76);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.totp-mask {
  overflow-y: auto !important;
  padding: 16px !important;
  background: rgba(224, 236, 250, 0.9) !important;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.totp-mask .totp-panel {
  position: relative;
  width: 420px !important;
  max-width: 100% !important;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 28px !important;
  color: var(--login-ink, #102a4b) !important;
  border: 1px solid #7fa5d3 !important;
  border-radius: 2px !important;
  background: rgba(250, 253, 255, 0.98) !important;
  box-shadow: 0 24px 70px rgba(25, 73, 130, 0.22) !important;
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", sans-serif !important;
}

.totp-mask .totp-panel::before,
.totp-mask .totp-panel::after {
  position: absolute;
  width: 24px;
  height: 24px;
  content: "";
  pointer-events: none;
}

.totp-mask .totp-panel::before {
  top: 8px;
  left: 8px;
  border-top: 1px solid #126cff;
  border-left: 1px solid #126cff;
}

.totp-mask .totp-panel::after {
  right: 8px;
  bottom: 8px;
  border-right: 1px solid #126cff;
  border-bottom: 1px solid #126cff;
}

.totp-mask .totp-panel__title {
  margin: 0 0 20px !important;
  padding-bottom: 14px;
  color: #102a4b !important;
  border-bottom: 1px solid #7fa5d3;
  font-size: 20px;
  font-weight: 760;
}

.totp-mask .totp-panel__qr-wrap {
  padding: 8px 0 4px;
}

.totp-mask .totp-panel__qr {
  width: min(220px, 100%) !important;
  height: auto !important;
  aspect-ratio: 1;
  padding: 8px !important;
  border: 1px solid #a9c3e5;
  border-radius: 2px !important;
  background: #fff !important;
}

.totp-mask .totp-panel__secret-label,
.totp-mask .totp-panel__label {
  color: #36597f !important;
  font-size: 13px !important;
}

.totp-mask .totp-panel__secret {
  padding: 10px 12px !important;
  color: #102a4b !important;
  border: 1px solid #a9c3e5 !important;
  border-radius: 2px !important;
  background: #edf4fc !important;
  font-family: Consolas, "SFMono-Regular", monospace !important;
}

.totp-mask .totp-panel__input {
  width: 100% !important;
  height: 48px !important;
  color: #102a4b !important;
  caret-color: #126cff;
  border: 1px solid #a9c3e5 !important;
  border-radius: 2px !important;
  outline: 0 !important;
  background: #fff !important;
  box-shadow: none !important;
  font-family: Consolas, "SFMono-Regular", monospace !important;
  font-size: 20px !important;
  font-variant-numeric: tabular-nums;
}

.totp-mask .totp-panel__input:focus-visible {
  border-color: #126cff !important;
  box-shadow: 0 0 0 4px rgba(18, 108, 255, 0.18) !important;
}

.totp-mask .totp-panel__error {
  color: #c53d4d !important;
}

.totp-mask .totp-panel__copy,
.totp-mask .totp-panel__cancel,
.totp-mask .totp-panel__ok {
  min-height: 42px;
  border-radius: 2px !important;
  outline: 0 !important;
  font-size: 13px !important;
  font-weight: 700 !important;
}

.totp-mask .totp-panel__copy,
.totp-mask .totp-panel__cancel {
  color: #0754d6 !important;
  border: 1px solid #7fa5d3 !important;
  background: #fff !important;
}

.totp-mask .totp-panel__ok {
  color: #fff !important;
  border: 1px solid #126cff !important;
  background: #126cff !important;
}

.totp-mask .totp-panel__copy:focus-visible,
.totp-mask .totp-panel__cancel:focus-visible,
.totp-mask .totp-panel__ok:focus-visible {
  outline: 3px solid rgba(18, 108, 255, 0.28) !important;
  outline-offset: 3px !important;
}

.totp-settings-button {
  min-height: 34px !important;
  color: #fff !important;
  border: 1px solid #4f93ff !important;
  border-radius: 2px !important;
  background: #126cff !important;
  box-shadow: none !important;
  font-size: 12px !important;
}

.totp-settings-button:hover {
  border-color: #0754d6 !important;
  background: #0754d6 !important;
}

@media (max-width: 1180px) {
  .login-terminal__workspace {
    grid-template-columns: minmax(300px, 0.76fr) minmax(520px, 1.24fr);
    padding-inline: 34px;
  }

  .login-terminal__brand,
  .login-terminal__auth {
    padding-inline: 32px;
  }

  .login-terminal__auth {
    grid-template-columns: minmax(280px, 390px) minmax(150px, 1fr);
    gap: 30px;
  }
}

@media (max-width: 940px) {
  .login-terminal {
    height: auto;
    min-height: 100dvh;
    overflow: auto;
  }

  .login-terminal__workspace {
    grid-template-columns: 1fr;
    padding: 24px;
  }

  .login-terminal__brand {
    justify-content: flex-start;
    padding: 28px 24px 32px;
    border-right: 0;
    border-bottom: 1px solid rgba(74, 118, 170, 0.28);
  }

  .login-terminal__logo {
    width: 86px;
  }

  .login-terminal__brand h1 {
    font-size: clamp(36px, 8vw, 58px);
  }

  .login-terminal__summary,
  .login-terminal__telemetry {
    display: none;
  }

  .login-terminal__auth {
    grid-template-columns: minmax(0, 1fr) minmax(170px, 0.72fr);
    align-items: start;
    padding: 38px 24px 32px;
  }
}

@media (max-width: 680px) {
  .login-terminal {
    min-height: 100dvh;
  }

  .login-terminal__hud {
    grid-template-columns: 1fr auto;
  }

  .login-terminal__hud-center {
    display: none;
  }

  .login-terminal__workspace {
    padding: 12px;
  }

  .login-terminal__brand {
    padding-inline: 18px;
  }

  .login-terminal__brand-heading {
    gap: 16px;
  }

  .login-terminal__logo {
    width: 72px;
  }

  .login-terminal__brand h1 {
    font-size: 34px;
  }

  .login-terminal__brand-code {
    margin-top: 8px;
    font-size: 9px;
  }

  .login-terminal__auth {
    grid-template-columns: 1fr;
    gap: 34px;
    padding: 34px 18px 42px;
  }

  .login-terminal__feed {
    padding: 24px 0 0;
    border-top: 1px solid rgba(91, 143, 206, 0.45);
    border-left: 0;
  }

  .login-terminal__footer span:last-child {
    display: none;
  }

  .totp-mask .totp-panel {
    padding: 24px 18px !important;
  }

  .totp-mask .totp-panel__actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
  }

  .totp-mask .totp-panel__copy,
  .totp-mask .totp-panel__cancel,
  .totp-mask .totp-panel__ok {
    min-height: 44px;
  }
}

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