/* 数字森林科技官网 - 现代化重置样式 */
/* 基于现代CSS重置最佳实践 */

/* 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;
  hyphens: auto;
}

/* 6. 改善行高和字体渲染 */
body {
  line-height: var(--line-height-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeSpeed;
}

/* 7. 改善列表样式 */
ul,
ol {
  list-style: none;
}

/* 8. 移除链接的默认样式 */
a {
  text-decoration: none;
  color: inherit;
}

/* 9. 改善按钮的默认样式 */
button {
  border: none;
  background: none;
  cursor: pointer;
}

/* 10. 改善表格样式 */
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* 11. 改善引用样式 */
blockquote,
q {
  quotes: none;
}

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

/* 12. 移除iframe边框 */
iframe {
  border: 0;
}

/* 13. 改善水平线样式 */
hr {
  border: none;
  height: 1px;
  background: var(--gray-medium);
  margin: var(--space-lg) 0;
}

/* 14. 改善代码样式 */
code,
pre {
  font-family: 'Courier New', Courier, monospace;
}

/* 15. 改善选中文本样式 */
::selection {
  background: var(--primary-green);
  color: var(--white);
}

::-moz-selection {
  background: var(--primary-green);
  color: var(--white);
}

/* 16. 改善滚动条样式（Webkit浏览器） */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--gray-light);
}

::-webkit-scrollbar-thumb {
  background: var(--gray-dark);
  border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-green);
}

/* 17. 改善焦点样式 */
:focus {
  outline: 2px solid var(--primary-green);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* 18. 减少动画对于偏好减少动画的用户 */
@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;
  }
}

/* 19. 改善打印样式 */
@media print {
  *,
  *::before,
  *::after {
    background: transparent !important;
    color: black !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }
  
  a,
  a:visited {
    text-decoration: underline;
  }
  
  img {
    page-break-inside: avoid;
  }
  
  p,
  h2,
  h3 {
    orphans: 3;
    widows: 3;
  }
  
  h2,
  h3 {
    page-break-after: avoid;
  }
}