/* =========================================================
   公元前 · 数智管理平台 — 统一登录与账户管理
   ========================================================= */

body.auth-locked {
  background: #061326;
}

body.auth-locked .app-shell,
body.auth-locked .toast-wrap,
body.auth-locked .modal-root {
  display: none !important;
}

.menu-item.is-danger {
  color: #b42318;
}

.menu-item.is-danger .ic {
  color: #d4665d;
}

.menu-item.is-danger:hover {
  background: #fdf1f0;
  color: #912018;
}

.side-empty {
  margin: 14px 12px;
  padding: 16px 12px;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: 9px;
  color: #9fb4cf;
  font-size: 11.5px;
  line-height: 1.7;
  text-align: center;
}

.side-empty span {
  color: #7189a6;
  font-size: 9.5px;
}

.rail-empty {
  padding: 16px 4px;
  color: #97a6b9;
  font-size: 10.5px;
  text-align: center;
}

.empty-grant {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 26px;
  border: 1px dashed #d6e2f2;
  border-radius: 14px;
  background: #fff;
  text-align: center;
}

.empty-grant .ic {
  width: 30px;
  height: 30px;
  margin-bottom: 12px;
  color: #7fa3d2;
}

.empty-grant h3 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
}

.empty-grant p {
  max-width: 430px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.8;
}

.apps-hero.is-muted .apps-hero-icon {
  color: #6f8db3;
  background: #eef3fa;
}

/* ----------------------------- login ----------------------------- */

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(420px, 0.96fr);
  background: #f4f7fc;
  overflow: auto;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.auth-screen.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.auth-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(28px, 4.5vw, 58px) clamp(30px, 5vw, 76px);
  color: #e7eef9;
  overflow: hidden;
  background:
    radial-gradient(80% 55% at 92% 6%, rgba(37, 99, 235, 0.42) 0%, rgba(37, 99, 235, 0) 60%),
    radial-gradient(70% 55% at 4% 96%, rgba(6, 182, 212, 0.20) 0%, rgba(6, 182, 212, 0) 62%),
    linear-gradient(158deg, #0b2140 0%, #071a32 48%, #051326 100%);
}

.auth-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 52px 52px;
  -webkit-mask-image: radial-gradient(75% 68% at 55% 45%, #000 0%, transparent 100%);
  mask-image: radial-gradient(75% 68% at 55% 45%, #000 0%, transparent 100%);
  pointer-events: none;
}

.auth-brand::after {
  content: "";
  position: absolute;
  width: 520px;
  height: 520px;
  right: -210px;
  bottom: -250px;
  border-radius: 50%;
  border: 1px solid rgba(96, 165, 250, 0.22);
  box-shadow: 0 0 0 70px rgba(37, 99, 235, 0.04), 0 0 0 140px rgba(37, 99, 235, 0.025);
  pointer-events: none;
}

.auth-brand-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 13px;
}

.auth-brand-top > img {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.auth-brand-name {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 19px;
  font-weight: 750;
  letter-spacing: 0.06em;
  color: #fff;
}

.auth-brand-name span {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.3em;
  color: #8fa9c9;
}

.auth-version {
  margin-left: auto;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #a9c0dd;
  font-family: var(--font-num);
  font-size: 10px;
  letter-spacing: 0.05em;
}

.auth-brand-copy {
  position: relative;
  z-index: 1;
  margin-top: clamp(60px, 11vh, 126px);
  max-width: 520px;
}

.auth-eyebrow {
  font-family: var(--font-num);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.22em;
  color: #6aa6f8;
}

.auth-brand-copy h2 {
  margin: 17px 0 0;
  font-size: clamp(30px, 3.5vw, 46px);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.015em;
  color: #fff;
}

.auth-brand-copy p {
  margin: 20px 0 0;
  max-width: 450px;
  color: #9db1ca;
  font-size: 13px;
  line-height: 1.9;
}

.auth-modules {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: clamp(32px, 5.5vh, 58px);
  max-width: 560px;
}

.auth-module {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 13px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  background: rgba(255, 255, 255, 0.045);
}

.auth-module-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 9px;
  color: #8fc2ff;
  background: rgba(59, 130, 246, 0.15);
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.14);
}

.auth-module-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-module > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.auth-module b {
  font-size: 12px;
  font-weight: 650;
  color: #ecf3fc;
}

