/**
 * 文章模块样式
 */

/* 文章列表布局 */
.article-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
    padding: 40px 0;
}

/* 文章列表项 */
.article-item {
    display: flex;
    gap: 24px;
    padding: 24px 0;
    border-bottom: 1px solid #e2e8f0;
    transition: all 0.3s;
}

.article-item:hover {
    transform: translateY(-2px);
}

.article-cover {
    flex-shrink: 0;
    width: 240px;
    height: 160px;
    border-radius: 12px;
    overflow: hidden;
}

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

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

.article-info {
    flex: 1;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 13px;
}

.article-category a {
    color: #4361ee;
    text-decoration: none;
    font-weight: 500;
}

.article-date, .article-views {
    color: #94a3b8;
}

.article-title {
    margin: 0 0 12px;
    font-size: 20px;
    font-weight: 600;
}

.article-title a {
    color: #1e293b;
    text-decoration: none;
    transition: color 0.2s;
}

.article-title a:hover {
    color: #4361ee;
}

.article-summary {
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 16px;
}

.article-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.article-author {
    display: flex;
    align-items: center;
    gap: 8px;
}

.article-author img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.article-author span {
    font-size: 13px;
    color: #64748b;
}

.article-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tag {
    font-size: 12px;
    color: #64748b;
    text-decoration: none;
    transition: color 0.2s;
}

.tag:hover {
    color: #4361ee;
}

/* 侧边栏 */
.sidebar-widget {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.sidebar-widget h3 {
    margin: 0 0 16px;
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
}

/* 搜索框 */
.search-widget form {
    display: flex;
    gap: 8px;
}

.search-widget input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
}

.search-widget button {
    padding: 10px 16px;
    background: #4361ee;
    border: none;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
}

/* 分类列表 */
.categories-widget ul,
.archives-widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.categories-widget li,
.archives-widget li {
    margin-bottom: 10px;
}

.categories-widget a,
.archives-widget a {
    display: flex;
    justify-content: space-between;
    color: #475569;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.categories-widget a:hover,
.archives-widget a:hover {
    color: #4361ee;
}

.count {
    color: #94a3b8;
    font-size: 12px;
}

/* 热门文章 */
.hot-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hot-list li {
    margin-bottom: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
}

.hot-list a {
    display: flex;
    justify-content: space-between;
    text-decoration: none;
}

.hot-title {
    color: #475569;
    font-size: 14px;
    transition: color 0.2s;
}

.hot-title:hover {
    color: #4361ee;
}

.hot-views {
    color: #94a3b8;
    font-size: 12px;
}

/* 标签云 */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag-cloud-item {
    color: #475569;
    text-decoration: none;
    transition: color 0.2s;
}

.tag-cloud-item:hover {
    color: #4361ee;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.pagination a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #475569;
    text-decoration: none;
    transition: all 0.2s;
}

.pagination a:hover,
.pagination a.active {
    background: #4361ee;
    border-color: #4361ee;
    color: #fff;
}

/* 文章详情页 */
.article-detail-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
    padding: 40px 0;
}

.detail-article {
    background: #fff;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.article-header {
    text-align: center;
    margin-bottom: 32px;
}

.article-header .article-meta {
    justify-content: center;
    margin-bottom: 20px;
}

.article-header .article-title {
    font-size: 32px;
    margin-bottom: 24px;
    line-height: 1.3;
}

.article-author-info {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    background: #f8fafc;
    border-radius: 40px;
}

.article-author-info img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.author-detail {
    text-align: left;
}

.author-name {
    display: block;
    font-weight: 600;
    color: #1e293b;
}

.author-bio {
    font-size: 12px;
    color: #94a3b8;
}

.article-cover-full {
    margin: 24px -40px;
    border-radius: 0;
    overflow: hidden;
}

.article-cover-full img {
    width: 100%;
    height: auto;
}

.article-content {
    line-height: 1.8;
    font-size: 16px;
    color: #334155;
}

.article-content h1,
.article-content h2,
.article-content h3 {
    margin: 32px 0 16px;
    color: #1e293b;
}

.article-content p {
    margin-bottom: 20px;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.article-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
}

.article-content code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 14px;
}

.article-footer-bar {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid #e2e8f0;
}

