/* ================================================================
   考试急 PWA — Reset & Global v3.0
   盒模型重置、全局排版、无障碍基础
   ================================================================ */

/* === 盒模型 === */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* === 根元素 === */
html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === Body 全局 === */
body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-normal);
  line-height: var(--leading-normal);
  color: var(--text);
  background: var(--ink-base);
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 100%;
  margin: 0 auto;
  position: relative;
  overflow-x: hidden;
}

/* === 链接 === */
a {
  color: var(--amber);
  text-decoration: none;
}

/* === 图片 & 媒体 === */
img, svg, video, canvas {
  display: block;
  max-width: 100%;
}

/* === 按钮重置 === */
button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

/* === 输入重置 === */
input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* === 列表 === */
ul, ol {
  list-style: none;
}

/* === 标题 === */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
}

/* ================================================================
   文本选择
   ================================================================ */

::selection {
  background: rgba(232, 168, 56, 0.25);
  color: var(--text);
}

/* ================================================================
   自定义滚动条 (Webkit)
   ================================================================ */

::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(235, 232, 224, 0.08);
  border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(235, 232, 224, 0.14);
}

/* ================================================================
   无障碍 — 减少动画
   ================================================================ */

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

/* ================================================================
   聚焦样式 — 可见的键盘焦点
   ================================================================ */

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

/* 按钮和输入框用更克制的聚焦环 */
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 1px;
}
