/* ════════════════════════════════════════════════════
   🔐 PVE Auth Gate — 与 Boot Splash 风格一致的密码门
   ════════════════════════════════════════════════════ */

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 14%, rgba(34, 211, 238, 0.12) 0%, rgba(34, 211, 238, 0.07) 10%, transparent 26%),
    radial-gradient(circle at 18% 28%, rgba(56, 139, 253, 0.14) 0%, transparent 24%),
    radial-gradient(circle at 82% 24%, rgba(167, 139, 250, 0.12) 0%, transparent 22%),
    linear-gradient(180deg, rgba(5, 10, 18, 0.80) 0%, rgba(4, 8, 14, 0.92) 52%, rgba(3, 6, 12, 0.98) 100%);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  font-family: var(--font-text);
  animation: auth-gate-in 0.45s cubic-bezier(0.4, 0, 0.2, 1) both;
  overflow: hidden;
}

.auth-gate.unlocked {
  animation: auth-gate-out 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  pointer-events: none;
}

@keyframes auth-gate-in {
  from { opacity: 0; backdrop-filter: blur(0) saturate(100%); }
  to   { opacity: 1; backdrop-filter: blur(28px) saturate(180%); }
}

@keyframes auth-gate-out {
  from { opacity: 1; transform: scale(1); filter: blur(0); }
  to   { opacity: 0; transform: scale(1.04); filter: blur(8px); }
}

/* 背景装饰：网格 + 微粒 */
.auth-gate::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 30%, rgba(56, 139, 253, 0.12), transparent 42%),
    radial-gradient(circle at 82% 72%, rgba(196, 181, 253, 0.10), transparent 42%),
    radial-gradient(circle at 50% 10%, rgba(125, 211, 252, 0.08), transparent 24%),
    radial-gradient(circle at 12% 16%, rgba(255,255,255,0.92) 0 0.8px, transparent 1.6px),
    radial-gradient(circle at 18% 46%, rgba(219,234,254,0.72) 0 0.9px, transparent 1.7px),
    radial-gradient(circle at 26% 72%, rgba(191,219,254,0.60) 0 0.8px, transparent 1.6px),
    radial-gradient(circle at 40% 22%, rgba(255,255,255,0.78) 0 0.9px, transparent 1.7px),
    radial-gradient(circle at 58% 16%, rgba(219,234,254,0.66) 0 0.8px, transparent 1.6px),
    radial-gradient(circle at 68% 54%, rgba(255,255,255,0.72) 0 0.9px, transparent 1.8px),
    radial-gradient(circle at 82% 18%, rgba(219,234,254,0.76) 0 0.9px, transparent 1.7px),
    radial-gradient(circle at 88% 38%, rgba(191,219,254,0.58) 0 0.8px, transparent 1.6px),
    radial-gradient(circle at 74% 76%, rgba(255,255,255,0.68) 0 0.9px, transparent 1.8px),
    radial-gradient(circle at 28% 10%, rgba(191,219,254,0.52) 0 0.8px, transparent 1.5px),
    radial-gradient(circle at 92% 62%, rgba(191,219,254,0.56) 0 0.9px, transparent 1.6px);
  pointer-events: none;
  animation: auth-cosmos-drift 18s linear infinite;
}

.auth-gate::after {
  content: '';
  position: absolute;
  inset: auto 10% -24% 10%;
  height: 42%;
  background:
    radial-gradient(circle at 50% 0%, rgba(96, 165, 250, 0.18) 0%, transparent 16%),
    radial-gradient(ellipse at 50% 72%, rgba(59, 130, 246, 0.08) 0%, transparent 42%),
    linear-gradient(180deg, rgba(59, 130, 246, 0.08) 0%, transparent 62%);
  transform: perspective(1600px) rotateX(76deg) scaleY(2.1);
  transform-origin: center top;
  opacity: 0.52;
  pointer-events: none;
  animation: auth-warp-floor 14s linear infinite;
}

