* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.header {
    background-color: #4CAF50;
    color: #fff;
    padding: 20px;
    text-align: center;
}

.header h1 {
    font-size: 28px;
    font-weight: bold;
    margin: 0;
}

.header .subtitle {
    font-size: 14px;
    margin: 5px 0 0 0;
    opacity: 0.9;
}

.main {
    display: flex;
    flex-wrap: wrap;
}

/* 顶部一级分类导航样式 */
.top-category-nav {
    background-color: #f9f9f9;
    border-bottom: 1px solid #eee;
    padding: 0;
    margin: 0;
}

/* 顶部分类导航容器 */
.top-category-nav .category-nav {
    padding: 0;
}

/* 顶部分类列表 - 横向排列 */
.top-category-nav .category-list {
    list-style: none;
    display: flex;
    flex-direction: row;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* 顶部分类项 - 横向排列 */
.top-category-nav .category-item {
    margin: 0;
    width: auto;
    border-right: 1px solid #eee;
    flex-shrink: 1;
}

/* 顶部分类链接 - 固定大小 */
.top-category-nav .category-link {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    width: 100px; /* 顶部分类宽度固定为100px */
    height: 45px; /* 分类高度增加为45px，适应30px图标 */
    padding: 0 10px;
    text-decoration: none;
    color: #333;
    background-color: #fff;
    border: none;
    font-size: 16px;
    text-align: left;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
    line-height: 45px;
}

/* 顶部分类链接悬停效果 */
.top-category-nav .category-link:hover {
    background-color: #4CAF50;
    color: #fff;
    border-bottom-color: #4CAF50;
}

/* 顶部分类图标 */
.top-category-nav .category-icon {
    margin-right: 8px;
    object-fit: cover;
    vertical-align: middle;
    width: 30px;
    height: 30px;
}

/* 搜索表单样式 */
.search-container {
    background-color: #f9f9f9;
    border-bottom: 1px solid #eee;
    padding: 10px 20px;
    text-align: left;
    width: 100%;
}

.search-form {
    display: flex;
    width: 100%;
    margin: 0;
    gap: 10px;
    overflow: visible;
}

.search-input {
    flex: 1;
    height: 38px;
    padding: 0 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
    min-width: 0;
}

.search-input:focus {
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.1);
}

.search-btn {
    height: 38px;
    padding: 0 20px;
    background-color: #4CAF50;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    white-space: nowrap;
}

.search-btn:hover {
    background-color: #45a049;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.search-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

/* 左侧二级分类导航样式 */
.sidebar {
    width: 150px; /* 左侧分类宽度 */
    padding: 2px 0 2px 2px; /* 左侧间距2px，上下2px */
    background-color: #f9f9f9;
    border-right: 1px solid #eee;
    flex-shrink: 0;
}

/* 左侧二级分类标题 */
.sub-category-nav h3 {
    font-size: 16px;
    margin: 0 20px 15px 0;
    color: #333;
    border-bottom: 2px solid #4CAF50;
    padding-bottom: 5px;
    text-align: left;
}

/* 左侧二级分类列表 */
.sub-category-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: block; /* 始终显示 */
}

/* 左侧二级分类项 */
.sub-category-item {
    margin-bottom: 5px;
    width: 100%;
}

/* 左侧三级分类列表 */
.sub-sub-category-list {
    list-style: none;
    margin: 5px 0 5px 15px;
    padding: 0;
}

/* 左侧三级分类项 */
.sub-sub-category-item {
    margin-bottom: 3px;
    width: 100%;
}

/* 左侧分类链接基础样式 */
.sub-category-link, .sub-sub-category-link {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    height: 45px;
    padding: 0 10px 0 10px;
    text-decoration: none;
    color: #333;
    background-color: #fff;
    border: none;
    border-radius: 0;
    transition: all 0.3s ease;
    font-size: 14px;
    text-align: left;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    line-height: 45px;
}

/* 二级分类链接样式 */
.sub-category-link {
    background-color: #fff;
    border-bottom: 1px solid #eee;
    font-weight: bold;
}

/* 三级分类链接样式 */
.sub-sub-category-link {
    background-color: #fafafa;
    font-size: 13px;
    color: #666;
}

/* 分类链接悬停效果 */
.sub-category-link:hover, .sub-sub-category-link:hover {
    background-color: #4CAF50;
    color: #fff;
    transform: translateX(5px);
}

/* 图标样式统一 */
.category-icon, .sub-category-icon, .sub-sub-category-icon {
    margin-right: 5px;
    object-fit: cover;
    vertical-align: middle;
    flex-shrink: 0;
    width: 30px;
    height: 30px;
}

/* 左侧分类图标 */
.sub-category-icon, .sub-sub-category-icon {
    margin-right: 8px;
    object-fit: cover;
    vertical-align: middle;
    width: 30px;
    height: 30px;
}

/* 无二级分类提示 */
.no-sub-category {
    padding: 10px 20px;
    color: #999;
    font-style: italic;
    text-align: center;
}

/* 无内容提示 */
.no-content {
    text-align: center;
    padding: 50px 0;
    color: #999;
    font-size: 16px;
}

/* 右侧内容区域 */
.content {
    flex: 1;
    padding: 5px;
    min-width: 300px;
}

/* 内容卡片样式 - 一行显示 */
.content-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.content-card {
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    /* 修改为一行显示，图片在左文字在右 */
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    height: auto;
}

.content-card:hover {
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transform: none;
}

