/* ========================================
   reset.css — 现代化 CSS 重置
   作用：统一各浏览器默认样式差异，建立一致的基础样式
   ======================================== */

/* 盒模型统一：所有元素使用 border-box，宽高计算包含内边距和边框 */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 页面根元素：平滑滚动 + 防止移动端横屏时字体缩放 */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* 页面主体：最小高度撑满视口，开启字体抗锯齿（更清晰的文字渲染） */
body {
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 媒体元素：块级显示 + 响应式宽度（防止图片溢出容器） */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

/* 表单元素：继承父级字体，避免浏览器默认字体干扰 */
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

/* 文本元素：长单词自动换行，防止撑破容器 */
p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

/* 链接：去除默认下划线和颜色，由各组件自行定义 */
a {
  color: inherit;
  text-decoration: none;
}

/* 列表：去除默认圆点/序号样式 */
ul,
ol {
  list-style: none;
}

/* 按钮：去除默认背景和边框，由 .btn 组件统一控制样式 */
button {
  cursor: pointer;
  background: none;
  border: none;
}

/* 表格：合并边框，去除单元格间距 */
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* 文字选中态：使用品牌主色（绿色）背景 + 白色文字 */
::selection {
  background-color: var(--color-primary);
  color: #fff;
}

/* 无障碍：尊重用户的"减少动画"系统设置，关闭所有过渡和动画 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