.auth-card {
  position: relative;
  width: 540px;
  max-width: calc(100vw - 32px);
  background: linear-gradient(180deg, rgba(10, 18, 32, 0.95) 0%, rgba(6, 10, 18, 0.98) 100%);
  border: 1px solid rgba(96, 165, 250, 0.16);
  border-radius: 24px;
  box-shadow:
    0 34px 96px rgba(2, 8, 23, 0.58),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 0 70px rgba(56, 139, 253, 0.10);
  overflow: hidden;
  animation: auth-card-in 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) 0.05s both;
  clip-path: polygon(9% 0, 100% 0, 100% 100%, 0 100%, 0 10%);
}

.auth-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 14%),
    linear-gradient(135deg, rgba(96, 165, 250, 0.08) 0%, transparent 24%),
    linear-gradient(180deg, transparent 0%, transparent 80%, rgba(2, 8, 23, 0.32) 100%);
  pointer-events: none;
}

.auth-card::after {
  content: '';
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 14px;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(96, 165, 250, 0.24), transparent);
  pointer-events: none;
}

@keyframes auth-card-in {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── 标题栏（macOS 风） ── */
.auth-titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 16px;
  border-bottom: 1px solid rgba(96, 165, 250, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015));
  position: relative;
  z-index: 1;
}

