/* 文章详情页样式 */
.article-container {
    padding: 40px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* 面包屑样式 */
.breadcrumb {
    margin-bottom: 30px;
}

.breadcrumb ul {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
}

.breadcrumb-item {
    color: #666;
    margin: 0 8px 0 0;
}

.breadcrumb-item:first-child {
    margin-left: 0;
}

.breadcrumb-item a {
    color: #666;
    text-decoration: none;
}

.breadcrumb-item:last-child {
    color: #333;
}

/* 布局 */
.article-layout {
    display: flex;
    gap: 40px;
}

/* 左侧边栏 */
.article-sidebar {
    width: 250px;
    flex-shrink: 0;
}

.sidebar-content {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    padding: 0;
}

/* 分类项 */
.sidebar-category {
    border-bottom: 1px solid #f0f0f0;
}

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

/* 分类标题头部 - 可点击 */
.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease, color 0.2s ease;
    position: relative;
}

.category-header:hover {
    background-color: #f8f8f8;
}

/* 有选中文章的分类 - 主题色背景和文字 */
.sidebar-category.has-active .category-header {
    background-color: #fff5f0;
    color: #f69034;
}

.sidebar-category.has-active .category-header:hover {
    background-color: #ffebe0;
}

.category-title {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    flex: 1;
}

.sidebar-category.has-active .category-title {
    color: #f69034;
}

/* 箭头图标 */
.category-arrow {
    font-size: 12px;
    color: #999;
    transition: transform 0.2s ease, color 0.2s ease;
    margin-left: 10px;
}

.sidebar-category.has-active .category-arrow {
    color: #f69034;
}

/* 展开状态 - 箭头向上 */
.sidebar-category.expanded .category-arrow {
    transform: rotate(180deg);
}

/* 文章列表容器 */
.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    /* 关闭时使用更快的过渡 */
    transition: max-height 0.2s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.15s ease, 
                padding 0.2s ease;
    padding-left: 0;
    padding-right: 0;
}

/* 展开状态 */
.sidebar-category.expanded .category-list {
    max-height: 1000px;
    opacity: 1;
    padding: 0 0 8px 0;
    /* 展开时稍慢一点，但也不超过0.25s */
    transition: max-height 0.25s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.2s ease, 
                padding 0.25s ease;
}

/* 文章链接项 */
.category-list li {
    margin: 0;
}

.article-link {
    display: block;
    padding: 10px 20px 10px 40px;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease, background-color 0.2s ease;
    position: relative;
}

.article-link:hover {
    color: #f69034;
    background-color: #fafafa;
}

/* 选中状态 - 主题色文字 */
.article-link.active {
    color: #f69034;
    font-weight: 500;
    background-color: #fff5f0;
}

/* 右侧内容区 */
.article-content {
    flex: 1;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    padding: 40px;
}

.article-title {
    font-size: 32px;
    font-weight: 600;
    color: #2d2d38;
    margin: 0 0 20px 0;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e5e5;
}

.article-body {
    font-size: 15px;
    line-height: 1.8;
    color: #333;
}

.article-empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.article-empty p {
    font-size: 16px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .article-layout {
        flex-direction: column;
    }
    
    .article-sidebar {
        width: 100%;
        margin-bottom: 20px;
    }
}
