/* ==========================================================================
   現代 CSS Reset (精煉與無障礙強化版)
   融合 @layer 優先權隔離、無障礙規範、RWD 媒體防爆與台灣繁中字體優化
   ========================================================================== */

@layer reset {
  /* 1. 全域盒模型為 border-box */
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  /* 2. 移除所有元素的預設外距與內距 */
  * {
    margin: 0;
    padding: 0;
  }

  /* 3. HTML 視圖與平滑滾動 */
  html {
    /* 防止 iOS 橫向旋轉時字體異常放大 */
    -webkit-text-size-adjust: 100%;
    /* 平滑滾動支援（配合導覽錨點） */
    scroll-behavior: smooth;
    tab-size: 4;
    -moz-tab-size: 4;
  }

  /* 4. 基礎字體與閱讀體驗 */
  body {
    /* 繁體中文與西文兼顧的高清系統字體集 */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", "微軟正黑體", sans-serif;
    /* 強化 macOS / iOS 渲染銳利度 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
    color: #212529;
    background-color: #ffffff;
    min-height: 100vh;
  }

  /* 5. 清理清單標記符號 */
  ul,
  ol {
    list-style: none;
  }

  /* 6. 媒體元素響應式防爆（防止圖表或向量撐破容器） */
  img,
  picture,
  video,
  canvas,
  svg {
    display: block;
    max-width: 100%;
  }

  /* 7. 表單元件繼承字體（修正瀏覽器預設不繼承字型與字級的歷史問題） */
  input,
  button,
  textarea,
  select {
    font: inherit;
  }

  /* 8. 超連結基礎重置（交由元件與通用樣式接管顏色） */
  a {
    color: inherit;
    text-decoration: none;
  }

  /* 9. 文字排版防溢出 */
  p,
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    overflow-wrap: break-word;
  }

  /* 10. 無障礙環境（prefers-reduced-motion）動態減弱 */
  @media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
      scroll-behavior: auto !important;
    }
  }
}