/* ================= 布局基础 ================= */
.page-layout {
    display: flex;
    gap: 25px;
    align-items: flex-start;
}

/* ================= 左侧侧边栏 ================= */
.sidebar {
    flex: 0 0 250px;
}

.sidebar-box {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    padding-bottom: 10px;
}

.mt-20 {
    margin-top: 20px;
}

.sidebar-header {
    background-color: #f5f7fa;
    padding: 12px 15px;
    border-left: 4px solid #1976d2;
    /* 左侧蓝条装饰 */
    border-bottom: 1px solid #eee;
}

.sidebar-header h3 {
    font-size: 16px;
    color: #333;
    margin: 0;
}

.sidebar-menu li {
    padding: 12px 20px;
    border-bottom: 1px solid #f9f9f9;
    color: #555;
    cursor: pointer;
    transition: all 0.3s;
}

.sidebar-menu li:hover {
    color: #1976d2;
    background-color: #fafafa;
    padding-left: 25px;
}

.sidebar-menu li.active {
    color: #fff;
    background-color: #1976d2;
    font-weight: bold;
}

/* 侧边栏迷你列表 (最新动态) */
.mini-list {
    padding: 10px 15px;
}

.mini-list li {
    padding: 8px 0;
    border-bottom: 1px dashed #eee;
    font-size: 13px;
    line-height: 1.4;
}

.mini-list li a {
    color: #666;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    /* 限制一行 */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mini-list li a:hover {
    color: #1976d2;
    text-decoration: underline;
}

/* ================= 右侧详情容器 ================= */
.detail-wrapper {
    flex: 1;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    padding: 40px;
    /* 宽敞的内边距 */
    min-height: 800px;
}

/* 面包屑 */
.breadcrumb {
    font-size: 14px;
    color: #888;
    margin-bottom: 20px;
}

.breadcrumb a {
    color: #666;
}

.breadcrumb span {
    color: #1976d2;
}

/* --- 文章头部 --- */
.article-header {
    text-align: center;
    margin-bottom: 20px;
}

.article-title {
    font-size: 26px;
    color: #333;
    font-weight: bold;
    line-height: 1.4;
    margin-bottom: 15px;
}

.article-meta {
    font-size: 14px;
    color: #999;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    /* 项目间距 */
}

.article-divider {
    border: 0;
    height: 1px;
    background-image: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0));
    margin-bottom: 30px;
}

/* --- 文章正文 --- */
.article-body {
    font-family: "Microsoft YaHei", sans-serif;
    color: #444;
    font-size: 16px;
    line-height: 1.8;
    /* 适合阅读的行高 */
    text-align: justify;
    /* 两端对齐 */
}

.article-body p {
    margin-bottom: 20px;
    text-indent: 2em;
    /* 首行缩进 */
}

/* 文中标题 */
.article-body h3 {
    font-size: 18px;
    color: #1976d2;
    margin-top: 30px;
    margin-bottom: 15px;
    font-weight: bold;
}

/* 文中强调 */
.article-body strong {
    color: #333;
    font-weight: bold;
}

/* 文中图片容器 */
.article-image {
    text-align: center;
    margin: 30px 0;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 4px;
}

.article-image img {
    max-width: 100%;
    height: auto;
    border: 1px solid #ddd;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.image-caption {
    font-size: 14px;
    color: #777;
    margin-top: 10px;
    text-indent: 0 !important;
    /* 图注不缩进 */
}

/* --- 附件下载区 --- */
.attachment-box {
    margin-top: 50px;
    padding: 20px;
    background-color: #f8faff;
    /* 极浅的蓝色背景 */
    border: 1px solid #e3f2fd;
    border-radius: 4px;
}

.attach-title {
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

.attach-list li {
    margin-bottom: 10px;
}

.attach-list a {
    color: #1976d2;
    text-decoration: underline;
    font-size: 14px;
    display: flex;
    align-items: center;
}

.attach-list a:hover {
    color: #0d47a1;
}

/* 简单的文件图标样式 */
.file-icon {
    display: inline-block;
    padding: 2px 6px;
    background-color: #eee;
    color: #555;
    font-size: 11px;
    border-radius: 3px;
    margin-right: 8px;
    font-weight: bold;
    text-decoration: none;
    /* 图标内无下划线 */
}

/* --- 上一篇/下一篇 --- */
.article-nav {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px dashed #eee;
    font-size: 14px;
}

.nav-prev,
.nav-next {
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-prev span,
.nav-next span {
    color: #999;
}

.nav-prev a,
.nav-next a {
    color: #555;
}

.nav-prev a:hover,
.nav-next a:hover {
    color: #1976d2;
}

/* ================= 响应式适配 ================= */
@media screen and (max-width: 768px) {
    .page-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        order: 2;
        /* 手机端侧边栏放到文章底部 */
        margin-top: 20px;
    }

    .detail-wrapper {
        padding: 20px;
        order: 1;
        /* 手机端优先显示文章 */
    }

    .article-title {
        font-size: 20px;
    }

    .article-meta {
        flex-direction: column;
        gap: 5px;
    }

    .article-body {
        font-size: 15px;
    }
}