/* base.css — reset、排版基线、滚动条、链接、动画关键帧 */

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

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'tnum' 1;   /* 等宽数字，便于价位对齐 */
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, select, textarea { font: inherit; color: inherit; }

a { color: var(--green-d); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--r-sm); }

/* 数字/代码等宽强调 */
.tnum { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1; }

/* 细滚动条 */
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: var(--line); border-radius: var(--r-pill); border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--ink-3); background-clip: content-box; }
*::-webkit-scrollbar-track { background: transparent; }

/* —— 关键帧（沿用原型命名）—— */
@keyframes mg-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes mg-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes mg-pop { 0% { opacity: 0; transform: translateY(6px) scale(.985); } 100% { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes mg-spin { to { transform: rotate(360deg); } }
@keyframes mg-shimmer { 0% { background-position: -480px 0; } 100% { background-position: 480px 0; } }
@keyframes mg-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes mg-textshine { 0% { background-position: 150% 50%; } 100% { background-position: -50% 50%; } }

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

.u-hidden { display: none !important; }
.u-mono { font-variant-numeric: tabular-nums; }
.u-nowrap { white-space: nowrap; }
.u-ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