/* 图片区域固定大小100*100 */
.content-image {
    width: 100px;
    height: 100px;
    overflow: hidden;
    flex-shrink: 0;
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.content-card:hover .card-image {
    transform: none;
}

/* 文字内容区域 */
.content-info {
    padding: 10px 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100px;
}

/* 标题样式 */
.content-title {
    font-size: 16px;
    margin-bottom: 5px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-all;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    max-height: 2.8em;
}

.content-title a {
    text-decoration: none;
    color: #333;
    transition: color 0.3s ease;
    word-break: break-all;
    display: block;
}

.content-title a:hover {
    color: #4CAF50;
}

/* 隐藏内容元信息 */
.content-meta {
    display: none;
}

/* 内容摘要样式 - 最多20个字，显示一行 */
.content-summary {
    color: #666;
    line-height: 1.4;
    font-size: 12px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    word-break: break-all;
    margin-top: 0;
    margin-bottom: 5px;
    display: block;
    max-height: 1.4em;
}

/* 调整内容信息区域的样式 */
.content-info {
    padding: 10px 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100px;
}

/* 内容时间样式 */
.content-time {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
    line-height: 1.4;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* 响应式调整 */
@media (max-width: 768px) {
    /* 保持flex布局，不使用grid */
    .content-list {
        flex-direction: column;
        gap: 15px;
    }
    
    .content-card {
        margin-bottom: 15px;
        /* 保持一行显示 */
        flex-direction: row;
    }
    
    .content-info {
        padding: 10px;
    }
    
    /* 内容摘要在移动端也最多显示20个字 */
    .content-summary {
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
    }
}

.no-content {
    text-align: center;
    padding: 50px 0;
    color: #999;
    font-size: 16px;
}



/* 类似APP的底部导航样式 */
.app-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #fff;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    height: 60px;
    display: flex;
}

.app-nav-list {
    list-style: none;
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 100%;
    margin: 0;
    padding: 0;
    width: 100%;
}

.app-nav-item {
    flex: 1;
    text-align: center;
    margin: 0;
}

.app-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    width: 100%;
}

.nav-icon {
    font-size: 20px;
    margin-bottom: 4px;
    display: block;
}

.app-nav-link:hover {
    color: #4CAF50;
    background-color: #f9f9f9;
}

/* 主容器需要添加底部 padding，避免内容被底部导航遮挡 */
.container {
    padding-bottom: 70px;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
    padding: 10px;
}

.pagination-list {
    list-style: none;
    display: flex;
    gap: 10px;
    margin: 0;
    padding: 0;
}

.pagination-item {
    margin: 0;
}

.pagination-link {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 35px;
    height: 35px;
    color: #666;
    text-decoration: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.pagination-link:hover {
    color: #4CAF50;
    border-color: #4CAF50;
    background-color: #f9f9f9;
}

.pagination-link.active {
    color: #fff;
    background-color: #4CAF50;
    border-color: #4CAF50;
}

.pagination-link:disabled {
    color: #999;
    border-color: #eee;
    background-color: #f5f5f5;
    cursor: not-allowed;
}

/* 内容详情页样式 */
.content-detail {
    padding: 20px;
    flex: 1;
}

.detail-title {
    font-size: 28px;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

.detail-meta {
    text-align: center;
    font-size: 13px;
    color: #999;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

/* 让每个meta项占据适当宽度，实现两行显示 */
.detail-meta span {
    flex: 0 0 auto;
    margin: 3px 8px;
}

/* 强制浏览和时间项换行显示 */
.detail-meta .view-count {
    flex-basis: 100%;
    margin-top: 3px;
}

/* 大图展示框样式 - 固定350*350大小 */
.detail-image {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 350px;
    height: 350px;
    margin: 0 auto 20px;
    background-color: #f5f5f5;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.detail-image img:hover {
    transform: scale(1.02);
}

/* 图片预览容器样式 */
.image-preview-container {
    margin-bottom: 30px;
    text-align: center;
}

/* 图片预览列表样式 - 一排显示 */
.image-preview-list {
    display: flex;
    justify-content: center;
    gap: 10px;
    overflow-x: auto;
    padding: 10px 0;
    flex-wrap: nowrap;
}

/* 预览图片项样式 - 固定60*60大小 */
.image-preview-item {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.image-preview-item:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    border-color: #4CAF50;
}

/* 选中的预览图片项样式 */
.image-preview-item.active {
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
    transform: scale(1.05);
}

.image-preview-item.active .preview-image {
    opacity: 1;
}

/* 预览图片样式 */
.preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s ease;
}

/* 大图显示容器样式 */
.large-image-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.large-image-container.show {
    opacity: 1;
}

/* 大图样式 */
#large-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

#large-image:hover {
    transform: scale(1.05);
}

.detail-content {
    font-size: 16px;
    line-height: 1.8;
    color: #333;
}

.detail-content p {
    margin-bottom: 20px;
}

.detail-content img {
    max-width: 100%;
    height: auto;
    margin: 20px 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    /* 保持左右结构，不改为上下结构 */
    .main {
        flex-direction: row;
        overflow-x: auto;
    }
    
    /* 保持侧边栏宽度 */
    .sidebar {
        width: 100px;
        min-width: 100px;
        border-right: 1px solid #eee;
        border-bottom: none;
    }
    
    /* 内容区域自适应 */
    .content {
        min-width: 0;
        flex: 1;
    }
    
    /* 内容卡片调整为单列显示 */
    .content-list {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    /* 容器宽度调整 */
    .container {
        width: 100%;
        max-width: 100%;
    }
    
    /* 内容卡片内边距调整 */
    .content-card {
        margin-bottom: 15px;
    }
    
    .content-info {
        padding: 10px;
    }
}