/* ══════════════════════════════════════════════════════════════════════
   AICraft 国际站 · ReactBits 效果层（2026-11-16）
   ReactBits (https://reactbits.dev) · MIT + Commons Clause · © 2026 David Haz
   本层为原生 CSS/JS 移植版，仅替换 React 外壳：
     LineWaves   → 首屏动态线场背景（WebGL2，着色器原样）
     ShinyText   → h1 强调字段流光
     StarBorder  → 主 CTA 星轨描边
     BorderGlow  → 控制台面板呼吸光 + 指针跟随边光
     SpotlightCard → 定价卡指针光斑
   全部遵守 prefers-reduced-motion；LineWaves 拿不到 WebGL2 时退回静态极光。
   ══════════════════════════════════════════════════════════════════════ */

/* ── ① LineWaves 动态背景 ──────────────────────────────────────────── */
/* 换掉 Aurora 的原因：极光是「雾」，白底上雾看不出在动（实测像素差 0.1–20%，
   但人眼读不出来）。细线波场是「结构在动」，同样的透明度下一眼能看见。
   仍然只在上半屏显影、往下 mask 化到白 —— 白底页面的动态背景不能抢字。 */
#hero-waves{
  position:absolute;inset:0;overflow:hidden;pointer-events:none;z-index:-1;
  opacity:.95;
  -webkit-mask-image:linear-gradient(180deg,#000 0%,#000 26%,rgba(0,0,0,.4) 44%,transparent 62%);
  mask-image:linear-gradient(180deg,#000 0%,#000 26%,rgba(0,0,0,.4) 44%,transparent 62%);
}
#hero-waves canvas{display:block;width:100%;height:100%}
/* WebGL 起来了就把静态极光收掉，免得两层叠成脏色 */
html body .hero.hero-band.rb-live::before{opacity:0;transition:opacity .8s}

/* ── ② ShinyText：强调字段流光 ─────────────────────────────────────── */
/* 原件是给深底用的（浅字 + 白色高光带）。白底上照搬会得到「白字消字」，
   所以换成「整条渐变都够暗，靠色带滑动表达流光」。五个色标对白底的对
   比度：1e3ad0 8.5 · 4338ca 7.4 · 6d4aff 5.3 · 8b5cf6 4.0 · 0e9bb8 3.4
   —— 大字号最低要求 3:1，全程达标。 */
html body .hero.hero-band h1 em{
  background:linear-gradient(100deg,
    #1e3ad0 0%, #4338ca 16%, #6d4aff 32%, #8b5cf6 46%,
    #0e9bb8 62%, #1e3ad0 78%, #1e3ad0 100%);
  background-size:220% 100%;
  -webkit-background-clip:text;background-clip:text;
  -webkit-text-fill-color:transparent;color:transparent;
  animation:rb-shine 9s linear infinite;
}
@keyframes rb-shine{
  from{background-position:110% 0}
  to{background-position:-110% 0}
}

/* ── ③ StarBorder：主 CTA 星轨 ────────────────────────────────────── */
@property --rb-a{syntax:'<angle>';initial-value:0deg;inherits:false}
html body .hero.hero-band .hero-actions .btn-primary{
  position:relative;isolation:isolate;overflow:visible;
}
html body .hero.hero-band .hero-actions .btn-primary::before{
  content:"";position:absolute;inset:0;border-radius:inherit;padding:2.4px;
  pointer-events:none;
  background:conic-gradient(from var(--rb-a),
    rgba(255,255,255,0) 0deg, rgba(255,255,255,0) 206deg,
    rgba(255,255,255,.35) 250deg, rgba(255,255,255,1) 288deg,
    rgba(190,214,255,1) 308deg, rgba(255,255,255,.25) 330deg,
    rgba(255,255,255,0) 360deg);
  -webkit-mask:linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask:linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite:xor;mask-composite:exclude;
  animation:rb-lap 2.8s linear infinite;
}
@keyframes rb-lap{to{--rb-a:360deg}}

/* ── ④ BorderGlow：控制台面板呼吸光 ───────────────────────────────── */
.hx{position:relative;animation:rb-breathe 6.5s ease-in-out infinite}
@keyframes rb-breathe{
  0%,100%{box-shadow:0 40px 80px -44px rgba(15,23,42,.55),
                     0 0 0 1px rgba(47,84,235,.10),
                     0 0 0 0 rgba(47,84,235,0)}
  50%    {box-shadow:0 40px 80px -44px rgba(15,23,42,.55),
                     0 0 0 1px rgba(47,84,235,.30),
                     0 0 34px -4px rgba(47,84,235,.55)}
}
/* 指针跟随的一圈边光 */
.hx::after{
  content:"";position:absolute;inset:0;border-radius:inherit;padding:1.2px;
  pointer-events:none;opacity:0;transition:opacity .35s;
  background:radial-gradient(220px 220px at var(--rb-mx,50%) var(--rb-my,0%),
    rgba(150,180,255,.95), rgba(120,150,255,0) 72%);
  -webkit-mask:linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask:linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite:xor;mask-composite:exclude;
}
.hx:hover::after{opacity:1}

/* ── ④b 控制台流式打字：光标 + 路由命中高亮 + 读屏全量副本 ───────── */
.hx-full{
  position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;
  overflow:hidden;clip-path:inset(50%);white-space:nowrap;
}
.hx-cur{
  display:inline-block;width:.5em;height:1.05em;margin-left:2px;
  vertical-align:-.16em;border-radius:1px;background:currentColor;opacity:.75;
  animation:rb-blink 1.06s steps(1,end) infinite;
}
@keyframes rb-blink{0%,49%{opacity:.75}50%,100%{opacity:0}}
.hx-route .pill{transition:box-shadow .25s,background-color .25s}
.hx-route.hx-hit .pill{
  background-color:rgba(47,84,235,.16);
  box-shadow:0 0 0 1px rgba(47,84,235,.55), 0 0 16px -2px rgba(47,84,235,.75);
}
.hx-route.hx-hit .to{opacity:1;transition:opacity .2s}

/* ── ⑤ SpotlightCard：定价卡指针光斑 ──────────────────────────────── */
.pc{position:relative}
.pc .rb-spot{
  position:absolute;inset:0;border-radius:inherit;pointer-events:none;
  opacity:0;transition:opacity .3s;
  background:radial-gradient(240px 240px at var(--rb-mx,50%) var(--rb-my,50%),
    rgba(47,84,235,.15), rgba(47,84,235,0) 70%);
}
.pc.rb-spot-on .rb-spot{opacity:1}

/* ── ⑤b 定价卡：一圈极慢的星轨描边 ────────────────────────────────── */
/* 定价段是整页最静的一屏（实测像素差 0.0–0.3%）。三张卡各挂一道与主
   CTA 同族的 conic 弧光，7.2s 一圈 —— 慢到不抢数字，但一直有东西在走。
   用 ::after，因为 ::before 已被 BEST VALUE / GLOBAL 徽标占用。 */
.pc::after{
  content:"";position:absolute;inset:-2px;pointer-events:none;
  border-radius:calc(var(--radius) + 2px);padding:2px;opacity:.5;
  background:conic-gradient(from var(--rb-a),
    rgba(47,84,235,0) 0deg, rgba(47,84,235,.9) 48deg,
    rgba(124,92,255,.9) 96deg, rgba(14,155,184,.6) 132deg,
    rgba(47,84,235,0) 190deg, rgba(47,84,235,0) 360deg);
  -webkit-mask:linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask:linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite:xor;mask-composite:exclude;
  animation:rb-lap 7.2s linear infinite;
}
.pc.glb::after{animation-delay:-2.4s}
.pc.pop::after{animation-delay:-4.8s}

/* ── ⑥ 全页分区动效 ───────────────────────────────────────────────── */
/* 效果不能只堆在首屏。每个 .sec 自带一块 .rb-bg 背板：
   模型库是 Threads 线束，Quick Start 是 Beams 辉光。
   z-index 用 -1 + isolation：背板画在 section 自己的背景之上、所有正文之下。
   正 z-index 会让半透明光斑盖在字上；裸负 z-index 会被 section 背景遮住 ——
   isolation 把 section 变成独立层叠上下文，两头才对。 */
.sec{position:relative;isolation:isolate}
.rb-host{position:relative;isolation:isolate}
.sec > .rb-bg,
.rb-host > .rb-bg{
  position:absolute;inset:0;z-index:-1;pointer-events:none;overflow:hidden;
}
.sec > .rb-bg .rb-cv{
  position:absolute;inset:0;display:block;width:100%;height:100%;
}
.sec > .sec-inner{position:relative;z-index:1}

/* 点阵只当纹理：上下淡出，别在边界处被硬切一刀 */
#models-threads{
  opacity:.9;
  -webkit-mask-image:linear-gradient(180deg,transparent 0%,#000 14%,#000 82%,transparent 100%);
  mask-image:linear-gradient(180deg,transparent 0%,#000 14%,#000 82%,transparent 100%);
}
/* 深色带的辉光：左右收一点，避免和上下白底硬碰 */
#docs-beams{
  -webkit-mask-image:linear-gradient(90deg,transparent 0%,#000 12%,#000 88%,transparent 100%);
  mask-image:linear-gradient(90deg,transparent 0%,#000 12%,#000 88%,transparent 100%);
}

/* ── ⑥b CSS 漂移光斑（rb-orb）──────────────────────────────────────
   定价 / 缓存 / 路由 / 隐私四节不再开 WebGL —— 全页只留两个上下文，
   其余用两团 radial 光斑以 transform 缓慢漂移。transform 走合成层，
   不重排、不重绘滤镜，手机上也只是两块半透明图层。
   radial-gradient 自己就是软边，不用 blur（blur 才是真的花钱）。 */
.sec > .rb-bg.rb-orb,
.rb-host > .rb-bg.rb-orb{
  opacity:.62;
  -webkit-mask-image:linear-gradient(180deg,transparent 0%,#000 14%,#000 86%,transparent 100%);
  mask-image:linear-gradient(180deg,transparent 0%,#000 14%,#000 86%,transparent 100%);
}
.sec > .rb-bg.rb-orb::before,
.sec > .rb-bg.rb-orb::after,
.rb-host > .rb-bg.rb-orb::before,
.rb-host > .rb-bg.rb-orb::after{
  content:"";position:absolute;width:52%;aspect-ratio:1/1;border-radius:50%;
  will-change:transform;
}
.sec > .rb-bg.rb-orb::before,
.rb-host > .rb-bg.rb-orb::before{
  left:-10%;top:-6%;
  background:radial-gradient(circle,rgba(47,84,235,.30) 0%,rgba(47,84,235,.14) 42%,rgba(47,84,235,0) 68%);
  animation:rb-drift-a 27s ease-in-out infinite;
}
.sec > .rb-bg.rb-orb::after,
.rb-host > .rb-bg.rb-orb::after{
  right:-12%;bottom:-10%;
  background:radial-gradient(circle,rgba(124,92,255,.26) 0%,rgba(14,155,184,.12) 45%,rgba(124,92,255,0) 70%);
  animation:rb-drift-b 34s ease-in-out infinite;
}
@keyframes rb-drift-a{
  0%,100%{transform:translate3d(0,0,0) scale(1)}
  50%    {transform:translate3d(26%,20%,0) scale(1.16)}
}
@keyframes rb-drift-b{
  0%,100%{transform:translate3d(0,0,0) scale(1.08)}
  50%    {transform:translate3d(-24%,-18%,0) scale(.9)}
}
/* 深色主题下同一团光更"亮眼"，压一档，免得盖过卡片 */
body.dark .rb-bg.rb-orb{opacity:.45}
/* 相邻两节错开相位，不然四节同时呼吸，反而看出是同一个动画 */
#cache-orb::before{animation-delay:-9s}
#cache-orb::after{animation-delay:-6s}
#router-orb::before{animation-delay:-16s}
#router-orb::after{animation-delay:-14s}
#privacy-orb::before{animation-delay:-22s}
#privacy-orb::after{animation-delay:-19s}
/* 内页的背板由 rb-fx.js 现插，没有 id —— 按插入序号错相位 */
.rb-orb-2::before{animation-delay:-9s}
.rb-orb-2::after{animation-delay:-6s}
.rb-orb-3::before{animation-delay:-16s}
.rb-orb-3::after{animation-delay:-14s}
.rb-orb-4::before{animation-delay:-22s}
.rb-orb-4::after{animation-delay:-19s}

/* 分区小标题下划线：进视口后由左至右画出来 */
.sec-label{position:relative}
.sec-label::after{
  content:"";position:absolute;left:50%;bottom:-9px;height:2px;width:0;
  border-radius:2px;transform:translateX(-50%);
  background:linear-gradient(90deg,#2f54eb,#7c5cff 65%,rgba(124,92,255,0));
  transition:width .9s cubic-bezier(.22,.7,.2,1) .12s;
}
.sec-inner.rb-in .sec-label::after,
.sec.rb-in .sec-label::after{width:46px}

/* 每个分区标题都带一条缓慢横掠的品牌色光带 —— 与首屏 h1 的 ShinyText 同源。
   底色仍是正文墨色 #0f172a，光带经过时最亮到 #2f54eb（对白底 8.5:1）和
   #7c5cff（5.3:1），大字号全程达标，不会出现「白字消字」。 */
@supports ((-webkit-background-clip:text) or (background-clip:text)){
  html body .sec-title{
    background-image:linear-gradient(100deg,
      #0f172a 0%, #0f172a 38%, #2f54eb 47%, #7c5cff 51%, #0f172a 60%, #0f172a 100%);
    background-size:260% 100%;
    -webkit-background-clip:text;background-clip:text;
    -webkit-text-fill-color:transparent;
    /* 同时保留 v4.css 的滚动入场（v4-rise 走 view() 时间轴），
       两条动画并列，别把入场顶掉 */
    animation-name:v4-rise, rb-sweep;
    animation-duration:auto, 11s;
    animation-timing-function:linear, linear;
    animation-fill-mode:both, none;
    animation-iteration-count:1, infinite;
    animation-timeline:view(), auto;
  }
  /* 深色带（Quick Start）用白底光带，深色光带在白字上等于没字 */
  html body #docs .sec-title{
    background-image:linear-gradient(100deg,
      #ffffff 0%, #ffffff 38%, #a9c1ff 47%, #c9b6ff 51%, #ffffff 60%, #ffffff 100%);
  }
  /* ⛔ 深色主题（body.dark）必须换浅色带。
     这条是上线后回头补的：整站有明暗开关，上面那条 `-webkit-text-fill-color:
     transparent` 一旦把字变透明，深底上再叠深墨渐变 = 标题整条消失。
     深色态实测 fill 为 rgba(0,0,0,0)、肉眼几乎看不到标题。 */
  body.dark .sec-title{
    background-image:linear-gradient(100deg,
      #f1f5f9 0%, #f1f5f9 38%, #9db8ff 47%, #c4b1ff 51%, #f1f5f9 60%, #f1f5f9 100%);
  }
}
@keyframes rb-sweep{from{background-position:120% 0}to{background-position:-120% 0}}

/* 首充横幅：一道很淡的斜向高光慢慢扫过 */
.promo{position:relative;overflow:hidden}
.promo::after{
  content:"";position:absolute;top:-60%;bottom:-60%;left:-30%;width:36%;
  pointer-events:none;transform:translateX(-60%) skewX(-18deg);
  background:linear-gradient(90deg,rgba(255,255,255,0),rgba(255,255,255,.55),rgba(255,255,255,0));
  animation:rb-sheen 7.5s ease-in-out infinite;
}
/* 只动 transform —— 动 left 每帧都要重排，这一条是整页最长的动画 */
@keyframes rb-sheen{
  0%,55%{transform:translateX(-60%) skewX(-18deg);opacity:0}
  62%{opacity:1}
  92%{transform:translateX(380%) skewX(-18deg);opacity:0}
  100%{transform:translateX(380%) skewX(-18deg);opacity:0}
}

/* Auto Router 对比卡：四行任务被逐行扫过 —— 表达的是"逐个评估"，
   不是装饰光效。第一行是 <h4>，所以行从 nth-child(2) 起算。 */
@keyframes rb-scan{
  0%,64%,100%{background-color:transparent}
  6%{background-color:rgba(47,84,235,.10)}
  18%{background-color:transparent}
}
.router-good .rl{
  animation:rb-scan 7.2s ease-in-out infinite;border-radius:4px;
}
.router-good .rl:nth-child(2){animation-delay:0s}
.router-good .rl:nth-child(3){animation-delay:.45s}
.router-good .rl:nth-child(4){animation-delay:.9s}
.router-good .rl:nth-child(5){animation-delay:1.35s}

/* 卡片在指针下浮起 + 品牌色描边（比单纯换阴影更有"被点亮"的感觉） */
.pc, .card, .privacy-card, .promo{transition:box-shadow .3s ease, transform .3s ease}
.card:hover, .privacy-card:hover{
  box-shadow:0 14px 34px -22px rgba(15,23,42,.45), 0 0 0 1px rgba(47,84,235,.28);
}

/* 整页滚动进度：顶上一条 2px 品牌色 */
.rb-prog{
  position:fixed;top:0;left:0;right:0;height:2px;z-index:9998;pointer-events:none;
  background:rgba(47,84,235,.08);
}
.rb-prog i{
  display:block;height:100%;width:100%;transform:scaleX(0);transform-origin:0 50%;
  background:linear-gradient(90deg,#2f54eb,#7c5cff 55%,#0e9bb8);
}

@media (max-width:768px){
  .sec > .rb-bg.rb-orb{opacity:.5}
  #hero-waves{
    opacity:.72;
    -webkit-mask-image:linear-gradient(180deg,#000 0%,#000 34%,rgba(0,0,0,.45) 58%,transparent 82%);
    mask-image:linear-gradient(180deg,#000 0%,#000 34%,rgba(0,0,0,.45) 58%,transparent 82%);
  }
}

/* 手机：徽标一行放不下会折成两行，"· Live" 掉到第二行显得像断句 */
@media (max-width:420px){
  html body .hero.hero-band .hero-badge{font-size:11px;letter-spacing:.02em;padding:6px 10px;white-space:nowrap}
}

@media (prefers-reduced-motion: reduce){
  html body .hero.hero-band h1 em{animation:none;background-position:0 0}
  html body .hero.hero-band .hero-actions .btn-primary::before{animation:none;opacity:.45}
  .pc::after{animation:none;opacity:.28}
  .sec > .rb-bg.rb-orb::before,
  .sec > .rb-bg.rb-orb::after{animation:none}
  .hx{animation:none}
  #hero-waves{display:none}
  .hx-cur{animation:none;opacity:0}
  html body .hero.hero-band.rb-live::before{opacity:1}
}

/* ── ⑦ 模型字标：静态网格 → 双向滚动带 ────────────────────────────────
   原来 10 个 logo 静态排在 920px 里、34px 高，两侧全是空气。
   改成两行反向滚动：行高 46px、边缘渐隐、悬停暂停（认得出是谁）。
   结构由 rb-fx.js 的 mountLogoLoop() 现搭；reduce 时不搭，退回静态网格。 */
/* 不搭滚动带的时候（reduce / JS 没跑）静态网格也得用大一号的字标，
   否则这批用户看到的还是 26px 那一版，等于没改。 */
html body .top10-grid .top10-logo{height:46px;max-height:none;max-width:240px;width:auto}
html body .top10-grid .top10-item{width:auto}
@media (max-width:768px){
  html body .top10-grid .top10-logo{height:32px;max-width:170px}
}

html body .rb-ll{
  position:relative;display:block;
  max-width:none;width:100%;margin:2px 0 0;padding:0;
  -webkit-mask-image:linear-gradient(90deg,transparent 0,#000 6%,#000 94%,transparent 100%);
  mask-image:linear-gradient(90deg,transparent 0,#000 6%,#000 94%,transparent 100%);
}
html body .rb-ll .ll-row{overflow:hidden;overflow:clip;padding:10px 0}
html body .rb-ll .ll-track{
  display:flex;align-items:center;width:max-content;
  animation:rb-ll-shift var(--ll-dur,56s) linear infinite;
  will-change:transform;
}
html body .rb-ll .ll-row[data-dir="-1"] .ll-track{animation-direction:reverse}
html body .rb-ll .ll-row:hover .ll-track{animation-play-state:paused}
@keyframes rb-ll-shift{
  from{transform:translate3d(0,0,0)}
  to{transform:translate3d(-50%,0,0)}
}
/* 页内 #b1 那层把 .top10-item 定成 width:132px（手机 44%），宽字标会溢出压到
   隔壁；这里必须显式 width:auto，让每个格子跟着自己那张图走。 */
html body .rb-ll .top10-item{
  flex:0 0 auto;position:relative;width:auto;height:auto;min-height:0;
  margin:0 var(--ll-gap,58px) 0 0;
  opacity:.7;filter:grayscale(28%);
  transition:opacity .3s ease, filter .3s ease;
}
html body .rb-ll .top10-item:hover{opacity:1;filter:none}
/* 深色主题：原来那条 invert(1) 对深底字标没救 —— deepseek 那种白字标被翻成黑，
   整条带子会缺一块。统一压成白色剪影，明暗两态都读得清。 */
body.dark .rb-ll .top10-item{filter:none;opacity:.62}
body.dark .rb-ll .top10-logo{filter:grayscale(1) invert(1) contrast(.9);opacity:1}
/* deepseek 的字标本身是白字，再翻一次就变黑 —— 这一个单独压成白色剪影 */
body.dark .rb-ll .top10-logo[alt="deepseek"]{filter:brightness(0) invert(1)}
body.dark .rb-ll .top10-item:hover{opacity:1}
/* 页内 #b1 那层写了 .top10-logo{max-height:26px} —— 不显式放开，
   height 写多大都会被这 26px 夹死（34px 那条老规则就是这么失效的）。 */
html body .rb-ll .top10-logo{
  height:var(--ll-h,46px);max-height:none;max-width:240px;width:auto;
  transition:transform .3s cubic-bezier(.4,0,.2,1);
}
html body .rb-ll .top10-item:hover .top10-logo{transform:scale(1.08)}

@media (max-width:768px){
  html body .rb-ll{--ll-h:32px;--ll-gap:34px}
  html body .rb-ll .ll-row{padding:7px 0}
  html body .rb-ll .top10-logo{max-width:170px}
}

@media (prefers-reduced-motion: reduce){
  html body .rb-ll{mask-image:none;-webkit-mask-image:none}
  html body .rb-ll .ll-row:last-child{display:none}
  html body .rb-ll .ll-row:first-child{overflow:visible;padding:0}
  html body .rb-ll .ll-track{flex-wrap:wrap;justify-content:center;width:100%;animation:none;row-gap:18px}
  html body .rb-ll .top10-item{opacity:.72}
}
