/* 基础样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Noto Sans SC', sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 导航栏核心样式 - 整体背景为页脚同款浅蓝色 */
.nav {
  background-color: #e6f0ff; /* 与页脚一致的浅蓝色 */
  margin-bottom: 20px;
  position: relative;
  padding: 10px 0;
}

/* 桌面端导航 */
.desktop-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  flex-wrap: wrap;
}

.nav-logo {
  height: 45px;
  width: auto;
  margin-right: 15px;
}

.logo {
  font-size: 1.4rem;
  color: #333;
  margin: 0;
  flex: 1;
  min-width: 200px;
}

/* 桌面端导航列表 */
.desktop-nav .nav-list {
  list-style: none;
  display: flex;
  gap: 15px;
}

.desktop-nav .nav-list a {
  text-decoration: none;
  color: #333;
  font-weight: 500;
  padding: 8px 18px;
  border-radius: 20px;
  background-color: white;
  transition: all 0.3s ease;
}

/* 桌面端交互效果 */
.desktop-nav .nav-list a:hover {
  background-color: #dcfce7;
  color: #000000;
  transform: translateY(-2px);
}

.desktop-nav .nav-list a.active {
  background-color: #ce8cdb;
  color: #ffffff;
}

.desktop-nav .nav-list a:active {
  background-color: #fef3c7;
  color: #9f72da;
}

/* 移动端导航容器 */
.mobile-nav {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

.mobile-nav .nav-logo {
  height: 40px;
}

.mobile-nav .logo {
  font-size: 1.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-list {
  list-style: none !important;
  margin: 0;
  padding: 0;
}

.menu-toggle {
  background: white;
  border: none;
  color: #333;
  font-size: 1.5rem;
  cursor: pointer;
  /* 关键：宽高相等+50%圆角实现圆形 */
  width: 40px;
  height: 40px;
  border-radius: 50%; /* 圆形核心属性 */
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  display: flex; /* 图标水平居中 */
  align-items: center; /* 图标垂直居中 */
  justify-content: center; /* 图标水平居中 */
  padding: 0; /* 清除默认内边距，避免变形 */
  transition: transform 0.2s; /* 点击反馈动画 */
}

/* 移动端导航列表容器 */
.mobile-nav-list {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  margin: 10px;
  padding: 10px;
  border-radius: 15px;
  background-color: #e6f0ff;
}

.mobile-nav-list.expanded {
  max-height: 400px;
}

/* 移动端三行布局 - 强制指定行数 */
@media (max-width: 768px) {
  .mobile-nav-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto; /* 明确三行 */
    gap: 10px;
  }
  
  /* 第一行：首页（独占一行） */
  .mobile-nav-list li:nth-child(1) {
    grid-column: 1 / 3;
    grid-row: 1;
  }
  
  /* 第二行：历史文化 + 文件公告 */
  .mobile-nav-list li:nth-child(2) {
    grid-column: 1;
    grid-row: 2;
  }
  
  .mobile-nav-list li:nth-child(3) {
    grid-column: 2;
    grid-row: 2;
  }
  
  /* 第三行：活动风采 + 部门信息 */
  .mobile-nav-list li:nth-child(4) {
    grid-column: 1;
    grid-row: 3;
  }
  
  .mobile-nav-list li:nth-child(5) {
    grid-column: 2;
    grid-row: 3;
  }
}

.mobile-nav-list a {
  display: block;
  text-decoration: none;
  color: #333;
  font-weight: 500;
  padding: 10px 15px;
  border-radius: 20px;
  background-color: white;
  text-align: center;
  transition: all 0.3s ease;
}

/* 移动端交互效果 */
.mobile-nav-list a:hover {
  background-color: #dcfce7;
  color: #166534;
}

.mobile-nav-list a.active {
  background-color: #fee2e2;
  color: #991b1b;
}

.mobile-nav-list a:active {
  background-color: #fef3c7;
  color: #92400e;
}

/* 页脚样式 */
.footer {
  background-color: #e6f0ff;
  padding: 40px 0 20px;
  margin-top: auto;
  color: #333;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 30px;
  flex-wrap: wrap;
}

.footer-left, .footer-right {
  flex: 1;
  min-width: 300px;
}

.footer-left {
  margin-right: 30px;
  margin-bottom: 30px;
}

.contact-info p {
  margin-bottom: 10px;
  line-height: 1.6;
}

.social-section {
  margin-bottom: 30px;
}

.social-title, .friend-link-title {
  font-size: 1.2rem;
  color: #1a56db;
  margin-bottom: 15px;
  font-weight: 600;
  text-align: center;
}

.social-buttons {
  display: flex;
  gap: 20px;
  margin-top: 10px;
  width: 100%;
  justify-content: center;
}

.social-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  color: white;
  text-decoration: none;
  font-size: 1.2rem;
  transition: all 0.3s ease 0.1s;
  overflow: hidden;
  flex-shrink: 0;
}

.social-button i {
  margin-right: 0;
  transition: margin-right 0.3s ease;
}

.social-text {
  opacity: 0;
  width: 0;
  white-space: nowrap;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  font-weight: 500;
}

.social-button.qq {
  background-color: #12B7F5;
}

.social-button.douyin {
  background-color: #333333;
}

.social-button.bilibili {
  background-color: #FB7299;
}

.social-button:hover {
  width: auto;
  padding: 0 20px;
  border-radius: 25px;
  transition: all 0.3s ease;
}

.social-button:hover i {
  margin-right: 8px;
  transition: margin-right 0.3s ease;
}

.social-button:hover .social-text {
  opacity: 1;
  width: auto;
  margin-left: 4px;
  transition: all 0.3s ease 0.1s;
}

.friend-link-images {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  justify-content: center;
}

.friend-link-item {
  display: inline-block;
}

.friend-link-img {
  height: 50px;
  width: auto;
  border: 1px solid #ddd;
  padding: 5px;
  background-color: white;
  transition: transform 0.3s ease;
}

.friend-link-img:hover {
  transform: scale(1.05);
}

/* 返回顶部按钮 */
#backToTop {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 45px;
  height: 45px;
  background-color: #1a56db;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
}

#backToTop.show {
  opacity: 1;
  visibility: visible;
}

#backToTop:hover {
  background-color: #0d2e86;
  transform: translateY(-3px);
}

/* 响应式设置 */
@media (max-width: 768px) {
  .desktop-nav {
    display: none;
  }
  
  .mobile-nav {
    display: flex;
  }
  
  .footer-content {
    flex-direction: column;
  }
  
  .footer-left {
    margin-right: 0;
    text-align: center;
  }
}

@media (min-width: 769px) {
  .mobile-nav,
  .mobile-nav-list {
    display: none;
  }
}

/* 页面内容样式 */
.container {
  padding: 0 20px;
  flex: 1;
}
