:root {
  color-scheme: light;
  --ink: #0d2036;
  --muted: #5d6d82;
  --soft: #93a2b6;
  --line: rgba(65, 128, 204, 0.22);
  --line-strong: rgba(75, 141, 231, 0.42);
  --page: #f5faff;
  --surface: rgba(255, 255, 255, 0.76);
  --surface-strong: rgba(255, 255, 255, 0.92);
  --blue: #2f72ff;
  --cyan: #27d5dd;
  --teal: #24c7b4;
  --danger: #be443b;
  --shadow: 0 28px 90px rgba(43, 93, 145, 0.16);
  --card-shadow: 0 22px 60px rgba(45, 92, 150, 0.13);
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 42% 4%, rgba(255, 255, 255, 0.98), transparent 28%),
    linear-gradient(125deg, rgba(35, 204, 190, 0.12), transparent 34%),
    linear-gradient(245deg, rgba(47, 114, 255, 0.13), transparent 38%),
    linear-gradient(180deg, #ffffff 0%, var(--page) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(67, 145, 221, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(67, 145, 221, 0.035) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.24), transparent 72%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(112deg, transparent 0 25%, rgba(79, 159, 229, 0.055) 25.1% 25.35%, transparent 25.5% 100%),
    linear-gradient(112deg, transparent 0 67%, rgba(39, 213, 221, 0.06) 67.1% 67.35%, transparent 67.5% 100%);
}

button,
input {
  font: inherit;
}

svg {
  display: block;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 1px solid rgba(42, 188, 216, 0.40);
  border-radius: 12px;
  background:
    linear-gradient(145deg, #243a58, #0c1b2e 62%, #07111f);
  color: #fff;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  box-shadow: 0 18px 34px rgba(20, 48, 85, 0.22), 0 0 0 4px rgba(44, 216, 229, 0.10);
}

.brand-mark.small {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  font-size: 17px;
}

.brand-mark.large {
  width: 94px;
  height: 94px;
  border-radius: 22px;
  font-size: 28px;
  box-shadow: 0 26px 52px rgba(21, 59, 107, 0.25), 0 0 0 5px rgba(40, 213, 221, 0.22);
}

.login-topbar,
.portal-topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 38px clamp(32px, 4vw, 70px) 26px;
}

.login-brand,
.portal-brand {
  display: flex;
  align-items: center;
  gap: 20px;
}

.login-brand h1,
.portal-brand h1 {
  margin: 0;
  color: #0b1d34;
  font-size: 30px;
  line-height: 1.05;
  letter-spacing: 0;
  text-shadow: 0 10px 26px rgba(31, 76, 130, 0.10);
}

.login-user-hint,
.portal-user {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: #5a6a7e;
  font-size: 15px;
}

.login-exit-icon,
.icon-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #173354;
  box-shadow: none;
}

.login-exit-icon svg,
.icon-button svg {
  width: 23px;
  height: 23px;
}

.icon-button:hover {
  transform: translateY(-1px);
  background: rgba(47, 114, 255, 0.08);
  box-shadow: none;
}

.login-stage {
  position: relative;
  z-index: 1;
  width: min(820px, calc(100vw - 112px));
  margin: 0 auto;
  padding-bottom: 48px;
}

.portal-stage {
  position: relative;
  z-index: 1;
  width: min(1480px, calc(100vw - 112px));
  margin: 0 auto;
  padding-bottom: 48px;
}

.login-board,
.portal-board {
  position: relative;
  display: grid;
  min-height: clamp(650px, 72vh, 820px);
  border: 1px solid rgba(75, 141, 231, 0.24);
  border-radius: 14px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.54), rgba(235, 246, 255, 0.42)),
    radial-gradient(circle at 50% 18%, rgba(47, 114, 255, 0.12), transparent 30%),
    rgba(248, 252, 255, 0.72);
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, 0.72);
  overflow: hidden;
  backdrop-filter: blur(18px);
}

.login-board {
  grid-template-columns: 1fr;
  place-items: center;
}

.portal-board {
  grid-template-columns: 1fr;
  min-height: clamp(520px, 64vh, 700px);
  place-items: center;
  padding: clamp(36px, 5vh, 62px) 0;
}

.login-board::before,
.portal-board::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 36% 0%, rgba(63, 142, 255, 0.16), transparent 25%),
    linear-gradient(rgba(47, 114, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 114, 255, 0.04) 1px, transparent 1px);
  background-size: auto, 10px 10px, 10px 10px;
  opacity: .58;
}

