/* 标题样式 */
.title {
  font-size: 100px;
  font-weight: bold;
  color: #ffffff;
  margin-top: 5px;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
  /* 添加阴影效果 */
  z-index: 1;
  position: relative;
  text-align: center;
}

/* 全局样式 */
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: Arial, sans-serif;
  overflow: hidden;
}

#particles-js {
  position: absolute;
  width: 100%;
  height: 100%;
  background-color: #181828;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: #f0f0f0;
}

/* 工具容器样式 */
.tool-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 20px;
  width: 80%;
  max-width: 1200px;
  z-index: 1;
  /* 让工具项层级高于粒子背景 */
}

/* 工具项样式 */
.tool-item {
  position: relative;
  width: 100%;
  height: 150px;
  background-color: #1d326d8e;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

/* 悬停效果 */
.tool-item:hover {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  transform: scale(1.05);
  /* 悬停时放大效果 */
}

/* 点击效果 */
.tool-item:active {
  transform: scale(0.95);
  /* 点击时缩小效果 */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* 工具图标样式 */
.tool-icon {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s;
}

.tool-item:hover .tool-icon {
  opacity: 0.8;
}

/* 工具名称样式 */
.tool-name {
  position: absolute;
  bottom: 10px;
  left: 10px;
  right: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 16px;
  color: #ffffff;
  background-color: rgba(0, 0, 0, 0.6);
  /* 背景透明度 */
  padding: 5px;
  border-radius: 5px;
  text-align: center;
}

/* 鼠标点击的动画效果 */
@keyframes click-feedback {
  0% {
    transform: scale(1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  }

  50% {
    transform: scale(0.95);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  }
}

.tool-item:active {
  animation: click-feedback 0.2s ease;
}

/* 媒体查询，针对小屏幕设备的样式调整 */
@media (max-width: 768px) {
  .title {
    font-size: 60px; /* 缩小标题字体大小 */
  }

  .tool-container {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); /* 调整游戏项的最小宽度 */
  }

  .tool-item {
    height: 120px; /* 缩小游戏项的高度 */
  }

  .tool-name {
    font-size: 14px; /* 调整工具名称字体大小 */
  }
}

@media (max-width: 480px) {
  .title {
    font-size: 40px; /* 更小的设备上进一步缩小标题 */
  }

  .tool-item {
    height: 100px; /* 更小设备上的游戏项高度 */
  }

  .tool-name {
    font-size: 12px; /* 更小设备上的游戏名称字体大小 */
  }
}
