/*
Theme Name: 运维之家 (CNOP)
Theme URI: https://www.cnop.net/
Author: cnop
Author URI: https://www.cnop.net/
Description: 运维之家自定义主题 — dev.to 风格三栏社区布局：左侧竖排导航 + 中栏内容流 + 右侧边栏。
Version: 2.0.0
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: cnop
Tags: three-columns, left-sidebar, right-sidebar, custom-menu, featured-images, threaded-comments, translation-ready, blog, news
*/

/* ========== 变量 ========== */
:root {
    --bg: #f5f5f5;
    --surface: #ffffff;
    --border: #e6e6e6;
    --text: #1a1a1b;
    --text-muted: #525252;
    --text-faint: #828282;
    --primary: #3b49df;
    --primary-hover: #2f3bb8;
    --accent: #10b981;
    --hover-bg: #f2f2f2;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,.06);
    --shadow-hover: 0 2px 8px rgba(0,0,0,.1);
    --maxw: 1480px;
}

/* ========== 基础重置 ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', '微软雅黑', Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
}
a { color: var(--primary); text-decoration: none; transition: color .15s, background .15s; }
a:hover { color: var(--primary-hover); text-decoration: underline; }
img { max-width: 100%; height: auto; }
ul, ol { list-style: none; }
.clearfix::after { content: ""; display: table; clear: both; }

/* ========== 顶部头 ========== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 0 rgba(0,0,0,.02);
}
.header-inner {
    max-width: var(--maxw);
    margin: 0 auto;
    height: 60px;
    padding: 0 16px;
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    align-items: center;
    gap: 16px;
}
.site-branding { justify-self: start; display: flex; align-items: center; }
.site-logo { display: block; max-height: 56px; height: 36px; width: auto; object-fit: contain; }
.site-branding .site-title {
    font-size: 20px;
    font-weight: 800;
    line-height: 1.1;
    color: var(--primary);
}
.site-branding .site-title:hover { text-decoration: none; color: var(--primary-hover); }
.site-branding .site-description { font-size: 12px; color: var(--text-faint); margin-left: 8px; }

/* ========== 搜索框（居中） ========== */
.header-search { justify-self: center; display: flex; align-items: center; width: 100%; max-width: 460px; }
.header-search .search-form { display: flex; width: 100%; align-items: center; }
.header-search input[type="search"] {
    flex: 1;
    height: 36px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 18px 0 0 18px;
    outline: none;
    font-size: 14px;
    background: var(--bg);
    transition: border-color .15s, background .15s;
}
.header-search input[type="search"]:focus {
    border-color: var(--primary);
    background: var(--surface);
}
.header-search button {
    height: 36px;
    width: 40px;
    background: var(--bg);
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-left: none;
    border-radius: 0 18px 18px 0;
    cursor: pointer;
    font-size: 15px;
    transition: background .15s, color .15s;
}
.header-search button:hover { background: #eaeaea; color: var(--primary); }

/* ========== 顶栏账户按钮（右上） ========== */
.header-account {
    justify-self: end;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    flex-shrink: 0;
    gap: 8px;
}
.btn {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    height: 34px;
    padding: 0 16px;
    border-radius: 17px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background .15s, color .15s, border-color .15s;
}
.btn:hover { text-decoration: none; }
.btn-ghost {
    color: var(--primary);
    background: transparent;
    border-color: transparent;
}
.btn-ghost:hover { background: var(--hover-bg); color: var(--primary-hover); }
.btn-primary {
    color: #fff;
    background: var(--primary);
}
.btn-primary:hover { background: var(--primary-hover); color: #fff; }

/* ========== 顶部语言切换器 ========== */
.lang-switcher { position: relative; display: inline-flex; align-items: center; }
.lang-switcher-btn { display: inline-flex; align-items: center; gap: 4px; padding: 0 12px; }
.lang-switcher-btn .lang-flag { display: inline-flex; line-height: 1; }
.lang-switcher-btn .lang-flag img { width: 16px; height: 11px; vertical-align: middle; }
.lang-switcher-btn .lang-label { font-size: 13px; font-weight: 700; letter-spacing: .5px; }
.lang-switcher-btn .lang-caret { font-size: 10px; opacity: .6; margin-top: 1px; }
.lang-switcher-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 1000;
    min-width: 150px;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
}
.lang-switcher-menu[hidden] { display: none; }
.lang-switcher-menu li { margin: 0; }
.lang-switcher-menu a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    color: var(--text);
    font-size: 14px;
    text-decoration: none;
}
.lang-switcher-menu a:hover { background: var(--hover-bg); color: var(--primary); }
.lang-switcher-menu .lang-flag img { width: 18px; height: 12px; vertical-align: middle; }
.lang-switcher-menu .lang-name { flex: 1; }
.lang-switcher-menu .lang-slug { font-size: 12px; color: var(--text-muted); font-weight: 700; }
.lang-switcher-menu .no-translation a { opacity: .55; }

