/* 5LAOBAN-1781 首页新增动效（在 v9 之上，仁洲 10-27「在 v9 上再加更炫的效果」）：
   ① 首屏业务流光线（小组件 ↔ 标题）② 标题流光扫过 ③ 小组件鼠标视差与光泽 ④ 模块排按业务顺序依次点亮 ⑤ 全景窗口边框流光。
   只用 CSS 动画与一小段脚本（home-fx.js）；系统开了「减少动态效果」时全部不播。 */

@property --fx-a {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

/* ① 业务流光线：脚本按小组件与标题的位置画三条弧线。
   画在小组件上面一层（线只到卡片边缘、不压卡片内容），接头才是完整的圆点，不会被卡片盖掉半个 */
.fx-beams {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.fx-beams .fx-rail {
  fill: none;
  stroke: url(#fx-rail-grad);
  stroke-width: 1.4;
  stroke-dasharray: 2 7;
  stroke-linecap: round;
  opacity: .55;
}
.fx-beams .fx-pulse {
  fill: none;
  stroke: url(#fx-pulse-grad);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-dasharray: 46 1400;
  stroke-dashoffset: 46;
  filter: drop-shadow(0 0 6px rgba(79, 107, 255, .75));
  animation: fx-pulse 3.6s cubic-bezier(.45, .05, .35, 1) infinite;
}
.fx-beams .fx-pulse:nth-of-type(2) { animation-delay: 1.2s; }
.fx-beams .fx-pulse:nth-of-type(3) { animation-delay: 2.4s; }
.fx-beams .fx-node {
  fill: #fff;
  stroke: #4f6bff;
  stroke-width: 2;
  filter: drop-shadow(0 1px 3px rgba(79, 107, 255, .45));
}
.fx-beams .fx-halo {
  fill: rgba(79, 107, 255, .18);
  animation: fx-node 3.6s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes fx-pulse {
  0% { stroke-dashoffset: 46; opacity: 0; }
  8% { opacity: 1; }
  85% { opacity: 1; }
  100% { stroke-dashoffset: calc(-1 * var(--fx-len, 600px)); opacity: 0; }
}
@keyframes fx-node {
  0%, 100% { transform: scale(.6); opacity: .9; }
  50% { transform: scale(1.25); opacity: .35; }
}

/* ② 标题流光：逐字浮现结束后，一道蓝紫光逐字扫过 */
.d9 h1.fx-glint .d9-ch {
  background-image: linear-gradient(100deg, var(--ink9) 0 38%, #4f6bff 44%, #7b5cff 50%, #22b8ff 56%, var(--ink9) 62% 100%);
  background-size: 400% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: fx-glint 5.2s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * 55ms);
}
@keyframes fx-glint {
  0%, 55% { background-position: 100% 0; }
  80%, 100% { background-position: 0 0; }
}

/* ③ 小组件视差与光泽：位移走独立的 translate 属性，不碰 v9 入场用的 transform */
.d9-wid {
  translate: var(--fx-x, 0px) var(--fx-y, 0px);
  transition: opacity .8s cubic-bezier(.2, .8, .2, 1), transform .8s cubic-bezier(.2, .8, .2, 1), translate .5s cubic-bezier(.2, .8, .2, 1);
}
.d9-wid::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(160px circle at var(--fx-mx, 50%) var(--fx-my, -40%), rgba(255, 255, 255, .75), rgba(255, 255, 255, 0) 60%);
  mix-blend-mode: soft-light;
  opacity: 0;
  transition: opacity .4s;
}
.d9.fx-hover .d9-wid::after { opacity: 1; }
.d9.fx-hover .d9-wid {
  box-shadow: 0 24px 50px -18px rgba(30, 40, 110, .3), 0 0 0 1px rgba(79, 107, 255, .14);
}

/* ④ 模块排流水灯：按 LTC → CPQ → OTS → STL → … 依次点亮 */
.d9-mods a { position: relative; }
.d9-mods a::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: -9px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, #4f6bff, #7b5cff, #22b8ff);
  box-shadow: 0 0 10px rgba(79, 107, 255, .7);
  transform: scaleX(0);
  opacity: 0;
}
.d9-mods.fx-run a b { animation: fx-run-b 7.2s ease-in-out infinite; animation-delay: calc(var(--fx-i, 0) * .6s); }
.d9-mods.fx-run a::after { animation: fx-run-bar 7.2s ease-in-out infinite; animation-delay: calc(var(--fx-i, 0) * .6s); }
@keyframes fx-run-b {
  0%, 12%, 100% { color: inherit; text-shadow: none; }
  4%, 7% { color: #4f6bff; text-shadow: 0 0 14px rgba(79, 107, 255, .45); }
}
@keyframes fx-run-bar {
  0%, 12%, 100% { transform: scaleX(0); opacity: 0; }
  4%, 7% { transform: scaleX(1); opacity: 1; }
}

/* ⑤ 全景窗口边框流光 */
.fx-beam {
  position: absolute;
  inset: -1px;
  z-index: 3;
  padding: 2px;
  border-radius: inherit;
  pointer-events: none;
  background: conic-gradient(from var(--fx-a), transparent 0 64%, rgba(79, 107, 255, .0) 66%, #4f6bff 78%, #7b5cff 86%, #22b8ff 93%, transparent 100%);
  -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;
  animation: fx-spin 6s linear infinite;
}
.fx-beam.fx-beam-glow { filter: blur(10px); opacity: .55; inset: -3px; padding: 4px; }
@keyframes fx-spin { to { --fx-a: 360deg; } }

@media (prefers-reduced-motion: reduce) {
  .fx-beams .fx-pulse, .fx-beam { display: none; }
  .fx-beams .fx-halo, .d9 h1.fx-glint .d9-ch, .d9-mods.fx-run a b, .d9-mods.fx-run a::after { animation: none; }
  .d9 h1.fx-glint .d9-ch { background: none; -webkit-text-fill-color: currentColor; }
  .d9-wid { translate: none; }
}
