/**
 * AKSRT Reset
 * 现代精简 reset，结合 box-sizing 与 a11y 友好的默认值。
 */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  background-color: var(--surface-page);
  color: var(--color-ink-2);
  transition: background-color 0.25s ease, color 0.25s ease;
  overflow-x: hidden;
}

/* 媒体元素 */
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;
  transition: color var(--dur-fast) var(--ease);
}

a:hover {
  color: var(--color-primary);
}

/* 焦点环：a11y 关键 */
:focus {
  outline: none;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: 4px;
}

/* 选区色 */
::selection {
  background: var(--color-primary-soft);
  color: var(--color-ink);
}

/* 屏幕阅读器隐藏 */
.screen-reader-text,
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.screen-reader-text:focus,
.sr-only:focus {
  position: fixed !important;
  top: 16px;
  left: 16px;
  width: auto;
  height: auto;
  padding: 8px 16px;
  background: var(--surface-1);
  color: var(--color-ink);
  z-index: 100000;
  clip: auto;
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius);
}

/* 减少动效偏好 */
@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;
  }
}
