/* ==========================================================================
   cfse-demo — premium re-skin
   暖米白 + 衬线标题 + 发丝线 + 克制古铜点缀。去掉渐变 / 投影 / 冷蓝。
   结构（class 名）与现有 tpl.json 完全一致，可直接替换 style.css。
   ========================================================================== */

:root {
  --bg: #faf8f5;
  --surface: #ffffff;
  --surface-2: #f4f0e9;
  --ink: #17140f;
  --ink-2: #5c564d;
  --ink-3: #9c9488;
  --line: #e8e2d8;
  --line-2: #d8cfc0;
  --accent: #8a6a43;
  --accent-ink: #6f5233;
  --radius: 10px;
  --radius-sm: 7px;
  --maxw: 1080px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --serif: "Noto Serif SC", "Songti SC", "Source Han Serif SC", Georgia, "Times New Roman", "SimSun", serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-family: var(--serif); font-weight: 600; letter-spacing: -0.005em; color: var(--ink); }
p { margin: 0; }

.shell { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 248, 245, 0.92);
  border-bottom: 1px solid var(--line);
}
.topbar-in { display: flex; align-items: center; gap: 28px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 3px; margin-right: auto; }
.logo-mark {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px;
  background: var(--ink); color: var(--bg);
  border-radius: 6px;
  font-family: var(--serif); font-size: 13px; font-weight: 700; letter-spacing: 0;
}
.brand-text { font-family: var(--serif); font-size: 16px; font-weight: 600; letter-spacing: -0.015em; }
.badge {
  margin-left: 9px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.04em; text-transform: none;
  color: var(--accent-ink);
  border: 1px solid var(--line-2);
  border-radius: 999px; padding: 2px 8px;
}
.nav { margin-left: 0; }
.menu { display: flex; align-items: center; gap: 26px; list-style: none; margin: 0; padding: 0; }
.menu-item a { color: var(--ink-2); font-size: 14.5px; letter-spacing: 0.01em; transition: color .15s ease; }
.menu-item a:hover { color: var(--ink); }
.srch input {
  width: 176px; font-family: var(--sans); font-size: 13.5px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); padding: 8px 12px; outline: none;
  transition: border-color .15s ease;
}
.srch input::placeholder { color: var(--ink-3); }
.srch input:focus { border-color: var(--accent); }

