/*
 * Template Name: Sanlancms
 * Author: yangzeye
 * Copyright: olzz.com
 * Contact: QQ 350379853 | WeChat 19146748887
 * Website: https://www.sanlancms.com
 */
:root {
    --w-left: 300px;
    --w-right: 240px;
    --gap: 24px;
    --brand: #3b6ef5;
    --brand-d: #2f59d6;
    --text: #1f2430;
    --text-2: #5b6274;
    --text-3: #8a90a0;
    --line: #eceef3;
    --bg: #f4f6fa;
    --card: #ffffff;
    --radius: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font: 14px/1.8 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    color: var(--text);
    background: var(--bg);
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-d); }
img { max-width: 100%; }

/* ---------------- 导航 ---------------- */
.nav {
    background: #5b4fd1;
    position: sticky; top: 0; z-index: 50;
}
.nav-inner {
    display: flex; align-items: center;
    max-width: 1360px; margin: 0 auto; height: 56px;
    overflow-x: auto; scrollbar-width: none;
}
.nav-inner::-webkit-scrollbar { display: none; }
.nav .logo {
    font-size: 18px; font-weight: 700; color: #fff;
    padding: 0 22px; white-space: nowrap; letter-spacing: .5px;
}
.nav .logo:hover { opacity: .88; }
.nav-item {
    display: inline-flex; align-items: center; height: 56px;
    padding: 0 18px; color: rgba(255,255,255,.82); white-space: nowrap;
    font-size: 14.5px; border-bottom: 2px solid transparent;
}
.nav-item:hover { color: #fff; }
.nav-item.active {
    color: #fff;
    background: rgba(255,255,255,.14);
    border-bottom-color: #fff;
    font-weight: 600;
}

/* ---------------- 全站搜索条（右栏顶部）---------------- */
.rb-search { padding: 0 !important; background: transparent !important; border: none !important; }
.rb-search form {
    display: flex; gap: 0; margin: 0;
    border: 1px solid var(--line); border-radius: 8px;
    overflow: hidden; background: #fff;
}
.rb-search input {
    flex: 1; min-width: 0; height: 38px; border: none; border-radius: 0;
    padding: 0 12px; font-size: 13px; outline: none;
}
.rb-search input:focus { outline: none; }
.rb-search button {
    height: 38px; padding: 0 16px; border: none; border-radius: 0; cursor: pointer;
    background: var(--brand); color: #fff; font-size: 13px; font-weight: 500;
    white-space: nowrap; flex-shrink: 0;
}
.rb-search button:hover { background: var(--brand-d); }

/* ---------------- 三栏布局 ---------------- */
.layout {
    display: flex; gap: var(--gap); align-items: flex-start;
    max-width: 1360px; margin: 24px auto; padding: 0;
}
.leftbar  { width: var(--w-left);  flex: 0 0 var(--w-left);  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.center   { flex: 1 1 auto; min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 36px; }
.rightbar { width: var(--w-right); flex: 0 0 var(--w-right); display: flex; flex-direction: column; gap: var(--gap); }

/* ---------------- 左栏 ---------------- */
.lb-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.lb-title { font-size: 16px; font-weight: 700; color: var(--text); }
.lb-toggle-all {
    border: 1px solid var(--line); background: #f7f9fc; color: var(--text-2);
    border-radius: 6px; padding: 4px 10px; font-size: 12.5px; cursor: pointer;
}
.lb-toggle-all:hover { color: var(--brand); border-color: var(--brand); }
.lb-search { padding: 12px 16px; }
.lb-search input {
    width: 100%; height: 36px; border: 1px solid var(--line); border-radius: 8px;
    padding: 0 12px; font-size: 13px; outline: none;
}
.lb-search input:focus { border-color: var(--brand); }
.lb-list { padding: 0 8px 12px; max-height: none; }   /* 不加内部小滚动条，随整页滚动 */
.l2-group { border-top: 1px solid var(--line); }
.l2-group:first-child { border-top: none; }
.l2-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 10px;
}
.l2-name {
    font-weight: 600; color: var(--text); font-size: 14px;
    cursor: pointer; border-radius: 4px; padding: 2px 6px; margin: -2px -6px;
}
.l2-name:hover { color: var(--brand); background: #f0f3ff; }
.l2-arrow {
    font-size: 24px; line-height: 1;
    color: var(--text-3);
    flex-shrink: 0;
    cursor: pointer; padding: 4px 8px; margin: -4px -6px;
    border-radius: 6px; user-select: none;
    transition: color .15s, background-color .15s, transform .15s;
}
.l2-arrow:hover { color: var(--brand); background: #f0f3ff; }
.l2-group.collapsed .l2-arrow { transform: rotate(-90deg); }
.l2-body { padding: 0 4px 8px; }
.l2-group.collapsed .l2-body { display: none; }
.l2-art {
    display: block; padding: 7px 10px; color: var(--text-2);
    font-size: 13.5px; border-radius: 6px; line-height: 1.5;
}
.l2-art:hover { background: #f4f7ff; color: var(--brand); }
.l2-empty { padding: 8px 12px; color: var(--text-3); font-size: 12.5px; }
.lb-list .hidden { display: none !important; }

/* ---------------- 主体 ---------------- */
.pn-row {
    display: flex; justify-content: space-between; gap: 16px;
    padding: 12px 0; border-bottom: 1px dashed var(--line);
}
.pn-row.pn-bottom { border-top: 1px dashed var(--line); border-bottom: none; margin-top: 20px; }
.pn-cell { flex: 1 1 0; min-width: 0; display: flex; align-items: baseline; gap: 8px; }
.pn-cell.pn-right { justify-content: flex-end; text-align: right; }
.pn-label { color: var(--text-3); font-size: 13px; flex: 0 0 auto; }
.pn-link { color: var(--brand); font-size: 14px; }
.pn-link.long { line-height: 1.4; max-height: 2.8em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pn-none { color: var(--text-3); font-size: 13px; }

.article-title { font-size: 26px; line-height: 1.4; margin: 18px 0 10px; color: var(--text); }
.article-desc {
    color: var(--text-2); background: #f7f9fc; border-left: 3px solid var(--brand);
    padding: 12px 16px; border-radius: 6px; margin: 0 0 22px; font-size: 14px;
}
.article-body { font-size: 15px; line-height: 1.9; color: #2a2f3a; word-break: break-word; }
.article-body h1, .article-body h2, .article-body h3,
.article-body h4, .article-body h5, .article-body h6 {
    line-height: 1.4; margin: 1.4em 0 .6em; scroll-margin-top: 80px;
}
.article-body h1 { font-size: 24px; }
.article-body h2 { font-size: 21px; }
.article-body h3 { font-size: 18px; }
.article-body h4 { font-size: 16px; }
.article-body p { margin: 0 0 1em; }
.article-body img { border-radius: 8px; }
.article-body pre {
    background: #1e2433; color: #dfe6f0; padding: 20px 22px; border-radius: 10px;
    overflow-x: auto; font-size: 14px; line-height: 1.7;
    font-family: "SF Mono", Menlo, Consolas, "Liberation Mono", "Courier New", monospace;
    border: 1px solid #2a3040;
}
.article-body pre code {
    background: none; padding: 0; border-radius: 0;
    font-size: inherit; color: inherit; line-height: inherit;
}
.article-body code { background: #eef1f6; padding: 2px 7px; border-radius: 4px; font-size: 13px; }
.article-body blockquote {
    margin: 1em 0; padding: 10px 16px; border-left: 3px solid var(--brand);
    background: #f7f9fc; color: var(--text-2);
}

/* ---------------- 栏目独立页面 ---------------- */
.cat-page-title { font-size: 26px; line-height: 1.4; margin: 14px 0 8px; color: var(--text); }
.cat-page-desc {
    color: var(--text-2); background: #f7f9fc; border-left: 3px solid var(--brand);
    padding: 12px 16px; border-radius: 6px; margin: 0 0 22px; font-size: 14px;
}
.cat-page-body { margin: 4px 0 12px; }
/* 下属分类网格（一级栏目页） */
.cat-subs { margin: 18px 0 8px; }
.cs-title, .ca-title { font-size: 18px; color: var(--text); margin: 22px 0 14px; padding-left: 10px; border-left: 3px solid var(--brand); }
.cs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.cs-card {
    display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 16px 18px; color: var(--text); transition: box-shadow .15s, transform .15s, border-color .15s;
}
.cs-card:hover { box-shadow: 0 6px 18px rgba(59,110,245,.12); border-color: var(--brand); transform: translateY(-2px); color: var(--text); }
.cs-name { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.cs-intro { font-size: 13px; color: var(--text-2); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-height: 3.1em; }
/* 本栏目文章列表（二级栏目页） */
.cat-arts { margin: 18px 0 8px; }
.ca-list { list-style: none; margin: 0; padding: 0; }
.ca-list li { border-bottom: 1px dashed var(--line); }
.ca-list li:last-child { border-bottom: none; }
.ca-list a { display: block; padding: 12px 4px; color: var(--text-2); font-size: 15px; line-height: 1.6; }
.ca-list a:hover { color: var(--brand); }
.pager { display: flex; align-items: center; gap: 12px; margin: 18px 0 6px; font-size: 14px; }
.pager a { display: inline-block; padding: 6px 16px; border: 1px solid var(--brand); border-radius: 6px; color: var(--brand); text-decoration: none; }
.pager a:hover { background: var(--brand); color: #fff; }
.pager .disabled { padding: 6px 16px; color: #bbb; border: 1px solid var(--line); border-radius: 6px; }
.pager .pinfo { color: var(--text-2); }

/* ---------------- 右栏区块 ---------------- */
.rb-block { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.rb-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 10px; padding-left: 8px; border-left: 3px solid var(--brand); }

/* 站点统计（右栏搜索框下方） */
.rb-stat .rb-stat-rows { display: flex; flex-direction: column; gap: 8px; }
.rb-stat-row {
    display: flex; align-items: baseline; justify-content: flex-start; gap: 2px;
    padding: 8px 10px; background: #f7f9fc; border-radius: 8px;
}
.rb-stat-label { font-size: 13px; color: var(--text-2); }
.rb-stat-num { font-size: 18px; font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; }
.rb-stat-unit { font-size: 12px; color: var(--text-3); margin-left: 2px; }
.rb-list { display: flex; flex-direction: column; gap: 2px; }
.rb-item {
    display: block; color: var(--text-2); font-size: 13.5px; padding: 7px 8px;
    border-radius: 6px; line-height: 1.45; max-height: 2.9em; overflow: hidden;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.rb-item:hover { background: #f4f7ff; color: var(--brand); }
.toc-empty { color: var(--text-3); font-size: 12.5px; padding: 4px 8px; }
.toc-item {
    display: block; color: var(--text-2); font-size: 13px; padding: 5px 8px; border-radius: 6px; line-height: 1.45;
    /* 超宽截断：仅在标题文字超过板块宽度时显示“…”，默认完整显示 */
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    position: relative; transition: background-color .15s, color .15s;
}
.toc-item:hover { background: #f4f7ff; color: var(--brand); }
/* 阅读高亮：当前所在标题项变色 + 左侧内嵌竖条（不撑动缩进布局） */
.toc-item.active { background: #f0f3ff; color: var(--brand); font-weight: 600; box-shadow: inset 3px 0 0 var(--brand); }
.toc-l1 { padding-left: 8px; font-weight: 600; }
.toc-l2 { padding-left: 18px; }
.toc-l3 { padding-left: 28px; }
.toc-l4 { padding-left: 38px; }
.toc-l5 { padding-left: 48px; }
.toc-l6 { padding-left: 58px; }

/* ---------------- 页脚 ---------------- */
.site-foot { background: var(--card); border-top: 1px solid var(--line); margin-top: 32px; padding: 22px 0; }
.foot-inner { max-width: 1360px; margin: 0 auto; text-align: center; color: var(--text-3); font-size: 12.5px; line-height: 2; }
.foot-inner a { color: var(--text-3); }
.foot-inner a:hover { color: var(--brand); }

/* ---------------- 响应式：窄屏堆叠 ---------------- */
@media (max-width: 980px) {
    .layout { flex-direction: column; margin: 14px auto; padding: 0 12px; }
    .leftbar, .rightbar { width: 100%; flex: 1 1 auto; }
    .center { padding: 20px 18px; }
    .nav-inner { max-width: 100%; }
    .article-title { font-size: 22px; }
    /* 首页手机版隐藏左右边栏 */
    .home .leftbar, .home .rightbar { display: none; }
    .home .center { width: 100%; }
}
@media (max-width: 560px) {
    .pn-row { flex-direction: column; gap: 6px; }
    .pn-cell.pn-right { justify-content: flex-start; text-align: left; }
}

/* ---------------- 首页 ---------------- */
/* 左栏：两个有序列表（最新 / 最热文章），单行截断 */
.leftbar-home { padding: 0; }
.hl-block { border-bottom: 1px solid var(--line); }
.hl-block:last-child { border-bottom: none; }
.hl-head {
    padding: 13px 14px 8px;
    display: flex; align-items: center;
}
.hl-title {
    font-size: 14px; font-weight: 700; color: var(--text);
    padding-left: 8px; border-left: 3px solid var(--brand);
}
.hl-ol { list-style: none; margin: 0; padding: 0 14px 12px; counter-reset: hl; }
.hl-item {
    display: flex; align-items: center; gap: 9px;
    padding: 7px 0; border-top: 1px dashed var(--line);
}
.hl-item:first-child { border-top: none; }
.hl-rank {
    width: 20px; height: 20px; flex: 0 0 20px;
    display: flex; align-items: center; justify-content: center;
    background: #f0f2f7; color: var(--text-2); border-radius: 5px;
    font-size: 11px; font-weight: 600;
}
.hl-item:nth-child(-n+3) .hl-rank { background: var(--brand); color: #fff; }
.hl-name {
    display: block;
    flex: 1; min-width: 0; max-width: 100%;
    font-size: 13.5px; color: var(--text-2);
    overflow: hidden !important; white-space: nowrap !important; text-overflow: ellipsis !important;
}
.hl-name:hover { color: var(--brand); }
.hl-empty { padding: 12px 14px; color: var(--text-3); font-size: 13px; }

/* 右栏：热门栏目有序列表（单行截断） */
.rb-ol { list-style: none; margin: 0; padding: 0; }
.rb-oi {
    display: flex; align-items: center; gap: 9px;
    padding: 7px 0; border-top: 1px dashed var(--line);
}
.rb-oi:first-child { border-top: none; }
.rb-rank {
    width: 20px; height: 20px; flex: 0 0 20px;
    display: flex; align-items: center; justify-content: center;
    background: #f0f2f7; color: var(--text-2); border-radius: 5px;
    font-size: 11px; font-weight: 600;
}
.rb-oi:nth-child(-n+3) .rb-rank { background: var(--brand); color: #fff; }
.rb-oname {
    flex: 1; min-width: 0;
    font-size: 13.5px; color: var(--text-2);
    overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.rb-oname:hover { color: var(--brand); }
.rb-empty { display: block; padding: 8px 2px; color: var(--text-3); font-size: 13px; }

/* 右栏：热门标签云（挤满每一行，放不下换行，非列表） */
.rb-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.rb-tag {
    display: inline-block;
    padding: 4px 11px;
    background: #f4f6fa; color: var(--text-2);
    border: 1px solid var(--line); border-radius: 999px;
    font-size: 12.5px; line-height: 1.4; white-space: nowrap;
}
.rb-tag:hover { background: var(--brand); color: #fff; border-color: var(--brand); }

.home-center { background: transparent; border: none; padding: 0; }
.home-block { margin-bottom: 28px; }
.hb-title {
    font-size: 18px; font-weight: 700; color: var(--text);
    margin: 0 0 16px; padding-left: 12px; border-left: 4px solid var(--brand);
    display: flex; align-items: center; gap: 8px;
}
.hb-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.hb-card {
    display: flex; align-items: flex-start; gap: 12px;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 16px; transition: .15s;
}
.hb-card:hover { border-color: var(--brand); box-shadow: 0 4px 14px rgba(59,110,245,.08); }
.hbc-icon { width: 64px; height: 64px; flex: 0 0 64px; border-radius: 10px; overflow: hidden; background: #f4f6fa; display: flex; align-items: center; justify-content: center; }
.hbc-icon img { width: 100%; height: 100%; object-fit: cover; }
.hbc-body { flex: 1; min-width: 0; }
.hbc-name { font-size: 15px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; }
.hbc-intro { font-size: 13px; color: var(--text-2); line-height: 1.5; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.home-empty { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 48px 32px; text-align: center; }
.home-empty h2 { margin: 0 0 10px; font-size: 20px; color: var(--text); }
.home-empty p { margin: 0; color: var(--text-2); font-size: 14px; line-height: 1.8; }

@media (max-width: 1200px) {
    .hb-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .hb-grid { grid-template-columns: 1fr; }
}

/* ---------------- 搜索页 ---------------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.search-card { padding: 28px 32px; }
.search-h { font-size: 22px; margin: 0 0 16px; }
.search-h .q { color: var(--brand); }
.search-form { display: flex; gap: 10px; margin-bottom: 16px; }
.search-form input {
    flex: 1; height: 42px; border: 1px solid var(--line); border-radius: 8px;
    padding: 0 14px; font-size: 14px; outline: none;
}
.search-form input:focus { border-color: var(--brand); }
.search-form button {
    height: 42px; padding: 0 22px; border: none; border-radius: 8px; cursor: pointer;
    background: var(--brand); color: #fff; font-size: 14px;
}
.search-form button:hover { background: var(--brand-d); }
.search-tip { color: var(--text-2); margin: 4px 0 0; }
/* 标签页：标签 SEO 描述（支持 HTML，特殊广告位）展示在标题下方 */
.tag-seo-desc {
    margin: 0 0 16px; padding: 14px 16px; border-radius: 8px;
    background: #f6f8fc; border: 1px solid var(--line);
    color: var(--text-2); font-size: 13.5px; line-height: 1.7;
}
.tag-seo-desc :first-child { margin-top: 0; }
.tag-seo-desc :last-child { margin-bottom: 0; }
.search-list { list-style: none; margin: 16px 0 0; padding: 0; }
.search-list li { padding: 14px 0; border-top: 1px solid var(--line); }
.sr-title { font-size: 16px; font-weight: 600; color: var(--text); }
.sr-title:hover { color: var(--brand); }
.sr-meta { color: var(--text-3); font-size: 12.5px; margin: 4px 0; }
.sr-cat { margin-right: 12px; }
.sr-excerpt { color: var(--text-2); font-size: 13.5px; }

/* ---------------- 前台标签中心（/tag，仅中间主体） ---------------- */
.tag-center-main { padding: 30px 36px 40px; }
.tc-title { font-size: 30px; font-weight: 700; margin: 0 0 18px; letter-spacing: 2px; }
.tc-nav {
    display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 26px;
    padding-bottom: 18px; border-bottom: 1px solid var(--line);
}
.tc-nav a {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 38px; height: 32px; padding: 0 10px;
    border: 1px solid var(--line); border-radius: 8px;
    background: var(--card); color: var(--text-2);
    font-size: 13.5px; font-weight: 600; text-decoration: none;
    transition: all .15s;
}
.tc-nav a:hover { border-color: var(--brand); color: var(--brand); background: #f0f3ff; }
.tc-section { scroll-margin-top: 80px; margin: 0 0 22px; }
.tc-idx {
    font-size: 18px; font-weight: 700; margin: 0 0 12px;
    padding-left: 12px; border-left: 4px solid var(--brand); color: var(--text);
}
.tc-tags { display: flex; flex-wrap: wrap; gap: 10px; }
.tc-tag {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px; border: 1px solid var(--line); border-radius: 20px;
    background: var(--card); color: var(--text); font-size: 14px; text-decoration: none;
    transition: all .15s;
}
.tc-tag:hover { border-color: var(--brand); color: var(--brand); background: #f0f3ff; }
.tc-count {
    font-size: 12px; color: var(--text-3);
    background: #eef1f6; border-radius: 10px; padding: 1px 7px; line-height: 1.6;
}
.tc-empty { color: var(--text-3); font-size: 13.5px; margin: 4px 0 0; }

/* ---------------- 文章标签 ---------------- */
.article-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 22px 0 4px; padding-top: 16px; border-top: 1px solid var(--line); }
.at-label { color: var(--text-3); font-size: 13px; }
.tag-chip {
    display: inline-block; padding: 4px 12px; border-radius: 999px;
    background: rgba(59,110,245,.10); color: var(--brand); font-size: 13px;
    text-decoration: none; transition: .15s;
}
.tag-chip:hover { background: var(--brand); color: #fff; }

/* ---------------- 自定义字段（前台调用 field_list_html 整组输出） ---------------- */
.cf-list { margin: 18px 0 4px; padding: 16px 18px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.cf-item { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.cf-item:last-child { border-bottom: 0; }
.cf-name { flex: 0 0 116px; color: var(--text-3); font-size: 13.5px; padding-top: 2px; }
.cf-value { flex: 1; min-width: 0; color: var(--text); font-size: 14px; line-height: 1.7; word-break: break-all; }
.cf-value a { color: var(--brand); }

/* ---------------- 正文内链：关键词内链 vs 标签内链 ---------------- */
/* 统一品牌蓝色，只通过下划线样式区分：关键词实线、标签虚线 */
.il-kw,
.il-tag {
    color: var(--brand-d);
    text-decoration: none;
    transition: .12s;
}
.il-kw { border-bottom: 1px solid rgba(59,110,245,.45); }
.il-tag { border-bottom: 1px dashed rgba(59,110,245,.45); }
.il-kw:hover,
.il-tag:hover {
    color: #fff;
    background: var(--brand);
    border-bottom-color: var(--brand);
    border-radius: 3px;
}

/* ---------------- 广告位：正文内插入的广告 ---------------- */
.ad-in-content { margin: 20px 0; text-align: center; line-height: 0; }
.ad-in-content > * { vertical-align: middle; }
.ad-in-content img { max-width: 100%; height: auto; }

:root{ --render-id:82fbee2501dd6ff1; }
