/* ============================================================
   reset.css — CSS Reset & 全局基线
   ============================================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

body {
  font-family: "Source Han Sans SC", "Noto Sans CJK SC", "Microsoft YaHei",
               "PingFang SC", -apple-system, BlinkMacSystemFont,
               "Segoe UI", Roboto, sans-serif;
  font-size: var(--fs-14);
  font-weight: var(--fw-400);
  line-height: var(--lh-normal);
  color: var(--text-primary);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* 默认元素 */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--fw-700);
  line-height: var(--lh-tight);
  color: var(--text-primary);
}

p { margin: 0; }
a {
  color: var(--text-link);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { color: var(--text-link-hover); }

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

ul, ol { list-style: none; }

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

/* Focus 可见性（无障碍） */
:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
  border-radius: var(--radius-sm);
}

/* 选中文本 */
::selection {
  background: var(--brand-accent);
  color: #fff;
}

/* 滚动条美化（WebKit） */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-surface-alt); }
::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