/* ---------- hero ---------- */
.hero { padding: 104px 0 76px; }
.hero-in { text-align: center; max-width: 800px; margin: 0 auto; }
.eyebrow {
  font-family: var(--sans); font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--accent-ink); margin-bottom: 24px;
}
.hero h1 {
  font-size: clamp(2.2rem, 5.2vw, 3.6rem);
  font-weight: 600; line-height: 1.12; letter-spacing: -0.01em;
}
.grad { color: var(--ink); font-style: italic; } /* 衬线斜体，比渐变克制的"贵" */
.lede { margin: 26px auto 0; max-width: 600px; font-size: 17.5px; color: var(--ink-2); line-height: 1.75; }
.cta { display: flex; justify-content: center; gap: 14px; margin-top: 36px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14.5px; font-weight: 500; letter-spacing: 0.01em;
  padding: 12px 24px; border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: background .15s ease, border-color .15s ease, color .15s ease, opacity .15s ease;
}
.btn-primary { background: var(--ink); color: #faf8f5; border-color: var(--ink); }
.btn-primary:hover { background: #000; border-color: #000; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-light { background: #faf8f5; color: var(--ink); border-color: #faf8f5; }
.btn-light:hover { background: #fff; border-color: #fff; }

.stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  max-width: 760px; margin: 60px auto 0; padding-top: 32px;
  border-top: 1px solid var(--line);
}
.stats > div { text-align: center; padding: 0 14px; border-left: 1px solid var(--line); }
.stats > div:first-child { border-left: 0; }
.stats dt { font-family: var(--serif); font-size: 1.7rem; font-weight: 600; letter-spacing: -0.01em; }
.stats dd { margin: 6px 0 0; font-size: 12.5px; color: var(--ink-3); letter-spacing: 0.02em; }

/* ---------- section ---------- */
.section { padding: 88px 0; }
.section.alt { background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sec-head { max-width: 640px; margin-bottom: 48px; }
.sec-head h2 { font-size: clamp(1.5rem, 2.6vw, 2.05rem); font-weight: 600; }
.sec-head p { margin-top: 12px; color: var(--ink-2); font-size: 16px; }

/* routes */
.routes { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.route {
  display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 32px; background: var(--surface);
  transition: border-color .18s ease, transform .18s ease;
}
.route:hover { border-color: var(--line-2); }
.route-no { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-ink); }
.route h3 { font-size: 1.3rem; font-weight: 600; margin: 16px 0 10px; }
.route p { color: var(--ink-2); font-size: 14.5px; flex: 1; }
.more { margin-top: 20px; color: var(--accent-ink); font-size: 14px; font-weight: 500; }

/* features */
.feats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px 32px; }
.feat .ico {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px;
  border: 1px solid var(--line-2); border-radius: 50%;
  background: var(--surface);
  font-family: var(--serif); font-size: 16px; font-weight: 600; color: var(--accent-ink);
}
.feat h3 { font-size: 1.12rem; font-weight: 600; margin: 18px 0 8px; }
.feat p { color: var(--ink-2); font-size: 14.5px; line-height: 1.7; }

/* post grid */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.post-card {
  display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; background: var(--surface);
  transition: border-color .18s ease;
}
.post-card:hover { border-color: var(--line-2); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.chip a {
  font-size: 11.5px; letter-spacing: 0.04em; color: var(--accent-ink);
  border: 1px solid var(--line-2); border-radius: 999px; padding: 3px 10px;
}
.card-top time { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.post-card h2 { font-size: 1.14rem; font-weight: 600; line-height: 1.42; margin: 0 0 10px; }
.post-card h2 a { color: var(--ink); }
.post-card h2 a:hover { color: var(--accent-ink); }
.excerpt { color: var(--ink-2); font-size: 14px; line-height: 1.65; flex: 1; }
.card-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line);
}
.read { color: var(--accent-ink); font-size: 13.5px; font-weight: 500; }
.cc { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }

/* pager */
.pager { margin-top: 44px; text-align: center; }
.pager a, .wp-block-query-pagination-next {
  display: inline-block; font-size: 14px; color: var(--ink-2);
  border: 1px solid var(--line-2); border-radius: 999px; padding: 9px 18px;
  transition: border-color .15s ease, color .15s ease;
}
.pager a:hover { border-color: var(--ink); color: var(--ink); }

/* band */
.band { background: #1b1712; color: #f6f2ea; padding: 64px 0; }
.band-in { display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.band h2 { color: #f6f2ea; font-size: clamp(1.4rem, 2.6vw, 1.85rem); font-weight: 500; margin: 0 0 10px; }
.band p { color: rgba(246,242,234,0.6); font-size: 15px; }
.band .btn { flex: none; }

/* footer */
.foot { border-top: 1px solid var(--line); padding: 64px 0 0; }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 36px; }
.foot-brand { display: flex; flex-direction: column; gap: 12px; max-width: 320px; }
.foot-brand strong { font-family: var(--serif); font-size: 15px; font-weight: 600; }
.foot-brand p { color: var(--ink-3); font-size: 13px; line-height: 1.65; }
.foot h4 { font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 14px; }
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot ul li { margin: 10px 0; }
.foot ul a { color: var(--ink-2); font-size: 14px; }
.foot ul a:hover { color: var(--ink); }
.cnt { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }
.foot-bar { margin-top: 52px; border-top: 1px solid var(--line); padding: 24px 0; }
.foot-bar a { color: var(--ink-2); }
.wp-block-social-link-anchor { color: var(--ink-2); }
.wp-block-social-link-anchor:hover { color: var(--ink); }

/* ---------- single / article ---------- */
.article-wrap { max-width: 740px; margin: 0 auto; padding: 72px 28px 48px; }
.article { max-width: 100%; }
.crumbs { font-family: var(--mono); font-size: 12px; color: var(--ink-3); margin-bottom: 22px; }
.crumbs a { color: var(--ink-3); }
.crumbs a:hover { color: var(--ink-2); }
.post-title { font-family: var(--serif); font-size: clamp(1.9rem, 4vw, 2.7rem); font-weight: 600; line-height: 1.24; letter-spacing: -0.01em; }
.post-meta { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 20px; font-family: var(--mono); font-size: 12.5px; color: var(--ink-3); }
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.post-tags a { font-size: 12px; color: var(--ink-2); border: 1px solid var(--line-2); border-radius: 999px; padding: 3px 11px; }
.post-tags a:hover { border-color: var(--accent); color: var(--accent-ink); }
.content { margin-top: 40px; color: #221e18; font-size: 17px; line-height: 1.82; }
.content > * + * { margin-top: 1.15em; }
.content h2 { font-size: 1.5rem; font-weight: 600; margin-top: 2em; }
.content h3 { font-size: 1.2rem; font-weight: 600; margin-top: 1.7em; }
.content a { color: var(--accent-ink); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.content a:hover { text-decoration-color: var(--accent); }
.content p { margin: 0; }
.content ul, .content ol { padding-left: 1.35em; }
.content li { margin: 0.4em 0; }
.content img { border-radius: var(--radius-sm); }
.content blockquote { margin: 1.5em 0; padding: 6px 0 6px 22px; border-left: 2px solid var(--accent); color: var(--ink-2); font-family: var(--serif); font-style: italic; }
.content code { font-family: var(--mono); font-size: 0.88em; background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; }
.content pre { background: #f5f1ea; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 18px 20px; overflow: auto; }
.content pre code { background: none; border: 0; padding: 0; }
.content table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.content th, .content td { border: 1px solid var(--line); padding: 9px 13px; text-align: left; }
.content th { background: var(--surface-2); font-weight: 600; }

.prevnext { display: flex; justify-content: space-between; gap: 16px; margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--line); }
.prevnext a { color: var(--ink-2); font-size: 14px; }
.prevnext a:hover { color: var(--accent-ink); }

/* comments */
.comments { margin-top: 64px; padding-top: 44px; border-top: 1px solid var(--line); }
.comments h2, .comment-reply-title { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; margin-bottom: 20px; }
.comment-notes { font-size: 13px; color: var(--ink-3); margin-bottom: 16px; }
.comment-form { display: grid; gap: 16px; }
.comment-form p { margin: 0; }
.comment-form label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; letter-spacing: 0.02em; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
  width: 100%; font-family: var(--sans); font-size: 14.5px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  padding: 11px 13px; outline: none; transition: border-color .15s ease, box-shadow .15s ease;
}
.comment-form textarea { min-height: 130px; resize: vertical; }
.comment-form input:focus, .comment-form textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(138,106,67,0.12); }
.form-submit { margin-top: 6px; }
.submit {
  font: inherit; font-size: 14.5px; font-weight: 500;
  background: var(--ink); color: #faf8f5; border: 1px solid var(--ink);
  border-radius: var(--radius-sm); padding: 12px 26px; cursor: pointer; transition: background .15s ease;
}
.submit:hover { background: #000; }

/* page head (category/tag/archive) */
.page-head { padding: 64px 0 12px; }
.page-head h1 { font-family: var(--serif); font-size: clamp(1.7rem, 3.4vw, 2.25rem); font-weight: 600; }
.page-sub { margin-top: 10px; color: var(--ink-2); font-size: 15.5px; }

/* ---------- docs layout ---------- */
.docs-shell {
  display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 60px;
  max-width: var(--maxw); margin: 0 auto; padding: 56px 28px 72px;
}
.docs-nav { position: sticky; top: 96px; align-self: start; }
.docs-nav h4 { font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 12px; }
.docs-nav h4:not(:first-child) { margin-top: 30px; }
.docs-nav ul { list-style: none; margin: 0; padding: 0; }
.docs-nav li { margin: 2px 0; }
.docs-nav a { display: block; color: var(--ink-2); font-size: 13.5px; padding: 6px 11px; border-radius: 6px; line-height: 1.4; transition: background .14s ease, color .14s ease; }
.docs-nav a:hover { background: var(--surface-2); color: var(--ink); }
.docs-nav a.is-active { background: var(--surface-2); color: var(--accent-ink); font-weight: 500; }
.docs-main h1 { font-family: var(--serif); font-size: clamp(1.8rem, 3.6vw, 2.3rem); font-weight: 600; }
.docs-main .lede-sm { margin-top: 12px; color: var(--ink-2); font-size: 15.5px; max-width: 640px; }
.docs-group { margin-top: 48px; }
.docs-group > h2 { font-family: var(--sans); font-size: 11.5px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 8px; }
.doc-row { display: flex; align-items: baseline; justify-content: space-between; gap: 22px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.doc-row:last-child { border-bottom: 0; }
.doc-row .doc-t { display: flex; flex-direction: column; gap: 4px; }
.doc-row .doc-t a { font-family: var(--serif); color: var(--ink); font-size: 16.5px; font-weight: 600; }
.doc-row .doc-t a:hover { color: var(--accent-ink); }
.doc-row .doc-d { color: var(--ink-2); font-size: 13.5px; line-height: 1.55; }
.doc-row .arw { color: var(--ink-3); font-size: 15px; flex: none; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .srch { display: none; }
  .feats { grid-template-columns: repeat(2, 1fr); }
  .post-grid { grid-template-columns: repeat(2, 1fr); }
  .foot-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .docs-shell { grid-template-columns: 1fr; gap: 10px; padding-top: 32px; }
  .docs-nav { position: static; }
  .docs-nav ul { display: flex; flex-wrap: wrap; gap: 6px; }
  .docs-nav li { margin: 0; }
  .docs-nav h4 { margin-top: 20px; }
}
@media (max-width: 640px) {
  .topbar-in { height: 60px; gap: 14px; }
  .menu { gap: 16px; overflow-x: auto; }
  .menu-item a { white-space: nowrap; }
  .hero { padding: 64px 0 48px; }
  .section { padding: 60px 0; }
  .routes, .feats, .post-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); row-gap: 26px; }
  .stats > div { border-left: 0; }
  .band-in { flex-direction: column; align-items: flex-start; }
  .foot-grid { grid-template-columns: 1fr; gap: 26px; }
}

section.section:has(.post-grid:empty){display:none}
