/* speed-refresh-fx · 速蹬实测 feed 刷新动效（速览速度卡 + 模型速度表共用）
   ---------------------------------------------------------------------------------------------
   作用域：只命中本文件自己的类名 .sfx-*、宿主标记 [data-sfx-host]、关键帧 sfx-* 与 @property --sfx-a。
   不改任何现有选择器、数字、排序、表格或 #375/#376 的样式；不给现有元素加动画。
   所有可见效果都画在宿主里的一个临时图层 .sfx-layer 上：z-index:-1 + 宿主 isolation:isolate，
   图层位于宿主背景之上、文字/按钮之下，所以不遮挡分数与触控；pointer-events:none，不接管鼠标键盘。
   图层只在一次刷新（≤ 约 3.7s）期间存在，结束即删除；没有任何无限循环。
   JS 在挂图层前读取 --sfx-ready，读不到（CSS 未加载）就整段放弃，不留残余。 */

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

/* ── 宿主：只在效果期间存在的标记，结束后由 JS 移除 ─────────────────────────────── */
[data-sfx-host] { isolation: isolate; }
[data-sfx-host="static"] { position: relative; }

/* ── 图层与调色 ──────────────────────────────────────────────────────────────── */
.sfx-layer {
  --sfx-ready: 1;
  /* 信号绿＝本轮同步；暖＝升（更快/位次上移，"升温"）；冷＝降（更慢/位次下移，"降温"）；
     新进＝白热绿。用冷暖而不用红绿，避开中英文涨跌色相反的约定，也不与站点基准绿混淆。 */
  --sfx-sig: #39ff88;
  --sfx-warm: #ffb347;
  --sfx-cool: #4cc9ff;
  --sfx-new: #c6ffe0;
  --sfx-wash-a: 30%;
  --sfx-pad-a: 40%;
  position: absolute; inset: 0; z-index: -1;
  overflow: hidden; pointer-events: none; contain: strict;
  border-radius: inherit;
}
:root[data-theme="light"] .sfx-layer {
  --sfx-sig: #087a40;
  --sfx-warm: #c25e00;
  --sfx-cool: #0b6fb8;
  --sfx-new: #087a40;
  --sfx-wash-a: 22%;
  --sfx-pad-a: 30%;
}
.sfx-layer > * { position: absolute; display: block; box-sizing: border-box; opacity: 0; pointer-events: none; }
.sfx-layer [data-k="up"]     { --c: var(--sfx-warm); }
.sfx-layer [data-k="down"]   { --c: var(--sfx-cool); }
.sfx-layer [data-k="change"] { --c: var(--sfx-sig); }
.sfx-layer [data-k="enter"]  { --c: var(--sfx-new); }

/* ── 区块级：锁定框（实测列表外缘四角）──────────────────────────────────────────── */
.sfx-frame {
  --l: 12px; --t: 1.5px; --s: var(--sfx-sig);
  background:
    linear-gradient(var(--s), var(--s)) 0 0 / var(--l) var(--t),
    linear-gradient(var(--s), var(--s)) 0 0 / var(--t) var(--l),
    linear-gradient(var(--s), var(--s)) 100% 0 / var(--l) var(--t),
    linear-gradient(var(--s), var(--s)) 100% 0 / var(--t) var(--l),
    linear-gradient(var(--s), var(--s)) 0 100% / var(--l) var(--t),
    linear-gradient(var(--s), var(--s)) 0 100% / var(--t) var(--l),
    linear-gradient(var(--s), var(--s)) 100% 100% / var(--l) var(--t),
    linear-gradient(var(--s), var(--s)) 100% 100% / var(--t) var(--l),
    linear-gradient(color-mix(in srgb, var(--s) 5%, transparent), color-mix(in srgb, var(--s) 5%, transparent));
  background-repeat: no-repeat;
  animation: sfx-frame 1300ms cubic-bezier(.2, .7, .2, 1) both;
}
@keyframes sfx-frame {
  0%   { opacity: 0; transform: scale(1.02); }
  10%  { opacity: 1; transform: scale(1); }
  55%  { opacity: .75; }
  100% { opacity: 0; transform: scale(1); }
}