.auth-titlebar .dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}
.auth-titlebar .dot.red    { background: #ff5f57; }
.auth-titlebar .dot.yellow { background: #febc2e; }
.auth-titlebar .dot.green  { background: #28c840; }

.auth-titlebar .title {
  flex: 1;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
  font-weight: 500;
}

.titlebar-spacer {
  display: inline-block;
  width: 33px;
  flex: 0 0 33px;
}

/* ── 主体 ── */
.auth-body {
  position: relative;
  z-index: 1;
  padding: 32px 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-body::before {
  content: '';
  position: absolute;
  top: 2px;
  right: -6px;
  width: 252px;
  height: 252px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 240'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%23eef6ff' stop-opacity='.92'/%3E%3Cstop offset='1' stop-color='%2360a5fa' stop-opacity='.68'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cg fill='none' stroke='%2396c7ff' stroke-opacity='.18'%3E%3Ccircle cx='120' cy='120' r='92' stroke-width='1.4'/%3E%3Ccircle cx='120' cy='120' r='66' stroke-width='1.1'/%3E%3Ccircle cx='120' cy='120' r='42' stroke-width='.9'/%3E%3Cpath d='M120 18v18M120 204v18M18 120h18M204 120h18M50 50l12 12M178 178l12 12M50 190l12-12M178 62l12-12' stroke-width='1'/%3E%3C/g%3E%3Cg fill='none' stroke='url(%23g)' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' opacity='.62'%3E%3Cpath d='M72 160L96 144L118 122L144 116L166 92L150 70L126 78'/%3E%3C/g%3E%3Cg fill='%23eef6ff'%3E%3Ccircle cx='72' cy='160' r='3'/%3E%3Ccircle cx='96' cy='144' r='3.2'/%3E%3Ccircle cx='118' cy='122' r='3.2'/%3E%3Ccircle cx='144' cy='116' r='3.2'/%3E%3Ccircle cx='166' cy='92' r='3.6'/%3E%3Ccircle cx='150' cy='70' r='3.3'/%3E%3Ccircle cx='126' cy='78' r='3.1'/%3E%3C/g%3E%3Cg fill='none' stroke='%23dbeafe' stroke-opacity='.18' stroke-width='2'%3E%3Ccircle cx='72' cy='160' r='7'/%3E%3Ccircle cx='122' cy='120' r='8'/%3E%3Ccircle cx='166' cy='92' r='8'/%3E%3Ccircle cx='126' cy='78' r='7'/%3E%3C/g%3E%3Cg fill='%23dbeafe' fill-opacity='.54' font-family='Arial' font-size='8' text-anchor='middle'%3E%3Ctext x='120' y='14'%3EN%3C/text%3E%3Ctext x='226' y='124'%3EE%3C/text%3E%3Ctext x='120' y='236'%3ES%3C/text%3E%3Ctext x='14' y='124'%3EW%3C/text%3E%3C/g%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0.84;
  filter: drop-shadow(0 0 22px rgba(96, 165, 250, 0.18));
  pointer-events: none;
  z-index: 0;
  animation: auth-dipper-orbit 16s ease-in-out infinite;
}

.auth-body::after {
  content: '';
  position: absolute;
  top: 8px;
  right: -8px;
  width: 268px;
  height: 268px;
  background:
    radial-gradient(circle at 50% 50%, rgba(59, 130, 246, 0.14) 0%, rgba(59, 130, 246, 0.08) 22%, transparent 52%),
    conic-gradient(from 180deg, transparent 0deg, rgba(96, 165, 250, 0.08) 42deg, transparent 92deg, rgba(167, 139, 250, 0.08) 182deg, transparent 238deg, rgba(34, 211, 238, 0.08) 320deg, transparent 360deg);
  filter: blur(20px);
  opacity: 0.54;
  pointer-events: none;
  z-index: 0;
  animation: auth-ribbon-drift 12s ease-in-out infinite;
}

.auth-body > * {
  position: relative;
  z-index: 1;
}

.auth-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.auth-logo-cluster {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-logo {
  display: flex;
  gap: 8px;
  font-size: 44px;
  font-weight: 100;
  letter-spacing: 0.15em;
  line-height: 1;
  margin-bottom: 0;
  font-family: var(--font-display);
}
.auth-logo .l-b { color: #388bfd; }
.auth-logo .l-i { color: #00d4ff; }
.auth-logo .l-e { color: #c4b5fd; }

.auth-badge-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(96, 165, 250, 0.12);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(219, 234, 254, 0.72);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--font-mono);
  white-space: nowrap;
}

.auth-badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(147, 197, 253, 0.7);
  box-shadow: 0 0 6px rgba(147, 197, 253, 0.55);
}

.auth-badge-live {
  color: #dbeafe;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.14), rgba(96, 165, 250, 0.08));
}

.auth-badge-live::before {
  background: #34d399;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.55);
}

.auth-subtitle {
  font-size: 11px;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.42);
  text-transform: uppercase;
  margin-bottom: 0;
}

.auth-intro {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(96, 165, 250, 0.12);
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.10), rgba(8, 14, 26, 0.62)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 70%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.auth-intro-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.auth-intro-text {
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.auth-prompt {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(96, 165, 250, 0.08);
}
.auth-prompt .sigil { color: #00d4ff; font-weight: 600; }
.auth-prompt .cmd   { color: rgba(255, 255, 255, 0.78); }
.auth-prompt .arg   { color: #c4b5fd; }

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-field-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(163, 177, 198, 0.74);
}

/* ── 输入框 ── */
.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: linear-gradient(180deg, rgba(4, 10, 18, 0.94) 0%, rgba(5, 9, 16, 0.98) 100%);
  border: 1px solid rgba(56, 139, 253, 0.26);
  border-radius: 14px;
  padding: 0 14px;
  height: 50px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    inset 0 -10px 20px rgba(2, 8, 23, 0.36);
}

.auth-input-wrap:focus-within {
  border-color: rgba(0, 212, 255, 0.55);
  box-shadow:
    0 0 0 3px rgba(0, 212, 255, 0.12),
    0 0 24px rgba(0, 212, 255, 0.12),
    inset 0 0 24px rgba(0, 212, 255, 0.08);
}

.auth-input-wrap .lead {
  color: #00d4ff;
  font-family: var(--font-mono);
  font-size: 14px;
  margin-right: 8px;
  user-select: none;
}

.auth-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.08em;
  caret-color: #00d4ff;
  padding: 0;
}
.auth-input::placeholder {
  color: rgba(255, 255, 255, 0.28);
  letter-spacing: 0.04em;
}

.auth-field-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.auth-meta-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid rgba(96, 165, 250, 0.10);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(191, 219, 254, 0.74);
  font-size: 10px;
  letter-spacing: 0.05em;
  font-family: var(--font-mono);
}

.auth-input-wrap .caret {
  width: 8px;
  height: 16px;
  background: #00d4ff;
  margin-left: 2px;
  animation: auth-caret 1.05s steps(2) infinite;
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.6);
}
@keyframes auth-caret {
  50% { opacity: 0; }
}

/* ── 提交按钮 ── */
.auth-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 2px;
}

.auth-hint {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.32);
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
}
.auth-hint kbd {
  display: inline-block;
  padding: 2px 6px;
  font-size: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.7);
  margin: 0 2px;
}

