@charset "UTF-8";
/* ==========================================================================
   theme.css — 全站区块与组件装修
   选择器全部对应 book-rev-lite 主题实际输出的 DOM 结构，未改动任何 HTML/PHP。
   停用子主题即可 100% 回退。
   ========================================================================== */

/* ==========================================================================
   1. 顶部条  #top-bar
   ========================================================================== */
section#top-bar{
  background: var(--ink);
  border-bottom: 1px solid rgba(255,255,255,.06);
  font-size: 13px;
}
section#top-bar .container{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 38px;
}
section#top-bar,
section#top-bar a{ color: rgba(255,255,255,.72); }
section#top-bar a:hover{ color: #fff; }

#top-bar-menu ul{
  display: flex;
  align-items: center;
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}
#top-bar-menu li{ margin: 0; }

/* 顶部搜索框 */
section#top-bar .search-form,
#top-bar .search-form{
  display: flex;
  align-items: center;
  gap: 6px;
}
.search-form .search-icon{
  opacity: .75;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  transition: opacity .15s ease;
}
.search-form .search-icon:hover{ opacity: 1; }
section#top-bar input[type="search"],
section#top-bar input[type="text"]{
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: var(--r-pill);
  color: #fff;
  font-size: 13px;
  height: 28px;
  padding: 0 14px;
  min-width: 190px;
  transition: all .15s ease;
}
section#top-bar input[type="search"]::placeholder{ color: rgba(255,255,255,.45); }
section#top-bar input[type="search"]:focus{
  outline: none;
  background: rgba(255,255,255,.16);
  border-color: var(--brand-2);
  min-width: 240px;
}

/* ==========================================================================
   2. 站点头部  #inner-header
   ========================================================================== */
section#inner-header{
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 20px 0;
}
section#inner-header .container{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
a.custom-logo-link{
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--ink);
}
a.custom-logo-link img{
  max-height: 46px;
  width: auto;
  border-radius: var(--r-sm);
}
a.custom-logo-link:hover{ color: var(--brand); }

/* 无 logo 图片时，用文字徽标兜底 */
a.custom-logo-link:not(:has(img))::before{
  content: "PT";
  width: 38px; height: 38px;
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0;
}

/* 广告位：留白并弱化，避免突兀 */
section#ad-banner{
  padding: 14px 0;
  background: var(--paper);
}
section#ad-banner img{ border-radius: var(--r); }

/* ==========================================================================
   3. 分类主菜单  #main-menu
   现状：17 个分类横排平铺，拥挤难辨。
   方案：可换行 + 按编号前缀分组着色（1.x 基础 / 2.x 应用 / 3.x 防护 / 4.x 训练）
   分组 class 由 functions.php 的 nav_menu_css_class 过滤器自动注入。
   ========================================================================== */
section#main-menu{
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--sh-1);
  position: relative;
  z-index: 40;
}
section#main-menu .container{ padding: 0 24px; }

section#main-menu ul.menu{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 4px;
  list-style: none;
  margin: 0;
  padding: 7px 0;
}
section#main-menu ul.menu > li{
  margin: 0;
  position: relative;
}
section#main-menu ul.menu > li > a{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-2);
  padding: 7px 12px;
  border-radius: var(--r-sm);
  white-space: nowrap;
  transition: all .15s ease;
}
section#main-menu ul.menu > li > a:hover{
  background: var(--brand-soft);
  color: var(--brand);
}
/* 当前所在分类高亮 */
section#main-menu ul.menu > li.current-menu-item > a,
section#main-menu ul.menu > li.current-cat > a{
  background: var(--brand);
  color: #fff;
}
section#main-menu ul.menu > li.current-menu-item > a:hover,
section#main-menu ul.menu > li.current-cat > a:hover{ color: #fff; }

/* --- 分组色点：前缀 1.x 青绿 / 2.x 蓝 / 3.x 橙 / 4.x 紫 --- */
section#main-menu ul.menu > li.cat-g1 > a::before{ background: var(--brand); }
section#main-menu ul.menu > li.cat-g2 > a::before{ background: #185FA5; }
section#main-menu ul.menu > li.cat-g3 > a::before{ background: var(--accent); }
section#main-menu ul.menu > li.cat-g4 > a::before{ background: #534AB7; }
section#main-menu ul.menu > li[class*="cat-g"] > a::before{
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  flex: 0 0 auto;
  opacity: .85;
}
section#main-menu ul.menu > li.current-menu-item > a::before,
section#main-menu ul.menu > li.current-cat > a::before{ background: rgba(255,255,255,.85); }

