:root {
    --primary-color: #6e48aa;
    --secondary-color: #9d50bb;
    --dark-color: #343a40;
    --light-color: #f8f9fa;
}

body {
    /* background-color: #f5f7fa; */
    /* padding-left: 250px; */
    /* margin-top: 80px; */
}

/* 侧边栏样式 */
.sidebar {
    position: sticky; /* 初始为绝对定位 */
    top: 80px; /* 初始距离顶部300px */
    left: 0;
    width: 250px;
    height: calc(100vh - 70px); /* 高度计算 */
    /* background: white; */
    overflow-y: auto;
    z-index: 1000;
    padding: 20px 0;
    /* 添加平滑过渡效果 */
    /* transition: top 0.3s ease;  */
}

/* 当页面滚动时的固定定位样式 */
.sidebar.fixed {
    position: fixed;
    top: 70px; /* 固定在头部导航栏下方 */
    height: calc(100vh - 70px); /* 重新计算高度 */
}

.sidebar-header {
    padding: 0 20px 15px;
    border-bottom: 1px solid #e1e5eb;
    margin-bottom: 15px;
}

.category-list {
    list-style: none;
    padding: 0;
}

.category-item {
    margin-bottom: 2px;
}

.category-link {
    display: block;
    padding: 10px 20px;
    color: var(--dark-color);
    text-decoration: none;
    transition: all 0.2s;
    position: relative;
}

.category-link:hover,
.category-link.active {
    background: rgba(110, 72, 170, 0.1);
    color: var(--primary-color);
}

.category-link.active:after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--primary-color);
}

/* 主内容区域 */
.main-content {
    /* padding: 30px; */
}

.category-section {
    margin-bottom: 40px;
}

.category-title {
    color: var(--primary-color);
    /* margin-bottom: 20px; */
    padding-bottom: 10px;
    /* border-bottom: 2px solid #e1e5eb; */
}

.category-title a {
    color: var(--primary-color);
}

/* 二级分类卡片 */
.subcategory-card {
    background: white;
    border-radius: 8px;
    border: 1px solid rgba(128, 0, 128, 0.2);
    padding: 15px;
    /* margin-bottom: 20px; */
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    height: 100%;
}

.subcategory-card:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transform: translateY(-3px);
}

.subcategory-name {
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--dark-color);
}

.tool-logos {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin: 0 -5px;
}

.tool-logo {
    width: 32px;
    height: 32px;
    margin: 0 5px 10px;
    position: relative;
}

.tool-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.tool-logo:hover img {
    transform: scale(1.1);
}

.tool-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dark-color);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: nowrap;
    visibility: hidden;
    opacity: 0;
    transition: all 0.2s;
    z-index: 10;
    margin-bottom: 5px;
}

.tool-tooltip:after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: var(--dark-color) transparent transparent transparent;
}

.tool-logo:hover .tool-tooltip {
    visibility: visible;
    opacity: 1;
}

.view-all {
    color: var(--primary-color);
    font-size: 0.9rem;
    margin-top: 10px;
    display: inline-block;
}

/* 响应式设计 */
@media (max-width: 992px) {
    body {
        padding-left: 0;
    }
    
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        display: none;
    }
    
    .sidebar.active {
        transform: translateX(0);
        display: flex;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .mobile-menu-toggle {
        display: block;
        position: fixed;
        left: 10px;
        top: 10px;
        z-index: 1010;
        background: white;
        border: none;
        width: 40px;
        height: 40px;
        margin-top: 80px;
        border-radius: 50%;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }
}

/* 广告位 */
.ad-item {
    background: linear-gradient(135deg, #f5f7fa, #e4e8eb);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    color: #6c757d;
    border: 1px dashed #ced4da;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    height: 100%;
}

.ad-item i {
    font-size: 2rem;
    margin-bottom: 10px;
    color: var(--primary-color);
}
