/*
Theme Name: 般若会
Theme URI: https://quxuefo.com/
Author: Nanjing Edina
Description: 面向东方古典典籍与译经史方向的文献学内容主题。宣纸底、墨色字、宋体排版，轻量无外部依赖，内置结构化数据与备案号页脚。
Version: 1.0.4
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: brh
*/

:root {
  --ink: #262019;
  --ink-2: #4d453a;
  --ink-3: #8a8073;
  --line: #e3dccc;
  --line-2: #d3c9b4;
  --bg: #fdfcf8;
  --bg-2: #f7f3e9;
  --brand: #8a3b2b;
  --brand-2: #6b2a1e;
  --accent: #4a6b5a;
  --radius: 4px;
  --w: 1080px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-serif: "Songti SC", "SimSun", "Source Han Serif SC", "Noto Serif CJK SC", "Times New Roman", serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 16.5px;
  line-height: 1.9;
  color: var(--ink-2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-2); text-decoration: underline; }

.wrap { max-width: var(--w); margin: 0 auto; padding: 0 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- 顶部 ---------- */
.site-head {
  border-bottom: 1px solid var(--line);
  background: rgba(253,252,248,.96);
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(160%) blur(6px);
}
.site-head .bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; min-height: 70px;
}
.brand { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 3px;
  background: var(--brand);
  display: grid; place-items: center;
  color: #fdfcf8; font-family: var(--font-serif); font-weight: 700; font-size: 17px;
  letter-spacing: 0;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}
.brand-txt { display: flex; flex-direction: column; line-height: 1.3; }
.brand-name {
  font-size: 18px; font-weight: 700; color: var(--ink);
  letter-spacing: 1.5px; font-family: var(--font-serif);
}
.brand-sub {
  font-size: 11px; color: var(--ink-3); letter-spacing: 1.4px;
  font-family: var(--font-sans);
}

.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 24px; flex-wrap: wrap; }
.nav a {
  font-size: 14.5px; color: var(--ink-2); padding: 6px 0; display: inline-block;
  border-bottom: 1px solid transparent; transition: .15s;
  font-family: var(--font-sans);
}
.nav a:hover, .nav .current-menu-item > a, .nav .current_page_item > a {
  color: var(--brand); border-bottom-color: var(--brand); text-decoration: none;
}

.nav-toggle {
  display: none; font-family: var(--font-sans);
}

/* ---------- 首页 Hero ---------- */
.hero {
  background: #2b2621;
  background-image:
    radial-gradient(circle at 78% 12%, rgba(197,167,110,.13) 0%, rgba(197,167,110,0) 46%),
    radial-gradient(circle at 12% 88%, rgba(255,255,255,.05) 0%, rgba(255,255,255,0) 42%);
  color: #f2ece0; padding: 76px 0 66px; position: relative; overflow: hidden;
  border-bottom: 3px double var(--line-2);
}
.hero-inner { max-width: 760px; }
.hero .kicker {
  font-family: var(--font-sans); font-size: 12px; letter-spacing: 3px;
  color: #c5a76e; margin: 0 0 20px; text-transform: uppercase;
}
.hero h1 {
  font-size: clamp(25px, 3.6vw, 36px); line-height: 1.5; margin: 0 0 20px;
  font-weight: 700; letter-spacing: 1px; color: #fdfaf3;
  font-family: var(--font-serif);
}
.hero p.lead {
  font-size: 16px; line-height: 2; margin: 0 0 30px;
  color: rgba(242,236,224,.82);
}
.hero-tags { display: flex; gap: 9px; flex-wrap: wrap; }
.hero-tags span {
  font-family: var(--font-sans);
  font-size: 12.5px; padding: 5px 13px; border-radius: 2px;
  background: rgba(197,167,110,.1); border: 1px solid rgba(197,167,110,.3);
  color: #d8c9a8;
}