/* ========== 三栏布局 ========== */
#page.site { background: var(--bg); }

/* 三栏容器：左栏导航 + main(中右两栏) */
.layout-row {
    max-width: var(--maxw);
    margin: 12px auto;
    padding: 0 12px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}
.site-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

/* 左栏：导航 + Tags（约占 1/5） */
.nav-sidebar {
    flex: 0 0 20%;
    min-width: 180px;
    max-width: 240px;
    position: sticky;
    top: 72px;
    align-self: flex-start;
}
.nav-vertical {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
}
.nav-home-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}
.nav-home-link:hover { background: var(--hover-bg); text-decoration: none; color: var(--text); }

/* 左栏 Tags 区 */
.nav-tags {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    margin-top: 16px;
    padding: 0 4px;
}
.nav-tags-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}
.nav-tags-body a {
    display: inline-block;
    padding: 2px 9px;
    margin: 3px 2px 3px 0;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 12px !important;
    color: var(--text-muted);
}
.nav-tags-body a:hover { background: var(--primary); color: #fff; border-color: var(--primary); text-decoration: none; }

/* 常用标签区（固定列表，点击跳搜索页） */
.nav-popular-tags {
    background: transparent;
    border: none;
    margin-top: 20px;
    padding: 0 4px;
}
.popular-tag .hash { color: var(--text-faint); margin-right: 1px; font-weight: 600; }
.popular-tag:hover .hash { color: #fff; }

/* 左栏栏目菜单（一级 + 二级展开）—— 扁平化，无边框无阴影 */
.nav-box {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
}
.nav-cat-menu { margin-top: 4px; }
.nav-cat-item { }
.nav-cat-row {
    display: flex;
    align-items: stretch;
    border-radius: 6px;
    overflow: hidden;
}
.nav-cat-row:hover { background: var(--hover-bg); }
.nav-cat-link {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
}
.nav-cat-link:hover { color: var(--primary); text-decoration: none; }
.nav-cat-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
    line-height: 1;
    flex: 0 0 20px;
}
.nav-cat-name { flex: 1; }
.nav-cat-toggle {
    flex: 0 0 auto;
    width: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-faint);
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.nav-cat-toggle:hover { color: var(--primary); }
.toggle-icon { transition: transform .15s; }

/* 二级菜单：默认折叠，点击 .open 后展开 */
.nav-sub-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height .2s ease;
    padding-left: 14px;
}
.nav-cat-item.open > .nav-sub-menu { max-height: 800px; }
.nav-sub-menu li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px;
    border-radius: 5px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 400;
}
.nav-sub-menu li a:hover { background: var(--hover-bg); color: var(--primary); text-decoration: none; }
.nav-sub-menu .count { color: var(--text-faint); font-size: 11px; }

/* 当前所在分类高亮 */
.nav-cat-item.current-cat > .nav-cat-row { background: #eef0fb; }
.nav-cat-item.current-cat > .nav-cat-row .nav-cat-link { color: var(--primary); }

/* 中栏：内容 */
.content-area {
    flex: 1 1 auto;
    min-width: 0;
    background: transparent;
    border-radius: var(--radius);
    padding: 0;
}

/* 右栏：侧边栏（略多于 1/5） */
.widget-area {
    flex: 0 0 22%;
    min-width: 220px;
    max-width: 320px;
    padding: 0;
}

/* ========== 左栏竖排菜单 ========== */
.nav-menu { display: block; margin-top: 4px; }
.nav-menu > li { position: relative; }
.nav-menu > li > a {
    display: block;
    padding: 8px 12px;
    border-radius: 6px;
    color: var(--text);
    font-size: 15px;
    font-weight: 500;
}
.nav-menu > li > a:hover { background: var(--hover-bg); text-decoration: none; color: var(--text); }
.nav-menu > li.current-menu-item > a,
.nav-menu > li.current-menu-parent > a {
    background: #eef0fb;
    color: var(--primary);
    font-weight: 600;
}
/* 二级菜单：右侧浮出 */
.nav-menu .sub-menu {
    position: absolute;
    left: calc(100% + 6px);
    top: 0;
    min-width: 180px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-hover);
    padding: 6px;
    display: none;
    z-index: 999;
}
.nav-menu li:hover > .sub-menu { display: block; }
.nav-menu .sub-menu a {
    display: block;
    padding: 7px 12px;
    border-radius: 5px;
    color: var(--text-muted);
    font-size: 14px;
    white-space: nowrap;
}
.nav-menu .sub-menu a:hover { background: var(--hover-bg); color: var(--primary); text-decoration: none; }

