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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-md);
  font-weight: var(--weight-normal);
  line-height: var(--leading-normal);
  color: #141412;
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ===== 中文排版 ===== */

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  color: var(--color-text);
}

h1 {
  font-size: var(--text-4xl);
  font-weight: 650;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-8);
}

h2 {
  font-size: 28px;
  font-weight: 630;
  margin-top: 80px;
  margin-bottom: var(--space-6);
  padding-bottom: 0;
}

h3 {
  font-size: var(--text-xl);
  margin-top: var(--space-10);
  margin-bottom: var(--space-4);
}

h4 {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  margin-top: var(--space-8);
  margin-bottom: var(--space-3);
}

p {
  margin-bottom: var(--space-5);
}

strong {
  font-weight: var(--weight-semibold);
}

a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color var(--duration-fast) var(--ease-out);
}

a:hover {
  color: var(--color-accent-hover);
}

ul, ol {
  padding-left: var(--space-6);
  margin-bottom: var(--space-5);
}

li {
  margin-bottom: var(--space-2);
}

li + li {
  margin-top: var(--space-1);
}

hr {
  border: none;
  border-top: 1px solid var(--color-border-light);
  margin: var(--space-12) 0;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--color-bg-secondary);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
}

/* ===== 选中文本 ===== */
::selection {
  background: var(--color-highlight);
  color: var(--color-text);
}

/* ===== 无障碍：减少动画 ===== */
@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;
  }
}
