/* 文章列表 & 文章详情页样式 */

/* 页面主体 */
.article-page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 25px 15px 90px;
    min-height: calc(100vh - 160px);
}

/* 页面头部 */
.article-page-head {
    text-align: center;
    margin-bottom: 25px;
}

.article-page-head .page-title {
    font-size: 24px;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.article-page-head .page-sub {
    color: var(--text-tertiary);
    font-size: 13px;
}

.article-page-head .page-sub b {
    color: var(--primary-color);
    font-weight: 600;
}

/* 文章列表 */
.article-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.article-card {
    display: flex;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    cursor: pointer;
    text-decoration: none;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.article-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.article-card .card-cover {
    flex-shrink: 0;
    width: 190px;
    min-height: 118px;
    background: var(--bg-secondary);
    overflow: hidden;
}

.article-card .card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.article-card .card-cover .cover-fallback {
    width: 100%;
    height: 100%;
    min-height: 118px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #ff7875, #ff4d4f);
}

.article-card .card-body {
    flex: 1;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.article-card .card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.article-card .card-summary {
    flex: 1;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 8px;
}

.article-card .card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: var(--text-tertiary);
}

.article-card .card-meta .meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.article-card .card-meta .tag-top {
    background: #fff1f0;
    color: var(--primary-color);
    border: 1px solid #ffccc7;
    border-radius: 3px;
    padding: 0 5px;
    font-size: 12px;
    line-height: 18px;
}

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

.article-pagination .page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-fast);
    user-select: none;
}

.article-pagination .page-btn:hover:not(:disabled):not(.active) {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.article-pagination .page-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    cursor: default;
}

.article-pagination .page-btn:disabled {
    color: #ccc;
    background: var(--bg-secondary);
    cursor: not-allowed;
}

.article-pagination .page-ellipsis {
    color: var(--text-tertiary);
    padding: 0 2px;
}

.article-pagination .page-info {
    width: 100%;
    text-align: center;
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-tertiary);
}

/* 骨架屏 / 空状态 */
.article-skeleton {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    gap: 15px;
    box-shadow: var(--shadow-sm);
}

.article-skeleton .sk-cover {
    width: 190px;
    height: 118px;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
}

.article-skeleton .sk-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
    justify-content: center;
}

.article-empty {
    text-align: center;
    padding: 70px 0;
    color: var(--text-tertiary);
}

.article-empty .empty-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 15px;
    border-radius: 50%;
    background: #fff1f0;
    color: var(--primary-color);
    font-size: 26px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sk {
    background: linear-gradient(90deg, #f2f2f2 25%, #e9e9e9 37%, #f2f2f2 63%);
    background-size: 400% 100%;
    animation: skLoading 1.4s ease infinite;
}

.sk-line {
    height: 14px;
    border-radius: 4px;
}

@keyframes skLoading {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

/* 文章详情 */
.article-detail-wrap {
    max-width: 820px;
    margin: 0 auto;
    padding: 25px 15px 90px;
    min-height: calc(100vh - 160px);
}

.article-back {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 15px;
    transition: color var(--transition-fast);
}

.article-back:hover {
    color: var(--primary-color);
}

.article-detail {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 28px 26px;
}

.article-detail .detail-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 14px;
    word-break: break-all;
}

.article-detail .detail-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    padding-bottom: 16px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
    color: var(--text-tertiary);
}

.article-detail .detail-meta .tag-top {
    background: #fff1f0;
    color: var(--primary-color);
    border: 1px solid #ffccc7;
    border-radius: 3px;
    padding: 0 6px;
    font-size: 12px;
    line-height: 20px;
}

/* 正文（支持后台富文本 HTML） */
.article-detail .detail-content {
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1.9;
    word-break: break-word;
}

.article-detail .detail-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 10px auto;
    border-radius: var(--radius-sm);
}

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

.article-detail .detail-content h1,
.article-detail .detail-content h2,
.article-detail .detail-content h3,
.article-detail .detail-content h4 {
    margin: 18px 0 10px;
    line-height: 1.4;
}

.article-detail .detail-content ul,
.article-detail .detail-content ol {
    padding-left: 24px;
    margin-bottom: 12px;
}

.article-detail .detail-content a {
    color: var(--secondary-color);
}

.article-detail .detail-content table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 12px;
}

.article-detail .detail-content table th,
.article-detail .detail-content table td {
    border: 1px solid var(--border-color);
    padding: 8px 10px;
}

.article-detail .detail-content pre {
    background: var(--bg-secondary);
    padding: 12px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin-bottom: 12px;
}

.article-detail .detail-content video {
    max-width: 100%;
}

/* 上一条 / 下一条 */
.article-adjacent {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.article-adjacent .adj-item {
    flex: 1;
    min-width: 0;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 14px 16px;
    text-decoration: none;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.article-adjacent .adj-item:hover:not(.disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.article-adjacent .adj-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 6px;
}

.article-adjacent .adj-item.next {
    text-align: right;
}

.article-adjacent .adj-item.next .adj-label {
    justify-content: flex-end;
}

.article-adjacent .adj-title {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

.article-adjacent .adj-item.disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.article-adjacent .adj-item.disabled .adj-title {
    color: var(--text-tertiary);
    font-weight: 400;
}

/* 加载失败 */
.article-error {
    text-align: center;
    padding: 70px 0;
    color: var(--text-tertiary);
}

/* 响应式 */
@media (max-width: 768px) {
    .article-page-head .page-title {
        font-size: 20px;
    }

    .article-card .card-cover {
        width: 120px;
        min-height: 96px;
    }

    .article-card .card-cover .cover-fallback {
        min-height: 96px;
        font-size: 18px;
    }

    .article-card .card-body {
        padding: 10px 12px;
    }

    .article-card .card-title {
        font-size: 15px;
    }

    .article-card .card-summary {
        -webkit-line-clamp: 1;
        margin-bottom: 4px;
    }

    .article-card .card-meta {
        gap: 8px;
    }

    .article-skeleton .sk-cover {
        width: 120px;
        height: 96px;
    }

    .article-detail {
        padding: 20px 16px;
    }

    .article-detail .detail-title {
        font-size: 19px;
    }

    .article-adjacent {
        flex-direction: column;
    }

    .article-adjacent .adj-item.next {
        text-align: left;
    }

    .article-adjacent .adj-item.next .adj-label {
        justify-content: flex-start;
    }
}
