/* ------------------------------------------------------------------
   登录 / 初始化页面
   深色技术线稿风格（参照 gis_agent 登录页）：深海军蓝底 + 低透明度
   线描插画，白色表单卡是唯一焦点。插画语义对应本系统：
   模型包（立方体）→ 数据 / 运行 / 产物流水线 → 观测地球与数据层；
   REST / MCP 是两个入口。前台（.auth-front）用钢蓝，后台（.auth-admin）用青绿。
   ------------------------------------------------------------------ */

.auth-page {
  --auth-accent: #6fb3e8;
  --auth-accent-deep: #3f77a6;
  --auth-accent-soft: rgba(111, 179, 232, 0.12);
  --auth-accent-ring: rgba(111, 179, 232, 0.22);
  --auth-ink: #e8f2fb;
  --auth-body: #a9bfd4;
  --auth-line: rgba(140, 190, 240, 0.22);
  --auth-button-from: #4f87b8;
  --auth-button-to: #2f5f8c;
  --auth-card-ink: #16324f;
  --auth-card-body: #5f738e;
  --auth-card-line: #dbe6f2;
  --auth-surface: #f7faff;
  --auth-glass: rgba(111, 179, 232, 0.65);
  --art-strong: #6fa8d8;
  --art-soft: #3f77a6;
  --art-faint: #2a5578;
  --art-text: #9cc8ec;

  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #071523;
  color: var(--auth-ink);
}

.auth-admin {
  --auth-accent: #5cc8c0;
  --auth-accent-deep: #2f9e96;
  --auth-accent-soft: rgba(92, 200, 192, 0.12);
  --auth-accent-ring: rgba(92, 200, 192, 0.22);
  --auth-button-from: #3f9e96;
  --auth-button-to: #22766f;
  --auth-glass: rgba(92, 200, 192, 0.6);
}

/* 后台入口：更方的控制台卡片 + 等宽标签 + 运行链路背景，
   与前台圆角、插画化的登录页形成区分。 */
.auth-admin .auth-shell {
  grid-template-columns: minmax(0, 1fr) minmax(352px, 396px);
  gap: 64px;
}
.auth-admin .auth-card {
  max-width: 396px;
  padding: 34px 32px 28px;
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(47, 158, 150, 0.09), rgba(251, 253, 253, 0) 128px),
    linear-gradient(rgba(47, 158, 150, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 158, 150, 0.045) 1px, transparent 1px),
    #fbfdfd;
  background-size: auto, 22px 22px, 22px 22px, auto;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 0 0 6px rgba(255, 255, 255, 0.03),
    0 40px 84px -46px rgba(0, 6, 14, 0.9),
    0 3px 10px rgba(0, 6, 14, 0.2);
}
.auth-admin .auth-card::after {
  content: "";
  position: absolute;
  top: -1px;
  left: 24px;
  right: 24px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, var(--auth-accent-deep), var(--auth-accent) 55%, transparent);
  pointer-events: none;
}
.auth-admin .auth-card-head h1 { letter-spacing: -0.01em; }
.auth-admin .auth-card .auth-kicker {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.2em;
}
.auth-console-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  padding: 4px 9px;
  border: 1px solid rgba(47, 158, 150, 0.32);
  border-radius: 4px;
  background: rgba(47, 158, 150, 0.07);
  color: var(--auth-accent-deep);
  font: 700 9.5px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.18em;
}
.auth-console-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--auth-accent);
  box-shadow: 0 0 0 3px rgba(92, 200, 192, 0.16);
}
.auth-admin .auth-points span { border-radius: 4px; }
.auth-admin .auth-brand small { color: #7fc4bd; }
/* 后台只保留运行链路与产物图，弱化地学插画 */
.auth-admin .auth-scene__art { opacity: 0.34; }
.auth-admin .auth-scene__globe,
.auth-admin .auth-scene__contours,
.auth-admin .auth-scene__tetris,
.auth-admin .auth-scene__solids,
.auth-admin .auth-scene__math,
.auth-admin .auth-scene__sat,
.auth-admin .auth-scene__blocks { display: none; }

/* ---------- 背景线描 ---------- */
.auth-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  user-select: none;
}
.auth-scene__art {
  opacity: 0.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.auth-scene .s-strong { fill: none; stroke: var(--art-strong); stroke-width: 1.6; }
.auth-scene .s-soft { fill: none; stroke: var(--art-soft); stroke-width: 1.4; }
.auth-scene .s-faint { fill: none; stroke: var(--art-faint); stroke-width: 1.2; }
.auth-scene .s-accent { fill: none; stroke: var(--auth-accent); stroke-width: 2; }
.auth-scene .s-dash {
  fill: none;
  stroke: var(--art-strong);
  stroke-width: 1.5;
  stroke-dasharray: 6 10;
  opacity: 0.8;
}
.auth-scene .s-dash-soft {
  fill: none;
  stroke: var(--art-soft);
  stroke-width: 1.4;
  stroke-dasharray: 4 12;
  opacity: 0.85;
}
.auth-scene .s-text {
  fill: var(--art-text);
  font: 600 8.5px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.16em;
}
.auth-scene .f-accent { fill: var(--auth-accent); opacity: 0.9; }
.auth-scene .f-soft { fill: var(--art-strong); opacity: 0.7; }
.auth-scene__globe { opacity: 0.72; }
.auth-scene__contours { opacity: 0.85; }
.auth-scene__blocks { opacity: 0.95; }
.auth-scene__ghost { opacity: 0.75; }
.auth-scene__tetris { opacity: 0.8; }
.auth-scene__solids { opacity: 0.78; }
.auth-scene__math { opacity: 0.7; }
.auth-scene__api { opacity: 0.85; }
.auth-scene__pipeline { opacity: 0.9; }
.auth-scene__sat { opacity: 0.8; }
.auth-scene__charts { opacity: 0.85; }
.auth-scene__dot { fill: #4a7ba6; opacity: 0.22; }
/* 极轻的动态：RUN 节点呼吸 + 链路虚线缓慢流动 */
.auth-scene__run-ring { animation: auth-run-breathe 5.5s ease-in-out infinite; }
.auth-scene__flow { animation: auth-flow 3.2s linear infinite; }
@keyframes auth-run-breathe {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.75; }
}
@keyframes auth-flow {
  to { stroke-dashoffset: -32; }
}
.auth-scene__glow-start { stop-color: var(--auth-accent); stop-opacity: 0.2; }
.auth-scene__glow-end { stop-color: var(--auth-accent); stop-opacity: 0; }

/* 左侧柔和暗角：压住插画，保证介绍文字可读 */
.auth-page::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(115% 85% at 16% 44%, rgba(5, 16, 28, 0.82) 0%, rgba(5, 16, 28, 0.46) 40%, rgba(5, 16, 28, 0) 66%),
    linear-gradient(180deg, rgba(4, 12, 22, 0.38), rgba(4, 12, 22, 0) 26%, rgba(4, 12, 22, 0.44));
}