/* 二级菜单 */
section#main-menu ul.menu ul.sub-menu{
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 190px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--sh-2);
  padding: 6px;
  list-style: none;
  margin: 4px 0 0;
  z-index: 50;
}
section#main-menu ul.menu ul.sub-menu li{ margin: 0; }
section#main-menu ul.menu ul.sub-menu a{
  display: block;
  padding: 7px 11px;
  font-size: 13px;
  color: var(--ink-2);
  border-radius: var(--r-sm);
}
section#main-menu ul.menu ul.sub-menu a:hover{
  background: var(--brand-soft);
  color: var(--brand);
}

/* 社交图标区：收敛尺寸 */
section#menu-social-icons{ background: var(--paper); }
section#menu-social-icons ul{
  display: flex;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 10px 24px;
}
section#menu-social-icons li{ margin: 0; }
section#menu-social-icons a{
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--paper-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-2);
  font-size: 13px;
  transition: all .15s ease;
}
section#menu-social-icons a:hover{
  background: var(--brand);
  color: #fff;
}

/* ==========================================================================
   4. 首页幻灯片  #slider
   ========================================================================== */
section#slider{
  background: var(--paper);
  padding: 26px 0 30px;
  border-bottom: 1px solid var(--line);
}
section#slider .cycle-slideshow{ max-width: var(--w); margin: 0 auto; }

section#slider .slide{
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 26px;
  align-items: start;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--sh-1);
}
section#slider .book-cover{
  margin: 0;
  border-radius: var(--r);
  overflow: hidden;
  background: var(--paper-2);
  box-shadow: var(--sh-2);
}
section#slider .book-cover img{
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: var(--r);
}
/* 无封面时的占位：避免布局塌陷 */
section#slider .book-cover:empty{
  aspect-ratio: 3 / 4;
  background: linear-gradient(160deg, var(--brand-soft), var(--paper-2));
  border-radius: var(--r);
}
section#slider .slide-description{ min-width: 0; }
section#slider .inner-sd{ display: block; }

section#slider h2.sd-title{
  font-size: 21px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -.015em;
  margin-bottom: 10px;
}
section#slider h2.sd-title a{ color: var(--ink); }
section#slider h2.sd-title a:hover{ color: var(--brand); }

section#slider .sd-body{
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--ink-2);
  margin-bottom: 14px;
  /* 摘要最多 3 行，超出省略，保证幻灯片高度一致 */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
section#slider .sd-meta{
  font-size: 12.5px;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
section#slider .sd-meta a{ color: var(--brand); font-weight: 500; }

/* Cycle 分页器 */
section#slider .cycle-pager{
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-top: 18px;
}
section#slider .cycle-pager span{
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--line-2);
  cursor: pointer;
  display: inline-block;
  transition: all .2s ease;
}
section#slider .cycle-pager span.cycle-pager-active{
  background: var(--brand);
  width: 22px;
  border-radius: var(--r-pill);
}

/* ==========================================================================
   5. 主体容器与文章列表
   ========================================================================== */
section#main-content{
  background: var(--paper-3);
  padding: 30px 0 50px;
}
section#main-content-inner.container{
  max-width: var(--w);
  display: grid;
  grid-template-columns: minmax(0,1fr) 300px;
  gap: 32px;
  align-items: start;
}

/* --- 列表页：文章卡片 --- */
.article-container{
  background: transparent;
}
body:not(.single) .article-container.post{
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px 24px;
  margin-bottom: 16px;
  box-shadow: var(--sh-1);
  transition: all .18s ease;
}
body:not(.single) .article-container.post:hover{
  border-color: var(--brand-2);
  box-shadow: var(--sh-2);
  transform: translateY(-2px);
}
.article-container header{ margin-bottom: 12px; }
.article-details h1.title,
.article-details h2.title{
  font-size: 19px;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: -.01em;
  margin-bottom: 8px;
}
.article-details h1.title a,
.article-details h2.title a{ color: var(--ink); }
.article-details h1.title a:hover,
.article-details h2.title a:hover{ color: var(--brand); }