.auth-module small {
  color: #8299b6;
  font-size: 9.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.auth-foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 42px;
  color: #6d86a5;
  font-family: var(--font-num);
  font-size: 9.5px;
  letter-spacing: 0.1em;
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 36px clamp(24px, 5vw, 74px);
  background:
    radial-gradient(70% 55% at 100% 0%, rgba(37, 99, 235, 0.055) 0%, rgba(37, 99, 235, 0) 65%),
    #f4f7fc;
}

.auth-card {
  width: min(392px, 100%);
  animation: auth-rise 0.4s cubic-bezier(0.22, 0.8, 0.32, 1);
}

@keyframes auth-rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-mobile-brand {
  display: none;
}

.auth-card h1 {
  margin: 13px 0 0;
  color: var(--ink);
  font-size: 26px;
  font-weight: 720;
  letter-spacing: -0.02em;
}

.auth-sub {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.75;
}

#authForm {
  margin-top: 25px;
}

.auth-field {
  display: block;
  margin-bottom: 15px;
}

.auth-label {
  display: block;
  margin-bottom: 7px;
  color: #42546e;
  font-size: 11.5px;
  font-weight: 620;
}

.auth-input {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 44px;
  padding: 0 13px;
  border: 1px solid #dbe3ef;
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-input:focus-within {
  border-color: #7aa9f4;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.11);
}

.auth-input svg {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: #8b9bb1;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-input input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
}

.auth-input input::placeholder {
  color: #abb8c9;
}

.auth-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 44px;
  margin-top: 21px;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(180deg, #2f6fe4 0%, #1d5bd6 100%);
  box-shadow: 0 8px 20px rgba(29, 91, 214, 0.24);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.02em;
  transition: transform 0.12s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.auth-submit:hover {
  filter: brightness(1.05);
  box-shadow: 0 10px 24px rgba(29, 91, 214, 0.30);
}

.auth-submit:active {
  transform: translateY(1px);
}

.auth-submit:disabled {
  opacity: 0.78;
  cursor: progress;
}

.auth-hint {
  margin-top: 15px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #e5ebf4;
  background: #f9fbfe;
  color: #7d8da2;
  font-size: 10.5px;
  line-height: 1.7;
}

.auth-note {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 19px;
  color: #97a6b9;
  font-size: 10px;
  line-height: 1.6;
}

.auth-note svg {
  width: 14px;
  height: 14px;
  flex: none;
  fill: none;
  stroke: #91a5bf;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-alert {
  display: flex;
  align-items: center;
  margin-top: 18px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #d6e4ff;
  background: #f0f6ff;
  color: #24548f;
  font-size: 11.5px;
  line-height: 1.6;
}

.auth-alert.is-warn {
  border-color: #f3d3cf;
  background: #fdf3f2;
  color: #9d352b;
}

.auth-loading {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 30px 0;
  color: var(--muted);
  font-size: 12px;
}

.auth-screen.is-ready .auth-loading {
  display: none;
}

.auth-screen:not(.is-ready) .auth-card-main {
  display: none;
}

.auth-spinner {
  width: 17px;
  height: 17px;
  flex: none;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: auth-spin 0.7s linear infinite;
}

.auth-spinner.is-dark {
  border-color: rgba(37, 99, 235, 0.2);
  border-top-color: var(--blue-600);
}

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

@media (max-width: 980px) {
  .auth-screen {
    grid-template-columns: 1fr;
  }

  .auth-brand {
    display: none;
  }

  .auth-panel {
    align-items: flex-start;
    padding: max(7vh, 38px) 22px 46px;
    background:
      radial-gradient(85% 42% at 100% 0%, rgba(37, 99, 235, 0.10) 0%, rgba(37, 99, 235, 0) 70%),
      #f4f7fc;
  }

  .auth-card {
    width: min(412px, 100%);
    margin: 0 auto;
    padding: 28px 24px 24px;
    border: 1px solid #e3eaf4;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(13, 35, 67, 0.13);
  }

  .auth-mobile-brand {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 26px;
    color: var(--ink);
    font-size: 12.5px;
    font-weight: 650;
  }

  .auth-mobile-brand img {
    width: 34px;
    height: 34px;
    border-radius: 9px;
  }

  .auth-loading {
    justify-content: center;
  }
}

@media (max-width: 460px) {
  .auth-card h1 {
    font-size: 23px;
  }

  .auth-panel {
    padding: max(4.5vh, 26px) 14px 30px;
  }

  .auth-card {
    padding: 24px 18px 20px;
  }
}
