/* 全局样式 (部分由 Milligram 处理) */
body {
    font-family: "Microsoft YaHei", "Hiragino Sans GB", "Helvetica Neue", Helvetica, Arial, sans-serif; /* 优化字体栈 */
    /* font-size: 1.6rem; */ /* Milligram 默认 */
    /* line-height: 1.6; */ /* Milligram 默认 */
    /* color: #606c76; */ /* Milligram 默认 */
    background-color: #f8f9fa; /* 稍微调整背景色 */
}

a {
    /* color: #9b4dca; */ /* Milligram 默认 */
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

a:hover {
    color: #606c76; /* 调整悬停颜色 */
}

.container {
    max-width: 1140px; /* 稍微调整容器宽度 */
    margin: 0 auto;
    padding: 0 15px;
}

h1 {
    /* font-size: 3.2rem; */ /* Milligram 默认 */
    /* font-weight: 300; */ /* Milligram 默认 */
    /* color: #606c76; */ /* Milligram 默认 */
    margin: 30px 0 20px; /* 调整外边距 */
    /* line-height: 1.2; */ /* Milligram 默认 */
    text-align: center;
}

h2 {
    /* font-size: 2.8rem; */ /* Milligram 默认 */
    margin-bottom: 25px; /* 调整下边距 */
    padding-bottom: 15px; /* 调整内边距 */
    border-bottom: 1px solid #e1e1e1; /* 调整边框颜色 */
    /* color: #606c76; */ /* Milligram 默认 */
    font-weight: 400; /* 增加一点字重 */
}

h3 {
    /* font-size: 2.4rem; */ /* Milligram 默认 */
    margin-bottom: 20px; /* 调整下边距 */
    /* color: #606c76; */ /* Milligram 默认 */
    font-weight: 500; /* 增加字重 */
}

/* 头部样式 */
header {
    background-color: #ffffff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    padding: 15px 0; /* 调整内边距 */
    margin-bottom: 30px; /* 调整下边距 */
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
}

.site-title {
    /* font-size: 2.8rem; */ /* 继承 h1 样式，可能由 Milligram 调整 */
    margin: 0;
    /* color: #606c76; */ /* 继承 h1 样式，可能由 Milligram 调整 */
    font-weight: 500;
}

/* 主体内容 */
main {
    padding: 20px 0;
}

/* 主内容区布局 */
.main-container {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.content-area {
    flex: 1;
    min-width: 0; /* 允许内容区收缩 */
    padding: 0 15px;
}

/* 卡片样式通用 */
.article-detail,
.related-articles,
.comment-section,
.article-item,
.sidebar-block {
    background: #ffffff;
    padding: 30px; /* 增加内边距 */
    margin-bottom: 25px; /* 调整下边距 */
    border-radius: 6px; /* 调整圆角 */
    border: 1px solid #e9ecef; /* 添加细边框 */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04); /* 调整阴影 */
}

/* 文章详情页样式 */
.article-detail h1 {
    font-size: 2.6rem; /* 调整字体大小 */
    line-height: 1.3;
    margin-bottom: 15px; /* 调整下边距 */
    text-align: left;
    font-weight: 600;
}

.article-meta {
    margin-bottom: 25px; /* 调整下边距 */
    color: #868e96; /* 调整颜色 */
    font-size: 1.4rem; /* 调整字体大小 */
    border-bottom: 1px solid #f1f3f5; /* 调整边框颜色 */
    padding-bottom: 15px;
}

.article-meta span {
    margin-right: 15px; /* 调整右边距 */
    display: inline-block;
}

.article-meta i {
    margin-right: 4px; /* 调整右边距 */
    color: #adb5bd; /* 调整图标颜色 */
}

.article-meta a {
    color: #007bff; /* 使用更鲜明的链接颜色 */
    font-weight: 500;
}

.article-meta a:hover {
    text-decoration: underline;
    color: #0056b3;
}

.article-subtitle {
    font-size: 1.8rem; /* 调整字体大小 */
    color: #495057; /* 调整颜色 */
    margin-bottom: 25px; /* 调整下边距 */
    font-style: normal; /* 去掉斜体 */
    line-height: 1.6;
    border-left: 3px solid #007bff; /* 调整边框颜色和宽度 */
    padding: 10px 15px; /* 增加内边距 */
    background-color: #f8f9fa; /* 添加淡背景色 */
    border-radius: 4px;
}

.article-content {
    font-size: 1.6rem; /* 调整字体大小 */
    line-height: 1.75; /* 调整行高 */
    color: #343a40; /* 调整正文颜色 */
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.article-content p {
    margin-bottom: 1.5rem; /* 调整段落间距 */
    text-align: justify;
}

.article-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 25px auto; /* 调整外边距 */
    border-radius: 4px; /* 调整圆角 */
    box-shadow: 0 2px 8px rgba(0,0,0,0.08); /* 调整阴影 */
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.article-content img:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.article-footer {
    margin-top: 35px; /* 调整上边距 */
    padding-top: 25px; /* 调整上内边距 */
    border-top: 1px solid #f1f3f5; /* 调整边框颜色 */
    display: flex;
    justify-content: space-between;
    align-items: center; /* 垂直居中 */
    flex-wrap: wrap;
}

.article-stats {
    margin-bottom: 15px;
}

.article-stats .views,
.article-stats .likes {
    margin-right: 25px; /* 调整右边距 */
    color: #6c757d; /* 调整颜色 */
    font-size: 1.4rem; /* 调整字体大小 */
}

/* 标签样式 */
.article-tags {
    margin-top: 10px;
}

.article-tags .tags-label {
    color: #6c757d; /* 调整颜色 */
    margin-right: 10px; /* 调整右边距 */
    font-weight: 500;
}

.article-tags .tag-link {
    display: inline-block;
    background: #e9ecef; /* 调整背景色 */
    color: #495057; /* 调整文字颜色 */
    padding: 5px 12px; /* 调整内边距 */
    border-radius: 4px; /* 调整圆角 */
    margin: 0 6px 6px 0; /* 调整外边距 */
    font-size: 1.3rem; /* 调整字体大小 */
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.article-tags .tag-link:hover {
    background: #007bff;
    color: #fff;
    text-decoration: none;
    border-color: #007bff;
}

/* 相关文章和栏目标题 */
.related-articles h3,
.comment-section h3,
.sidebar-title {
    font-size: 2rem; /* 调整字体大小 */
    margin-bottom: 25px; /* 调整下边距 */
    border-bottom: 1px solid #e9ecef; /* 调整边框颜色 */
    padding-bottom: 15px; /* 调整下内边距 */
    color: #343a40; /* 调整颜色 */
    font-weight: 500;
}

.related-articles h3 i,
.comment-section h3 i {
    color: #007bff; /* 调整图标颜色 */
    margin-right: 10px; /* 调整右边距 */
}

/* 文章列表通用样式 */
.article-list .article-item {
    display: flex;
    margin-bottom: 25px; /* 调整下边距 */
    padding: 25px; /* 增加内边距 */
    border: 1px solid #e9ecef; /* 添加边框 */
    border-radius: 6px; /* 添加圆角 */
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s ease;
}

.article-list .article-item:hover {
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

.article-list .article-item:last-child {
    margin-bottom: 0;
}

.article-image {
    width: 180px; /* 调整宽度 */
    height: 120px; /* 调整高度 */
    border-radius: 4px; /* 调整圆角 */
    overflow: hidden;
    margin-right: 25px; /* 调整右边距 */
    flex-shrink: 0;
}

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

.article-image img:hover {
    transform: scale(1.05);
}

.article-list .article-content {
    flex: 1;
    min-width: 0; /* 允许内容收缩 */
}

.article-list .article-content h3 {
    font-size: 1.9rem; /* 调整字体大小 */
    margin: 0 0 10px; /* 调整外边距 */
    line-height: 1.3;
    font-weight: 600; /* 增加字重 */
    border-bottom: none;
    padding-bottom: 0;
}

.article-list .article-content h3 a {
    color: #212529; /* 调整颜色 */
    text-decoration: none;
    transition: color 0.2s ease;
}

.article-list .article-content h3 a:hover {
    color: #007bff;
}

.article-summary {
    color: #6c757d; /* 调整颜色 */
    line-height: 1.6;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* 调整显示行数 */
    -webkit-box-orient: vertical;
    margin-bottom: 15px; /* 调整下边距 */
    font-size: 1.5rem;
}

.article-list .article-meta {
    font-size: 1.3rem; /* 调整字体大小 */
    color: #868e96; /* 调整颜色 */
    margin-bottom: 0; /* 移除下边距 */
    border-bottom: none;
    padding-bottom: 0;
}

.article-list .article-meta .time {
    margin-right: 15px;
}

.article-list .article-meta i {
    font-size: 1.2rem; /* 调整字体大小 */
    margin-right: 4px; /* 调整右边距 */
}

/* 评论区样式 */
.comment-section {
    margin-top: 30px; /* 调整上边距 */
}

.comments {
    margin-top: 20px; /* 调整上边距 */
}

.comment-item {
    display: flex;
    margin-bottom: 25px; /* 调整下边距 */
    padding-bottom: 25px; /* 调整下内边距 */
    border-bottom: 1px solid #f1f3f5; /* 调整边框颜色 */
}

.comment-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.comment-avatar {
    width: 45px; /* 调整宽度 */
    margin-right: 18px; /* 调整右边距 */
    flex-shrink: 0;
}

.avatar-img {
    width: 45px; /* 调整宽度 */
    height: 45px; /* 调整高度 */
    border-radius: 50%;
    object-fit: cover;
}

.comment-content {
    flex: 1;
    min-width: 0; /* 允许内容收缩 */
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center; /* 垂直居中 */
    margin-bottom: 10px; /* 调整下边距 */
    flex-wrap: wrap;
}

.comment-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap; /* 允许换行 */
}

.comment-author {
    font-weight: 600; /* 增加字重 */
    color: #343a40; /* 调整颜色 */
    margin-right: 12px; /* 调整右边距 */
    font-size: 1.5rem;
}

.comment-likes {
    color: #dc3545; /* 调整颜色 */
    font-size: 1.3rem; /* 调整字体大小 */
    margin-left: 10px;
}

.comment-time {
    color: #868e96; /* 调整颜色 */
    font-size: 1.3rem; /* 调整字体大小 */
    margin-left: auto; /* 推到右侧 */
    padding-left: 10px; /* 增加左内边距 */
}

.comment-text {
    margin-bottom: 15px;
    color: #495057; /* 调整颜色 */
    line-height: 1.65; /* 调整行高 */
    font-size: 1.5rem;
}

.comment-replies {
    background: #f8f9fa; /* 调整背景色 */
    border-radius: 4px; /* 调整圆角 */
    padding: 15px 20px; /* 调整内边距 */
    margin-top: 15px; /* 调整上边距 */
    border: 1px solid #e9ecef;
}

.reply-item {
    padding: 12px 0; /* 调整内边距 */
    border-bottom: 1px dashed #dee2e6; /* 调整边框颜色 */
    font-size: 1.4rem;
}

.reply-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.reply-to {
    color: #6c757d; /* 调整颜色 */
    margin: 0 5px;
}

.reply-time {
    color: #868e96; /* 调整颜色 */
    font-size: 1.2rem; /* 调整字体大小 */
    float: right;
}

/* 侧边栏样式 */
.sidebar {
    width: 300px;
    padding: 0 15px;
    flex-shrink: 0; /* 防止侧边栏被压缩 */
}

.sidebar-block {
    margin-bottom: 30px; /* 调整下边距 */
    padding: 25px; /* 调整内边距 */
}

.sidebar-title {
    border-bottom: 1px solid #e9ecef; /* 调整边框颜色 */
    padding-bottom: 15px;
    margin-bottom: 20px; /* 调整下边距 */
}

.sidebar-content {
    padding: 0;
}

.category-list {
    list-style: none;
    padding-left: 0; /* 移除默认内边距 */
}

.category-list li {
    margin-bottom: 10px; /* 调整下边距 */
    padding-bottom: 10px; /* 调整下内边距 */
    border-bottom: 1px dashed #e9ecef; /* 调整边框颜色 */
}

.category-list li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.category-list a {
    color: #495057; /* 调整颜色 */
    transition: all 0.2s;
    display: block;
    padding: 5px 0; /* 增加垂直内边距 */
    font-size: 1.5rem;
}

.category-list a:hover {
    color: #007bff;
    padding-left: 8px; /* 调整悬停效果 */
    background-color: #f8f9fa; /* 添加悬停背景色 */
    border-radius: 3px;
}

/* 作者信息 */
.author-info {
    text-align: center;
}

.author-avatar {
    margin-bottom: 15px;
}

.author-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff; /* 添加白色边框 */
    box-shadow: 0 2px 6px rgba(0,0,0,0.1); /* 调整阴影 */
}

.author-details h4 {
    margin-bottom: 8px; /* 调整下边距 */
    font-size: 1.8rem; /* 调整字体大小 */
    color: #343a40; /* 调整颜色 */
    font-weight: 600;
}

.author-details p {
    color: #6c757d; /* 调整颜色 */
    margin-bottom: 15px; /* 调整下边距 */
    line-height: 1.6;
    font-size: 1.4rem;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 40px; /* 调整上边距 */
    padding-left: 0; /* 移除默认内边距 */
    list-style: none;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 10px 18px; /* 调整内边距 */
    margin: 0 4px; /* 调整外边距 */
    border-radius: 4px;
    background-color: #fff;
    border: 1px solid #dee2e6; /* 添加边框 */
    color: #007bff; /* 调整颜色 */
    transition: all 0.2s;
    font-size: 1.4rem;
}

.pagination a:hover {
    background-color: #e9ecef; /* 调整悬停背景色 */
    color: #0056b3;
    text-decoration: none;
}

.pagination .current {
    background-color: #007bff;
    color: #fff;
    border-color: #007bff;
    z-index: 1; /* 确保当前页在最上层 */
}

.pagination .disabled span {
    color: #6c757d;
    background-color: #fff;
    border-color: #dee2e6;
    cursor: not-allowed;
}

.pagination .prev,
.pagination .next {
    padding: 10px 15px; /* 调整内边距 */
}

/* 页脚样式 */
footer {
    background-color: #ffffff;
    padding: 30px 0; /* 调整内边距 */
    margin-top: 50px; /* 调整上边距 */
    border-top: 1px solid #e9ecef; /* 调整边框颜色 */
    text-align: center;
    color: #6c757d; /* 调整颜色 */
    font-size: 1.4rem; /* 调整字体大小 */
    box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.05);
}

footer p {
    margin-bottom: 5px; /* 调整下边距 */
    line-height: 1.5;
}

/* 提示信息样式 */
div[style*="background:#f0f0f0"],
div[style*="background:#fff0f0"] {
    margin: 20px 0; /* 调整外边距 */
    border-radius: 4px; /* 调整圆角 */
    font-size: 1.4rem; /* 调整字体大小 */
    padding: 15px 20px; /* 增加内边距 */
    border: 1px solid #dee2e6;
    box-shadow: none; /* 移除原有阴影 */
}

div[style*="background:#fff0f0"] {
    background-color: #f8d7da !important; /* 使用更标准的错误提示背景色 */
    color: #721c24; /* 使用对应的文字颜色 */
    border-color: #f5c6cb;
}

/* 无数据提示 */
.no-data {
    background-color: #fff;
    padding: 50px; /* 增加内边距 */
    text-align: center;
    border-radius: 6px; /* 调整圆角 */
    color: #868e96; /* 调整颜色 */
    border: 1px solid #e9ecef; /* 添加边框 */
    box-shadow: none; /* 移除原有阴影 */
    margin: 30px 0; /* 调整外边距 */
    font-size: 1.6rem;
}

/* 响应式设计 */
@media screen and (max-width: 992px) {
    .sidebar {
        width: 100%;
        margin-top: 30px; /* 调整上边距 */
    }

    .category-list {
        display: flex;
        flex-wrap: wrap;
        margin: 0 -5px; /* 调整负边距 */
    }

    .category-list li {
        width: calc(50% - 10px); /* 调整宽度并考虑间距 */
        padding-right: 0; /* 移除右内边距 */
        margin: 0 5px 10px; /* 调整外边距 */
        border-bottom: 1px dashed #e9ecef;
    }

    .category-list li:nth-child(2n) {
        /* 可选：移除偶数项的右边距 */
    }
}

@media screen and (max-width: 768px) {
    h1 {
        font-size: 2.4rem; /* 调整字体大小 */
        text-align: left;
        margin: 20px 0 15px;
    }

    .article-detail,
    .comment-section,
    .related-articles,
    .sidebar-block,
    .article-list .article-item {
        padding: 20px; /* 调整内边距 */
    }

    .article-footer {
        flex-direction: column;
        align-items: flex-start; /* 左对齐 */
    }

    .article-list .article-item {
        flex-direction: column;
    }

    .article-image {
        width: 100%;
        height: auto; /* 高度自适应 */
        max-height: 200px; /* 限制最大高度 */
        margin-right: 0;
        margin-bottom: 20px; /* 调整下边距 */
    }

    .comment-time {
        margin-left: 0; /* 移除左外边距 */
        margin-top: 5px; /* 增加上边距 */
        width: 100%; /* 占满整行 */
        text-align: left; /* 左对齐 */
    }
}

@media screen and (max-width: 576px) {
    body {
        /* font-size: 1.5rem; */ /* 可选：调整基础字号 */
    }

    .container {
        padding: 0 10px; /* 调整容器内边距 */
    }

    h1 {
        font-size: 2.2rem;
    }

    h2 {
        font-size: 2rem;
    }

    h3 {
        font-size: 1.8rem;
    }

    .article-detail h1 {
        font-size: 2rem;
    }

    .article-list .article-content h3 {
        font-size: 1.7rem;
    }

    .category-list li {
        width: calc(100% - 10px); /* 调整宽度 */
    }

    .comment-item {
        flex-direction: column;
        align-items: flex-start; /* 左对齐 */
    }

    .comment-avatar {
        margin-bottom: 15px; /* 调整下边距 */
    }

    .pagination a,
    .pagination span {
        padding: 8px 12px; /* 调整内边距 */
        margin: 0 3px; /* 调整外边距 */
        font-size: 1.3rem;
    }

    .pagination .prev,
    .pagination .next {
        padding: 8px 10px;
    }
}