/* =============================================================
 * base.css —— 基础重置 / 排版 / 无障碍基础
 * 只定义全局底层规则，不牵扯具体组件。
 * ============================================================= */

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

html,body{
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
  overflow-x:hidden;              /* 防止横向溢出导致的移动端错位 */
  transition:background .4s,color .4s;
  scroll-behavior:smooth;
}
/* 在 html 上设 overflow-x:hidden 会把根元素变成滚动容器，影响锚点跳转等行为。
   支持 clip 的浏览器改用 clip：同样裁掉横向溢出，但不创建滚动容器。 */
@supports (overflow-x: clip){
  html{ overflow-x:clip; }
}
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior:auto; }
  *{ transition:none !important; animation:none !important; }
}

body{
  font-family:var(--font-body);
  color:var(--txt);
  background:var(--bg);
  line-height:1.6;
}

img{ display:block; max-width:100%; height:auto; }
a{ color:inherit; text-decoration:none; }
button{ font-family:inherit; }

/* 文本选区配色 */
::selection{ background:var(--accent); color:#fff; }

/* ---------- 无障碍：键盘焦点可见 ---------- */
:focus-visible{
  outline:2px solid var(--accent-2);
  outline-offset:2px;
  border-radius:4px;
}
/* 去掉鼠标点击时的焦点环，仅键盘导航显示 */
:focus:not(:focus-visible){ outline:none; }

/* ---------- 无障碍：跳到主内容 ---------- */
.skip-link{
  position:fixed;
  left:16px; top:-60px;
  z-index:300;
  padding:10px 18px;
  background:var(--accent);
  color:#fff;
  font-weight:700;
  border-radius:var(--r-sm);
  transition:top .2s var(--ease);
}
.skip-link:focus{ top:16px; }

/* ---------- 通用容器 ---------- */
.wrap{
  max-width:var(--wrap-max);
  margin:0 auto;
  padding:0 var(--wrap-pad);
}
@media (min-width:1600px){
  .wrap{ max-width:1600px; padding:0 44px; }
}
