/* 登录主视觉：仅覆盖 #view-welcome，业务页与演示账号页沿用原样式。 */
#view-welcome {
  --welcome-ink: #183b7d;
  --welcome-muted: #7685aa;
  --welcome-line: rgba(105, 113, 207, 0.2);
  position: fixed;
  inset: 0;
  z-index: 200;
  min-height: 100dvh;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  background: #edf0ff url("./assets/auth-landscape-bg.png") center bottom / cover no-repeat;
  color: var(--welcome-ink);
  isolation: isolate;
}

#view-welcome::before,
#view-welcome::after {
  content: "";
  position: fixed;
  z-index: -1;
  pointer-events: none;
  border-radius: 50%;
}

#view-welcome::before {
  width: min(42vw, 680px);
  aspect-ratio: 1;
  left: -18vw;
  top: -28vw;
  border: 1px solid rgba(255, 255, 255, 0.42);
  box-shadow:
    0 0 0 34px rgba(255, 255, 255, 0.08),
    0 0 0 72px rgba(255, 255, 255, 0.06),
    0 0 0 112px rgba(255, 255, 255, 0.04);
}

#view-welcome::after {
  width: 7px;
  height: 7px;
  left: 5.2vw;
  top: 4.9vh;
  background: #fff;
  box-shadow: 0 0 6px 2px #fff, 0 0 18px 7px rgba(143, 137, 255, 0.65);
  animation: welcome-star 3.6s ease-in-out infinite;
}

#view-welcome.active {
  display: block !important;
}

#view-welcome .welcome-auth-shell {
  width: min(500px, calc(100vw - 32px));
  min-height: 100dvh;
  margin: 0 auto;
  padding: clamp(62px, 10.2vh, 102px) 0 clamp(34px, 5vh, 54px);
  gap: 0;
  justify-content: flex-start;
}

#view-welcome .auth-brand {
  position: relative;
  z-index: 2;
  text-align: center;
}

#view-welcome .brand-mark.lg {
  width: 60px;
  height: 60px;
  margin: 0 auto 12px;
  border-radius: 14px;
  font-size: 24px;
  font-weight: 600;
  line-height: 1;
  background: linear-gradient(145deg, #617aff 0%, #6359ef 54%, #7354eb 100%);
  border: 1px solid rgba(255, 255, 255, 0.64);
  box-shadow: 0 10px 26px rgba(86, 76, 218, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

#view-welcome .auth-brand h1 {
  margin: 0;
  font-family: "Noto Serif SC", "Songti SC", "SimSun", serif;
  font-size: clamp(38px, 3vw, 48px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.11em;
  color: #163b7d;
  text-shadow: 0 2px 12px rgba(78, 91, 170, 0.08);
}

#view-welcome .auth-brand p {
  margin-top: 7px;
  color: #7180a4;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.28em;
}

.welcome-role-entry {
  position: fixed;
  z-index: 4;
  top: clamp(25px, 5.2vh, 52px);
  right: clamp(28px, 4.6vw, 78px);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 4px;
  color: #6c78a4;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 0.18s ease, transform 0.18s ease;
}

.welcome-role-entry svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: #765fff;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.welcome-role-entry:hover {
  color: #4d4bd2;
  transform: translateY(-1px);
}

#view-welcome .welcome-login-card {
  position: relative;
  z-index: 2;
  overflow: hidden;
  width: 100%;
  margin: clamp(40px, 6vh, 58px) 0 0;
  padding: 34px clamp(34px, 5.25vw, 88px) 35px;
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 28px;
  background:
    radial-gradient(circle at 14% 5%, rgba(255, 255, 255, 0.19), transparent 38%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(229, 233, 255, 0.06) 52%, rgba(255, 255, 255, 0.11));
  box-shadow:
    0 24px 52px rgba(53, 63, 145, 0.15),
    0 2px 5px rgba(255, 255, 255, 0.68),
    inset 1.5px 1.5px 0 rgba(255, 255, 255, 0.96),
    inset -1.5px -1.5px 0 rgba(159, 177, 242, 0.35),
    inset 0 0 30px rgba(255, 255, 255, 0.055);
  -webkit-backdrop-filter: blur(5px) saturate(1.12);
  backdrop-filter: blur(5px) saturate(1.12);
}

