/* =========================================================================
   WordPress 专属补充样式
   -------------------------------------------------------------------------
   site.css 由 tools/export-wp.js 从静态站原样复制，每次导出都会被覆盖——
   所以任何 WordPress 才需要的样式都写在这个文件里，不要动 site.css。

   这里只有三类内容：
     1. 静态站没有的页面（新闻正文、搜索结果、404）
     2. 分页导航
     3. 后台管理条带来的 32px 偏移
   ========================================================================= */

/* ---------------------------------------------------------- 管理条偏移 */
/* 登录状态下 WordPress 会在页面顶部插入 32px 高的管理条。页眉是 fixed 的，
   不把它往下推就会被管理条盖住一截，而且只有编辑自己看得见——
   这类问题最容易一直没人发现。 */
.admin-bar .site-header { top: 32px; }
.admin-bar .search-panel,
.admin-bar .mobile-nav { top: calc(var(--header-h) + 32px); }

@media screen and (max-width: 782px) {
  .admin-bar .site-header { top: 46px; }
  .admin-bar .search-panel,
  .admin-bar .mobile-nav { top: calc(var(--header-h) + 46px); }
}

/* ---------------------------------------------------------- 新闻正文 */
.post-single .sec-head { margin-bottom: 22px; }
.post-single .sec-head h1 {
  margin: 8px 0 0;
  font-size: clamp(26px, 3.4vw, 38px);
  line-height: 1.35;
  color: var(--ink);
  letter-spacing: .2px;
}
.post-single .news-meta { display: flex; align-items: center; gap: 10px; }

.post-cover {
  margin: 0 0 26px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--tint);
}
.post-cover img { display: block; width: 100%; height: auto; }

.post-body { max-width: 820px; }
.post-body p { margin: 0 0 1.05em; line-height: 1.95; color: var(--text); }
.post-body h2 {
  margin: 1.9em 0 .7em;
  font-size: 21px; color: var(--ink); font-weight: 600;
}
.post-body h3 { margin: 1.6em 0 .6em; font-size: 17px; color: var(--ink); font-weight: 600; }
.post-body ul,
.post-body ol { margin: 0 0 1.05em 1.3em; }
.post-body li { margin-bottom: .45em; line-height: 1.85; color: var(--text); }
.post-body img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }
.post-body a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.post-body blockquote {
  margin: 1.4em 0;
  padding: 14px 18px;
  border-left: 3px solid var(--primary-line);
  background: var(--tint);
  color: var(--muted);
}
.post-body table { width: 100%; border-collapse: collapse; margin: 1.2em 0; font-size: 14px; }
.post-body th,
.post-body td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.post-body th { background: var(--tint); font-weight: 600; }

/* 正文里的表格在窄屏要能横向滚，而不是把整页撑宽 */
.post-body > .wp-block-table,
.post-body > figure.wp-block-table { overflow-x: auto; }

.post-nav {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px;
  margin-top: 40px; padding-top: 22px;
  border-top: 1px solid var(--line);
}
.post-nav .link-more { max-width: 46%; }

@media (max-width: 640px) {
  .post-nav .link-more { max-width: 100%; }
}

/* ---------------------------------------------------------- 分页 */
.pagination { margin-top: 36px; }
.pagination ul {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px;
  list-style: none; margin: 0; padding: 0;
}
.pagination a,
.pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 38px; height: 38px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: 14px; color: var(--text); background: #fff;
  transition: border-color .16s ease, color .16s ease, background .16s ease;
}
.pagination a:hover { border-color: var(--primary-line); color: var(--primary); background: var(--tint); }
.pagination .current {
  border-color: var(--primary); background: var(--primary); color: #fff; font-weight: 500;
}

/* ---------------------------------------------------------- 搜索 / 404 */
.simple-page { padding: clamp(70px, 12vw, 130px) 0; text-align: center; }
.simple-page h1 {
  margin: 0 0 12px;
  font-size: clamp(30px, 5vw, 52px);
  color: var(--ink); letter-spacing: .5px;
}
.simple-page p { margin: 0 auto 26px; max-width: 560px; color: var(--muted); line-height: 1.9; }
.simple-page .btn + .btn { margin-left: 10px; }

.search-list { max-width: 820px; margin: 0 auto; }
.search-list li { list-style: none; padding: 18px 0; border-bottom: 1px solid var(--line-soft); }
.search-list h3 { margin: 0 0 6px; font-size: 17px; }
.search-list h3 a { color: var(--ink); }
.search-list h3 a:hover { color: var(--primary); }
.search-list p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.8; }

/* ---------------------------------------------------------- 无障碍 */
/* 跳转链接在获得焦点前不能占位，但也不能用 display:none——那样读屏和
   键盘用户都拿不到它。 */
.screen-reader-text {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
