/* ===========================================================================
   矩阵生长 · 统一加载态（18 点交错点阵 · v2 标志 · AI Loading）
   —— 对应 2026-11-04 定稿的标志：两组 3×3 点阵半格错位，共 18 点，
      浅阵 #BECFF9 / 深阵 #3B6DE8，两阵中心各一点放大到 1.32×（常亮呼吸）。

   为什么放在 public/ 而不是 src/styles/：
   启动画面要在 JS bundle 到达**之前**就画出来，样式必须随首个 HTML 一起到达。
   同时 React 组件复用同一份类名，避免「启动画面一套、组件一套」两处漂移。

   与源稿（白底版）的差异只有配色，且刻意最小化：
     标题 #1E293B → 云白 #FFFFFF（暗底唯一选择）
     副文 #64748B → #8C99B3（岩灰对暗底对比只有 4.1:1，沿用本站既有副文本色 6.8:1）
     进度条槽 #E2E8F0 → rgba(190,207,249,.16)（白槽在暗底会抢视线）
     闪烁色 #3D6BF0 → #EAF0FF（暗底要把「激活」画得更亮，而不是更深）
     标志投影 .10 → .18（同样的投影强度在暗底上会弱一半）
   点本身的颜色**一个都没动** —— 那就是品牌资产 matrix-growth-mark-dark.svg 的授权配色。

   动画两层（与源稿一致）：
     · 雷达脉冲：纯 CSS，逐点 animation-delay = 距中心距离 × 6ms，光波由内向外；
     · 随机突触闪烁：JS 每 200ms 随机点亮 1~2 个点，模拟 token 逐个生成，
       用 !important 压过脉冲动画（源稿同样靠优先级解决两者抢同一个 transform）。
   =========================================================================== */

.bl {
  --bl-mark: 180px;                        /* 标志外框（含画板留白） */
  --bl-gap: 48px;                          /* 标志与文字间距 */
  --bl-light: #becff9;                     /* 浅阵 · 品牌资产原色 */
  --bl-deep: #3b6de8;                      /* 深阵 · 品牌资产原色 */
  --bl-spark: #eaf0ff;                     /* 突触闪烁：暗底上的「最亮」阶 */
  --bl-glow: rgba(59, 109, 232, 0.7);      /* 脉冲光晕 */
  --bl-text: #ffffff;
  --bl-sub: #8c99b3;
  --bl-bar: rgba(190, 207, 249, 0.16);
  --bl-bg: #0a0a0f;                        /* = --cyber-bg */

  display: flex;
  align-items: center;
  gap: var(--bl-gap);
  font-family: "Inter", "Noto Sans SC", -apple-system, BlinkMacSystemFont,
    "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* 全屏启动态：盖住首屏，React 挂载后由 main.tsx 移除 */
.bl--fullscreen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  justify-content: center;
  background: var(--bl-bg);
  transition: opacity 0.3s ease;
}
.bl--fullscreen.is-out {
  opacity: 0;
}

/* 紧凑态：用于路由 / 局部加载，不铺满 */
.bl--inline {
  justify-content: center;
  padding: 40px 0;
}

/* ---------- 18 点交错点阵 ---------- */

.bl-mark {
  width: var(--bl-mark);
  height: var(--bl-mark);
  flex: none;
  /* 整枚标志的柔和蓝晕，与源稿在白底上的 drop-shadow 等义 */
  filter: drop-shadow(0 8px 24px rgba(59, 109, 232, 0.18));
  /* 脉冲会把点放大到 1.32×，靠近边界的点会略微出框，不要裁掉 */
  overflow: visible;
}

.bl-dot {
  /* fill-box + center：让每一点绕**自己的圆心**缩放，而不是绕画板原点 */
  transform-box: fill-box;
  transform-origin: center;
  transition:
    transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275),
    fill 0.2s ease,
    filter 0.35s ease;
}
.bl-dot--light {
  fill: var(--bl-light);
}
.bl-dot--deep {
  fill: var(--bl-deep);
}

/* 两阵中心的那一对：常亮心跳，永不参与脉冲与闪烁 */
.bl-dot.is-core {
  animation: bl-breathe 2.4s infinite ease-in-out;
}
@keyframes bl-breathe {
  0%,
  100% {
    transform: scale(1);
    filter: drop-shadow(0 0 0 rgba(59, 109, 232, 0));
  }
  50% {
    transform: scale(1.16);
    filter: drop-shadow(0 0 9px rgba(59, 109, 232, 0.55));
  }
}