#view-welcome .welcome-login-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  padding: 1.5px;
  border-radius: inherit;
  background: linear-gradient(
    128deg,
    rgba(255, 255, 255, 0.98) 0%,
    rgba(255, 255, 255, 0.32) 24%,
    rgba(159, 174, 241, 0.18) 52%,
    rgba(255, 255, 255, 0.83) 78%,
    rgba(183, 198, 255, 0.56) 100%
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

#view-welcome .welcome-login-card::after {
  content: "";
  position: absolute;
  z-index: 0;
  width: 72%;
  height: 80px;
  left: 5%;
  top: -52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.36);
  filter: blur(22px);
  transform: rotate(-5deg);
  pointer-events: none;
}

#view-welcome .welcome-login-card > * {
  position: relative;
  z-index: 1;
}

.welcome-login-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 9px;
  color: #665dea;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.welcome-login-kicker i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #745fff;
  box-shadow: 0 0 0 4px rgba(116, 95, 255, 0.1), 0 0 9px rgba(116, 95, 255, 0.6);
}

#view-welcome .welcome-login-card h2 {
  margin: 0;
  font-family: "Noto Serif SC", "Songti SC", "SimSun", serif;
  font-size: 25px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.05em;
  color: #183b7d;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.72), 0 5px 18px rgba(54, 70, 137, 0.08);
}

.welcome-title-underline {
  display: block;
  width: 31px;
  height: 3px;
  margin: 12px 0 20px;
  border-radius: 999px;
  background: linear-gradient(90deg, #4f84ff, #7757ff);
  box-shadow: 0 2px 8px rgba(91, 84, 255, 0.35);
}

#view-welcome .welcome-login-copy {
  margin: 18px 0 20px;
  color: var(--welcome-muted);
  font-size: 14px;
  font-weight: 500;
}

.welcome-input-row {
  width: 100%;
  height: 51px;
  margin-top: 0;
  display: grid;
  grid-template-columns: 23px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.88),
    inset -1px -1px 0 rgba(143, 159, 224, 0.2),
    0 4px 14px rgba(76, 83, 160, 0.045);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.welcome-input-row + .welcome-input-row {
  margin-top: 20px;
}

.welcome-input-row:focus-within {
  border-color: rgba(100, 92, 244, 0.5);
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 0 3px rgba(104, 86, 255, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.welcome-input-row > svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: #8d96dc;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.welcome-input-row input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  color: #334b7d;
  background: transparent;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.welcome-input-row input::placeholder {
  color: #8791b2;
  opacity: 1;
}

.welcome-password-toggle {
  width: 28px;
  height: 32px;
  display: grid;
  place-items: center;
  color: #8993c5;
}

.welcome-password-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.welcome-login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 15px 0 0;
  color: #7682a5;
  font-size: 13px;
}

.welcome-remember {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.welcome-remember input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: #675cf6;
}

.welcome-forgot {
  color: inherit;
  font-size: inherit;
}

.welcome-forgot:hover {
  color: #5c54dc;
}

#view-welcome .welcome-login-error {
  margin: 11px 0 -3px;
  padding: 7px 10px;
  font-size: 12px;
}

.welcome-auth-actions {
  display: grid;
  gap: 20px;
  margin-top: 26px;
}

