/* 手機體驗基本修正（全站共用，載入在各頁 <style> 前面）。
   選擇器刻意加上 html 前綴提高特異度，這樣不用管跟各頁樣式的載入順序。 */

/* 點擊時的灰色/藍色閃光；橫向時字體被自動放大 */
html {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* iOS Safari 遇到小於 16px 的輸入框會自動放大頁面，而且不會縮回來 */
@media (pointer: coarse) {
  html input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
  html textarea,
  html select {
    font-size: 16px !important;
  }
}

/* 去掉點擊的延遲（雙擊縮放判定） */
html button,
html a,
html label,
html summary,
html [role="button"] {
  touch-action: manipulation;
}

/* 長按控制項不要選到按鈕上的字、不要跳出連結選單 */
html button,
html [role="button"],
html .icon-btn,
html .pz-select-btn {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* 觸控裝置沒有 hover，工具列按鈕改在按下時給回饋 */
html .icon-btn:active {
  background: color-mix(in srgb, var(--text) 12%, transparent);
  transform: scale(0.92);
}

/* viewport-fit=cover 之後，橫向時內容和浮動按鈕要避開瀏海 */
html body {
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
html body:not(:has(.admin-header)) .icon-toolbar {
  top: max(14px, env(safe-area-inset-top, 0px));
  right: max(14px, env(safe-area-inset-right, 0px));
}
html .feedback-launcher {
  left: max(18px, env(safe-area-inset-left, 0px));
}
