/* =====================================================================
 * olit-anim.css —— 卡片進場與載入中骨架(儀表板與內容頁共用)
 *
 * 卡片上浮:.ol-rise 由 JS 掛上,--ol-rise-i 是第幾張(錯開用),
 *   只動 opacity 與 translate(view 手機版的卡用 !important 鎖住 transform),
 *   動畫跑完 JS 會把 class 拿掉,不留在卡上。
 * 骨架:.ol-skel 疊在還沒拿到資料的圖表/元件上,資料到了加 .is-done 淡出。
 * ===================================================================== */

.ol-rise {
  animation: ol-rise .45s cubic-bezier(.2, .7, .3, 1) both;
  animation-delay: calc(var(--ol-rise-i, 0) * 60ms);
}
@keyframes ol-rise {
  from { opacity: 0; translate: 0 14px; }
  to   { opacity: 1; translate: 0 0; }
}

.ol-skel-host { position: relative; }
.ol-skel {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: var(--ol-surface, var(--ol-panel, #fff));
  pointer-events: none;
  transition: opacity .35s;
}
.ol-skel.is-done { opacity: 0; }
.ol-skel i {
  display: block;
  height: 10px;
  border-radius: 2px;
  background: linear-gradient(90deg,
    var(--ol-rail-border, #dde3ea) 0,
    rgba(255, 255, 255, .35) 40%,
    var(--ol-rail-border, #dde3ea) 80%);
  background-size: 300% 100%;
  animation: ol-shim 1.2s linear infinite;
}
html[data-skin-theme="dark"] .ol-skel i {
  background-image: linear-gradient(90deg,
    var(--ol-rail-border, #2b313b) 0,
    rgba(255, 255, 255, .08) 40%,
    var(--ol-rail-border, #2b313b) 80%);
}
.ol-skel i:nth-child(1) { width: 40%; }
.ol-skel i:nth-child(2) { width: 70%; }
.ol-skel i:nth-child(3) { flex: 1; height: auto; min-height: 20px; }
@keyframes ol-shim {
  from { background-position: 100% 0; }
  to   { background-position: -50% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .ol-rise { animation: none; }
  .ol-skel i { animation: none; }
}
