/* ATR feedback — C3 交互反馈层（独立作用域，路线 A）
   作用域：html.afx-on（由 feedback.js 落标开启；JS 不跑则 CSS 全不生效 → hydration/静态安全）。
   不挂 data-aurora：models/docs 页不在五页 aurora 作用域（无 boot 85826431），C3 为交互反馈
   动效而非主题装饰，独立作用域零 boot 风险（选型论证见作业记录 20261115-AURORA-C3）。
   红线：DOM 动画仅 transform/opacity（合成层）；prefers-reduced-motion: reduce 全停环境动效，
   交互触发的小位移保留（C1 已档 WCAG 前庭理据）；颜色字面量全部 B≥R（冷色不变量）。
   目标页：models.html（mpz 表）、docs 系（代码块/侧栏/toc）、五页全局反馈项。 */

html.afx-on{
  --afx-dur:480ms;            /* 常规反馈时长 */
  --afx-fast:200ms;
  --afx-ease:cubic-bezier(.22,1,.36,1);
  --afx-charge:420ms;         /* SLA 桶充能单桶时长 */
  --afx-charge-step:16ms;     /* 相邻桶延迟步进（24 桶 ≈ 0.4s 波前） */
  --afx-sweep:620ms;          /* 表行扫光时长 */
}

/* ============ 1) models 表：行悬停高亮扫过 ============ */
/* 委托加 .afx-row-hl 到 tr；每 td 一个扫光 ::after（tr 相对定位在部分内核不可靠，td 稳妥） */
html.afx-on .mpz-table td{position:relative}
html.afx-on .mpz-table td::after{
  content:"";position:absolute;inset:0;pointer-events:none;
  background:linear-gradient(90deg,transparent 0%,rgba(95,140,255,.16) 46%,rgba(95,140,255,.28) 54%,transparent 100%);
  opacity:0;transform:translateX(-112%);
}
html.afx-on .mpz-table tr.afx-row-hl td::after{
  animation:afxSweep var(--afx-sweep) var(--afx-ease) forwards;
}
html.afx-on .mpz-table tr.afx-row-hl td:first-child::before{
  content:"";position:absolute;inset:0;pointer-events:none;
  background:rgba(95,140,255,.07);opacity:0;animation:afxFade var(--afx-sweep) var(--afx-ease) forwards;
}
@keyframes afxSweep{0%{opacity:1;transform:translateX(-112%)}82%{opacity:1}100%{opacity:0;transform:translateX(112%)}}
@keyframes afxFade{0%{opacity:0}45%{opacity:1}100%{opacity:.55}}

/* ============ 2) models 表：SLA 绿条充能 ============ */
/* JS 对进入视口的 .pmc-sla-strip 加 .afx-charge 并给每桶 --i；scaleY 自底充起，纯 transform */
html.afx-on .pmc-sla-strip{--afx-o:1}
html.afx-on .pmc-sla-strip .pmc-sla-bucket{
  transform-origin:50% 100%;
}
html.afx-on .pmc-sla-strip.afx-charge .pmc-sla-bucket{
  animation:afxCharge var(--afx-charge) var(--afx-ease) both;
  animation-delay:calc(var(--i,0)*var(--afx-charge-step));
}
@keyframes afxCharge{0%{transform:scaleY(.22);opacity:.5}100%{transform:scaleY(1);opacity:1}}