.article-container .meta{
  font-size: 12.5px;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.article-container .meta a{ color: var(--ink-3); }
.article-container .meta a:hover{ color: var(--brand); }
.article-container .meta .date::before{
  content: "";
  display: inline-block;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--ink-3);
  margin-right: 7px;
  vertical-align: middle;
}

/* 列表页正文摘要 */
body:not(.single) .article-container article{
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--ink-2);
}
body:not(.single) .article-container article p{ margin-bottom: .8em; }

/* 列表页缩略图 */
.article-container article img,
.article-container .post-thumbnail img,
.article-container .featured-image img{
  border-radius: var(--r);
  width: 100%;
}

/* 「阅读更多」按钮化 */
.article-container .more-link,
.article-container a.more-link{
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 12px;
  padding: 7px 15px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 500;
  color: var(--brand);
  transition: all .15s ease;
}
.article-container .more-link:hover{
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* ==========================================================================
   6. 书目信息区  #book-review  ★核心改造★
   现状：插件输出 <label>书名:</label><span>xxx</span><br> 的线性堆砌，信息密度低。
   方案：不碰 PHP，用 CSS Grid 把线性流重排为「标签列 + 内容列」两栏规格表。
   ========================================================================== */
body.single #book-review{
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  column-gap: 22px;
  row-gap: 12px;
  align-items: baseline;
  background: var(--paper-2);
  /* !important 是必需的：book-review 插件在元素上硬编码了
     style="border-style:solid;border-width:1px"，内联样式优先级高于任何选择器，
     不用 !important 的话下面这两条边框会被内联样式吃掉。 */
  border: 1px solid var(--line) !important;
  border-left: 3px solid var(--brand) !important;
  border-radius: var(--r-lg);
  padding: 20px 24px;
  margin: 0 0 26px;
  font-size: 14.5px;
}
/* 关键：干掉插件硬编码的换行，否则 Grid 会出现空行 */
body.single #book-review > br{ display: none; }
/* schema.org 的 meta 与 link 不参与布局 */
body.single #book-review > meta,
body.single #book-review > link{ display: none; }

body.single #book-review::before{
  content: "书目信息";
  grid-column: 1 / -1;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--brand);
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}

/* ★ 必须用直接子代选择器 > ：
   插件输出的 <span id="book_review_title"> 内部还嵌套了一层
   <span itemprop="name">，若写成 #book-review span，嵌套 span 也会被
   拉进网格各占一格，整块布局会错乱。 */
body.single #book-review > label{
  grid-column: 1;
  margin: 0;
  color: var(--ink-3);
  font-size: 13.5px;
  font-weight: 400;
  white-space: nowrap;
}
body.single #book-review > span{
  grid-column: 2;
  color: var(--ink);
  font-weight: 500;
}

/* 封面图：横跨整行并限宽，避免撑开网格 */
body.single #book-review > img.cover,
body.single #book-review > #book_review_cover_image{
  grid-column: 1 / -1;
  width: 148px;
  max-width: 100%;
  height: auto;
  border-radius: var(--r);
  box-shadow: var(--sh-2);
  margin: 2px 0 6px;
}

/* 星级评分与自定义链接区：横跨整行 */
body.single #book-review > div,
body.single #book-review > ul{
  grid-column: 1 / -1;
}

/* 自定义链接列表：
   当文章没有配置任何链接时，book-review 插件仍会输出一个空的
   <ul id="book-review-links">（内部还带一个没有配对的孤立 </li>，属插件自身缺陷）。
   这里做两件事：归零列表默认缩进；为空列表彻底隐藏，避免在网格中白占一行。
   注：CSS 的 :empty 不匹配含文本节点的元素，但注释节点不影响判定，因此可命中。 */
body.single #book-review > ul#book-review-links{
  margin: 0;
  padding: 0;
  list-style: none;
}
body.single #book-review > ul#book-review-links:empty{
  display: none;
}
body.single #book-review > ul#book-review-links li{
  margin: 0;
  font-size: 13.5px;
}
body.single #book-review > ul#book-review-links a{
  color: var(--brand);
  font-weight: 500;
  border-bottom: 1px dashed var(--brand-2);
}
body.single #book-review div[itemprop="reviewRating"]{
  display: flex;
  align-items: center;
  gap: 4px;
  padding-top: 4px;
  border-top: 1px dashed var(--line);
  margin-top: 4px;
}
body.single #book-review #book_review_rating_image{
  height: 16px;
  width: auto;
}
/* ISBN 等长数字串用等宽字体，便于核对 */
body.single #book-review span[id^="book_review_"]:not(#book_review_title):not(#book_review_author){
  font-feature-settings: "tnum";
}

