/* ============================================================
   base.css — reset、字体、滚动条、可访问性、通用工具类
   ============================================================ */

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

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI',
    'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--t-text);
  background: var(--t-bg-layout);
  min-height: 100vh;
  transition: background-color 0.25s ease, color 0.25s ease;
}

h1, h2, h3, h4 { font-weight: 600; line-height: 1.35; }

/* 数字一律等宽对齐，金额列专用 */
.num,
input[type="number"],
.result-table td,
.result-table th,
.summary-item .value,
.detail-table td,
.detail-table th { font-variant-numeric: tabular-nums; }

::selection { background: var(--t-primary-bg); }

/* 滚动条（WebKit + Firefox 细化） */
* { scrollbar-width: thin; scrollbar-color: var(--t-border) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--t-border); border-radius: 4px; }
*::-webkit-scrollbar-thumb:hover { background: var(--t-text-3); }
*::-webkit-scrollbar-track { background: transparent; }

/* 键盘可见焦点环 */
:focus-visible {
  outline: 2px solid var(--t-primary);
  outline-offset: 1px;
}
input:focus-visible,
select:focus-visible,
textarea:focus-visible { outline: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- 通用工具类 ---------- */
.t-hidden { display: none !important; }
.t-mono { font-family: 'Bahnschrift', 'DIN Alternate', Consolas, monospace; }

.t-ellipsis {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* 横向滚动容器：宽表格统一包裹 */
.scroll-x {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
