/*
 * 登录页动效与一屏布局。只用于登录页与设置密码页，品牌浅色主题。
 * 品牌色：海辰蓝 #005FC7，深蓝 #00387A，强调蓝 #0F62FE，白，冷灰。
 * 动画只改 transform 与 opacity，进场动画不改变占位，不引起布局位移。
 * 系统开启减少动态效果时，全部动画关闭，内容直接显示。
 */
:root {
  --hxm-ease: cubic-bezier(.16, 1, .3, 1);
  --hxm-rise: 14px;
  --hxm-ink-blue: #8fc1ff;
}

/* 1. 一屏布局：桌面 100% 缩放下不出现纵向滚动 */
@media (min-width: 992px) {
  body.l8-login-page:not(:has(.cx-environment)) .cx-login-layout { min-height: 100dvh; }
  body.l8-login-page .cx-login-layout .cx-login-brand { min-height: 0; }
  body.l8-login-page .cx-login-photo { flex: 1 1 0; height: auto; min-height: 96px; max-height: 340px; }
  body.l8-login-page .cx-login-form.card { position: relative; align-self: center; margin: 28px 0 72px; }
}
@media (min-width: 992px) and (max-height: 900px) {
  body.l8-login-page .cx-login-layout .cx-login-brand { padding-top: 48px; }
  body.l8-login-page .cx-login-brand .cx-ribbon { margin-top: 36px; }
  body.l8-login-page .cx-login-brand .cx-login-statement { font-size: 40px; }
  body.l8-login-page .hx-login-steps { margin: 36px 0 24px; }
  body.l8-login-page .cx-login-form.card { margin: 20px 0 64px; padding: 30px 34px 20px; }
}
@media (min-width: 992px) and (max-height: 800px) {
  body.l8-login-page .cx-login-layout .cx-login-brand { padding-top: 40px; }
  body.l8-login-page .cx-login-brand .cx-ribbon { margin-top: 30px; }
  body.l8-login-page .cx-login-brand .cx-login-statement { margin-top: 14px; font-size: 36px; }
  body.l8-login-page .cx-login-brand .cx-login-statement + p { margin-top: 14px; font-size: 15px; line-height: 1.7; }
  body.l8-login-page .hx-login-steps { margin: 28px 0 20px; }
  body.l8-login-page .cx-login-form.card { margin: 16px 0 60px; padding: 26px 32px 16px; }
  body.l8-login-page .cx-login-form .login form { margin-top: 14px; }
}

/* 2. 表单：显示密码收为右侧文字按钮，与保持登录同一行 */
body.l8-login-page .cx-login-form .login form#password-login { grid-template-columns: minmax(0, 1fr) auto; grid-auto-flow: row dense; align-items: center; }
body.l8-login-page .cx-login-form .login form#password-login > :not(#password-visibility):not(.ht-remember) { grid-column: 1 / -1; }
body.l8-login-page #password-login .ht-remember { grid-column: 1; margin: 2px 0 0; }
body.l8-login-page .cx-login-form .login #password-visibility {
  grid-column: 2;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  margin: 2px 0 0;
  padding: 0 4px 0 2px;
  color: var(--hx-blue, #005fc7);
  background: transparent;
  border: 0;
  font-size: 14px;
  font-weight: 600;
}
body.l8-login-page .cx-login-form .login #password-visibility::before {
  content: "";
  width: 18px;
  height: 18px;
  background: center / 18px 18px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23005FC7' stroke-width='1.8'%3E%3Cpath d='M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12Z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
}
body.l8-login-page .cx-login-form .login #password-visibility[aria-pressed="true"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23005FC7' stroke-width='1.8'%3E%3Cpath d='M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12Z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='m3 3 18 18'/%3E%3C/svg%3E");
}
body.l8-login-page .cx-login-form .login #password-visibility:hover { color: var(--hx-navy, #00387a); background: transparent; text-decoration: underline; text-underline-offset: 3px; }