.article-tags-section {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.tags-label {
    font-weight: 500;
    color: #475569;
}

.article-actions {
    display: flex;
    gap: 16px;
}

.action-btn {
    padding: 8px 20px;
    background: #f1f5f9;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    background: #e2e8f0;
}

/* ============================================
   文章导航 - 优化版（两行布局）
   ============================================ */
.article-navigation {
    background: #f8fafc;
    border-radius: 16px;
    padding: 24px;
    margin: 32px 0;
}

.nav-row {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.nav-item {
    flex: 1;
    min-width: 0;
}

.nav-prev {
    text-align: left;
}

.nav-next {
    text-align: right;
}

.nav-label {
    display: block;
    font-size: 13px;
    color: #94a3b8;
    margin-bottom: 8px;
}

.nav-title {
    display: block;
    font-size: 15px;
    font-weight: 500;
    color: #1e293b;
    text-decoration: none;
    line-height: 1.4;
    word-wrap: break-word;
    transition: color 0.2s;
}

.nav-title:hover {
    color: #4361ee;
}

.nav-item.disabled .nav-title {
    color: #cbd5e1;
}

.nav-return {
    text-align: center;
}

.return-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 24px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 30px;
    color: #475569;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.return-btn:hover {
    background: #4361ee;
    border-color: #4361ee;
    color: #fff;
}

/* 评论区域 */
.comments-section {
    background: #fff;
    border-radius: 16px;
    padding: 40px;
    margin-top: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.comments-section h3 {
    margin: 0 0 24px;
    font-size: 20px;
    color: #1e293b;
}

.comment-form {
    margin-bottom: 32px;
}

.comment-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    resize: vertical;
}

.comment-form textarea:focus {
    outline: none;
    border-color: #4361ee;
}

.btn-submit {
    margin-top: 12px;
    padding: 10px 24px;
    background: #4361ee;
    border: none;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
}

.comment-login-tip {
    background: #f1f5f9;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 24px;
}

.comment-item {
    display: flex;
    gap: 16px;
    padding: 20px 0;
    border-bottom: 1px solid #f1f5f9;
}

.comment-avatar img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.comment-body {
    flex: 1;
}

.comment-header {
    margin-bottom: 8px;
}

.comment-author {
    font-weight: 600;
    color: #1e293b;
    margin-right: 12px;
}

.comment-time {
    font-size: 12px;
    color: #94a3b8;
}

.comment-content {
    margin-bottom: 12px;
    line-height: 1.6;
}

.comment-actions button {
    padding: 4px 12px;
    background: #f1f5f9;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}

.comment-replies {
    margin-top: 16px;
    padding-left: 24px;
    border-left: 2px solid #e2e8f0;
}

.reply-item {
    display: flex;
    gap: 12px;
    margin-top: 12px;
    padding: 12px 0;
}

.reply-avatar img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.reply-body {
    flex: 1;
}

.reply-author {
    font-weight: 500;
    font-size: 13px;
    margin-right: 8px;
}

.reply-time {
    font-size: 11px;
    color: #94a3b8;
}

.reply-content {
    margin-top: 6px;
    font-size: 13px;
}

.comment-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

/* 响应式 */
@media (max-width: 768px) {
    .article-layout,
    .article-detail-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .article-item {
        flex-direction: column;
    }
    
    .article-cover {
        width: 100%;
        height: 180px;
    }
    
    .detail-article,
    .comments-section {
        padding: 20px;
    }
    
    .article-header .article-title {
        font-size: 24px;
    }
    
    /* 移动端导航优化 */
    .nav-row {
        flex-direction: column;
        gap: 16px;
    }
    
    .nav-next {
        text-align: left;
    }
    
    .nav-return {
        margin-top: 8px;
    }
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.empty-state h3 {
    margin: 0 0 10px;
    color: #475569;
}

.empty-state p {
    color: #94a3b8;
}

/* ============================================
   推荐阅读样式
   ============================================ */
.recommend-widget .recommend-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.recommend-widget .recommend-list li {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

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

.recommend-widget .recommend-list a {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    text-decoration: none;
}

.recommend-widget .rec-title {
    flex: 1;
    font-size: 14px;
    color: #475569;
    line-height: 1.5;
    transition: color 0.2s;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recommend-widget .rec-title:hover {
    color: #4361ee;
}

.recommend-widget .rec-views {
    flex-shrink: 0;
    font-size: 12px;
    color: #94a3b8;
    white-space: nowrap;
    line-height: 1.5;
}