/* StayKR — 手感層（2026-11-27 Mia：按鈕、切換、Loading 要絲滑，不要一看就是 web app）
 * 只「外加」：不改任何版面尺寸、不動原本的規則。全部用 :where() 把權重壓到 0，
 * 原本有自己 transition / transform / :active 的元件一律照舊，這裡只補沒有的。
 * 最後一支載入。拿掉這個檔＝完全回到原狀。
 */

/* ── 1. 觸控：點下去不要有灰色閃塊、不要有雙擊放大的延遲 ── */
* { -webkit-tap-highlight-color: transparent; }
:where(button, a, label, select, summary, [onclick], [role="button"]) { touch-action: manipulation; }
/* App 裡：長按按鈕、圖片不要跳出「拷貝／儲存影像」那種網頁選單；課文內容照樣可以選字 */
html.in-app :where(button, a, nav, label, select, summary, .hd, .bnav, .btn, [role="button"]) { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
html.in-app :where(img, svg) { -webkit-touch-callout: none; -webkit-user-drag: none; }

/* ── 2. 按壓回饋：按下去微微縮一下、放開彈回來 ── */
:where(button, .btn, [role="button"]) {
  transition: transform .16s cubic-bezier(.2, .8, .2, 1), opacity .16s ease, background-color .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease;
}
:where(button, .btn, [role="button"]):where(:active:not(:disabled)) { transform: scale(.965); opacity: .88; }
/* 整張卡片當按鈕的那種，縮太多會晃，輕一點 */
:where(.s2-hero, .s2-row, .pq-card, .hb-resume, .wn-card, .kr-path-all):where(:active) { transform: scale(.985); }

@media (prefers-reduced-motion: no-preference) {
  /* ── 3. 切換分頁：淡入（只動透明度；不加位移，免得面板裡固定在螢幕上的元件跟著跳） ── */
  .panel.on { animation: feelFade .22s ease-out; }

  /* ── 4. 彈窗：背景淡入、視窗從下面浮上來 ── */
  .quiz-bg.show { animation: feelFade .18s ease-out; }
  .quiz-bg.show > .quiz-box { animation: feelRise .28s cubic-bezier(.2, .9, .3, 1); }
  .wt-ov, .en-ask-bg, #krAsk { animation: feelFade .18s ease-out; }
  .wt-ov > .wt-dlg { animation: feelRise .28s cubic-bezier(.2, .9, .3, 1); }

  /* ── 5. Loading：內容還沒畫出來的區塊先放會流動的灰條，不要一片空白 ── */
  .panel.on > :where(div[id$="Box"], #srsPanel):empty::before {
    content: ""; display: block; height: 320px; margin: 18px 0; border-radius: 18px;
    background:
      linear-gradient(100deg, transparent 30%, color-mix(in srgb, var(--bg) 55%, transparent) 50%, transparent 70%) 0 0 / 220% 100% no-repeat,
      linear-gradient(var(--bg3), var(--bg3)) 0 0 / 100% 132px no-repeat,
      linear-gradient(var(--bg3), var(--bg3)) 0 152px / 100% 74px no-repeat,
      linear-gradient(var(--bg3), var(--bg3)) 0 246px / 62% 74px no-repeat;
    animation: feelShimmer 1.25s linear infinite;
  }
}
@keyframes feelFade { from { opacity: 0; } }
@keyframes feelRise { from { opacity: 0; transform: translateY(16px) scale(.985); } }
@keyframes feelShimmer { from { background-position: 180% 0, 0 0, 0 152px, 0 246px; } to { background-position: -80% 0, 0 0, 0 152px, 0 246px; } }
