/* ===== 疾风API 登录/注册页视频背景主题 v48 =====
   v39 稳定底座 + 四个独立优化叠加：
   - body 自带静态渐变（v47）：内联脚本在 <head> 最前打 zf-login-on 类后立即可见，
     跨境网络下不再黑屏 30 秒等 bundle。
   - HUD 扫描线隐藏（v42）：display:none，避免在视频中央形成明显横线。
   - 没有下划线（保留 v39）：v40-v46 引入的「注册/登录大链接」下划线随追加链接
     一起回滚，不再给 a.zf-big-link 加 underline。
   - 主题脚本不在 head（v47）：由 nginx sub_filter '<body>' 注入，与 bundle 并行。 */

html.zf-login-on {
  background: #020205 !important;
}

html.zf-login-on body {
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  background:
    radial-gradient(ellipse at 26% 34%, rgba(34, 211, 238, 0.18), transparent 52%),
    radial-gradient(ellipse at 78% 78%, rgba(52, 211, 153, 0.10), transparent 48%),
    linear-gradient(135deg, #060912 0%, #0b1322 48%, #05070d 100%) !important;
  background-attachment: fixed !important;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* 左侧视频背景（v33：向右扩展到 75%，盖住右侧表单区原本的纯黑底色，
   表单区左缘浮在视频上，由 ::after 右缘渐变压暗保证表单可读） */
#zf-login-video-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 75%;
  height: 100%;
  z-index: 0;
  overflow: hidden;
  /* 静态渐变兜底：视频未加载/未播放时也不留黑屏，直接显示 sci-fi 静态背景 */
  background:
    radial-gradient(circle at 28% 38%, rgba(34,211,238,0.16), transparent 55%),
    linear-gradient(135deg, #060912 0%, #0b1322 48%, #05070d 100%) !important;
  pointer-events: none;
  /* v35：视频自身右缘溶解（容器宽 75%，55%~98% 处逐渐透明），
     与 #zf-login-fade 遮挡层双保险，彻底消除硬分界线 */
  -webkit-mask-image: linear-gradient(90deg, #000 55%, transparent 98%);
  mask-image: linear-gradient(90deg, #000 55%, transparent 98%);
}

#zf-login-video-bg video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 70% center;
  background: transparent !important;
  opacity: 0;
  transition: opacity 0.6s ease;
}

#zf-login-video-bg video.zf-playing {
  opacity: 1 !important;
}

#zf-login-video-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  /* v34：右缘压暗从 0.88 降到 0.45，重活交给 body::after 的全局渐变遮罩，
     两层叠加形成平滑的交叉淡化，避免视频右缘硬切 */
  background: linear-gradient(90deg, rgba(2, 2, 5, 0.12) 0%, rgba(2, 2, 5, 0) 50%, rgba(2, 2, 5, 0.45) 100%);
  pointer-events: none;
}

/* v35：右侧渐变遮挡层（实体 div，由 login-theme.js 创建，z-index 3：
   视频 0 / 扫描线 2 之上、表单 #root 10 之下）。
   从屏幕 48% 开始由浅到深，75%（视频边缘处）已压到约 0.85，
   最右缘实心 #020205 与页面底色无缝衔接。 */
#zf-login-fade {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 48%;
  right: 0;
  background: linear-gradient(90deg,
    rgba(2, 2, 5, 0)    0%,
    rgba(2, 2, 5, 0.20) 22%,
    rgba(2, 2, 5, 0.52) 42%,
    rgba(2, 2, 5, 0.85) 58%,
    rgba(2, 2, 5, 0.97) 75%,
    #020205             100%);
  z-index: 3;
  pointer-events: none;
}

/* 静态 HUD 扫描线：v48 隐藏，避免在视频画面中央形成明显横线（v42 起即如此） */
#zf-login-scanline {
  display: none !important;
}

/* 强制隐藏原生顶部条 */
html.zf-login-on body.zf-login-theme header,
html.zf-login-on body.zf-login-theme nav,
html.zf-login-on body.zf-login-theme [role="banner"],
html.zf-login-on body.zf-login-theme [class*="AppBar"],
html.zf-login-on body.zf-login-theme [class*="appbar"],
html.zf-login-on body.zf-login-theme [class*="Toolbar"],
html.zf-login-on body.zf-login-theme [class*="toolbar"],
html.zf-login-on body.zf-login-theme [class*="TopBar"],
html.zf-login-on body.zf-login-theme [class*="topbar"],
html.zf-login-on body.zf-login-theme [class*="Navbar"],
html.zf-login-on body.zf-login-theme [class*="navbar"],
html.zf-login-on body.zf-login-theme .MuiAlert-root,
html.zf-login-on body.zf-login-theme [role="alert"] {
  display: none !important;
}

