/*
Theme Name: 墨行
Theme URI: https://ann.hi.cn
Author: 团子
Description: 墨行 · 克制的文字与留白。暖纸底色、宋体标题、衬线阅读体验，支持深色模式。
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: moxing
*/

/* ================= 0. Tokens ================= */
:root {
  --bg:          #fbf9f6;
  --bg-soft:     #f4f1ec;
  --surface:     #ffffff;
  --text:        #23201d;
  --text-soft:   #5f584f;
  --text-faint:  #948b80;
  --line:        #e5e0d8;
  --accent:      #b4532a;
  --accent-soft: #f0e2da;
  --shadow:      0 1px 2px rgba(35,32,29,.04), 0 8px 24px rgba(35,32,29,.05);
  --shadow-lg:   0 2px 4px rgba(35,32,29,.05), 0 18px 48px rgba(35,32,29,.09);
  --radius:      14px;
  --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Helvetica Neue", sans-serif;
  --mono: "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;
}
[data-theme="dark"] {
  --bg:          #161513;
  --bg-soft:     #1e1c1a;
  --surface:     #211f1d;
  --text:        #ece7e0;
  --text-soft:   #a8a099;
  --text-faint:  #6f675f;
  --line:        #2f2c29;
  --accent:      #d98057;
  --accent-soft: #33241d;
  --shadow:      0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  --shadow-lg:   0 2px 4px rgba(0,0,0,.35), 0 18px 48px rgba(0,0,0,.4);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  transition: background .35s ease, color .35s ease;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
p { margin: 0; }
h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 700; }
button, input, textarea { font: inherit; }
.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link:focus {
  position: fixed; top: 10px; left: 10px; z-index: 999;
  width: auto; height: auto; clip: auto; padding: 10px 16px;
  background: var(--accent); color: #fff; border-radius: 8px;
}

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 28px; }
.entry-content > *:first-child { margin-top: 0; }
.entry-content > *:last-child { margin-bottom: 0; }

/* ================= 1. Header ================= */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(251,249,246,.86);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
  transition: background .35s ease, border-color .35s ease;
}
[data-theme="dark"] .site-header { background: rgba(22,21,19,.86); }
.nav { display: flex; align-items: center; gap: 32px; height: 68px; }
.brand {
  font-family: var(--serif); font-size: 21px; font-weight: 700;
  letter-spacing: .05em; white-space: nowrap; color: var(--text);
}
.brand span { color: var(--accent); }
.brand img { height: 30px; width: auto; }

.nav-menu { display: flex; gap: 26px; margin-left: 6px; font-size: 14.5px; color: var(--text-soft); }
.nav-menu li { position: relative; }
.nav-menu a {
  display: block; position: relative; padding: 4px 0; transition: color .2s ease;
}
.nav-menu a::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 0; height: 1.5px;
  background: var(--accent); transition: width .25s ease;
}
.nav-menu a:hover { color: var(--text); }
.nav-menu a:hover::after,
.nav-menu li.current-menu-item > a::after,
.nav-menu li.current_page_item > a::after,
.nav-menu li.current-cat > a::after { width: 100%; }
.nav-menu li.current-menu-item > a,
.nav-menu li.current_page_item > a,
.nav-menu li.current-cat > a { color: var(--text); }
.nav-menu .sub-menu {
  position: absolute; top: 100%; left: -14px; min-width: 150px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow-lg);
  padding: 8px 0; opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: all .2s ease; z-index: 20;
}
.nav-menu li:hover > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.nav-menu .sub-menu a { padding: 8px 16px; font-size: 14px; }
.nav-menu .sub-menu a::after { display: none; }

.nav-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.menu-btn { display: none; }
.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%;
  background: var(--surface); color: var(--text-soft); cursor: pointer;
  transition: all .2s ease; padding: 0;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-1px); }
.icon-btn svg { width: 17px; height: 17px; }

