/* 分类文档页面样式 */

/* 分类导航按钮 */
.second-level-section {
    margin: 1.5rem 0;
}

.category-btn-mobile {
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.category-btn-mobile:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
}

/* 分类标题链接 */
.category-title-link {
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
    position: relative;
}

.category-title-link:hover {
    color: #007bff;
    text-decoration: none;
    transform: translateX(4px);
}

.category-title-link::after {
    content: '↑';
    margin-left: 0.5rem;
    font-size: 0.8em;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.category-title-link:hover::after {
    opacity: 1;
}

/* 页面容器 */
.category-docs-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* 文档列表 */
.docs-list {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    padding: 0px 10px;
}

/* 文档项 - 紧凑布局 */
.doc-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s ease;
    line-height: 1.4;
    position: relative;
}

/* 年份分隔线 - 在每年中间添加蓝色加粗线 */
.doc-item.year-separator {
    border-bottom: 1px solid #007bff;
    background: linear-gradient(90deg, rgba(0, 123, 255, 0.1) 0%, transparent 100%);
}

.doc-item.year-separator .doc-date {
    font-weight: 600;
    color: #007bff;
    font-size: 0.9rem;
}

.doc-item.year-separator .doc-link {
    font-weight: 500;
    color: #333;
}

/* 年份分隔符日期样式 */
.year-separator-date {
    font-weight: 600;
    color: #007bff;
    font-size: 0.9rem;
    width: 80px;
    text-align: left;
}

/* 年份分隔符不显示分隔线 */
.doc-item.year-separator .doc-date::after {
    display: none !important;
}

/* 年份分隔符文本样式 */
.year-separator-text {
    font-weight: 600;
    color: #007bff;
    font-size: 0.8rem;
    text-decoration: none;
    pointer-events: none;
}

.doc-item:last-child {
    border-bottom: none;
}

.doc-item:hover {
    background: #f8f9fa;
    transform: none;
}

/* 文档日期 - 紧凑样式 */
.doc-date {
    flex-shrink: 0;
    width: 90px;
    font-size: 0.85rem;
    color: #666;
    font-weight: 400;
    margin-right: 1rem;
    text-align: left;
    position: relative;
    padding-right: 1rem;
}

/* 连续垂直分隔线 - 从第一个到最后一个 */
.doc-item:first-child .doc-date::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background: #d0d0d0;
    height: 100%;
}

.doc-item:not(:first-child):not(:last-child) .doc-date::after {
    content: '';
    position: absolute;
    right: 0;
    top: -0.5rem;
    bottom: -0.5rem;
    width: 1px;
    background: #d0d0d0;
    height: calc(100% + 1rem);
}

.doc-item:last-child .doc-date::after {
    content: '';
    position: absolute;
    right: 0;
    top: -0.5rem;
    bottom: 0;
    width: 1px;
    background: #d0d0d0;
    height: calc(100% + 0.5rem);
}

/* 文档链接 - 紧凑样式 */
.doc-link {
    flex: 1;
    min-width: 0;
    color: #333;
    text-decoration: none;
    font-size: 0.9rem;
    line-height: 1.4;
    display: block;
}

.doc-link:hover {
    color: #007bff;
    text-decoration: underline;
}

.download-link {
    color: #dc3545;
}

.download-link:hover {
    color: #c82333;
}

/* 清理重复样式 - 已移除 */

.doc-link:hover {
    color: #007bff;
    text-decoration: none;
}

/* 移动端适配 */
@media (max-width: 768px) {
    /* 文档项移动端布局 */
    .doc-item {
        padding: 0.4rem 0;
        flex-direction: column;
        align-items: flex-start;
    }
    
    /* 日期移动端样式 - 靠左对齐 */
    .doc-date {
        width: auto;
        margin-right: 0;
        margin-bottom: 0.3rem;
        font-size: 0.8rem;
        text-align: left;
        padding-right: 0;
    }
    
    /* 移除移动端的垂直分隔线 */
    .doc-date::after {
        display: none;
    }
    
    /* 文档链接移动端样式 */
    .doc-link {
        font-size: 0.85rem;
        line-height: 1.3;
        width: 100%;
    }
    
    /* 分类导航按钮移动端适配 */
    .category-btn-mobile {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
        margin: 0.2rem;
    }
    
    /* 页面容器移动端适配 */
    .category-docs-container {
        padding: 1rem 0.5rem;
    }
    
    /* 分类标题移动端适配 */
    .category-title {
        font-size: 1.1rem;
        margin-bottom: 0.8rem;
    }
    
    /* 分类标题链接移动端适配 */
    .category-title-link {
        font-size: 1rem;
        line-height: 1.3;
    }
}

.download-link {
    color: #dc3545;
    position: relative;
}

.download-link:hover {
    color: #c82333;
}

.download-link::after {
    content: " 📥";
    font-size: 0.8rem;
    margin-left: 0.3rem;
    opacity: 0.7;
}

/* 文档元信息 */
.doc-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.85rem;
    color: #666;
}

.doc-category {
    background: #e9ecef;
    color: #495057;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
}

.doc-author {
    color: #6c757d;
}

.doc-views {
    color: #6c757d;
}

/* 空状态 */
.empty-state {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin-top: 2rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .category-docs-container {
        padding: 1rem 0.5rem;
    }
    
    .doc-item {
        padding: 1rem 1.5rem;
        flex-direction: column;
    }
    
    .doc-date {
        width: auto;
        margin-right: 0;
        margin-bottom: 0.5rem;
        font-size: 0.8rem;
        color: #999;
    }
    
    .doc-link {
        font-size: 0.8rem;
    }
    
    .doc-meta {
        gap: 0.5rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .doc-item {
        padding: 0.8rem 1rem;
    }
    
    .doc-link {
        font-size: 0.8rem;
    }
    
    .doc-meta {
        flex-direction: column;
        gap: 0.3rem;
    }
    
    /* 分类标题超小屏幕适配 */
    .category-title {
        font-size: 1rem;
        margin-bottom: 0.6rem;
    }
    
    .category-title-link {
        font-size: 0.9rem;
        line-height: 1.2;
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.doc-item {
    animation: fadeInUp 0.5s ease-out;
}

.doc-item:nth-child(1) { animation-delay: 0.1s; }
.doc-item:nth-child(2) { animation-delay: 0.2s; }
.doc-item:nth-child(3) { animation-delay: 0.3s; }
.doc-item:nth-child(4) { animation-delay: 0.4s; }
.doc-item:nth-child(5) { animation-delay: 0.5s; }