/* 隐藏 form / 卡片内部品牌相关图片 */
html.zf-login-on #root form img[src*="logo"],
html.zf-login-on #root form img[src*="jifeng"],
html.zf-login-on #root form img[alt*="疾风"],
html.zf-login-on #root form img[alt*="logo"],
html.zf-login-on #root form img[alt*="徽标"] {
  display: none !important;
}

/* 左下角 HUD 标签 */
#zf-login-tag {
  position: fixed;
  left: 26px;
  bottom: 24px;
  z-index: 5;
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
  letter-spacing: 1.4px;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  pointer-events: none;
  text-transform: uppercase;
}

#zf-login-tag .dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22d3ee;
  margin-right: 8px;
  box-shadow: 0 0 10px #22d3ee;
  animation: zf-login-pulse 1.6s ease-in-out infinite;
}

@keyframes zf-login-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

/* 左上角唯一 logo */
#zf-login-logo {
  position: fixed;
  top: 24px;
  left: 28px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  pointer-events: auto;
  transition: opacity 0.2s;
}

#zf-login-logo:hover { opacity: 0.85; }

#zf-login-logo img {
  height: 32px;
  width: auto;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}

#zf-login-logo span {
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* 右侧面板：完全透明，无任何边框 */
html.zf-login-on body.zf-login-theme #root.zf-login-root,
html.zf-login-on body.zf-login-theme #root {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  width: 38% !important;
  min-width: 360px !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  z-index: 10 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: none !important;
  border-left: none !important;
  border-width: 0 !important;
  overflow: auto !important;
}

/* 登录页 #root 直接可见：首屏白闪由 <head> 内联脚本（提前打 zf-login-on 类）
   让本 CSS 从首次绘制即生效解决，无需再用 opacity:0 隐藏表单。
   表单立即出现，静态渐变背景立即出现，视频随后淡入。 */
html.zf-login-on body.zf-login-theme #root {
  opacity: 1 !important;
  transition: opacity 0.25s ease !important;
}
html.zf-login-on body.zf-login-theme.zf-ready #root {
  opacity: 1 !important;
}

/* 彻底去掉右侧所有背景图/背景色（保留按钮、logo、视频） */
html.zf-login-on body.zf-login-theme #root section,
html.zf-login-on body.zf-login-theme #root div:not(.zf-keep-bg):not(button):not(#zf-login-logo):not(#zf-login-logo *),
html.zf-login-on body.zf-login-theme #root form,
html.zf-login-on body.zf-login-theme #root article,
html.zf-login-on body.zf-login-theme #root main,
html.zf-login-on body.zf-login-theme #root aside,
html.zf-login-on body.zf-login-theme #root header,
html.zf-login-on body.zf-login-theme #root footer,
html.zf-login-on body.zf-login-theme #root span:not(.zf-keep-bg):not(button),
html.zf-login-on body.zf-login-theme #root p,
html.zf-login-on body.zf-login-theme #root label,
html.zf-login-on body.zf-login-theme #root h1,
html.zf-login-on body.zf-login-theme #root h2,
html.zf-login-on body.zf-login-theme #root h3,
html.zf-login-on body.zf-login-theme #root h4,
html.zf-login-on body.zf-login-theme #root h5,
html.zf-login-on body.zf-login-theme #root h6 {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-left: none !important;
  border-right: none !important;
}

/* 表单本身 */
html.zf-login-on body.zf-login-theme #root form.zf-login-form,
html.zf-login-on body.zf-login-theme #root form[data-zf-moved] {
  width: 100% !important;
  max-width: 420px !important;
  margin: 0 auto !important;
  padding: 20px !important;
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  border-width: 0 !important;
  box-shadow: none !important;
  text-align: left !important;
}

/* 内层卡片：去掉所有背景框和边框 */
html.zf-login-on body.zf-login-theme #root form .zf-login-card,
html.zf-login-on body.zf-login-theme #root form .MuiPaper-root,
html.zf-login-on body.zf-login-theme #root form .MuiCard-root,
html.zf-login-on body.zf-login-theme #root form > div:first-child,
html.zf-login-on body.zf-login-theme #root form > div[class]:first-child,
html.zf-login-on body.zf-login-theme #root form .MuiStack-root,
html.zf-login-on body.zf-login-theme #root form .MuiBox-root {
  width: 100% !important;
  max-width: 420px !important;
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: none !important;
  border-width: 0 !important;
  border-radius: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
  text-align: left !important;
}

