/* =========================
   CSS Reset (Modern & Safe)
   ========================= */

/* 1) Box sizing: 更好算寬高 */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* 2) 移除預設 margin */
* {
  margin: 0;
}

/* 3) 基礎 body 設定：更穩定的文字渲染 */
html:focus-within {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* 4) 媒體元素：避免圖片/影片撐爆容器 */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

/* 5) 表單元素：字體跟著走，避免怪怪的預設樣式 */
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

/* 6) 按鈕：讓你更好自訂 */
button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

/* 7) 連結：預設不強制改，但給你乾淨的起點 */
a {
  color: inherit;
  text-decoration: none;
}

/* 8) 標題與段落：避免預設字重/大小怪異（可自行加回設計系統） */
h1, h2, h3, h4, h5, h6 {
  font-size: inherit;
  font-weight: inherit;
}

/* 9) 清單：常見 UI 會自己做樣式 */
ul,
ol {
  list-style: none;
  padding: 0;
}

/* 10) 避免長字串把版面撐爆 */
p,
h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

/* 11) 讓根節點更好用（特別是 React / Next 常見） */
#root,
#__next {
  isolation: isolate;
}

/* 12) 尊重使用者偏好：減少動態效果 */
@media (prefers-reduced-motion: reduce) {
  html:focus-within {
    scroll-behavior: auto;
  }
  /* *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  } */
}