/* ===================================
   通用重置 & 全局设置 
=================================== */

/* 通用重置（综合参考自 Eric Meyer Reset、Normalize 等） */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* 让 HTML 高度占满视窗，方便后续布局 */
html,
body {
  height: 100%;
}

/* 全局字体与背景色，可根据需要调整 */
html {
  font-size: 16px; /* 1rem = 16px */
  line-height: 1.5;
  -webkit-text-size-adjust: 100%; /* 防止移动端浏览器自动调整文字尺寸 */
  scroll-behavior: smooth; /* 平滑滚动 */
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji",
               "Segoe UI Emoji", "Segoe UI Symbol";
  color: #333;
  background-color: #fafafa;
}

/* 去除列表默认样式 */
ul,
ol {
  list-style: none;
}

/* 去除默认下划线与颜色，由你自定义超链接样式 */
a {
  color: inherit; /* 继承父级颜色 */
  text-decoration: none;
}
a:hover,
a:focus {
  text-decoration: underline;
}

/* 图片、视频等媒体元素的自适应 */
img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 表单元素的基本样式 */
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  background-color: transparent;
  border: none;
  outline: none; /* 覆盖后记得自定义 focus 态样式，保证可访问性 */
}
button {
  cursor: pointer; /* 鼠标移入时显示手形光标 */
}

/* ===================================
   通用排版
=================================== */

/* 标题常规设置，可根据项目调大或调小字号 */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 0.5em;
}

h1 {
  font-size: 2rem; /* 32px */
}
h2 {
  font-size: 1.75rem; /* 28px */
}
h3 {
  font-size: 1.5rem; /* 24px */
}
h4 {
  font-size: 1.25rem; /* 20px */
}
h5 {
  font-size: 1.125rem; /* 18px */
}
h6 {
  font-size: 1rem; /* 16px */
}

/* 段落及文字间距 */
p {
  margin-bottom: 1em;
  line-height: 1.6;
}

/* 小段落或辅助文字 */
.small-text {
  font-size: 0.875rem; /* 14px */
  line-height: 1.4;
}

/* 粗体与斜体 */
strong {
  font-weight: bold;
}
em {
  font-style: italic;
}

/* ===================================
   常用类
=================================== */

/* 容器类：左右留边距，控制页面主体内容宽度 */
.container {
  width: 100%;
  max-width: 1200px; /* 根据实际需求可做调整 */
  margin: 0 auto;
  padding: 0 1rem; /* 内边距，适配移动端 */
}

/* 左浮动 */
.float-left {
  float: left;
}

/* 右浮动 */
.float-right {
  float: right;
}

/* 清除浮动：常称“clearfix” */
.clearfix::after {
  content: "";
  display: block;
  clear: both;
}


/* Flex 布局助手类 */
.flex {
  display: flex;
  gap: 1rem; /* 子元素之间的空隙 */
}
.flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* 网格布局助手类 */
.grid {
  display: grid;
  gap: 1rem; /* 网格间隙 */
}
.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}
.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}
.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* 隐藏元素但保留空间 */
.hidden {
  visibility: hidden;
}
/* 完全隐藏元素，且不占据空间 */
.d-none {
  display: none !important;
}

/* 间距工具类 (可根据需要扩展) */
.mt-1 {
  margin-top: 1rem;
}
.mb-1 {
  margin-bottom: 1rem;
}
.pt-1 {
  padding-top: 1rem;
}
.pb-1 {
  padding-bottom: 1rem;
}

/* 按钮样式示例 */
.btn {
  display: inline-block;
  padding: 0.75rem 1.25rem;
  background-color: #0070f3;
  color: #fff;
  border-radius: 4px;
  text-align: center;
  transition: background-color 0.2s ease;
}
.btn:hover {
  background-color: #005bb5;
}

/* ===================================
   媒体查询示例
   可根据需要调整断点
=================================== */

@media (max-width: 768px) {
  h1 {
    font-size: 1.75rem;
  }
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr; /* 在窄屏时堆叠 */
  }
}