/* ── 区块级：扫描束（只扫实测列表那一段，自上而下；位移由 JS 一次 WAAPI 驱动）────────── */
.sfx-scan { opacity: 1; overflow: hidden; }
.sfx-beam {
  position: absolute; left: 0; right: 0; top: -56px; height: 56px; opacity: 0;
  background: linear-gradient(to bottom,
    transparent 0,
    color-mix(in srgb, var(--sfx-sig) 4%, transparent) 40%,
    color-mix(in srgb, var(--sfx-sig) 12%, transparent) 86%,
    color-mix(in srgb, var(--sfx-sig) 26%, transparent) 100%);
}
.sfx-beam::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1.5px;
  background: linear-gradient(90deg, transparent, var(--sfx-sig) 6%, var(--sfx-sig) 94%, transparent);
  box-shadow: 0 0 12px 1px color-mix(in srgb, var(--sfx-sig) 65%, transparent);
}
.sfx-beam::before {
  content: ""; position: absolute; left: 0; bottom: -3px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--sfx-sig); box-shadow: 0 0 10px 2px var(--sfx-sig);
}

/* ── 区块级：同步脉冲（可选 [data-speed-fx-ping] 元素，例如"来源已同步"徽标）──────────── */
.sfx-ping {
  border: 1.5px solid var(--sfx-sig); border-radius: 999px;
  animation: sfx-ping 1000ms cubic-bezier(.15, .6, .3, 1) both;
}
@keyframes sfx-ping {
  0%   { opacity: 0; transform: scale(.94); }
  8%   { opacity: 1; }
  100% { opacity: 0; transform: scale(1.22, 1.9); }
}

/* ── 行级：冷暖信号带（从左侧射出、余辉淡出）────────────────────────────────────── */
.sfx-wash {
  transform-origin: 0 50%;
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--c) var(--sfx-wash-a), transparent) 0,
    color-mix(in srgb, var(--c) calc(var(--sfx-wash-a) * .45), transparent) 22%,
    color-mix(in srgb, var(--c) calc(var(--sfx-wash-a) * .16), transparent) 58%,
    transparent 88%);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--c) 34%, transparent),
    inset 0 -1px 0 color-mix(in srgb, var(--c) 34%, transparent);
  animation: sfx-wash 1900ms cubic-bezier(.2, .7, .2, 1) both;
}
.sfx-wash[data-k="change"] { animation-duration: 1500ms; --sfx-wash-a: 18%; }
.sfx-wash[data-k="enter"]  { animation-duration: 2300ms; }
@keyframes sfx-wash {
  0%   { opacity: 0; transform: scaleX(.12); }
  11%  { opacity: 1; transform: scaleX(1); }
  42%  { opacity: .85; }
  100% { opacity: 0; transform: scaleX(1); }
}

/* ── 行级：左缘锁存条（升从下长、降从上长、其他从中间长）──────────────────────────── */
.sfx-rail {
  background: var(--c); box-shadow: 0 0 9px 1px color-mix(in srgb, var(--c) 70%, transparent);
  transform-origin: 50% 50%;
  animation: sfx-rail 1900ms cubic-bezier(.2, .7, .2, 1) both;
}
.sfx-rail[data-k="up"]   { transform-origin: 50% 100%; }
.sfx-rail[data-k="down"] { transform-origin: 50% 0; }
@keyframes sfx-rail {
  0%   { opacity: 1; transform: scaleY(0); }
  14%  { opacity: 1; transform: scaleY(1); }
  62%  { opacity: 1; }
  100% { opacity: 0; transform: scaleY(1); }
}

