/* ============================================================
   base.css · reset / 排版 / 工具类 / 全局响应式
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-weight: 600; line-height: 1.35; }
h1 { font-size: var(--fs-xl); }
h2 { font-size: var(--fs-lg); }
h3 { font-size: var(--fs-md); }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: var(--fs-base); color: var(--text); }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: not-allowed; }
img, svg { vertical-align: middle; max-width: 100%; }
ul, ol { list-style: none; }
table { border-collapse: collapse; width: 100%; }
::selection { background: var(--brand-soft); color: var(--brand-deep); }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--brand); color: #fff; padding: 10px 16px; border-radius: var(--r-sm);
}
.skip-link:focus { left: 12px; top: 12px; }

.container { width: min(var(--maxw), calc(100% - 40px)); margin: 0 auto; }
.page-body { flex: 1; width: 100%; }
main { min-width: 0; }

/* 页题与区块题使用衬线，正文一律系统字体 */
.shop-page-heading h1, .catalog-heading h1, .transaction-heading h1,
.pd-title, .panel-title, .admin-heading h2, .install-complete h1 { font-family: var(--font-display); letter-spacing: -.3px; }

/* 工具类 */
.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; }
.no-wrap { white-space: nowrap; }
.break-all, .mono { overflow-wrap: anywhere; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.text-ok { color: var(--ok); }
.text-danger { color: var(--danger); }
.text-link { color: var(--brand); font-size: var(--fs-sm); border-bottom: 1px solid transparent; }
.text-link:hover { border-bottom-color: currentColor; }
.spacer { flex: 1; }
.full { grid-column: 1 / -1; }
.s, .t, .c, .cap, .word, .no, .name, .cnt, .info, .text, .link, .head, .ic, .num, .lbl, .uid, .time, .primary, .secondary { min-width: 0; }
[hidden] { display: none !important; }

/* 统一断点：1200 / 900 / 640，360 兜底 */
@media (max-width: 1200px) {
  .container { width: min(100% - 32px, var(--maxw)); }
}
@media (max-width: 640px) {
  .container { width: calc(100% - 24px); }
  h1 { font-size: 22px; }
  h2 { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
