/* 分类页面特定样式 */
:root {
    --max-content-width: 640px;
    --sidebar-width: 80px;
    --sidebar-small-width: 70px;
}

body {
    background-color: #f5f5f5;
    max-width: var(--max-content-width);
    margin: 0 auto;
}

a {
    text-decoration: none;
    color: inherit;
}

a:hover, a:visited, a:active, a:link {
    text-decoration: none;
    color: inherit;
}

/* 顶部搜索框样式 */
.search-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #fff;
    display: flex;
    align-items: center;
    padding: 0 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    z-index: 1000;
    max-width: 640px;
    margin: 0 auto;
    justify-content: space-between;
}

.search-back {
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-form {
    flex: 1;
    display: flex;
    align-items: center;
    background: #f5f5f5;
    border-radius: 10px;
    padding: 0 15px;
    height: 40px;
}

.search-icon {
    color: #999;
    margin-right: 10px;
}

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    height: 100%;
    outline: none;
    font-size: 14px;
}

.search-button {
    background: #ef4444;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 0 15px;
    height: 36px;
    margin-left: 10px;
    font-size: 14px;
    cursor: pointer;
}

/* 分类内容区域 */
.category-container {
    display: flex;
    margin-top: 70px;
    margin-bottom: 60px;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
}

/* 左侧导航 */
.category-sidebar {
    width: var(--sidebar-width);
    background: #fff;
    height: calc(100vh - 130px);
    overflow-y: auto;
    position: fixed;
    /* 使用calc计算正确位置，确保不会贴在屏幕最左侧 */
    left: calc(50% - var(--max-content-width)/2);
    top: 70px;
    max-width: var(--sidebar-width);
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.category-sidebar::-webkit-scrollbar {
    display: none;
}

.sidebar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 30px;
    padding: 10px 0;
    font-size: 14px;
    color: #666;
    position: relative;
    border-left: 3px solid transparent;
}

.sidebar-item.active {
    color: #ef4444;
    background: #ffe6e6;
    border-left: 3px solid #ef4444;
}

/* 右侧内容区 */
.category-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    background: #fff;
    min-height: calc(100vh - 130px);
    padding: 15px;
}

/* 响应式调整 */
@media screen and (max-width: 640px) {
    .category-sidebar {
        /* 在小屏幕下调整位置 */
        left: 0;
    }
    
    .category-container {
        margin-left: 0;
        margin-right: 0;
    }
}

/* 右侧横幅 */
.category-banner {
    width: 100%;
    height: auto;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}

.category-banner img {
    width: 100%;
    height: auto;
    object-fit: cover;
    max-height: 100px;
}

/* 子分类标题 */
.subcategory-title {
    font-size: 16px;
    font-weight: 600;
    margin: 15px 0 10px;
    color: #333;
}

/* 子分类网格 */
.subcategory-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.subcategory-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.subcategory-image {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 8px;
    background: #f5f5f5;
}

.subcategory-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.subcategory-name {
    font-size: 12px;
    color: #666;
}

/* 隐藏非活动的子分类 */
.subcategory-section {
    display: none;
}

.subcategory-section.active {
    display: block;
}

/* 响应式调整 */
@media screen and (max-width: 480px) {
    .subcategory-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .subcategory-image {
        width: 50px;
        height: 50px;
    }
    
    .category-content {
        margin-left: var(--sidebar-width);
        padding: 10px;
    }
    
    .category-sidebar {
        width: var(--sidebar-width);
        max-width: var(--sidebar-width);
    }
    
    .category-banner {
        height: auto;
    }
    
    .category-banner img {
        max-height: 80px;
    }
}
/* 底部导航 */
/* 底部导航 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
    z-index: 100;
    max-width: 640px;
    margin: 0 auto;
}

.bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    width: 20%;
}

.bottom-nav .nav-item .nav-icon {
    font-size: 20px;
    color: #666;
    margin-bottom: 4px;
    display: block;
    text-align: center;
    width: 100%;
    max-width: 20px;
    max-height: 20px;
    margin: 0 auto 4px;
}

/* 确保所有SVG图标在非激活状态下颜色一致 */
.bottom-nav .nav-item svg path {
    fill: #666;
}

/* 为img类型的SVG图标设置颜色 */
.bottom-nav .nav-item .nav-icon {
    color: #666;
    filter: invert(42%) sepia(0%) saturate(0%) hue-rotate(143deg) brightness(95%) contrast(92%);
}

.bottom-nav .nav-item span {
    font-size: 12px;
    color: #666;
    text-align: center;
}

.bottom-nav .nav-item.active .nav-icon,
.bottom-nav .nav-item.active span {
    color: #ff4d4f;
}

.bottom-nav .nav-item.active .nav-icon {
    color: #ff4d4f;
    filter: invert(39%) sepia(79%) saturate(2449%) hue-rotate(328deg) brightness(100%) contrast(98%);
}

.bottom-nav .nav-item.active svg path {
    fill: #ff4d4f;
    /* 确保激活状态下SVG图标颜色覆盖默认颜色 */
    transition: fill 0.2s ease;
}
/* 确保在所有屏幕尺寸下导航栏都可见 */
@media screen and (max-width: 360px) {
    .category-sidebar {
        width: var(--sidebar-small-width);
        max-width: var(--sidebar-small-width);
        left: 0;
        box-shadow: 1px 0 5px rgba(0,0,0,0.1);
    }
    
    .category-content {
        margin-left: var(--sidebar-small-width);
        padding: 8px;
    }
    
    .sidebar-item {
        font-size: 12px;
        height: 50px;
        padding: 5px 0;
    }
    
    .category-banner {
        height: auto;
        margin-bottom: 15px;
    }
    
    .category-banner img {
        max-height: 70px;
    }
    
    .subcategory-grid {
        gap: 8px;
    }
}