/* 页面头部样式 */
.header {
  display: flex;
  justify-content: center; /* 居中以限制宽度范围 */
  align-items: center;
  padding: 10px 20px;
  background-color: #ff9800; /* 背景颜色 */
  position: fixed;
  top: 0;
  width: 100%;
  height: 60px;
  z-index: 1000; /* 确保覆盖其他元素 */
}

/* 内部容器，用于限制内容宽度 */
.header .container {
  display: flex;
  justify-content: space-between; /* 左右对齐 */
  align-items: center;
  max-width: 960px; /* 限制最大宽度 */
  width: 100%; /* 容器宽度占满 */
  margin: 0 auto;
  padding: 0 20px; /* 为两侧内容增加内边距 */
}

/* logo 样式 */
.logo-container {
  display: flex;
  align-items: center;
  gap: 20px; /* 调整 logo 和网页名称间距 */
}

.logo-container img {
  width: 40px; /* logo 图片宽高 */
  height: 40px;
}

.logo-container .web-name {
  font-size: 1.5rem; /* 字体大小 */
  font-weight: bold;
  color: white;
  white-space: nowrap; /* 防止文本换行 */
}

/* logo 文本样式 */
.logo h1 {
  margin: 0;              /* 移除默认外边距 */
  font-size: 1.5em;       /* 相对于body的字体大小 */
}

/* 导航链接样式 */
.nav-links {
  display: flex;
  gap: 20px; /* 链接间距 */
  justify-content: flex-end; /* 右对齐 */
  flex-grow: 1; /* 占满容器剩余空间 */
}

.nav-links a {
  color: white;
  text-decoration: none; /* 移除下划线 */
  transition: color 0.3s ease;
  font-size: 1rem;
  cursor: pointer; /* 修改光标样式 */
}

.nav-links a:hover {
  color: #ffd740; /* 悬停时颜色变化 */
}

/* 响应式隐藏菜单 */
.menu-toggle {
  display: none; /* 默认不显示 */
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  flex-direction: column;
  justify-content: space-around;
  width: 20px;
  height: 15px;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: white;
}

/* 窄屏样式 */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    flex-direction: column;
    gap: 10px;
    background-color: #e65100;
    position: absolute;
    top: 60px;
    right: 20px;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  }

  .nav-links a {
    text-align: center;
  }

  .menu-toggle {
    display: flex; /* 显示菜单按钮 */
  }
}

body {
  background-color: #fff5d6; /* 淡黄色背景 */
  font-family: Arial, sans-serif;
}

/* 全局光标样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  cursor: url("../resource/images/Mouse_cursor/SummerPockets.png"), url("../resource/images/Mouse_cursor/SummerPockets.cur"), default;
}

/* 主要内容区域样式 */
main {
  max-width: 960px;         /* 最大宽度 */
  margin: 0 auto;           /* 自动居中 */
  padding-top: 80px;            /* 内边距 */
  background-color: transparent;  /* 背景颜色设为透明 */
}

/* 内容区块样式 */
section {
  background-color: #f4f4f4; /* 背景颜色 */
  padding: 20px;              /* 内边距 */
  border-radius: 10px;        /* 圆角 */
  margin-bottom: 20px;        /* 下方外边距 */
}

.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  padding: 20px;
}

.card {
  border: 1px solid #ccc;
  padding: 10px;
  background-color: #f9f9f9;
}

/* 标题样式 */
h2 {
  font-size: 1.5em;           /* 相对于body的字体大小 */
  color: #4a4a4a;             /* 文字颜色 */
  margin-bottom: 10px;        /* 下方外边距 */
}

/* 子标题样式 */
h3 {
  font-size: 1.125em;         /* 相对于body的字体大小 */
  color: #777;                /* 文字颜色 */
  margin-top: 20px;           /* 上方外边距 */
  margin-bottom: 5px;         /* 下方外边距 */
}

/* 分割线样式 */
hr {
  border: none;              /* 无边框 */
  height: 1px;               /* 高度 */
  background-color: #ccc;    /* 背景颜色 */
  margin: 15px 0;            /* 上下方外边距 */
}

/* 段落样式 */
p {
  font-size: 1em;            /* 相对于body的字体大小 */
  margin: 0 0 10px;          /* 上下外边距 */
}

/* 图片样式 */
img {
  width: 100%;               /* 宽度自适应 */
  max-width: 400px;          /* 最大宽度限制 */
  display: block;            /* 块级元素显示 */
  margin: 20px auto;         /* 上下外边距，水平居中 */
  cursor: pointer; /* 修改光标样式 */
}

/* 链接样式 */
a {
  color: #007bff;            /* 文字颜色 */
  text-decoration: none;     /* 移除下划线 */
  font-size: 1em;            /* 添加字体大小，默认为相对于body的大小 */
  cursor: pointer; /* 修改光标样式 */
}

/* 链接悬停效果 */
a:not(.header a):hover {
  text-decoration: underline; /* 悬停时添加下划线 */
}

/* header 中的链接悬停效果 */
.header .nav-links a:hover {
  text-decoration: none; /* 悬停时没有下划线 */
}

/* 页脚样式 */
footer {
  text-align: center;        /* 居中对齐 */
  padding: 20px;             /* 内边距 */
  background-color: rgba(255, 255, 255, 0.7); /* 半透明背景色 */
  margin-top: 20px;          /* 上方外边距 */
  font-size: 0.8em;          /* 页脚字体大小设置为body的0.8倍 */
}

/* 二维码容器样式 */
#qrCodeContainer {
  display: none;             /* 默认不显示 */
  position: absolute;        /* 绝对定位 */
  top: -100%;                /* 距离顶部-100%，即在链接上方 */
  left: 50%;                 /* 距离左边50% */
  transform: translateX(-50%); /* 水平居中 */
  background-color: white;   /* 背景颜色 */
  border: 1px solid #ccc;    /* 边框 */
  padding: 10px;             /* 内边距 */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); /* 阴影效果 */
  z-index: 1;                /* 层叠顺序 */
}

/* 二维码容器显示条件 */
.qrLinkContainer {
  position: relative; /* 使二维码容器相对于此元素定位 */
}

.qrLinkContainer span:focus + #qrCodeContainer,
.qrLinkContainer span:hover + #qrCodeContainer {
  display: block;            /* 显示容器 */
}

/* 二维码链接容器内的span标签样式 */
span {
  text-decoration: none;     /* 移除下划线 */
  color: blue;               /* 文字颜色 */
  cursor: pointer;           /* 鼠标指针变为手形 */
  outline: none;             /* 无轮廓 */
  font-size: 1em;            /* 设置字体大小 */
}

/* 二维码容器在body激活时隐藏 */
body:active #qrCodeContainer {
  display: none;             /* 不显示 */
}