/* 左侧边栏 - 基础样式 */
.left-sidebar {
    width: 220px;
    flex-shrink: 0;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 40px;
    align-self: flex-start;
}

/* WebKit浏览器隐藏滚动条 */
.left-sidebar::-webkit-scrollbar {
    display: none;
}

/* 分类卡片 */
.category-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 20px;
    overflow: hidden;
}

/* 分类标题栏 - 蓝色渐变 */
.category-header {
    background: linear-gradient(to right, var(--primary), #6e8ffa);
    color: white;
    padding: 15px;
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* 分类标题栏 - 紫色渐变 */
.category-headerlt {
    background: linear-gradient(to right, #8a2be2, #ba55d3);
    color: white;
    padding: 15px;
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-title {
    display: flex;
    align-items: center;
}

.header-title i {
    margin-right: 5px;
}

/* 分类列表 */
.category-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.category-item {
    border-bottom: 1px solid var(--border);
    margin: 0;
    padding: 0;
}

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

/* 分类图标 */
.category-icon {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    object-fit: contain;
    vertical-align: middle;
}

/* 分类链接 */
.category-link {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: var(--dark);
    transition: var(--transition);
    gap: 10px;
    text-decoration: none;
}

.category-link:hover {
    background-color: rgba(25, 152, 255, 0.05);
    color: var(--primary);
    padding-left: 20px;
}

.category-link.active {
    background-color: rgba(25, 152, 255, 0.1);
    color: var(--primary);
    border-left: 3px solid var(--primary);
}

/* 投稿/发帖按钮文字 */
.wz {
    font-size: 12px;
    color: white;
    font-weight: normal;
    text-decoration: none;
}

.wz:hover {
    color: white;
}

.wz i {
    margin-right: 5px;
}

/* 工具分类容器 */
.tool-cat-container {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 20px;
    overflow: hidden;
}

/* 工具分类标题栏 */
.tool-cat-header {
    background: linear-gradient(to right, #ff9966, #ff5e62);
    color: white;
    padding: 15px;
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tool-cat-title {
    display: flex;
    align-items: center;
}

.tool-cat-title i {
    margin-right: 5px;
}

.tool-cat-more {
    font-size: 12px;
    color: white;
    font-weight: normal;
    text-decoration: none;
}

.tool-cat-more:hover {
    color: white;
}

.tool-cat-more i {
    margin-right: 5px;
}

/* 工具分类网格 */
.tool-cat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    padding: 8px;
    gap: 8px;
}

.tool-cat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--dark);
    padding: 10px 5px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.tool-cat-item:hover {
    background-color: rgba(25, 152, 255, 0.05);
    color: var(--primary);
}

.tool-cat-active {
    background-color: rgba(25, 152, 255, 0.1);
    color: var(--primary);
}

.tool-cat-icon-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 5px;
}

.tool-cat-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.tool-cat-name {
    font-size: 12px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

/* 设置最大高度和滚动 */
.category-list {
    max-height: 300px; /* 根据需要调整 */
    overflow-y: auto;
    scrollbar-width: none; /* Firefox隐藏滚动条 */
    -ms-overflow-style: none; /* IE隐藏滚动条 */
    padding-right: 5px;
}

/* WebKit浏览器隐藏滚动条 */
.category-list::-webkit-scrollbar {
    display: none;
}


.category-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.category-list::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.category-list::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}


/* 响应式设计 */
@media (max-width: 992px) {
    .left-sidebar {
        width: 100%;
        position: static;
        order: 3;
        margin-top: 20px;
        border-top: 1px solid var(--border);
        padding-top: 20px;
    }
}

@media (max-width: 576px) {
    .left-sidebar {
        display: none;
    }
    
    .tool-cat-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
