/* ================================================================
   菜刀客在线工具页 · index.html 首页私有样式
   需在 /css/common.css 之后加载。
   ================================================================ */

.container {
    max-width: 1400px;
}

.footer {
    max-width: 1400px;
}

/* ---- 分类快速跳转 ---- */
.cat-anchors {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 15px 0;
}

.cat-anchors a {
    padding: 6px 12px;
    font-size: 13px;
    color: #374151;
    text-decoration: none;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    transition: all 0.2s;
}

.cat-anchors a:hover {
    color: #667eea;
    border-color: #667eea;
    background: #eef2ff;
}

/* ---- 工具搜索 ---- */
.tool-search .search-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
}

.tool-search .search-icon {
    font-size: 16px;
    color: #9ca3af;
}

.tool-search input {
    flex: 1;
}

/* ---- 分类网格 ---- */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 15px;
}

.cat-panel {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    overflow: hidden;
    scroll-margin-top: 68px;
}

.cat-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.cat-title {
    font-size: 15px;
    font-weight: 600;
    color: #374151;
}

.cat-title a {
    color: inherit;
    text-decoration: none;
}

.cat-count {
    font-size: 12px;
    color: #9ca3af;
}

.tool-list {
    padding: 6px 8px 10px;
}

.tool-item {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 7px 8px;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.15s;
}

.tool-item:hover {
    background: #eef2ff;
}

.tool-item:hover .t-name {
    color: #667eea;
}

.t-name {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    flex-shrink: 0;
    min-width: 122px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.t-desc {
    font-size: 12px;
    color: #9ca3af;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---- 过滤隐藏 ---- */
.tool-item.hide,
.cat-panel.hide {
    display: none;
}

/* ---- 小屏适配 ---- */
@media (max-width: 900px) {
    .cat-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 720px) {
    .cat-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .tool-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .t-name {
        min-width: 0;
        max-width: 100%;
    }
}