/* ---------- 布局 ---------- */
.auth-shell {
  position: relative;
  z-index: 1;
  width: min(1060px, calc(100% - 56px));
  margin: auto;
  padding: 56px 0 40px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(372px, 412px);
  align-items: center;
  gap: 72px;
}
.auth-setup .auth-shell {
  grid-template-columns: minmax(0, 1fr) minmax(400px, 470px);
}

.auth-page-foot {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 0 0 22px;
  text-align: center;
  color: #7c94ab;
  font-size: 11.5px;
  letter-spacing: 0.04em;
}

/* ---------- 左侧介绍 ---------- */
.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  align-self: flex-start;
  color: var(--auth-ink);
  text-decoration: none;
}
.auth-brand:hover { text-decoration: none; }
.auth-brand strong { display: block; font-size: 15px; letter-spacing: 0.01em; }
.auth-brand small { display: block; margin-top: 1px; color: #8fb2d4; font-size: 11.5px; }
.auth-logo {
  width: 46px;
  height: 46px;
  padding: 5px;
  border-radius: 13px;
  background: rgba(247, 250, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 10px 24px -14px rgba(0, 0, 0, 0.85);
  flex: none;
}

.auth-brand-copy { margin-top: 60px; }
.auth-brand-copy h2 {
  max-width: 470px;
  margin: 14px 0 16px;
  color: var(--auth-ink);
  font-size: clamp(25px, 3vw, 35px);
  font-weight: 650;
  line-height: 1.32;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.auth-brand-copy p {
  max-width: 440px;
  margin: 0;
  color: var(--auth-body);
  font-size: 13.5px;
  line-height: 1.85;
}
.auth-kicker {
  margin: 0;
  color: var(--auth-accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.auth-points {
  display: grid;
  gap: 12px;
  margin: 36px 0 0;
  padding: 0;
  list-style: none;
}
.auth-points li {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--auth-body);
  font-size: 12.5px;
}
.auth-points span {
  display: inline-grid;
  place-items: center;
  width: 27px;
  height: 27px;
  flex: none;
  border-radius: 9px;
  border: 1px solid var(--auth-line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--auth-accent);
  font: 600 10px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ---------- 卡片 ---------- */
.auth-card {
  position: relative;
  width: 100%;
  max-width: 430px;
  justify-self: end;
  padding: 38px 36px 30px;
  border-radius: 20px;
  background: var(--auth-surface);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 0 0 8px rgba(255, 255, 255, 0.035),
    0 46px 96px -42px rgba(0, 6, 14, 0.85),
    0 4px 12px rgba(0, 6, 14, 0.18);
}
.auth-card-wide { max-width: none; }
/* 半透明玻璃渐变描边：替代原先的顶部高光条 */
.auth-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    152deg,
    rgba(255, 255, 255, 0.92),
    rgba(255, 255, 255, 0.26) 30%,
    var(--auth-glass) 60%,
    rgba(255, 255, 255, 0.72)
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
}
@supports not ((mask-composite: exclude) or (-webkit-mask-composite: xor)) {
  .auth-card { border: 1px solid rgba(255, 255, 255, 0.35); }
  .auth-card::before { display: none; }
}

.auth-card-head h1 {
  margin: 9px 0 7px;
  color: var(--auth-card-ink);
  font-size: 26px;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.auth-card-head p {
  margin: 0 0 24px;
  color: var(--auth-card-body);
  font-size: 12.5px;
  line-height: 1.7;
  text-wrap: pretty;
}
.auth-card .auth-kicker { color: var(--auth-accent-deep); }

.auth-error {
  margin: 0 0 16px;
  padding: 10px 12px;
  border: 1px solid #f0cfca;
  border-radius: 10px;
  background: #fff6f5;
  color: #a8332c;
  font-size: 12.5px;
  line-height: 1.6;
}

.auth-notice {
  margin: 0 0 16px;
  padding: 10px 12px;
  border: 1px solid #cfe3d6;
  border-radius: 10px;
  background: #f4fbf6;
  color: #256b43;
  font-size: 12.5px;
  line-height: 1.6;
}

/* ---------- 表单 ---------- */
.auth-form { display: grid; gap: 14px; }
.auth-form .field { margin: 0; }
.auth-page .field label {
  display: block;
  margin-bottom: 6px;
  color: #33475e;
  font-size: 12.5px;
  font-weight: 600;
}
.auth-page .field input {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  border: 1px solid var(--auth-card-line);
  border-radius: 10px;
  background: #fff;
  color: var(--auth-card-ink);
  font: inherit;
  font-size: 13.5px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.auth-page .field input::placeholder { color: #9aabbd; }
.auth-page .field input:hover { border-color: #b6c8db; }
.auth-page .field input:focus {
  outline: none;
  border-color: var(--auth-accent-deep);
  background: #fff;
  box-shadow: 0 0 0 3px var(--auth-accent-ring);
}
.label-note { color: #8b9db1; font-weight: 400; }

.auth-check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #5b6f86;
  font-size: 12.5px;
  user-select: none;
  cursor: pointer;
}
.auth-check input { width: 15px; height: 15px; accent-color: var(--auth-accent); }

.auth-page .auth-submit {
  width: 100%;
  height: 45px;
  margin-top: 4px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--auth-button-from), var(--auth-button-to));
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  box-shadow: 0 14px 26px -16px rgba(16, 56, 110, 0.8);
  transition: transform 0.12s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.auth-page .auth-submit:hover {
  background: linear-gradient(135deg, var(--auth-button-from), var(--auth-button-to));
  border-color: transparent;
  filter: brightness(1.07);
  transform: translateY(-1px);
  box-shadow: 0 18px 30px -16px rgba(16, 56, 110, 0.85);
}
.auth-page .auth-submit:active {
  background: linear-gradient(135deg, var(--auth-button-from), var(--auth-button-to));
  transform: translateY(0);
  filter: brightness(0.98);
}
.auth-page .auth-submit:focus-visible {
  outline: 2px solid var(--auth-accent);
  outline-offset: 2px;
}

.auth-links {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid #eef3f8;
  font-size: 12.5px;
}
.auth-links a { color: var(--auth-accent-deep); font-weight: 600; }
.auth-links a:hover { color: var(--auth-button-to); }

.auth-foot {
  margin: 16px 0 0;
  color: var(--auth-card-body);
  font-size: 11.5px;
  line-height: 1.65;
  text-wrap: pretty;
}

.auth-page a:focus-visible {
  outline: 2px solid var(--auth-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 980px) {
  .auth-shell,
  .auth-setup .auth-shell,
  .auth-admin .auth-shell {
    grid-template-columns: 1fr;
    width: min(500px, calc(100% - 40px));
    gap: 34px;
    padding: 36px 0 28px;
  }
  .auth-brand-copy { margin-top: 34px; }
  .auth-brand-copy h2 { font-size: 24px; }
  .auth-brand-copy p { max-width: none; }
  .auth-points { display: none; }
  .auth-card,
  .auth-admin .auth-card { justify-self: stretch; max-width: none; }
  .auth-scene__blocks,
  .auth-scene__tetris,
  .auth-scene__solids,
  .auth-scene__math,
  .auth-scene__pipeline,
  .auth-scene__api,
  .auth-scene__sat,
  .auth-scene__charts { display: none; }
}

@media (max-width: 560px) {
  .auth-shell,
  .auth-setup .auth-shell {
    width: 100%;
    padding: 26px 18px 22px;
    gap: 26px;
  }
  .auth-brand { padding-top: 2px; }
  .auth-brand-copy { margin-top: 26px; }
  .auth-brand-copy h2 { font-size: 21px; }
  .auth-brand-copy p { font-size: 12.5px; line-height: 1.75; }
  .auth-card,
  .auth-admin .auth-card { padding: 28px 20px 24px; border-radius: 16px; }
  .auth-card-head h1 { font-size: 23px; }
  .auth-page-foot { padding-bottom: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-page .auth-submit { transition: none; }
  .auth-scene__run-ring,
  .auth-scene__flow { animation: none; }
}