/* 雷达脉冲：周期 1.5s，亮起 → 回落共占 ~46%（约 690ms，含回弹）。
   逐点延迟 = 距离 × 6ms（最远 205.1 → 1231ms），于是光波由中心向外扩散；
   周期相同 ⟹ 相位差恒定，波是持续的，不只第一轮。 */
.bl-dot:not(.is-core) {
  animation: bl-pulse 1.5s infinite linear;
  animation-delay: calc(var(--bl-dist, 0) * 6ms);
}
@keyframes bl-pulse {
  0% {
    transform: scale(1);
    filter: drop-shadow(0 0 0 rgba(59, 109, 232, 0));
  }
  14% {
    transform: scale(1.32);
    filter: drop-shadow(0 0 7px var(--bl-glow));
  }
  28% {
    transform: scale(1.32);
    filter: drop-shadow(0 0 7px var(--bl-glow));
  }
  46%,
  100% {
    transform: scale(1);
    filter: drop-shadow(0 0 0 rgba(59, 109, 232, 0));
  }
}

/* 随机突触闪烁 —— 由 JS 随机点亮。
   必须 !important：普通声明赢不了正在跑的 @keyframes 动画。 */
.bl-dot.is-spark {
  fill: var(--bl-spark) !important;
  transform: scale(1.55) !important;
  filter: drop-shadow(0 0 11px rgba(45, 91, 230, 0.9)) !important;
}

/* ---------- 右侧文字区 ---------- */

.bl-text {
  display: flex;
  flex-direction: column;
}

.bl-title {
  font-family: "Inter", "Noto Sans SC", sans-serif;
  font-size: 44px;
  font-weight: 800;
  color: var(--bl-text);
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.bl-sub {
  font-size: 18px;
  font-weight: 500;
  color: var(--bl-sub);
  margin-top: 10px;
  letter-spacing: 2px;
  animation: bl-text-pulse 2s infinite alternate;
}
@keyframes bl-text-pulse {
  0% {
    opacity: 0.55;
  }
  100% {
    opacity: 1;
  }
}

/* 底部流光加载条 */
.bl-bar {
  height: 4px;
  background-color: var(--bl-bar);
  border-radius: 2px;
  margin-top: 18px;
  width: 170px;
  overflow: hidden;
  position: relative;
}
.bl-bar-fill {
  position: absolute;
  left: -40%;
  height: 100%;
  width: 40%;
  background-color: var(--bl-deep);
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(59, 109, 232, 0.6);
  animation: bl-bar-move 1.5s infinite cubic-bezier(0.65, 0, 0.35, 1);
}
@keyframes bl-bar-move {
  0% {
    left: -40%;
  }
  100% {
    left: 100%;
  }
}

/* 尺寸变体 */
.bl--sm {
  --bl-mark: 96px;
  --bl-gap: 24px;
}
.bl--sm .bl-title {
  font-size: 26px;
}
.bl--sm .bl-sub {
  font-size: 14px;
  margin-top: 6px;
}
.bl--sm .bl-bar {
  width: 120px;
  margin-top: 12px;
}

@media (max-width: 640px) {
  .bl {
    --bl-mark: 132px;
    --bl-gap: 24px;
  }
  .bl-title {
    font-size: 30px;
  }
  .bl-sub {
    font-size: 15px;
    letter-spacing: 1px;
  }
  .bl-bar {
    width: 130px;
  }
}

/* 窄屏保持「标志在左、文字在右」的横向组合，整体等比缩小。
   实测 360 / 320 宽时若仍用 132px 标志 + 30px 标题，文字区会顶到视口右边缘
   （right 恰等于 vw，看起来像被裁掉）。缩到 104 + 26 后两侧都有 20px 以上余量。 */
@media (max-width: 480px) {
  .bl {
    --bl-mark: 104px;
    --bl-gap: 18px;
  }
  .bl-title {
    font-size: 26px;
  }
  .bl-sub {
    font-size: 14px;
    letter-spacing: 0.5px;
    margin-top: 6px;
  }
  .bl-bar {
    width: 118px;
    margin-top: 12px;
  }
}

/* 尊重系统「减少动态效果」偏好：保留静态可读形态，去掉持续动画 */
@media (prefers-reduced-motion: reduce) {
  .bl-dot,
  .bl-sub,
  .bl-bar-fill {
    animation: none !important;
  }
  .bl-bar-fill {
    left: 0;
    width: 100%;
    opacity: 0.7;
  }
}
