@font-face {
  font-family: 'HarmonyOS_Sans_Medium';
  src: url('/fonts/HarmonyOS_Sans_Medium.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap; /* 添加字体加载策略 */
}

/* 设置页面背景颜色、字体和默认样式 */
html {
  scroll-behavior: smooth; /* 添加平滑滚动效果 */
}

body {
  background-color: #FEF6E8;
  font-family: 'HarmonyOS_Sans_Medium', system-ui, -apple-system, BlinkMacSystemFont, sans-serif; /* 添加后备字体 */
  margin: 0;
  padding: 0;
  line-height: 1.6;
  color: #333;
}

/* 设置页面顶部横幅样式 */
.banner {
  text-align: center;
  width: 100%;
  overflow: hidden;
  margin-bottom: 2rem;
  margin-top: 60px; /* 增加上边距，与导航栏保持更好的间隔 */
  padding: 20px 0;
  background-color: #fef6e8;
}

/* 设置横幅中的图片样式 */
.banner img {
  display: block;
  margin: 0 auto;
  max-width: 1200px; /* 限制最大宽度 */
  width: 100%; 
  height: auto; /* 高度自适应，保持原比例 */
  object-fit: contain; /* 确保图像完整显示 */
  box-shadow: 0 4px 8px rgba(0,0,0,0.1); /* 添加轻微阴影 */
  border-radius: 8px; /* 圆角边框 */
  animation: fadeIn 0.8s ease-out forwards; /* 添加淡入动画 */
}

/* 图片淡入动画 */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 隐藏Banner内容区域 */
.banner-content {
  display: none;
}

/* 设置页面头部样式 */
.header {
  padding: 40px 20px;
  text-align: center;
  background: linear-gradient(135deg, #1abc9c 0%, #16a085 100%); /* 添加渐变背景 */
  color: white;
  border-radius: 8px;
  margin: 20px auto;
  max-width: 1200px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* 设置section标题样式 */
.section-title {
  font-size: 1.8rem;
  color: #333;
  margin-bottom: 1rem;
  text-align: center;
}

/* 设置分类项样式 */
.category-item {
  text-align: center;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 15px;
  box-sizing: border-box;
  background-color: white;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  line-height: 1.5;
  white-space: nowrap;
  max-width: 100%;
}

/* 设置分类项悬停效果 */
.category-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
  border-color: #FA8B31;
}

/* 设置分类项中的段落样式 */
.category-item p {
  margin: 0;
  font-size: 16px;
  color: #333;
  font-weight: 500;
}

/* 设置考试类型区域样式 */
.exam-type {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* 设置考试分类标题容器样式 */
.exam-category-title-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 30px;
}

/* 设置考试分类标题样式 */
.exam-category-title {
  display: block;
  max-width: 400px;
  height: auto;
  margin-top: 10px;
}

/* 设置分类网格样式 */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px;
  justify-content: center;
}

/* 设置分类项中的图片样式 */
.category-item img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  margin-bottom: 8px;
}

/* 设置页脚样式 */
.footer {
  background: linear-gradient(180deg, #333 0%, #222 100%);
  color: white;
  text-align: center;
  padding: 30px 0;
  margin-top: 20px;
}

/* 设置页脚中的段落样式 */
.footer p {
  margin: 8px 0;
  font-size: 14px;
  line-height: 1.5;
}

/* 设置页脚中的链接样式 */
.footer a {
  color: #ddd;
  text-decoration: none;
  transition: color 0.3s;
}

/* 设置页脚中的链接悬停效果 */
.footer a:hover {
  color: #fff;
  text-decoration: underline;
}

/* 重置分类项中的链接样式 */
.category-item a {
  color: #333;
  text-decoration: none;
  display: block;
  font-size: 16px;
  font-weight: 500;
  transition: color 0.3s;
}

/* 设置分类项中的链接悬停效果 */
.category-item a:hover {
  color: #FA8B31;
}

/* 教师团队、学生作品和联系我们部分的通用样式 */
.teachers-section,
.works-section,
.contact-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* 视觉隐藏元素但保持屏幕阅读器可访问 */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* 移动菜单按钮样式 */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 21px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
}

.mobile-menu-btn span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: #333;
  border-radius: 3px;
  transition: all 0.3s ease;
}

/* 移动菜单按钮激活状态样式 */
.mobile-menu-btn.active span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.mobile-menu-btn.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* 关闭菜单按钮样式 */
.close-menu-btn {
  display: none; /* 默认隐藏，只在移动端显示 */
  position: absolute;
  top: 20px;
  right: 20px;
  background: transparent;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #333;
  z-index: 1010;
}

.close-menu-btn span {
  display: block;
}

