/* pangwei.io — shared stylesheet (2026 redesign)
   Quiet literary: warm paper, ink, one cinnabar accent. */

:root {
  --paper: #f6f1e7;
  --paper-2: #efe8da;
  --card: #fbf8f2;
  --ink: #1f1b16;
  --ink-2: #4a433a;
  --muted: #7a7064;
  --rule: #d9cfbf;
  --seal: #9b2c1f;
  --seal-soft: #b8483a;
  --serif-zh: "Noto Serif SC", "Songti SC", "STSong", serif;
  --serif-en: "EB Garamond", "Libre Baskerville", Georgia, serif;
  --sans: "Source Sans 3", -apple-system, "Helvetica Neue", sans-serif;
  --measure: 40rem;
  --wide: 68rem;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif-en), var(--serif-zh);
  font-size: 19px;
  line-height: 1.8;
  text-rendering: optimizeLegibility;
}
:lang(zh) { font-family: var(--serif-zh); }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration-color: var(--rule); text-underline-offset: 3px; }
a:hover { color: var(--seal); text-decoration-color: var(--seal); }

/* ---------- language toggle ---------- */
html[data-lang="zh"] [lang="en"] { display: none !important; }
html[data-lang="en"] [lang="zh"] { display: none !important; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(246, 241, 231, 0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--rule);
}
.site-header .inner {
  max-width: var(--wide); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.85rem 1.25rem; gap: 1rem;
}
.brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; }
.seal {
  width: 34px; height: 34px; flex: none;
  background: var(--seal); color: #fbf3ea;
  font-family: var(--serif-zh); font-weight: 600; font-size: 19px;
  display: grid; place-items: center; border-radius: 3px;
  letter-spacing: 0;
}
.brand-name { font-family: var(--serif-zh); font-size: 1.05rem; letter-spacing: 0.12em; line-height: 1.2; }
.brand-name small { display: block; font-family: var(--serif-en); font-size: 0.78rem; letter-spacing: 0.08em; color: var(--muted); }
.nav { display: flex; align-items: center; gap: 1.4rem; list-style: none; }
.nav a {
  font-family: var(--sans); font-size: 0.86rem; letter-spacing: 0.06em;
  text-decoration: none; color: var(--ink-2);
}
.nav a:hover, .nav a.active { color: var(--seal); }
.lang-btn {
  font-family: var(--sans); font-size: 0.78rem; letter-spacing: 0.08em;
  background: none; border: 1px solid var(--rule); color: var(--ink-2);
  padding: 0.25rem 0.6rem; border-radius: 2px; cursor: pointer;
}
.lang-btn:hover { border-color: var(--seal); color: var(--seal); }
.menu-btn { display: none; background: none; border: 0; cursor: pointer; padding: 0.3rem; }
.menu-btn span { display: block; width: 22px; height: 1.5px; background: var(--ink); margin: 5px 0; }

@media (max-width: 860px) {
  .menu-btn { display: block; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: flex-start; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--rule);
    padding: 0.5rem 1.25rem 1rem;
  }
  .nav.open { display: flex; }
  .nav li { width: 100%; border-bottom: 1px solid var(--paper-2); }
  .nav a { display: block; padding: 0.7rem 0; font-size: 1rem; }
  .nav li:last-child { border: 0; padding-top: 0.7rem; }
}

/* ---------- layout ---------- */
.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 1.25rem; }
.narrow { max-width: var(--measure); margin: 0 auto; padding: 0 1.25rem; }
section { padding: 4.5rem 0; }
section + section { border-top: 1px solid var(--rule); }

.kicker {
  font-family: var(--sans); font-size: 0.74rem; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--seal); margin-bottom: 1rem;
}
.kicker:lang(zh) { letter-spacing: 0.3em; }
h1, h2, h3 { font-weight: 500; line-height: 1.3; }
h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); letter-spacing: 0.02em; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.15rem); margin-bottom: 1.2rem; }
h3 { font-size: 1.25rem; margin-bottom: 0.4rem; }
p + p { margin-top: 1em; }
.lede { font-size: 1.15rem; color: var(--ink-2); }
.muted { color: var(--muted); }
.small { font-size: 0.88rem; }

