/* ============================================
   base.css —— Reset + 全局样式 + Google Fonts
   ============================================ */

/* —— Google Fonts 引入 —— */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500&display=swap');

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

/* —— 全局 —— */
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-weight: var(--fw-light);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text-primary);
  background-color: var(--bg-base);
  min-height: 100vh;
  overflow-x: hidden;
}

/* —— 链接 —— */
a {
  color: var(--green-accent);
  text-decoration: none;
  transition: color var(--duration-normal) var(--ease-out);
}

a:hover {
  color: var(--green-deep);
}

/* —— 图片 —— */
img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* —— 选中态 —— */
::selection {
  background: var(--green-light);
  color: var(--text-primary);
}

/* —— 滚动条 —— */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-base);
}

::-webkit-scrollbar-thumb {
  background: var(--green-light);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--green-mid);
}

/* —— 噪点纹理叠加层 —— */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px;
}

/* —— 标题层级 —— */
h1 {
  font-size: var(--fs-h1);
  font-weight: var(--fw-regular);
  line-height: var(--lh-tight);
}

h2 {
  font-size: var(--fs-h2);
  font-weight: var(--fw-regular);
  line-height: var(--lh-tight);
}

h3 {
  font-size: var(--fs-h3);
  font-weight: var(--fw-medium);
}

/* —— 工具类 —— */
.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;
}