/* 标题：居中对齐 */
html.zf-login-on body.zf-login-theme #root h1,
html.zf-login-on body.zf-login-theme #root h2,
html.zf-login-on body.zf-login-theme #root h3,
html.zf-login-on body.zf-login-theme #root h4,
html.zf-login-on body.zf-login-theme #root h5,
html.zf-login-on body.zf-login-theme #root h6 {
  color: #fff !important;
  font-weight: 700 !important;
  margin-bottom: 4px !important;
  margin-top: 0 !important;
  letter-spacing: 0.5px !important;
  text-align: center !important;
}

html.zf-login-on body.zf-login-theme #root p,
html.zf-login-on body.zf-login-theme #root span,
html.zf-login-on body.zf-login-theme #root label {
  color: #b4b4c0 !important;
}

html.zf-login-on body.zf-login-theme #root a {
  color: #22d3ee !important;
  transition: color 0.2s;
}

html.zf-login-on body.zf-login-theme #root a:hover {
  color: #67e8f9 !important;
}

/* 登录/注册链接扩大点击区域（v39 原样，不带 v44 引入的下划线） */
html.zf-login-on body.zf-login-theme #root a.zf-big-link,
html.zf-login-on body.zf-login-theme #root form a {
  display: inline-block !important;
  padding: 8px 16px !important;
  margin: -8px -16px !important;
  line-height: 1.4 !important;
}

/* 字段容器：去掉背景框和边框 */
html.zf-login-on body.zf-login-theme #root form .MuiFormControl-root,
html.zf-login-on body.zf-login-theme #root form .MuiTextField-root,
html.zf-login-on body.zf-login-theme #root form .MuiBox-root,
html.zf-login-on body.zf-login-theme #root form .MuiStack-root,
html.zf-login-on body.zf-login-theme #root form > div,
html.zf-login-on body.zf-login-theme #root form > div > div {
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  border-width: 0 !important;
  box-shadow: none !important;
  margin-bottom: 10px !important;
  text-align: left !important;
}

/* 标签文字：左对齐、块级 */
html.zf-login-on body.zf-login-theme #root form .MuiFormLabel-root,
html.zf-login-on body.zf-login-theme #root form label,
html.zf-login-on body.zf-login-theme #root form .MuiInputLabel-root {
  display: block !important;
  text-align: left !important;
  color: rgba(255, 255, 255, 0.72) !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  margin-bottom: 2px !important;
  transform: none !important;
  position: static !important;
}

/* ===== 输入框：透明底 + 白色描边（终极兜底，覆盖 shadcn/MUI/Tailwind） ===== */
html.zf-login-on body.zf-login-theme #root input,
html.zf-login-on body.zf-login-theme #root input:is([type="text"], [type="password"], [type="email"]),
html.zf-login-on body.zf-login-theme #root [class*="InputBase-root"] input,
html.zf-login-on body.zf-login-theme #root [class*="OutlinedInput-root"] input,
html.zf-login-on body.zf-login-theme #root .MuiInputBase-root input,
html.zf-login-on body.zf-login-theme #root .MuiOutlinedInput-root input {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  border: 1px solid rgba(255, 255, 255, 0.42) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.42) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.42) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.42) !important;
  border-left: 1px solid rgba(255, 255, 255, 0.42) !important;
  border-radius: 10px !important;
  color: #fff !important;
  font-size: 14px !important;
  min-height: 38px !important;
  height: auto !important;
  padding: 0 12px !important;
  padding-right: 12px !important;
  box-sizing: border-box !important;
  text-align: left !important;
  transition: border-color 0.2s, box-shadow 0.2s !important;
  box-shadow: none !important;
}

/* 自动填充时不要被浏览器改成黄色 */
html.zf-login-on body.zf-login-theme #root input:-webkit-autofill,
html.zf-login-on body.zf-login-theme #root input:-webkit-autofill:hover,
html.zf-login-on body.zf-login-theme #root input:-webkit-autofill:focus,
html.zf-login-on body.zf-login-theme #root input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px transparent inset !important;
  -webkit-text-fill-color: #fff !important;
  transition: background-color 5000s ease-in-out 0s !important;
}

html.zf-login-on body.zf-login-theme #root input:hover,
html.zf-login-on body.zf-login-theme #root [class*="InputBase-root"] input:hover,
html.zf-login-on body.zf-login-theme #root [class*="OutlinedInput-root"] input:hover {
  border-color: rgba(255, 255, 255, 0.65) !important;
  border-top-color: rgba(255, 255, 255, 0.65) !important;
  border-right-color: rgba(255, 255, 255, 0.65) !important;
  border-bottom-color: rgba(255, 255, 255, 0.65) !important;
  border-left-color: rgba(255, 255, 255, 0.65) !important;
}

