/* 文章页面专用样式 - 修复走形问题 */

/* 文章容器 */
.article-section {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 25px;
    border: 1px solid #f0e9d8;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
    padding: 0;
}

/* 面包屑导航 */
.breadcrumb {
    padding: 12px 15px;
    background-color: #fcf8ef;
    border-bottom: 1px solid #f0e9d8;
    margin-bottom: 0;
    border-radius: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.breadcrumb a,
.breadcrumb span {
    margin: 0 5px;
    color: #845314;
    font-size: 14px;
}

.breadcrumb a:hover {
    color: #c45e1b;
}

.breadcrumb i {
    margin-right: 5px;
}

.breadcrumb .separator {
    color: #ccc;
}

/* 文章内容 */
.article-content {
    padding: 0 20px 20px;
}

.article-header {
    margin: 20px 0;
    padding-bottom: 15px;
    border-bottom: 1px dashed #f0e9d8;
}

h1.article-title {
    font-size: 24px;
    color: #5a2508;
    margin-bottom: 15px;
    line-height: 1.4;
    font-weight: bold;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    color: #999;
    font-size: 14px;
}

.article-meta span {
    display: flex;
    align-items: center;
}

.article-meta i {
    margin-right: 5px;
}

.article-summary {
    background-color: #fcf8ef;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #f0e9d8;
    font-size: 15px;
    color: #845314;
    line-height: 1.6;
}

.article-text {
    line-height: 1.8;
    font-size: 16px;
    color: #333;
    margin-bottom: 30px;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* 修复文章内容中的图片和表格 */
.article-text img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
    margin: 15px auto;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.article-text table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    border: 1px solid #f0e9d8;
}

.article-text table th,
.article-text table td {
    padding: 10px;
    border: 1px solid #f0e9d8;
}

.article-text table th {
    background-color: #fcf8ef;
    color: #5a2508;
    font-weight: bold;
}

/* 文章分页 */
.article-pages {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    padding-top: 20px;
    border-top: 1px dashed #f0e9d8;
}

.article-pages a,
.article-pages span {
    display: inline-block;
    padding: 5px 12px;
    margin: 0 3px;
    border-radius: 4px;
    background-color: #fcf8ef;
    color: #845314;
    border: 1px solid #f0e9d8;
    transition: all 0.3s ease;
}

.article-pages a:hover,
.article-pages span.current {
    background-color: #c45e1b;
    color: #fff;
    border-color: #c45e1b;
}

/* 上下篇导航 */
.article-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px dashed #f0e9d8;
}

.pagination-item {
    flex: 0 0 calc(50% - 10px);
    max-width: calc(50% - 10px);
    background-color: #fcf8ef;
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid #f0e9d8;
    transition: all 0.3s ease;
}

.pagination-item:hover {
    background-color: #f3e3c0;
}

.pagination-label {
    color: #845314;
    font-size: 14px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
}

.pagination-label i {
    margin-right: 5px;
}

.next .pagination-label i {
    margin-left: 5px;
    margin-right: 0;
}

.pagination-title {
    font-size: 14px;
    color: #5a2508;
}

/* 相关文章 */
.related-section,
.hot-recommend-section {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 25px;
    border: 1px solid #f0e9d8;
    overflow: hidden;
}

.section-header {
    padding: 15px;
    border-bottom: 1px solid #f0e9d8;
    background-color: #fcf8ef;
}

.section-header h2 {
    font-size: 18px;
    color: #5a2508;
    margin: 0;
    display: flex;
    align-items: center;
}

.section-header h2 i {
    margin-right: 8px;
    color: #c45e1b;
}

.related-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    padding: 15px;
}

.related-item {
    background-color: #fcf8ef;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #f0e9d8;
    transition: all 0.3s ease;
}

.related-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.related-image {
    height: 120px;
    overflow: hidden;
}

.related-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.related-item:hover .related-image img {
    transform: scale(1.05);
}

.related-info {
    padding: 10px;
}

.related-info.no-thumb {
    padding: 15px;
}

.related-title {
    font-size: 14px;
    color: #5a2508;
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: #999;
    font-size: 12px;
}

.related-meta span {
    display: flex;
    align-items: center;
}

.related-meta i {
    margin-right: 3px;
}

/* 热门推荐 */
.article-list-compact {
    padding: 15px;
}

.list-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #f0e9d8;
}

.list-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.list-link {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.list-thumb {
    flex: 0 0 100px;
    width: 100px;
    height: 70px;
    overflow: hidden;
    border-radius: 4px;
}

.list-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.list-item:hover .list-thumb img {
    transform: scale(1.05);
}

.list-info {
    flex: 1;
    min-width: 0;
}

.list-title {
    font-size: 15px;
    color: #5a2508;
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.list-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: #999;
    font-size: 12px;
}

.list-meta span {
    display: flex;
    align-items: center;
}

.list-meta i {
    margin-right: 3px;
}

/* 阅读权限提示 */
.read-permission {
    background-color: #fcf8ef;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid #f0e9d8;
    text-align: center;
}

.permission-tips {
    margin-bottom: 15px;
}

.btn-pay {
    display: inline-block;
    padding: 8px 20px;
    background-color: #c45e1b;
    color: #fff;
    border-radius: 30px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn-pay:hover {
    background-color: #a34d16;
    color: #fff;
}

/* 修复内容宽度问题 */
.content-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.content-main {
    flex: 1;
    min-width: 0;
    max-width: 100%;
}

.side-content {
    width: 300px;
    flex-shrink: 0;
}

/* 响应式调整 */
@media (max-width: 992px) {
    .content-wrapper {
        flex-direction: column;
    }

    .side-content {
        width: 100%;
    }

    .related-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {

    .article-pagination {
        flex-direction: column;
    }

    .pagination-item {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .related-list {
        grid-template-columns: 1fr;
    }

    .list-link {
        flex-wrap: wrap;
    }

    .list-thumb {
        flex: 0 0 100%;
        width: 100%;
        height: 150px;
        margin-bottom: 10px;
    }

    h1.article-title {
        font-size: 20px;
    }
}

/* 全局修复样式 */
* {
    box-sizing: border-box;
}

img {
    max-width: 100%;
    height: auto;
}

/* 修复移动端边距 */
@media (max-width: 576px) {
    .article-content {
        padding: 0 15px 15px;
    }
    .article-pagination {
        gap: 10px;
    }

    .related-list,
    .article-list-compact {
        padding: 10px;
    }
}