/* ── 行级：位序短轨迹（左缘彗星从相邻位次驶入本行，头部带方向箭头）─────────────────── */
.sfx-comet { overflow: visible; }
.sfx-comet[data-k="up"]   { animation: sfx-comet-up 560ms cubic-bezier(.3, .6, .25, 1) both; }
.sfx-comet[data-k="down"] { animation: sfx-comet-down 560ms cubic-bezier(.3, .6, .25, 1) both; }
.sfx-comet > i { position: absolute; display: block; left: 0; width: 3px; height: 160%; }
.sfx-comet > i::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: -3px; width: 9px;
  background: inherit; opacity: .28; border-radius: 4px;
}
.sfx-comet[data-k="up"] > i   { top: 0;    background: linear-gradient(to bottom, var(--c), color-mix(in srgb, var(--c) 40%, transparent) 30%, transparent); }
.sfx-comet[data-k="down"] > i { bottom: 0; background: linear-gradient(to top,    var(--c), color-mix(in srgb, var(--c) 40%, transparent) 30%, transparent); }
.sfx-comet > b {
  position: absolute; display: block; left: 5px; width: 8px; height: 6px; background: var(--c);
  filter: drop-shadow(0 0 3px var(--c));
}
.sfx-comet[data-k="up"] > b   { top: -1px;    clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.sfx-comet[data-k="down"] > b { bottom: -1px; clip-path: polygon(0 0, 100% 0, 50% 100%); }
@keyframes sfx-comet-up {
  0%   { opacity: 0; transform: translateY(130%); }
  12%  { opacity: 1; }
  60%  { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(0); }
}
@keyframes sfx-comet-down {
  0%   { opacity: 0; transform: translateY(-130%); }
  12%  { opacity: 1; }
  60%  { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(0); }
}

/* ── 数字：背光（冷暖高光垫在数字下面）────────────────────────────────────────── */
.sfx-pad {
  border-radius: 50%;
  background: radial-gradient(closest-side,
    color-mix(in srgb, var(--c) var(--sfx-pad-a), transparent) 0,
    color-mix(in srgb, var(--c) calc(var(--sfx-pad-a) * .4), transparent) 55%,
    transparent 100%);
  animation: sfx-pad 1600ms cubic-bezier(.2, .7, .2, 1) both;
}
.sfx-pad[data-k="change"] { --sfx-pad-a: 22%; animation-duration: 1300ms; }
@keyframes sfx-pad {
  0%   { opacity: 0; transform: scale(.5); }
  14%  { opacity: 1; transform: scale(1); }
  55%  { opacity: .7; }
  100% { opacity: 0; transform: scale(1.05); }
}

/* ── 数字：锁定框（四角收拢到数字上）────────────────────────────────────────── */
.sfx-lock {
  --l: 7px; --t: 1.5px;
  background:
    linear-gradient(var(--c), var(--c)) 0 0 / var(--l) var(--t),
    linear-gradient(var(--c), var(--c)) 0 0 / var(--t) var(--l),
    linear-gradient(var(--c), var(--c)) 100% 0 / var(--l) var(--t),
    linear-gradient(var(--c), var(--c)) 100% 0 / var(--t) var(--l),
    linear-gradient(var(--c), var(--c)) 0 100% / var(--l) var(--t),
    linear-gradient(var(--c), var(--c)) 0 100% / var(--t) var(--l),
    linear-gradient(var(--c), var(--c)) 100% 100% / var(--l) var(--t),
    linear-gradient(var(--c), var(--c)) 100% 100% / var(--t) var(--l);
  background-repeat: no-repeat;
  animation: sfx-lock 1100ms cubic-bezier(.2, .7, .2, 1) both;
}
@keyframes sfx-lock {
  0%   { opacity: 0; transform: scale(1.75); }
  22%  { opacity: 1; transform: scale(1); }
  30%  { transform: scale(1.06); }
  38%  { transform: scale(1); }
  74%  { opacity: 1; }
  100% { opacity: 0; transform: scale(1); }
}

/* ── 数字环：一圈雷达扫弧绕数字一周（@property 不支持时退化为静止弧淡出）─────────── */
.sfx-dial {
  border: 1.5px solid var(--c); border-radius: 50%;
  -webkit-mask-image: conic-gradient(from var(--sfx-a), transparent 0 52%, #000 96%, transparent 100%);
          mask-image: conic-gradient(from var(--sfx-a), transparent 0 52%, #000 96%, transparent 100%);
  animation: sfx-dial 900ms linear both;
}
@keyframes sfx-dial {
  0%   { opacity: 0; --sfx-a: 0deg; }
  10%  { opacity: 1; }
  78%  { opacity: .9; }
  100% { opacity: 0; --sfx-a: 360deg; }
}

/* ── 数字环：外扩脉冲环（新进模型连打两环）──────────────────────────────────────── */
.sfx-ring {
  border: 1.5px solid var(--c); border-radius: 999px;
  animation: sfx-ring 1000ms cubic-bezier(.15, .6, .3, 1) both;
}
@keyframes sfx-ring {
  0%   { opacity: 0; transform: scale(.92); }
  10%  { opacity: .95; }
  100% { opacity: 0; transform: scale(1.35, 1.75); }
}

/* ── 速度条（速览卡 svg.bar）背后的光晕；条本身不动 ────────────────────────────── */
.sfx-halo {
  border-radius: 3px;
  background: color-mix(in srgb, var(--c) 45%, transparent);
  box-shadow: 0 0 10px 2px color-mix(in srgb, var(--c) 55%, transparent);
  animation: sfx-halo 1400ms cubic-bezier(.2, .7, .2, 1) both;
}
@keyframes sfx-halo {
  0%   { opacity: 0; }
  15%  { opacity: 1; }
  100% { opacity: 0; }
}

/* ── 停特效：减少动态 / 强制配色 / 打印 一律不画（JS 也会提前放弃）─────────────────── */
@media (prefers-reduced-motion: reduce) { .sfx-layer { display: none !important; } }
@media (forced-colors: active) { .sfx-layer { display: none !important; } }
@media print { .sfx-layer { display: none !important; } }
