/* 頁面標題 */
.page-header {
    text-align: center;
    padding: 40px 20px;
    background-color: #fff;
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 2.2rem;
    color: #222;
    margin-bottom: 10px;
}

.page-header p {
    font-size: 1.1rem;
    color: #666;
}

/* 搜尋區域 */
.search-section {
    max-width: 1200px;
    margin: 0 auto 20px;
    padding: 0 20px;
}

.search-section form {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

.search-section input[type="text"] {
    width: 100%;
    max-width: 400px;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

.search-section input[type="text"]:focus {
    border-color: #4a90e2;
}

.search-section button {
    padding: 10px 20px;
    background-color: #4a90e2;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background-color 0.3s, transform 0.2s;
}

.search-section button:hover {
    background-color: #357abd;
    transform: translateY(-2px);
}

/* 分類篩選區域 */
.filter-section {
    max-width: 1200px;
    margin: 0 auto 30px;
    padding: 0 20px;
    text-align: center;
}

.category-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.category-tag {
    background-color: #e6f3ff;
    color: #4a90e2;
    padding: 8px 15px;
    border-radius: 15px;
    font-size: 0.9rem;
    text-decoration: none;
    transition: background-color 0.3s, color 0.3s, transform 0.2s;
}

.category-tag:hover {
    background-color: #4a90e2;
    color: #fff;
    transform: translateY(-2px);
}

.category-tag.active {
    background-color: #4a90e2;
    color: #fff;
    font-weight: bold;
}

/* 工具列表區域 */
.tools-list-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 工具網格 */
.tool-grid {
    display: grid;
    gap: 20px;
}

/* 工具卡片 */
.tool-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.tool-logo {
    max-width: 50px;
    height: auto;
    margin: 0;
}

.tool-card h3 {
    font-size: 1.1rem;
    margin: 0;
    color: #333;
}

.tool-card h3 a {
    color: #333;
    text-decoration: none;
}

.tool-card h3 a:hover {
    color: #4a90e2;
}

.tool-description {
    font-size: 0.85rem;
    color: #666;
    margin: 5px 0 0;
    display: none; /* 移動端隱藏描述，模仿圖片風格 */
}

.tool-categories {
    display: none; /* 移動端隱藏分類 */
}

.detail-btn {
    display: none; /* 移動端隱藏詳細按鈕 */
}

/* 響應式設計 */
@media (max-width: 768px) {
    .page-header h1 {
        font-size: 1.8rem;
    }

    .page-header p {
        font-size: 1rem;
    }

    .search-section form {
        flex-direction: column;
        align-items: stretch;
    }

    .search-section input[type="text"] {
        max-width: 100%;
    }

    .search-section button {
        width: 100%;
        justify-content: center;
    }

    .category-tags {
        gap: 8px;
    }

    .category-tag {
        font-size: 0.85rem;
        padding: 6px 12px;
    }

    .tool-grid {
        grid-template-columns: repeat(2, 1fr); /* 移動端每列 2 個 */
        gap: 15px;
    }

    .tool-card {
        flex-direction: column;
        padding: 10px;
    }

    .tool-logo {
        max-width: 40px;
    }

    .tool-card h3 {
        font-size: 1rem;
    }
}

@media (min-width: 769px) {
    .tool-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }

    .tool-card {
        flex-direction: column;
    }

    .tool-description {
        display: block; /* 桌面端顯示描述 */
    }

    .tool-categories {
        display: block; /* 桌面端顯示分類 */
    }

    .detail-btn {
        display: inline-block; /* 桌面端顯示詳細按鈕 */
        background-color: #4a90e2;
        color: #fff;
        padding: 8px 15px;
        border-radius: 5px;
        text-decoration: none;
    }

    .detail-btn:hover {
        background-color: #357abd;
    }
}