/* ==========================================================================
   基础重置与排版
   ========================================================================== */

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

/* 让 HTML 的 hidden 属性真正生效。
   作者样式里的 display:flex / grid 会盖过浏览器默认的 [hidden]{display:none}，
   结果是「设了 hidden 却收不回去」。这一条把它压回来。 */
[hidden] { display: none !important; }

html,
body {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scrollbar-gutter: stable;

  /* 底色铺在 html 上而不是 body：
     氛围层（effects.css 的 .atmosphere / .grain）用 z-index:-1，
     如果 body 自己带背景，绘制顺序会把它们整个盖住。 */
  background-color: var(--bg-0);
  min-height: 100%;
}

body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  line-height: var(--lh-normal);
  color: var(--text-0);

  /* 必须透明，见上面的说明 */
  background: transparent;

  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  letter-spacing: -0.02em;
}

h1 { font-size: var(--fs-2xl); letter-spacing: -0.028em; }
h2 { font-size: var(--fs-xl); letter-spacing: -0.022em; }
h3 { font-size: var(--fs-lg); letter-spacing: -0.015em; }

p { margin: 0; }

a {
  color: var(--neon-cyan);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}
a:hover { color: var(--neon-pink); }

img {
  max-width: 100%;
  display: block;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

input,
textarea,
select {
  font: inherit;
  color: inherit;
}

/* 键盘可达性：只在键盘导航时显示焦点环 */
:focus-visible {
  outline: 2px solid var(--neon-cyan);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}
:focus:not(:focus-visible) { outline: none; }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-0); }
::-webkit-scrollbar-thumb {
  background: var(--bg-3);
  border-radius: var(--r-pill);
  border: 2px solid var(--bg-0);
}
::-webkit-scrollbar-thumb:hover { background: var(--neon-violet); }

::selection {
  background: rgba(226, 88, 107, 0.35);
  color: var(--text-0);
}

/* 工具类 */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.text-gradient {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.muted { color: var(--text-1); }
.dim { color: var(--text-2); }
.tiny { font-size: var(--fs-xs); }
.small { font-size: var(--fs-sm); }
.bold { font-weight: var(--fw-bold); }
.center { text-align: center; }
.mono { font-family: var(--font-mono); }