/* ========== 面包屑 ========== */
.breadcrumb {
    font-size: 13px;
    color: var(--text-faint);
    padding: 4px 0 16px;
    margin-bottom: 4px;
}
.breadcrumb a { color: var(--primary); }
.breadcrumb .sep { margin: 0 6px; color: var(--border); }

/* ========== 首页 Hero Banner ========== */
.home-hero {
    background: linear-gradient(135deg, #3b49df 0%, #5d6dff 45%, #10b981 100%);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 53px 32px; /* 原 40px → 加高约 1/3 */
    min-height: 320px;  /* 显式高度，保证视觉占位，不再仅靠内容撑高 */
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-bottom: 16px;
    color: #fff;
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
/* 有背景图时：叠暗化遮罩，保证白色文字可读 */
.home-hero--has-image::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,.35) 0%, rgba(0,0,0,.25) 100%);
    z-index: 1;
}
.home-hero-inner { position: relative; z-index: 2; }
/* 移动端背景图：默认隐藏，媒体查询内显示覆盖桌面图 */
.home-hero-mobile-bg {
    display: none;
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    z-index: 0;
}
.home-hero::after {
    content: "";
    position: absolute;
    right: -40px; top: -40px;
    width: 200px; height: 200px;
    background: rgba(255,255,255,.08);
    border-radius: 50%;
    z-index: 2;
}
.home-hero-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
    position: relative;
}
.home-hero-sub {
    font-size: 15px;
    opacity: .92;
    margin-bottom: 18px;
    position: relative;
}
.home-hero-btn {
    display: inline-block;
    padding: 8px 20px;
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(255,255,255,.4);
    border-radius: 16px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    position: relative;
}
.home-hero-btn:hover { background: rgba(255,255,255,.3); color: #fff; text-decoration: none; }

/* ========== 首页分类区块卡片 ========== */
.home-blocks { display: flex; flex-direction: column; gap: 16px; }
.block {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: box-shadow .15s;
}
.block:hover { box-shadow: var(--shadow-hover); }
.block-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
}
.block-title > a:first-child {
    color: var(--text);
    position: relative;
    padding-left: 12px;
}
.block-title > a:first-child::before {
    content: "";
    position: absolute;
    left: 0; top: 2px; bottom: 2px;
    width: 4px;
    border-radius: 2px;
    background: var(--primary);
}
.block-title > a:first-child:hover { color: var(--primary); text-decoration: none; }
.block-title .more {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-faint);
}
.block-title .more:hover { color: var(--primary); text-decoration: none; }
.block-body { padding: 6px 18px 12px; }

/* ========== 首页文章流大卡片（全局最新 16 条） ========== */
.home-feed-wrap { display: flex; flex-direction: column; }
.feed-section-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
    padding: 4px 4px 12px;
}
.feed-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.feed-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px 24px;
    transition: box-shadow .15s, transform .15s;
}
.feed-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.feed-card-title {
    font-size: 22px;
    font-weight: 800;
    line-height: 1.35;
    margin-bottom: 10px;
}
.feed-card-title a { color: var(--text); }
.feed-card-title a:hover { color: var(--primary); text-decoration: none; }
.feed-card-excerpt {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.75;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.feed-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
    font-size: 14px;
    color: var(--text-faint);
}
.feed-card-meta span,
.feed-card-meta .meta-tag { display: inline-flex; align-items: center; gap: 4px; }

