/* CSS Reset - 现代化重置样式 */

/* 1. 使用更好的盒模型 */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* 2. 移除默认边距 */
* {
  margin: 0;
  padding: 0;
}

/* 3. 改善媒体元素的默认样式 */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* 4. 移除表单元素的默认字体样式 */
input,
button,
textarea,
select {
  font: inherit;
}

/* 5. 避免文本溢出 */
p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
  line-height: 1.5;
}

/* 6. 改善根元素的默认样式 */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

/* 7. 改善body的默认样式 */
body {
  min-height: 100vh;
  text-rendering: optimizeSpeed;
  line-height: 1.6;
  font-family: var(--font-primary);
  color: var(--text-dark);
  background-color: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 8. 移除列表样式 */
ul,
ol {
  list-style: none;
}

/* 9. 改善链接的默认样式 */
a {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

a:focus {
  outline: 2px solid var(--primary-green);
  outline-offset: 2px;
}

/* 10. 改善按钮的默认样式 */
button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
}

button:focus {
  outline: 2px solid var(--primary-green);
  outline-offset: 2px;
}

/* 11. 改善表格的默认样式 */
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* 12. 改善表单元素的默认样式 */
input,
textarea {
  border: none;
  outline: none;
  background: transparent;
}

input:focus,
textarea:focus {
  outline: 2px solid var(--primary-green);
  outline-offset: 2px;
}

/* 13. 隐藏元素 */
.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;
}

/* 14. 清除浮动 */
.clearfix::after {
  content: "";
  display: table;
  clear: both;
}

/* 15. 响应式图片 */
.responsive-img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 16. 禁用选择 */
.no-select {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* 17. 移动端优化 */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}