.auth-submit {
  background: linear-gradient(135deg, #388bfd 0%, #00d4ff 100%);
  border: none;
  border-radius: 12px;
  color: #061018;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0 18px;
  height: 42px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
  box-shadow: 0 10px 22px rgba(0, 212, 255, 0.20), inset 0 1px 0 rgba(255, 255, 255, 0.20);
  font-family: var(--font-text);
}
.auth-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 212, 255, 0.4);
  filter: brightness(1.05);
}
.auth-submit:active {
  transform: translateY(0);
  filter: brightness(0.95);
}

/* ── 状态栏 ── */
.auth-status {
  margin-top: 2px;
  padding-top: 14px;
  border-top: 1px solid rgba(96, 165, 250, 0.08);
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(255, 255, 255, 0.32);
  letter-spacing: 0.06em;
}
.auth-status .pulse {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #28c840;
  border-radius: 50%;
  margin-right: 6px;
  animation: auth-pulse 1.4s ease-in-out infinite;
  vertical-align: middle;
}
@keyframes auth-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px #28c840; }
  50%      { opacity: 0.4; box-shadow: 0 0 0 transparent; }
}

@keyframes auth-cosmos-drift {
  0% {
    transform: translate3d(0, 0, 0);
    opacity: 0.88;
  }
  50% {
    transform: translate3d(-10px, 6px, 0);
    opacity: 1;
  }
  100% {
    transform: translate3d(0, 0, 0);
    opacity: 0.88;
  }
}

@keyframes auth-warp-floor {
  0% {
    transform: perspective(1600px) rotateX(76deg) scaleY(2.1) translateY(0);
    opacity: 0.42;
  }
  100% {
    transform: perspective(1600px) rotateX(76deg) scaleY(2.1) translateY(16px);
    opacity: 0.58;
  }
}

@keyframes auth-dipper-orbit {
  0%, 100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
    opacity: 0.78;
  }
  50% {
    transform: translate3d(-8px, 5px, 0) rotate(-4deg);
    opacity: 0.92;
  }
}

@keyframes auth-ribbon-drift {
  0%, 100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
    opacity: 0.40;
  }
  50% {
    transform: translate3d(-10px, 6px, 0) rotate(-2deg);
    opacity: 0.58;
  }
}

/* ── 错误抖动 ── */
.auth-card.error {
  animation: auth-shake 0.42s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}
.auth-card.error .auth-input-wrap {
  border-color: rgba(255, 95, 87, 0.7);
  box-shadow: 0 0 0 3px rgba(255, 95, 87, 0.15), 0 0 24px rgba(255, 95, 87, 0.15) inset;
}
.auth-card.error .auth-input {
  color: #ff8a82;
}
@keyframes auth-shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-8px); }
  40%, 60% { transform: translateX(8px); }
}

.auth-error-msg {
  margin-top: -2px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #ff8a82;
  letter-spacing: 0.04em;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  transition: opacity 0.2s ease, max-height 0.25s ease, padding 0.25s ease, border-color 0.25s ease;
  min-height: 0;
}
.auth-card.error .auth-error-msg {
  opacity: 1;
  max-height: 56px;
  padding: 10px 12px;
  border-color: rgba(255, 95, 87, 0.18);
  background: linear-gradient(180deg, rgba(127, 29, 29, 0.24) 0%, rgba(69, 10, 10, 0.16) 100%);
}

/* 当 auth-gate 在 DOM 时，禁止下面元素滚动 */
html.auth-locked, body.auth-locked {
  overflow: hidden !important;
}

@media (max-width: 640px) {
  .auth-card {
    width: min(100vw - 20px, 520px);
    border-radius: 20px;
    clip-path: none;
  }

  .auth-card::after {
    display: none;
  }

  .auth-body {
    padding: 24px 20px 20px;
    gap: 14px;
  }

  .auth-body::before {
    width: 176px;
    height: 176px;
    top: 8px;
    right: -6px;
    opacity: 0.58;
  }

  .auth-body::after {
    width: 188px;
    height: 188px;
    top: 14px;
    right: -2px;
    opacity: 0.38;
  }

  .auth-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .auth-badge-stack {
    flex-direction: row;
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .auth-logo {
    font-size: 38px;
  }

  .auth-actions,
  .auth-status {
    flex-direction: column;
    align-items: flex-start;
  }

  .auth-submit {
    width: 100%;
    justify-content: center;
  }
}
