/* 自定义工具类 */
@layer utilities {
  .content-auto {
    content-visibility: auto;
  }
  .text-shadow {
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
  }
  .card-hover {
    transition: all 0.3s ease;
  }
  .card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  }
  .square-image {
    aspect-ratio: 1 / 1;
    object-fit: cover;
  }
  .gradient-bg {
    background: linear-gradient(135deg, rgba(15, 82, 186, 0.05) 0%, rgba(55, 202, 236, 0.05) 100%);
  }
  .icon-circle {
    position: relative;
    z-index: 1;
  }
  .icon-circle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    background-color: currentColor;
    opacity: 0.1;
    border-radius: 50%;
    z-index: -1;
  }
}

/* 基础动画效果 */
.fade-in {
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 滚动动画 */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* 平滑滚动 */
html {
  scroll-behavior: smooth;
}

/* 轮播图动画 */
.carousel-item {
  transition: transform 0.5s ease-in-out; /* 确保这里的时间是0.5s */
}

/* 基础样式补充 */
.qrcode-container {
  position: relative; /* 作为弹窗的定位参考 */
  display: inline-block; /* 确保容器大小适应内容 */
}

/* 二维码弹窗默认状态 */
.qrcode-popup {
  opacity: 0; /* 透明 */
  visibility: hidden; /* 隐藏（不占空间） */
  transition: all 0.3s ease; /* 过渡动画 */
  z-index: 10; /* 确保弹窗在其他内容上方 */
}

/* 鼠标悬停时显示弹窗 */
.qrcode-container:hover .qrcode-popup {
  opacity: 1; /* 不透明 */
  visibility: visible; /* 显示 */
}

/* 确保二维码容器保持正方形 */
.qrcode-popup .aspect-square {
  position: relative;
  width: 120px; /* 宽度自适应 */
}

/* 防止图片变形 */
.qrcode-popup img {
  object-fit: contain; /* 保持图片比例，完整显示 */
}

/* 微信二维码样式 */
.wechat-qrcode {
  width: 200px; /* 宽度根据需要调整 */
  height: auto; /* 高度自动适应，保持比例 */
  object-fit: contain; /* 防止图片被拉伸 */
}

/* 导航菜单底部横条效果 - 扩展到整个导航栏高度 */
.nav-item {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}

.nav-link {
  position: relative;
  padding: 0 1rem;
  height: 100%;
  display: flex;
  align-items: center;
  transition: color 0.3s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 3px;
  background-color: #0F52BA; /* 主色调横条 */
  transition: width 0.3s ease;
}

.nav-item:hover .nav-link::after {
  width: 100%;
}

/* 下拉菜单样式 */
.dropdown-parent {
  position: relative;
  height: 100%;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 180px;
  background-color: white;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  border-radius: 0 0 4px 4px;
  padding: 0.5rem 0;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}

.dropdown-parent:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-parent:hover .nav-link {
  color: #0F52BA; /* 主色调 */
}

.dropdown-menu a {
  display: block;
  padding: 0.75rem 1.5rem;
  color: #333;
  transition: background-color 0.2s ease;
}

.dropdown-menu a:hover {
  background-color: rgba(15, 82, 186, 0.1); /* 主色浅背景 */
  color: #0F52BA;
}

/* 新闻列表样式 */
.news-item {
  border: 1px solid #f0f0f0;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.news-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.news-date {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background-color: rgba(15, 82, 186, 0.1);
  color: #0F52BA;
  border-radius: 4px;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

/* 分页样式 */
.pagination {
  display: flex;
  justify-content: center;
  margin-top: 3rem;
}

.pagination a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0 4px;
  border-radius: 4px;
  color: #6B7280;
  transition: all 0.3s ease;
}

.pagination a:hover {
  background-color: rgba(15, 82, 186, 0.1);
  color: #0F52BA;
}

.pagination a.active {
  background-color: #0F52BA;
  color: white;
}