/*
 * 工具列表样式
 * 版本: 2.0.0
 */

/* 页面头部 */
.page-header {
    text-align: center;
    margin: 40px 0 30px;
}

.page-header h1 {
    font-size: 2.2em;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.page-description {
    font-size: 1.1em;
    color: var(--light-text);
    max-width: 800px;
    margin: 0 auto;
}

/* 工具搜索 */
.tools-search {
    margin: 30px 0;
    display: flex;
    justify-content: center;
}

.search-container {
    display: flex;
    width: 100%;
    max-width: 600px;
    position: relative;
    border: 1px solid var(--border-color);
    border-radius: 50px;
    background-color: var(--white-bg);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.search-container input {
    flex-grow: 1;
    padding: 12px 20px;
    border: none;
    font-size: 1em;
    background-color: transparent;
    color: var(--dark-text);
    transition: all 0.3s ease;
}

.search-container input:focus {
    outline: none;
}

.search-container button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    width: 50px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-container button:hover {
    background-color: var(--primary-hover);
}

.search-container button i {
    font-size: 1.2em;
}

/* 分类导航 */
.category-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
    justify-content: flex-start;
    padding: 10px;
    border-radius: var(--border-radius);
    background-color: var(--light-bg);
    border: 1px solid var(--border-color);
    position: static;
}

.category-item {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    background-color: var(--white-bg);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9em;
    text-decoration: none;
    color: var(--light-text);
}

.category-item i {
    margin-right: 8px;
    font-size: 1.1em;
    color: var(--secondary-color);
    transition: color 0.3s ease;
}

.category-item span {
    font-size: 0.95em;
    color: var(--light-text);
    transition: color 0.3s ease;
}

.category-item:hover {
    background-color: var(--primary-color-light);
    border-color: var(--primary-color);
}

.category-item:hover i,
.category-item:hover span {
    color: var(--primary-color);
}

.category-item.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.category-item.active i,
.category-item.active span {
    color: white;
}

/* 分类组 */
.category-group {
    margin-bottom: 30px;
    scroll-margin-top: 20px;
}

.category-group-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.category-group-header i {
    font-size: 1.5em;
    color: var(--primary-color);
    margin-right: 10px;
}

.category-group-header h2 {
    font-size: 1.4em;
    color: var(--dark-text);
    margin: 0;
}

.category-group-tools {
    list-style: none;
    padding: 0;
    margin: 0;
    background-color: transparent;
    border-radius: 0;
    border: none;
    overflow: visible;
}

/* 工具项 */
.tool-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color-light);
    transition: all 0.2s ease;
}

.tool-item:last-child {
    border-bottom: none;
}

.tool-item:hover {
    background-color: var(--light-bg);
}

.tool-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: var(--primary-color-light);
    border-radius: 8px;
    margin-right: 15px;
    flex-shrink: 0;
}

.tool-icon i {
    font-size: 1.2em;
    color: var(--primary-color);
}

.tool-info {
    flex-grow: 1;
    min-width: 0; /* 防止内容溢出 */
}

.tool-info h3 {
    font-size: 1.1em;
    margin: 0 0 5px;
    color: var(--dark-text);
}

.tool-info p {
    font-size: 0.9em;
    color: var(--light-text);
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tool-actions {
    display: flex;
    gap: 10px;
    margin-left: 15px;
    flex-shrink: 0;
    align-items: center;
}

.tool-link, .tool-source-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 0.9em;
    text-decoration: none;
    white-space: nowrap;
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    vertical-align: middle !important;
}

.tool-link {
    background-color: var(--primary-color);
    color: white;
    border: 1px solid var(--primary-color) !important;
}

.tool-link:hover {
    background-color: var(--primary-hover);
    color: white;
}

.tool-source-link {
    background-color: var(--light-bg);
    color: var(--dark-text);
    border: 1px solid var(--border-color) !important;
}

.tool-source-link:hover {
    background-color: var(--border-color);
}

.tool-source-link.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.search-category {
    display: inline-block;
    font-size: 0.85em;
    color: var(--secondary-color);
    margin-top: 5px;
}

.no-tools {
    text-align: center;
    padding: 40px;
    color: var(--light-text);
    font-size: 1.1em;
}

.tools-count {
    text-align: right;
    margin-bottom: 15px;
    color: var(--light-text);
    font-size: 0.9em;
}

.error-message {
    text-align: center;
    padding: 20px;
    color: #e74c3c;
}

.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--light-text);
}

.loading-indicator i {
    font-size: 2em;
    margin-bottom: 10px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式调整 */
@media (max-width: 768px) {
    .category-nav {
        padding: 8px;
        top: 5px;
        flex-direction: column;
        max-height: 200px;
        overflow-y: auto;
    }

    .category-item {
        padding: 8px 12px;
        font-size: 0.9em;
        width: 100%;
    }

    .category-group-header h2 {
        font-size: 1.2em;
    }

    .tool-item {
        flex-wrap: wrap;
        padding: 15px;
    }

    .tool-info {
        width: calc(100% - 55px);
    }

    .tool-actions {
        margin-left: 0;
        margin-top: 10px;
        width: 100%;
        display: flex;
        gap: 10px;
    }

    .tool-link, .tool-source-link {
        flex: 1;
        text-align: center;
        display: flex;
        justify-content: center;
        align-items: center;
        height: 36px !important;
        min-height: 36px !important;
        max-height: 36px !important;
        margin: 0 !important;
        vertical-align: middle !important;
    }
}