/* 响应式布局：当屏幕宽度小于等于768px时应用以下样式 */
@media (max-width: 768px) {
  /* 调整导航栏布局和样式 */
  .navbar {
    flex-direction: row; /* 保持行方向以便logo和菜单按钮并排 */
    justify-content: space-between; /* 改为两端对齐，logo靠左，菜单按钮靠右 */
    align-items: center;
    height: 60px;
    padding: 0 15px; /* 减少左右内边距，让内容更靠近屏幕边缘 */
    position: fixed;
    width: calc(100% - 30px); /* 考虑更新后的padding */
  }

  .mobile-menu-btn {
    display: flex; /* 在移动端显示菜单按钮 */
    position: relative; /* 改为相对定位，依赖父容器的space-between布局 */
    right: 0; /* 不需要绝对定位的右偏移 */
    top: 0; /* 不需要绝对定位的顶部偏移 */
    transform: none; /* 不需要变换 */
    z-index: 1003; /* 确保按钮在最上层，可以被点击 */
    margin-left: auto; /* 确保它在flex容器中靠右 */
  }

  .nav-links {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
    background-color: #fff;
    z-index: 1005;
    padding: 60px 20px 20px 20px;
    text-align: left;
    transform: translateX(100%); /* 初始状态在屏幕右侧 */
    transition: transform 0.3s ease;
    overflow-y: auto;
  }

  .logo-container {
    display: flex;
    align-items: center;
    margin: 0;
    position: static; /* 恢复正常文档流定位 */
    max-width: 50%; /* 限制宽度，防止占用太多空间 */
    z-index: 1000;
    background-color: transparent !important; /* 强制背景透明 */
    justify-content: flex-start; /* 确保logo靠左对齐 */
  }

  .logo {
    height: 30px; /* 稍微缩小移动端下的LOGO */
  }

  .close-menu-btn {
    display: block; /* 在移动端显示关闭按钮 */
  }

  .nav-links.active {
    transform: translateX(0); /* 激活时滑入 */
  }

  /* 调整导航栏链接样式 */
  .navbar a {
    width: 100%;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 18px;
    text-align: left;
  }

  /* 调整banner的上边距和样式 */
  .banner {
    margin-top: 70px; /* 调整上边距，适应移动设备上的导航栏 */
    padding: 15px 0;
  }

  .banner img {
    width: 95%; /* 在移动端增加宽度占比 */
    max-width: 100%; /* 确保不超出容器 */
  }

  /* 调整考试类型区域样式 */
  .exam-type {
    padding: 20px 10px;
  }

  /* 调整分类网格样式 */
  .category-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
  }

  .category-item {
    padding: 10px;
  }

  .category-item a,
  .category-item p {
    font-size: 14px;
  }

  /* 调整页脚样式 */
  .footer {
    padding: 20px 0;
    margin-top: 30px;
  }

  /* 调整页脚中段落的字体大小 */
  .footer p {
    font-size: 12px;
  }
}

/* 响应式布局：适应极小屏幕设备 */
@media (max-width: 480px) {
  .navbar {
    padding: 8px 15px;
    width: calc(100% - 30px); /* 考虑新的padding */
  }
  
  .logo {
    height: 25px; /* 进一步缩小LOGO */
  }
  
  .mobile-menu-btn {
    right: 15px;
    top: 12px;
  }
  
  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .header h1 {
    font-size: 1.5rem;
  }
  
  .header p {
    font-size: 1rem;
  }

  /* 调整banner样式 */
  .banner {
    margin-top: 60px;
    padding: 10px 0;
  }

  .banner img {
    width: 100%;
    border-radius: 4px; /* 减小圆角 */
  }
}

/* 导航栏当前页面活跃状态 */
.navbar a.active {
  color: black;
  font-weight: 700;
  border-bottom: 2px solid #FA8B31;
}

/* 设置导航栏样式 */
.navbar {
  background-color: #fff;
  overflow: hidden;
  display: flex;
  justify-content: center; /* 修改为居中对齐 */
  align-items: center;
  height: 60px;
  padding: 0 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: fixed; /* 改为fixed定位，确保始终显示在顶部 */
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  width: 100%;
  transition: background-color 0.3s ease, backdrop-filter 0.3s ease; /* 添加过渡效果 */
}

/* 磨砂玻璃效果导航栏 */
.navbar.scrolled {
  background-color: rgba(255, 255, 255, 0.8); /* 半透明白色背景 */
  backdrop-filter: blur(10px); /* 磨砂玻璃效果 */
  -webkit-backdrop-filter: blur(10px); /* Safari兼容 */
}

/* 导航链接容器 */
.nav-links {
  display: flex;
  align-items: center;
}

/* 设置导航栏链接样式 */
.navbar a {
  text-align: center;
  display: block;
  color: black;
  padding: 14px 16px;
  text-decoration: none;
  transition: background-color 0.3s, color 0.3s; /* 添加过渡效果 */
  font-weight: 500; /* 添加字体粗细 */
}

/* 设置导航栏链接悬停效果 */
.navbar a:hover {
  background-color: #f5f5f5;
  color: #FA8B31; /* 使用网站主题色 */
}

/* Logo容器 */
.logo-container {
  display: flex;
  align-items: center;
  margin: 0;
  position: static; /* 恢复正常文档流定位 */
  max-width: 50%; /* 限制宽度，防止占用太多空间 */
  z-index: 1000;
  background-color: transparent !important; /* 强制背景透明 */
  justify-content: flex-start; /* 确保logo靠左对齐 */
}

/* 确保logo-container在移动端下的样式一致 */
@media (max-width: 768px) {
  .logo-container {
    background-color: transparent !important; /* 强制背景透明 */
  }
}

/* 设置logo样式 */
.logo {
  height: 40px;
  width: auto;
  vertical-align: middle;
}