body.l8-login-page .cx-login-form .login .coord-password-control #password-visibility { width: 44px; min-height: 44px; margin: 0; padding: 0; gap: 0; justify-content: center; font-size: 0; line-height: 0; white-space: nowrap; overflow: hidden; }
body.l8-login-page .cx-login-form .login .coord-password-control #password-visibility:hover { text-decoration: none; background: rgba(0, 95, 199, .06); }

body.l8-login-page .cx-login-form .login .ht-code-login-off { margin-top: 8px; }

/* 3. 卡片质感与微交互 */
body.l8-login-page .cx-login-form.card {
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(11, 31, 58, .04), 0 28px 56px -32px rgba(0, 56, 122, .28);
}
body.l8-login-page .cx-login-form.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, #00387a 0%, #005fc7 55%, #0f62fe 100%);
  transform-origin: left center;
}
body.l8-login-page .cx-login-form .login input:not([type="checkbox"]),
.tl-form input {
  transition: border-color .2s ease, box-shadow .25s ease, background-color .2s ease;
}
body.l8-login-page .cx-login-form .login input:not([type="checkbox"]):hover { border-color: #5b7a99; }
body.l8-login-page .cx-login-form .login input:not([type="checkbox"]):focus,
body.l8-login-page .cx-login-form .login input:not([type="checkbox"]):focus-visible,
.tl-form input:focus,
.tl-form input:focus-visible {
  border-color: #005fc7;
  outline: 0;
  box-shadow: 0 0 0 4px rgba(0, 95, 199, .13);
}
body.l8-login-page .cx-login-form .login label { transition: color .2s ease; }
body.l8-login-page .cx-login-form .login label:has(+ input:focus) { color: #005fc7; }
body.l8-login-page .cx-login-form .login button[type="submit"],
.tl-submit {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: transform .2s var(--hxm-ease), box-shadow .25s ease, background-color .2s ease;
}
body.l8-login-page .cx-login-form .login button[type="submit"]::after,
.tl-submit::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: 0;
  left: 0;
  width: 45%;
  background: linear-gradient(105deg, transparent 0%, rgba(255, 255, 255, .22) 50%, transparent 100%);
  transform: translateX(-120%);
  pointer-events: none;
}
body.l8-login-page .cx-login-form .login button[type="submit"]:hover:not(:disabled),
.tl-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px -10px rgba(0, 95, 199, .6);
}
body.l8-login-page .cx-login-form .login button[type="submit"]:active:not(:disabled),
.tl-submit:active:not(:disabled) { transform: translateY(0) scale(.995); box-shadow: 0 4px 10px -6px rgba(0, 95, 199, .5); }
body.l8-login-page .cx-login-form .login button[type="submit"]:focus-visible,
.tl-submit:focus-visible { outline: 2px solid #0f62fe; outline-offset: 2px; }

/* 4. 品牌区光场与承诺链网络（装饰层，读屏忽略） */
.hx-motion {
  position: absolute;
  z-index: -2;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  contain: strict;
}
.hx-motion-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 78% 22%, #000 0%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 78% 22%, #000 0%, transparent 75%);
}
.hx-motion-field { position: absolute; inset: 0; transition: translate 1.2s var(--hxm-ease); }
.hx-motion-glow {
  position: absolute;
  border-radius: 50%;
  will-change: transform;
}
.hx-motion-glow--a { width: 760px; height: 760px; left: 38%; top: -340px; background: radial-gradient(circle, rgba(15, 98, 254, .42) 0%, rgba(15, 98, 254, 0) 66%); }
.hx-motion-glow--b { width: 620px; height: 620px; left: -220px; top: 22%; background: radial-gradient(circle, rgba(0, 95, 199, .5) 0%, rgba(0, 95, 199, 0) 68%); }
.hx-motion-glow--c { width: 480px; height: 480px; right: -160px; top: 34%; background: radial-gradient(circle, rgba(120, 178, 255, .2) 0%, rgba(120, 178, 255, 0) 70%); }
.hx-motion-net {
  position: absolute;
  top: 0;
  right: 0;
  width: min(62%, 720px);
  height: auto;
  opacity: .85;
  -webkit-mask-image: radial-gradient(ellipse 75% 85% at 82% 22%, #000 35%, transparent 80%);
  mask-image: radial-gradient(ellipse 75% 85% at 82% 22%, #000 35%, transparent 80%);
  transition: translate 1.4s var(--hxm-ease);
}
.hx-net-line { fill: none; stroke: rgba(196, 220, 255, .16); stroke-width: 1; vector-effect: non-scaling-stroke; }
.hx-net-chain { fill: none; stroke: rgba(196, 220, 255, .32); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.hx-net-trace { fill: none; stroke: var(--hxm-ink-blue); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 60 940; stroke-dashoffset: 1000; vector-effect: non-scaling-stroke; }
.hx-net-node { fill: rgba(214, 230, 255, .55); }
.hx-net-key { fill: #ffffff; }
.hx-net-halo { fill: none; stroke: rgba(143, 193, 255, .55); stroke-width: 1; transform-box: fill-box; transform-origin: center; opacity: 0; vector-effect: non-scaling-stroke; }

body.l8-login-page .cx-login-photo { -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 38%); mask-image: linear-gradient(180deg, transparent 0%, #000 38%); }

/* 步骤分隔线上的流光与步骤徽标依次点亮 */
body.l8-login-page .hx-login-steps { position: relative; clip-path: inset(-2px 0 0 0); }
body.l8-login-page .hx-login-steps::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 25%;
  height: 1px;
  background: linear-gradient(90deg, rgba(143, 193, 255, 0), #cfe3ff 50%, rgba(143, 193, 255, 0));
  opacity: 0;
  transform: translateX(-100%);
  pointer-events: none;
}
body.l8-login-page .hx-login-steps b { transition: background-color .3s ease, border-color .3s ease; }

/* 5. 设置密码页（浅色版） */
.tl-page { position: relative; isolation: isolate; }
.tl-body { overflow-x: hidden; }
.tl-body::before {
  content: "";
  position: fixed;
  z-index: -1;
  inset: -20vmax;
  background:
    radial-gradient(40vmax 34vmax at 22% 30%, rgba(0, 95, 199, .10), transparent 70%),
    radial-gradient(36vmax 30vmax at 82% 74%, rgba(15, 98, 254, .08), transparent 70%);
  pointer-events: none;
}
.tl-card { position: relative; overflow: hidden; }
.tl-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, #00387a 0%, #005fc7 55%, #0f62fe 100%);
  transform-origin: left center;
}
.tl-steps li { transition: border-color .25s ease, transform .25s var(--hxm-ease), box-shadow .25s ease; }
.tl-steps li:hover { border-color: #b9d2ef; transform: translateX(2px); box-shadow: 0 8px 18px -14px rgba(0, 56, 122, .45); }

/* 6. 动画，只在允许动态效果时启用 */
@media (prefers-reduced-motion: no-preference) {
  @keyframes hxm-rise { from { opacity: 0; transform: translate3d(0, var(--hxm-rise), 0); } to { opacity: 1; transform: none; } }
  @keyframes hxm-fade { from { opacity: 0; } to { opacity: 1; } }
  @keyframes hxm-bar { from { transform: scaleX(0); } to { transform: scaleX(1); } }
  @keyframes hxm-drift-a { 0% { transform: translate3d(0, 0, 0) scale(1); } 50% { transform: translate3d(-90px, 60px, 0) scale(1.08); } 100% { transform: translate3d(40px, 110px, 0) scale(.96); } }
  @keyframes hxm-drift-b { 0% { transform: translate3d(0, 0, 0) scale(1); } 50% { transform: translate3d(120px, -50px, 0) scale(1.06); } 100% { transform: translate3d(60px, 70px, 0) scale(1); } }
  @keyframes hxm-drift-c { 0% { transform: translate3d(0, 0, 0); } 100% { transform: translate3d(-80px, -90px, 0); } }
  @keyframes hxm-trace { from { stroke-dashoffset: 1000; } to { stroke-dashoffset: 0; } }
  @keyframes hxm-halo { 0%, 70%, 100% { opacity: 0; transform: scale(.6); } 8% { opacity: .9; } 30% { opacity: 0; transform: scale(2.6); } }
  @keyframes hxm-node { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
  @keyframes hxm-sweep { 0% { opacity: 0; transform: translateX(-100%); } 15% { opacity: 1; } 70% { opacity: 1; } 85%, 100% { opacity: 0; transform: translateX(300%); } }
  @keyframes hxm-step { 0%, 100% { background-color: transparent; border-color: #d3e1f0; } 6%, 18% { background-color: rgba(143, 193, 255, .22); border-color: #ffffff; } 30% { background-color: transparent; border-color: #d3e1f0; } }
  @keyframes hxm-photo { from { transform: scale(1.02) translate3d(0, 0, 0); } to { transform: scale(1.08) translate3d(-1.5%, -1%, 0); } }
  @keyframes hxm-sheen { from { transform: translateX(-120%); } to { transform: translateX(260%); } }

  /* 品牌区进场：依次淡入上浮 */
  body.l8-login-page .cx-login-brand > img,
  body.l8-login-page .cx-login-brand .cx-ribbon,
  body.l8-login-page .cx-login-brand .cx-login-statement,
  body.l8-login-page .cx-login-brand .cx-login-statement + p,
  body.l8-login-page .hx-login-steps li,
  body.l8-login-page .cx-login-brand .cx-login-brand-foot { animation: hxm-rise .36s var(--hxm-ease) both; }
  body.l8-login-page .cx-login-brand > img { animation-delay: 0s; }
  body.l8-login-page .cx-login-brand .cx-ribbon { animation-delay: .03s; }
  body.l8-login-page .cx-login-brand .cx-login-statement { animation-delay: .06s; }
  body.l8-login-page .cx-login-brand .cx-login-statement + p { animation-delay: .09s; }
  body.l8-login-page .hx-login-steps li:nth-child(1) { animation-delay: .1s; }
  body.l8-login-page .hx-login-steps li:nth-child(2) { animation-delay: .12s; }
  body.l8-login-page .hx-login-steps li:nth-child(3) { animation-delay: .14s; }
  body.l8-login-page .hx-login-steps li:nth-child(4) { animation-delay: .16s; }
  body.l8-login-page .cx-login-brand .cx-login-brand-foot { animation-delay: .18s; }
  body.l8-login-page .cx-login-photo { animation: hxm-fade .6s ease-out both; }
  body.l8-login-page .cx-login-photo img { animation: hxm-photo 36s ease-in-out 1s infinite alternate; will-change: transform; }

  /* 表单区进场：表单是要操作的内容，不等待，进场不超过 0.2 秒 */
  body.l8-login-page .cx-login-form.card { animation: hxm-rise .2s var(--hxm-ease) both; }
  body.l8-login-page .cx-login-form.card::before { animation: hxm-bar .5s var(--hxm-ease) .1s both; }
  body.l8-login-page .cx-footer { animation: hxm-fade .3s ease-out both; }

  /* 光场与网络 */
  .hx-motion { animation: hxm-fade .6s ease-out both; }
  .hx-motion-glow--a { animation: hxm-drift-a 26s ease-in-out infinite alternate; }
  .hx-motion-glow--b { animation: hxm-drift-b 32s ease-in-out infinite alternate; }
  .hx-motion-glow--c { animation: hxm-drift-c 22s ease-in-out infinite alternate; }
  .hx-net-trace { animation: hxm-trace 7s cubic-bezier(.45, 0, .2, 1) 1.2s infinite; }
  .hx-net-trace--b { animation-duration: 9s; animation-delay: 4.6s; }
  .hx-net-halo { animation: hxm-halo 7s ease-out infinite; }
  .hx-net-halo:nth-of-type(1) { animation-delay: 1.4s; }
  .hx-net-halo:nth-of-type(2) { animation-delay: 2.9s; }
  .hx-net-halo:nth-of-type(3) { animation-delay: 4.4s; }
  .hx-net-halo:nth-of-type(4) { animation-delay: 5.9s; }
  .hx-net-node { animation: hxm-node 5s ease-in-out infinite; }
  .hx-net-node:nth-of-type(3n) { animation-delay: 1.7s; }
  .hx-net-node:nth-of-type(3n+1) { animation-delay: 3.3s; }

  body.l8-login-page .hx-login-steps::before { animation: hxm-sweep 6s ease-in-out 1.6s infinite; }
  body.l8-login-page .hx-login-steps b { animation: hxm-step 8s ease-in-out infinite; }
  body.l8-login-page .hx-login-steps li:nth-child(1) b { animation-delay: 1.6s; }
  body.l8-login-page .hx-login-steps li:nth-child(2) b { animation-delay: 3.6s; }
  body.l8-login-page .hx-login-steps li:nth-child(3) b { animation-delay: 5.6s; }
  body.l8-login-page .hx-login-steps li:nth-child(4) b { animation-delay: 7.6s; }

  body.l8-login-page .cx-login-form .login button[type="submit"]:hover:not(:disabled)::after,
  .tl-submit:hover:not(:disabled)::after { animation: hxm-sheen .9s var(--hxm-ease) both; }

  /* 设置密码页 */
  .tl-brand > *, .tl-steps li { animation: hxm-rise .36s var(--hxm-ease) both; }
  .tl-brand > :nth-child(2) { animation-delay: .03s; }
  .tl-brand > :nth-child(3) { animation-delay: .06s; }
  .tl-steps li:nth-child(1) { animation-delay: .08s; }
  .tl-steps li:nth-child(2) { animation-delay: .1s; }
  .tl-steps li:nth-child(3) { animation-delay: .12s; }
  .tl-card { animation: hxm-rise .2s var(--hxm-ease) both; }
  .tl-card::before { animation: hxm-bar .5s var(--hxm-ease) .1s both; }
  .tl-body::before { animation: hxm-drift-c 24s ease-in-out infinite alternate; }

  /* 标签页不可见时暂停循环动画，省电 */
  html.hxm-paused .hx-motion *,
  html.hxm-paused .cx-login-photo img,
  html.hxm-paused .hx-login-steps::before,
  html.hxm-paused .hx-login-steps b { animation-play-state: paused; }
}

/* 减少动态效果：全部静止，内容直接可见 */
@media (prefers-reduced-motion: reduce) {
  .hx-motion *, .hx-motion, .hx-login-steps::before, .tl-body::before { animation: none !important; transition: none !important; }
  body.l8-login-page *, .tl-body * { animation: none !important; transition-duration: 0s !important; }
  .hx-net-trace { stroke-dasharray: none; stroke-dashoffset: 0; opacity: .5; }
}

/* 6. 手机：正常滚动，表单尽量靠前 */
@media (max-width: 700px) {
  .hx-motion-net { width: 120%; opacity: .55; }
  .hx-motion-glow--a { width: 520px; height: 520px; left: 20%; top: -260px; }
  .hx-motion-glow--b { width: 420px; height: 420px; }
  body.l8-login-page:not(:has(.cx-environment)) .cx-login-layout { align-content: start; }
  body.l8-login-page:not(:has(.cx-environment)) .cx-login-layout .cx-login-brand { display: block; }
  body.l8-login-page:not(:has(.cx-environment)) .cx-login-photo { top: 0; width: calc(100% + 32px); height: 120px; margin: 20px -16px -22px; }
  body.l8-login-page:not(:has(.cx-environment)) .hx-login-steps { margin: 24px 0 0; }
  body.l8-login-page:not(:has(.cx-environment)) .cx-login-brand > img { display: block; }
  body.l8-login-page:not(:has(.cx-environment)) .cx-login-brand .cx-ribbon { display: flex; width: max-content; margin-top: 18px; }
  body.l8-login-page:not(:has(.cx-environment)) .cx-login-brand .cx-login-brand-foot { display: none; }
  body.l8-login-page .cx-login-form.card { box-shadow: none; }
}