/* ---------- hero ---------- */
.hero { padding: 6rem 0 5rem; }
.hero .wrap { display: grid; grid-template-columns: 1.4fr 1fr; gap: 4rem; align-items: end; }
.hero h1 { margin-bottom: 1.4rem; }
.hero .lede { max-width: 34rem; }
.hero-quote {
  border-left: 2px solid var(--seal); padding: 0.2rem 0 0.2rem 1.4rem;
  font-size: 1.15rem; color: var(--ink-2);
}
.hero-quote cite { display: block; margin-top: 0.8rem; font-style: normal; font-family: var(--sans); font-size: 0.8rem; letter-spacing: 0.08em; color: var(--muted); }
@media (max-width: 860px) {
  .hero { padding: 3.5rem 0 3rem; }
  .hero .wrap { grid-template-columns: 1fr; gap: 2.5rem; }
}

/* ---------- feature (book) ---------- */
.feature { display: grid; grid-template-columns: 15rem 1fr; gap: 3.5rem; align-items: start; }
@media (max-width: 760px) { .feature { grid-template-columns: 1fr; gap: 2rem; } .feature .cover { max-width: 11rem; } }

.cover {
  text-decoration: none;
  aspect-ratio: 2 / 3; width: 100%; max-width: 15rem;
  background: var(--ink); color: #efe6d6;
  padding: 1.6rem 1.3rem; display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: 0 1px 0 var(--rule), 12px 14px 0 -2px var(--paper-2);
  position: relative;
}
.cover .c-title { font-family: var(--serif-zh); font-size: 2rem; line-height: 1.25; letter-spacing: 0.1em; }
.cover .c-sub { font-family: var(--serif-zh); font-size: 0.82rem; line-height: 1.7; color: #c9bda9; margin-top: 0.9rem; }
.cover .c-author { font-family: var(--serif-zh); font-size: 0.9rem; letter-spacing: 0.3em; }
.cover .c-seal { position: absolute; right: 1.1rem; bottom: 1.3rem; width: 26px; height: 26px; background: var(--seal); color: #fbf3ea; font-family: var(--serif-zh); font-size: 14px; display: grid; place-items: center; border-radius: 2px; }
.cover.light { background: var(--card); color: var(--ink); border: 1px solid var(--rule); }
.cover.light .c-sub { color: var(--muted); }
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.status {
  display: inline-block; font-family: var(--sans); font-size: 0.74rem; letter-spacing: 0.12em;
  color: var(--seal); border: 1px solid var(--seal-soft); padding: 0.15rem 0.55rem; border-radius: 2px;
  margin-bottom: 1rem;
}
.facts { margin-top: 1.6rem; display: grid; grid-template-columns: max-content 1fr; gap: 0.3rem 1.2rem; font-size: 0.95rem; }
.facts dt { font-family: var(--sans); font-size: 0.8rem; letter-spacing: 0.06em; color: var(--muted); padding-top: 0.2rem; }

/* ---------- lists of writing ---------- */
.entries { list-style: none; }
.entries li { padding: 1.4rem 0; border-top: 1px solid var(--rule); display: grid; grid-template-columns: 7rem 1fr; gap: 1.5rem; }
.entries li:last-child { border-bottom: 1px solid var(--rule); }
.entries .date { font-family: var(--sans); font-size: 0.8rem; color: var(--muted); letter-spacing: 0.04em; padding-top: 0.35rem; }
.entries a { text-decoration: none; }
.entries h3 { font-size: 1.2rem; }
.entries p { font-size: 0.98rem; color: var(--ink-2); }
@media (max-width: 640px) { .entries li { grid-template-columns: 1fr; gap: 0.3rem; } }

/* ---------- grid of cards ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2.5rem; }
@media (max-width: 860px) { .grid-3, .grid-2 { grid-template-columns: 1fr; gap: 2rem; } }
.card h3 a { text-decoration: none; }
.card p { font-size: 0.98rem; color: var(--ink-2); }
.more { font-family: var(--sans); font-size: 0.85rem; letter-spacing: 0.06em; color: var(--seal); text-decoration: none; display: inline-block; margin-top: 0.8rem; }
.more:hover { text-decoration: underline; }

.book-row { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1.6rem; align-items: start; }
.book-row .cover { padding: 0.9rem 0.8rem; box-shadow: none; }
.book-row .cover .c-title { font-size: 1rem; letter-spacing: 0.06em; }
.book-row .cover .c-author { font-size: 0.65rem; }

/* ---------- pull quote ---------- */
.pull { text-align: center; padding: 5.5rem 0; background: var(--paper-2); }
.pull blockquote { font-size: clamp(1.4rem, 3vw, 1.9rem); line-height: 1.6; max-width: 44rem; margin: 0 auto; padding: 0 1.25rem; }
.pull cite { display: block; margin-top: 1.2rem; font-family: var(--sans); font-style: normal; font-size: 0.82rem; letter-spacing: 0.1em; color: var(--muted); }

/* ---------- article pages (blog posts, about) ---------- */
.page-head { padding: 4.5rem 0 2.5rem; }
.page-head h1 { font-size: clamp(1.9rem, 4.2vw, 2.8rem); }
.page-head .subtitle, .page-head .date { font-family: var(--sans); font-size: 0.88rem; color: var(--muted); margin-top: 0.8rem; letter-spacing: 0.04em; }
article.prose, .prose { max-width: var(--measure); margin: 0 auto; padding: 0 1.25rem 5rem; }
.prose h2 { font-size: 1.5rem; margin: 3rem 0 1rem; }
.prose h3 { font-size: 1.2rem; margin: 2rem 0 0.6rem; }
.prose p { margin: 0 0 1.1em; }
.prose blockquote, .prose .epigraph, .prose .quote {
  border-left: 2px solid var(--seal); padding: 0.2rem 0 0.2rem 1.3rem; margin: 1.8rem 0; color: var(--ink-2);
}
.prose ul, .prose ol { margin: 0 0 1.1em 1.4em; }
.prose li { margin: 0.3em 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: 0.92rem; }
.prose th, .prose td { border-bottom: 1px solid var(--rule); padding: 0.5rem 0.4rem; text-align: left; vertical-align: top; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--rule); padding: 3rem 0 3.5rem; font-family: var(--sans); font-size: 0.85rem; color: var(--muted); }
.site-footer .inner { max-width: var(--wide); margin: 0 auto; padding: 0 1.25rem; display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.site-footer a { text-decoration: none; }
.site-footer ul { list-style: none; display: flex; gap: 1.2rem; flex-wrap: wrap; }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; font-family: var(--sans); font-size: 0.86rem; letter-spacing: 0.08em;
  text-decoration: none; color: var(--paper); background: var(--ink);
  padding: 0.65rem 1.2rem; border-radius: 2px; margin-top: 1.6rem;
}
.btn:hover { background: var(--seal); color: var(--paper); }
.btn.ghost { background: none; color: var(--ink); border: 1px solid var(--ink); }
.btn.ghost:hover { border-color: var(--seal); color: var(--seal); }

/* ---------- migrated article pages (older markup) ---------- */
.page-head, .article-hero, .article-header, main > .hero, main > header.hero {
  max-width: var(--measure); margin: 0 auto; padding: 4.5rem 1.25rem 2.5rem;
  background: none !important; color: var(--ink) !important; text-align: left;
}
.page-head h1, .article-hero h1, .article-header h1, main > .hero h1 {
  font-size: clamp(1.9rem, 4.2vw, 2.7rem); font-weight: 500; line-height: 1.3; color: var(--ink);
}
.page-head h2, .article-hero h2, main > .hero h2 { font-size: 1.15rem; font-weight: 400; color: var(--ink-2); margin: 0.8rem 0 0; }
.hero-icon { font-size: 1.8rem; margin-bottom: 0.8rem; }
.subtitle, .hero-subtitle, .article-subtitle, .article-hero-subtitle, .tagline { color: var(--ink-2); font-size: 1.05rem; margin-top: 0.8rem; }
.date, .article-date, .article-meta, .hero-meta, .hero-author, .article-author, .author {
  font-family: var(--sans); font-size: 0.86rem; color: var(--muted); letter-spacing: 0.03em; margin-top: 0.6rem;
}
.article-badge, .fire-badge, .ai-badge, .article-category, .tag, .tags span, .post-tags span {
  display: inline-block; font-family: var(--sans); font-size: 0.74rem; letter-spacing: 0.12em;
  color: var(--seal); border: 1px solid var(--seal-soft); background: none !important;
  padding: 0.12rem 0.5rem; border-radius: 2px; margin: 0 0.3rem 0.8rem 0;
}
.prose { max-width: var(--measure); margin: 0 auto; padding: 0 1.25rem 4rem; }
.prose img { margin: 1.5rem auto; height: auto; }
.prose .lead, .prose .intro-text, .prose .lead-box { font-size: 1.12rem; color: var(--ink-2); }
.prose .section-title, .prose .volume-header, .prose .country-header, .prose .zodiac-header, .prose .method-title {
  font-weight: 500; margin: 2.5rem 0 0.8rem; color: var(--ink);
}
.prose .highlight-box, .prose .info-box, .prose .ai-box, .prose .formula-box, .prose .conclusion-box,
.prose .fire-box, .prose .lead-box, .prose .important-note, .prose .highlight-section, .prose .highlight-block,
.prose .conclusion-block, .prose .quote-block, .prose .method-block, .prose .zodiac-section, .prose .list-block,
.prose .prologue, .prose .zodiac-card, .prose .about-section, .prose .toc, .prose .conclusion {
  background: var(--card) !important; color: var(--ink) !important;
  border: 0; border-left: 2px solid var(--seal); border-radius: 0;
  padding: 1.1rem 1.3rem; margin: 1.8rem 0; box-shadow: none !important;
}
.prose .about-section { border-left: 0; background: none !important; padding: 0; }
.prose .quote-source, .prose .epigraph-source { font-family: var(--sans); font-size: 0.85rem; color: var(--muted); margin-top: 0.5rem; }
.prose .highlight-gold, .prose .highlight-fire, .prose .highlight-green, .prose .highlight-blue { color: var(--seal); background: none; }
.prose .divider { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0; height: 0; }
.prose table { display: block; overflow-x: auto; }
.prose .zodiac-emoji, .prose .method-emoji { font-size: 1.4rem; }
.back-row { max-width: var(--measure); margin: 0 auto; padding: 0 1.25rem 4rem; font-family: var(--sans); font-size: 0.9rem; }
.back-row a { color: var(--seal); text-decoration: none; }
.prose h1 { font-size: clamp(1.6rem, 3.4vw, 2rem); margin: 3rem 0 1rem; line-height: 1.35; }

/* ---------- hand-built inner pages ---------- */
.page-head .kicker { margin-bottom: 0.6rem; }
.page-head .lede { margin-top: 1rem; font-size: 1.08rem; color: var(--ink-2); }
.sec-head { margin-bottom: 2rem; }
.sec-head h2 { font-size: 1.5rem; }
.sec-head p { color: var(--ink-2); margin-top: 0.5rem; max-width: 40rem; }
.shelf { display: grid; gap: 3rem; }
.shelf-item { display: grid; grid-template-columns: 9rem 1fr; gap: 2rem; align-items: start; }
.shelf-item img, .shelf-item .cover { width: 100%; max-width: 9rem; box-shadow: 0 6px 18px rgba(31,27,22,.16); }
.shelf-item .cover { padding: 1rem 0.9rem; aspect-ratio: 2 / 3; }
.shelf-item .cover .c-title { font-size: 1.15rem; }
.shelf-item .cover .c-sub { font-size: 0.7rem; }
.shelf-item .num { font-family: var(--sans); font-size: 0.74rem; letter-spacing: 0.14em; color: var(--muted); }
.shelf-item h3 { font-size: 1.3rem; margin: 0.3rem 0 0.2rem; }
.shelf-item .sub { font-style: italic; color: var(--ink-2); font-size: 0.98rem; margin-bottom: 0.8rem; }
.shelf-item p { font-size: 0.98rem; color: var(--ink-2); }
.shelf-item .btn { margin-top: 1rem; }
@media (max-width: 640px) { .shelf-item { grid-template-columns: 6rem 1fr; gap: 1.2rem; } .shelf-item h3 { font-size: 1.15rem; } }

.papers { list-style: none; counter-reset: p; }
.papers li { padding: 2rem 0; border-top: 1px solid var(--rule); }
.papers li:last-child { border-bottom: 1px solid var(--rule); }
.papers .meta { font-family: var(--sans); font-size: 0.78rem; letter-spacing: 0.08em; color: var(--muted); }
.papers h3 { font-size: 1.2rem; margin: 0.4rem 0 0.7rem; }
.papers p { font-size: 0.98rem; color: var(--ink-2); }
.links { margin-top: 0.9rem; display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; }
.links a { font-family: var(--sans); font-size: 0.85rem; letter-spacing: 0.04em; color: var(--seal); text-decoration: none; }
.links a:hover { text-decoration: underline; }
.cite { font-family: var(--sans); font-size: 0.82rem; color: var(--muted); margin-top: 0.9rem; line-height: 1.6; word-break: break-word; }
.flag { background: var(--paper-2); padding: 2.2rem; border-left: 3px solid var(--seal); }
.flag h3 { font-size: 1.35rem; margin: 0.4rem 0 0.8rem; }
.flag p { color: var(--ink-2); margin-top: 0.8rem; }
@media (max-width: 640px) { .flag { padding: 1.4rem; } }
.figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: 1rem; margin-top: 1.4rem; }
.figs div { border-top: 1px solid var(--rule); padding-top: 0.6rem; }
.figs b { display: block; font-family: var(--serif-en, serif); font-size: 1.5rem; font-weight: 500; }
.figs span { font-family: var(--sans); font-size: 0.78rem; color: var(--muted); }

