/* ==== 1. 盒模型統一 ==== */
*, *::before, *::after {
box-sizing: border-box;
margin: 0;
padding: 0;
}
/* ==== 2. 根字體與縮放 ==== */
html {
font-size: 100%; /* 16px 基準,支援 rem 縮放 */
-webkit-text-size-adjust: 100%; /* 防止 iOS 橫屏字體放大 */
scroll-behavior: smooth; /* 平滑滾動 */
}
/* ==== 3. 基礎排版 ==== */
body {
min-height: 100vh;
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
font-size: 1rem; /* 16px */
line-height: 1.6;
color: #1a1a1a;
background-color: #fff;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
/* ==== 4. 媒體元素響應式 ==== */
img, video, canvas, svg, picture {
max-width: 100%;
height: auto;
display: block; /* 消除底部間隙 */
vertical-align: middle;
}
/* ==== 5. 表單元素繼承字體 ==== */
input, button, textarea, select {
font: inherit;
color: inherit;
}
/* ==== 6. 移除列表默認樣式 (按需) ==== */
ul, ol, menu { list-style: none; }
/* ==== 7. 表格邊框合併 ==== */
table { border-collapse: collapse; border-spacing: 0; }
/* ==== 8. 焦點可見性 (無障礙) ==== */
:focus-visible {
outline: 2px solid #0066cc;
outline-offset: 2px;
}
/* ==== 9. 選中文字樣式 ==== */
::selection {
background: #0066cc;
color: #fff;
}
* { margin:0; padding:0 }?::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #a1a1a1; }
⚠️ 非標準屬性,僅 WebKit/Blink 支援。Firefox 用 scrollbar-width/color (CSS Scrollbars 標準)。
reset.css / normalize.css 作為專案**唯一入口**,所有樣式後載入。npm pkg set browserslist="last 2 versions, not dead" 配合 Autoprefixer。design-tokens.css (色彩、間距、字體、圓角、陰影 CSS 變數)。stylelint-config-standard + stylelint-config-prettier 強制格式。現代 CSS 基礎樣式 = **盒模型統一 + 字體繼承鏈 + 響應式媒體 + 無障礙焦點 + 設計系統 Token**。拋棄暴力歸零,擁抱標準化 Normalize + 專案級 Token,讓每個新頁面從「乾淨、一致、可縮放」的起跑線出發。