/* ============================================================
   文章模块 PC 样式 — article.css
   复用现有设计体系：主色 #1E9FFF / var(--hp-primary)，卡片白底 + 圆角 + 悬停阴影
   容器 .w1200（来自 common.css），FontAwesome 图标
   ============================================================ */

:root {
    --art-primary: #1E9FFF;
    --art-primary-dark: #0d8de6;
    --art-border: #e6e6e6;
    --art-text: #333;
    --art-text-light: #888;
    --art-radius: 6px;
}

.art-page {
    padding: 16px 15px 40px;
}

/* ===== 面包屑 ===== */
.art-crumb {
    font-size: 13px;
    color: var(--art-text-light);
    padding: 10px 0 16px;
    line-height: 1.6;
}
.art-crumb a {
    color: var(--art-text-light);
    text-decoration: none;
    transition: color .2s;
}
.art-crumb a:hover { color: var(--art-primary); }
.art-crumb .sep { margin: 0 8px; color: #ccc; }
.art-crumb .cur { color: var(--art-text); }

/* ===== 布局（单模板多样式） ===== */
.art-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}
.art-layout.l-three { grid-template-columns: 220px minmax(0, 1fr) 300px; }
.art-layout.l-left  { grid-template-columns: 220px minmax(0, 1fr); }
.art-layout.l-right { grid-template-columns: minmax(0, 1fr) 300px; }
.art-layout.l-full  { grid-template-columns: minmax(0, 1fr); }
/* 单栏详情阅读宽度居中 */
.art-layout.l-full .art-detail { max-width: 860px; margin: 0 auto; }

/* ===== 通用面板 ===== */
.art-panel {
    background: #fff;
    border: 1px solid var(--art-border);
    border-radius: var(--art-radius);
    margin-bottom: 16px;
    overflow: hidden;
}
.art-panel-title {
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 600;
    color: var(--art-text);
    border-bottom: 1px solid var(--art-border);
    border-left: 4px solid var(--art-primary);
    background: #fafcff;
}
.art-panel-title i { color: var(--art-primary); margin-right: 6px; }
.art-panel-body { padding: 10px 16px 14px; }

