/* =====================================================================
   天机接口 · 登录页改版（居中卡片 + 全屏动态背景）
   纯 CSS 覆盖，不改 DOM、不重建前端。
   所有选择器加 `html body` 前缀，保证优先级压过组件内 scoped 样式
   （.login-layout[data-v-xxxx] 这类规则在登录路由懒加载后才插入）。
   停用方式：删除本文件的 <link> 即可完整回滚。
   ===================================================================== */

/* ---------- 1. 全屏动态背景 ---------- */
html body .login-layout {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100vh !important;
  height: 100vh !important;
  height: 100dvh !important;
  padding: 0;
  overflow-x: clip !important;
  overflow-y: auto !important;
  position: relative;
  isolation: isolate;
  background: #050d24 !important;
}

/* 缓慢漂移的极光层 */
html body .login-layout.login-layout::before {
  content: "";
  position: fixed;
  inset: -25%;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(34% 34% at 20% 24%, rgba(37, 99, 235, .88) 0%, rgba(37, 99, 235, 0) 70%),
    radial-gradient(30% 30% at 82% 18%, rgba(14, 165, 233, .58) 0%, rgba(14, 165, 233, 0) 68%),
    radial-gradient(40% 40% at 74% 84%, rgba(99, 102, 241, .78) 0%, rgba(99, 102, 241, 0) 70%),
    radial-gradient(30% 30% at 12% 84%, rgba(6, 182, 212, .42) 0%, rgba(6, 182, 212, 0) 68%),
    linear-gradient(160deg, #050f2b 0%, #08204c 42%, #0b2f6d 70%, #050f2b 100%);
  animation: tjAurora 30s ease-in-out infinite alternate;
}

/* 中心呼吸光晕 */
html body .login-layout.login-layout::after {
  content: "";
  position: fixed;
  left: 50%;
  top: 50%;
  width: 78vmax;
  height: 78vmax;
  margin: -39vmax 0 0 -39vmax;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(56, 189, 248, .14) 0%, rgba(56, 189, 248, 0) 60%);
  filter: blur(18px);
  animation: tjBreath 16s ease-in-out infinite;
}

@keyframes tjAurora {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(-2.2%, 1.6%, 0) scale(1.06); }
  100% { transform: translate3d(1.8%, -1.4%, 0) scale(1.02); }
}

@keyframes tjBreath {
  0%, 100% { opacity: .55; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.08); }
}

/* 漂浮的知识节点收小、压暗，只做背景肌理 */
html body .login-layout .animated-bg {
  z-index: 0;
  opacity: .75;
}
html body .login-layout .knowledge-node {
  width: 28px;
  height: 28px;
  background: rgba(148, 197, 255, .10);
  border: 1px solid rgba(148, 197, 255, .28);
  box-shadow: 0 0 12px rgba(96, 165, 250, .22), inset 0 0 6px rgba(148, 197, 255, .10);
  animation-duration: 7s;
}
html body .login-layout .knowledge-node .node-icon {
  width: 14px;
  height: 14px;
  color: rgba(191, 219, 254, .62);
}
html body .login-layout .knowledge-lines {
  opacity: .25;
}
html body .login-layout .connection-line {
  stroke: rgba(186, 230, 253, .45);
  stroke-width: 1;
  stroke-dasharray: 3 11;
}

/* ---------- 2. 去掉左侧营销区，登录区占满 ---------- */
html body .login-layout .showcase-section {
  display: none !important;
}

html body .login-layout .form-section {
  flex: 1 1 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 100vh;
  padding: 76px 24px 76px !important;
  box-sizing: border-box;
}

/* 卡片背后的聚光，把登录区和背景拉开层次 */
html body .login-layout .form-section::before {
  content: "";
  position: fixed;
  left: 50%;
  top: 50%;
  width: min(820px, 96vw);
  height: min(820px, 96vw);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(125, 190, 255, .22) 0%, rgba(125, 190, 255, 0) 62%);
}

html body .login-layout .form-panel {
  width: 100%;
  max-width: 420px !important;
  margin: 0 !important;
  z-index: 2;
}

