* { box-sizing: border-box; }
html, body { height: 100%; }
/* 手机横屏时 iOS 会自动放大正文字号，把页面撑乱，这里固定住 */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* 点按不要那层灰色高亮，按下态由各组件自己的 :active 负责 */
html { -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  font-weight: var(--text-weight);
  line-height: 1.55;
  letter-spacing: var(--text-tracking);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; font-size: inherit; color: inherit; }
/* hidden 属性要真的隐藏：.btn 之类自己设了 display，会盖掉浏览器默认规则 */
[hidden] { display: none !important; }
h1, h2, h3, h4 { margin: 0; font-weight: var(--heading-weight); letter-spacing: -0.01em; text-wrap: balance; }
b, strong { font-weight: var(--strong-weight); }
p, li, dd, figcaption { text-wrap: pretty; }
ul { margin: 0; padding-left: 18px; }
code, .mono { font-family: var(--mono); }

/* 会变的数字统一等宽，避免 1 和 8 来回抖动 */
.mono-num, .mono, .countdown-time, .countdown-sub, .stat-num, .bar-num,
.ring-label, .mini-countdown, .t-date, .tl-time, .badge, .progress-num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* 小图标相对文字微下移 1px，避免视觉上飘起来 */
.ico, .dropzone-icon, .close-x, .chip-x, .tl-tag { transform: translateY(1px); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--text-mute); background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }
/* 选中文字：黑底上原来的紫灰几乎看不见，换成中国红（浅色主题用稍深一档保证白字可读）。
   文字色必须一起写死，否则深色主题下继承的浅灰压在红底上读不清。 */
::selection { background: var(--select-bg); color: var(--select-fg); }
::-moz-selection { background: var(--select-bg); color: var(--select-fg); }
input, textarea, select { font-family: inherit; }
/* 复选框 / 单选框：跟主题同色，默认尺寸太小（13px）手指点不准 */
input[type="checkbox"], input[type="radio"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
  flex: none;
  cursor: pointer;
}
