/* ═══════════════════════════════════════════════════════════════════════
   法之道 · 骨架屏（Skeleton）v1.0
   ───────────────────────────────────────────────────────────────────────
   解决两件事（田总原话：「每次从一个页面切换到另一个页面的时候不要一闪
   一闪的加载数据，要做骨架屏，内容没加载完先显示灰色占位块」）：
     ① 跨页跳转：新页面第一帧就是灰底 + 骨架，不出现白屏
     ② 数据未到：主内容区显示灰色占位块，数据到达后淡出，页面不跳动

   结构全部是【加法】：
     - 骨架层是独立 fixed 容器，不写进业务 DOM，业务代码 innerHTML 覆盖
       也带不走它；移除时只删自己这一个节点
     - 删除本文件引用 + ui-skeleton.js 引用即完全回滚
   ⚠️ 本文件不含任何 !important 业务覆盖，只影响 .sk-* 命名空间。
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  /* 中性灰但压深一档：在暖铜主题的浅底上也要一眼可见 */
  --sk-base: #D8DBE0;
  --sk-hi:   #F0F1F4;
  --sk-radius: 14px;
}

/* 首帧灰底：即使骨架来不及画，也不是刺眼的白 */
html.sk-boot {
  background-color: #F1F2F4 !important;
}

/* ── 骨架覆盖层 ─────────────────────────────────────────────────────── */
.sk-layer {
  position: fixed;
  z-index: 890;
  pointer-events: none;
  padding: 0;
  opacity: 0;
  transition: opacity .22s ease;
  will-change: opacity;
}
.sk-layer.on { opacity: 1; }
.sk-layer.out { opacity: 0; }

.sk-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
  padding: 4px 0 0;
  box-sizing: border-box;
}

/* 呼吸/流光：一条亮带缓慢扫过（只动 background-position，不触发重排） */
.sk-el {
  border-radius: var(--sk-radius);
  background-color: var(--sk-base);
  background-image: linear-gradient(100deg,
    rgba(255, 255, 255, 0) 32%,
    rgba(255, 255, 255, .72) 48%,
    rgba(255, 255, 255, 0) 64%);
  background-repeat: no-repeat;
  background-size: 260% 100%;
  background-position: -80% 0;
  animation: skShine 1.5s cubic-bezier(.45, 0, .55, 1) infinite;
}
@keyframes skShine {
  0%   { background-position: -80% 0; }
  70%  { background-position: 180% 0; }
  100% { background-position: 180% 0; }
}

/* 页标题条 */
.sk-title { height: 20px; width: 168px; border-radius: 8px; }

/* 指标带：四格 */
.sk-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.sk-stat {
  height: 86px;
  border-radius: 18px;
}

/* 内容卡：图表 / 列表两种比例 */
.sk-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.sk-card {
  height: 248px;
  border-radius: 22px;
}

/* 表格卡 */
.sk-table {
  flex: 1;
  min-height: 220px;
  border-radius: 22px;
  padding: 18px 20px;
  box-sizing: border-box;
  background-color: rgba(255, 255, 255, .55);
  background-image: none;
  animation: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sk-tr {
  height: 14px;
  border-radius: 7px;
  background-color: var(--sk-base);
  background-image: linear-gradient(100deg,
    rgba(255, 255, 255, 0) 32%,
    rgba(255, 255, 255, .72) 48%,
    rgba(255, 255, 255, 0) 64%);
  background-repeat: no-repeat;
  background-size: 260% 100%;
  animation: skShine 1.5s cubic-bezier(.45, 0, .55, 1) infinite;
}
.sk-tr.head { height: 18px; width: 42%; opacity: .85; }
.sk-tr:nth-child(2n) { width: 92%; }
.sk-tr:nth-child(3n) { width: 80%; }
.sk-tr:nth-child(4n) { width: 96%; }
.sk-tr:nth-child(5n) { width: 74%; }

/* ── 跨页离开过渡：旧页先压一层浅色，避免直接白屏 ───────────────── */
html.sk-leaving::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 2147483601;
  background: #F1F2F4;
  opacity: 0;
  animation: skLeave .34s ease forwards;
  pointer-events: none;
}
@keyframes skLeave {
  from { opacity: 0; }
  to   { opacity: .92; }
}

/* ── 「加载中…」文字 → 骨架条（弹窗、局部刷新场景） ───────────────── */
.sk-text {
  color: transparent !important;
  position: relative;
  text-shadow: none !important;
}
.sk-text::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 132px;
  max-width: 70%;
  height: 12px;
  margin: -6px 0 0 -66px;
  border-radius: 6px;
  background-color: var(--sk-base);
  background-image: linear-gradient(100deg,
    rgba(255, 255, 255, 0) 32%,
    rgba(255, 255, 255, .72) 48%,
    rgba(255, 255, 255, 0) 64%);
  background-repeat: no-repeat;
  background-size: 260% 100%;
  animation: skShine 1.5s cubic-bezier(.45, 0, .55, 1) infinite;
}

/* 表格整行骨架：td 里画多条 */
.sk-cell-lines::after {
  width: 70%;
}

/* 无障碍 */
@media (prefers-reduced-motion: reduce) {
  .sk-el, .sk-tr, .sk-text::after { animation: none; }
  html.sk-leaving::after { animation-duration: .01s; }
}

/* ── 局部骨架层（v1.1）：盖在单个空容器上，不整页覆盖 ───────────────── */
.sk-layer--part {
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 16px 18px;
  box-sizing: border-box;
  border-radius: 18px;
  background: transparent;     /* 不铺底，只画灰条，避免双重白 */
  overflow: hidden;
}
/* 图表卡的占位：一大块 + 三个小标签 */
.sk-card--fill {
  flex: 1;
  min-height: 120px;
  border-radius: 16px;
}
.sk-inline {
  display: flex;
  gap: 10px;
  flex: 0 0 auto;
}
.sk-chip {
  flex: 1;
  height: 12px;
  border-radius: 6px;
}
/* 局部层用内联 opacity 控制，屏蔽全局过渡 */
.sk-layer--part { transition: opacity .18s ease; }