.welcome-login-submit,
.welcome-register-button {
  width: 100%;
  min-height: 55px;
  border-radius: 17px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.06em;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.welcome-login-submit {
  color: #fff;
  background: linear-gradient(100deg, #3f78ff 0%, #5355f3 48%, #9a50ef 100%);
  box-shadow: 0 11px 22px rgba(89, 80, 226, 0.29), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.welcome-register-button {
  color: #6659ed;
  border: 1px solid #7567f3;
  background: rgba(255, 255, 255, 0.2);
}

.welcome-back-admin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  margin-top: 4px;
  border-radius: 14px;
  color: #3d4f8c;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  background: linear-gradient(180deg, #e8eeff 0%, #d6e0ff 100%);
  border: 1px solid rgba(99, 112, 180, 0.4);
  box-shadow: 0 4px 12px rgba(70, 90, 160, 0.14);
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.welcome-back-admin[hidden] {
  display: none !important;
}

.welcome-back-admin:hover {
  color: #2a3a78;
  background: linear-gradient(180deg, #f0f4ff 0%, #dce6ff 100%);
  border-color: rgba(80, 95, 170, 0.55);
  box-shadow: 0 6px 16px rgba(70, 90, 160, 0.2);
  transform: translateY(-1px);
}

.welcome-login-submit:hover,
.welcome-register-button:hover {
  transform: translateY(-1px);
  filter: saturate(1.05);
}

.welcome-login-submit:hover {
  box-shadow: 0 14px 27px rgba(89, 80, 226, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.welcome-login-submit:disabled {
  opacity: 0.68;
  cursor: wait;
  transform: none;
}

.welcome-browse-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  margin: 26px auto 0;
  padding: 5px 8px;
  color: #5573ee;
  font-size: 16px;
  font-weight: 600;
}

.welcome-browse-link b {
  font-size: 20px;
  font-weight: 400;
  transition: transform 0.18s ease;
}

.welcome-browse-link:hover b {
  transform: translateX(4px);
}

@keyframes welcome-star {
  0%, 100% { opacity: 0.55; transform: scale(0.88); }
  50% { opacity: 1; transform: scale(1.08); }
}

@media (max-height: 850px) and (min-width: 641px) {
  #view-welcome .welcome-auth-shell {
    padding-top: 36px;
    padding-bottom: 28px;
  }

  #view-welcome .brand-mark.lg {
    width: 52px;
    height: 52px;
    margin-bottom: 7px;
    font-size: 21px;
  }

  #view-welcome .auth-brand h1 { font-size: 36px; }
  #view-welcome .auth-brand p { margin-top: 3px; font-size: 13px; }
  #view-welcome .welcome-login-card { margin-top: 30px; padding-top: 28px; padding-bottom: 24px; }
  #view-welcome .welcome-login-copy { margin: 10px 0 13px; }
  .welcome-input-row { height: 47px; }
  .welcome-input-row + .welcome-input-row { margin-top: 13px; }
  .welcome-auth-actions { gap: 12px; margin-top: 17px; }
  .welcome-login-submit, .welcome-register-button { min-height: 48px; }
  .welcome-browse-link { margin-top: 16px; }
}

@media (max-width: 640px) {
  #view-welcome {
    background-position: 46% bottom;
  }

  #view-welcome .welcome-auth-shell {
    width: min(430px, calc(100vw - 28px));
    padding-top: 72px;
    padding-bottom: 26px;
  }

  .welcome-role-entry {
    top: 14px;
    right: 16px;
    font-size: 13px;
    gap: 7px;
  }

  .welcome-role-entry svg {
    width: 20px;
    height: 20px;
  }

  #view-welcome .brand-mark.lg {
    width: 50px;
    height: 50px;
    border-radius: 13px;
    font-size: 20px;
    margin-bottom: 7px;
  }

  #view-welcome .auth-brand h1 {
    font-size: 34px;
  }

  #view-welcome .auth-brand p {
    margin-top: 4px;
    font-size: 12px;
    letter-spacing: 0.16em;
  }

  #view-welcome .welcome-login-card {
    margin-top: 30px;
    padding: 28px 24px 24px;
    border-radius: 24px;
  }

  #view-welcome .welcome-login-card h2 {
    font-size: 21px;
  }

  #view-welcome .welcome-login-copy {
    margin: 12px 0 15px;
  }

  .welcome-input-row {
    height: 48px;
  }

  .welcome-input-row + .welcome-input-row {
    margin-top: 13px;
  }

  .welcome-auth-actions {
    gap: 13px;
    margin-top: 19px;
  }

  .welcome-login-submit,
  .welcome-register-button {
    min-height: 49px;
    border-radius: 15px;
    font-size: 15px;
  }

  .welcome-browse-link {
    margin-top: 17px;
    font-size: 14px;
  }
}

