/* ============================================================
   动效层 · 甲·液态玻璃（2026-11-12）
   ------------------------------------------------------------
   一条原则：动效跟着"这一块东西是什么"走，不套同一个模板。

     首屏文字      显影（模糊→清晰，慢起慢收）
     首屏照片      凝出来 + 一道掠光扫过（玻璃接住光）
     数据条        从照片下沿托上来；数字滚轮；金线从中间长出去
     三块能力      错峰浮起 + 图标逐笔描线（图标是线稿，就该描）
     校区卡        定位针先落，圈从针上荡开，序号渗出，区域名最后浮现
                  （五张错开相位，光团极慢地涨落，不齐步走）
     课程三段      照片显影、正文浮起；分隔线左→右画出来
     时间轴        横线先画、圆点依次落位（顺序本身就是内容）
     校区卡        照片从 1.06 收回 1，正文跟着浮起
     师资卡        头像先凝出来，名字后到
     关于页        照片显影；三个数字各自计数；三条规矩的线逐条画
     结尾 CTA      整块淡入，玻璃被光扫过一次就停

   动画全部走 Web Animations API（motion.js），CSS 这边只负责
   "初始隐形 + 一次性彩蛋 + 描线"这几件 CSS 更擅长的事。
   ============================================================ */

/* ---------- 初始隐形 ----------
   跨页转场时浏览器可能在脚本执行前就截了新页快照，
   那一刻要是全亮，入场等于白做。脚本万一出错由看门狗兜回来。 */
html.m-on .rv{opacity:0}
html.m-on .rv.in{opacity:1}

/* ---------- 掠光（照片 / CTA 共用一套节奏）---------- */
@keyframes sheen{
  0%{left:-72%;opacity:0}
  14%{opacity:.95}
  72%{opacity:.95}
  100%{left:134%;opacity:0}
}
html.m-on .shot.sweep::before{animation:sheen 1.9s cubic-bezier(.25,.6,.3,1) .34s 1 both}
html.m-on .cta-block.lit::after{animation:sheen 1.7s cubic-bezier(.25,.6,.3,1) .2s 1 both}
/* 校区页的推荐卡：掠光只在这一块第一次入场时扫一遍 */
html.m-on .chz-rec.sweep .shot::before{animation:sheen 1.9s cubic-bezier(.25,.6,.3,1) .34s 1 both}
/* ---------- 门店卡：针先落，圈再荡开 ----------
   一张门店卡讲的是"这家店在哪"，所以动作顺序跟内容顺序一致：
   定位针先落下 → 圈从针上荡开 → 序号渗出 → 区域名浮现。
   五张卡用 --d 错开，最右那张最后到位。 */
@keyframes cx5pin{
  from{transform:translateY(-15px) scale(.84);opacity:0}
  62%{opacity:1}
  to{transform:translateY(0) scale(1);opacity:1}
}
@keyframes cx5rings{
  from{transform:scale(.20);opacity:0}
  to{transform:scale(1);opacity:.66}
}
@keyframes cx5halo{
  from{transform:scale(.38);opacity:0}
  to{transform:scale(1);opacity:.72}
}
@keyframes cx5no{
  from{opacity:0;transform:translateY(-6px)}
  to{opacity:1;transform:none}
}
@keyframes cx5wm{
  from{opacity:0;letter-spacing:.24em}
  to{opacity:1;letter-spacing:.12em}
}
html.m-on .cx5-card.in .cx5-pin {animation:cx5pin .68s cubic-bezier(.34,1.42,.52,1) both;animation-delay:calc(.16s + var(--d,0s))}
html.m-on .cx5-card.in .cx5-rings{animation:cx5rings 1.65s cubic-bezier(.22,.68,0,1) both;animation-delay:calc(.30s + var(--d,0s))}
html.m-on .cx5-card.in .cx5-halo{animation:cx5halo 1.15s var(--ease) both;animation-delay:calc(.16s + var(--d,0s))}
html.m-on .cx5-card.in .cx5-no {animation:cx5no .9s var(--ease) both;animation-delay:calc(.52s + var(--d,0s))}
html.m-on .cx5-card.in .cx5-wm {animation:cx5wm 1s var(--ease) both;animation-delay:calc(.70s + var(--d,0s))}

