/* =============================================================================
   cc-reset.css — 基础重置与排版
   cnext design system · 个人 mark: cc

   内容：
   - 盒模型重置
   - body 基础排版（所有 token 走 cc-tokens.css）
   - 滚动条
   - focus-visible（键盘导航可访问性）
   - prefers-reduced-motion（减少动画偏好）

   引入顺序（必须）：
   cc-reset.css → cc-tokens.css → cc-structure.css → cc-skin-*.css
============================================================================= */

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

html {
  font-size: 13px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text-primary);
  background: var(--bg-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; }

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

/* 滚动条（走 token 配色，主题切换自动跟随） */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-hover) transparent;
}
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--border-hover);
  border-radius: 4px;
}
*::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* 键盘焦点：仅在键盘导航时显示（鼠标点击不显示） */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* 选区文字 */
::selection {
  background: var(--accent-soft);
  color: var(--text-primary);
}

/* 减少动画偏好（可访问性） */
@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;
  }
}
