/* ============================================
   CSS 重置 - 统一浏览器默认样式
   ============================================ */

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  line-height: 1.6;
  font-family: var(--font-primary);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

a {
  text-decoration: none;
  color: inherit;
}

ul,
ol {
  list-style: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
  line-height: 1.2;
}

p {
  overflow-wrap: break-word;
}

/* 滚动条样式 — 不滚动时自动隐藏 */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0);
  border-radius: 3px;
  transition: background 0.3s ease;
}

/* 滚动时显示 */
html.is-scrolling::-webkit-scrollbar-thumb {
  background: var(--accent-primary);
}

html.is-scrolling::-webkit-scrollbar-thumb:hover {
  background: var(--accent-secondary);
}

/* Firefox 支持 */
html {
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

html.is-scrolling {
  scrollbar-color: var(--accent-primary) transparent;
}