.login-board::after {
  content: "";
  position: absolute;
  top: 9%;
  bottom: 0;
  left: 18%;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(70, 126, 191, 0.18) 12%, rgba(70, 126, 191, 0.16) 70%, transparent);
}

.login-circuit {
  position: absolute;
  pointer-events: none;
  width: min(420px, 32vw);
  height: 78%;
  opacity: .78;
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

.login-circuit.left {
  left: 0;
  bottom: 4%;
  background-image:
    linear-gradient(135deg, transparent 0 18%, rgba(89, 155, 255, .52) 18.2% 18.55%, transparent 18.7%),
    linear-gradient(45deg, transparent 0 44%, rgba(41, 211, 219, .38) 44.2% 44.5%, transparent 44.7%),
    linear-gradient(0deg, transparent 0 78%, rgba(89, 155, 255, .38) 78.2% 78.45%, transparent 78.7%);
  clip-path: polygon(0 0, 78% 0, 48% 30%, 80% 48%, 52% 72%, 100% 100%, 0 100%);
}

.login-circuit.right {
  right: 0;
  top: 18%;
  transform: scaleX(-1);
  background-image:
    linear-gradient(135deg, transparent 0 22%, rgba(89, 155, 255, .46) 22.2% 22.55%, transparent 22.8%),
    linear-gradient(45deg, transparent 0 53%, rgba(41, 211, 219, .42) 53.1% 53.45%, transparent 53.7%),
    linear-gradient(0deg, transparent 0 70%, rgba(89, 155, 255, .32) 70.2% 70.45%, transparent 70.7%);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 18% 100%, 48% 64%, 20% 42%, 62% 18%);
}

.login-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: min(380px, 72%);
  margin: 0 auto;
  padding: 34px 0;
}

.login-mark-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 32px;
}

.login-panel h2 {
  margin: 0 0 30px;
  color: #0b1d34;
  font-size: 39px;
  line-height: 1.1;
  letter-spacing: 0;
  text-align: center;
  text-shadow: 0 12px 28px rgba(28, 77, 137, 0.13);
}

.login-panel form {
  display: grid;
  gap: 20px;
}

label span {
  display: block;
  margin-bottom: 8px;
  color: #23384f;
  font-size: 14px;
  font-weight: 760;
}

.field-shell {
  position: relative;
  display: block;
  margin: 0;
}

.field-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin: 0;
  color: #8da0b7;
  transform: translateY(-50%);
}

.field-icon.right {
  right: 16px;
  left: auto;
}

.field-icon svg {
  width: 19px;
  height: 19px;
}

input {
  width: 100%;
  height: 50px;
  border: 1px solid rgba(69, 123, 218, 0.38);
  border-radius: 8px;
  padding: 0 48px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.74);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), 0 12px 30px rgba(45, 92, 150, 0.06);
}

input::placeholder {
  color: #a4b2c4;
}

input:focus {
  border-color: rgba(47, 114, 255, 0.82);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(47, 114, 255, 0.11), 0 16px 34px rgba(45, 92, 150, 0.09);
}

button {
  height: 58px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #347dff, #245eea);
  color: #fff;
  font-size: 17px;
  font-weight: 860;
  cursor: pointer;
  box-shadow: 0 16px 34px rgba(47, 114, 255, 0.30);
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
  box-shadow: 0 20px 42px rgba(47, 114, 255, 0.34);
}

.form-error {
  margin: -8px 0 16px;
  border: 1px solid rgba(190, 68, 59, 0.24);
  border-radius: 8px;
  background: rgba(190, 68, 59, 0.08);
  color: var(--danger);
  padding: 11px 13px;
  font-size: 14px;
}

.portal-entry-panel {
  position: relative;
  z-index: 1;
  align-self: center;
  width: min(1180px, calc(100% - 96px));
  margin: 0 auto;
}

.login-entry-heading {
  margin-bottom: 22px;
}

.login-entry-heading h2 {
  position: relative;
  margin: 0;
  color: #0b1d34;
  font-size: 27px;
  line-height: 1.15;
  letter-spacing: 0;
}

.login-entry-heading h2::after {
  content: "";
  display: block;
  width: 24px;
  height: 3px;
  margin-top: 10px;
  border-radius: 999px;
  background: var(--blue);
}

.login-entry-heading p {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.login-system-grid,
.system-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 34px;
}