html.zf-login-on body.zf-login-theme #root input:focus,
html.zf-login-on body.zf-login-theme #root [class*="InputBase-root"] input:focus,
html.zf-login-on body.zf-login-theme #root [class*="OutlinedInput-root"] input:focus {
  border-color: #fff !important;
  border-top-color: #fff !important;
  border-right-color: #fff !important;
  border-bottom-color: #fff !important;
  border-left-color: #fff !important;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.10) !important;
  outline: none !important;
}

html.zf-login-on body.zf-login-theme #root input::placeholder,
html.zf-login-on body.zf-login-theme #root input::-webkit-input-placeholder {
  color: rgba(255, 255, 255, 0.35) !important;
}

/* v31：原生眼睛按钮直接 display:none。
   关键原因：React 重渲染会重置 JS 写入的内联样式（v30 已实证按钮会"复活"成白色长条），
   但 React 清不掉 CSS 规则——只要选择器命中，按钮永远不会再显示。
   JS 侧 fixPasswordEye 每轮再补一次 display:none 覆盖无 aria-label 的情况。 */
html.zf-login-on body.zf-login-theme #root button[aria-label*="password" i],
html.zf-login-on body.zf-login-theme #root button[aria-label*="Password" i],
html.zf-login-on body.zf-login-theme #root button[aria-label*="密码"],
html.zf-login-on body.zf-login-theme #root [role="button"][aria-label*="password" i],
html.zf-login-on body.zf-login-theme #root button[data-zf-eye-owned="true"] {
  display: none !important;
}

/* 忘记密码链接：移到输入框下方右侧 */
html.zf-login-on body.zf-login-theme #root .zf-forgot-link,
html.zf-login-on body.zf-login-theme #root form a.zf-forgot-link {
  display: block !important;
  text-align: right !important;
  margin-top: -10px !important;
  margin-bottom: 6px !important;
  font-size: 13px !important;
  color: #22d3ee !important;
}

/* 提交按钮 */
html.zf-login-on body.zf-login-theme #root button[type="submit"],
html.zf-login-on body.zf-login-theme #root button.MuiButton-containedPrimary,
html.zf-login-on body.zf-login-theme #root button.primary,
html.zf-login-on body.zf-login-theme #root form button:last-of-type {
  width: 100% !important;
  background: #fff !important;
  background-color: #fff !important;
  color: #020205 !important;
  border-radius: 12px !important;
  font-weight: 700 !important;
  font-size: 15px !important;
  height: 42px !important;
  margin-top: 14px !important;
  margin-bottom: 2px !important;
  box-shadow: 0 10px 30px rgba(255, 255, 255, 0.12) !important;
  transition: transform 0.2s, box-shadow 0.2s !important;
  box-sizing: border-box !important;
  position: relative !important;
  z-index: 1 !important;
}

html.zf-login-on body.zf-login-theme #root button[type="submit"]:hover,
html.zf-login-on body.zf-login-theme #root button.MuiButton-containedPrimary:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 14px 40px rgba(255, 255, 255, 0.18) !important;
}

/* 移动端 */
@media (max-width: 900px) {
  #zf-login-video-bg {
    width: 100%;
    opacity: 0.22;
  }

  #zf-login-video-bg::after {
    background: linear-gradient(180deg, rgba(2, 2, 5, 0.2) 0%, rgba(2, 2, 5, 0.92) 100%);
  }

  #zf-login-scanline { width: 100%; }

  /* 移动端不用右侧渐变遮挡/边缘溶解：视频全宽 + 表单自带深色底 */
  #zf-login-fade { display: none; }
  #zf-login-video-bg {
    -webkit-mask-image: none;
    mask-image: none;
  }

  html.zf-login-on body.zf-login-theme #root.zf-login-root,
  html.zf-login-on body.zf-login-theme #root {
    width: 100% !important;
    min-width: auto !important;
    border-left: none !important;
    background: rgba(2, 2, 5, 0.94) !important;
  }

  html.zf-login-on body.zf-login-theme #root form .zf-login-card,
  html.zf-login-on body.zf-login-theme #root form .MuiPaper-root,
  html.zf-login-on body.zf-login-theme #root form .MuiCard-root,
  html.zf-login-on body.zf-login-theme #root form > div:first-child {
    max-width: 92vw !important;
    padding: 0 !important;
  }

  #zf-login-logo { top: 16px; left: 18px; }
  #zf-login-logo img { height: 28px; }
  #zf-login-logo span { font-size: 16px; }
  #zf-login-tag { left: 18px; bottom: 16px; font-size: 10px; }
}
