/*
Theme Name: 青灯集
Theme URI: https://example.com/qingdeng
Author: aikksong
Author URI: https://example.com
Description: 素雅的中文个人博客主题：米纸底色、朱印、宋体长文，农历日期与干支年号，含文章、书斋、分类、归档、友链、搜索、四〇四全套版式。
 Version: 0.1.3
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: qingdeng
Tags: blog, one-column, custom-menu, custom-logo, translation-ready, threaded-comments
*/
:root {
  --paper: #f5f1e6;
  --ink: #2c2a25;
  --ink-light: #6b675e;
  --seal: #9e3b2f;
  --line: #d8d2c2;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", STSong, SimSun, serif;
  line-height: 1.9;
  font-size: 16px;
}
a { color: inherit; text-decoration: none; }
::selection { background: var(--seal); color: var(--paper); }
.wrap { max-width: 720px; margin: 0 auto; padding: 0 24px; }

header { border-bottom: 1px solid var(--line); padding-top: 28px; }
.masthead { display: flex; align-items: center; justify-content: space-between; padding-bottom: 20px; }
.brand-link { display: flex; align-items: center; gap: 12px; }
.seal-mark {
  display: inline-block;
  background: var(--seal);
  color: var(--paper);
  font-size: 13px;
  line-height: 1.4;
  padding: 4px 5px;
  letter-spacing: 2px;
  writing-mode: vertical-rl;
  text-align: center;
  border-radius: 1px;
}
.site-name { font-size: 24px; letter-spacing: 8px; font-weight: 600; }
nav { display: flex; gap: 26px; }
nav a {
  font-size: 15px;
  letter-spacing: 3px;
  color: var(--ink-light);
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color .2s, border-color .2s;
}
nav a:hover { color: var(--seal); }
nav a.active { color: var(--ink); border-bottom-color: var(--seal); }

.motto { text-align: center; padding: 64px 0 56px; }
.motto h1 { font-size: 20px; font-weight: 400; letter-spacing: 4px; margin-bottom: 14px; }
.motto p { font-size: 14px; color: var(--ink-light); letter-spacing: 2px; }

main { padding-bottom: 40px; }
section { margin-bottom: 56px; }
.section-title { font-size: 17px; font-weight: 600; letter-spacing: 6px; margin-bottom: 8px; }
.section-title::after {
  content: "";
  display: block;
  width: 36px;
  height: 2px;
  background: var(--seal);
  margin-top: 8px;
}
.year-label { font-size: 13px; color: var(--ink-light); letter-spacing: 3px; margin: 30px 0 6px; }
.posts { list-style: none; }
.posts li { padding: 13px 0; border-bottom: 1px dashed var(--line); }
.posts time {
  display: inline-block;
  min-width: 96px;
  font-size: 13px;
  color: var(--ink-light);
  letter-spacing: 1px;
  margin-right: 14px;
}
.posts a { font-size: 17px; transition: color .2s; }
.posts a:hover { color: var(--seal); }

.more-link {
  display: inline-block;
  margin-top: 16px;
  font-size: 14px;
  color: var(--seal);
  letter-spacing: 2px;
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.more-link:hover { border-bottom-color: var(--seal); }

.sig {
  margin-top: 10px;
  text-align: right;
  color: var(--ink-light);
  font-size: 14px;
  letter-spacing: 2px;
}

.divider {
  text-align: center;
  color: var(--line);
  letter-spacing: 12px;
  font-size: 12px;
  margin: 48px 0;
  user-select: none;
}

.page-head { text-align: center; padding: 60px 0 34px; }
.page-head h1 { font-size: 22px; font-weight: 400; letter-spacing: 10px; text-indent: 10px; }
.page-head p { font-size: 14px; color: var(--ink-light); letter-spacing: 2px; margin-top: 10px; }

.crumb { font-size: 13px; letter-spacing: 1px; margin-bottom: 30px; }
.crumb a { color: var(--ink-light); transition: color .2s; }
.crumb a:hover { color: var(--seal); }
.post-title { font-size: 25px; font-weight: 600; letter-spacing: 3px; line-height: 1.6; }
.post-meta { font-size: 13px; color: var(--ink-light); letter-spacing: 2px; margin: 12px 0 38px; }

.prose { font-size: 18px; line-height: 2.1; }
.prose p { margin-bottom: 16px; text-indent: 2em; }
.prose h2 { font-size: 22px; font-weight: 600; letter-spacing: 2px; line-height: 1.7; margin: 48px 0 16px; text-indent: 0; }
.prose h3 { font-size: 19px; font-weight: 600; letter-spacing: 4px; margin: 38px 0 12px; text-indent: 0; }
.prose h4 { font-size: 18px; font-weight: 600; letter-spacing: 3px; margin: 30px 0 10px; text-indent: 0; }
.prose hr { border: 0; width: 7em; height: 1px; background: var(--line); margin: 44px auto; }
.prose ul, .prose ol { margin: 14px 0 20px; padding-left: 1.7em; }
.prose li { margin-bottom: 8px; text-indent: 0; }
.prose li::marker { color: var(--seal); }
.prose blockquote {
  margin: 26px 0;
  padding-left: 20px;
  border-left: 2px solid var(--seal);
  color: var(--ink-light);
  font-size: 16px;
  line-height: 1.95;
  text-indent: 0;
}
.end-mark {
  text-align: center;
  color: #a49d8d;
  font-size: 13px;
  letter-spacing: 8px;
  margin-top: 52px;
  user-select: none;
}
.post-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: start;
  border-top: 1px dashed var(--line);
  margin-top: 48px;
  padding-top: 24px;
  font-size: 14px;
}
.post-nav .pn-label { display: block; font-size: 12px; color: var(--ink-light); letter-spacing: 2px; margin-bottom: 4px; }
.post-nav a { transition: color .2s; }
.post-nav a:hover { color: var(--seal); }
.post-nav .prev { justify-self: start; }
.post-nav .next { justify-self: end; text-align: right; }
.post-nav .toc { color: var(--ink-light); font-size: 13px; letter-spacing: 2px; padding-top: 2px; }

