/* ==========================================================================
   reset.css — 基础重置与全局默认样式
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Box model & 元素归一
   -------------------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
}

body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
dl,
dd,
ul,
ol {
  margin: 0;
}

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

/* --------------------------------------------------------------------------
   2. 文档默认样式
   -------------------------------------------------------------------------- */

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

/* 移动端抽屉打开时锁定滚动 */
body.is-locked {
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   3. 标题
   基准：参考站的标题是 Georgia 衬线 + 常规字重（400），而非粗体无衬线。
   这里把 h1–h6 的默认值改成衬线常规字重，绝大多数区块标题无需再单独声明；
   个别需要「小号标注」气质的地方（页脚栏目标题、导航激活态）自行覆盖回无衬线。
   -------------------------------------------------------------------------- */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-serif);
  font-weight: var(--fw-regular);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  color: var(--color-primary-800);
}

h1 {
  font-size: var(--fs-4xl);
}
h2 {
  font-size: var(--fs-3xl);
}
h3 {
  font-size: var(--fs-xl);
}
h4 {
  font-size: var(--fs-lg);
}
h5,
h6 {
  font-size: var(--fs-md);
}

/* --------------------------------------------------------------------------
   4. 文本元素
   -------------------------------------------------------------------------- */

p {
  line-height: var(--lh-normal);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out),
    opacity var(--duration-fast) var(--ease-out);
}

strong,
b {
  font-weight: var(--fw-semibold);
}

small {
  font-size: var(--fs-sm);
}

/* --------------------------------------------------------------------------
   5. 媒体元素 —— 统一响应式行为
   -------------------------------------------------------------------------- */

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}



/* --------------------------------------------------------------------------
   6. 表单元素
   -------------------------------------------------------------------------- */

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
  margin: 0;
}

button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

textarea {
  resize: vertical;
}

/* 去掉数字输入框的箭头 */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  -moz-appearance: textfield;
}

/* --------------------------------------------------------------------------
   7. 表格
   -------------------------------------------------------------------------- */

table {
  border-collapse: collapse;
  border-spacing: 0;
  width: 100%;
}

/* --------------------------------------------------------------------------
   8. 可访问性 Accessibility
   -------------------------------------------------------------------------- */

/* 键盘聚焦态：仅在键盘操作时显示，鼠标点击不显示 */
:focus-visible {
  outline: 2px solid var(--color-primary-500);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

/* 跳过导航（屏幕阅读器 / 键盘用户） */
.skip-link {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -120%);
  z-index: var(--z-toast);
  padding: var(--space-3) var(--space-6);
  font-size: var(--fs-base);
  color: var(--color-text-inverse);
  background-color: var(--color-primary-600);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  transition: transform var(--duration-base) var(--ease-out);
}

.skip-link:focus {
  transform: translate(-50%, 0);
}

/* 视觉隐藏（保留给屏幕阅读器） */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* 尊重用户「减少动态效果」的系统偏好 */
@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;
  }
}

/* --------------------------------------------------------------------------
   9. 打印
   -------------------------------------------------------------------------- */

@media print {
  .site-header,
  .site-footer,
  .back-to-top,
  .floating-cta {
    display: none !important;
  }
}
