/*
Theme Name: 秉元古籍
Theme URI: https://guji.bingyuandaochang.com
Author: 秉元道场
Description: 秉元古籍书库。书目字段与秉元道场古籍阁一致。
Version: 1.0.0
Text Domain: bingyuan-guji
Requires at least: 6.4
Requires PHP: 8.2
*/

:root {
  --ink: #1c1917;
  --parchment: #f7f3ea;
  --deep: #efe6d4;
  --cinnabar: #8f2d2d;
  --gold: #a67c2d;
  --jade: #2f5d50;
  --mist: #8a8175;
  --line: rgba(28, 25, 23, 0.12);
  --hero: #241c16;
  --shadow: 0 10px 30px rgba(36, 28, 22, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--parchment);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  line-height: 1.7;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
.screen-reader {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.gj-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 72px;
  padding: 0 28px;
  background: rgba(247, 243, 234, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.gj-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  font-weight: 700;
  letter-spacing: 0.18em;
}
.gj-seal {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--cinnabar);
  color: var(--cinnabar);
  font-family: "Songti SC", "SimSun", serif;
}
.gj-nav-toggle { display: none; }
.gj-nav-burger { display: none; }
.gj-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-left: auto;
}
.gj-nav a {
  color: rgba(28, 25, 23, 0.78);
  font-size: 14px;
  letter-spacing: 0.08em;
}
.gj-nav a.is-current { color: var(--cinnabar); }

.gj-hero {
  position: relative;
  overflow: hidden;
  padding: 72px 20px 64px;
  color: #f6efe4;
  background:
    radial-gradient(circle at 50% 20%, rgba(166, 124, 45, 0.35), transparent 36%),
    linear-gradient(180deg, #3a2c22 0%, var(--hero) 70%);
}
.gj-hero::before {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 90px;
  background: linear-gradient(180deg, transparent, rgba(247, 243, 234, 0.16));
}
.gj-hero-inner, .gj-wrap { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }
.gj-hero-inner { position: relative; text-align: center; }
.gj-kicker {
  margin: 0 0 12px;
  letter-spacing: 0.42em;
  color: rgba(246, 239, 228, 0.72);
  font-size: 13px;
}
.gj-hero h1 {
  margin: 0;
  font-size: 52px;
  font-weight: 700;
  letter-spacing: 0.28em;
  font-family: "Songti SC", "SimSun", serif;
}
.gj-hero .gj-lead {
  max-width: 720px;
  margin: 16px auto 28px;
  color: rgba(246, 239, 228, 0.82);
}
.gj-page .gj-lead { color: var(--mist); margin-top: -8px; }
.gj-page .gj-search {
  max-width: 520px;
  margin-top: 8px;
  padding: 4px;
  border-radius: 999px;
  background: white;
  border: 1px solid var(--line);
}
.gj-detail-cover .gj-cover-empty { min-height: 280px; }
.gj-search {
  display: flex;
  align-items: center;
  gap: 8px;
}
.gj-search-large {
  width: min(680px, 100%);
  margin: 0 auto;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}
.gj-search input[type="search"] {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  padding: 10px 18px;
}
.gj-search button {
  border: 0;
  border-radius: 999px;
  background: var(--cinnabar);
  color: white;
  padding: 10px 22px;
  cursor: pointer;
}
.gj-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
.gj-chips a {
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(246, 239, 228, 0.88);
  font-size: 13px;
}

.gj-section { padding: 28px 0 10px; }
.gj-section h2, .gj-page-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  font-size: 22px;
  letter-spacing: 0.14em;
}
.gj-section h2::before, .gj-page-title::before {
  content: "";
  width: 4px;
  height: 18px;
  border-radius: 99px;
  background: var(--cinnabar);
}
.gj-cats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.gj-cat {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  background: white;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.gj-cat-mark {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  color: white;
  font-family: "Songti SC", "SimSun", serif;
  font-size: 22px;
}
.gj-cat:nth-child(1) .gj-cat-mark { background: var(--cinnabar); }
.gj-cat:nth-child(2) .gj-cat-mark { background: var(--gold); }
.gj-cat:nth-child(3) .gj-cat-mark { background: var(--jade); }
.gj-cat strong { display: block; letter-spacing: 0.12em; }
.gj-cat span { color: var(--mist); font-size: 13px; }

.gj-head-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.gj-head-row a { color: var(--cinnabar); font-size: 14px; }
.gj-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.gj-card {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 14px;
  padding: 14px;
  background: white;
  border: 1px solid var(--line);
}
.gj-cover {
  display: block;
  height: 124px;
  background: var(--deep);
  overflow: hidden;
}
.gj-cover img { width: 100%; height: 100%; object-fit: cover; }
.gj-cover-empty {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--cinnabar);
  font-family: "Songti SC", "SimSun", serif;
  font-size: 32px;
}
.gj-card h3 { margin: 0 0 4px; font-size: 18px; letter-spacing: 0.04em; }
.gj-meta, .gj-excerpt { margin: 0; color: var(--mist); font-size: 13px; }
.gj-excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 6px;
}
.gj-card-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; }
.gj-price { color: var(--cinnabar); font-weight: 700; }
.gj-tags { display: flex; gap: 6px; }
.gj-tags em {
  font-style: normal;
  padding: 1px 6px;
  background: var(--deep);
  color: var(--ink);
  font-size: 12px;
}
.gj-empty, .gj-prose, .gj-detail {
  background: white;
  border: 1px solid var(--line);
  padding: 28px;
}
.gj-empty strong { letter-spacing: 0.08em; }
.gj-empty p, .gj-prose p { color: rgba(28, 25, 23, 0.78); }
.gj-page { padding: 36px 0 64px; }
.gj-detail { display: grid; grid-template-columns: 220px 1fr; gap: 28px; }
.gj-detail-cover { background: var(--deep); min-height: 280px; }
.gj-detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.gj-facts { display: grid; grid-template-columns: 88px 1fr; gap: 8px 12px; margin: 16px 0; }
.gj-facts dt { color: var(--mist); }
.gj-facts dd { margin: 0; }
.gj-gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 18px; }
.gj-gallery img { width: 100%; height: 120px; object-fit: cover; background: var(--deep); }
.gj-pager { display: flex; gap: 16px; justify-content: center; margin: 22px 0 40px; }
.gj-pager a, .gj-pager span { padding: 6px 12px; background: white; border: 1px solid var(--line); }
.gj-footer {
  padding: 28px;
  text-align: center;
  color: var(--mist);
  border-top: 1px solid var(--line);
}
.gj-footer a { color: var(--cinnabar); }

@media (max-width: 860px) {
  .gj-header { flex-wrap: wrap; padding: 12px 16px; }
  .gj-nav-burger {
    display: inline-flex;
    margin-left: auto;
    padding: 6px 10px;
    border: 1px solid var(--line);
    background: white;
  }
  .gj-nav { display: none; width: 100%; margin: 0; }
  .gj-nav-toggle:checked ~ .gj-nav { display: flex; flex-direction: column; }
  .gj-hero h1 { font-size: 36px; letter-spacing: 0.16em; }
  .gj-cats, .gj-grid, .gj-detail, .gj-gallery { grid-template-columns: 1fr; }
  .gj-wrap, .gj-hero-inner { width: min(1120px, calc(100% - 28px)); }
}