/* ---------- 通用区块 ---------- */
.sec { padding: 62px 0; }
.sec-alt { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sec-head { max-width: 700px; margin-bottom: 34px; }
.sec-head h2 {
  font-size: clamp(20px, 2.4vw, 25px); color: var(--ink); margin: 0 0 12px;
  font-weight: 700; letter-spacing: 1px;
  padding-bottom: 14px; position: relative;
}
.sec-head h2::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 44px; height: 2px; background: var(--brand);
}
.sec-head p { margin: 0; color: var(--ink-3); font-size: 14.5px; font-family: var(--font-sans); }

/* ---------- 栏目卡片 ---------- */
.cols { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
@media (max-width: 1000px) { .cols { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 780px)  { .cols { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px)  { .cols { grid-template-columns: 1fr; } }
.col-card {
  background: #fffefb; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 22px; transition: .18s; display: flex; flex-direction: column;
  position: relative;
}
.col-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--line-2); transition: .18s;
}
.col-card:hover { border-color: var(--line-2); box-shadow: 0 4px 18px rgba(38,32,25,.06); }
.col-card:hover::before { background: var(--brand); }
.col-card h3 {
  font-size: 17px; margin: 0 0 10px; color: var(--ink); font-weight: 700;
  letter-spacing: .8px;
}
.col-card h3 a { color: inherit; }
.col-card h3 a:hover { color: var(--brand); text-decoration: none; }
.col-card p { margin: 0 0 16px; font-size: 14px; color: var(--ink-3); line-height: 1.8; }
.col-card .more {
  margin-top: auto; font-size: 12.5px; color: var(--brand); font-weight: 600;
  font-family: var(--font-sans); letter-spacing: .5px;
}

/* ---------- 文章列表 ---------- */
.posts { border-top: 1px solid var(--line); }
.post-row {
  padding: 26px 4px 24px; border-bottom: 1px solid var(--line);
  transition: .15s;
}
.post-row:hover { background: rgba(247,243,233,.55); }
.post-row h3 { margin: 0 0 9px; font-size: 18px; line-height: 1.6; font-weight: 700; letter-spacing: .3px; }
.post-row h3 a { color: var(--ink); }
.post-row h3 a:hover { color: var(--brand); text-decoration: none; }
.post-meta {
  font-size: 12.5px; color: var(--ink-3); margin-bottom: 10px;
  display: flex; gap: 14px; flex-wrap: wrap; font-family: var(--font-sans);
}
.post-meta .cat { color: var(--accent); font-weight: 600; }
.post-meta .cat a { color: inherit; }
.post-row .excerpt { margin: 0; font-size: 14.5px; color: var(--ink-3); line-height: 1.85; }

/* ---------- 文章页 ---------- */
.article-head {
  padding: 48px 0 28px; border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}
/* 标题区与正文同宽，否则两者左右边缘错位 */
.article-head .wrap { max-width: 820px; }
.article-head h1 {
  font-size: clamp(22px, 2.9vw, 29px); line-height: 1.6; color: var(--ink);
  margin: 0 0 16px; font-weight: 700; letter-spacing: .5px;
}
.crumb { font-size: 12.5px; color: var(--ink-3); margin-bottom: 16px; font-family: var(--font-sans); }
.crumb a { color: var(--ink-3); }
.crumb a:hover { color: var(--brand); }

/* 正文 780 宽，与上方标题区（820 - 两侧 20 内边距 = 780）左右边缘对齐 */
.article-body { max-width: 780px; margin: 0 auto; padding: 42px 0 20px; }
.article-body h2 {
  font-size: 20px; color: var(--ink); margin: 44px 0 16px; font-weight: 700;
  padding-left: 13px; border-left: 3px solid var(--brand); line-height: 1.6;
  letter-spacing: .5px;
}
.article-body h3 { font-size: 17.5px; color: var(--ink); margin: 30px 0 12px; font-weight: 700; }
.article-body p { margin: 0 0 19px; }
.article-body ul, .article-body ol { margin: 0 0 19px; padding-left: 26px; }
.article-body li { margin-bottom: 9px; }
.article-body strong { color: var(--ink); font-weight: 700; }
.article-body em { font-style: normal; border-bottom: 1px dotted var(--line-2); }
.article-body blockquote {
  margin: 26px 0; padding: 16px 22px; background: var(--bg-2);
  border-left: 3px solid var(--line-2); border-radius: 0;
  color: var(--ink-2); font-size: 15px; line-height: 1.9;
}
.article-body blockquote p:last-child { margin-bottom: 0; }
.article-body table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 14.5px; }
.article-body th, .article-body td { border: 1px solid var(--line); padding: 11px 14px; text-align: left; vertical-align: top; }
.article-body th { background: var(--bg-2); color: var(--ink); font-weight: 700; }
.article-body code {
  background: var(--bg-2); padding: 2px 6px; border-radius: 2px; font-size: 13.5px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
.article-body hr { border: none; border-top: 1px solid var(--line); margin: 34px 0; }

/* 文末出处与声明 */
.source-note {
  margin: 34px 0 0; padding: 18px 22px; background: #fffefb;
  border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 13.5px; color: var(--ink-2); line-height: 1.9;
}
.source-note strong { color: var(--ink); }

.disclaimer {
  margin: 18px 0 0; padding: 16px 22px; background: var(--bg-2);
  border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: 0;
  font-size: 12.5px; color: var(--ink-3); line-height: 1.85;
  font-family: var(--font-sans);
}

/* ---------- 分页 ---------- */
.pager {
  display: flex; gap: 10px; justify-content: center; padding: 36px 0 8px;
  font-family: var(--font-sans); flex-wrap: wrap;
}
.pager a, .pager span {
  padding: 7px 14px; border: 1px solid var(--line); border-radius: 2px;
  font-size: 13.5px; color: var(--ink-2); background: #fffefb;
}
.pager .current { background: var(--brand); border-color: var(--brand); color: #fdfcf8; }
.pager a:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }

/* ---------- 页脚 ---------- */
.site-foot {
  background: #2b2621; color: #a89c88; padding: 54px 0 26px;
  margin-top: 0; font-size: 14px;
  border-top: 3px double #4a4238;
}
.foot-cols { display: grid; grid-template-columns: 1.7fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.foot-cols h4 {
  color: #f2ece0; font-size: 14.5px; margin: 0 0 14px; font-weight: 700; letter-spacing: 1.2px;
}
.foot-cols p { margin: 0; line-height: 1.95; font-size: 13.5px; color: #a89c88; }
.foot-cols ul { list-style: none; margin: 0; padding: 0; }
.foot-cols li { margin-bottom: 9px; }
.foot-cols a { color: #a89c88; }
.foot-cols a:hover { color: #f2ece0; text-decoration: none; }
.foot-bottom {
  border-top: 1px solid rgba(255,255,255,.09); padding-top: 22px;
  display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  font-size: 12.5px; color: #877d6c; font-family: var(--font-sans);
}
.foot-bottom a { color: #877d6c; }
.foot-bottom a:hover { color: #f2ece0; }

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .foot-cols { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .hero { padding: 52px 0 46px; }
  .sec { padding: 46px 0; }
  .nav-toggle {
    display: inline-flex; align-items: center; gap: 6px;
    background: none; border: 1px solid var(--line-2); border-radius: 2px;
    padding: 7px 12px; font-size: 13.5px; color: var(--ink-2); cursor: pointer;
  }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%;
         background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 20px 16px; }
  .nav.open { display: block; }
  .nav ul { flex-direction: column; gap: 0; }
  .nav li { border-bottom: 1px solid var(--line); }
  .nav a { display: block; padding: 12px 0; border-bottom: none; }
  .site-head .bar { position: relative; }
  .article-body { padding: 32px 0 10px; }
  .article-head { padding: 34px 0 22px; }
}
