/* ==============================================================
   reset.css · 浏览器样式重置
   ============================================================== */

/* 1. 基础重置 --------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  line-height: 1.6;
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  color: var(--color-text-inverse);
  background-color: var(--color-bg-dark);
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6,
p, figure, blockquote, dl, dd {
  margin: 0;
}

ul[role="list"],
ol[role="list"],
ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

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

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

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

table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* 2. 焦点可见性 ------------------------------------------------------ */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* 3. 文本换行 --------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  text-wrap: balance;
  line-height: 1.2;
}

p {
  text-wrap: pretty;
}

/* 4. 媒体元素 --------------------------------------------------------- */
img,
video {
  font-style: italic;
  background-repeat: no-repeat;
  background-size: cover;
  shape-margin: 0.75rem;
}

/* 5. 减少动效 --------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html:focus-within {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

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