/* ===== 栏目树 ===== */
.art-cat-tree { list-style: none; margin: 0; padding: 0; }
.art-cat-tree li { margin: 0; }
.art-cat-tree a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    font-size: 14px;
    color: var(--art-text);
    text-decoration: none;
    border-radius: 4px;
    transition: all .2s;
}
.art-cat-tree a:hover { background: #f2f8ff; color: var(--art-primary); }
.art-cat-tree a.active {
    background: var(--art-primary);
    color: #fff;
    font-weight: 600;
}
.art-cat-tree a.active .cnt { background: rgba(255,255,255,.25); color: #fff; }
.art-cat-tree .cnt {
    font-size: 12px;
    color: var(--art-text-light);
    background: #f0f2f5;
    border-radius: 10px;
    padding: 0 8px;
    line-height: 18px;
}
.art-cat-tree .art-cat-tree { margin-left: 12px; border-left: 1px dashed #e0e0e0; padding-left: 4px; }
.art-cat-tree .art-cat-tree a { font-size: 13px; padding: 6px 10px; }

/* ===== 列表标题条 ===== */
.art-list-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    font-size: 17px;
    font-weight: 600;
    color: var(--art-text);
    background: #fff;
    border: 1px solid var(--art-border);
    border-left: 4px solid var(--art-primary);
    border-radius: var(--art-radius);
    margin-bottom: 16px;
}
.art-list-count { font-size: 13px; font-weight: 400; color: var(--art-text-light); }

/* ===== 文章列表 ===== */
.art-list { display: flex; flex-direction: column; gap: 14px; }
.art-item {
    display: flex;
    gap: 16px;
    background: #fff;
    border: 1px solid var(--art-border);
    border-radius: var(--art-radius);
    padding: 16px;
    transition: box-shadow .25s, transform .25s;
}
.art-item:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.1);
    transform: translateY(-2px);
}
.art-item-thumb {
    flex: 0 0 200px;
    width: 200px;
    height: 130px;
    position: relative;
    overflow: hidden;
    border-radius: 4px;
}
.art-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s;
}
.art-item:hover .art-item-thumb img { transform: scale(1.05); }
.art-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.art-item-title {
    font-size: 17px;
    font-weight: 600;
    margin: 0 0 8px;
    line-height: 1.5;
}
.art-item-title a { color: var(--art-text); text-decoration: none; transition: color .2s; }
.art-item-title a:hover { color: var(--art-primary); }
.art-item-summary {
    font-size: 14px;
    color: #666;
    line-height: 1.7;
    margin: 0 0 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.art-item-meta {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 12px;
    color: var(--art-text-light);
}
.art-item-meta a { color: var(--art-text-light); text-decoration: none; }
.art-item-meta a:hover { color: var(--art-primary); }
.art-item-meta i { margin-right: 4px; }

/* 标记徽章 */
.art-flag {
    display: inline-block;
    font-size: 11px;
    line-height: 16px;
    padding: 0 6px;
    border-radius: 3px;
    margin-right: 6px;
    vertical-align: middle;
    color: #fff;
    font-weight: 400;
}
.art-flag.flag-top { background: #ff5722; }
.art-flag.flag-hot { background: #ff9800; }
.art-flag.flag-rec { background: #22c55e; }
.art-item-thumb .art-flag { position: absolute; left: 0; top: 0; margin: 0; border-radius: 0 0 4px 0; }

/* ===== 图文栅格列表（一行 3 卡） ===== */
.art-list.is-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.art-list.is-grid .art-item { flex-direction: column; gap: 0; padding: 0; overflow: hidden; }
.art-list.is-grid .art-item-thumb { flex: none; width: 100%; height: 160px; border-radius: 0; }
.art-list.is-grid .art-item-body { padding: 12px 14px 14px; }
.art-list.is-grid .art-item-summary { -webkit-line-clamp: 2; }
.art-thumb-empty {
    background: linear-gradient(135deg, #f2f6fb, #e8eef5);
    display: flex; align-items: center; justify-content: center;
}

/* ===== 分页 ===== */
.art-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 24px;
}
.art-pager a, .art-pager .current {
    padding: 7px 16px;
    border: 1px solid var(--art-border);
    border-radius: 4px;
    font-size: 14px;
    color: var(--art-text);
    text-decoration: none;
    background: #fff;
    transition: all .2s;
}
.art-pager a:hover { border-color: var(--art-primary); color: var(--art-primary); }
.art-pager .current { background: var(--art-primary); border-color: var(--art-primary); color: #fff; }

/* ===== 空状态 ===== */
.art-empty {
    text-align: center;
    color: #bbb;
    padding: 70px 0;
    background: #fff;
    border: 1px solid var(--art-border);
    border-radius: var(--art-radius);
}
.art-empty i { font-size: 48px; display: block; margin-bottom: 12px; }
.art-empty-sm { text-align: center; color: #bbb; padding: 20px 0; font-size: 13px; }

/* ===== 右侧排行榜 / 推荐 ===== */
.art-rank { list-style: none; margin: 0; padding: 0; }
.art-rank li { margin-bottom: 10px; }
.art-rank a {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 14px;
    color: var(--art-text);
    text-decoration: none;
    line-height: 1.5;
    transition: color .2s;
}
.art-rank a:hover { color: var(--art-primary); }
.rank-idx {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    font-size: 12px;
    border-radius: 4px;
    background: #eef1f5;
    color: #909399;
}
.rank-idx.top { background: var(--art-primary); color: #fff; }
.art-rec-list { list-style: none; margin: 0; padding: 0; }
.art-rec-list li {
    padding: 8px 0;
    border-bottom: 1px dashed #eee;
    display: flex;
    flex-direction: column;
}
.art-rec-list li:last-child { border-bottom: none; }
.art-rec-list a {
    font-size: 14px;
    color: var(--art-text);
    text-decoration: none;
    line-height: 1.5;
    transition: color .2s;
}
.art-rec-list a:hover { color: var(--art-primary); }
.art-rec-list .date { font-size: 12px; color: #bbb; margin-top: 3px; }

/* ============================================================
   文章详情页
   ============================================================ */
.art-detail {
    background: #fff;
    border: 1px solid var(--art-border);
    border-radius: var(--art-radius);
    padding: 25px 15px;
}
.art-detail-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--art-text);
    line-height: 1.5;
    margin: 0 0 16px;
    text-align: center;
}
.art-detail-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 18px;
    font-size: 13px;
    color: var(--art-text-light);
    padding-bottom: 18px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 20px;
}
.art-detail-meta a { color: var(--art-text-light); text-decoration: none; }
.art-detail-meta a:hover { color: var(--art-primary); }
.art-detail-meta i { margin-right: 4px; }
.art-detail-summary {
    background: #f7fafd;
    border-left: 3px solid var(--art-primary);
    padding: 12px 16px;
    font-size: 14px;
    color: #666;
    line-height: 1.8;
    border-radius: 0 4px 4px 0;
    margin-bottom: 20px;
}

/* AI 摘要 */
.art-ai-summary {
    background: linear-gradient(135deg, #f5f9ff, #eef4ff);
    border: 1px solid #dbe7ff;
    border-radius: var(--art-radius);
    padding: 16px 18px;
    margin-bottom: 22px;
}
.art-ai-head {
    font-size: 14px;
    font-weight: 600;
    color: var(--art-primary);
    margin-bottom: 8px;
}
.art-ai-body { font-size: 14px; color: #555; line-height: 1.85; white-space: pre-wrap; }

/* 正文 */
.art-detail-content { font-size: 15px; color: #444; line-height: 1.9; }
.art-detail-content .md-view img { max-width: 100%; height: auto; border-radius: 4px; }

/* FAQ */
.art-faq { margin-top: 28px; border-top: 1px solid #f0f0f0; padding-top: 20px; }
.art-faq-title { font-size: 17px; font-weight: 600; color: var(--art-text); margin-bottom: 14px; }
.art-faq-title i { color: var(--art-primary); margin-right: 6px; }
.art-faq-item { margin-bottom: 14px; }
.art-faq-q { font-size: 15px; font-weight: 600; color: var(--art-text); margin-bottom: 6px; }
.art-faq-a {
    font-size: 14px;
    color: #666;
    line-height: 1.8;
    background: #fafafa;
    border-radius: 4px;
    padding: 10px 14px;
}

/* 标签区 */
.art-tags {
    margin-top: 26px;
    padding-top: 18px;
    border-top: 1px solid #f0f0f0;
    font-size: 14px;
    color: var(--art-text-light);
}
.art-tags > i { margin-right: 8px; color: var(--art-primary); }
.art-tag {
    display: inline-block;
    padding: 4px 14px;
    margin: 4px 8px 4px 0;
    font-size: 13px;
    color: var(--art-primary);
    background: #eef6ff;
    border: 1px solid #cfe6ff;
    border-radius: 20px;
    text-decoration: none;
    transition: all .2s;
}
.art-tag:hover { background: var(--art-primary); color: #fff; border-color: var(--art-primary); }

/* 上一篇/下一篇 */
.art-pn {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid #f0f0f0;
}
.art-pn-item {
    font-size: 14px;
    color: var(--art-text);
    text-decoration: none;
    transition: color .2s;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.art-pn-item:hover { color: var(--art-primary); }
.art-pn-item.disabled { color: #ccc; }

/* 相关文章 */
.art-related { margin-top: 26px; }
.art-related-title { font-size: 17px; font-weight: 600; color: var(--art-text); margin-bottom: 12px; }
.art-related-title i { color: var(--art-primary); margin-right: 6px; }
.art-related-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 24px; }
.art-related-list li { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px dashed #eee; }
.art-related-list a {
    flex: 1; min-width: 0;
    font-size: 14px; color: var(--art-text); text-decoration: none; transition: color .2s;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.art-related-list a:hover { color: var(--art-primary); }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 1200px) {
    .art-layout.l-three { grid-template-columns: 200px minmax(0, 1fr); }
    .art-layout.l-three .art-sidebar-right,
    .art-layout.l-right .art-sidebar-right { display: none; }
    .art-layout.l-right { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 992px) {
    .art-layout.l-three,
    .art-layout.l-left { grid-template-columns: minmax(0, 1fr); }
    .art-sidebar-left { display: none; }
    .art-list.is-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .art-detail { padding: 24px 20px; }
    .art-detail-title { font-size: 22px; }
}
@media (max-width: 768px) {
    .art-item { flex-direction: column; }
    .art-item-thumb { flex: none; width: 100%; height: 180px; }
    .art-related-list { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 576px) {
    .art-list.is-grid { grid-template-columns: minmax(0, 1fr); }
    .art-detail { padding: 18px 14px; }
    .art-detail-title { font-size: 19px; }
    .art-detail-meta { gap: 10px; font-size: 12px; }
}
