/* ============================================================
   02. 基础重置
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-gutter: stable; -webkit-text-size-adjust: 100%; }
html.is-scroll-locked { overflow: hidden; }
body {
  margin: 0; min-height: 100vh;
  font-family: var(--font-sans); font-size: 16px; line-height: 1.6;
  color: var(--text-primary); background-color: var(--bg-base);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4, p, figure, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button {
  font: inherit; color: inherit; background: none; border: none; padding: 0;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
input, textarea { font: inherit; color: inherit; -webkit-appearance: none; appearance: none; }
[hidden] { display: none !important; }
/* 焦点可见性：新浏览器仅键盘聚焦时显示；旧浏览器（不支持 :focus-visible，
   :not() 内伪类无效使整条规则被忽略）回退为所有聚焦均显示，键盘可达性兜底 */
:focus { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
:focus:not(:focus-visible) { outline: none; }
/* 锚点跳转的焦点目标（section 容器）不显示焦点框，避免视觉噪音 */
main section[id]:focus { outline: none; }
/* 桌面端文字选中样式 */
::selection { background: var(--accent); color: var(--accent-contrast); }
/* 桌面滚动条：Firefox 用标准属性，WebKit/Blink 用伪元素 */
html { scrollbar-width: thin; scrollbar-color: var(--text-tertiary) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--text-tertiary); border-radius: 6px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
.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;
}
section[id] { scroll-margin-top: 104px; }
.no-js .reveal { opacity: 1 !important; transform: none !important; }

html.is-theme-switching *,
html.is-theme-switching *::before,
html.is-theme-switching *::after {
  transition-duration: 0s !important;
  transition-delay: 0s !important;
  animation-duration: 0s !important;
}

