/* =============================================
   文章页面样式
   ============================================= */

/* ===== 列表页 ===== */
.art-page {
    padding-top: 40px;
    padding-bottom: 72px;
}

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

.art-page-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 8px;
}

.art-page-sub {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
}

/* 分类标签 */
.art-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 32px;
}

.art-cat-btn {
    padding: 6px 16px;
    border-radius: 20px;
    border: 1.5px solid var(--border);
    font-size: 13px;
    color: var(--text-muted);
    background: var(--white);
    transition: border-color .15s, color .15s, background .15s;
}

.art-cat-btn:hover, .art-cat-btn.active {
    border-color: var(--primary);
    color: var(--primary);
    background: #eff6ff;
}

/* 文章网格 */
.art-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

/* 文章卡片 */
.art-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .2s, box-shadow .2s, border-color .2s;
}

.art-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 32px rgba(0,0,0,.09);
    border-color: #c7d2fe;
}

.art-card-cover {
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #f1f5f9;
}

.art-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}

.art-card:hover .art-card-cover img { transform: scale(1.04); }

.art-card-body {
    padding: 18px 20px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.art-card-cat {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: var(--primary);
    background: #eff6ff;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 10px;
    letter-spacing: .3px;
}

.art-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 10px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.art-card-summary {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.7;
    margin: 0 0 14px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.art-card-meta {
    display: flex;
    gap: 14px;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: auto;
}

.art-card-meta i { margin-right: 4px; }

/* 分页 */
.art-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 40px;
}

.art-page-btn {
    padding: 8px 20px;
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text);
    transition: border-color .15s, color .15s;
}

.art-page-btn:hover { border-color: var(--primary); color: var(--primary); }
.art-page-info { font-size: 13px; color: var(--text-muted); }

/* 空状态 */
.art-empty {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.art-empty i { font-size: 52px; opacity: .25; display: block; margin-bottom: 16px; }
.art-empty p { font-size: 15px; margin: 0; }

/* ===== 详情页 ===== */
.art-detail-wrap {
    padding-top: 32px;
    padding-bottom: 72px;
}

/* 面包屑 */
.art-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 28px;
}

.art-breadcrumb a { color: var(--text-muted); transition: color .15s; }
.art-breadcrumb a:hover { color: var(--primary); }
.art-breadcrumb i { font-size: 10px; opacity: .5; }

/* 详情布局：正文 + 侧边 */
.art-detail-layout {
    display: grid;
    grid-template-columns: 1fr 240px;
    gap: 28px;
    align-items: start;
}

/* 正文主体 */
.art-detail-main {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
}

.art-detail-header {
    padding: 32px 36px 24px;
    border-bottom: 1px solid var(--border);
}

.art-detail-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin: 10px 0 14px;
    line-height: 1.4;
}

.art-detail-meta {
    display: flex;
    gap: 18px;
    font-size: 13px;
    color: var(--text-muted);
}

.art-detail-meta i { margin-right: 4px; }

.art-detail-cover {
    aspect-ratio: 21/9;
    overflow: hidden;
    background: #f1f5f9;
}

.art-detail-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 正文内容 */
.art-detail-content {
    padding: 32px 36px 36px;
    font-size: 15px;
    line-height: 1.9;
    color: var(--text);
}

.art-detail-content h1,
.art-detail-content h2,
.art-detail-content h3 {
    margin: 28px 0 14px;
    font-weight: 600;
    line-height: 1.4;
}

.art-detail-content h1 { font-size: 22px; }
.art-detail-content h2 { font-size: 19px; }
.art-detail-content h3 { font-size: 16px; }

.art-detail-content p { margin: 0 0 16px; }

.art-detail-content img {
    max-width: 100%;
    border-radius: 8px;
    margin: 12px 0;
}

.art-detail-content a { color: var(--primary); text-decoration: underline; }

.art-detail-content blockquote {
    margin: 16px 0;
    padding: 12px 16px;
    border-left: 3px solid var(--primary);
    background: #f8fafc;
    border-radius: 0 6px 6px 0;
    color: var(--text-muted);
}

.art-detail-content ul, .art-detail-content ol {
    padding-left: 24px;
    margin: 0 0 16px;
}

.art-detail-content li { margin-bottom: 6px; }

.art-detail-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 16px 20px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 13px;
    margin: 16px 0;
}

.art-detail-content code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    color: #e53e3e;
}

.art-detail-content pre code { background: none; color: inherit; padding: 0; }

/* 侧边栏 */
.art-detail-side {
    position: sticky;
    top: calc(var(--header-height) + 16px);
}

.art-side-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
}

.art-side-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 14px;
}

.art-side-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--text);
    transition: background .12s, color .12s;
    margin-bottom: 4px;
}

.art-side-link:hover { background: #eff6ff; color: var(--primary); }
.art-side-link i { width: 16px; text-align: center; color: var(--text-muted); font-size: 13px; }
.art-side-link:hover i { color: var(--primary); }

/* 返回按钮 */
.art-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 20px;
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text);
    transition: border-color .15s, color .15s;
}

.art-back-btn:hover { border-color: var(--primary); color: var(--primary); }

/* ===== 响应式 ===== */
@media (max-width: 960px) {
    .art-grid { grid-template-columns: repeat(2, 1fr); }
    .art-detail-layout { grid-template-columns: 1fr; }
    .art-detail-side { position: static; }
}

@media (max-width: 640px) {
    .art-page { padding-top: 24px; }
    .art-grid { grid-template-columns: 1fr; gap: 14px; }
    .art-detail-header { padding: 20px; }
    .art-detail-title { font-size: 20px; }
    .art-detail-content { padding: 20px; font-size: 14px; }
}
