/* ====================================
   Modern CSS Reset (2025)
   精簡版 - 移除過時規則，只保留必要的重置
   ==================================== */

/* 1. Box Model 統一 */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* 2. 移除預設間距 */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, address, cite, code, del, dfn, em, img, ins,
kbd, q, s, samp, small, strong, sub, sup, var,
b, u, i, dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, menu, nav, 
output, ruby, section, summary, time, mark, audio, video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
}

/* 3. HTML & Body 基礎設定 */
html {
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

body {
  line-height: inherit;
}

/* 4. 列表樣式 */
ol, ul {
  list-style: none;
}

/* 5. 引用標籤 */
blockquote, q {
  quotes: none;
}

blockquote::before, blockquote::after,
q::before, q::after {
  content: '';
  content: none;
}

/* 6. 表格 */
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* 7. 媒體元素 */
img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* 8. 表單元素 */
input, button, textarea, select {
  font: inherit;
  color: inherit;
  margin: 0;
}

button {
  cursor: pointer;
  overflow: visible;
  background: none;
  border: none;
}

button:disabled {
  cursor: not-allowed;
}

/* 移除 number input 的上下箭頭 */
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;
}

/* Checkbox 和 Radio */
input[type="checkbox"],
input[type="radio"] {
  padding: 0;
}

/* Search input */
input[type="search"] {
  -webkit-appearance: textfield;
}

input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
}

/* Textarea */
textarea {
  overflow: auto;
  resize: vertical;
}

/* Fieldset */
fieldset {
  border: 1px solid #ccc;
  margin: 0 2px;
  padding: 0.35em 0.625em 0.75em;
}

legend {
  border: 0;
  padding: 0;
}

/* Optgroup */
optgroup {
  font-weight: bold;
}

/* 9. 焦點樣式（無障礙）*/
:focus:not(:focus-visible) {
  outline: none;
}

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* 10. 連結 */
a {
  background-color: transparent;
  text-decoration: none;
  color: inherit;
}

/* 11. 隱藏元素 */
[hidden] {
  display: none !important;
}

/* 12. HR 分隔線 */
hr {
  box-sizing: content-box;
  height: 0;
  overflow: visible;
  border: none;
  border-top: 1px solid currentColor;
  margin: 1em 0;
}

/* 13. 縮寫標籤 */
abbr[title] {
  border-bottom: 1px dotted;
  text-decoration: none;
}
