/* ============================================================
   base.css — 全局重置 & 基础元素样式
   依赖：design-tokens.css
   ============================================================ */

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

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

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--font-regular);
  color: var(--color-text-primary);
  background-color: var(--color-bg);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ── 排版 ───────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-semibold);
  line-height: var(--leading-tight);
  color: var(--color-text-primary);
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }

p { line-height: var(--leading-loose); }

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { color: var(--color-primary-dark); }

/* ── 表单元素重置 ───────────────────────────────────── */
input, textarea, select, button {
  font-family: inherit;
  font-size: inherit;
  outline: none;
  border: none;
  background: none;
}

button { cursor: pointer; }

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

ul, ol { list-style: none; }

table { border-collapse: collapse; width: 100%; }

/* ── 滚动条样式 ─────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--color-bg);
}
::-webkit-scrollbar-thumb {
  background: var(--color-primary-lighter);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary-light);
}

/* ── 选中文字颜色 ───────────────────────────────────── */
::selection {
  background: var(--color-primary-lighter);
  color: var(--color-primary-dark);
}
