/* === 全局基础设置（带渐变背景） === */
body {
  margin: 0;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background: linear-gradient(to bottom right, #e0f2ff, #f4f6fa);
  color: #111;
  line-height: 1.6;
  background-attachment: fixed;
}

/* 容器限制宽度与居中 */
.container {
  max-width: 1200px;
  margin: auto;
  padding: 40px 20px;
}

/* 搜索框 */
.search-box {
  width: 100%;
  max-width: 480px;
  margin: 0 auto 40px auto;
  display: flex;
  justify-content: center;
}

.search-box input {
  width: 100%;
  padding: 14px 18px;
  font-size: 1rem;
  border-radius: 12px;
  border: 1px solid #d0d5dd;
  box-shadow: 0 3px 6px rgba(0,0,0,0.04);
  transition: border-color 0.3s;
}

.search-box input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* 分类标题 */
.category-title {
  font-size: 1.5rem;
  margin-top: 2.5rem;
  margin-bottom: 1.2rem;
  font-weight: 600;
  color: #333;
  border-left: 5px solid #6366f1;
  padding-left: 12px;
}

/* 筛选器 */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 30px;
}

.filter-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  background-color: #e0e7ff;
  color: #333;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
  background-color: #6366f1;
  color: white;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* 工具卡片网格 */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 28px;
}

.tool-card {
  position: relative;  /* 必须相对定位，方便绝对定位收藏按钮 */
  background: linear-gradient(180deg, #ffffff 0%, #f9f9fb 100%);
  border-radius: 20px;
  padding: 24px 48px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  cursor: pointer;

  display: flex;
  justify-content: center;
  align-items: center;

  opacity: 0.85;
  transform: translateY(10px);
  transition: opacity 0.35s ease, transform 0.35s ease, box-shadow 0.35s ease;
}

.tool-card:hover {
  opacity: 1;
  transform: translateY(0);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

/* 收藏按钮样式 */
.favorite-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: none;
  font-size: 22px;
  color: #ccc;            /* 默认灰色 */
  cursor: pointer;
  transition: color 0.3s ease;
  user-select: none;
  z-index: 10;
  outline: none;
}

.favorite-btn:hover {
  color: #ff6b6b;         /* 鼠标悬停变浅红 */
}

.favorite-btn.active {
  color: #e02424;         /* 点击后变红 */
}

/* 保持链接内部元素居中排列 */
.tool-card a {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: inherit;
  text-decoration: none;
}


/* 图标美化 */
.tool-card a img {
  width: 52px;
  height: 52px;
  margin-bottom: 14px;
  border-radius: 10px;
  display: block;
}

/* 名称 */
.tool-card a h3 {
  font-size: 1.2rem;
  margin: 0.5rem 0 0.3rem 0;
  font-weight: 600;
  color: #111;
}

/* 描述文本 */
.tool-card a {
  font-size: 0.92rem;
  color: #555;
  max-width: 90%;
  line-height: 1.4;
}
.category-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-bottom: 40px;
}

.category-nav a {
  padding: 10px 16px;
  border-radius: 8px;
  background-color: #f0f4ff;
  color: #333;
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.3s;
}

.category-nav a:hover {
  background-color: #6366f1;
  color: white;
}

/* 返回顶部按钮 - 简洁悬浮样式 */
#back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  background-color: rgba(99, 102, 241, 0.85);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 24px;
  line-height: 44px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.6);
  display: none;
  z-index: 1000;
  transition: background-color 0.3s ease, opacity 0.3s ease;
}

#back-to-top:hover {
  background-color: rgba(99, 102, 241, 1);
  opacity: 0.9;
}
