/*
Theme Name: 工业电路文库
Theme URI: https://blog.a766.com/
Author: YKYH
Author URI: https://blog.a766.com/
Description: 面向电路图、电工、PLC、变频、CAD 技术文库的极简 SEO 主题。纯文字优先排版、零 JavaScript 依赖、语义化结构与结构化数据。
Version: 1.1.0
Requires at least: 6.0
Tested up to: 7.1
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: a766-tech
Tags: blog, one-column, two-columns, right-sidebar, custom-menu, featured-images, translation-ready
*/

/* ========== 设计令牌：石墨 + 琥珀 ========== */
:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --ink: #1c1c1c;
  --ink-2: #454545;
  --muted: #767676;
  --line: #e2e2e2;
  --brand: #8a3a0c;
  --brand-2: #b45309;
  --brand-soft: #fdf2e4;
  --accent: #e8890c;
  --header: #ffffff;      /* 导航栏：白色 */
  --header-ink: #2b2b2b;   /* 导航栏文字 */
  --header-muted: #858585;
  --footer: #24211c;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(28,26,23,.05), 0 10px 26px -18px rgba(28,26,23,.30);
  --max: 1000px;
}

/* ========== 基础 ========== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--bg);
  color: var(--ink);
  font: 16px/1.75 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
        "Microsoft YaHei", "Noto Sans SC", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; }
a { color: var(--brand-2); text-decoration: none; }
a:hover { color: var(--brand); text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.45; letter-spacing: -.01em; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(1px,1px,1px,1px); white-space: nowrap;
}

/* ========== 顶栏 ========== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(28,26,23,.04), 0 8px 20px -16px rgba(28,26,23,.30);
}
.header-inner {
  max-width: var(--max); margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 16px; height: 54px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--header-ink); font-size: 19px; font-weight: 800; letter-spacing: .02em;
  white-space: nowrap; text-decoration: none;
}
.brand:hover { color: #000; text-decoration: none; }
.brand-logo { display: block; height: 23px; width: auto; max-width: 170px; }
.brand-sub { font-size: 12px; font-weight: 500; color: var(--header-muted); margin-left: 2px; }

.header-search { margin-left: auto; flex: 0 0 auto; }
.search-form { display: flex; align-items: center; }
.search-form input[type="search"] {
  width: 190px; height: 31px; padding: 0 12px;
  border: 1px solid #e4e4e4; border-right: 0;
  border-radius: 6px 0 0 6px; background: #f7f7f7;
  color: var(--ink); font-size: 13.5px; outline: none;
}
.search-form input[type="search"]::placeholder { color: #9e9e9e; }
.search-form input[type="search"]:focus { border-color: var(--accent); }
.search-form button {
  height: 31px; padding: 0 13px; border: 0; border-radius: 0 6px 6px 0;
  background: #2563eb; color: #ffffff; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: background .14s;
}
.search-form button:hover { background: #1d4ed8; }

/* ========== 导航：6 个大类 + 悬停展开子类 ========== */
.nav-main {
  display: flex; align-items: center; gap: 1px;
  min-width: 0; overflow: visible;   /* 必须是 visible，否则会裁剪绝对定位的下拉面板 */
}
.nav-link {
  position: relative;
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 15.5px; font-weight: 500; letter-spacing: .01em;
  color: #4a4a4a; padding: 9px 13px; border-radius: 9px;
  white-space: nowrap;
  transition: background .16s ease, color .16s ease;
}
.nav-link::after {
  content: ""; position: absolute; left: 13px; right: 13px; bottom: 4px;
  height: 2px; border-radius: 2px; background: var(--brand-2);
  transform: scaleX(0); transform-origin: left; opacity: 0;
  transition: transform .22s ease, opacity .22s ease;
}
.nav-item:hover > .nav-link::after,
.nav-item:focus-within > .nav-link::after { transform: scaleX(1); opacity: 1; }
.nav-link.is-active {
  background: var(--brand-soft); color: var(--brand); font-weight: 600;
}
.nav-link.is-active::after { transform: scaleX(1); opacity: .5; }
.nav-link:hover { background: rgba(60,44,20,.07); color: var(--header-ink); text-decoration: none; }
.nav-item { position: relative; display: inline-block; vertical-align: middle; }
.nav-item:hover > .nav-link,
.nav-item:focus-within > .nav-link { background: rgba(60,44,20,.08); color: var(--header-ink); }
.nav-item .caret { font-size: 10px; opacity: .5; line-height: 1; transition: transform .15s; }
.nav-item:hover .caret,
.nav-item:focus-within .caret { transform: rotate(180deg); }

