/* ============================================
   货代小工具 — ② 基础层 (Base)
   重置 / 排版 / 焦点可见 / 滚动条 / 选中态
   ============================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--surface-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- 排版 ---------- */
h1, h2, h3, h4, h5, h6 {
  margin-top: 0;
  color: var(--text-primary);
  font-weight: 600;
  letter-spacing: -.011em;
}

p {
  margin-top: 0;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--duration-base) var(--ease-out);
}

a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

code, kbd, pre, samp {
  font-family: var(--font-mono);
  font-size: .92em;
}

hr {
  border: 0;
  border-top: 1px solid var(--border-subtle);
  margin: var(--space-6) 0;
}

/* ---------- 焦点可见（键盘导航） ---------- */
:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

/* 鼠标点击不显示焦点环，键盘 Tab 才显示 */
:focus:not(:focus-visible) {
  outline: none;
}

/* ---------- 选中态 ---------- */
::selection {
  background-color: var(--brand-100);
  color: var(--gray-900);
}

/* ---------- 滚动条 ---------- */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--gray-300) transparent;
}

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

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

::-webkit-scrollbar-thumb {
  background-color: var(--gray-300);
  border: 2px solid transparent;
  background-clip: content-box;
  border-radius: var(--radius-full);
  transition: background-color var(--duration-base) var(--ease-out);
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--gray-400);
}

/* ---------- 图标 ---------- */
/* 描边图标统一规格：Lucide 风格，1.75px 描边，随文字色 */
.icon {
  width: 1.125em;
  height: 1.125em;
  stroke-width: 1.75;
  stroke: currentColor;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  vertical-align: -.15em;
}

.icon-sm {
  width: 1em;
  height: 1em;
  stroke-width: 2;
}

.icon-lg {
  width: 1.375em;
  height: 1.375em;
}

/* 无障碍：仅屏幕阅读器可见（SVG sprite 容器） */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Bootstrap 兼容性修正 ---------- */
/* Bootstrap 默认 body 字号偏小、文本色偏灰，这里统一回语义令牌 */
.text-secondary { color: var(--text-secondary) !important; }
.text-muted     { color: var(--text-tertiary) !important; }
.text-danger    { color: var(--danger-text) !important; }