.poem { padding: 2rem 0; border-top: 1px solid var(--rule); }
.poem:last-child { border-bottom: 1px solid var(--rule); }
.poem .num { font-family: var(--sans); font-size: 0.74rem; letter-spacing: 0.14em; color: var(--seal); }
.poem h3 { font-size: 1.4rem; margin: 0.3rem 0 0.2rem; }
.poem .by { font-family: var(--sans); font-size: 0.85rem; color: var(--muted); }
.poem audio { width: 100%; margin-top: 1.1rem; }

.rec { display: grid; grid-template-columns: 9rem 1fr; gap: 2rem; padding: 2rem 0; border-top: 1px solid var(--rule); }
.rec img { width: 100%; box-shadow: 0 6px 18px rgba(31,27,22,.16); }
.rec .video { grid-column: 1 / -1; position: relative; aspect-ratio: 16 / 9; }
.rec .video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.rec.wide { grid-template-columns: 1fr; }
.rec h3 { font-size: 1.25rem; }
.rec .by { font-family: var(--sans); font-size: 0.85rem; color: var(--muted); margin: 0.2rem 0 0.8rem; }
.rec p { color: var(--ink-2); font-size: 0.98rem; margin-top: 0.6rem; }
@media (max-width: 640px) { .rec { grid-template-columns: 6rem 1fr; gap: 1.2rem; } }
.mail { font-size: clamp(1.4rem, 4vw, 2rem); color: var(--seal); text-decoration: none; border-bottom: 1px solid var(--seal-soft); }
.flag p, section .muted { font-size: 0.98rem; }

/* Revised bilingual About page */
.revised-about{max-width:820px;margin:0 auto;padding:30px 24px 85px}.revised-about .about-section{margin:0 0 46px}.revised-about h2{font-size:clamp(1.35rem,2.5vw,1.85rem);margin:0 0 24px;line-height:1.5}.revised-about p{line-height:2;letter-spacing:.012em;margin:0 0 1.3em}.revised-about .closing-note{border-top:1px solid #d8c9b7;border-bottom:1px solid #d8c9b7;padding:34px 10px;margin:65px 0 30px;text-align:center}.revised-about .closing-note blockquote{border:0;margin:18px 0;padding:0;font-family:'EB Garamond','Noto Serif SC',serif;font-size:clamp(1.22rem,2.5vw,1.65rem);line-height:1.95}.revised-about .closing-signature{margin-top:20px;font-size:.95rem;opacity:.7}.revised-about .about-next{text-align:center;line-height:2.2}.revised-about .about-next a{color:#8b382e}.hero-about .subtitle{max-width:820px;margin-left:auto;margin-right:auto}