.nav-drop {
  display: none;
  position: absolute; left: 0; top: 100%; z-index: 80;
  margin-top: 6px; padding: 9px;
  min-width: 254px;
  grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px 6px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 2px 6px rgba(28,26,23,.05), 0 20px 44px -24px rgba(28,26,23,.45);
}
.nav-item:hover .nav-drop,
.nav-item:focus-within .nav-drop { display: grid; }
.nav-drop-all {
  grid-column: 1 / -1;
  margin-bottom: 4px !important;
  padding: 7px 9px !important;
  border-radius: 6px !important;
  background: var(--brand-soft);
  color: var(--brand) !important;
  font-weight: 600;
}
.nav-drop-all:hover { background: #fbe7cf; text-decoration: none; }
.nav-drop a {
  display: flex; justify-content: space-between; gap: 8px;
  padding: 6px 9px; border-radius: 6px;
  font-size: 13px; color: var(--ink-2); white-space: nowrap;
}
.nav-drop a:hover { background: var(--brand-soft); color: var(--brand); text-decoration: none; }
.nav-drop .n { font-size: 11px; color: #b0b0b0; font-variant-numeric: tabular-nums; }

/* 分类页的子分类标签 */
.subcat-list {
  display: flex; flex-wrap: wrap; align-items: center; gap: 7px;
  margin: 0 0 16px;
}
.subcat-label { font-size: 13px; color: var(--muted); margin-right: 2px; }
.subcat {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; padding: 5px 11px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-2);
}
.subcat:hover { border-color: #e5b98a; background: var(--brand-soft); color: var(--brand); text-decoration: none; }
.subcat .n { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ========== 面包屑 ========== *//* ========== 面包屑 ========== */
/* 面包屑：白色圆角框 */
.crumbs {
  display: flex; align-items: center; flex-wrap: wrap; gap: 1px;
  width: auto; max-width: none;
  margin: 2px 0 16px;
  padding: 7px 14px;
  font-size: 13px; line-height: 1.6; color: var(--muted);
  background: #ffffff;
  border: 1px solid #e2e2e2;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(28,26,23,.02);
}
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--brand-2); }
.crumbs .sep { margin: 0 5px; color: #c6c6c6; }
.crumbs > span:last-child { color: var(--ink-2); }

/* ========== 布局 ========== */
.site-main { padding: 18px 0 20px; }
.layout { display: grid; grid-template-columns: minmax(0,1fr); gap: 30px; }
@media (min-width: 1000px) {
  .layout { grid-template-columns: minmax(0,1fr) 260px; }
}
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}

/* ========== 首页 Hero ========== */
.hero {
  background: #ffffff;
  border: 1px solid #e4e4e4;
  border-radius: var(--radius);
  padding: 18px 30px 22px;   /* 顶部 26→18，底部 24→22，合计压 10px */
  color: var(--ink);
  margin-bottom: 22px;
  box-shadow:
    0 1px 2px rgba(28,26,23,.05),
    0 6px 14px -8px rgba(28,26,23,.10),
    0 20px 40px -24px rgba(28,26,23,.38);
}
.hero h1 { margin: 0 0 8px; font-size: 25px; letter-spacing: -.02em; color: var(--ink); }
.hero p { margin: 0 0 15px; color: var(--muted); font-size: 14px; max-width: 720px; line-height: 1.6; }
.hero .search-form input[type="search"] {
  width: min(420px, 58vw); height: 38px;
  background: transparent; color: var(--ink);
  border: 1px solid #dedede; border-right: 0;
  border-radius: 8px 0 0 8px; font-size: 15px;
  transition: border-color .15s, background .15s;
}
.hero .search-form input[type="search"]::placeholder { color: #9e9e9e; }
.hero .search-form input[type="search"]:focus {
  border-color: var(--accent);
  background: #fcfcfc;
}
.hero .search-form button { height: 38px; border-radius: 0 8px 8px 0; font-size: 14.5px; padding: 0 20px; }
.hero-stats { margin-top: 12px; font-size: 12.5px; color: var(--muted); display: flex; gap: 16px; flex-wrap: wrap; }
.hero-stats b { color: var(--brand); font-variant-numeric: tabular-nums; }

/* ========== 首页：按大类聚合 ========== */
.home-sections { display: block; }
.home-block { margin-bottom: 18px; overflow: hidden; }
.home-block-head {
  display: flex; align-items: center; gap: 12px;
  padding: 15px 22px; border-bottom: 1px solid var(--line);
}
.home-block-head h2 { margin: 0; font-size: 17.5px; }
.home-block-head h2 a { color: var(--ink); }
.home-block-head h2 a:hover { color: var(--brand-2); text-decoration: none; }
.home-block-head .cnt { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.home-block-head .more { margin-left: auto; font-size: 13px; color: var(--brand-2); white-space: nowrap; }
.home-list {
  list-style: none; margin: 0; padding: 8px 22px 14px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 0 26px;
}
.home-list li {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  padding: 7px 0; border-bottom: 1px dashed #e8e8e8;
}
.home-list li a {
  font-size: 14px; line-height: 1.6; color: var(--ink-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.home-list li a:hover { color: var(--brand-2); }
.home-list time { flex: 0 0 auto; font-size: 11.5px; color: #b0b0b0; font-variant-numeric: tabular-nums; }
.home-subs { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 22px 18px; }
.home-subs a {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; padding: 4px 11px; border-radius: 999px;
  background: #fafafa; border: 1px solid var(--line); color: var(--ink-2);
}
.home-subs a:hover { border-color: #e5b98a; background: var(--brand-soft); color: var(--brand); text-decoration: none; }
.home-subs .n { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ========== 区块标题 ========== */
.section { margin-bottom: 26px; }
.section:last-child { margin-bottom: 0; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 14px; margin: 0 0 14px;
}
.section-head h2 {
  margin: 0; font-size: 19px; display: flex; align-items: center; gap: 9px;
}
.section-head h2::before,
.section-head h1.page-title::before {
  content: ""; width: 4px; height: 17px; background: var(--accent); border-radius: 2px;
}
.section-head h1.page-title {
  margin: 0; font-size: 19px; line-height: 1.45; letter-spacing: -.01em;
  display: flex; align-items: center; gap: 9px; color: var(--ink);
}
.section-head .more { font-size: 13.5px; color: var(--muted); }

/* ========== 分类网格 ========== */
.cat-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: 10px;
}
.cat-card {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 13px 15px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px;
  color: var(--ink); font-size: 14.5px; font-weight: 600;
  transition: border-color .15s, background .15s, transform .15s, box-shadow .15s;
}
.cat-card:hover {
  border-color: #e5b98a; background: var(--brand-soft);
  color: var(--brand); text-decoration: none; transform: translateY(-1px);
  box-shadow: 0 8px 20px -14px rgba(138,58,12,.5);
}
.cat-card .count {
  font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #f2f2f2; border-radius: 999px; padding: 2px 8px; flex: 0 0 auto;
}
.cat-card:hover .count { background: #fff; color: var(--brand-2); }

/* ========== 文章列表 ========== */
.post-list { list-style: none; margin: 0; padding: 0; }
.post-item { padding: 19px 20px; border-bottom: 1px solid var(--line); transition: background .15s; }
.post-item:hover { background: #fcfcfc; }
.post-item:last-child { border-bottom: 0; }
.post-item h2, .post-item h3 { margin: 0 0 7px; font-size: 18.5px; font-weight: 700; letter-spacing: -.01em; }
.post-item h2 a, .post-item h3 a { color: var(--ink); }
.post-item h2 a:hover, .post-item h3 a:hover { color: var(--brand-2); text-decoration: none; }
.post-meta {
  font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap;
  align-items: center; gap: 10px;
}
.post-meta a { color: var(--brand-2); }
.post-meta .dot { color: #cfcfcf; }

/* 同类文章：标题左、时间右，字号与站内其它列表一致 */
.related-list { padding: 4px 20px 10px; }
.related-list li {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  padding: 9px 0; border-bottom: 1px dashed #e8e8e8;
}
.related-list li:last-child { border-bottom: 0; }
.related-list li > a { font-size: 14px; color: var(--ink-2); line-height: 1.6; }
.related-list li > a:hover { color: var(--brand-2); }
.related-list li time {
  flex: 0 0 auto; font-size: 12px; color: #b0b0b0;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.post-excerpt {
  margin: 8px 0 0; font-size: 14.5px; line-height: 1.8; color: var(--ink-2);
}

/* ========== 分页 ========== */
.pager { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; padding: 22px 0 4px; }
.pager a, .pager span {
  min-width: 36px; height: 36px; padding: 0 11px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface); color: var(--ink-2); font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.pager a:hover { border-color: #e5b98a; color: var(--brand-2); text-decoration: none; background: var(--brand-soft); }
.pager .current { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }
.pager .dots { border: 0; background: transparent; color: var(--muted); }

/* ========== 文章详情 ========== */
.article-head { padding: 24px 26px 18px; border-bottom: 1px solid var(--line); }
.article-head h1 { margin: 0 0 12px; font-size: 27px; line-height: 1.42; letter-spacing: -.02em; }
.entry-content { padding: 24px 26px 30px; font-size: 17.5px; line-height: 2.05; color: #232323; }
.entry-content > *:first-child { margin-top: 0; }
.entry-content p { margin: 0 0 1.15em; }
.entry-content img {
  max-width: 100%; height: auto; display: block; margin: 20px auto;
  padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 8px;
}
.entry-content a { text-decoration: underline; text-underline-offset: 3px; }
.entry-content h2 {
  font-size: 20px; margin: 1.7em 0 .7em; padding-left: 12px;
  border-left: 4px solid var(--accent);
}
.entry-content h3 { font-size: 17.5px; margin: 1.5em 0 .6em; color: var(--brand); }
.entry-content h4 { font-size: 16px; margin: 1.3em 0 .5em; }
.entry-content ul, .entry-content ol { margin: 0 0 1.05em; padding-left: 1.5em; }
.entry-content li { margin: .3em 0; }
.entry-content blockquote {
  margin: 1.2em 0; padding: 12px 16px; border-left: 4px solid var(--accent);
  background: #f5f5f5; color: #3a3a3a; border-radius: 0 8px 8px 0;
}
.entry-content table {
  width: 100%; border-collapse: collapse; margin: 1.2em 0; font-size: 14.5px;
  display: block; overflow-x: auto;
}
.entry-content th, .entry-content td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; }
.entry-content th { background: #f5f5f5; font-weight: 700; }
.entry-content pre {
  background: #1c1a17; color: #e6dfd3; padding: 14px 16px; border-radius: 8px;
  overflow-x: auto; font-size: 13.5px; line-height: 1.7;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.entry-content code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
.entry-content hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.entry-content iframe { max-width: 100%; }

/* 文章底部导航 */
.article-foot { padding: 18px 26px 22px; border-top: 1px solid var(--line); }
.nav-links-post { display: grid; gap: 10px; }
@media (min-width: 720px) { .nav-links-post { grid-template-columns: 1fr 1fr; } }
.nav-links-post a {
  display: block; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 9px; background: #fafafa; font-size: 14px; color: var(--ink-2);
  transition: border-color .15s, background .15s;
}
.nav-links-post a:hover { border-color: #e5b98a; color: var(--brand-2); text-decoration: none; background: var(--brand-soft); }
.nav-links-post .label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.nav-links-post .next { text-align: right; }

.tag-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; }
.tag-list a {
  font-size: 12.5px; padding: 4px 10px; border-radius: 999px;
  background: #f2f2f2; color: var(--ink-2);
}
.tag-list a:hover { background: var(--brand-soft); color: var(--brand); text-decoration: none; }

/* ========== 侧栏 ========== */
.sidebar { min-width: 0; }
@media (min-width: 1000px) { .sidebar-inner { position: sticky; top: 84px; } }
.widget { padding: 14px 15px; margin-bottom: 14px; }
.widget h3 {
  margin: 0 0 12px; font-size: 15px; display: flex; align-items: center; gap: 8px;
}
.widget h3::before { content: ""; width: 3px; height: 14px; background: var(--accent); border-radius: 2px; }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 7px 0; border-bottom: 1px dashed #e8e8e8; font-size: 14px; }
.widget li:last-child { border-bottom: 0; }
.widget li a { color: var(--ink-2); display: flex; justify-content: space-between; gap: 8px; }
.widget li a:hover { color: var(--brand-2); }
.widget li .n { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; flex: 0 0 auto; }

/* 本分类最热：带序号 */
.hot-list { list-style: none; margin: 0 0 10px; padding: 0; counter-reset: hot; }
.hot-list li {
  counter-increment: hot;
  display: flex; gap: 8px; align-items: baseline;
  padding: 6px 0; border-bottom: 1px dashed #e8e8e8; font-size: 13.5px;
}
.hot-list li:last-child { border-bottom: 0; }
.hot-list li::before {
  content: counter(hot);
  flex: 0 0 18px; font-size: 11px; color: #b8b8b8;
  font-variant-numeric: tabular-nums; text-align: right;
}
.hot-list li a { color: var(--ink-2); line-height: 1.55; }
.hot-list li a:hover { color: var(--brand-2); }
.hot-list li:nth-child(-n+3)::before { color: var(--accent); font-weight: 700; }
.widget-more {
  display: block; text-align: center; font-size: 12.5px;
  padding: 8px 0 1px; border-top: 1px solid var(--line);
  color: var(--brand-2);
}
.widget-more:hover { color: var(--brand); text-decoration: none; }

/* ========== 空状态 ========== */
.empty { padding: 40px 24px; text-align: center; color: var(--muted); }

/* ========== 页脚 ========== */
.site-footer {
  background: transparent;   /* 无色，透出页面底色 */
  color: var(--ink-2);
  border-top: 0;
  margin-top: 0; padding: 16px 0 0; font-size: 13.5px;
}
.footer-cats {
  display: flex; flex-wrap: wrap; gap: 8px;
  background: #ffffff;
  border: 1px solid #e2e2e2;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 26px;
}
.footer-cats a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: #fff; color: var(--ink-2); font-size: 13px;
  transition: border-color .12s, background .12s, color .12s;
}
.footer-cats a:hover { border-color: #e5b98a; background: var(--brand-soft); color: var(--brand); text-decoration: none; }
.footer-cats .n { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.footer-cats a:hover .n { color: var(--brand-2); }
.footer-bottom {
  background: #ffffff;
  border-top: 1px solid var(--line);
  padding: 15px 0;
}
.footer-bottom-inner {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  color: var(--muted);
}
.footer-bottom a { color: var(--muted); }
.footer-bottom a:hover { color: var(--brand); }
.footer-bottom .sep { margin: 0 8px; color: #c6c6c6; }
.footer-bottom .beian-sep { margin: 0 6px; color: #c6c6c6; }
.footer-bottom .icp { white-space: nowrap; }
.footer-bottom .icp:hover { color: var(--brand-2); }

/* ========== 响应式 ========== */
@media (max-width: 1080px) {
  .nav-link { font-size: 15px; padding: 8px 9px; }
}
@media (max-width: 900px) {
  .nav-main {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .nav-main::-webkit-scrollbar { display: none; }
  .nav-link { font-size: 13px; padding: 7px 7px; }
  .nav-drop {
    position: fixed; left: 10px; right: 10px; top: 66px;
    min-width: 0; width: auto; max-height: 64vh; overflow: auto;
  }
}
@media (max-width: 760px) {
  .home-list { grid-template-columns: 1fr; padding: 6px 16px 12px; }
  .home-block-head { padding: 13px 16px; }
  .home-subs { padding: 0 16px 16px; }
}
@media (max-width: 640px) {
  .header-inner { height: 50px; padding: 0 14px; }
  .brand-logo { height: 20px; }
  .brand { font-size: 16.5px; }
  .brand-sub { display: none; }
  .header-search { display: none; }
  .hero { padding: 20px 16px 18px; }
  .hero h1 { font-size: 21px; }
  .hero .search-form input[type="search"] { width: 62vw; }
  .post-item { padding: 16px 15px; }
  .post-item h2, .post-item h3 { font-size: 17px; }
  .article-head { padding: 18px 16px 14px; }
  .article-head h1 { font-size: 21px; }
  .entry-content { padding: 18px 16px 22px; font-size: 16px; line-height: 1.9; }
  .article-foot { padding: 16px; }
  .pager a, .pager span { min-width: 32px; height: 32px; font-size: 13px; }
}

/* ========== 列表项：首图缩略图布局 ========== */
.post-item {
  display: flex; gap: 16px; align-items: flex-start;
}
.post-thumb {
  flex: 0 0 180px; width: 180px; height: 122px;
  display: block; position: relative;
  border-radius: 9px; overflow: hidden;
  background: #f4f4f4;
  border: 1px solid var(--line);
}
.post-thumb img {
  width: 100%; height: 100%; display: block;
  object-fit: cover; object-position: center top;
  transition: transform .25s ease;
}
.post-item:hover .post-thumb img { transform: scale(1.045); }
.post-thumb--none {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #fafafa 0%, #eeeeee 100%);
  color: #b9b9b9;
}
.post-thumb--none svg { width: 34px; height: 34px; }
.post-body { flex: 1 1 auto; min-width: 0; }
.post-body h2 { margin: 0 0 6px; }

@media (max-width: 640px) {
  .post-item { gap: 12px; padding: 14px 15px; }
  .post-thumb { flex: 0 0 104px; width: 104px; height: 76px; border-radius: 8px; }
  .post-thumb--none svg { width: 24px; height: 24px; }
  .post-body h2 { font-size: 15.5px; line-height: 1.5; }
  .post-excerpt { display: none; }
}

/* ========== 首页图片卡片 ========== */
.home-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 12px; padding: 18px 20px 20px;
}
.home-card {
  display: block; overflow: hidden;
  border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink);
  transition: border-color .15s, box-shadow .18s, transform .18s;
}
.home-card:hover {
  border-color: #e5b98a;
  box-shadow: 0 10px 24px -16px rgba(28,26,23,.55);
  transform: translateY(-2px);
  text-decoration: none;
}
.home-card-pic {
  display: block; overflow: hidden; background: #f4f4f4;
  height: 90px;
}
.home-card-pic img {
  width: 100%; height: 100%; display: block;
  object-fit: cover; object-position: center top;
  transition: transform .32s ease;
}
.home-card:hover .home-card-pic img { transform: scale(1.05); }
.home-card-body { display: block; padding: 8px 10px 10px; }
.home-card-title {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 12.5px; font-weight: 600; line-height: 1.5; min-height: 36px;
  color: var(--ink);
}
.home-card-date {
  display: block; margin-top: 6px;
  font-size: 11.5px; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
@media (max-width: 640px) {
  .home-cards { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; padding: 12px 14px 16px; }
  .home-card-body { padding: 8px 10px 10px; }
  .home-card-title { font-size: 12.5px; min-height: 36px; }
  .home-card-pic { height: 72px; }
}

/* ========== 首页分类区块：2 篇带图置顶 ========== */
.home-feat {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  padding: 14px 20px 4px;
}
.home-feat-card {
  display: flex; gap: 12px; align-items: center;
  padding: 8px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink);
  transition: border-color .15s, box-shadow .18s, transform .18s;
}
.home-feat-card:hover {
  border-color: #e5b98a;
  box-shadow: 0 8px 20px -15px rgba(28,26,23,.5);
  transform: translateY(-1px);
  text-decoration: none;
}
.home-feat-pic {
  flex: 0 0 132px; width: 132px; height: 88px;
  border-radius: 7px; overflow: hidden; background: #f4f4f4;
}
.home-feat-pic img {
  width: 100%; height: 100%; display: block;
  object-fit: cover; object-position: center top;
  transition: transform .3s ease;
}
.home-feat-card:hover .home-feat-pic img { transform: scale(1.05); }
.home-feat-body { min-width: 0; flex: 1 1 auto; }
.home-feat-title {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 14px; font-weight: 600; line-height: 1.5; color: var(--ink);
}
.home-feat-date {
  display: block; margin-top: 6px; font-size: 11.5px; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
@media (max-width: 760px) {
  .home-feat { grid-template-columns: 1fr; gap: 10px; padding: 12px 14px 2px; }
  .home-feat-pic { flex: 0 0 104px; width: 104px; height: 72px; }
  .home-feat-title { font-size: 13.5px; }
}

/* 无图占位：分类色淡底 + 大号首字水印 */
.post-thumb--txt {
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
  border: 1px solid var(--line);
}
.post-thumb--txt .pt-big {
  position: absolute; right: 8px; bottom: -16px;
  font-size: 76px; font-weight: 700; line-height: 1; opacity: .10;
  pointer-events: none;
}
.post-thumb--txt .pt-name {
  position: relative; font-size: 12.5px; font-weight: 600; letter-spacing: .05em;
}
@media (max-width: 640px) {
  .post-thumb--txt .pt-big { font-size: 54px; bottom: -12px; right: 4px; }
  .post-thumb--txt .pt-name { font-size: 11.5px; }
}

/* 正文排版增强 */
.entry-content > p:first-of-type::first-letter {
  float: left; font-size: 3.05em; line-height: .92; font-weight: 700;
  color: var(--brand); margin: .06em .12em 0 0;
}
.entry-content .kv {
  position: relative; padding-left: 17px;
}
.entry-content .kv::before {
  content: ""; position: absolute; left: 1px; top: .78em;
  width: 5px; height: 5px; border-radius: 50%; background: var(--brand-2);
}
.entry-content .tip {
  background: #fdf6ee; border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0; padding: 12px 16px;
  color: #5b4a36;
}
.entry-content h2 { scroll-margin-top: 80px; }

.entry-content .kv-h {
  font-weight: 600; color: #1c1c1c; padding-left: 0; margin-top: 1.5em;
}
.entry-content .kv-h::before { display: none; }
.entry-content .kv-h:first-of-type { margin-top: 0; }

/* ==================== 统一字号：24 / 20 / 16 / 14 ==================== */
/* 基准：正文 16px，辅助信息 14px，标题 20px，页面标题 24px，导航栏保持 15.5px */

/* --- 标题 --- */
.hero h1,
h1.page-title,
.article-head h1 { font-size: 24px; }

.home-block-head h2,
.widget h3,
.entry-content h2 { font-size: 20px; }

.entry-content h3,
.entry-content h4 { font-size: 16px; font-weight: 600; }

/* --- 正文类 --- */
body { font-size: 16px; }
.entry-content { font-size: 16px; line-height: 2; }

.post-item h2,
.post-item h3,
.post-item h2 a,
.post-body h2,
.post-body h2 a { font-size: 16px; }

.post-excerpt,
.home-list li a,
.related-list li > a,
.widget li,
.widget li a,
.hot-list li a,
.nav-links-post a,
.nav-links-post .label,
.search-form input[type="search"],
.pager a,
.pager span,
.footer-cats a,
.home-feat-title { font-size: 16px; }

/* --- 辅助信息 --- */
.post-meta,
.post-meta a,
.post-meta time,
.crumbs,
.crumbs a,
.crumbs span,
.home-list time,
.related-list li time,
.subcat,
.subcat .n,
.subcat-label,
.tag-list a,
.post-tags a,
.section-head .more,
.widget-more,
.footer-bottom,
.footer-bottom a,
.home-subs a,
.home-feat-date,
.nav-drop a,
.cat-card .count,
.home-block-head .cnt { font-size: 14px; }

.home-subs .n,
.footer-cats .n,
.nav-drop .n { font-size: 12px; }

@media (max-width: 640px) {
  .hero h1,
  h1.page-title,
  .article-head h1 { font-size: 22px; }
  .post-item h2,
  .post-item h3,
  .post-body h2,
  .post-body h2 a { font-size: 16px; }
  .entry-content { font-size: 16px; }
}

/* --- 统一字号补充：覆盖优先级更高的选择器 --- */
.section-head h1.page-title,
.section-head h2,
.article-head h1 { font-size: 24px; }

.hero p,
.cat-card,
.hot-list li,
.entry-content table,
.entry-content td,
.entry-content th { font-size: 16px; }

.site-footer { font-size: 14px; }
.home-block-head .more { font-size: 14px; }
.cat-card .count { font-size: 14px; }
.widget li .n { font-size: 12px; }

@media (max-width: 640px) {
  .section-head h1.page-title,
  .article-head h1 { font-size: 22px; }
  .hero p { font-size: 16px; }
}

/* ==================== 侧栏列表：单行显示，超出省略 ==================== */
.widget li a {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 8px; min-width: 0;
}
.widget li a .t,
.widget li a > span:first-child {
  flex: 1 1 auto; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hot-list li { min-width: 0; }
.hot-list li a {
  flex: 1 1 auto; min-width: 0; display: block;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* 缩略图裁剪居中，避免顶部截断 */
.post-thumb img { object-position: center center; }

/* ==================== 修复导航下拉：填补 6px 悬停空隙 ==================== */
.nav-item::after {
  content: "";
  position: absolute;
  left: -6px; right: -6px;
  top: 100%;
  height: 7px;           /* 只覆盖 margin-top: 6px 的空隙 */
  display: none;
}
.nav-item:hover::after,
.nav-item:focus-within::after { display: block; }

/* 面板本身也确保可点击、层级在内容之上 */
.nav-drop {
  z-index: 90;
  pointer-events: auto;
}

/* ==================== 导航下拉：彻底修复闪退 ==================== */
/* 1) 面板改为 visibility 控制，悬停结束后延时 250ms 再隐藏，
      给鼠标穿过空隙留出时间 */
.nav-drop {
  display: grid !important;
  opacity: 0;
  visibility: hidden;
  transition: opacity .1s ease, visibility 0s linear .25s;
}
.nav-item:hover .nav-drop,
.nav-item:focus-within .nav-drop {
  opacity: 1;
  visibility: visible;
  transition: opacity .1s ease, visibility 0s linear 0s;
}

/* 2) 在面板上方铺一条与面板同宽的透明桥（254px 宽），
      覆盖 6px 空隙 + 额外 6px */
.nav-drop::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -12px;
  height: 12px;
}

/* 点击展开状态（JS 控制） */
.nav-item.is-open .nav-drop {
  opacity: 1;
  visibility: visible;
  transition: opacity .1s ease, visibility 0s linear 0s;
}
.nav-item.is-open > .nav-link { background: rgba(60,44,20,.08); color: var(--header-ink); }
.nav-item.is-open .caret { transform: rotate(180deg); }

/* ==================== 列表缩略图：原图等比，不裁剪 ==================== */
.post-thumb {
  flex: 0 0 180px;
  width: 180px;
  height: auto;
  border-radius: 9px;
  overflow: hidden;
  background: #f4f4f4;
  border: 1px solid var(--line);
}
.post-thumb img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: initial;
  object-position: center;
}
.post-item:hover .post-thumb img { transform: none; }

/* 占位块保持固定高度 */
.post-thumb--txt { height: 122px; }

@media (max-width: 640px) {
  .post-thumb { flex: 0 0 104px; width: 104px; height: auto; }
  .post-thumb--txt { height: 76px; }
}

/* ==================== 导航栏搜索框加宽 ==================== */
.header-search .search-form input[type="search"] {
  width: 200px;
  height: 33px;
  padding: 0 14px;
}
.header-search .search-form button {
  height: 33px;
  padding: 0 16px;
}

@media (max-width: 1100px) {
  .header-search .search-form input[type="search"] { width: 150px; }
}
@media (max-width: 960px) {
  .header-search .search-form input[type="search"] { width: 180px; }
}

/* ==================== 导航栏 logo 放大 ==================== */
.brand-logo {
  height: 32px;
  max-width: 220px;
}
.brand { gap: 12px; }

@media (max-width: 640px) {
  .brand-logo { height: 27px; max-width: 170px; }
}

/* ==================== logo 与分类导航之间留白 ==================== */
.brand {
  margin-right: 18px;
}
@media (max-width: 640px) {
  .brand { margin-right: 10px; }
}

/* ==================== 全站字号已下调两号（导航栏不变）==================== */
/* 24 → 20、20 → 17、16 → 14、14 → 12；导航栏与头部搜索框保持原样 */

body { font-size: 14px; }
.entry-content { font-size: 14px; }

.hero h1,
h1.page-title,
.section-head h1.page-title,
.article-head h1 { font-size: 20px; }

.home-block-head h2,
.widget h3,
.entry-content h2 { font-size: 17px; }

.entry-content h3,
.entry-content h4 { font-size: 14px; }

.post-item h2,
.post-item h3,
.post-item h2 a,
.post-body h2,
.post-body h2 a,
.post-excerpt,
.home-list li a,
.related-list li > a,
.widget li,
.widget li a,
.hot-list li,
.hot-list li a,
.nav-links-post a,
.nav-links-post .label,
.pager a,
.pager span,
.footer-cats a,
.home-feat-title,
.cat-card,
.entry-content table,
.entry-content td,
.entry-content th,
.search-form input[type="search"] { font-size: 14px; }

.post-meta,
.post-meta a,
.post-meta time,
.crumbs,
.crumbs a,
.crumbs span,
.home-list time,
.related-list li time,
.subcat,
.subcat .n,
.subcat-label,
.tag-list a,
.post-tags a,
.section-head .more,
.widget-more,
.footer-bottom,
.footer-bottom a,
.home-subs a,
.home-feat-date,
.cat-card .count,
.home-block-head .cnt { font-size: 12px; }

/* 导航栏字号（已下调一号） */
.nav-link { font-size: 14.5px; }
.nav-drop a { font-size: 13px; }
.nav-drop .n,
.footer-cats .n,
.home-subs .n { font-size: 12px; }
.header-search .search-form input[type="search"] { font-size: 16px; }
.header-search .search-form button { font-size: 13px; }

@media (max-width: 640px) {
  body { font-size: 14px; }
  .entry-content { font-size: 14px; }
  .hero h1,
  h1.page-title,
  .section-head h1.page-title,
  .article-head h1 { font-size: 18px; }
  .post-item h2,
  .post-item h3,
  .post-body h2,
  .post-body h2 a { font-size: 14px; }
}

/* ==================== 1000px 宽度下：导航栏自适应 ==================== */
.header-search .search-form input[type="search"] {
  width: 150px;
}
.header-inner {
  gap: 10px;
}
.brand {
  margin-right: 12px;
}
.nav-link {
  padding: 9px 10px;
}
.nav-main {
  gap: 0;
}
@media (max-width: 1100px) {
  .header-search .search-form input[type="search"] { width: 130px; }
}

/* ==================== 当前栏目：只保留下划线，不要背景色块 ==================== */
.nav-link.is-active {
  background: transparent;
  color: var(--brand);
  font-weight: 600;
}
.nav-link.is-active::after {
  transform: scaleX(1);
  opacity: 1;
}
/* 导航项 hover 时也不要有底色块，只留文字 */
.nav-item:hover > .nav-link,
.nav-item:focus-within > .nav-link {
  background: transparent;
  color: var(--brand);
}
.nav-link:hover {
  background: transparent;
  color: var(--brand);
}

/* ==================== Hero 描述文字降两号 ==================== */
.hero p {
  font-size: 14px;
  line-height: 1.65;
}
@media (max-width: 640px) {
  .hero p { font-size: 13px; }
}