.search-panel {
  display: none; border-bottom: 1px solid var(--line); background: var(--bg-soft);
  padding: 16px 0;
}
.search-panel.open { display: block; }
.search-form { display: flex; gap: 10px; max-width: 560px; }
.search-form input[type="search"] {
  flex: 1; padding: 11px 14px; font-size: 15px; color: var(--text);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 9px; outline: none; transition: border-color .2s;
}
.search-form input[type="search"]:focus { border-color: var(--accent); }
.search-form button {
  padding: 11px 20px; font-size: 14.5px; font-weight: 500; color: #fff;
  background: var(--accent); border: none; border-radius: 9px; cursor: pointer;
  transition: filter .2s, transform .2s;
}
.search-form button:hover { filter: brightness(1.08); transform: translateY(-1px); }

/* ================= 2. Hero ================= */
.hero { padding: 72px 0 56px; }
.hero-inner { max-width: 720px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft);
  padding: 6px 14px; border-radius: 999px; margin-bottom: 22px;
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%     { opacity: .45; transform: scale(.85); }
}
.hero h1 {
  font-family: var(--serif); font-size: clamp(36px, 5.2vw, 58px);
  line-height: 1.24; letter-spacing: -.01em; margin-bottom: 20px;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { font-size: 17px; color: var(--text-soft); line-height: 1.85; max-width: 620px; }
.hero-meta { display: flex; gap: 36px; margin-top: 34px; flex-wrap: wrap; }
.stat b { display: block; font-family: var(--serif); font-size: 28px; line-height: 1.1; font-weight: 700; }
.stat span { font-size: 13px; color: var(--text-faint); letter-spacing: .04em; }

/* ================= 3. Featured ================= */
.featured { padding: 48px 0 6px; }
.featured-card {
  display: grid; grid-template-columns: 1.15fr 1fr;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  transition: box-shadow .3s ease, transform .3s ease;
}
.featured-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.featured-art {
  min-height: 330px; position: relative;
  background:
    radial-gradient(120% 100% at 15% 15%, #d98057 0%, transparent 55%),
    radial-gradient(90% 90% at 85% 80%, #7c6a8a 0%, transparent 60%),
    linear-gradient(135deg, #b4532a 0%, #6b3f5e 100%);
  background-size: cover; background-position: center;
}
.featured-art::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.10) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.10) 1px, transparent 1px);
  background-size: 34px 34px; opacity: .55;
}
.featured-body { padding: 42px 40px; display: flex; flex-direction: column; justify-content: center; }
.tag {
  display: inline-block; width: fit-content; font-size: 12px; letter-spacing: .1em;
  color: var(--accent); background: var(--accent-soft);
  padding: 4px 11px; border-radius: 6px;
}
.featured-body h2 {
  font-family: var(--serif); font-size: 29px; line-height: 1.4; margin: 18px 0 14px;
}
.featured-body h2 a { transition: color .2s; }
.featured-body h2 a:hover { color: var(--accent); }
.excerpt { color: var(--text-soft); font-size: 15.5px; }
.featured-body .excerpt { margin-bottom: 22px; }
.byline { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--text-faint); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #d98057, #7c6a8a);
  display: grid; place-items: center; color: #fff; font-size: 12.5px; font-weight: 600;
}

/* ================= 4. Section head ================= */
.sec-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 20px;
  padding: 52px 0 22px; border-bottom: 1px solid var(--line);
}
.sec-head h2 { font-family: var(--serif); font-size: 24px; }
.sec-head .more {
  font-size: 14px; color: var(--text-soft); display: inline-flex; align-items: center;
  gap: 6px; transition: color .2s, gap .2s; white-space: nowrap;
}
.sec-head .more:hover { color: var(--accent); gap: 10px; }

/* ================= 5. Layout ================= */
.layout { display: grid; grid-template-columns: 1fr 320px; gap: 56px; padding-bottom: 86px; }