/* ---------- 3. 居中登录卡片 ---------- */
html body .login-layout .form-card {
  position: relative;
  width: 100%;
  box-sizing: border-box;
  padding: 34px 34px 24px !important;
  border: 1px solid rgba(255, 255, 255, .85) !important;
  border-radius: 22px !important;
  background: rgba(255, 255, 255, .975) !important;
  -webkit-backdrop-filter: blur(22px) saturate(165%);
  backdrop-filter: blur(22px) saturate(165%);
  box-shadow:
    0 34px 90px -24px rgba(2, 10, 32, .85),
    0 10px 28px -14px rgba(2, 10, 32, .55),
    0 0 0 1px rgba(147, 197, 253, .16),
    inset 0 1px 0 rgba(255, 255, 255, .95);
  animation: tjCardIn .62s cubic-bezier(.22, .8, .3, 1) both;

  /* 固定为浅色语义，避免用户存了深色主题时出现白底白字 */
  --td-text-color-primary: #101b33;
  --td-text-color-secondary: #5b6b85;
  --td-text-color-placeholder: #96a4ba;
  --td-text-color-disabled: #b6c0d0;
  --td-bg-color-container: #ffffff;
  --td-bg-color-container-hover: #f3f6fb;
  --td-bg-color-secondarycontainer: #eef2f8;
  --td-component-stroke: #dce4f0;
  --td-error-color-1: rgba(220, 38, 38, .06);
  --td-error-color-3: rgba(220, 38, 38, .22);
  --td-success-color-light: rgba(22, 119, 255, .09);
}

@keyframes tjCardIn {
  from { opacity: 0; transform: translateY(18px) scale(.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- 4. 卡片内部节奏收紧 ---------- */
html body .login-layout .form-header {
  margin-bottom: 20px !important;
}
html body .login-layout .form-title {
  font-size: 22px !important;
  letter-spacing: .02em;
  margin-bottom: 8px !important;
}
html body .login-layout .form-welcome {
  font-size: 13px;
  line-height: 1.6;
}
html body .login-layout .form-hint {
  background: rgba(11, 92, 255, .07) !important;
  color: #0b5cff !important;
}

html body .login-layout .form-content .t-form-item {
  margin-bottom: 16px !important;
}
html body .login-layout .submit-button {
  height: 44px !important;
  margin: 18px 0 14px !important;
  border-radius: 9px !important;
  font-weight: 600;
  letter-spacing: .02em;
  box-shadow: 0 8px 20px -8px rgba(11, 92, 255, .65);
}

html body .login-layout .register-cta__divider {
  margin: 2px 0 12px !important;
}
html body .login-layout .register-cta__divider span {
  background: transparent !important;
}
html body .login-layout .register-cta__button {
  height: 44px !important;
  border-radius: 9px !important;
}

/* 底部三项特性在卡片里比较占高度，收起 */
html body .login-layout .login-features {
  display: none !important;
}
html body .login-layout .login-form-footer {
  margin-top: 12px !important;
  padding-bottom: 0 !important;
}

/* ---------- 5. 顶部品牌 / 语言切换在小屏下的样子 ---------- */
/* 矮屏（常见的 1366x768 / 1280x720 笔记本）整体收紧，让注册表单也能一屏放下 */
@media (max-height: 800px) {
  html body .login-layout .form-section {
    padding: 62px 24px !important;
  }
  html body .login-layout .form-card {
    padding: 26px 30px 18px !important;
  }
  html body .login-layout .form-header {
    margin-bottom: 14px !important;
  }
  html body .login-layout .form-content .t-form-item {
    margin-bottom: 12px !important;
  }
  html body .login-layout .submit-button {
    margin: 14px 0 10px !important;
  }
}

@media (max-width: 768px) {
  html body .login-layout {
    flex-direction: column !important;
    align-items: center;
    justify-content: center !important;
  }
  html body .login-layout .form-section {
    flex: 1 1 auto !important;
    min-height: 100vh;
    padding: 84px 18px 56px !important;
  }
  html body .login-layout .form-card {
    padding: 28px 22px 20px !important;
    border-radius: 18px !important;
  }
  html body .login-layout .header-logo {
    top: 18px !important;
    left: 20px !important;
  }
  html body .login-layout .header-links {
    top: 14px !important;
    right: 14px !important;
  }
}

/* ---------- 6. 登录路由所在文档层 ---------- */
/* 应用里有个藏在屏幕外的 setting-drawer（body 直属子元素），会把页面撑出
   横向滚动条，登录页单独裁掉。纵向交给文档滚动：卡片变短时滚动位置会
   自动回弹，不会出现「从注册页返回登录页后卡片被顶出屏幕」。 */
html:has(.login-layout),
body:has(.login-layout) {
  height: 100% !important;
  overflow: clip !important;
}

@media (prefers-reduced-motion: reduce) {
  html body .login-layout.login-layout::before,
  html body .login-layout.login-layout::after {
    animation: none !important;
  }
  html body .login-layout .form-card {
    animation: none !important;
  }
}