.login-system-card,
.system-card {
  position: relative;
  display: flex;
  min-height: 320px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(88, 136, 196, 0.20);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(250, 253, 255, 0.70));
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--card-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.94);
  overflow: hidden;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.system-grid {
  gap: 18px;
}

.system-card {
  min-height: 220px;
  padding: 18px 18px 22px;
}

.login-system-card::before,
.system-card::before {
  content: "";
  position: absolute;
  inset: 54px auto auto 50%;
  width: 130px;
  height: 130px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, rgba(85, 139, 209, 0.14));
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 7%, rgba(255, 255, 255, 0.84));
  transform: translateX(-50%);
}

.system-card::before {
  inset: 34px auto auto 50%;
  width: 94px;
  height: 94px;
}

.login-system-card:hover,
.system-card:hover {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--accent) 42%, rgba(88, 136, 196, 0.20));
  box-shadow: 0 28px 70px rgba(45, 92, 150, 0.18), 0 0 36px color-mix(in srgb, var(--accent) 12%, transparent);
}

.login-system-icon,
.system-icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  margin-bottom: 28px;
  border: 1px solid color-mix(in srgb, var(--accent) 26%, rgba(88, 136, 196, 0.18));
  border-radius: 999px;
  color: color-mix(in srgb, var(--accent) 86%, #235d91);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.94), color-mix(in srgb, var(--accent) 8%, rgba(235, 246, 255, 0.88)));
  box-shadow: inset 0 0 0 6px rgba(255, 255, 255, 0.62), 0 18px 42px rgba(45, 92, 150, 0.11);
}

.system-icon {
  width: 78px;
  height: 78px;
  margin-bottom: 18px;
}

.login-system-icon svg,
.system-icon svg {
  width: 52px;
  height: 52px;
  stroke-width: 1.65;
}

.system-icon svg {
  width: 36px;
  height: 36px;
}

.login-system-card strong,
.system-card strong {
  position: relative;
  z-index: 1;
  display: block;
  color: #0b1d34;
  font-size: 26px;
  line-height: 1.2;
}

.system-card strong {
  font-size: 21px;
}

.login-system-card small,
.system-card small {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 16px;
  color: #4c5e75;
  font-size: 15px;
}

.system-card small {
  margin-top: 11px;
  font-size: 13px;
}

.login-system-card small span,
.system-card small span {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(36, 199, 180, 0.14);
}

.system-card em {
  width: 92%;
  margin-top: 8px;
  color: var(--soft);
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
  text-align: center;
}

.login-system-card i,
.system-card i {
  position: absolute;
  right: 24px;
  bottom: 24px;
  color: var(--blue);
  font-size: 31px;
  font-style: normal;
  line-height: 1;
}

.system-card i {
  right: 18px;
  bottom: 16px;
  font-size: 26px;
}

.portal-entry-panel {
  width: min(1180px, calc(100% - 96px));
}

.system-disabled {
  opacity: .56;
  cursor: not-allowed;
}

.system-disabled:hover {
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
  }
}

@media (max-width: 1080px) {
  .login-stage,
  .portal-stage {
    width: min(100% - 40px, 900px);
  }

  .login-board,
  .portal-board {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 44px 0;
  }

  .login-board::after {
    display: none;
  }

  .login-panel,
  .portal-entry-panel {
    width: min(620px, calc(100% - 48px));
  }

  .portal-entry-panel {
    margin-top: 0;
  }
}

@media (max-width: 720px) {
  .login-topbar,
  .portal-topbar {
    padding: 24px 20px 18px;
  }

  .login-brand h1,
  .portal-brand h1 {
    font-size: 24px;
  }

  .login-stage,
  .portal-stage {
    width: min(100% - 24px, 620px);
  }

  .login-board,
  .portal-board {
    border-radius: 12px;
    padding: 30px 0;
  }

  .login-panel h2,
  .login-entry-heading h2 {
    font-size: 31px;
  }

  .login-system-grid,
  .system-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .login-system-card,
  .system-card {
    min-height: 230px;
  }
}

@media (max-width: 460px) {
  .login-user-hint span:first-child,
  .portal-user span {
    display: none;
  }

  .brand-mark.small {
    width: 44px;
    height: 44px;
  }

  .brand-mark.large {
    width: 78px;
    height: 78px;
    border-radius: 18px;
  }

  .login-panel,
  .portal-entry-panel {
    width: min(100% - 28px, 420px);
  }

  .login-panel h2,
  .login-entry-heading h2 {
    font-size: 28px;
  }
}