@media (max-width: 360px) {
  #view-welcome .welcome-login-card { padding-inline: 18px; }
  .welcome-login-options { gap: 8px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  #view-welcome::after { animation: none; }
  .welcome-role-entry,
  .welcome-login-submit,
  .welcome-register-button,
  .welcome-browse-link b { transition: none; }
}

/* ========== 注册 / 演示登录：与欢迎页同一山景 + 玻璃卡 ========== */
:is(#view-login, #view-register) {
  --welcome-ink: #183b7d;
  --welcome-muted: #7685aa;
  position: fixed;
  inset: 0;
  z-index: 200;
  min-height: 100dvh;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  background: #edf0ff url("./assets/auth-landscape-bg.png") center bottom / cover no-repeat;
  color: var(--welcome-ink);
  isolation: isolate;
}

:is(#view-login, #view-register).active {
  display: flex !important;
  align-items: flex-start;
  justify-content: center;
  min-height: 100dvh;
}

:is(#view-login, #view-register) .welcome-auth-shell {
  width: min(500px, calc(100vw - 32px));
  min-height: 100dvh;
  margin: 0 auto;
  padding: clamp(48px, 8vh, 88px) 0 clamp(34px, 5vh, 54px);
  gap: 0;
  justify-content: flex-start;
}

:is(#view-login, #view-register) .welcome-login-card {
  position: relative;
  z-index: 2;
  overflow: hidden;
  width: 100%;
  margin: 0;
  padding: 30px clamp(28px, 5vw, 72px) 32px;
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 28px;
  background:
    radial-gradient(circle at 14% 5%, rgba(255, 255, 255, 0.19), transparent 38%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(229, 233, 255, 0.06) 52%, rgba(255, 255, 255, 0.11));
  box-shadow:
    0 24px 52px rgba(53, 63, 145, 0.15),
    0 2px 5px rgba(255, 255, 255, 0.68),
    inset 1.5px 1.5px 0 rgba(255, 255, 255, 0.96),
    inset -1.5px -1.5px 0 rgba(159, 177, 242, 0.35),
    inset 0 0 30px rgba(255, 255, 255, 0.055);
  -webkit-backdrop-filter: blur(5px) saturate(1.12);
  backdrop-filter: blur(5px) saturate(1.12);
}

:is(#view-login, #view-register) .welcome-login-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  padding: 1.5px;
  border-radius: inherit;
  background: linear-gradient(
    128deg,
    rgba(255, 255, 255, 0.98) 0%,
    rgba(255, 255, 255, 0.32) 24%,
    rgba(159, 174, 241, 0.18) 52%,
    rgba(255, 255, 255, 0.83) 78%,
    rgba(183, 198, 255, 0.56) 100%
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

:is(#view-login, #view-register) .welcome-login-card > * {
  position: relative;
  z-index: 1;
}

:is(#view-login, #view-register) .welcome-login-card h2 {
  margin: 0;
  font-family: "Noto Serif SC", "Songti SC", "SimSun", serif;
  font-size: 25px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.05em;
  color: #183b7d;
}

.auth-glass-back {
  display: inline-flex;
  align-items: center;
  margin: 0 0 16px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(116, 95, 255, 0.24);
  background: rgba(255, 255, 255, 0.24);
  color: #6c78a4;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.auth-glass-back:hover {
  color: #4d4bd2;
  border-color: rgba(116, 95, 255, 0.42);
  background: rgba(255, 255, 255, 0.36);
}

.welcome-register-card .welcome-input-row + .welcome-input-row,
.welcome-register-card .auth-register-inline + .welcome-input-row {
  margin-top: 16px;
}

.auth-register-inline {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.auth-register-inline .welcome-input-row {
  margin-top: 0;
}

.welcome-input-row--select {
  grid-template-columns: minmax(0, 1fr);
  padding-inline: 14px;
}

.welcome-input-row select {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  color: #334b7d;
  background: transparent;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

:is(#view-login, #view-register) .test-accounts {
  margin: 14px 0 6px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px dashed rgba(116, 95, 255, 0.28);
}

:is(#view-login, #view-register) .test-accounts + .welcome-input-row {
  margin-top: 16px;
}

:is(#view-login, #view-register) .test-acc {
  background: rgba(255, 255, 255, 0.52);
  border-color: rgba(116, 95, 255, 0.12);
}

:is(#view-login, #view-register) .test-acc:hover,
:is(#view-login, #view-register) .test-acc.selected {
  border-color: rgba(116, 95, 255, 0.38);
  box-shadow: 0 0 0 2px rgba(116, 95, 255, 0.1);
}

:is(#view-login, #view-register) .auth-switch {
  color: #7682a5;
}

:is(#view-login, #view-register) .text-link {
  color: #6659ed;
  font-weight: 700;
}

@media (max-width: 640px) {
  :is(#view-login, #view-register) {
    background-position: 46% bottom;
  }

  :is(#view-login, #view-register) .welcome-auth-shell {
    width: min(430px, calc(100vw - 28px));
    padding-top: 56px;
    padding-bottom: 26px;
  }

  :is(#view-login, #view-register) .welcome-login-card {
    padding: 26px 22px 24px;
    border-radius: 24px;
  }

  :is(#view-login, #view-register) .welcome-login-card h2 {
    font-size: 21px;
  }
}

@media (max-width: 360px) {
  .auth-register-inline {
    grid-template-columns: 1fr;
  }
}
