/*
Theme Name: 诗
Theme URI: https://example.com/yu
Author: Codex
Description: 一款为中文诗歌、随笔与摄影创作的米白纸张质感单栏主题。
Version: 1.5.5
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
Text Domain: yu
Tags: blog, photography, one-column, custom-menu, featured-images, threaded-comments, translation-ready
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

:root {
  --yu-paper: #faf8f1;
  --yu-ink: #161616;
  --yu-muted: #92918d;
  --yu-line: #e8e4d9;
  --yu-width: 800px;
  --yu-leading: 1.8;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  padding: 20px;
  background: var(--yu-paper);
  color: var(--yu-ink);
  font: 17px/1.85 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft Yahei", "Source Han Sans CN", "Lantinghei SC", "WenQuanYi Micro Hei", sans-serif;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; text-underline-offset: .18em; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; height: auto; }
button, input, textarea { font: inherit; }
::selection { background: #d8d0bd; }

.site-header, .site-main, .site-footer { width: 100%; max-width: var(--yu-width); margin-left: auto; margin-right: auto; }
.site-header { margin-bottom: 120px; }
body.single-post .site-header { margin-bottom: 40px; padding-bottom: 28px; border-bottom: 1px solid var(--yu-line); }
.site-nav { display: flex; justify-content: space-between; gap: 28px; padding: 10px 0; margin-bottom: 90px; color: #888; }
.site-nav a { position: relative; text-decoration: none; transition: color .16s ease; }
.site-nav a::after { content: ""; position: absolute; right: 0; bottom: -4px; left: 0; height: 1px; background: currentColor; opacity: .72; transform: scaleX(0); transform-origin: center; transition: transform .16s ease; }
.site-nav a:hover { color: var(--yu-ink); text-decoration: none; }
.site-nav a:hover::after { transform: scaleX(1); }
.nav-group { display: flex; flex-wrap: wrap; align-items: center; gap: 0; }
.nav-group > * + * { position: relative; margin-left: 30px; }
.nav-group > * + *::before { content: "｜"; position: absolute; top: 0; left: -15px; padding: 0; color: var(--yu-muted); transform: translateX(-50%); }
.nav-secondary { gap: 18px; }
.nav-secondary > * + * { margin-left: 0; }
.nav-secondary > * + *::before { content: none; padding: 0; }
.nav-secondary .menu-inline { gap: 18px; }
.nav-secondary .menu-inline li + li { margin-left: 0; }
.nav-secondary .menu-inline li + li::before { content: none; padding: 0; }
.menu-inline { display: flex; margin: 0; padding: 0; list-style: none; }
.menu-inline li + li { position: relative; margin-left: 30px; }
.menu-inline li + li::before { content: "｜"; position: absolute; top: 0; left: -15px; padding: 0; color: var(--yu-muted); transform: translateX(-50%); }
.nav-toggle { appearance: none; padding: 0; border: 0; background: transparent; color: inherit; cursor: pointer; }
.site-title, .entry-hero-title { margin: 0; font-size: 26px; line-height: 1.5; font-weight: 700; letter-spacing: .01em; }
.site-description, .entry-hero-meta { margin: 0; color: var(--yu-muted); }
.site-description { padding: 5px 0; }
.entry-hero-meta { padding-top: 5.234px; color: #aaa; font-size: 14.1667px; line-height: 26.2083px; }
.archive-count { margin: 17px 0 0; color: var(--yu-muted); font-size: 14px; }

.sticky-reader {
  position: fixed; z-index: 1000; top: 0; left: 0; right: 0;
  padding: 8px 20px 11px; border-bottom: 1px solid rgba(128, 119, 101, .22);
  background: rgba(250, 248, 241, .96); box-shadow: 0 8px 28px rgba(50, 44, 33, .06);
  opacity: 0; transform: translateY(-110%); pointer-events: none;
  transition: opacity .22s ease, transform .22s ease; backdrop-filter: blur(12px);
}
.sticky-reader.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.admin-bar .sticky-reader { top: 32px; }
.sticky-reader-inner { width: 100%; max-width: var(--yu-width); margin: 0 auto; }
.sticky-reader .site-nav { padding: 0; margin: 0 0 18px; font-size: 14px; }
.sticky-reader .hero-identity { display: flex; align-items: baseline; gap: 14px; min-width: 0; }
.sticky-reader .site-title, .sticky-reader .entry-hero-title { overflow: hidden; font-size: 18px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.sticky-reader .site-description, .sticky-reader .entry-hero-meta { overflow: hidden; padding: 0; font-size: 13px; line-height: 1.5; text-overflow: ellipsis; white-space: nowrap; }

.drawer { display: none; margin: -64px 0 72px; padding: 20px 0; border-top: 1px solid var(--yu-line); border-bottom: 1px solid var(--yu-line); }
.drawer.is-open { display: block; }
.drawer ul { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px 24px; margin: 0; padding: 0; list-style: none; }

.post-card { margin: 0 0 50px; padding: 0 0 50px; border-bottom: 1px solid #eee; }
.post-date { color: inherit; font-size: 16px; opacity: .5; }
.post-card-title { margin: 10px 0 20px; font-size: 22px; line-height: 1.5; font-weight: 700; }
.post-card p { margin: 0 0 1.25em; line-height: 1.8; }
.post-gallery { display: flex; gap: 0; margin: -8px -8px 10px; }
.post-gallery a { flex: 1 1 0; min-width: 0; padding: 8px; }
.post-gallery img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.post-wrap { display: flex; gap: 30px; align-items: flex-start; }
.post-wrap .post-text { flex: 0 0 540px; }
.post-wrap .post-cover { flex: 0 0 230px; padding-top: 8px; }
.post-wrap .post-cover img { width: 228px; aspect-ratio: 1 / 1; object-fit: cover; }
.read-more { display: inline; margin: 0; }
.read-more::after { content: " →"; }
.post-meta { margin-top: 10px; color: #aaa; font-size: 15px; }
.post-meta a { color: #66645f; }

.pagination { display: flex; gap: 18px; align-items: center; margin: 10px 0 80px; }
.pagination .current { color: var(--yu-muted); }
.pagination .page-numbers { min-width: 20px; }

.entry-content { margin-top: 0; }
.entry-content > * { max-width: 100%; }
.entry-content p { margin: 0 0 1.5em; }
.entry-content h2 { margin: 2.4em 0 .8em; font-size: 23px; }
.entry-content h3 { margin: 2em 0 .7em; font-size: 20px; }
.entry-content img { width: auto; margin: 42.5px auto; }
.entry-content figure { margin: 0; }
.entry-content figure img { width: 100%; }
body.single-post .entry-content > img:first-child,
body.single-post .entry-content > figure:first-child img:first-child { margin-top: 0; }
.entry-content .gallery { display: block !important; margin: 0 !important; }
.entry-content .gallery-item { float: none !important; width: 100% !important; margin: 0 !important; }
.entry-content .gallery img { width: 100%; border: 0 !important; margin: 42.5px 0; }
.entry-content blockquote { margin: 2em 0; padding-left: 20px; border-left: 2px solid #bcb6a8; color: #56544f; }
.entry-content pre { overflow: auto; padding: 18px; background: #f1eee5; }
.entry-content code { font-size: .9em; }
.entry-content a { text-decoration: underline; }
.creation-background { margin: 76px 0 0; padding: 25px 0 0; border-top: 1px solid var(--yu-line); color: #65625c; }
.entry-content .creation-background h2 { margin: 0 0 12px; color: var(--yu-ink); font-size: 16px; font-weight: 500; letter-spacing: .08em; }
.creation-background div { width: 100%; max-width: none; font-size: 15px; line-height: 1.9; }
.creation-background p { margin: 0 0 .8em; }
.creation-background p:last-child { margin-bottom: 0; }
.entry-footer { margin: 70px 0 0; color: var(--yu-muted); }
.entry-tags { margin-top: 8px; }
.entry-tags a { margin-right: 12px; }
.entry-tags a::before { content: "#"; }

.post-navigation { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; margin: 90px 0; padding-top: 40px; border-top: 1px solid var(--yu-line); }
.post-navigation small { display: block; color: var(--yu-muted); }
.post-navigation strong { font-size: 18px; }
.post-navigation .next { text-align: right; }
.related-posts { margin: 90px 0 0; }
.section-head { margin: 80px 0 20px; padding-bottom: 15px; border-bottom: 2px solid #eee; color: #888; font-size: 17px; line-height: 25.5px; }
.related-posts ul { margin: 0; padding: 0; list-style: none; }
.related-posts li { margin: 7px 0; }
.related-posts .cat { color: #888; }

.comments-area { margin-top: 90px; padding-top: 30px; border-top: 1px solid var(--yu-line); }
.comments-title, .comment-reply-title { margin: 0 0 14px; font-size: 19px; font-weight: 500; line-height: 1.5; }
.comments-title span { margin-left: 4px; color: var(--yu-muted); font-size: 13px; font-weight: 400; }
.comment-list { margin: 0; padding: 0; list-style: none; }
.comment-list .children { margin: 0 0 0 28px; padding: 0; list-style: none; }
.comment-body { margin: 0; padding: 22px 0 21px; border-bottom: 1px solid var(--yu-line); }
.comment-head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; }
.comment-author-name { color: var(--yu-ink); font-size: 15px; font-weight: 500; }
.comment-date { color: var(--yu-muted); font-size: 12px; white-space: nowrap; }
.comment-content { margin-top: 9px; font-size: 15px; line-height: 1.85; }
.comment-content p:last-child { margin-bottom: 0; }
.comment-actions { margin-top: 8px; font-size: 12px; }
.comment-actions a { margin-right: 13px; color: var(--yu-muted); }
.comment-awaiting-moderation { margin: 9px 0 0; color: var(--yu-muted); font-size: 13px; }
.comment-respond { margin-top: 56px; }
.comment-list + .comment-respond { margin-top: 58px; }
.comment-notes, .logged-in-as { margin: -4px 0 22px; color: var(--yu-muted); font-size: 13px; }
.comment-form { width: 100%; max-width: none; }
.comment-form p { margin: 0 0 18px; }
.comment-form label { display: block; color: var(--yu-muted); }
.comment-form label { margin-bottom: 4px; font-size: 13px; }
.comment-form input:not([type=submit]), .comment-form textarea, .search-field {
  width: 100%; padding: 10px 0; border: 0; border-bottom: 1px solid #bcb8ad; border-radius: 0; outline: 0; background: transparent;
}
.comment-form textarea { min-height: 132px; padding: 12px 14px; border: 1px solid #c9c3b7; resize: vertical; }
.comment-form-cookies-consent input { width: auto !important; margin-top: 6px; }
.comment-form-cookies-consent { display: flex; align-items: flex-start; gap: 8px; }
.comment-form-cookies-consent label { margin: 0; line-height: 1.7; }
.comment-form input:focus, .comment-form textarea:focus, .search-field:focus { border-color: var(--yu-ink); }
.submit, .search-submit { padding: 9px 22px; border: 1px solid var(--yu-ink); background: var(--yu-ink); color: var(--yu-paper); cursor: pointer; transition: opacity .18s ease; }
.submit:hover, .search-submit:hover { opacity: .72; }
.comment-form .submit { padding: 7px 18px; background: transparent; color: var(--yu-ink); font-size: 13px; }

.search-page { margin-top: -22px; }
.search-panel { margin-bottom: 72px; padding: 29px 32px 32px; border: 1px solid #ddd7c9; background: rgba(244, 241, 232, .55); }
.search-label { display: block; margin-bottom: 10px; color: var(--yu-muted); font-size: 13px; letter-spacing: .12em; }
.search-form { display: flex; align-items: flex-end; gap: 18px; }
.search-form label { flex: 1; }
.search-field { padding: 10px 2px 11px; font-size: 20px; }
.search-field::placeholder { color: #aaa79f; }
.search-summary { display: flex; justify-content: space-between; gap: 20px; margin: 0 0 18px; padding-bottom: 13px; border-bottom: 1px solid var(--yu-line); color: var(--yu-muted); font-size: 14px; }
.search-results-list { list-style: none; margin: 0; padding: 0; }
.search-result { display: grid; grid-template-columns: 48px 1fr auto; gap: 0 22px; padding: 28px 0 30px; border-bottom: 1px solid var(--yu-line); }
.search-result-index { padding-top: 5px; color: #b0ada5; font: italic 15px/1.5 Georgia, serif; }
.search-result-title { margin: 0 0 9px; font-size: 22px; line-height: 1.5; }
.search-result-excerpt { max-width: 620px; margin: 0; color: #56544f; font-size: 16px; line-height: 1.8; }
.search-result-meta { padding-top: 6px; color: var(--yu-muted); font-size: 13px; white-space: nowrap; }
.search-empty { padding: 14px 0 80px; }
.search-empty h2 { margin: 0 0 10px; font-size: 22px; }
.search-suggestions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 28px; }
.search-suggestions a { padding: 6px 13px; border: 1px solid #d6d0c3; color: #6e6a62; font-size: 14px; }

.archives { border-top: 1px solid var(--yu-line); }
.archives details { border-bottom: 1px solid var(--yu-line); }
.archives summary { display: flex; align-items: center; justify-content: space-between; min-height: 60px; padding: 0; cursor: pointer; list-style: none; font-size: 17px; }
.archives summary::-webkit-details-marker { display: none; }
.archives summary::after { content: "+"; color: #aaa69c; font-size: 18px; font-weight: 300; }
.archives details[open] summary::after { content: "−"; }
.archives summary small { margin-left: auto; margin-right: 16px; color: #aaa69c; font-size: 13px; font-weight: 400; }
.archive-month-list { margin: -1px 0 0; padding: 0 0 15px; list-style: none; }
.archive-month-list li { border-top: 1px solid rgba(232, 228, 217, .72); }
.archive-month-list a { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; padding: 14px 0; }
.archive-month-list a:hover { text-decoration: none; }
.archive-month-list h2 { margin: 0; font-size: 17px; line-height: 1.55; }
.archive-month-list .time { flex: 0 0 auto; color: #aaa69c; font-size: 14px; }
.archive-month-list .time span + span { margin-left: 7px; }
.archive-empty { min-height: 240px; color: var(--yu-muted); }

.site-footer { margin-top: 60px; padding-bottom: 40px; }
.footer-menu { margin-bottom: 0; }
.footer-menu h3 { margin-top: 80px; }
.footer-menu .section-head { color: var(--yu-ink); }
.footer-menu ul { display: flex; flex-wrap: wrap; gap: 0 10px; margin: 0; padding: 0; list-style: none; }
.footer-menu a { color: #888; line-height: 25.5px; }
.site-info { margin-top: 60px; color: var(--yu-ink); font-size: 17px; line-height: 25.5px; }
.site-info p { margin: 3px 0; }
.site-mark { display: grid; place-items: center; width: 38px; height: 38px; margin-top: 60px; border: 1px solid #a49b8b; color: #777269; font: 700 19px/1 "Songti SC", STSong, serif; transform: rotate(-1.5deg); }
.empty-state { min-height: 260px; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.site-tools {
  position: fixed; z-index: 1200;
  right: max(20px, calc(50% - 740px));
  bottom: max(72px, env(safe-area-inset-bottom));
  display: grid; gap: 8px;
}
.site-tool {
  display: grid; place-items: center; width: 40px; height: 40px; padding: 0;
  border: 1px solid #d4cec1; border-radius: 0; background: rgba(250, 248, 241, .9);
  color: #777269; font: 500 17px/1 Georgia, "Songti SC", serif; text-decoration: none;
  box-shadow: 0 6px 18px rgba(50, 44, 33, .05); cursor: pointer;
  backdrop-filter: blur(10px); transition: color .16s ease, border-color .16s ease, background .16s ease, opacity .18s ease, transform .18s ease;
}
.site-tool:hover { border-color: #aaa293; color: var(--yu-ink); text-decoration: none; transform: translateY(-1px); }
.global-back-top { opacity: 0; visibility: hidden; transform: translateY(7px); pointer-events: none; }
.global-back-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto; }

html[data-theme="dark"] {
  color-scheme: dark;
  --yu-paper: #171715;
  --yu-ink: #e7e3d9;
  --yu-muted: #9b978f;
  --yu-line: #34322e;
}
html[data-theme="dark"] ::selection { background: #554d40; }
html[data-theme="dark"] .site-nav,
html[data-theme="dark"] .footer-menu a,
html[data-theme="dark"] .section-head,
html[data-theme="dark"] .related-posts .cat { color: #aaa69d; }
html[data-theme="dark"] .entry-hero-meta,
html[data-theme="dark"] .post-meta,
html[data-theme="dark"] .archive-month-list .time,
html[data-theme="dark"] .archives summary small,
html[data-theme="dark"] .archives summary::after { color: #89867f; }
html[data-theme="dark"] .post-meta a { color: #c1bcb1; }
html[data-theme="dark"] .post-card,
html[data-theme="dark"] .section-head { border-color: #302e2a; }
html[data-theme="dark"] .sticky-reader { border-color: rgba(214, 205, 190, .14); background: rgba(23, 23, 21, .96); box-shadow: 0 8px 28px rgba(0, 0, 0, .24); }
html[data-theme="dark"] .entry-content blockquote { border-color: #6e685d; color: #c0bbb0; }
html[data-theme="dark"] .entry-content pre { background: #22211e; }
html[data-theme="dark"] .creation-background { color: #bcb6aa; }
html[data-theme="dark"] .comment-body { border-color: #3f3c36; }
html[data-theme="dark"] .comment-form input:not([type=submit]),
html[data-theme="dark"] .comment-form textarea,
html[data-theme="dark"] .search-field { border-color: #5b574f; color: var(--yu-ink); }
html[data-theme="dark"] .search-panel { border-color: #403d37; background: rgba(42, 40, 35, .62); }
html[data-theme="dark"] .search-result-excerpt { color: #c6c1b7; }
html[data-theme="dark"] .search-suggestions a { border-color: #514d45; color: #b8b2a7; }
html[data-theme="dark"] .archive-month-list li { border-color: rgba(74, 70, 63, .7); }
html[data-theme="dark"] .site-mark { border-color: #625d54; color: #aaa399; }
html[data-theme="dark"] .site-tool { border-color: #4a463f; background: rgba(28, 27, 24, .9); color: #aaa399; box-shadow: 0 7px 20px rgba(0, 0, 0, .24); }
html[data-theme="dark"] .site-tool:hover { border-color: #777064; color: var(--yu-ink); }

@media (max-width: 700px) {
  body { padding: 20px; }
  .site-nav { gap: 0; white-space: nowrap; }
  .nav-group > * + *, .menu-inline li + li { margin-left: 26px; }
  .nav-group > * + *::before, .menu-inline li + li::before { left: -13px; }
  .nav-secondary > * + *, .nav-secondary .menu-inline li + li { margin-left: 0; }
  .post-gallery { gap: 7px; }
  .post-wrap { display: block; }
  .post-wrap .post-text, .post-wrap .post-cover { width: auto; }
  .post-wrap .post-cover { margin-top: 18px; }
  .post-wrap .post-cover img { width: 100%; }
  .post-navigation { gap: 24px; }
  .sticky-reader { padding-left: 20px; padding-right: 20px; }
  .sticky-reader .nav-secondary { display: none; }
  .sticky-reader .hero-identity { gap: 8px; }
  .sticky-reader .site-description, .sticky-reader .entry-hero-meta { display: none; }
  .search-panel { padding: 24px 22px 26px; }
  .search-result { grid-template-columns: 34px 1fr; gap: 0 12px; }
  .search-result-meta { grid-column: 2; padding-top: 12px; }
  .comment-list .children { margin-left: 18px; }
  .comment-body { padding: 20px 0 19px; }
  .site-tools { right: max(14px, env(safe-area-inset-right)); bottom: max(24px, env(safe-area-inset-bottom)); }
}

@media screen and (max-width: 782px) {
  .admin-bar .sticky-reader { top: 46px; }
}

@media screen and (max-width: 600px) {
  .admin-bar .sticky-reader { top: 0; }
}

@media (max-width: 430px) {
  body { font-size: 17px; }
  .site-nav { font-size: 17px; }
  .site-title, .entry-hero-title { font-size: 26px; }
  .post-card-title { font-size: 22px; }
  .post-gallery { gap: 0; margin-left: -4px; margin-right: -4px; }
  .post-gallery a { padding: 4px; }
  .search-form { align-items: stretch; gap: 10px; }
  .search-submit { padding-left: 15px; padding-right: 15px; }
  .archive-month-list a { display: block; }
  .archive-month-list .time { margin-top: 4px; }
  .site-tool { width: 38px; height: 38px; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