/* 栏目标签 pill */
.feed-card-meta .meta-tag {
    padding: 4px 12px;
    border-radius: 14px;
    background: #eef0fb;
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
}
.feed-card-meta .meta-tag:hover { background: #dfe2f7; text-decoration: none; color: var(--primary-hover); }
.feed-card-meta .meta-tag-dot { font-size: 8px; opacity: .7; }
.feed-card-meta .meta-comments,
.feed-card-meta .meta-likes { font-size: 14px; }
.feed-card-meta .meta-likes { color: var(--primary); font-weight: 600; }

/* ========== 子分类 pill（首页/分类页） ========== */
.subcat-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
}
.subcat-card {
    flex: 0 0 auto;
    padding: 4px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    font-size: 13px;
}
.subcat-card a { color: var(--primary); font-weight: 500; }
.subcat-card a:hover { text-decoration: none; }
.subcat-card:hover { background: #eef0fb; border-color: var(--primary); }
.subcat-card .count { color: var(--text-faint); font-size: 12px; }

/* ========== 文章列表项 ========== */
.post-list { }
.post-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.post-list li:last-child { border-bottom: none; }
.post-list li a {
    flex: 1;
    min-width: 0;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 4px 8px;
    margin-left: -8px;
    border-radius: 5px;
}
.post-list li a:hover { color: var(--primary); background: var(--hover-bg); text-decoration: none; }
.post-list li .date {
    color: var(--text-faint);
    font-size: 12px;
    white-space: nowrap;
}

/* 归档/分类页的列表（带摘要） */
.archive-list .post-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px 20px;
    margin-bottom: 12px;
    transition: box-shadow .15s, transform .15s;
}
.archive-list .post-item:hover { box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.archive-list .post-title {
    font-size: 19px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.35;
}
.archive-list .post-title a { color: var(--text); }
.archive-list .post-title a:hover { color: var(--primary); text-decoration: none; }
.archive-list .post-meta {
    font-size: 13px;
    color: var(--text-faint);
    margin-bottom: 10px;
}
.archive-list .post-meta .cat a {
    color: var(--primary);
    background: #eef0fb;
    padding: 2px 8px;
    border-radius: 12px;
    margin-right: 4px;
}
.archive-list .post-meta .cat a:hover { text-decoration: none; background: #dfe2f7; }
.archive-list .post-excerpt { font-size: 14px; color: var(--text-muted); line-height: 1.7; }

/* ========== 归档/分类页头部 ========== */
.archive-header {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px 20px;
    margin-bottom: 16px;
}
.archive-title { font-size: 22px; font-weight: 700; color: var(--text); }
.archive-title strong { color: var(--primary); }
.archive-description { margin-top: 8px; font-size: 14px; color: var(--text-muted); }

/* ========== 文章详情页 ========== */
.single-article {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px 32px;
}
.single-article .article-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 12px;
    line-height: 1.3;
    text-align: left;
}
.single-article .article-meta {
    font-size: 13px;
    color: var(--text-faint);
    padding: 10px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}
.single-article .article-meta span { margin-right: 14px; }
.single-article .article-meta .cat a {
    color: var(--primary);
    background: #eef0fb;
    padding: 2px 8px;
    border-radius: 12px;
}
.single-article .article-meta .cat a:hover { text-decoration: none; }
.single-article .article-content {
    font-size: 16px;
    line-height: 1.9;
    color: var(--text);
    word-wrap: break-word;
}
.single-article .article-content p { margin-bottom: 1.2em; }
.single-article .article-content h2 { font-size: 22px; margin: 1.4em 0 .6em; color: var(--text); font-weight: 700; }
.single-article .article-content h3 { font-size: 19px; margin: 1.2em 0 .5em; color: var(--text); font-weight: 700; }
.single-article .article-content pre {
    background: #f6f8fa;
    padding: 14px 16px;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 14px;
    margin: 1em 0;
    border: 1px solid var(--border);
}
.single-article .article-content code {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 14px;
}
.single-article .article-content pre code { background: none; padding: 0; }
.single-article .article-content img { display: block; margin: 1em auto; border-radius: 6px; }
.single-article .article-content blockquote {
    border-left: 4px solid var(--primary);
    background: #f9f9fb;
    padding: 12px 16px;
    margin: 1em 0;
    color: var(--text-muted);
    border-radius: 0 6px 6px 0;
}
.single-article .article-content a { color: var(--primary); text-decoration: underline; }
.single-article .article-content ul,
.single-article .article-content ol { margin: 1em 0 1em 2em; }
.single-article .article-content ul li { list-style: disc; }
.single-article .article-content ol li { list-style: decimal; }

/* 文章标签 */
.post-tags { margin-top: 24px; font-size: 13px; color: var(--text-faint); }
.post-tags a {
    color: var(--primary);
    background: #eef0fb;
    padding: 3px 10px;
    border-radius: 12px;
    margin-right: 6px;
    display: inline-block;
    margin-bottom: 6px;
}
.post-tags a:hover { text-decoration: none; background: #dfe2f7; }

/* 文章上下篇导航 */
.post-nav {
    margin-top: 32px;
    padding: 16px 0;
    border-top: 1px solid var(--border);
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
}
.post-nav .prev,
.post-nav .next { max-width: 48%; }
.post-nav .next { text-align: right; }
.post-nav .nav-label { color: var(--text-faint); display: block; font-size: 12px; margin-bottom: 2px; }

/* 相关文章 */
.related-posts {
    margin-top: 24px;
    padding: 18px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.related-posts h3 {
    font-size: 16px;
    color: var(--text);
    margin-bottom: 12px;
    font-weight: 700;
}

/* ========== 分页 ========== */
.pagination {
    text-align: center;
    padding: 20px 0 8px;
}
.pagination .page-numbers {
    display: inline-block;
    padding: 7px 13px;
    margin: 0 3px;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 14px;
    background: var(--surface);
}
.pagination .page-numbers:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.pagination .page-numbers.current {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ========== 侧边栏小工具 ========== */
.widget {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 12px;
    overflow: hidden;
}
.widget-title {
    padding: 14px 16px 10px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    text-transform: none;
    border-bottom: 1px solid var(--border);
}
.widget ul { padding: 10px 16px 14px; }
.widget li {
    padding: 7px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.widget li:last-child { border-bottom: none; }
.widget li a { color: var(--text); }
.widget li a:hover { color: var(--primary); }
.widget .post-date { display: block; font-size: 12px; color: var(--text-faint); margin-top: 2px; }
.widget_search .widget-body { padding: 14px 16px; }
.widget_search input[type="search"] {
    width: 100%;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
}
.widget_search input[type="search"]:focus { border-color: var(--primary); background: var(--surface); outline: none; }
.widget_tag_cloud .widget-body { padding: 14px 16px; }
.widget_tag_cloud a {
    display: inline-block;
    padding: 3px 10px;
    margin: 3px 2px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 13px !important;
    color: var(--text-muted);
}
.widget_tag_cloud a:hover { background: var(--primary); color: #fff; border-color: var(--primary); text-decoration: none; }

/* ========== 空状态 ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-faint);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }

/* ========== 页脚 ========== */
.site-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    margin-top: 24px;
    padding: 24px 0;
    font-size: 13px;
    color: var(--text-faint);
}
.footer-inner {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 12px;
    text-align: center;
}
.footer-links { margin-bottom: 10px; }
.footer-links a { color: var(--text-muted); margin: 0 8px; }
.footer-links a:hover { color: var(--primary); }
.site-footer .copyright { color: var(--text-faint); }
.site-footer a { color: var(--text-muted); }

/* ========== 404 ========== */
.error-404 {
    text-align: center;
    padding: 80px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.error-404 .error-code { font-size: 96px; font-weight: 800; color: var(--primary); line-height: 1; }
.error-404 .error-text { font-size: 20px; color: var(--text-muted); margin: 16px 0 24px; }
.error-404 .back-home {
    display: inline-block;
    padding: 9px 26px;
    background: var(--primary);
    color: #fff;
    border-radius: 6px;
}
.error-404 .back-home:hover { background: var(--primary-hover); color: #fff; text-decoration: none; }

/* ========== 响应式 ========== */
@media (max-width: 1024px) {
    .header-inner { grid-template-columns: auto 1fr auto; }
    .nav-sidebar { flex: 0 0 160px; min-width: 160px; max-width: 160px; }
    .widget-area { flex: 0 0 24%; min-width: 200px; }
    .header-search { max-width: 620px; }
}
@media (max-width: 900px) {
    .header-inner { grid-template-columns: auto 1fr auto; gap: 10px; }
    .site-branding .site-description { display: none; }
    .header-account .btn { padding: 0 10px; }
    .layout-row, .site-main { flex-direction: column; }
    .nav-sidebar {
        position: static;
        flex: 0 0 auto;
        min-width: 0;
        max-width: none;
        width: 100%;
    }
    .widget-area { flex: 0 0 auto; min-width: 0; width: 100%; max-width: none; }
}
@media (max-width: 640px) {
    .header-search { display: none; }
    .header-inner { grid-template-columns: 1fr auto; }
    .home-hero { padding: 35px 18px; min-height: 240px; }
    .home-hero-title { font-size: 22px; }
    /* 移动端若设了专用背景图，在此显示并覆盖桌面图 */
    .home-hero-mobile-bg { display: block; }
    .single-article { padding: 18px 16px; }
    .single-article .article-title { font-size: 22px; }
}
