/* ============================================
   星河入梦工作室 — CSS Reset
   基于现代 CSS Reset，安迪·贝尔风格
   ============================================ */

/* Box sizing */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Remove default margin & padding */
html,
body,
h1, h2, h3, h4, h5, h6,
p,
ul, ol,
dl, dd,
figure,
blockquote,
pre {
  margin: 0;
  padding: 0;
}

/* Remove list styles */
ul, ol {
  list-style: none;
}

/* Set core body defaults */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-normal);
  color: var(--color-text-primary);
  background-color: var(--color-bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Media defaults */
img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Form element font inheritance */
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

/* Button reset */
button {
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}

/* Link reset */
a {
  color: inherit;
  text-decoration: none;
}

/* Remove textarea resize */
textarea {
  resize: vertical;
}

/* Table reset */
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* Selection color */
::selection {
  background-color: var(--color-accent-glow);
  color: var(--color-text-primary);
}

/* Focus visible */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Hidden utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Page load transition */
body {
  opacity: 0;
  transition: opacity 0.4s ease;
}

body.loaded {
  opacity: 1;
}