/* --------------------------------------------------------------------------
   6.1 文字封面兜底块
   清理侵权封面图后，<img src=""> 会渲染成破图图标。
   ptbook.js 会把这类 <img> 整体替换成下面的 .ptb-cover-fallback，
   用书名首字生成一个品牌色书脊块。
   -------------------------------------------------------------------------- */
.ptb-cover-fallback{
  display: flex;
  align-items: center;
  justify-content: center;
  width: 148px;
  max-width: 100%;
  aspect-ratio: 3 / 4;          /* 常见图书开本比例 */
  border-radius: var(--r);
  background: linear-gradient(150deg, var(--brand) 0%, #0B5642 100%);
  color: #fff;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: .04em;
  line-height: 1.15;
  text-align: center;
  padding: 10px;
  box-shadow: var(--sh-2);
  user-select: none;
}
/* 不支持 aspect-ratio 的旧浏览器兜底 */
@supports not (aspect-ratio: 3 / 4){
  .ptb-cover-fallback{ height: 197px; }
}
/* 文章页里它位于 #book-review 网格中，需横跨整行 */
body.single #book-review > .ptb-cover-fallback{
  grid-column: 1 / -1;
  margin: 2px 0 6px;
}
/* 列表页卡片中的封面块填满卡片宽度 */
.book-cover .ptb-cover-fallback,
.article-container .ptb-cover-fallback{
  width: 100%;
}

/* --------------------------------------------------------------------------
   6.2 原创书目卡（清理工具在正文变空时插入）
   只含事实性书目信息，替代原本盗用的出版社简介与实拍图。
   -------------------------------------------------------------------------- */
.ptb-book-card{
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: var(--r-lg);
  padding: 18px 22px;
  margin: 0 0 22px;
}
.ptb-book-card p{
  margin: 0 0 .5em;
  line-height: 1.85;
}
.ptb-book-card p:last-child{ margin-bottom: 0; }
.ptb-book-card strong{
  color: var(--ink);
  font-size: 17px;
}
.ptb-book-card-note{
  font-size: 13px;
  color: var(--ink-3);
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  margin-top: 10px !important;
}

/* --- 书评正文 --- */
body.single [itemprop="reviewBody"]{
  font-size: 15.5px;
  line-height: 1.9;
  color: var(--ink);
}
body.single [itemprop="reviewBody"] p{ margin-bottom: 1.15em; }
body.single [itemprop="reviewBody"] img{
  border-radius: var(--r);
  margin: 1.2em auto;
  /* 正文图片被 ueditor 写入了内联 max-width:750px，
     在窄屏会溢出容器，这里强制收敛。 */
  max-width: 100% !important;
  height: auto !important;
}
body.single [itemprop="reviewBody"] a{
  color: var(--brand);
  border-bottom: 1px dashed var(--brand-2);
}
body.single [itemprop="reviewBody"] a:hover{
  background: var(--brand-soft);
  border-bottom-style: solid;
}

/* 覆盖 ueditor 在正文里撒下的内联字体样式。
   用属性选择器精准命中「带内联 font 样式」的元素，
   既不误伤作者刻意设置的强调样式，又能统一正文观感。 */
body.single [itemprop="reviewBody"] span[style*="font-family"],
body.single [itemprop="reviewBody"] p[style*="font-family"]{
  font-family: var(--sans) !important;
}
body.single [itemprop="reviewBody"] span[style*="font-size"],
body.single [itemprop="reviewBody"] p[style*="font-size"]{
  font-size: inherit !important;
  line-height: inherit !important;
}