/* ================= 6. Post list ================= */
.posts { min-width: 0; }
.post {
  display: grid; grid-template-columns: 132px 1fr; gap: 26px;
  padding: 30px 0; border-bottom: 1px solid var(--line); align-items: start;
}
.post:last-child { border-bottom: none; }
.post-thumb {
  width: 132px; height: 96px; border-radius: 10px; overflow: hidden;
  flex-shrink: 0; background: var(--bg-soft);
}
.post-thumb svg, .post-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-body { min-width: 0; }
.post-body h3 { font-family: var(--serif); font-size: 20.5px; line-height: 1.5; margin-bottom: 8px; }
.post-body h3 a { transition: color .2s ease; }
.post-body h3 a:hover { color: var(--accent); }
.post-body .excerpt { font-size: 14.8px; margin-bottom: 14px; }
.post-meta {
  display: flex; align-items: center; gap: 12px;
  font-size: 13px; color: var(--text-faint); flex-wrap: wrap;
}
.post-meta .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--text-faint); opacity: .6; }
.post-meta .cat { color: var(--accent); }

/* ================= 7. Sidebar ================= */
.side { padding-top: 20px; min-width: 0; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 24px; margin-bottom: 26px; box-shadow: var(--shadow);
}
.card h4, .widget-title {
  font-family: var(--sans); font-size: 12.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--text-faint); margin-bottom: 18px; font-weight: 600;
}
.about-top { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.about-top .avatar { width: 48px; height: 48px; font-size: 16px; }
.about-top b { font-size: 16.5px; font-family: var(--serif); display: block; line-height: 1.3; }
.about-top span { font-size: 13px; color: var(--text-faint); }
.card p { font-size: 14.5px; color: var(--text-soft); }
.tags { display: flex; flex-wrap: wrap; gap: 9px; }
.tags a {
  font-size: 13px; color: var(--text-soft); border: 1px solid var(--line);
  padding: 5px 12px; border-radius: 999px; transition: all .2s ease;
}
.tags a:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.rank { counter-reset: r; }
.rank li {
  display: flex; gap: 13px; padding: 11px 0;
  border-bottom: 1px dashed var(--line); align-items: baseline;
}
.rank li:last-child { border-bottom: none; padding-bottom: 0; }
.rank li::before {
  counter-increment: r; content: counter(r);
  font-family: var(--serif); font-size: 17px; font-weight: 700;
  color: var(--accent); opacity: .55; min-width: 16px;
}
.rank a { font-size: 14.5px; line-height: 1.6; transition: color .2s; }
.rank a:hover { color: var(--accent); }
.sub-form { display: flex; flex-direction: column; gap: 10px; }
.sub-btn {
  display: block; text-align: center; padding: 11px 14px; font-size: 14.5px; font-weight: 500;
  color: #fff; background: var(--accent); border: none; border-radius: 9px;
  cursor: pointer; transition: filter .2s, transform .2s;
}
.sub-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.sub-note { font-size: 12.5px; color: var(--text-faint); margin-top: 4px; }
.widget { margin-bottom: 26px; }
.widget ul li { font-size: 14.5px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.widget ul li:last-child { border-bottom: none; }
.widget ul li a:hover { color: var(--accent); }

/* ================= 8. Single / Page ================= */
.article-wrap { padding: 56px 0 20px; }
.article-head { max-width: 760px; }
.article-head h1 {
  font-family: var(--serif); font-size: clamp(30px, 4vw, 42px); line-height: 1.35;
  margin: 16px 0 18px; letter-spacing: -.01em;
}
.article-meta { display: flex; align-items: center; gap: 12px; font-size: 13.5px; color: var(--text-faint); flex-wrap: wrap; }
.article-meta .cat { color: var(--accent); }
.article-cover { margin: 34px 0 0; border-radius: var(--radius); overflow: hidden; max-height: 460px; }
.article-cover img { width: 100%; height: 100%; object-fit: cover; }
.prose {
  max-width: 760px; font-size: 16.5px; line-height: 1.95; color: var(--text-soft);
}
.prose > * + * { margin-top: 1.15em; }
.prose h1, .prose h2, .prose h3, .prose h4 {
  font-family: var(--serif); color: var(--text); line-height: 1.45;
  margin-top: 1.8em; margin-bottom: .7em;
}
.prose h2 { font-size: 25px; }
.prose h3 { font-size: 21px; }
.prose h4 { font-size: 18px; }
.prose a { color: var(--accent); border-bottom: 1px solid var(--accent-soft); }
.prose a:hover { border-bottom-color: var(--accent); }
.prose strong { color: var(--text); font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.45em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li + li { margin-top: .4em; }
.prose blockquote, .prose .wp-block-quote {
  margin: 1.6em 0; padding: 18px 22px; border-left: 3px solid var(--accent);
  background: var(--bg-soft); border-radius: 0 10px 10px 0; color: var(--text-soft);
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose code {
  font-family: var(--mono); font-size: .9em; background: var(--bg-soft);
  border: 1px solid var(--line); border-radius: 5px; padding: 2px 6px; color: var(--accent);
}
.prose pre {
  background: #23201d; color: #efeae3; padding: 20px 22px; border-radius: 12px;
  overflow-x: auto; font-family: var(--mono); font-size: 14px; line-height: 1.7;
}
.prose pre code { background: none; border: none; padding: 0; color: inherit; }
.prose img { border-radius: 12px; margin: 1.4em 0; }
.prose figure { margin: 1.6em 0; }
.prose figcaption { font-size: 13px; color: var(--text-faint); text-align: center; margin-top: 10px; }
.prose hr { border: none; border-top: 1px solid var(--line); margin: 2.2em 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; }
.prose th { background: var(--bg-soft); color: var(--text); font-weight: 600; }
.prose .wp-block-button__link {
  display: inline-block; background: var(--accent); color: #fff; padding: 10px 20px;
  border-radius: 9px; border: none; font-size: 14.5px;
}
.article-foot { max-width: 760px; margin-top: 44px; padding-top: 26px; border-top: 1px solid var(--line); }
.article-foot .tags { margin-top: 14px; }
.post-nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
  max-width: 760px; margin: 40px 0 10px;
}
.post-nav a {
  display: block; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; background: var(--surface); transition: all .25s ease;
}
.post-nav a:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.post-nav .label { display: block; font-size: 12.5px; letter-spacing: .1em; color: var(--text-faint); margin-bottom: 8px; }
.post-nav b { font-family: var(--serif); font-size: 16px; line-height: 1.5; font-weight: 700; }
.post-nav .next { text-align: right; }

/* ================= 9. Comments ================= */
.comments-area { max-width: 760px; margin: 50px 0 10px; padding-top: 30px; border-top: 1px solid var(--line); }
.comments-title, .comment-reply-title { font-family: var(--serif); font-size: 21px; margin-bottom: 20px; }
.comment-list { margin: 0 0 30px; }
.comment-list li { margin-bottom: 18px; }
.comment-body { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.comment-meta { font-size: 13px; color: var(--text-faint); margin-bottom: 10px; }
.comment-meta cite { font-style: normal; color: var(--text); font-weight: 600; }
.comment-content { font-size: 15px; }
.comment-list .children { margin: 16px 0 0 26px; }
.comment-form label { display: block; font-size: 13.5px; color: var(--text-faint); margin-bottom: 6px; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
  width: 100%; padding: 11px 14px; font-size: 15px; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: 9px;
  outline: none; margin-bottom: 16px; transition: border-color .2s;
}
.comment-form input:focus, .comment-form textarea:focus { border-color: var(--accent); }
.comment-form .submit {
  padding: 11px 22px; font-size: 14.5px; font-weight: 500; color: #fff;
  background: var(--accent); border: none; border-radius: 9px; cursor: pointer;
}
.comment-form .submit:hover { filter: brightness(1.08); }

/* ================= 10. Pagination ================= */
.pagination { padding: 10px 0 78px; }
.pagination .nav-links { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pagination .page-numbers {
  display: inline-grid; place-items: center; min-width: 38px; height: 38px;
  padding: 0 12px; font-size: 14px; color: var(--text-soft);
  border: 1px solid var(--line); border-radius: 9px; background: var(--surface);
  transition: all .2s ease;
}
.pagination .page-numbers:hover { color: var(--accent); border-color: var(--accent); }
.pagination .page-numbers.current { background: var(--accent); border-color: var(--accent); color: #fff; }
.pagination .dots { border: none; background: none; }

/* ================= 11. Footer ================= */
.site-footer {
  border-top: 1px solid var(--line); background: var(--bg-soft);
  padding: 52px 0 40px; transition: background .35s ease;
}
.foot-grid { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; margin-bottom: 34px; }
.foot-brand { max-width: 300px; }
.foot-brand p { font-size: 14.5px; color: var(--text-soft); margin-top: 10px; }
.foot-col h5 {
  font-size: 13px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-faint); margin-bottom: 14px; font-weight: 600;
}
.foot-col li { margin-bottom: 9px; }
.foot-col a { font-size: 14.5px; color: var(--text-soft); transition: color .2s; }
.foot-col a:hover { color: var(--accent); }
.foot-bottom {
  border-top: 1px solid var(--line); padding-top: 24px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 13.5px; color: var(--text-faint);
}

/* ================= 12. Reveal / empty ================= */
.arc { margin-bottom: 20px; }.arc li {
  display: flex; gap: 14px; align-items: baseline;
  padding: 11px 0; border-bottom: 1px solid var(--line);
}
.arc li .date { font-size: 13px; color: var(--text-faint); min-width: 46px; font-variant-numeric: tabular-nums; }
.arc li a { font-size: 16px; line-height: 1.6; transition: color .2s; }
.arc li a:hover { color: var(--accent); }
.reveal {
  transition: opacity .7s cubic-bezier(.2,.7,.3,1), transform .7s cubic-bezier(.2,.7,.3,1);
}
.js .reveal {
  opacity: 0; transform: translateY(18px);
}
.js .reveal.in { opacity: 1; transform: none; }
.no-posts { padding: 60px 0; color: var(--text-faint); font-size: 15.5px; }
.page-head { padding: 46px 0 8px; }
.page-head h1 { font-family: var(--serif); font-size: clamp(26px, 3.4vw, 36px); }
.page-head p { color: var(--text-soft); font-size: 15px; margin-top: 10px; }

/* ================= 13. Responsive ================= */
@media (max-width: 940px) {
  .layout { grid-template-columns: 1fr; gap: 0; }
  .side { padding-top: 12px; }
  .featured-card { grid-template-columns: 1fr; }
  .featured-art { min-height: 210px; }
  .featured-body { padding: 32px 26px; }
}
@media (max-width: 680px) {
  .wrap { padding: 0 20px; }
  .nav { position: relative; }
  .menu-btn { display: grid; }
  .nav-menu {
    display: none; position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; gap: 0; margin: 0; padding: 8px 20px 16px;
    background: var(--surface); border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-lg); z-index: 60;
  }
  .nav-menu.open { display: flex; }
  .nav-menu a { padding: 11px 0; }
  .nav-menu a::after { display: none; }
  .nav-menu .sub-menu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: none; padding-left: 14px; }
  .hero { padding: 46px 0 38px; }
  .post { grid-template-columns: 1fr; gap: 16px; }
  .post-thumb { width: 100%; height: 170px; }
  .hero-meta { gap: 26px; }
  .sec-head { padding-top: 40px; }
  .featured-body h2 { font-size: 24px; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav .next { text-align: left; }
  .article-wrap { padding-top: 38px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .reveal, .js .reveal { opacity: 1 !important; transform: none !important; }
}
