/* ============================================================
   Base · reset / 排版 / 滚动条 / 通用工具类
   ============================================================ */

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

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 600; line-height: 1.35; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
table { border-collapse: collapse; border-spacing: 0; width: 100%; }
img { display: block; max-width: 100%; }
a { color: var(--c-primary); text-decoration: none; }
button { font-family: inherit; font-size: inherit; cursor: pointer; border: none; background: none; color: inherit; padding: 0; }
input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
input:focus, select:focus, textarea:focus, button:focus { outline: none; }
hr { border: none; border-top: 1px solid var(--c-border); margin: 0; }

/* 滚动条 —— Webkit */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #DCE1EC;
  border-radius: var(--r-pill);
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: #C3CAD9; background-clip: content-box; }
::-webkit-scrollbar-corner { background: transparent; }

/* 数字等宽，表格里对齐更好看 */
.num, .mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* ---- 工具类 ---- */
.u-flex { display: flex; }
.u-flex-center { display: flex; align-items: center; }
.u-between { display: flex; align-items: center; justify-content: space-between; }
.u-col { display: flex; flex-direction: column; }
.u-wrap { flex-wrap: wrap; }
.u-gap-1 { gap: var(--sp-1); }
.u-gap-2 { gap: var(--sp-2); }
.u-gap-3 { gap: var(--sp-3); }
.u-gap-4 { gap: var(--sp-4); }
.u-gap-5 { gap: var(--sp-5); }
.u-gap-6 { gap: var(--sp-6); }
.u-grow { flex: 1; min-width: 0; }
.u-shrink0 { flex-shrink: 0; }
.u-mt-1 { margin-top: var(--sp-1); }
.u-mt-2 { margin-top: var(--sp-2); }
.u-mt-3 { margin-top: var(--sp-3); }
.u-mt-4 { margin-top: var(--sp-4); }
.u-mt-5 { margin-top: var(--sp-5); }
.u-mt-6 { margin-top: var(--sp-6); }
.u-mb-2 { margin-bottom: var(--sp-2); }
.u-mb-3 { margin-bottom: var(--sp-3); }
.u-mb-4 { margin-bottom: var(--sp-4); }
.u-tr { text-align: right; }
.u-tc { text-align: center; }
.u-nowrap { white-space: nowrap; }
.u-ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-hidden { display: none !important; }
.u-muted { color: var(--c-text-2); }
.u-faint { color: var(--c-text-3); }
.u-sm { font-size: var(--fs-sm); }
.u-xs { font-size: var(--fs-xs); }
.u-bold { font-weight: 600; }
.u-panel {
  background: var(--c-panel);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-xs);
}
.u-scroll-y { overflow-y: auto; }
.u-pointer { cursor: pointer; }

/* 焦点可见性（键盘可达） */
:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}

/* 无障碍：仅屏幕阅读器 */
.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;
}

/* 打印 */
@media print {
  body { background: #fff; }
  .no-print { display: none !important; }
}