/* 呼吸：卡片上那团光极慢地涨落，五张错开相位，不齐步走 */
@keyframes cx5breathe{
  0%,100%{transform:scale(.84);opacity:.30}
  50%{transform:scale(1.12);opacity:.58}
}
.cx5-thumb::after{
  content:'';position:absolute;left:62%;top:58%;width:154px;height:154px;margin:-77px 0 0 -77px;
  pointer-events:none;border-radius:50%;
  background:radial-gradient(circle at 50% 50%,rgba(255,255,255,.72),rgba(255,255,255,0) 66%);
  animation:cx5breathe 11s ease-in-out infinite;
}
.cx5-card:nth-child(odd) .cx5-thumb::after{animation-delay:-2.9s}
.cx5-card:nth-child(even) .cx5-thumb::after{animation-delay:-6.4s}

/* ---------- 图标描线：紫画骨、金点睛 ----------
   隐形态只存在于 keyframes 内部；默认没有任何 dash 偏移，
   脚本没跑 / 动效被系统关掉 / 类没挂上，都不会出现"空方块"。 */
@keyframes icdraw{
  from{stroke-dashoffset:240}
  to{stroke-dashoffset:0}
}
html.m-on .card.ico-draw .ic svg path,
html.m-on .card.ico-draw .ic svg circle{
  stroke-dasharray:240;
  animation:icdraw 1.45s cubic-bezier(.33,0,.2,1) both;
}
html.m-on .card.ico-draw .ic svg .gold{animation-delay:.4s}

/* ---------- 时间轴：线先画，点后落 ---------- */
html.m-on .timeline::before{
  transform:scaleX(0);transform-origin:left;
  transition:transform 1.15s cubic-bezier(.33,0,.2,1);
}
html.m-on .timeline.lined::before{transform:scaleX(1)}

html.m-on .tl::before{opacity:0;transform:scale(.45)}
html.m-on .tl.pop::before{
  opacity:1;transform:scale(1);
  transition:opacity .45s var(--ease),transform .62s cubic-bezier(.32,1.4,.4,1);
  transition-delay:var(--rv-d,0ms);
}

/* ---------- 规矩条 / 段落分隔线：左→右画出来 ---------- */
html.m-on .value::before{
  transform:scaleX(0);transform-origin:left;
  transition:transform .95s cubic-bezier(.33,0,.2,1);
}
html.m-on .value.lit::before{transform:scaleX(1)}

html.m-on .mode::before{
  transform:scaleX(0);transform-origin:left;
  transition:transform 1.05s cubic-bezier(.33,0,.2,1);
}
html.m-on .mode.lit::before{transform:scaleX(1)}

/* ---------- 卡片：悬停时那层"变亮"交给 CSS ---------- */
html.m-on .card,
html.m-on .campus-card,
html.m-on .teacher,
html.m-on .cx5-card{will-change:transform,opacity}

/* ---------- 手机端：位移减半，别在窄屏上晃 ---------- */
@media (max-width:960px){
  html.m-on .timeline::before{transform:scaleY(0);transform-origin:top}
  html.m-on .timeline.lined::before{transform:scaleY(1)}
  html.m-on .shot.sweep::before{animation-duration:1.5s}
  /* 门店卡的内部动作在窄屏上收一档：针落得快些，圈收得短些 */
  html.m-on .cx5-card.in .cx5-pin{animation-duration:.56s}
  html.m-on .cx5-card.in .cx5-rings{animation-duration:1.3s}
  html.m-on .cx5-card.in .cx5-halo{animation-duration:.95s}
  html.m-on .cx5-card.in .cx5-no{animation-duration:.7s}
  html.m-on .cx5-card.in .cx5-wm{animation-duration:.8s}
}

/* ============================================================
   跨页切换
   支持 View Transitions 的浏览器：整页交叉溶解，导航栏钉住不动。
   不支持的：脚本淡出后跳转。
   ============================================================ */
@view-transition{ navigation:auto; }

::view-transition-old(root){animation:pt-out .34s cubic-bezier(.4,0,.55,1) both}
::view-transition-new(root){animation:pt-in .66s cubic-bezier(.25,.1,.25,1) both}
@keyframes pt-out{to{opacity:0}}
@keyframes pt-in{from{opacity:0}to{opacity:1}}

/* 导航胶囊两页之间位置一致，单独拎出来，不跟着整页闪 */
.nav{view-transition-name:site-nav}
::view-transition-old(site-nav),
::view-transition-new(site-nav){animation-duration:.001s}

html.pt-leaving body{opacity:0;transition:opacity .3s cubic-bezier(.4,0,.55,1)}

@media (prefers-reduced-motion:reduce){
  @view-transition{ navigation:none }
  html.pt-leaving body{opacity:1;transition:none}
  html.m-on .rv,
  html.m-on .tl::before{opacity:1;transform:none}
  /* 门店卡的呼吸光停掉：内容还在，光不闪 */
  .cx5-thumb::after{animation:none;opacity:.42}
}