.about-block h3 { font-size: 18px; font-weight: 600; letter-spacing: 4px; margin: 38px 0 12px; }
.about-block p { margin-bottom: 16px; text-indent: 2em; }
.dot-list { list-style: none; margin: 6px 0 10px; }
.dot-list li { position: relative; padding-left: 1.4em; }
.dot-list li::before { content: "·"; position: absolute; left: .4em; color: var(--seal); }

.side-note {
  position: fixed;
  right: 34px;
  top: 50%;
  transform: translateY(-50%);
  writing-mode: vertical-rl;
  font-size: 13px;
  color: #a49d8d;
  letter-spacing: 6px;
  user-select: none;
}

footer {
  border-top: 1px solid var(--line);
  padding: 26px 0 40px;
  text-align: center;
  font-size: 13px;
  color: var(--ink-light);
  letter-spacing: 2px;
}
footer a { border-bottom: 1px dotted var(--ink-light); }
footer a:hover { color: var(--seal); border-color: var(--seal); }

@media (max-width: 900px) {
  .side-note { display: none; }
}
@media (max-width: 600px) {
  .masthead { flex-direction: column; align-items: flex-start; gap: 14px; }
  .site-name { font-size: 21px; letter-spacing: 5px; }
  .motto { padding: 44px 0 36px; }
  .page-head { padding: 44px 0 26px; }
  .posts time { display: block; min-width: auto; margin-right: 0; }
  .post-title { font-size: 22px; }
  .prose { font-size: 17px; }
  .post-nav { font-size: 13px; }
}

nav { flex-wrap: wrap; row-gap: 4px; }

.timeline { list-style: none; }
.timeline li {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px dashed var(--line);
}
.timeline time {
  min-width: 96px;
  flex-shrink: 0;
  font-size: 13px;
  color: var(--ink-light);
  letter-spacing: 1px;
}
.timeline a { font-size: 17px; transition: color .2s; }
.timeline a:hover { color: var(--seal); }
.timeline .cat { margin-left: auto; font-size: 12px; color: #a49d8d; letter-spacing: 3px; }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 10px 12px; margin: 10px 0 24px; }
.tag-pill {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-light);
  font-family: inherit;
  font-size: 14px;
  letter-spacing: 1px;
  padding: 3px 14px;
  cursor: pointer;
  transition: color .2s, border-color .2s, background .2s;
}
.tag-pill:hover { color: var(--seal); border-color: var(--seal); }
.tag-pill.active { background: var(--seal); border-color: var(--seal); color: var(--paper); }
.tag-pill .cnt { font-size: 12px; margin-left: 6px; opacity: .65; }
.tag-hint { font-size: 13px; color: var(--ink-light); letter-spacing: 2px; margin-bottom: 22px; }