/* --- 文章标签：chip 化 --- */
.article-tags{
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.article-tags i{ margin-right: 2px; color: var(--ink-3); }
.article-tags a{
  display: inline-block;
  font-size: 12.5px;
  padding: 3px 11px;
  border-radius: var(--r-pill);
  background: var(--paper-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
  transition: all .15s ease;
}
.article-tags a:hover{
  background: var(--brand-soft);
  border-color: var(--brand-2);
  color: var(--brand);
}

/* --- 上下篇导航 --- */
nav.nav-single{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 26px;
}
nav.nav-single .nav-previous,
nav.nav-single .nav-next{
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 13px 16px;
  font-size: 13.5px;
  transition: all .15s ease;
  min-width: 0;
}
nav.nav-single .nav-previous:hover,
nav.nav-single .nav-next:hover{
  border-color: var(--brand-2);
  background: var(--brand-soft);
}
nav.nav-single .nav-next{ text-align: right; }
nav.nav-single a{
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-2);
}
nav.nav-single .meta-nav{ color: var(--brand); font-weight: 600; margin: 0 4px; }

/* --- 分页 --- */
.pagination,
.wp-pagenavi,
.nav-links{
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  margin: 34px 0 0;
  flex-wrap: wrap;
}
.pagination a, .pagination span,
.wp-pagenavi a, .wp-pagenavi span,
.nav-links a, .nav-links 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: var(--r-sm);
  background: var(--paper);
  font-size: 14px;
  color: var(--ink-2);
  transition: all .15s ease;
}
.pagination a:hover,
.wp-pagenavi a:hover,
.nav-links a:hover{
  border-color: var(--brand-2);
  color: var(--brand);
}
.pagination .current, .pagination span.current,
.wp-pagenavi .current,
.nav-links .current{
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 500;
}

/* ==========================================================================
   7. 侧边栏  #main-sidebar
   ========================================================================== */
aside#main-sidebar{
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
aside#main-sidebar .widget{
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  box-shadow: var(--sh-1);
}
aside#main-sidebar .widget-title,
aside#main-sidebar .widget h2,
aside#main-sidebar .widget h3{
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 14px;
  padding-left: 10px;
  border-left: 3px solid var(--brand);
  line-height: 1.4;
}
aside#main-sidebar .widget ul{
  list-style: none;
  margin: 0;
  padding: 0;
}
aside#main-sidebar .widget li{
  margin: 0;
  padding: 7px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 13.5px;
  color: var(--ink-2);
}
aside#main-sidebar .widget li:last-child{ border-bottom: 0; }
aside#main-sidebar .widget li a{ color: var(--ink-2); }
aside#main-sidebar .widget li a:hover{ color: var(--brand); }

/* 标签云 */
aside#main-sidebar .tagcloud{
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
aside#main-sidebar .tagcloud a{
  font-size: 12.5px !important;   /* 覆盖 WP 内联的随机字号 */
  padding: 4px 11px;
  border-radius: var(--r-pill);
  background: var(--paper-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
  line-height: 1.6;
  transition: all .15s ease;
}
aside#main-sidebar .tagcloud a:hover{
  background: var(--brand-soft);
  border-color: var(--brand-2);
  color: var(--brand);
}

/* 近期评论 */
aside#main-sidebar .widget_recent_comments li{
  line-height: 1.6;
  color: var(--ink-3);
}
aside#main-sidebar .widget_recent_comments a{ color: var(--ink); font-weight: 500; }

/* 搜索小工具 */
aside#main-sidebar .widget_search form,
aside#main-sidebar .search-form{
  display: flex;
  gap: 7px;
}
aside#main-sidebar .widget_search input[type="search"],
aside#main-sidebar .widget_search input[type="text"]{
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--paper);
  font-size: 13.5px;
  transition: border-color .15s ease;
}
aside#main-sidebar .widget_search input:focus{
  outline: none;
  border-color: var(--brand-2);
}
aside#main-sidebar .widget_search input[type="submit"],
aside#main-sidebar .search-submit{
  height: 36px;
  padding: 0 15px;
  border: 0;
  border-radius: var(--r-sm);
  background: var(--brand);
  color: #fff;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s ease;
}
aside#main-sidebar .widget_search input[type="submit"]:hover{ background: var(--brand-hover); }

/* ==========================================================================
   8. 评论区  #comments-section
   ========================================================================== */
section#comments-section{
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 24px 26px;
  margin-top: 26px;
  box-shadow: var(--sh-1);
}
section#comments-section h3,
#comments-container h3,
#reply-title{
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

