/* ─────────────────────────────────────────────────────────────
   Base · 重置、排版、布局骨架、通用原子类
   ───────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* hidden 属性优先于组件自身的 display（.btn 是 inline-flex，会盖掉 [hidden]） */
[hidden] { display: none !important; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button, input, textarea, select { font-family: inherit; }
button { cursor: pointer; }

h1, h2, h3, h4 { line-height: 1.4; }

/* 布局骨架 */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 calc(var(--pad) * 2); }
main.wrap {
  padding-top: calc(var(--pad) * 3);
  padding-bottom: var(--pad);
  position: relative;
  z-index: 1;
}

/* 通用占位 / 空态 */
.msg {
  text-align: center;
  color: var(--muted);
  padding: calc(var(--pad) * 3);
}
.msg a { color: var(--primary); }

/* 屏幕阅读器专用 */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* 文本截断 */
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
