/* =====================================================================
   文章系统前台样式（复用主题CSS变量，自动适配 default/ocean/forest 等配色）
   ===================================================================== */

/* ---------- 侧边栏小计数与标签云 ---------- */
.art-side-count{margin-left:auto;font-style:normal;font-size:12px;color:var(--text3);background:#f1f2f6;border-radius:10px;padding:1px 8px;line-height:18px}
.sidebar-nav li a:has(.art-side-count){justify-content:flex-start}
.art-tag-cloud{display:flex;flex-wrap:wrap;gap:6px;padding:0 6px}
.art-tag-cloud li{width:auto}
.art-tag-cloud li a{display:inline-block;padding:5px 11px!important;margin:0!important;font-size:13px;background:#f3f4f8;border-radius:14px;color:var(--text2)!important}
.art-tag-cloud li a:hover{background:var(--primary);color:#fff!important}

/* ---------- 面包屑 ---------- */
.art-breadcrumb{padding:4px 2px 16px}

/* ---------- 频道页头 ---------- */
.art-channel-head{background:var(--card);border:1px solid var(--border);border-radius:16px;padding:26px 28px;margin-bottom:22px;position:relative;overflow:hidden}
.art-channel-head h1{font-size:24px;font-weight:700;margin-bottom:8px;color:var(--text)}
.art-channel-head p{font-size:14px;color:var(--text2);line-height:1.7;margin:0}
.art-channel-head .art-search{margin-top:18px;display:flex;max-width:520px}
.art-channel-head .art-search input{flex:1;padding:11px 16px;border:1.5px solid var(--border);border-radius:22px 0 0 22px;outline:none;font-size:14px;background:#fafafa}
.art-channel-head .art-search input:focus{border-color:var(--primary);background:#fff}
.art-channel-head .art-search button{padding:0 24px;border:none;background:var(--primary);color:#fff;border-radius:0 22px 22px 0;font-size:14px;cursor:pointer;white-space:nowrap}
.art-channel-head .art-search button:hover{background:var(--primary2)}

/* ---------- 文章卡片列表 ---------- */
.art-list{display:flex;flex-direction:column;gap:16px}
.art-card{display:flex;gap:18px;background:var(--card);border:1px solid var(--border);border-radius:14px;padding:18px 20px;transition:.2s;position:relative}
.art-card:hover{box-shadow:var(--shadow2);border-color:var(--primary3)}
.art-card-cover{width:200px;height:134px;flex-shrink:0;border-radius:10px;overflow:hidden;background:#f3f4f8;position:relative}
.art-card-cover img{width:100%;height:100%;object-fit:cover;display:block;transition:transform .35s}
.art-card:hover .art-card-cover img{transform:scale(1.05)}
.art-card-cover .art-no-cover{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-size:34px;color:#c4c9d6;background:linear-gradient(135deg,#f6f7fb,#eef0f6)}
.art-card-body{flex:1;min-width:0;display:flex;flex-direction:column}
.art-card-title{font-size:18px;font-weight:700;color:var(--text);line-height:1.45;margin:0 0 8px;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden}
.art-card:hover .art-card-title{color:var(--primary)}
.art-card-title .art-top-flag{display:inline-block;font-size:11px;font-weight:600;color:#fff;background:linear-gradient(135deg,#ff6b6b,#ff8e53);border-radius:4px;padding:1px 6px;margin-right:7px;vertical-align:2px;font-style:normal}
.art-card-meta{display:flex;flex-wrap:wrap;align-items:center;gap:8px 14px;font-size:13px;color:var(--text3);margin-bottom:9px}
.art-card-meta a{color:var(--primary)}
.art-card-meta .art-dot{width:3px;height:3px;border-radius:50%;background:#c4c9d6;display:inline-block}
.art-card-summary{font-size:14px;color:var(--text2);line-height:1.75;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;margin-bottom:10px}
.art-card-tags{margin-top:auto;display:flex;flex-wrap:wrap;gap:8px}
.art-card-tags a{font-size:12px;color:var(--text3);background:#f3f4f8;border-radius:12px;padding:3px 11px}
.art-card-tags a:hover{background:var(--primary);color:#fff}

/* 无封面时标题两行 */
.art-card.no-cover .art-card-title{-webkit-line-clamp:2}

/* 空状态 */
.art-empty{background:var(--card);border:1px dashed var(--border);border-radius:14px;text-align:center;padding:70px 20px;color:var(--text3);font-size:15px}
.art-empty .art-empty-ico{font-size:46px;display:block;margin-bottom:14px;opacity:.65}

/* ---------- 文章详情 ---------- */
.art-detail{background:var(--card);border:1px solid var(--border);border-radius:16px;padding:34px 40px 34px}
.art-detail-head{text-align:center;border-bottom:1px solid var(--border);padding-bottom:24px;margin-bottom:26px}
.art-detail-title{font-size:30px;line-height:1.4;font-weight:700;color:var(--text);margin:0 0 16px;word-break:break-word}
.art-detail-meta{display:flex;flex-wrap:wrap;justify-content:center;gap:6px 16px;font-size:13px;color:var(--text3)}
.art-detail-meta a{color:var(--primary)}
.art-detail-meta span{display:inline-flex;align-items:center;gap:5px}
.art-detail-cover{margin:0 0 26px;text-align:center}
.art-detail-cover img{max-width:100%;border-radius:12px;height:auto;box-shadow:0 6px 24px rgba(0,0,0,.08)}

.art-content{font-size:16px;line-height:1.9;color:#2b2b3a;word-break:break-word}
.art-content p{margin:0 0 18px}
.art-content h2{font-size:22px;font-weight:700;margin:32px 0 16px;padding-left:12px;border-left:4px solid var(--primary);line-height:1.4}
.art-content h3{font-size:19px;font-weight:700;margin:28px 0 14px}
.art-content h4,.art-content h5{font-size:16px;font-weight:700;margin:22px 0 12px}
.art-content a{color:var(--primary);text-decoration:underline;text-underline-offset:3px}
.art-content img{max-width:100%;height:auto;border-radius:8px;display:block;margin:18px auto}
.art-content ul,.art-content ol{margin:0 0 18px;padding-left:28px}
.art-content li{margin-bottom:8px}
.art-content blockquote{margin:0 0 18px;padding:14px 20px;background:#f7f8fb;border-left:4px solid var(--primary);border-radius:0 8px 8px 0;color:var(--text2)}
.art-content blockquote p:last-child{margin-bottom:0}
.art-content pre{background:#1f2430;color:#e6e8ef;padding:16px 18px;border-radius:10px;overflow-x:auto;margin:0 0 18px;font-size:14px;line-height:1.7}
.art-content code{background:#f0f1f6;color:#d6336c;padding:2px 7px;border-radius:5px;font-size:.92em;font-family:Consolas,Monaco,"Courier New",monospace}
.art-content pre code{background:none;color:inherit;padding:0}
.art-content hr{border:none;border-top:1px dashed var(--border);margin:28px 0}
.art-content table{width:100%;border-collapse:collapse;margin:0 0 18px;display:block;overflow-x:auto}
.art-content th,.art-content td{border:1px solid var(--border);padding:9px 13px;font-size:14px}
.art-content th{background:#f7f8fb;font-weight:600}
.art-content figure{margin:0 0 18px;text-align:center}
.art-content figcaption{font-size:13px;color:var(--text3);margin-top:8px}

.art-detail-foot{margin-top:30px;padding-top:22px;border-top:1px solid var(--border);display:flex;flex-wrap:wrap;gap:12px;align-items:center}
.art-detail-tags{display:flex;flex-wrap:wrap;gap:8px;flex:1}
.art-detail-tags a{font-size:13px;background:#f3f4f8;color:var(--text2);border-radius:14px;padding:5px 14px}
.art-detail-tags a:hover{background:var(--primary);color:#fff}
.art-detail-tags .art-tags-label{color:var(--text3);font-size:13px;line-height:30px;margin-right:2px}

.art-pn{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-top:24px}
.art-pn a{display:block;background:var(--card);border:1px solid var(--border);border-radius:10px;padding:13px 18px;font-size:14px;color:var(--text2);transition:.2s;min-width:0}
.art-pn a:hover{border-color:var(--primary3);color:var(--primary)}
.art-pn .art-pn-dir{font-size:12px;color:var(--text3);display:block;margin-bottom:5px}
.art-pn .art-pn-next{text-align:right}
.art-pn span{display:block;background:#fafbfd;border:1px dashed var(--border);border-radius:10px;padding:13px 18px;color:var(--text3);font-size:14px}

/* 相关文章 */
.art-related{background:var(--card);border:1px solid var(--border);border-radius:16px;padding:24px 28px;margin-top:22px}
.art-related h3{font-size:17px;font-weight:700;margin:0 0 16px;display:flex;align-items:center;gap:9px}
.art-related h3::before{content:'';width:4px;height:17px;background:var(--primary);border-radius:2px;display:inline-block}
.art-related-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:6px 26px}
.art-related-grid a{display:flex;align-items:center;gap:9px;padding:9px 6px;font-size:14px;color:var(--text2);border-bottom:1px dashed var(--border);min-width:0}
.art-related-grid a:hover{color:var(--primary)}
.art-related-grid a::before{content:'•';color:var(--primary);flex-shrink:0}
.art-related-grid a span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* 草稿预览提示条 */
.art-preview-tip{background:#fffbe6;border:1px solid #ffe58f;color:#ad6800;border-radius:10px;padding:11px 18px;font-size:13px;margin-bottom:18px;text-align:center}

/* 侧栏热门文章（详情页可挂） */
.art-side-hot{padding:0 12px}
.art-side-hot li{counter-increment:artrank;display:flex;align-items:center;gap:10px;padding:9px 4px;font-size:14px;border-bottom:1px dashed var(--border)}
.art-side-hot li:last-child{border-bottom:none}
.art-side-hot li::before{content:counter(artrank);flex-shrink:0;width:20px;height:20px;border-radius:5px;background:#eef0f6;color:var(--text3);font-size:12px;font-style:normal;display:flex;align-items:center;justify-content:center;font-weight:700}
.art-side-hot li:nth-child(-n+3)::before{background:var(--primary);color:#fff}
.art-side-hot a{flex:1;min-width:0;color:var(--text2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.art-side-hot a:hover{color:var(--primary)}

/* 返回顶部 */
.art-backtop{position:fixed;right:26px;bottom:40px;width:44px;height:44px;border-radius:50%;border:none;background:var(--primary);color:#fff;font-size:20px;cursor:pointer;opacity:0;visibility:hidden;transition:.25s;box-shadow:0 6px 18px rgba(0,0,0,.18);z-index:90}
.art-backtop.show{opacity:1;visibility:visible}
.art-backtop:hover{background:var(--primary2)}

/* ---------- 移动端 ---------- */
@media (max-width:900px){
    .art-related-grid{grid-template-columns:1fr}
    .art-detail{padding:22px 18px}
    .art-detail-title{font-size:22px}
}
@media (max-width:768px){
    .art-channel-head{padding:20px 16px;border-radius:12px}
    .art-channel-head h1{font-size:20px}
    .art-card{flex-direction:column;gap:0;padding:15px;border-radius:12px}
    .art-card-cover{width:100%;height:190px;order:-1;margin-bottom:13px}
    .art-card-title{font-size:17px;-webkit-line-clamp:2}
    .art-card.no-cover .art-card-cover{display:none}
    .art-detail{padding:20px 15px;border-radius:12px}
    .art-detail-title{font-size:20px}
    .art-content{font-size:15px}
    .art-content h2{font-size:19px}
    .art-content h3{font-size:17px}
    .art-pn{grid-template-columns:1fr}
    .art-pn .art-pn-next{text-align:left}
    .art-related{padding:18px 15px}
    .art-backtop{right:16px;bottom:24px;width:40px;height:40px}
}

/* ===== 首页最新文章模块 ===== */
.home-art-list{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:0 30px;
    background:var(--card);
    border:1px solid var(--border);
    border-radius:12px;
    padding:8px 22px;
    list-style:none;
    margin:0;
    box-shadow:var(--shadow2);
}
.home-art-list li a{
    display:flex;
    align-items:center;
    gap:10px;
    padding:13px 4px;
    border-bottom:1px dashed var(--border);
    font-size:14px;
    color:var(--text2);
    min-width:0;
}
.home-art-list li:nth-last-child(-n+2) a{border-bottom:none}
.home-art-list li a:hover{color:var(--primary)}
.home-art-list em{
    flex-shrink:0;
    font-style:normal;
    font-size:12px;
    color:var(--primary);
    background:var(--primary3);
    border-radius:4px;
    padding:1px 7px;
    max-width:110px;
    overflow:hidden;
    white-space:nowrap;
    text-overflow:ellipsis;
}
.home-art-list span{
    flex:1;
    min-width:0;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}
.home-art-list small{
    flex-shrink:0;
    color:var(--text3);
    font-size:12px;
}
@media (max-width:768px){
    .home-art-list{grid-template-columns:1fr;gap:0;padding:8px 16px}
    .home-art-list li:nth-last-child(-n+2) a{border-bottom:1px dashed var(--border)}
    .home-art-list li:last-child a{border-bottom:none}
}

