/* ---------------------------------------
   基本 CSS Reset + Normalize + Utility
   by ChatGPT (RWD + A11y + 現代語法)
--------------------------------------- */

/* Box sizing: 保證所有元素的寬高包含邊框與內距 */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* 移除預設邊距 */
body,
h1, h2, h3, h4, h5, h6,
p, figure, blockquote,
dl, dd {
  margin: 0;
}

/* 設定 body 的基本樣式 */
body {
  min-height: 100vh;
  line-height: 1.5;
  font-family:  "Noto Sans TC", Arial, sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  background-color: #fff;
}

/* 預設圖片與影片行為：不超出容器寬度 */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

/* 移除內建的表單樣式差異 */
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

/* 連結預設樣式 */
a {
  color: inherit;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* 按鈕游標與禁用狀態 */
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

/* 表格設定 */
table {
  border-collapse: collapse;
  width: 100%;
}

/* 列表預設 */
ul[role="list"],
ol[role="list"] {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* 預設文字斷行策略（支援 CJK） */
p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
  word-break: break-word;
}

/* 針對 prefers-reduced-motion 的無障礙設定 */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------------------------------------
   實用 Utility Classes
--------------------------------------- */

/* Container 寬度與間距 */
.u-container {
  width: min(92%, 1200px);
  margin-inline: auto;
  padding-inline: 1rem;
}

/* Flex 常用排版 */
.flex {
  display: flex;
  align-items: center;
}
.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Grid 排版 */
.grid {
  display: grid;
  gap: 1rem;
}

/* 可視覺隱藏但保留可存取性 (screen reader) */
.u-visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