/* ============ 3) docs：代码块复制反馈（checkmark 画入） ============ */
/* JS 注入 span.afx-check（含对勾 svg），原复制图标淡出交叉；scaleX 描画替代 stroke-dashoffset（守 transform/opacity 红线） */
html.afx-on .code-copy{position:relative}
html.afx-on .code-copy .afx-check{
  position:absolute;inset:0;display:flex;align-items:center;justify-content:center;
  pointer-events:none;opacity:0;
}
html.afx-on .code-copy.afx-copied .afx-check{
  animation:afxFade2 900ms var(--afx-ease) forwards;
}
html.afx-on .code-copy.afx-copied > svg{opacity:.12}
html.afx-on .afx-check i{
  display:block;width:15px;height:15px;color:#00C9A7;
}
html.afx-on .afx-check i svg{display:block;width:100%;height:100%;overflow:visible}
html.afx-on .afx-check i svg path{
  stroke:currentColor;stroke-width:3.2;stroke-linecap:round;stroke-linejoin:round;fill:none;
  transform-origin:2px 12px;transform:scaleX(0);
}
html.afx-on .code-copy.afx-copied .afx-check i svg path{
  animation:afxDraw 460ms 60ms var(--afx-ease) forwards;
}
html.afx-on .code-copy .afx-check i svg circle{
  stroke:currentColor;stroke-width:2;fill:none;opacity:.4;
  transform-origin:center;transform:scale(.6);opacity:0;
}
html.afx-on .code-copy.afx-copied .afx-check i svg circle{
  animation:afxRing 460ms var(--afx-ease) forwards;
}
@keyframes afxDraw{0%{transform:scaleX(0)}100%{transform:scaleX(1)}}
@keyframes afxRing{0%{transform:scale(.6);opacity:0}55%{opacity:.45}100%{transform:scale(1);opacity:0}}
@keyframes afxFade2{0%{opacity:0}12%{opacity:1}72%{opacity:1}100%{opacity:0}}