.link-list { list-style: none; }
.link-list li { border-bottom: 1px dashed var(--line); }
.link-list a { display: flex; align-items: baseline; gap: 16px; padding: 16px 0; }
.link-list .lk-name {
  min-width: 100px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 2px;
  transition: color .2s;
}
.link-list a:hover .lk-name { color: var(--seal); }
.link-list .lk-desc { font-size: 14px; color: var(--ink-light); }
.link-list .lk-url { margin-left: auto; font-size: 12px; color: #a49d8d; letter-spacing: 1px; }
.link-note {
  margin-top: 28px;
  padding: 14px 18px;
  border: 1px dashed var(--line);
  font-size: 14px;
  color: var(--ink-light);
  text-indent: 2em;
}

.post-meta a { color: inherit; }
.post-meta a:hover { color: var(--seal); }

@media (max-width: 600px) {
  .timeline .cat { display: none; }
  .timeline time { min-width: 84px; }
  .link-list a { flex-wrap: wrap; gap: 4px 12px; }
  .link-list .lk-url { margin-left: 0; width: 100%; }
  .link-list .lk-name { min-width: auto; }
  .tag-pill { font-size: 13px; padding: 2px 11px; }
}

.search-box { margin: 6px 0 4px; }
.search-box input {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--line);
  background: transparent;
  font-family: inherit;
  font-size: 17px;
  color: var(--ink);
  padding: 10px 2px;
  letter-spacing: 1px;
}
.search-box input:focus { outline: none; border-bottom-color: var(--seal); }
.search-box input::placeholder { color: #b3ac9c; }
.search-count { font-size: 13px; color: var(--ink-light); letter-spacing: 2px; margin: 20px 0 6px; }
.search-more {
  display: block;
  margin: 20px auto 4px;
  font-family: inherit;
  font-size: 14px;
  letter-spacing: 3px;
  color: var(--ink-light);
  background: transparent;
  border: 1px solid var(--line);
  padding: 9px 28px;
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.search-more:hover { color: var(--seal); border-color: var(--seal); }

.result { padding: 14px 0; border-bottom: 1px dashed var(--line); }
.result .r-head { display: flex; align-items: baseline; gap: 14px; }
.result time { font-size: 13px; color: var(--ink-light); letter-spacing: 1px; flex-shrink: 0; }
.result .r-title { font-size: 17px; transition: color .2s; }
.result .r-title:hover { color: var(--seal); }
.result .r-cat { margin-left: auto; font-size: 12px; color: #a49d8d; letter-spacing: 3px; }
.result .r-snip { font-size: 13px; color: var(--ink-light); line-height: 1.9; margin-top: 4px; }
.hl { font-style: normal; color: var(--seal); }

.notfound { text-align: center; padding-top: 84px; padding-bottom: 96px; }
.notfound h1 { font-size: 30px; font-weight: 600; letter-spacing: 10px; text-indent: 10px; margin-bottom: 16px; }
.notfound p { color: var(--ink-light); letter-spacing: 2px; }
.notfound .nf-nav { margin-top: 36px; }
.notfound .nf-nav a { color: var(--seal); transition: border-color .2s; border-bottom: 1px solid transparent; }
.notfound .nf-nav a:hover { border-bottom-color: var(--seal); }

.to-top {
  position: fixed;
  right: 26px;
  bottom: 30px;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-light);
  font-family: inherit;
  font-size: 15px;
  cursor: pointer;
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .25s, transform .25s, visibility .25s, background .2s, color .2s, border-color .2s;
}
.to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { background: var(--seal); border-color: var(--seal); color: var(--paper); }

.nav-search {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 27px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink-light);
  align-self: center;
  margin-left: 2px;
  transition: color .2s, border-color .2s;
}
.nav-search:hover { color: var(--seal); border-color: var(--seal); }
.nav-search.active { color: var(--ink); border-color: var(--seal); }
.nav-search svg { display: block; }

.cat-name { font-size: 17px; font-weight: 600; letter-spacing: 4px; margin: 36px 0 6px; }
.cat-name .cnt { font-size: 13px; font-weight: 400; color: #a49d8d; letter-spacing: 2px; margin-left: 10px; }
.cat-desc { font-size: 14px; color: var(--ink-light); letter-spacing: 1px; margin-bottom: 12px; }
.timeline a.cat { transition: color .2s; }
.timeline a.cat:hover { color: var(--seal); }

@media (max-width: 600px) {
  .result .r-cat { display: none; }
  .notfound h1 { font-size: 25px; letter-spacing: 7px; }
  .to-top { right: 16px; bottom: 20px; width: 40px; height: 40px; }
}

/* —— 分页（主题补充） —— */
.navigation.pagination .nav-links {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 34px;
  font-size: 14px;
  letter-spacing: 2px;
}
.navigation.pagination .page-numbers {
  color: var(--ink-light);
  border-bottom: 1px solid transparent;
  transition: color .2s, border-color .2s;
}
.navigation.pagination .page-numbers:hover { color: var(--seal); }
.navigation.pagination .page-numbers.current { color: var(--ink); border-bottom-color: var(--seal); }

.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  word-wrap: normal !important;
}

/* ---- 页脚微调：年份为阿拉伯数字，去掉被 letter-spacing 拉散的字距 ---- */
.footer-years { letter-spacing: normal; font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* ---- 代码排版（码事组文章） ---- */
.prose pre {
  margin: 28px 0;
  padding: 14px 16px 16px;
  background: #efe9da;
  border: 1px solid var(--line);
  border-left: 3px solid var(--seal);
  overflow-x: auto;
  font-family: ui-monospace, "Cascadia Mono", Consolas, "SFMono-Regular", Menlo, monospace;
  font-size: 13px;
  line-height: 1.8;
  letter-spacing: normal;
  color: #3a372f;
  text-indent: 0;
  tab-size: 4;
}
.prose pre code {
  display: block;
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  white-space: pre;
}
.prose :not(pre) > code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, "SFMono-Regular", Menlo, monospace;
  font-size: .9em;
  background: #ebe4d2;
  color: var(--seal);
  padding: 1px 6px;
  border: 1px solid var(--line);
  text-indent: 0;
}

/* ---- 代码块：复制按钮 + 长代码横向滚动条 ---- */
.qd-code { position: relative; margin: 28px 0; }
.qd-code pre { margin: 0; }
.prose pre {
  scrollbar-width: thin;
  scrollbar-color: #bcae90 #e6dfcd;
}
.prose pre::-webkit-scrollbar { height: 9px; }
.prose pre::-webkit-scrollbar-track { background: #e6dfcd; }
.prose pre::-webkit-scrollbar-thumb { background: #bcae90; border-radius: 4px; border: 2px solid #e6dfcd; }
.prose pre::-webkit-scrollbar-thumb:hover { background: var(--seal); }
.qd-copy {
  position: absolute;
  top: 7px;
  right: 7px;
  padding: 2px 10px 3px;
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 2px;
  line-height: 1.6;
  color: var(--ink-light);
  background: rgba(255, 253, 246, .94);
  border: 1px solid var(--line);
  border-radius: 2px;
  cursor: pointer;
  opacity: 0;
  transition: opacity .2s, color .2s, border-color .2s;
}
.qd-code:hover .qd-copy,
.qd-copy:focus-visible { opacity: 1; }
.qd-copy:hover { color: var(--seal); border-color: var(--seal); }
.qd-copy.done { opacity: 1; color: var(--seal); border-color: var(--seal); }
@media (hover: none) {
  .qd-copy { opacity: 1; }
}

/* ---- 代码配色（Prism 令牌 · 青灯纸墨系） ---- */
.prose pre .token.comment,
.prose pre .token.prolog,
.prose pre .token.doctype,
.prose pre .token.cdata { color: #8d887a; font-style: italic; }
.prose pre .token.punctuation { color: #57534a; }
.prose pre .token.namespace { opacity: .7; }
.prose pre .token.keyword,
.prose pre .token.atrule,
.prose pre .token.important,
.prose pre .token.selector,
.prose pre .token.tag { color: #a03a2a; }
.prose pre .token.property,
.prose pre .token.function,
.prose pre .token.class-name { color: #2f5d7c; }
.prose pre .token.string,
.prose pre .token.char,
.prose pre .token.attr-value,
.prose pre .token.builtin,
.prose pre .token.inserted { color: #4f6f2f; }
.prose pre .token.number,
.prose pre .token.boolean,
.prose pre .token.constant,
.prose pre .token.symbol,
.prose pre .token.regex,
.prose pre .token.variable,
.prose pre .token.url { color: #8a5a1e; }
.prose pre .token.operator,
.prose pre .token.entity { color: #57534a; }
.prose pre .token.deleted { color: #a03a2a; }
.prose pre .token.attr-name { color: #8a5a1e; }


/* ---- 分类页分组：组题成标题行，组内内容以细线收拢，组间拉开 ---- */
.cat-group { margin-top: 46px; }
.cat-group:first-child { margin-top: 8px; }
.cat-group .year-label { margin: 0; display: flex; align-items: center; gap: 14px; }
.cat-group .year-label a { color: var(--ink-light); text-decoration: none; white-space: nowrap; transition: color .2s; }
.cat-group .year-label a:hover { color: var(--seal); }
.cat-group .year-label::after { content: ""; flex: 1 1 auto; height: 1px; background: var(--line); }
.cat-group-body { margin-top: 14px; padding-left: 18px; border-left: 1px solid var(--line); }
.cat-group-body .cat-name { margin-top: 30px; }
.cat-group-body .cat-name:first-child { margin-top: 6px; }
