/**
 * CSS Reset - 忠泰大華企業
 * 基於 modern-normalize 和最佳實踐
 */

/* Box sizing 規則 */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* 移除預設邊距和內距 */
* {
  margin: 0;
  padding: 0;
}

/* 防止字體大小在 iOS 橫向模式下自動調整 */
html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* 基礎 body 設定 */
body {
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 圖片和媒體元素 */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* 繼承字體設定到表單元素 */
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

/* 移除按鈕預設樣式 */
button {
  background: none;
  border: none;
  cursor: pointer;
}

/* 文字溢出處理 */
p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

/* 標題元素重設 */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: inherit;
  font-size: inherit;
}

/* 連結重設 */
a {
  color: inherit;
  text-decoration: none;
}

/* 列表重設 */
ul,
ol {
  list-style: none;
}

/* 表格重設 */
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* 表單元素重設 */
input,
textarea {
  border: none;
  outline: none;
  background: transparent;
}

/* 移除 input type=number 的箭頭 */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
}

/* 移除 input type=search 的清除按鈕 */
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
}

/* 隱藏元素 */
[hidden] {
  display: none !important;
}

/* 無障礙：僅供螢幕閱讀器使用 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
