/*
Theme Name: 赣石百科
Theme URI: https://www.jxslgs.com/
Author: 赣石百科
Author URI: https://www.jxslgs.com/
Description: 面向观赏石、奇石与石材内容站点的中文杂志型主题。支持两级栏目导航、杂志式首页、文章自动目录、长文榜单与同栏目精选；宣纸米白配色，移动优先，深浅色跟随系统。专为内容型站点设计，装上即可用，无需任何插件。
Version: 1.4.16
Requires at least: 5.9
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ganshi-baike
Tags: blog, two-columns, right-sidebar, custom-colors, custom-menu, custom-logo, featured-images, translation-ready, full-width-template, theme-options
*/

/* ==========================================================================
   本文件只放两件事：
     1. 上面的主题头信息（WordPress 靠它识别主题）
     2. WordPress 核心类与区块的样式适配
   站点视觉系统在 assets/css/site.css，由 inc/assets.php 入队。
   ========================================================================== */

/* ---------------------------------------------------------------- 可访问性 */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

.screen-reader-text:focus {
  background: var(--surface, #fff);
  border-radius: 6px;
  box-shadow: 0 0 2px 2px rgba(0, 0, 0, .2);
  clip: auto !important;
  clip-path: none;
  color: var(--ink, #2E2B27);
  display: block;
  font-size: 14px;
  height: auto;
  left: 8px;
  line-height: normal;
  padding: 14px 22px;
  text-decoration: none;
  top: 8px;
  width: auto;
  z-index: 100000;
}

/* ------------------------------------------------------------ 后台工具条 */
body.admin-bar .site-head { top: 32px; }
body.admin-bar .nav { top: 32px; }
body.admin-bar .read-progress { top: 32px; }

@media screen and (max-width: 782px) {
  body.admin-bar .site-head { top: 46px; }
  body.admin-bar .nav { top: 46px; }
  body.admin-bar .read-progress { top: 46px; }
}

/* -------------------------------------------------------------- 站点 Logo */
/* 静态站当初用的是纯文字品牌（.brand-mark 色块字），没有 logo 图，
   所以 site.css 里完全没有 .custom-logo 的约束。启用自定义 Logo 后，
   图片会按原图尺寸渲染并撑开 62px 高的头部，必须在这里给定尺寸。
   高度由 CSS 变量 --logo-h 控制，可在「外观 → 自定义 → 品牌与页脚」调整；
   宽度另有上限，避免宽幅图把右上角的图标按钮挤出屏幕。 */
.brand .custom-logo {
  display: block;
  width: auto;
  height: auto;
  max-height: var(--logo-h, 34px);
  max-width: 190px;
  object-fit: contain;
  border-radius: 4px; /* 方形底色 Logo 的圆角，透明 PNG 无影响 */
}

/* 页脚品牌行（.brand-lg）里的 Logo 略大一号 */
.brand-lg .custom-logo {
  max-height: calc(var(--logo-h, 34px) * 1.16);
  max-width: 240px;
}

/* 小屏收紧，避免宽幅 Logo 把右侧图标挤掉 */
@media (max-width: 640px) {
  .brand .custom-logo { max-width: 148px; }
}

/* 极窄屏（小屏手机竖排）进一步收 */
@media (max-width: 400px) {
  .brand .custom-logo { max-width: 118px; }
}

/* ------------------------------------------- 首页首屏（移动端收紧） */
/* 手机的第一屏如果被站点自我介绍占满，搜索框和最新内容全被挤到屏外。
   这里收紧 Hero 的留白，并把介绍压到 3 行：完整文字仍在页面里，SEO 不受影响。 */
@media (max-width: 639px) {
  .hero { padding: 30px 0 26px; }
  .hero .hero-kicker { margin-bottom: 12px; }
  .hero .hero-title { font-size: 25px; margin-bottom: 10px; }
  /* 标题里填了整段介绍时（常见误用），手机上压到 4 行，别把首屏占满 */
  .hero .hero-title {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .hero .hero-sub {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 14px;
    line-height: 1.75;
    margin-bottom: 14px;
  }
  .hero .hero-tags { margin-bottom: 16px; }
  .hero .hero-stats { padding-top: 14px; gap: 10px 8px; }
}

/* -------------------------------------------------------------- 通用对齐 */
.alignleft {
  float: left;
  margin: .45em 1.5em 1em 0;
}

.alignright {
  float: right;
  margin: .45em 0 1em 1.5em;
}

.aligncenter {
  display: block;
  margin: 1.3em auto;
}

/* 区块编辑器图片「居中」：实际结构为 div.wp-block-image > figure.aligncenter，
   aligncenter 在内部 figure 上、wp-block-image 在外层 div 上，二者不在一个元素，
   WP 核心 .wp-block-image.aligncenter 规则不匹配，导致图片（display:block + 固定宽度）
   停在容器左侧、右侧留白、看起来没居中。
   修复要点（1.4.7）：
     - figure 用 display:table 收缩到图片宽度，配合 margin:auto 真正居中；
     - 必须 width:auto 覆盖下方 .rich figure 的 width:100%!important，否则 table 被撑满；
     - figcaption 用 table-caption 在图片正下方水平居中单行显示（WP 核心默认行为）。
   1.4.6 误用 display:block，破坏了 figcaption 的 table-caption 渲染，
   导致图注塌缩成竖排窄条；本版改回 table 并显式锁定 figcaption。
   移动端 .rich img 仍受 max-width:100% 约束，table 会随之收缩，不会溢出。 */
.rich .wp-block-image .aligncenter,
.rich .wp-block-image.aligncenter,
.rich .aligncenter {
  display: table !important;
  width: auto !important;
  margin-left: auto !important;
  margin-right: auto !important;
  text-align: center;
}
.rich .wp-block-image .aligncenter img,
.rich .wp-block-image.aligncenter img,
.rich .aligncenter img {
  display: block !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
.rich .wp-block-image .aligncenter figcaption,
.rich .wp-block-image.aligncenter figcaption,
.rich .aligncenter figcaption {
  display: table-caption !important;
  caption-side: bottom;
  text-align: center;
}

.rich .alignleft,
.rich .alignright { max-width: 52%; }

@media (max-width: 640px) {
  .rich .alignleft,
  .rich .alignright {
    float: none;
    display: block;
    max-width: 100%;
    margin: 1.3em auto;
  }
}

/* ---------------------------------------------------------- 经典编辑器 */
.wp-caption {
  max-width: 100%;
  margin: 1.5em 0;
}

.wp-caption img {
  border-radius: var(--radius-s, 8px);
}

.wp-caption-text,
.wp-caption .wp-caption-text {
  font-size: 13px;
  color: var(--ink-faint, #9A9187);
  text-align: center;
  margin-top: .7em;
  line-height: 1.6;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin: 1.6em 0;
}

.gallery-item {
  margin: 0;
  max-width: 100%;
}

.gallery-icon img {
  border-radius: var(--radius-s, 8px);
  width: 100%;
}

.gallery-caption {
  font-size: 12px;
  color: var(--ink-faint, #9A9187);
  text-align: center;
  margin-top: .4em;
}

.bypostauthor > .comment-body .comment-author-name::after {
  content: " · 作者";
  font-size: 11px;
  color: var(--primary, #8A5A3B);
}

/* ------------------------------------------------------------ 区块基础 */
.rich .wp-block-image {
  margin: 1.7em 0;
}

.rich .wp-block-image img {
  border-radius: var(--radius-s, 8px);
}

.rich .wp-block-table {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.rich .wp-block-table table {
  min-width: 520px;
  margin: 0;
}

.rich .wp-block-table figcaption,
.rich .wp-block-table .wp-element-caption {
  font-size: 13px;
  color: var(--ink-faint, #9A9187);
  margin-top: .7em;
  text-align: center;
}

.rich .wp-block-separator {
  border: 0;
  border-top: 1px dashed var(--line-strong, #D8CCBB);
  margin: 2.2em 0;
}

.rich .wp-block-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.rich .wp-block-button__link {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--primary, #8A5A3B);
  color: #FAF7F2;
  font-size: 15px;
  border-bottom: 0;
}

.rich .wp-block-columns {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.rich .wp-block-column {
  flex: 1 1 240px;
  min-width: 0;
}

.rich .wp-block-code,
.rich .wp-block-preformatted {
  background: var(--bg-alt, #F4EFE7);
  border-radius: var(--radius-s, 8px);
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 14px;
}

.rich .wp-block-group {
  margin: 1.6em 0;
}

.rich .wp-block-media-text {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

@media (min-width: 640px) {
  .rich .wp-block-media-text {
    grid-template-columns: 1fr 1fr;
    align-items: center;
  }
}

.rich .has-text-align-center { text-align: center; }
.rich .has-text-align-right { text-align: right; }
.rich .has-text-align-left { text-align: left; }

.rich .wp-element-caption {
  font-size: 13px;
  color: var(--ink-faint, #9A9187);
  text-align: center;
  margin-top: .7em;
}

/* ------------------------------------------------------- 置顶标记 */
.card.is-sticky .card-title::after {
  content: "置顶";
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 400;
  vertical-align: 2px;
  color: var(--primary, #8A5A3B);
  background: var(--primary-wash, #F3E9E0);
  border-radius: 999px;
}

/* ------------------------------------------------------------ 评论区 */
.comments-area {
  margin: 52px auto 0;
  padding-top: 30px;
  border-top: 1px solid var(--line, #E8E0D5);
}

.comments-title,
.comment-reply-title {
  font-size: 19px;
  margin-bottom: 18px;
}

.comment-list {
  margin-bottom: 30px;
}

.comment-list .children {
  margin-left: 0;
  padding-left: 20px;
  border-left: 2px solid var(--line, #E8E0D5);
}

.comment-body {
  padding: 16px 0;
  border-bottom: 1px solid var(--line, #E8E0D5);
}

.comment-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--ink-faint, #9A9187);
  margin-bottom: 8px;
}

.comment-author img {
  border-radius: 50%;
}

.comment-author-name {
  font-size: 14.5px;
  color: var(--ink, #2E2B27);
  font-weight: 500;
}

.comment-content {
  font-size: 15.5px;
  line-height: 1.8;
}

.comment-content p + p {
  margin-top: .9em;
}

.comment-respond {
  margin-top: 26px;
}

.comment-form p {
  margin-bottom: 14px;
}

.comment-form label {
  display: block;
  font-size: 13.5px;
  color: var(--ink-soft, #6B635A);
  margin-bottom: 6px;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  padding: 10px 13px;
  font-size: 15px;
  color: var(--ink, #2E2B27);
  background: var(--surface, #fff);
  border: 1px solid var(--line-strong, #D8CCBB);
  border-radius: var(--radius-s, 8px);
  transition: border-color .16s ease;
}

.comment-form input:focus,
.comment-form textarea:focus {
  border-color: var(--primary, #8A5A3B);
  outline: none;
}

.comment-form .form-submit input,
.comment-form .submit {
  display: inline-block;
  width: auto;
  padding: 11px 26px;
  font-size: 15px;
  color: #FAF7F2;
  background: var(--primary, #8A5A3B);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}

.comment-form .submit:hover {
  background: var(--primary-deep, #6E452B);
}

.comment-notes,
.logged-in-as {
  font-size: 13px;
  color: var(--ink-faint, #9A9187);
}

/* ------------------------------------------------- 极简兜底分页样式 */
.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  font-size: 14.5px;
  color: var(--ink-soft, #6B635A);
  background: var(--surface, #fff);
  border: 1px solid var(--line, #E8E0D5);
  border-radius: var(--radius-s, 8px);
}

.page-numbers.current {
  color: #FAF7F2;
  background: var(--primary, #8A5A3B);
  border-color: var(--primary, #8A5A3B);
}

/* 多页文章的 wp_link_pages 输出的是裸 a，这里补上与分页器一致的样式 */
.pager > a:not(.pager-btn) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  font-size: 14.5px;
  color: var(--ink-soft, #6B635A);
  background: var(--surface, #fff);
  border: 1px solid var(--line, #E8E0D5);
  border-radius: var(--radius-s, 8px);
  transition: color .16s ease, background .16s ease, border-color .16s ease;
}

.pager > a:not(.pager-btn):hover {
  color: #FAF7F2;
  background: var(--primary, #8A5A3B);
  border-color: var(--primary, #8A5A3B);
}

/* ---------------------------------------------------- 侧栏小工具默认样式 */
.side-box .widget-title,
.side-box .side-h {
  font-size: 15px;
  font-weight: 700;
}

.side-box ul li a {
  display: block;
  padding: 7px 0;
  font-size: 14.5px;
  color: var(--ink-soft, #6B635A);
  border-bottom: 1px solid var(--line, #E8E0D5);
}

.side-box ul li:last-child a {
  border-bottom: 0;
}

.side-box ul li a:hover {
  color: var(--primary, #8A5A3B);
}

.side-box .tagcloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.side-box .tagcloud a {
  padding: 5px 12px;
  font-size: 13px !important;
  color: var(--ink-soft, #6B635A);
  background: var(--bg-alt, #F4EFE7);
  border-radius: 999px;
}

.side-box .tagcloud a:hover {
  color: #FAF7F2;
  background: var(--primary, #8A5A3B);
}

/* -------------------------------------------------------- 头部搜索面板 */
.site-head { position: sticky; }

.head-search {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  padding: 14px 18px;
  background: var(--surface, #fff);
  border-bottom: 1px solid var(--line, #E8E0D5);
  box-shadow: var(--shadow-1, 0 1px 2px rgba(60, 45, 30, .05));
  animation: ganshi-drop .18s var(--ease, ease);
}

@keyframes ganshi-drop {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .head-search { animation: none; }
}

.head-search form {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: var(--wrap, 1180px);
  margin: 0 auto;
}

.head-search .ico {
  color: var(--ink-faint, #9A9187);
  margin-left: 6px;
  margin-right: -32px;
  z-index: 1;
}

.head-search input[type="search"] {
  flex: 1;
  min-width: 0;
  padding: 11px 16px 11px 40px;
  font-size: 15px;
  color: var(--ink, #2E2B27);
  background: var(--bg-alt, #F4EFE7);
  border: 1px solid var(--line, #E8E0D5);
  border-radius: 999px;
  transition: border-color .16s ease;
}

.head-search input[type="search"]:focus {
  border-color: var(--primary, #8A5A3B);
  outline: none;
}

/* ------------------------------------------------------------ 窄栏正文 */
.sec-narrow .rich {
  max-width: var(--wrap-narrow, 860px);
  margin: 0 auto;
}

/* ------------------------------------------------------------ 搜索高亮 */
mark {
  padding: 0 2px;
  color: inherit;
  background: var(--accent-wash, #FBF1DC);
  border-radius: 3px;
}

/* -------------------------------------------------- 全宽页面模板（无侧栏） */
/* site.css 把 .art-layout 定成了两栏网格，这里用双类提升权重，才能在它之后生效 */
.art-layout.art-layout-full {
  display: block;
}

.art-main-full {
  /* 比两栏时的正文栏（约 830px）更宽，但仍控制在易读范围内 */
  max-width: 980px;
  margin: 0 auto;
}

/* ----------------------------------------------- 小工具 / get_search_form */
.search-mini {
  display: flex;
  gap: 8px;
}

.search-mini .search-field {
  flex: 1;
  min-width: 0;
  padding: 9px 14px;
  font-size: 14.5px;
  color: var(--ink, #2E2B27);
  background: var(--surface, #fff);
  border: 1px solid var(--line-strong, #D8CCBB);
  border-radius: 999px;
  transition: border-color .16s ease;
}

.search-mini .search-field:focus {
  outline: none;
  border-color: var(--primary, #8A5A3B);
}

.search-mini .search-submit {
  flex: none;
  padding: 9px 18px;
  font-size: 14px;
  color: #FAF7F2;
  background: var(--primary, #8A5A3B);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: background .16s ease;
}

.search-mini .search-submit:hover {
  background: var(--primary-deep, #6E452B);
}

/* ------------------------------------------------------------ 评论补充 */
.no-comments {
  font-size: 14px;
  color: var(--ink-faint, #9A9187);
}

/* 「记住信息」勾选框要和文字同行，别被 .comment-form label 的 block 顶到下一行 */
.comment-form .comment-form-cookies-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.comment-form .comment-form-cookies-consent input {
  margin: 4px 0 0;
  flex: none;
}

.comment-form .comment-form-cookies-consent label {
  display: inline;
  margin-bottom: 0;
}

/* ------------------------------------------------------------ 广告位 */
/* 后台「外观 → 自定义 → 广告位」填写代码后由 inc/ads.php 输出。
   这里只负责排版：统一间距、限宽防溢出、角标、卡片流跨整行。
   广告本身多为第三方 iframe / 图片，尺寸不可控，所以一律给容器加约束。 */
.ad-slot {
  position: relative;
  margin: 26px 0;
  text-align: center;
}

.ad-slot .ad-label {
  display: inline-block;
  margin-bottom: 8px;
  padding: 0 4px;
  font-size: 11px;
  line-height: 16px;
  letter-spacing: .08em;
  color: var(--ink-faint, #9A9187);
  border: 1px solid var(--line-strong, #D8CCBB);
  border-radius: 3px;
  opacity: .8;
}

.ad-slot .ad-body {
  overflow: hidden;
}

.ad-slot .ad-body > * {
  max-width: 100%;
}

.ad-slot img,
.ad-slot iframe,
.ad-slot ins,
.ad-slot video {
  max-width: 100%;
}

.ad-slot img {
  height: auto;
  margin: 0 auto;
}

/* 页头与页脚横幅：跟主体同宽，不贴边 */
.ad-head,
.ad-footer {
  max-width: var(--wrap, 1180px);
  margin: 0 auto;
  padding: 14px 20px;
}

.ad-head {
  padding-bottom: 0;
}

.ad-footer {
  padding-top: 0;
  padding-bottom: 30px;
}

/* 文章正文里：上下留白收一点，别把正文切得太碎 */
.rich .ad-slot {
  margin: 22px 0;
}

/* 正文上方的广告靠近文章头，不能再叠一个大间距 */
.art-main > .ad-post_top {
  margin-top: 4px;
}

/* 侧栏广告 */
.art-side .ad-slot {
  margin: 0 0 16px;
  padding: 14px;
  background: var(--surface, #fff);
  border: 1px solid var(--line, #E8E0D5);
  border-radius: var(--radius, 14px);
}

/* 列表流广告：跨整行，虚线框表示「这是广告，不是文章卡」 */
.grid-cards .ad-card {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 18px 16px;
  background: var(--surface-2, #FBF8F3);
  border: 1px dashed var(--line-strong, #D8CCBB);
  border-radius: var(--radius, 14px);
}

@media (max-width: 640px) {
  .ad-slot {
    margin: 18px 0;
  }

  .ad-head,
  .ad-footer {
    padding-left: 14px;
    padding-right: 14px;
  }

  /* 移动端隐藏（自定义器开关） */
  .ad-hide-mobile {
    display: none !important;
  }
}

/* ------------------------------------------------ 首页 Hero 桌面双栏 */
/* 标题、搜索、热门标签在左，站点数据卡在右，解决「标题占半屏、右边全空」。
   用 :has(.hero-stats) 判断：没有数据块的站点自动退回单列，不会留空栏。
   不支持 :has 的老浏览器同样退回单列，属于安全降级。 */
@media (min-width: 900px) {
  .hero:has(.hero-stats) .hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    grid-template-areas:
      'kicker stats'
      'title  stats'
      'search stats'
      'tags   stats';
    column-gap: 48px;
    align-items: start;
  }

  .hero:has(.hero-stats) .hero-kicker {
    grid-area: kicker;
    justify-self: start;
  }

  .hero:has(.hero-stats) .hero-title {
    grid-area: title;
    margin-bottom: 18px;
  }

  .hero:has(.hero-stats) .hero-search {
    grid-area: search;
    margin-bottom: 14px;
  }

  .hero:has(.hero-stats) .hero-tags {
    grid-area: tags;
    margin-bottom: 0;
    align-self: end;
  }

  .hero:has(.hero-stats) .hero-stats {
    grid-area: stats;
    align-self: center;
    grid-template-columns: 1fr 1fr;
    gap: 18px 14px;
    max-width: none;
    padding: 22px 24px;
    background: var(--surface, #fff);
    border: 1px solid var(--line, #E8E0D5);
    border-radius: var(--radius, 14px);
    box-shadow: var(--shadow-1);
  }
}

/* ------------------------------------------- 长标题自动降级 */
/* 「Hero 主标题」里填了整段站点介绍时（>24 字），不再用 46px 大字排版：
   字号收到 30px 档、行高放宽、限宽加大，三四行收住，首屏还给搜索和内容。 */
.hero.has-long-title .hero-title {
  font-size: clamp(20px, 2.4vw, 30px);
  line-height: 1.62;
  letter-spacing: .2px;
  max-width: 36em;
  margin-bottom: 12px;
}

.hero.has-long-title {
  padding: 44px 0 40px;
}

@media (min-width: 640px) {
  .hero.has-long-title {
    padding: 52px 0 46px;
  }
}

/* --------------------------------- 栏目卡末行补位 */
/* 栏目数量不是 3 的倍数时，最后一行会留空位：
   剩 2 张时第二张跨 2 列、剩 1 张时独占整行，网格始终铺满。 */
@media (min-width: 900px) {
  .cat-cards .cat-card:last-child:nth-child(3n + 2) {
    grid-column: span 2;
  }

  .cat-cards .cat-card:last-child:nth-child(3n + 1) {
    grid-column: 1 / -1;
  }
}

/* --------------------------------- 移动端头部撤掉毛玻璃 */
/* 关键修复：backdrop-filter 会把 header 变成 fixed 后代的「包含块」，
   移动端抽屉导航（#siteNav，fixed + top:0 + bottom:0）只能被拉到
   header 本身的高度（约 100px），表现为右上一个白色小盒子。
   移动端改用实底背景，桌面端保留毛玻璃不受影响。 */
@media (max-width: 899px) {
  html .site-head {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: var(--bg, #FAF7F2);
  }
}

/* --------------------------------- 暗色模式下的 Logo */
/* 透明底、深色字的 Logo 压在深色头部上会看不见。
   反色 + 色相旋转：明暗翻转、颜色倾向保留，文字 Logo 变浅色可读，
   彩色 Logo 明暗关系也不反转。 */
html[data-theme="dark"] .brand .custom-logo {
  filter: invert(1) hue-rotate(180deg);
}

/* ================================================================ 1.3.0 */

/* ---- 首页 Hero 搜索：新结构（ico+input 包在 .hs-field 里）----
   图标的 absolute 定位基准从 .hero-search 改为 .hs-field，
   否则图标会跑到整个表单最左侧、和输入框文字重叠错位。 */
.hs-field {
  position: relative;
  display: flex;
  flex: 1;
  min-width: 0;
}
.hs-field input {
  width: 100%;
  flex: 1;
}
.hero-search > .btn { flex: none; }

/* ---- 正文阅读宽度 ----
   审计指出正文行长 57-65 字偏长；46em（约 44 字/行）兼顾易读与版面，
   并在栏内居中，避免正文与侧栏之间出现一大块空地。 */
.art-main {
  max-width: 46em;
  margin-inline: auto;
}

/* ---- 标签云统一字号 ----
   WordPress 标签云默认按文章数输出行内 font-size（8-22px），
   视觉上参差不齐；统一为 13px 并保留 !important 压过行内样式。 */
.side-box .tagcloud a,
.art-side .tagcloud a,
.wp-block-tag-cloud a {
  font-size: 13px !important;
}

/* ---- 手机端分类卡片改两列 ----
   <640px 时原来是一列大卡，首页被拉得过长；改成两列并
   隐藏描述与箭头，只保留名称和文章数。 */
@media (max-width: 639px) {
  .cat-cards { grid-template-columns: 1fr 1fr; }
  .cat-card { padding: 16px 14px; }
  .cat-card .cc-desc,
  .cat-card .cc-go { display: none; }
  .cc-name { font-size: 16.5px; letter-spacing: .2px; }  /* 两列窄卡里降一点字号，
                                                           配合 text-wrap:balance 避免「园林景观石」断成孤字 */
}

/* ================================================================ 1.4.0 首页 v2 骨架 */

/* ---- Hero 实景图布局 ---- */
.hero-fig { margin: 0; }
.hero-fig img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: var(--radius-l);
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.hero-fig figcaption {
  font-size: 11.5px; color: var(--ink-faint);
  margin-top: 10px; letter-spacing: .01em;
}

@media (min-width: 900px) {
  .hero.has-fig .hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 440px);
    grid-template-areas:
      'kicker fig'
      'title  fig'
      'sub    fig'
      'stats  fig'
      'search fig'
      'tasks  fig';
    column-gap: 48px;
    align-items: start;
  }
  .hero.has-fig .hero-kicker { grid-area: kicker; justify-self: start; }
  .hero.has-fig .hero-title { grid-area: title; margin-bottom: 12px; }
  .hero.has-fig .hero-sub { grid-area: sub; margin: 0 0 10px; max-width: 34em; }

  /* 有实景图时，站点数据从 2×2 卡片降为一行小字（v2 原型样式） */
  .hero.has-fig .hero-stats {
    grid-area: stats;
    display: flex; flex-wrap: wrap; align-items: baseline;
    gap: 8px 22px;
    padding-top: 0; margin-bottom: 6px;
  }
  .hero.has-fig .hero-stats .hs { flex-direction: row; align-items: baseline; gap: 5px; }
  .hero.has-fig .hero-stats .hs b { font-size: 17px; }
  .hero.has-fig .hero-stats .hs span { font-size: 12.5px; }

  .hero.has-fig .hero-search { grid-area: search; max-width: 520px; margin-bottom: 14px; }
  .hero.has-fig .tasks { grid-area: tasks; margin: 10px 0 0; }
  .hero.has-fig .hero-fig { grid-area: fig; align-self: center; }
}

@media (max-width: 899px) {
  .hero.has-fig .hero-fig { display: none; }
  .hero.has-fig .hero-stats {
    display: flex; flex-wrap: wrap; align-items: baseline;
    gap: 8px 20px; padding-top: 14px;
  }
  .hero.has-fig .hero-stats .hs { flex-direction: row; align-items: baseline; gap: 5px; }
  .hero.has-fig .hero-stats .hs b { font-size: 19px; }
}

/* ---- 任务式入口四卡 ----
   左缘色条按卡片序号取四种低饱和点缀色，暗色模式提亮。 */
.tasks {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  margin: 22px 0 0;
}
.task {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 13px 15px 12px;
  position: relative; overflow: hidden;
  transition: border-color .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease);
}
.task::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--dot, var(--primary));
}
.task:nth-child(1) { --dot: #B98A4B; }
.task:nth-child(2) { --dot: #8C5A6B; }
.task:nth-child(3) { --dot: #6E7A5A; }
.task:nth-child(4) { --dot: #5B7081; }
html[data-theme="dark"] .task:nth-child(1) { --dot: #C99C5E; }
html[data-theme="dark"] .task:nth-child(2) { --dot: #A87583; }
html[data-theme="dark"] .task:nth-child(3) { --dot: #8B986F; }
html[data-theme="dark"] .task:nth-child(4) { --dot: #7C93A4; }
.task:hover { border-color: var(--line-strong); transform: translateY(-1px); box-shadow: var(--shadow-1); }
.task b { display: block; font-size: 14.5px; font-weight: 600; letter-spacing: .01em; }
.task span { display: block; font-size: 12.5px; color: var(--ink-soft); margin-top: 3px; line-height: 1.55; }

/* ---- 别买错：鉴伪 + 行情表双面板 ---- */
.duo { display: grid; grid-template-columns: 1.12fr .88fr; gap: 20px; align-items: start; }
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px 8px;
}
.panel h3 {
  font-size: 13px; font-weight: 600; color: var(--ink-faint);
  letter-spacing: .08em; margin: 0 0 12px;
}
.dec { display: flex; gap: 12px; padding: 13px 0; border-top: 1px solid var(--line); }
.dec:first-of-type { border-top: 0; padding-top: 0; }
.dec:hover .dec-t { color: var(--primary); }
.pill {
  flex: none; font-size: 11.5px; color: var(--primary);
  background: var(--primary-wash);
  border-radius: 4px; padding: 2px 7px; height: 21px; line-height: 17px; margin-top: 2px;
}
.dec-body { min-width: 0; }
.dec-t { display: block; font-size: 14.5px; line-height: 1.55; font-weight: 600; transition: color .18s var(--ease); }
.dec-c {
  display: block; font-size: 12.5px; color: var(--ink-soft); line-height: 1.6;
  margin-top: 5px; padding-left: 9px; border-left: 2px solid var(--line);
}
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; font-weight: 500; color: var(--ink-faint);
  font-size: 12px; padding: 0 0 9px; border-bottom: 1px solid var(--line);
}
.tbl td { padding: 9px 0; border-bottom: 1px solid var(--line); color: var(--ink-soft); }
.tbl td:first-child { color: var(--ink); font-weight: 600; }
.tbl th:nth-child(n+2), .tbl td:nth-child(n+2) { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr:last-child td { border-bottom: 0; }
.note { font-size: 11.5px; color: var(--ink-faint); margin: 10px 0 14px; line-height: 1.6; }

/* ---- 产地路线时间轴 ----
   桌面横向 5 站连线，窄屏转竖向单列。 */
.route {
  list-style: none; margin: 6px 0 0; padding: 0;
  position: relative;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px;
  counter-reset: route;
}
.route::before {
  content: ''; position: absolute;
  left: 5px; right: calc((100% - 56px) / 5 + 11px); top: 6px;
  height: 1px; background: var(--line);
}
.stop { position: relative; padding: 24px 8px 0 0; }
.stop::before {
  content: ''; position: absolute; top: 1px; left: 0;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--primary);
}
.stop b { display: block; font-size: 14.5px; font-weight: 600; }
.stop b a { display: inline-block; padding: 8px 4px 8px 0; margin: -8px 0 -8px -4px; }
.stop b a:hover { color: var(--primary); }
.stop em { font-style: normal; font-size: 12px; color: var(--primary); display: block; margin-top: 2px; }
.stop span { display: block; font-size: 12.5px; color: var(--ink-soft); margin-top: 5px; line-height: 1.55; }

@media (max-width: 899px) {
  .route { grid-template-columns: 1fr; gap: 0; }
  .route::before { left: 5px; right: auto; top: 6px; bottom: 14px; width: 1px; height: auto; }
  .stop { padding: 0 0 20px 26px; }
  .stop:last-child { padding-bottom: 4px; }
  .stop::before { top: 5px; }
}

/* ---- 造景装修横幅 ---- */
.scen-band {
  background: var(--bg-alt);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 52px 0; margin: 20px 0 0;
}
.scen-band-in { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; align-items: center; }
.band-img { margin: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.band-img img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3; display: block; }
.band-body h2 {
  font-family: var(--font-serif);
  font-size: clamp(21px, 2.4vw, 26px); font-weight: 600; margin: 0;
}
.band-body > p { font-size: 14.5px; color: var(--ink-soft); line-height: 1.8; margin: 10px 0 0; max-width: 30em; }
.blist { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 2px; max-width: 520px; }
.blist a {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 0; border-top: 1px solid var(--line);
  font-size: 14.5px; transition: color .18s var(--ease);
}
.blist a::after { content: '→'; margin-left: auto; color: var(--ink-faint); font-size: 13px; transition: color .18s var(--ease); }
.blist a:hover, .blist a:hover::after { color: var(--primary); }
.blist span {
  font-size: 11.5px; color: var(--ink-soft);
  border: 1px solid var(--line-strong); border-radius: 4px;
  padding: 1px 6px; flex: none;
}
.band-cta {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 20px; font-size: 14.5px; font-weight: 600;
  color: #fff; background: var(--primary);
  border-radius: 999px; padding: 11px 22px;
  transition: filter .18s var(--ease);
}
html[data-theme="dark"] .band-cta { color: #2A1B12; }
.band-cta:hover { filter: brightness(1.08); }

@media (max-width: 899px) {
  .scen-band-in { grid-template-columns: 1fr; gap: 24px; }
}

/* ---- 最新更新：前 2 条带图横卡 + 双栏文字行 ---- */
.latest-top {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  margin-bottom: 8px;
}
.row-media {
  display: grid; grid-template-columns: minmax(0, 42%) 1fr; gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.row-media:hover { border-color: var(--line-strong); box-shadow: var(--shadow-1); }
.rm-img { display: block; min-height: 100%; }
.rm-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rm-img.is-empty {
  display: grid; place-items: center;
  background: var(--surface-2);
  font-family: var(--font-serif); font-size: 22px; letter-spacing: 4px;
  color: var(--ink-faint); opacity: .55;
}
.rm-body { padding: 14px 16px 14px 0; min-width: 0; display: flex; flex-direction: column; }
.rm-cat {
  font-size: 11.5px; color: var(--primary); background: var(--primary-wash);
  border-radius: 4px; padding: 1px 7px; align-self: flex-start;
}
.rm-t { font-size: 15px; font-weight: 600; line-height: 1.5; margin-top: 8px; }
.row-media:hover .rm-t { color: var(--primary); }
.rm-meta { font-size: 12px; color: var(--ink-faint); margin-top: auto; padding-top: 10px; }
.latest-ad { grid-column: 1 / -1; }

.rows2 { display: grid; grid-template-columns: 1fr 1fr; grid-auto-flow: column; grid-template-rows: repeat(4, auto); gap: 0 40px; }
.row2 {
  display: flex; align-items: baseline; gap: 14px;
  padding: 13px 0; border-bottom: 1px solid var(--line);
  min-width: 0;
}
.row2:hover .row2-t { color: var(--primary); }
.row2-d { flex: none; font-size: 12px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.row2-t { font-size: 14.5px; line-height: 1.55; flex: 1; min-width: 0; transition: color .18s var(--ease); }
.row2-c {
  flex: none; font-size: 11.5px; color: var(--ink-soft);
  border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px;
}

@media (max-width: 899px) {
  .latest-top { grid-template-columns: 1fr; }
  .rows2 { grid-template-columns: 1fr; grid-auto-flow: row; grid-template-rows: none; }
}

/* ---- 关于本站 + KPI ---- */
.about-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: start; }
.about-body h2 { font-family: var(--font-serif); font-size: 22px; font-weight: 600; margin: 0 0 12px; }
.about-body p { font-size: 14.5px; line-height: 1.85; color: var(--ink-soft); margin: 0; }
.about-body p + p { margin-top: 10px; }
.kpi {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: var(--line); border: 1px solid var(--line);
  border-radius: var(--radius-s); overflow: hidden;
}
.kpi div { background: var(--surface); padding: 14px 16px; }
.kpi b { display: block; font-family: var(--font-serif); font-size: 22px; font-weight: 600; line-height: 1.2; }
.kpi span { display: block; font-size: 12px; color: var(--ink-faint); margin-top: 2px; }

@media (max-width: 899px) {
  .about-grid { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 719px) {
  .tasks { grid-template-columns: 1fr 1fr; }
  .duo { grid-template-columns: 1fr; }
  .panel { padding: 16px 16px 6px; }
}

/* ================================================================ 1.4.2 */

/* ---- 移动端页脚去掉「实用页面」栏 ----
   手机上页脚从上到下：品牌 / 逛站点 / 实用页面 / 全部栏目，
   实用页面里的页面链接与逛站点高度重复，小屏上整列隐藏。 */
@media (max-width: 899px) {
  .foot-col-pages { display: none; }
}

/* ================================================================ 1.4.3 */

/* ---- 正文内的宽元素兜底 ----
   正文里的表格 / 大图在窄屏会把整页撑出横向滚动（右侧被裁掉）。
   三层防护：
   1) 表格块级化、宽度锁在版心内，内容宽了表格自己横向滑动；
   2) figure（含 WP 表格块 .wp-block-table）同样限宽 + 可滑动兜底，
      即使表格因 table-layout:fixed 顽固不缩，也能在 figure 里滑；
   3) 大图 / iframe / pre 一律 max-width:100%。 */
.rich table {
  display: table !important;    /* 必须保持 table，display:block 会破坏列随容器宽自动
                                   拉伸填满的算法，导致列只按内容收缩、表格右侧大片空白 */
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  table-layout: auto !important; /* 覆盖 Gutenberg 的 has-fixed-layout（table-layout:fixed）：
                                    固定列宽会把窄列压成几像素导致中文逐字竖排；
                                    auto 让列按内容自适应、多余宽度均匀摊给各列填满版心 */
}
.rich figure,
.rich .wp-block-table {
  display: block;
  margin: 0;                 /* 清掉浏览器对 <figure> 默认的 1em 40px 外边距，
                                否则窄屏里 40px 左右外边距会把图片挤出去横向溢出 */
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
}
.rich img, .rich iframe, .rich video, .rich pre { max-width: 100%; }
.rich { overflow-wrap: break-word; }

/* ---- 手机面包屑去掉当前文章名 ----
   长标题会把面包屑挤成两行（首页/栏目/栏目/长长的文章标题），
   小屏只保留层级路径，当前页名标题里本来就有。 */
@media (max-width: 639px) {
  .crumbs .crumb-item:last-child { display: none; }
}

/* ---- 极窄屏（≤360px）站点数据强制 2×2 ----
   四项在 320px 会挤成 3+1 断行，改成整齐两列。 */
@media (max-width: 360px) {
  .hero-stats { grid-template-columns: 1fr 1fr; }
}

/* ---- 深色模式主按钮 ----
   深色下主色令牌整体变亮，但按钮文字仍是奶油色，
   对比度掉到 1.75-2.32:1；改为深墨文字压在浅棕渐变上（≈8:1）。 */
html[data-theme="dark"] .btn-primary {
  background-image: linear-gradient(140deg, var(--primary), var(--primary-deep));
  color: #2A1B12;
}

/* ---- 1.4.5：极窄屏（≤360px）侧栏小工具归零 ----
   侧栏小工具（如 2 列链接组）可能带 WP 编辑器写入的内联 min-width/width
   （例如 min-width:280px）。在窄于约 316px 的列宽里会撑破页面、出现横向滚动。
   移动端统一归零，让列表在列内正常回流，不影响桌面端的原有布局。 */
@media (max-width: 360px) {
  .art-side,
  .art-side * {
    min-width: 0 !important;
    max-width: 100% !important;
    width: auto !important;
    box-sizing: border-box !important;
  }
}
