/* =========================================
   Reset · 基于 modern-normalize 思路
   ========================================= */

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

* {
  margin: 0;
}

[hidden] {
  display: none !important;
}

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  min-height: 100dvh;
  line-height: 1.6;
  font-family: var(--font-sans);
}

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;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

ul,
ol {
  list-style: none;
  padding: 0;
}

#root,
#__next {
  isolation: isolate;
}

::selection {
  background: var(--color-accent-soft);
  color: var(--color-fg);
}

/* Focus visible —— 关键，2px outline + 偏移 */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Skip Link */
.skip-link {
  position: absolute;
  inset-inline-start: 1rem;
  inset-block-start: -100px;
  padding: 0.75rem 1rem;
  background: var(--color-fg);
  color: var(--color-bg);
  font-weight: 600;
  border-radius: 8px;
  z-index: 999;
  transition: top 200ms cubic-bezier(0.16, 1, 0.3, 1);
}
.skip-link:focus {
  inset-block-start: 1rem;
}