/* ============ 4) docs：侧栏当前项指示 ============ */
/* JS 给当前 pathname 匹配的侧栏链接加 .afx-cur；指示条 scaleY 入场，transform 合成层 */
html.afx-on .doc-aside a.afx-cur{position:relative}
html.afx-on .doc-aside a.afx-cur::before{
  content:"";position:absolute;left:-11px;top:14%;bottom:14%;width:3px;border-radius:2px;
  background:linear-gradient(180deg,#3D5AFE,#3FC9E8);
  transform:scaleY(.15);transform-origin:50% 0;
  animation:afxIndicator var(--afx-dur) var(--afx-ease) forwards;
}
@keyframes afxIndicator{0%{transform:scaleY(.15);opacity:0}100%{transform:scaleY(1);opacity:1}}

/* ============ 5) docs：toc scrollspy 当前项 ============ */
html.afx-on .afx-toc-on{
  color:#3D5AFE!important;font-weight:600;
}
html.afx-on .afx-toc-on::after{
  content:"";display:inline-block;width:5px;height:5px;border-radius:50%;
  background:#3D5AFE;margin-left:7px;vertical-align:2px;
  transform:scale(0);animation:afxPop 360ms var(--afx-ease) forwards;
}
@keyframes afxPop{0%{transform:scale(0)}100%{transform:scale(1)}}

/* ============ 6) 全局：按钮 hover 上浮 + 流动渐变边 ============ */
/* JS 白名单加 .afx-btn（models .stateful 主按钮、docs 主要 CTA）；环结构同 C2 am-ring 两 span */
html.afx-on .afx-btn{position:relative;transition:transform var(--afx-dur) var(--afx-ease),box-shadow var(--afx-dur) ease}
html.afx-on .afx-btn:hover{transform:translateY(-2px);box-shadow:0 10px 26px rgba(61,90,254,.22)}
html.afx-on .afx-btn:active{transform:translateY(0) scale(.97);transition-duration:120ms}
html.afx-on .afx-btn .afx-ring{
  position:absolute;inset:0;border-radius:inherit;pointer-events:none;padding:2px;
  -webkit-mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);
  -webkit-mask-composite:xor;
  mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);
  mask-composite:exclude;
  overflow:hidden;opacity:0;z-index:1;transition:opacity var(--afx-fast) ease;
}
html.afx-on .afx-btn:hover .afx-ring{opacity:.9}
html.afx-on .afx-btn .afx-ring i{
  position:absolute;inset:-40%;
  background:conic-gradient(from 0deg,#3FC9E8,#00C9A7,#3D5AFE,#B49CFF,#3FC9E8);
  animation:afxSpin 3.2s linear infinite;will-change:transform;
}
@keyframes afxSpin{to{transform:rotate(360deg)}}

/* ============ 7) 全局：卡片 hover 3D tilt + 边缘流光 ============ */
/* JS 白名单 .afx-tilt（mpz-card / pf-card）；mousemove 写 --afx-rx/--afx-ry/--afx-mx/--afx-my */
html.afx-on .afx-tilt{
  position:relative;transform-style:preserve-3d;
  transform:perspective(900px) rotateX(var(--afx-rx,0deg)) rotateY(var(--afx-ry,0deg)) translateZ(0);
  transition:transform 260ms var(--afx-ease);will-change:transform;
}
/* 站点 reveal 完成态 html.reveal-on .is-in{transform:none!important}(0,2,1) 永久压制非 important transform
   （实测发现：C2 的 pf-card:hover 上浮 (0,3,1) 非 important 同被压制——顺带以本规则恢复）。
   hover 升 (0,3,1)!important：> .is-in (0,2,1)!important、> reveal 预态 (0,3,1) 非 important。
   上浮+tilt 合一：translateY 置于 rotate 前=屏幕空间平移，保住 C2 lift 同时 tilt 生效。
   基础规则保持非 important：reveal 预态(隐藏 16px)不受干扰，reveal 完成后 vars=0 时等价 none。 */
html.afx-on .afx-tilt:hover{
  transform:perspective(900px) translateY(-3px) rotateX(var(--afx-rx,0deg)) rotateY(var(--afx-ry,0deg)) translateZ(0)!important;
}
html.afx-on .afx-tilt.afx-tilt-live{transition:none}
html.afx-on .afx-tilt::after{
  content:"";position:absolute;inset:0;border-radius:inherit;pointer-events:none;
  background:radial-gradient(220px circle at var(--afx-mx,50%) var(--afx-my,50%),
    rgba(95,140,255,.16),rgba(95,140,255,0) 62%);
  opacity:0;transition:opacity var(--afx-fast) ease;
}
html.afx-on .afx-tilt:hover::after{opacity:1}

/* ============ 8) 全局：表单焦点态光晕 ============ */
html.afx-on input:focus-visible,html.afx-on textarea:focus-visible,html.afx-on select:focus-visible{
  outline:none;
  border-color:rgba(61,90,254,.55);
  box-shadow:0 0 0 3px rgba(61,90,254,.16),0 0 18px rgba(61,90,254,.14);
  transition:border-color var(--afx-fast) ease,box-shadow var(--afx-fast) ease;
}

/* ============ 9) 全局：滚动 stagger 渐入 ============ */
/* JS 白名单容器 [data-afx-stagger]：子块进入视口逐个 .afx-in（--i 步进延迟） */
html.afx-on [data-afx-stagger] > *{
  opacity:0;transform:translateY(14px);
}
html.afx-on [data-afx-stagger] > .afx-in{
  opacity:1;transform:none;
  transition:opacity var(--afx-dur) var(--afx-ease),transform var(--afx-dur) var(--afx-ease);
  transition-delay:calc(var(--i,0)*60ms);
}

/* ============ 10) prefers-reduced-motion：环境动效全停 ============ */
@media (prefers-reduced-motion: reduce){
  html.afx-on .mpz-table tr.afx-row-hl td::after{animation:none!important;opacity:0!important}
  html.afx-on .mpz-table tr.afx-row-hl td:first-child::before{animation:none!important;opacity:.4!important}
  html.afx-on .pmc-sla-strip.afx-charge .pmc-sla-bucket{animation:none!important}
  html.afx-on .code-copy.afx-copied .afx-check i svg path{animation:none!important;transform:scaleX(1)!important}
  html.afx-on .code-copy.afx-copied .afx-check i svg circle{animation:none!important;opacity:0!important}
  html.afx-on .doc-aside a.afx-cur::before{animation:none!important;transform:scaleY(1)!important}
  html.afx-on .afx-toc-on::after{animation:none!important;transform:scale(1)!important}
  html.afx-on .afx-btn .afx-ring i{animation:none!important}
  html.afx-on .afx-btn:hover{transform:none!important}
  html.afx-on .afx-tilt{transform:none!important}
  html.afx-on .afx-tilt:hover{transform:none!important}
  html.afx-on [data-afx-stagger] > *{opacity:1!important;transform:none!important}
}
