/* ===========================================================
   页面切换加载动效（三选一，由 assets/js/app.js 的 FX 控制）
     A：顶部进度条 + 内容淡入
     B：骨架屏 + 微光扫过
     E：全屏蒙层 + 环形加载
   层级约定：#view(1) < 骨架屏(20) < #appbar(30) < #tabbar(40) < 进度条(55) < 全屏加载(60)
   所以骨架屏时顶栏还在（像原生 App），全屏加载时才盖住一切。
   =========================================================== */

/* ---------- A · 顶部进度条 ---------- */
#fx-bar {
  position: absolute; top: 0; left: 0;
  height: 2.5px; width: 0;
  z-index: 55;
  opacity: 0;
  pointer-events: none;
  border-radius: 0 2px 2px 0;
  background: linear-gradient(90deg, #00a0c8, #5b3bff);
  box-shadow: 0 0 10px rgba(91, 59, 255, 0.55);
}
#fx-bar.run { animation: fxBar 0.52s cubic-bezier(0.3, 0.9, 0.3, 1) forwards; }
@keyframes fxBar {
  0% { width: 0; opacity: 1; }
  55% { width: 74%; opacity: 1; }
  88% { width: 100%; opacity: 1; }
  100% { width: 100%; opacity: 0; }
}

/* ---------- 遮罩通用 ---------- */
.fx-mask { position: absolute; inset: 0; display: none; }
.fx-mask.on { display: block; }

/* ---------- B · 骨架屏 ---------- */
.fx-mask.sk {
  z-index: 20;
  display: none;
  padding: 16px 14px;
  background: #f5f7fa;
}
.fx-mask.sk.on { display: block; }
.fx-mask.sk .h,
.fx-mask.sk .r {
  position: relative;
  overflow: hidden;
  background: #e7eaf0;
  border-radius: 12px;
}
.fx-mask.sk .h { width: 42%; height: 24px; border-radius: 7px; margin-bottom: 16px; }
.fx-mask.sk .r { height: 82px; margin-bottom: 11px; }
.fx-mask.sk .r.sm { height: 56px; }
.fx-mask.sk .h::after,
.fx-mask.sk .r::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.92) 50%, transparent 80%);
  transform: translateX(-100%);
  animation: fxShimmer 0.74s ease-in-out infinite;
}
@keyframes fxShimmer { to { transform: translateX(100%); } }

/* ---------- E · 全屏加载 ---------- */
.fx-mask.load {
  z-index: 60;
  display: none;
  place-content: center;
  justify-items: center;
  gap: 12px;
  background: rgba(16, 18, 26, 0.74);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.fx-mask.load.on { display: grid; opacity: 0; animation: fxFadeIn 0.12s ease forwards; }
.fx-mask.load.out { display: grid; animation: fxFadeOut 0.22s ease forwards; }
@keyframes fxFadeIn { to { opacity: 1; } }
@keyframes fxFadeOut { from { opacity: 1; } to { opacity: 0; } }
.fx-mask.load .ring {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.16);
  border-top-color: #00e5ff;
  border-right-color: #7b5cff;
  animation: fxSpin 0.7s linear infinite;
}
@keyframes fxSpin { to { transform: rotate(360deg); } }
.fx-mask.load .tx {
  font-size: 11px; letter-spacing: 1.5px;
  color: rgba(255, 255, 255, 0.72);
}

/* ---------- 「无效果」模式：连基础的页面淡入也关掉，做到真正瞬切 ---------- */
html.fx-off .page { animation: none !important; }
html.fx-off #fx-bar,
html.fx-off #fx-mask { display: none !important; }
