/* 基础样式 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0px;
    background-color: #f4f7f6;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 90vh;
    /* max-height: 90vh; */
}

/* 头部样式 */
header {
    background-color: #2c3e50;
    color: #fff;
    padding: 20px 0;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    width: 100%;
    height: 80px;
}

header h1 {
    margin: 0;
    font-size: 2.0em;
    letter-spacing: 1px;
}

header p {
    margin-top: 5px;
    font-size: 1.0em;
    opacity: 0.9;
}

/* 主内容区域 */
main {
    flex-grow: 1;
    padding: 20px 20px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    text-align: center;
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(275px, 1fr));
    gap: 30px;
    justify-content: center;
    align-items: stretch;
    margin-top: 30px;
    padding: 0 20px;
}

/* 工具卡片样式 */
.tool-card {
    position: relative;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-left: auto;
    margin-right: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

.tool-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.tool-card .icon {
    font-size: 4em;
    /* 使用更大的图标，如果用图片请调整 */
    margin-bottom: 20px;
    color: #3498db;
    /* 图标颜色 */
}

/* 字体图标占位符，如果不用Font Awesome可以替换为图片或移除 */
.icon-placeholder {
    display: inline-block;
    width: 70px;
    height: 70px;
    background-color: #ecf0f1;
    border-radius: 50%;
    margin-bottom: 20px;
    line-height: 70px;
    /* 垂直居中 */
    font-size: 3em;
    /* 调整大小使占位符看起来像图标 */
    color: #7f8c8d;
    font-weight: bold;
    text-align: center;
}

.tool-card h2 {
    font-size: 1.8em;
    margin-top: 0;
    margin-bottom: 10px;
    color: #34495e;
}

.tool-card p {
    font-size: 1.1em;
    color: #666;
    line-height: 1.6;
    margin-bottom: 25px;
}

.tool-card a {
    display: inline-block;
    background-color: #3498db;
    color: #fff;
    padding: 12px 25px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1em;
    transition: background-color 0.3s ease;
    border: none;
    cursor: pointer;
}

.tool-card a:hover {
    background-color: #2980b9;
}

/* 页脚样式 */
footer {
    background-color: #34495e;
    color: #ecf0f1;
    text-align: center;
    padding: 20px 0;
    font-size: 0.9em;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.05);
    margin-top: auto;
    margin-bottom: 0px;
    /* 将页脚推到底部 */

}

/* 响应式设计 */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.5em;
    }

    .tool-grid {
        grid-template-columns: 1fr;
        /* 单列布局 */
    }

    .tool-card {
        padding: 20px 12px;
    }

    .tool-card .icon {
        font-size: 3.0em;
    }

    .tool-card h2 {
        font-size: 1.2em;
    }

    .tool-card p {
        font-size: 1em;
    }
}

/* 收藏按钮样式 */
.favorite-btn {
  position: absolute; /* 绝对定位，相对于父元素 tool-card */
  top: 10px;          /* 距离顶部 10px */
  right: 10px;        /* 距离右侧 10px */
  background: none;   /* 无背景 */
  border: none;       /* 无边框 */
  color: #ccc;        /* 默认图标颜色（浅灰色） */
  font-size: 1.4em;   /* 图标大小 */
  cursor: pointer;    /* 鼠标悬停时显示手型 */
  padding: 5px;       /* 增加点击区域 */
  transition: color 0.3s ease, transform 0.2s ease; /* 颜色和形变过渡效果 */
  z-index: 10;        /* 确保按钮在其他内容之上 */
  line-height: 1; /* 确保图标垂直居中，避免额外空间 */
}

.favorite-btn:hover {
  color: #ffcc00;     /* 鼠标悬停时变为黄色 */
  transform: scale(1.1); /* 鼠标悬停时稍微放大 */
}

/* （可选）如果您想在页面加载时就显示已收藏的状态，可以添加一个 .favorited 类 */
.favorite-btn.favorited {
    color: #ffcc00;
}