:root {
  color-scheme: light;
  --background: #f5f3ee;
  --surface: #fff;
  --text: #292722;
  --muted: #6f6a60;
  --border: #ddd7cb;
  --accent: #8b3f2f;
  --code: #f1eee7;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--text);
  background: var(--background);
  font-size: 16px;
  line-height: 1.5;
}

a { color: var(--accent); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
ul, ol { padding-inline-start: 1.5em; }

.site-header {
  color: #fff;
  background: #292722;
  border-bottom: 4px solid var(--accent);
}

.site-header__inner,
.site-layout,
.site-footer__inner {
  width: min(100% - 2rem, 1240px);
  margin-inline: auto;
}

.site-header__inner { padding: 2rem 0 1.25rem; }
.site-title { color: #fff; font-family: Georgia, "Noto Serif SC", serif; font-size: clamp(2rem, 5vw, 3rem); font-weight: 700; text-decoration: none; }
.site-description { margin: .25rem 0 1rem; color: #d8d2c7; }
.site-nav { display: flex; flex-wrap: wrap; gap: .5rem 1rem; }
.site-nav a { color: #fff; text-decoration: none; }
.site-nav a:hover { text-decoration: underline; }
.site-nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; }

.site-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 300px);
  gap: 2rem;
  align-items: start;
}
.site-main { min-width: 0; padding-block: 2rem 4rem; }
.site-sidebar { min-width: 0; padding-block: 2rem 4rem; }
.sidebar-card { margin-bottom: 1.25rem; padding: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: 4px; }
.sidebar-card h2 { margin: 0 0 .75rem; font-family: Georgia, "Noto Serif SC", serif; font-size: 1.15rem; }
.sidebar-card ul { margin-block: .5rem; padding-left: 1.25rem; }
.sidebar-card li { margin-block: .25rem; }
.sidebar-toc nav > ul { margin-bottom: 0; }
.sidebar-toc .toc-level-3 { margin-left: .75rem; }
.sidebar-toc .toc-level-4 { margin-left: 1.5rem; }
.archive-tree details { padding-block: 0; }
.archive-tree summary, .archive-tree li { line-height: 1.5; }
.archive-tree summary { cursor: pointer; }
.archive-tree summary a { font-weight: 600; }
.sidebar-card .archive-tree ul { margin-block: 0; }
.sidebar-card .archive-tree li { margin-block: 0; }
.sidebar-count-list { list-style: none; padding-left: 0 !important; }
.sidebar-count-list li { display: flex; justify-content: space-between; gap: .75rem; }
.sidebar-count-list span, .tag-cloud span { color: var(--muted); font-size: .85em; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: .4rem; }
.tag-cloud a { padding: .18rem .45rem; border: 1px solid var(--border); border-radius: 3px; background: #faf9f6; text-decoration: none; }
.sidebar-more { margin: .75rem 0 0; font-size: .9rem; }

.article {
  margin-bottom: 1.5rem;
  padding: clamp(1.25rem, 4vw, 2.5rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 4px 18px rgb(45 39 31 / 5%);
}

.article-title { margin: 0; font-family: Georgia, "Noto Serif SC", serif; line-height: 1.3; }
.article--summary .article-title { font-size: clamp(1.35rem, 3vw, 1.8rem); }
.article--single .article-title { font-size: clamp(1.8rem, 4vw, 2.5rem); }
.article-title a { color: inherit; text-decoration: none; }
.article-title a:hover { color: var(--accent); }
.post-meta { margin: .4rem 0 1.5rem; color: var(--muted); font-size: .92rem; }
.article-content { overflow-wrap: anywhere; }
.article-content img { max-width: 100%; height: auto; }
.article-content figure { max-width: 100% !important; margin-inline: auto; }
.article-content figure a { display: block; max-width: 100%; margin-bottom: .375em; }
.article-content figure img { display: block; width: auto !important; max-width: 100% !important; height: auto !important; margin-inline: auto; }
.article-content iframe, .article-content video { max-width: 100%; }
.article-footer { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--border); color: var(--muted); font-size: .94rem; }

blockquote { margin-inline: 0; padding: .75rem 1.25rem; border-left: 4px solid var(--border); color: #4f4b44; background: #f8f7f4; }
blockquote > :first-child { margin-top: 0; }
blockquote > :last-child { margin-bottom: 0; }
pre { overflow-x: auto; padding: 1rem; background: var(--code); border: 1px solid var(--border); border-radius: 3px; line-height: 1.5; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: .9em; }
:not(pre) > code { padding: .1em .3em; background: var(--code); border-radius: 3px; }
table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
th, td { padding: .4rem .65rem; border: 1px solid var(--border); }

.wp-caption { margin: 1.5rem auto; padding: .5rem; text-align: center; border: 1px solid var(--border); background: #faf9f6; }
.wp-caption img { display: block; margin-inline: auto; }
.wp-caption figcaption { color: var(--muted); font-size: .9rem; }
.alignleft { margin-left: 0; }
.alignright { margin-right: 0; }

.table-of-contents { float: right; max-width: min(45%, 24rem); margin: 0 0 1rem 1.5rem; padding: 1rem; border: 1px solid var(--border); background: #faf9f6; font-size: .9rem; }
.table-of-contents ul { padding-left: 1.25rem; }
.legacy-script-notice, .protected-post-notice { margin: 1rem 0; padding: 1rem; border-left: 4px solid #a36b2c; background: #fff5df; }
.article-content p.ntc { margin: 1rem 0; padding: .35rem .75rem; color: #8b3028; background: #fff0ed; border: 1px solid #d9a29a; border-left: 4px solid var(--accent); border-radius: 3px; }
.article-content p.ntc code { color: inherit; background: #f7deda; }
.article--single .article-content :is(h2, h3, h4) { scroll-margin-top: 1rem; transition: color .15s ease; }
.article--single .article-content :is(h2, h3, h4):hover { color: var(--accent); }
.heading-anchor { display: inline-block; width: 1.1em; margin-left: -1.1em; color: var(--muted); font-weight: 400; text-decoration: none; opacity: 0; transition: opacity .15s ease, color .15s ease; }
.article--single .article-content :is(h2, h3, h4):hover .heading-anchor,
.heading-anchor:focus-visible { color: var(--accent); opacity: .55; outline: none; }

.archive-header { margin-bottom: 1.5rem; }
.category-tree { margin: 0; padding: 0; list-style: none; background: var(--surface); border: 1px solid var(--border); border-radius: 4px; }
.category-tree__item { margin: 0; list-style: none; border-bottom: 1px solid var(--border); }
.category-tree > .category-tree__item:last-child { border-bottom: 0; }
.category-tree__row { display: grid; grid-template-columns: minmax(10rem, 1fr) auto; gap: .75rem 1.25rem; align-items: baseline; padding: .55rem .85rem; }
.category-tree__label { min-width: 0; }
.category-tree__name { font-weight: 600; text-decoration: none; }
.category-tree__count, .category-tree time { color: var(--muted); font-size: .88rem; white-space: nowrap; }
.category-tree__children { margin: 0; padding: 0 0 0 1.5rem; list-style: none; border-top: 1px solid var(--border); }
.category-tree__children .category-tree__item:last-child { border-bottom: 0; }
.category-tree__item--child .category-tree__name { font-weight: 400; }
.category-tree--sidebar { background: transparent; border: 0; border-radius: 0; }
.sidebar-card .category-tree--sidebar { margin: 0; padding-left: 0; }
.sidebar-card .category-tree--sidebar .category-tree__item { margin: 0; border-bottom: 0; }
.category-tree--sidebar .category-tree__row { display: block; padding: 0; line-height: 1.5; }
.category-tree--sidebar .category-tree__children { margin: 0; padding-left: 1rem; border-top: 0; }
.taxonomy-tag-cloud { align-items: flex-start; }
.pagination { display: flex; justify-content: center; padding: 1rem 0; }
.pagination__pages { display: flex; flex-wrap: wrap; gap: .25rem; align-items: center; justify-content: center; }
.pagination__page, .pagination__ellipsis { display: inline-flex; min-width: 2.25rem; min-height: 2.25rem; align-items: center; justify-content: center; }
.pagination__page { padding: .2rem .45rem; background: var(--surface); border: 1px solid var(--border); border-radius: 3px; text-decoration: none; }
.pagination__page:hover { border-color: var(--accent); }
.pagination__page[aria-current="page"] { color: #fff; background: var(--accent); border-color: var(--accent); font-weight: 600; }
.pagination__direction { font-size: 1.25rem; line-height: 1; }
.pagination__ellipsis { color: var(--muted); }
.site-footer { color: #d8d2c7; background: #292722; border-top: 4px solid var(--accent); font-size: .9rem; }
.site-footer__inner { padding: 1.5rem 0; text-align: center; }
.site-footer p { margin: 0; }

@media (max-width: 680px) {
  .site-header__inner, .site-layout, .site-footer__inner { width: min(100% - 1rem, 1240px); }
  .site-header__inner { padding-inline: .5rem; }
  .article { padding: 1rem; }
  .table-of-contents { float: none; max-width: none; margin-inline: 0; }
  .category-tree__row { grid-template-columns: minmax(0, 1fr) auto; gap: .15rem .75rem; }
  .category-tree time { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .site-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .site-main { padding-bottom: 1rem; }
  .site-sidebar { padding-top: 0; }
}