#comments-container ol,
#comments-container ul{
  list-style: none;
  margin: 0;
  padding: 0;
}
#comments-container .comment{
  list-style: none;
  margin: 0 0 14px;
}
.comment .comment-inner-wrapper{
  background: var(--paper-3);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 15px 18px;
  display: grid;
  grid-template-columns: 44px minmax(0,1fr);
  gap: 14px;
  align-items: start;
}
.comment .author-avatar{
  margin: 0;
  width: 44px;
}
.comment .author-avatar img{
  width: 44px; height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--paper-2);
}
.comment .comment-head{
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
  background: none;
  border: 0;
  padding: 0;
}
.comment .author-name{
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.comment .comment-date{
  font-size: 12px;
  color: var(--ink-3);
}
.comment .comment-body{
  font-size: 14px;
  line-height: 1.75;
  color: var(--ink-2);
}
.comment .comment-body p{ margin-bottom: .5em; }
.comment .comment-reply a,
.comment .reply a{
  font-size: 12.5px;
  color: var(--brand);
  font-weight: 500;
}
/* 楼主/管理员标记 */
.comment.bypostauthor .comment-inner-wrapper{
  background: var(--brand-soft);
  border-color: rgba(29,158,117,.3);
}

/* --- 评论表单 --- */
#respond.comment-respond{
  margin-top: 26px;
  background: var(--paper-3);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 20px 22px;
}
#respond textarea,
#respond input[type="text"],
#respond input[type="email"],
#respond input[type="url"]{
  width: 100%;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--paper);
  padding: 10px 13px;
  font-size: 14px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
#respond textarea:focus,
#respond input:focus{
  outline: none;
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(29,158,117,.12);
}
#respond textarea{ min-height: 110px; resize: vertical; }
#respond label{ font-size: 13px; color: var(--ink-2); display: block; margin-bottom: 5px; }
#respond .required{ color: var(--accent); }
#respond .required-field-message,
#respond #email-notes{ font-size: 12px; color: var(--ink-3); }
#respond input[type="submit"],
#respond .submit{
  height: 40px;
  padding: 0 24px;
  border: 0;
  border-radius: var(--r-sm);
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s ease;
}
#respond input[type="submit"]:hover{ background: var(--brand-hover); }

/* ==========================================================================
   9. 页脚
   主题页脚为 widget 区，这里统一卡片化并压暗背景
   ========================================================================== */
footer#main-footer,
body > footer,
#footer{
  background: var(--ink);
  color: rgba(255,255,255,.7);
  padding: 42px 0 26px;
  margin-top: 0;
}
footer .container{
  max-width: var(--w);
  margin: 0 auto;
  padding: 0 24px;
}
footer .widget{
  margin-bottom: 22px;
}
footer .widget-title,
footer .widget h2,
footer .widget h3{
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 14px;
}
footer a{ color: rgba(255,255,255,.7); }
footer a:hover{ color: var(--brand-2); }
footer ul{ list-style: none; margin: 0; padding: 0; }
footer li{
  margin-bottom: 7px;
  font-size: 13.5px;
  line-height: 1.7;
}
footer .tagcloud{ display: flex; flex-wrap: wrap; gap: 7px; }
footer .tagcloud a{
  font-size: 12.5px !important;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.75);
}
footer .tagcloud a:hover{
  background: rgba(255,255,255,.16);
  color: #fff;
}
/* 版权行 */
footer .copyright,
footer .site-info{
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 20px;
  margin-top: 10px;
  font-size: 12.5px;
  color: rgba(255,255,255,.5);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* ==========================================================================
   10. 返回顶部按钮（由 ptbook.js 注入）
   ========================================================================== */
.ptb-to-top{
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  border: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: var(--sh-2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all .22s ease;
  z-index: 60;
}
.ptb-to-top.is-visible{ opacity: 1; visibility: visible; transform: translateY(0); }
.ptb-to-top:hover{ background: var(--brand-hover); }

/* ==========================================================================
   11. 移动端菜单抽屉（由 ptbook.js 注入）
   ========================================================================== */
.ptb-burger{
  display: none;
  width: 38px; height: 38px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--paper);
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
}
.ptb-burger span{
  display: block;
  width: 17px; height: 1.6px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}
.ptb-burger.is-open span:nth-child(1){ transform: translateY(5.6px) rotate(45deg); }
.ptb-burger.is-open span:nth-child(2){ opacity: 0; }
.ptb-burger.is-open span:nth-child(3){ transform: translateY(-5.6px) rotate(-45deg); }

.ptb-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(18,33,28,.45);
  opacity: 0;
  visibility: hidden;
  transition: all .22s ease;
  z-index: 55;
}
.ptb-backdrop.is-open{ opacity: 1; visibility: visible; }

/* 抽屉打开时锁定滚动 */
body.ptb-locked{ overflow: hidden; }
